Bring Edit Page screen up to parity with Edit Post screen WRT timestamps. see #6250

git-svn-id: https://develop.svn.wordpress.org/trunk@7341 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2008-03-17 03:26:53 +00:00
parent 8ebb2c3ca6
commit ecbc4d48f1
3 changed files with 20 additions and 10 deletions

View File

@ -76,21 +76,20 @@ else
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> /> <?php _e('Keep this page private') ?></label></p>
<?php
if ($post_ID) {
if ( 'future' == $post->post_status ) {
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
$stamp = __('Scheduled for:<br />%1$s at %2$s');
} else if ( 'publish' == $post->post_status ) {
$stamp = __('%1$s at %2$s');
} else {
$stamp = __('Saved on:<br />%1$s at %2$s');
} else if ( 'publish' == $post->post_status ) { // already published
$stamp = __('Published on:<br />%1$s at %2$s');
} else if ( '0000-00-00 00:00:00' == $post->post_date ) { // draft, 1 or more saves, no date specified
$stamp = __('Publish immediately');
} else { // draft, 1 or more saves, date specified
$stamp = __('Publish on:<br />%1$s at %2$s');
}
$date = mysql2date(get_option('date_format'), $post->post_date);
$time = mysql2date(get_option('time_format'), $post->post_date);
} else {
$stamp = __('%1$s at %2$s');
} else { // draft (no saves, and thus no date specified)
$stamp = __('Publish immediately');
$date = mysql2date(get_option('date_format'), current_time('mysql'));
$time = mysql2date(get_option('time_format'), current_time('mysql'));
}

View File

@ -8,8 +8,15 @@ jQuery(document).ready( function() {
jQuery('.edit-timestamp').click(function () {
if (jQuery('#timestampdiv').is(":hidden")) {
jQuery('#timestampdiv').slideDown("normal");
jQuery('.edit-timestamp').text(postL10n.cancel);
} else {
jQuery('#timestampdiv').hide();
jQuery('#mm').val(jQuery('#hidden_mm').val());
jQuery('#jj').val(jQuery('#hidden_jj').val());
jQuery('#aa').val(jQuery('#hidden_aa').val());
jQuery('#hh').val(jQuery('#hidden_hh').val());
jQuery('#mn').val(jQuery('#hidden_mn').val());
jQuery('.edit-timestamp').text(postL10n.edit);
}
return false;
});

View File

@ -151,6 +151,10 @@ class WP_Scripts {
'edit' => __('Edit'),
) );
$this->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'postbox'), '20080208' );
$this->localize( 'page', 'postL10n', array(
'cancel' => __('Cancel'),
'edit' => __('Edit'),
) );
$this->add( 'link', '/wp-admin/js/link.js', array('jquery-ui-tabs', 'wp-lists', 'postbox'), '20080131' );
$this->add( 'comment', '/wp-admin/js/comment.js', array('postbox'), '20080219' );
$this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080109' );