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:
parent
92a7197599
commit
1d749413cd
@ -484,7 +484,7 @@ input.readonly {
|
|||||||
border-top-color: #247fab;
|
border-top-color: #247fab;
|
||||||
}
|
}
|
||||||
|
|
||||||
#user_info, .login #backtoblog a {
|
#user_info, .login #backtoblog a, .curtime {
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -675,3 +675,7 @@ div#media-upload-error, .file-error, abbr.required, .widget-control-remove:hover
|
|||||||
#poststuff #titlewrap {
|
#poststuff #titlewrap {
|
||||||
border-color: #ccc;
|
border-color: #ccc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.curtime {
|
||||||
|
color: #666;
|
||||||
|
}
|
@ -120,3 +120,7 @@ textarea, input, select {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
padding-bottom: 7px;
|
padding-bottom: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#timestampdiv {
|
||||||
|
display: none;
|
||||||
|
}
|
@ -112,7 +112,7 @@ if ($post_ID) {
|
|||||||
if ( 'future' == $post->post_status ) {
|
if ( 'future' == $post->post_status ) {
|
||||||
$stamp = __('Scheduled for:<br />%1$s at %2$s');
|
$stamp = __('Scheduled for:<br />%1$s at %2$s');
|
||||||
} else if ( 'publish' == $post->post_status ) {
|
} else if ( 'publish' == $post->post_status ) {
|
||||||
$stamp = __('Published on:<br />%1$s at %2$s');
|
$stamp = __('%1$s at %2$s');
|
||||||
} else {
|
} else {
|
||||||
$stamp = __('Saved on:<br />%1$s at %2$s');
|
$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);
|
$date = mysql2date(get_option('date_format'), $post->post_date);
|
||||||
$time = mysql2date(get_option('time_format'), $post->post_date);
|
$time = mysql2date(get_option('time_format'), $post->post_date);
|
||||||
} else {
|
} else {
|
||||||
$stamp = __('Timestamp:<br />%1$s at %2$s');
|
$stamp = __('%1$s at %2$s');
|
||||||
$date = mysql2date(get_option('date_format'), current_time('mysql'));
|
$date = mysql2date(get_option('date_format'), current_time('mysql'));
|
||||||
$time = mysql2date(get_option('time_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); ?>
|
||||||
<a href="#edit_timestamp" class="edit-timestamp"><?php _e('Edit') ?></a></p>
|
<a href="#edit_timestamp" class="edit-timestamp"><?php _e('Edit') ?></a></p>
|
||||||
|
|
||||||
<div id='timestampdiv'><?php touch_time(($action == 'edit')); ?></div>
|
<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">
|
<div id="titlediv">
|
||||||
<h3><?php _e('Title') ?></h3>
|
<h3><?php _e('Title') ?></h3>
|
||||||
<div id="titlewrap">
|
<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>
|
||||||
<div class="inside">
|
<div class="inside">
|
||||||
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
|
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
|
||||||
|
@ -39,11 +39,11 @@ addLoadEvent(focusit);
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$stamp = __('Timestamp:<br />%1$s at %2$s');
|
$stamp = __('%1$s at %2$s');
|
||||||
$date = mysql2date(get_option('date_format'), $comment->comment_date);
|
$date = mysql2date(get_option('date_format'), $comment->comment_date);
|
||||||
$time = mysql2date(get_option('time_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); ?>
|
||||||
<a href="#edit_timestamp" class="edit-timestamp"><?php _e('Edit') ?></a></p>
|
<a href="#edit_timestamp" class="edit-timestamp"><?php _e('Edit') ?></a></p>
|
||||||
|
|
||||||
<div id='timestampdiv'><?php touch_time(('editcomment' == $action), 0, 5); ?></div>
|
<div id='timestampdiv'><?php touch_time(('editcomment' == $action), 0, 5); ?></div>
|
||||||
|
@ -90,7 +90,7 @@ if ($post_ID) {
|
|||||||
if ( 'future' == $post->post_status ) {
|
if ( 'future' == $post->post_status ) {
|
||||||
$stamp = __('Scheduled for:<br />%1$s at %2$s');
|
$stamp = __('Scheduled for:<br />%1$s at %2$s');
|
||||||
} else if ( 'publish' == $post->post_status ) {
|
} else if ( 'publish' == $post->post_status ) {
|
||||||
$stamp = __('Published on:<br />%1$s at %2$s');
|
$stamp = __('%1$s at %2$s');
|
||||||
} else {
|
} else {
|
||||||
$stamp = __('Saved on:<br />%1$s at %2$s');
|
$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);
|
$date = mysql2date(get_option('date_format'), $post->post_date);
|
||||||
$time = mysql2date(get_option('time_format'), $post->post_date);
|
$time = mysql2date(get_option('time_format'), $post->post_date);
|
||||||
} else {
|
} else {
|
||||||
$stamp = __('Timestamp:<br />%1$s at %2$s');
|
$stamp = __('%1$s at %2$s');
|
||||||
$date = mysql2date(get_option('date_format'), current_time('mysql'));
|
$date = mysql2date(get_option('date_format'), current_time('mysql'));
|
||||||
$time = mysql2date(get_option('time_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); ?>
|
||||||
<a href="#edit_timestamp" class="edit-timestamp"><?php _e('Edit') ?></a></p>
|
<a href="#edit_timestamp" class="edit-timestamp"><?php _e('Edit') ?></a></p>
|
||||||
|
|
||||||
<div id='timestampdiv'><?php touch_time(($action == 'edit')); ?></div>
|
<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">
|
<div id="titlediv">
|
||||||
<h3><?php _e('Title') ?></h3>
|
<h3><?php _e('Title') ?></h3>
|
||||||
<div id="titlewrap">
|
<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>
|
||||||
<div class="inside">
|
<div class="inside">
|
||||||
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
|
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
|
||||||
|
BIN
wp-admin/images/date-button.gif
Normal file
BIN
wp-admin/images/date-button.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 111 B |
@ -805,7 +805,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0 ) {
|
|||||||
if ( (int) $tab_index > 0 )
|
if ( (int) $tab_index > 0 )
|
||||||
$tab_index_attribute = " tabindex=\"$tab_index\"";
|
$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 );
|
$time_adj = time() + (get_option( 'gmt_offset' ) * 3600 );
|
||||||
$post_date = ($for_post) ? $post->post_date : $comment->comment_date;
|
$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>';
|
$month .= '</select>';
|
||||||
|
|
||||||
$day = '<input type="text" id="jj" name="jj" value="' . $jj . '" 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 . ' />';
|
$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 . ' />';
|
$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 . ' />';
|
$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);
|
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" />
|
<input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" onchange="edit_date.checked=true" />
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
addLoadEvent( function() {
|
addLoadEvent( function() {
|
||||||
add_postbox_toggles('comment');
|
add_postbox_toggles('comment');
|
||||||
|
|
||||||
jQuery('#timestampdiv').css('display', 'none');
|
|
||||||
jQuery('.edit-timestamp').click(function () {
|
jQuery('.edit-timestamp').click(function () {
|
||||||
if (jQuery('#timestampdiv').is(":hidden")) {
|
if (jQuery('#timestampdiv').is(":hidden")) {
|
||||||
jQuery('#timestampdiv').slideDown("normal");
|
jQuery('#timestampdiv').slideDown("normal");
|
||||||
|
@ -5,7 +5,6 @@ addLoadEvent( function() {
|
|||||||
// hide advanced slug field
|
// hide advanced slug field
|
||||||
jQuery('#pageslugdiv').hide();
|
jQuery('#pageslugdiv').hide();
|
||||||
|
|
||||||
jQuery('#timestampdiv').css('display', 'none');
|
|
||||||
jQuery('.edit-timestamp').click(function () {
|
jQuery('.edit-timestamp').click(function () {
|
||||||
if (jQuery('#timestampdiv').is(":hidden")) {
|
if (jQuery('#timestampdiv').is(":hidden")) {
|
||||||
jQuery('#timestampdiv').slideDown("normal");
|
jQuery('#timestampdiv').slideDown("normal");
|
||||||
|
@ -146,7 +146,6 @@ addLoadEvent( function() {
|
|||||||
} );
|
} );
|
||||||
jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
|
jQuery('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change();
|
||||||
|
|
||||||
jQuery('#timestampdiv').css('display', 'none');
|
|
||||||
jQuery('.edit-timestamp').click(function () {
|
jQuery('.edit-timestamp').click(function () {
|
||||||
if (jQuery('#timestampdiv').is(":hidden")) {
|
if (jQuery('#timestampdiv').is(":hidden")) {
|
||||||
jQuery('#timestampdiv').slideDown("normal");
|
jQuery('#timestampdiv').slideDown("normal");
|
||||||
|
@ -1340,4 +1340,11 @@ ul.view-switch li.current {
|
|||||||
|
|
||||||
#templateside ul li a {
|
#templateside ul li a {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.curtime {
|
||||||
|
background-image: url(images/date-button.gif);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: left 2px;
|
||||||
|
padding-left: 18px;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user