From 01a8c764b31a2a1da0cd8015f54b17fca60a273a Mon Sep 17 00:00:00 2001
From: azaozz
- post_status, 'private'); ?> tabindex="4" />
+
+
+ '); ?>diff --git a/wp-admin/js/edit-comments.js b/wp-admin/js/edit-comments.js index 8babaa66d0..673c6ada39 100644 --- a/wp-admin/js/edit-comments.js +++ b/wp-admin/js/edit-comments.js @@ -1,85 +1,91 @@ var theList; var theExtraList; -jQuery(function($) { +(function($) { -var dimAfter = function( r, settings ) { - $('li span.comment-count').each( function() { - var a = $(this); - var n = parseInt(a.html(),10); - n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 ); - if ( n < 0 ) { n = 0; } - a.html( n.toString() ); - $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); - }); - $('.post-com-count span.comment-count').each( function() { - var a = $(this); - var n = parseInt(a.html(),10); - var t = parseInt(a.parent().attr('title'), 10); - if ( $('#' + settings.element).is('.unapproved') ) { // we unapproved a formerly approved comment - n = n - 1; - t = t + 1; - } else { // we approved a formerly unapproved comment - n = n + 1; - t = t - 1; - } - if ( n < 0 ) { n = 0; } - if ( t < 0 ) { t = 0; } - if ( t >= 0 ) { a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) ); } - if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); } - a.html( n.toString() ); - }); -} - -var delAfter = function( r, settings ) { - $('li span.comment-count').each( function() { - var a = $(this); - var n = parseInt(a.html(),10); - if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment - n = n - 1; - } else if ( $(settings.target).parents( 'span.unapprove' ).size() ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove" - n = n + 1; - } - if ( n < 0 ) { n = 0; } - a.html( n.toString() ); - $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); - }); - $('.post-com-count span.comment-count').each( function() { - var a = $(this); - if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment +setCommentsList = function() { + var dimAfter = function( r, settings ) { + $('li span.comment-count').each( function() { + var a = $(this); + var n = parseInt(a.html(),10); + n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 ); + if ( n < 0 ) { n = 0; } + a.html( n.toString() ); + $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); + }); + $('.post-com-count span.comment-count').each( function() { + var a = $(this); + var n = parseInt(a.html(),10); var t = parseInt(a.parent().attr('title'), 10); - if ( t < 1 ) { return; } - t = t - 1; - a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) ); + if ( $('#' + settings.element).is('.unapproved') ) { // we unapproved a formerly approved comment + n = n - 1; + t = t + 1; + } else { // we approved a formerly unapproved comment + n = n + 1; + t = t - 1; + } + if ( n < 0 ) { n = 0; } + if ( t < 0 ) { t = 0; } + if ( t >= 0 ) { a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) ); } if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); } + a.html( n.toString() ); + }); + }; + + var delAfter = function( r, settings ) { + $('li span.comment-count').each( function() { + var a = $(this); + var n = parseInt(a.html(),10); + if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment + n = n - 1; + } else if ( $(settings.target).parents( 'span.unapprove' ).size() ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove" + n = n + 1; + } + if ( n < 0 ) { n = 0; } + a.html( n.toString() ); + $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); + }); + $('.post-com-count span.comment-count').each( function() { + var a = $(this); + if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment + var t = parseInt(a.parent().attr('title'), 10); + if ( t < 1 ) { return; } + t = t - 1; + a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) ); + if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); } + return; + } + var n = parseInt(a.html(),10) - 1; + a.html( n.toString() ); + }); + $('li span.spam-comment-count' ).each( function() { + var a = $(this); + var n = parseInt(a.html(),10); + if ( $(settings.target).parents( 'span.spam' ).size() ) { // we marked a comment as spam + n = n + 1; + } else if ( $('#' + settings.element).is('.spam') ) { // we approved or deleted a comment marked as spam + n = n - 1; + } + if ( n < 0 ) { n = 0; } + a.html( n.toString() ); + }); + + if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) { return; } - var n = parseInt(a.html(),10) - 1; - a.html( n.toString() ); - }); - $('li span.spam-comment-count' ).each( function() { - var a = $(this); - var n = parseInt(a.html(),10); - if ( $(settings.target).parents( 'span.spam' ).size() ) { // we marked a comment as spam - n = n + 1; - } else if ( $('#' + settings.element).is('.spam') ) { // we approved or deleted a comment marked as spam - n = n - 1; - } - if ( n < 0 ) { n = 0; } - a.html( n.toString() ); - }); + + theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() ); + $('#get-extra-comments').submit(); + }; - if ( theExtraList.size() == 0 || theExtraList.children().size() == 0 ) { - return; - } - - theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() ); - $('#get-extra-comments').submit(); -} - -theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } ); -theList = $('#the-comment-list').wpList( { alt: '', dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } ); + theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } ); + theList = $('#the-comment-list').wpList( { alt: '', dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } ); +}; +$(document).ready(function(){ + setCommentsList(); }); +})(jQuery); + (function($){ commentReply = { @@ -92,16 +98,13 @@ commentReply = { left = d.left; } - $('#replydiv').show(); $('#replydiv #comment_post_ID').val(p); $('#replydiv #comment_ID').val(c); $('#replydiv').draggable({ handle : '#replyhandle', containment : '#wpwrap' - }); - - $('#replydiv').resizable({ + }).resizable({ handles : 'se', minHeight : 200, minWidth : 400, @@ -127,7 +130,7 @@ commentReply = { 'position' : 'absolute', 'top' : top, 'left' : left - }); + }).show(); $('#replycontent').focus().keyup(function(e){ if (e.which == 27) commentReply.close(); // close on Escape @@ -195,6 +198,8 @@ commentReply = { $('#comment-'+r.id) .animate( { backgroundColor:"#CFEBF7" }, 600 ) .animate( { backgroundColor:"transparent" }, 600 ); + + setCommentsList(); }, error : function(r) { @@ -217,8 +222,15 @@ commentReply = { if (e.which == 27) commentReply.close(); // close on Escape }); } + }, + + back : function() { + if ( $('#replydiv').is(':hidden') && $('#replyerror').is(':visible') ) { + $('#replyerror').hide(); + $('#replydiv').show(); + } } -} +}; $(document).ready(function(){ if ( typeof QTags != 'undefined' ) diff --git a/wp-admin/upload.php b/wp-admin/upload.php index 4f530953c3..a7946fb12a 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -10,7 +10,6 @@ require_once('admin.php'); add_thickbox(); wp_enqueue_script( 'media-upload' ); -wp_enqueue_script( 'quicktags' ); if (!current_user_can('upload_files')) wp_die(__('You do not have permission to upload files.')); diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index fa80c7ff6e..44e18c139c 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -1917,13 +1917,12 @@ p#post-search-prep { /* reply to comments */ #replydiv { width: 700px; - border-color: #EBEBEB #CCC #CCC #EBEBEB; border-width: 1px; border-style: solid; padding: 2px; - background-color: #fff; left: 20px; - top: 300px; + top: 200px; + z-index: 100; } #replydiv #editorcontainer { @@ -1933,8 +1932,13 @@ p#post-search-prep { #replysubmit { margin: 0; padding: 3px 5px; - background-color: #EAF3FA; - border-top: 1px solid #ddd; + border-top-width: 1px; + border-top-style: solid; +} + +#replysubmit .button, +#replyerror .button { + margin-right: 5px; } #replydiv #editor-toolbar { @@ -1973,8 +1977,8 @@ p#post-search-prep { } #replyerror { - border: 5px solid #ddd; - background-color: #f8f8f8; + border-width: 5px; + border-style: solid; position: absolute; padding: 15px 15px 10px; width: 500px; @@ -2028,7 +2032,7 @@ p#post-search-prep { } #edit-settings { - padding: 28px 0 0; + padding: 29px 0 0; margin: 0 0 20px; } @@ -2041,17 +2045,23 @@ p#post-search-prep { #edit-settings-wrap { -moz-border-radius: 4px 0 4px 4px; -khtml-border-radius: 4px; + -khtml-border-top-right-radius: 0; -webkit-border-radius: 4px; - border-radius: 4px 0 4px 4px; + -webkit-border-top-right-radius: 0; + border-radius: 4px; + border-top-right-radius: 0; border-width: 1px; border-style: solid; } -.show-settings-opened { +#show-settings.show-settings-opened { -moz-border-radius: 4px 4px 0 0; - -khtml-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px 4px 0 0; + -webkit-border-bottom-left-radius: 0; + -webkit-border-bottom-right-radius: 0; + -khtml-border-bottom-left-radius: 0; + -khtml-border-bottom-right-radius: 0; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; } .metabox-prefs { diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 7451d3352a..76f620f1ed 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -124,7 +124,7 @@ function wp_default_scripts( &$scripts ) { 'good' => __('Medium'), 'strong' => __('Strong') ) ); - $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-draggable', 'jquery-ui-resizable'), '20080821' ); + $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-draggable', 'jquery-ui-resizable', 'quicktags'), '20080828' ); $scripts->localize( 'admin-comments', 'adminCommentsL10n', array( 'pending' => __('%i% pending') // must look like: "# blah blah" ) );