diff --git a/wp-admin/css/global.css b/wp-admin/css/global.css index 150461ad7..3ed3b46fa 100644 --- a/wp-admin/css/global.css +++ b/wp-admin/css/global.css @@ -194,7 +194,3 @@ th.check-column + th, th.check-column + td { padding-bottom: 7px; padding-right: 280px; } - -#timestampdiv { - display: none; -} diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 0522933c4..b4355f93d 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -121,9 +121,9 @@ if ($post_ID) { ?>

-
+
@@ -205,7 +205,7 @@ endif; ?> -
+

@@ -218,7 +218,7 @@ endif; ?>
-

+

0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?> diff --git a/wp-admin/edit-form-comment.php b/wp-admin/edit-form-comment.php index 15b876802..c59a5774e 100644 --- a/wp-admin/edit-form-comment.php +++ b/wp-admin/edit-form-comment.php @@ -37,9 +37,9 @@ $date = mysql2date(get_option('date_format'), $comment->comment_date); $time = mysql2date(get_option('time_format'), $comment->comment_date); ?>

-
+
diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index 4c80ee5bd..1a4025fc7 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -106,9 +106,9 @@ if ($post_ID) { } ?>

-
+
diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 63a77f427..2ee6210b5 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -589,10 +589,10 @@ function postbox_classes( $id, $page ) { $current_user = wp_get_current_user(); if ( $closed = get_usermeta( $current_user->ID, 'closedpostboxes_'.$page ) ) { if ( !is_array( $closed ) ) return ''; - return in_array( $id, $closed )? 'closed' : ''; + return in_array( $id, $closed )? 'if-js-closed' : ''; } else { if ( 'tagsdiv' == $id || 'categorydiv' == $id ) return ''; - else return 'closed'; + else return 'if-js-closed'; } } diff --git a/wp-admin/js/comment.js b/wp-admin/js/comment.js index ddb54a5ee..11a362765 100644 --- a/wp-admin/js/comment.js +++ b/wp-admin/js/comment.js @@ -1,11 +1,25 @@ jQuery(document).ready( function() { add_postbox_toggles('comment'); + // close postboxes that should be closed + jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); + + // show things that should be visible, hide what should be hidden + jQuery('.hide-if-no-js').show(); + jQuery('.hide-if-js').hide(); + jQuery('.edit-timestamp').click(function () { if (jQuery('#timestampdiv').is(":hidden")) { jQuery('#timestampdiv').slideDown("normal"); + jQuery('.edit-timestamp').text(commentL10n.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(commentL10n.edit); } return false; }); diff --git a/wp-admin/js/page.js b/wp-admin/js/page.js index 6f549724c..2a91e3397 100644 --- a/wp-admin/js/page.js +++ b/wp-admin/js/page.js @@ -2,6 +2,13 @@ jQuery(document).ready( function() { add_postbox_toggles('page'); make_slugedit_clickable(); + // close postboxes that should be closed + jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); + + // show things that should be visible, hide what should be hidden + jQuery('.hide-if-no-js').show(); + jQuery('.hide-if-js').hide(); + jQuery('#title').blur( function() { if ( (jQuery("#post_ID").val() > 0) || (jQuery("#title").val().length == 0) ) return; autosave(); } ); // hide advanced slug field diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index 9dd6fd50a..78b22ed91 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -59,6 +59,13 @@ function tag_press_key( e ) { } jQuery(document).ready( function() { + // close postboxes that should be closed + jQuery('.if-js-closed').removeClass('if-js-closed').addClass('closed'); + + // show things that should be visible, hide what should be hidden + jQuery('.hide-if-no-js').show(); + jQuery('.hide-if-js').hide(); + // postboxes add_postbox_toggles('post'); diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index ee08758d7..fd39c638e 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -1455,4 +1455,8 @@ td.action-links, th.action-links { #poststuff h3, #poststuff .closed h3 { cursor: pointer; -} \ No newline at end of file +} + +.hide-if-no-js { + display: none; +} \ No newline at end of file diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index b42d7ce95..301ae9c19 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -940,7 +940,7 @@ function the_editor($content, $id = 'content', $prev_id = 'title', $media_button } if ( $media_buttons ) { ?> -
+
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 2aa53e58d..7c89dc500 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -160,6 +160,10 @@ class WP_Scripts { ) ); $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->localize( 'comment', 'commentL10n', array( + 'cancel' => __('Cancel'), + 'edit' => __('Edit'), + ) ); $this->add( 'media-upload', '/wp-admin/js/media-upload.js', false, '20080109' ); $this->localize( 'upload', 'uploadL10n', array( 'browseTitle' => attribute_escape(__('Browse your files')),