Better handling of text for submit button on already scheduled pages/posts

git-svn-id: http://svn.automattic.com/wordpress/trunk@9678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-11-14 08:39:39 +00:00
parent f1c1aa6ced
commit 47a445d1f2
2 changed files with 4 additions and 4 deletions

View File

@ -32,10 +32,10 @@ jQuery(document).ready( function($) {
var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val()); var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val());
var originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val()); var originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val());
var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val()); var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val());
if ( attemptedDate > currentDate ) { if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) {
var publishOn = postL10n.publishOnFuture; var publishOn = postL10n.publishOnFuture;
$('#publish').val( postL10n.schedule ); $('#publish').val( postL10n.schedule );
} else if ( $('#original_post_status').val() != 'publish' ) { } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
var publishOn = postL10n.publishOn; var publishOn = postL10n.publishOn;
$('#publish').val( postL10n.publish ); $('#publish').val( postL10n.publish );
} else { } else {

View File

@ -219,10 +219,10 @@ jQuery(document).ready( function($) {
var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val()); var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val());
var originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val()); var originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val());
var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val()); var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val());
if ( attemptedDate > currentDate ) { if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) {
var publishOn = postL10n.publishOnFuture; var publishOn = postL10n.publishOnFuture;
$('#publish').val( postL10n.schedule ); $('#publish').val( postL10n.schedule );
} else if ( $('#original_post_status').val() != 'publish' ) { } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
var publishOn = postL10n.publishOn; var publishOn = postL10n.publishOn;
$('#publish').val( postL10n.publish ); $('#publish').val( postL10n.publish );
} else { } else {