- function updateText() {
- var attemptedDate, originalDate, currentDate, publishOn;
-
- attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val());
- originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val());
- currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val());
- if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) {
- publishOn = postL10n.publishOnFuture;
- $('#publish').val( postL10n.schedule );
- } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
- publishOn = postL10n.publishOn;
- $('#publish').val( postL10n.publish );
- } else {
- publishOn = postL10n.publishOnPast;
- $('#publish').val( postL10n.update );
- }
- if ( originalDate.toUTCString() == attemptedDate.toUTCString() ) { //hack
- $('#timestamp').html(stamp);
- } else {
- $('#timestamp').html(
- publishOn + ' <b>' +
- $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' +
- $('#jj').val() + ', ' +
- $('#aa').val() + ' @ ' +
- $('#hh').val() + ':' +
- $('#mn').val() + '</b> '
- );
+ // submitdiv
+ if ( $('#submitdiv').length ) {
+ stamp = $('#timestamp').html();
+ visibility = $('#post-visibility-display').html();
+
+ function updateVisibility() {
+ var pvSelect = $('#post-visibility-select');
+ if ( $('input:radio:checked', pvSelect).val() != 'public' ) {
+ $('#sticky').prop('checked', false);
+ $('#sticky-span').hide();
+ } else {
+ $('#sticky-span').show();
+ }
+ if ( $('input:radio:checked', pvSelect).val() != 'password' ) {
+ $('#password-span').hide();
+ } else {
+ $('#password-span').show();
+ }