From c9a085eac6f302047015a54d130ce8d0e78eed74 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 17 Sep 2008 00:50:34 +0000 Subject: [PATCH] Update for the Save box in edit comment form. git-svn-id: https://develop.svn.wordpress.org/trunk@8913 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/edit-form-comment.php | 60 ++++++++++++++++++++++++++-------- wp-admin/js/comment.js | 55 +++++++++++++++++-------------- wp-admin/wp-admin.css | 3 +- 3 files changed, 79 insertions(+), 39 deletions(-) diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index fe46410cd3..c0faf6612b 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -20,16 +20,13 @@ $form_extra = "' />\n -
@@ -38,39 +35,74 @@ function comment_submit_meta_box($comment) {

+
+comment_ID&_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . ""; ?> +
+ comment_date); $time = mysql2date(get_option('time_format'), $comment->comment_date); ?> -

- -
+
+

-comment_ID&_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . ""; -?> +

+
+

Save

- +
+
+

+ +
+ +
+comment_ID&_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . ""; ?> +
+ +comment_date); +$time = mysql2date(get_option('time_format'), $comment->comment_date); +?> +
  +
+ +
+ +

+ + +

+
+ +
diff --git a/wp-admin/js/comment.js b/wp-admin/js/comment.js index b54f57ce24..936e19779b 100644 --- a/wp-admin/js/comment.js +++ b/wp-admin/js/comment.js @@ -1,4 +1,4 @@ -jQuery(document).ready( function() { +jQuery(document).ready( function($) { postboxes.add_postbox_toggles('comment'); // close postboxes that should be closed @@ -8,33 +8,40 @@ jQuery(document).ready( function() { jQuery('.hide-if-no-js').show(); jQuery('.hide-if-js').hide(); - jQuery('.edit-timestamp').click(function () { - if (jQuery('#timestampdiv').is(":hidden")) { - jQuery('#curtime').slideUp("normal"); - jQuery('#timestampdiv').slideDown("normal"); - } else { - jQuery('#timestampdiv').slideUp("normal"); - 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('#curtime').slideDown("normal"); + var stamp = $('#timestamp').html(); + $('.edit-timestamp').click(function () { + if ($('#timestampdiv').is(":hidden")) { + $('#timestampdiv').slideDown("normal"); + $('.edit-timestamp').hide(); } + return false; }); - jQuery('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels - jQuery('#timestampdiv').hide(); - var link = jQuery('.timestamp a').clone( true ); - jQuery('.timestamp').show().html( - jQuery( '#mm option[value=' + jQuery('#mm').val() + ']' ).text() + ' ' + - jQuery('#jj').val() + ',' + - jQuery('#aa').val() + '@' + - jQuery('#hh').val() + ':' + - jQuery('#mn').val() + ' ' - ).append( link ); - jQuery('#curtime').slideDown("normal"); + $('.cancel-timestamp').click(function() { + $('#timestampdiv').slideUp("normal"); + $('#mm').val($('#hidden_mm').val()); + $('#jj').val($('#hidden_jj').val()); + $('#aa').val($('#hidden_aa').val()); + $('#hh').val($('#hidden_hh').val()); + $('#mn').val($('#hidden_mn').val()); + $('#timestamp').html(stamp); + $('.edit-timestamp').show(); + + return false; + }); + + $('.save-timestamp').click(function () { // crazyhorse - multiple ok cancels + $('#timestampdiv').slideUp("normal"); + $('.edit-timestamp').show(); + $('#timestamp').html( + $( '#mm option[value=' + $('#mm').val() + ']' ).text() + ' ' + + $('#jj').val() + ', ' + + $('#aa').val() + ' @ ' + + $('#hh').val() + ':' + + $('#mn').val() + ' ' + ); + return false; }); }); diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index c4fa7f7a50..e9878c32f2 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -1097,7 +1097,8 @@ table.form-table td .updated { border: 0 none; } -#side-sortables .inside-submitbox .insidebox { +#side-sortables .inside-submitbox .insidebox, +.stuffbox .insidebox { margin: 11px 0; }