Date display and editing tweaks.

git-svn-id: https://develop.svn.wordpress.org/trunk@7285 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2008-03-14 08:17:59 +00:00
parent 92a7197599
commit 1d749413cd
11 changed files with 31 additions and 19 deletions

View File

@ -484,7 +484,7 @@ input.readonly {
border-top-color: #247fab;
}
#user_info, .login #backtoblog a {
#user_info, .login #backtoblog a, .curtime {
color: #ccc;
}
@ -675,3 +675,7 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
#poststuff #titlewrap {
border-color: #ccc;
}
.curtime {
color: #666;
}

View File

@ -120,3 +120,7 @@ textarea, input, select {
padding: 0;
padding-bottom: 7px;
}
#timestampdiv {
display: none;
}

View File

@ -112,7 +112,7 @@ if ($post_ID) {
if ( 'future' == $post->post_status ) {
$stamp = __('Scheduled for:<br />%1$s at %2$s');
} else if ( 'publish' == $post->post_status ) {
$stamp = __('Published on:<br />%1$s at %2$s');
$stamp = __('%1$s at %2$s');
} else {
$stamp = __('Saved on:<br />%1$s at %2$s');
}
@ -120,12 +120,12 @@ if ($post_ID) {
$date = mysql2date(get_option('date_format'), $post->post_date);
$time = mysql2date(get_option('time_format'), $post->post_date);
} else {
$stamp = __('Timestamp:<br />%1$s at %2$s');
$stamp = __('%1$s at %2$s');
$date = mysql2date(get_option('date_format'), current_time('mysql'));
$time = mysql2date(get_option('time_format'), current_time('mysql'));
}
?>
<p><?php printf($stamp, $date, $time); ?>
<p class="curtime"><?php printf($stamp, $date, $time); ?>
&nbsp;<a href="#edit_timestamp" class="edit-timestamp"><?php _e('Edit') ?></a></p>
<div id='timestampdiv'><?php touch_time(($action == 'edit')); ?></div>
@ -177,7 +177,7 @@ if ( ( 'edit' == $action) && current_user_can('delete_post', $post_ID) )
<div id="titlediv">
<h3><?php _e('Title') ?></h3>
<div id="titlewrap">
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" />
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" autocomplete="off" />
</div>
<div class="inside">
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>

View File

@ -39,11 +39,11 @@ addLoadEvent(focusit);
</p>
<?php
$stamp = __('Timestamp:<br />%1$s at %2$s');
$stamp = __('%1$s at %2$s');
$date = mysql2date(get_option('date_format'), $comment->comment_date);
$time = mysql2date(get_option('time_format'), $comment->comment_date);
?>
<p><?php printf($stamp, $date, $time); ?>
<p class="curtime"><?php printf($stamp, $date, $time); ?>
&nbsp;<a href="#edit_timestamp" class="edit-timestamp"><?php _e('Edit') ?></a></p>
<div id='timestampdiv'><?php touch_time(('editcomment' == $action), 0, 5); ?></div>

View File

@ -90,7 +90,7 @@ if ($post_ID) {
if ( 'future' == $post->post_status ) {
$stamp = __('Scheduled for:<br />%1$s at %2$s');
} else if ( 'publish' == $post->post_status ) {
$stamp = __('Published on:<br />%1$s at %2$s');
$stamp = __('%1$s at %2$s');
} else {
$stamp = __('Saved on:<br />%1$s at %2$s');
}
@ -98,12 +98,12 @@ if ($post_ID) {
$date = mysql2date(get_option('date_format'), $post->post_date);
$time = mysql2date(get_option('time_format'), $post->post_date);
} else {
$stamp = __('Timestamp:<br />%1$s at %2$s');
$stamp = __('%1$s at %2$s');
$date = mysql2date(get_option('date_format'), current_time('mysql'));
$time = mysql2date(get_option('time_format'), current_time('mysql'));
}
?>
<p><?php printf($stamp, $date, $time); ?>
<p class="curtime"><?php printf($stamp, $date, $time); ?>
&nbsp;<a href="#edit_timestamp" class="edit-timestamp"><?php _e('Edit') ?></a></p>
<div id='timestampdiv'><?php touch_time(($action == 'edit')); ?></div>
@ -152,7 +152,7 @@ if ( ('edit' == $action) && current_user_can('delete_page', $post_ID) )
<div id="titlediv">
<h3><?php _e('Title') ?></h3>
<div id="titlewrap">
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" />
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" autocomplete="off" />
</div>
<div class="inside">
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

View File

@ -805,7 +805,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0 ) {
if ( (int) $tab_index > 0 )
$tab_index_attribute = " tabindex=\"$tab_index\"";
echo '<input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label>';
echo '<label for="timestamp" style="display: block;"><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> '.__( 'Edit timestamp' ).'</label><br />';
$time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
$post_date = ($for_post) ? $post->post_date : $comment->comment_date;
@ -825,10 +825,10 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0 ) {
}
$month .= '</select>';
$day = '<input type="text" id="jj" name="jj" value="' . $jj . '" size="2" maxlength="2" onchange="edit_date.checked=true"' . $tab_index_attribute . ' />';
$year = '<input type="text" id="aa" name="aa" value="' . $aa . '" size="4" maxlength="5" onchange="edit_date.checked=true"' . $tab_index_attribute . ' />';
$hour = '<input type="text" id="hh" name="hh" value="' . $hh . '" size="2" maxlength="2" onchange="edit_date.checked=true"' . $tab_index_attribute . ' />';
$minute = '<input type="text" id="mn" name="mn" value="' . $mn . '" size="2" maxlength="2" onchange="edit_date.checked=true"' . $tab_index_attribute . ' />';
$day = '<input type="text" id="jj" name="jj" value="' . $jj . '" size="2" maxlength="2" onchange="edit_date.checked=true"' . $tab_index_attribute . ' autocomplete="off" />';
$year = '<input type="text" id="aa" name="aa" value="' . $aa . '" size="4" maxlength="5" onchange="edit_date.checked=true"' . $tab_index_attribute . ' autocomplete="off" />';
$hour = '<input type="text" id="hh" name="hh" value="' . $hh . '" size="2" maxlength="2" onchange="edit_date.checked=true"' . $tab_index_attribute . ' autocomplete="off" />';
$minute = '<input type="text" id="mn" name="mn" value="' . $mn . '" size="2" maxlength="2" onchange="edit_date.checked=true"' . $tab_index_attribute . ' autocomplete="off" />';
printf(__('%1$s%2$s%3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute);
?>
<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />

View File

@ -1,7 +1,6 @@
addLoadEvent( function() {
add_postbox_toggles('comment');
jQuery('#timestampdiv').css('display', 'none');
jQuery('.edit-timestamp').click(function () {
if (jQuery('#timestampdiv').is(":hidden")) {
jQuery('#timestampdiv').slideDown("normal");

View File

@ -5,7 +5,6 @@ addLoadEvent( function() {
// hide advanced slug field
jQuery('#pageslugdiv').hide();
jQuery('#timestampdiv').css('display', 'none');
jQuery('.edit-timestamp').click(function () {
if (jQuery('#timestampdiv').is(":hidden")) {
jQuery('#timestampdiv').slideDown("normal");

View File

@ -146,7 +146,6 @@ addLoadEvent( function() {
} );
jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
jQuery('#timestampdiv').css('display', 'none');
jQuery('.edit-timestamp').click(function () {
if (jQuery('#timestampdiv').is(":hidden")) {
jQuery('#timestampdiv').slideDown("normal");

View File

@ -1341,3 +1341,10 @@ ul.view-switch li.current {
#templateside ul li a {
text-decoration: none;
}
.curtime {
background-image: url(images/date-button.gif);
background-repeat: no-repeat;
background-position: left 2px;
padding-left: 18px;
}