diff --git a/wp-admin/admin-header.php b/wp-admin/admin-header.php index 27c496a710..81711f3846 100644 --- a/wp-admin/admin-header.php +++ b/wp-admin/admin-header.php @@ -41,7 +41,7 @@ $admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix); //','uid':'ID; ?>','time':''}; -var ajaxurl = '', pagenow = '', adminpage = ''; +var ajaxurl = '', pagenow = '', adminpage = '', thousandsSeparator = 'number_format['thousands_sep']; ?>', decimalPoint = 'number_format['decimal_point']; ?>'; //]]> total_comments); + $num = '' . number_format_i18n($num_comm->total_comments) . ''; $text = _n( 'Comment', 'Comments', $num_comm->total_comments ); if ( current_user_can( 'moderate_comments' ) ) { $num = "$num"; @@ -258,7 +258,7 @@ function wp_dashboard_right_now() { echo '' . $text . ''; // Approved Comments - $num = number_format_i18n($num_comm->approved); + $num = '' . number_format_i18n($num_comm->approved) . ''; $text = _nc( 'Approved|Right Now', 'Approved', $num_comm->approved ); if ( current_user_can( 'moderate_comments' ) ) { $num = "$num"; @@ -280,10 +280,10 @@ function wp_dashboard_right_now() { echo '' . $text . ''; // Pending Comments - $num = number_format_i18n($num_comm->moderated); + $num = '' . number_format_i18n($num_comm->moderated) . ''; $text = _n( 'Pending', 'Pending', $num_comm->moderated ); if ( current_user_can( 'moderate_comments' ) ) { - $num = "$num"; + $num = "$num"; $text = "$text"; } echo '' . $num . ''; diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 58374b60d6..b2fd6711ff 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -2158,7 +2158,7 @@ function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true, if ( $user_can ) { if ( 'trash' == $the_comment_status ) { - $actions['untrash'] = "" . __( 'Restore' ) . ''; + $actions['untrash'] = "" . __( 'Restore' ) . ''; $actions['delete'] = "" . __('Delete Permanently') . ''; } else { $actions['approve'] = "" . __( 'Approve' ) . ''; diff --git a/wp-admin/js/edit-comments.dev.js b/wp-admin/js/edit-comments.dev.js index 03d70e8c48..b95afb5921 100644 --- a/wp-admin/js/edit-comments.dev.js +++ b/wp-admin/js/edit-comments.dev.js @@ -17,23 +17,22 @@ setCommentsList = function() { c.find('div.comment_status').html('1') $('span.pending-count').each( function() { - var a = $(this), n; - n = a.html().replace(/[ ,.]+/g, ''); + var a = $(this), n, dif; + n = a.html().replace(/[^0-9]+/g, ''); n = parseInt(n,10); if ( isNaN(n) ) return; - n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 ); + dif = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1; + n = n + dif; if ( n < 0 ) { n = 0; } a.closest('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); - n = n.toString(); - if ( n.length > 3 ) - n = n.substr(0, n.length-3)+' '+n.substr(-3); - a.html(n); + updateCount(a, n); + dashboardTotals(); }); }; // Send current total, page, per_page and url delBefore = function( settings, list ) { - var cl = $(settings.target).attr('className'), id, el, n, h, a, author; + var cl = $(settings.target).attr('className'), id, el, n, h, a, to, author; settings.data._total = totalInput.val() || 0; settings.data._per_page = perPageInput.val() || 0; @@ -60,7 +59,7 @@ setCommentsList = function() { $('strong', '#trashundo-' + id).html(author); a = $('a.undo-trash', '#trashundo-' + id); a.attr('href', 'comment.php?action=untrashcomment&c=' + id + '&_ajax_nonce=' + settings.data._ajax_nonce); - a.attr('className', 'delete:the-comment-list:comment-' + id + '::untrash=1 vim-t vim-destructive'); + a.attr('className', 'delete:the-comment-list:comment-' + id + '::untrash=1 vim-z vim-destructive'); a.click(function(){ list.wpList.del(this); @@ -71,7 +70,7 @@ setCommentsList = function() { return false; }); - window.setTimeout( function(){ + to = window.setTimeout( function(){ $('#trashundo-' + id).fadeOut('slow', function(){ $(this).remove(); }); }, 200000 ); } @@ -81,31 +80,75 @@ setCommentsList = function() { // Updates the current total (as displayed visibly) updateTotalCount = function( total, time, setConfidentTime ) { - if ( time < lastConfidentTime ) { + if ( time < lastConfidentTime ) return; - } - totalInput.val( total.toString() ); - if ( setConfidentTime ) { + + if ( setConfidentTime ) lastConfidentTime = time; - } + + totalInput.val( total.toString() ); $('span.total-type-count').each( function() { - var a = $(this), n; - n = totalInput.val().toString(); - if ( n.length > 3 ) - n = n.substr(0, n.length-3)+' '+n.substr(-3); - a.html(n); + updateCount( $(this), total ); }); }; + function dashboardTotals(n) { + var dash = $('#dashboard_right_now'), total, appr, totalN, apprN; + + n = n || 0; + if ( isNaN(n) || !dash.length ) + return; + + total = $('span.total-count', dash); + appr = $('span.approved-count', dash); + totalN = getCount(total); + apprN = getCount(appr); + + if ( totalN ) { + totalN = totalN + n; + apprN = totalN - getCount( $('span.pending-count', dash) ); + updateCount(total, totalN); + updateCount(appr, apprN); + } + } + + function getCount(el) { + var n = parseInt( el.html().replace(/[^0-9]+/g, ''), 10 ); + if ( isNaN(n) ) + return 0; + return n; + } + + function updateCount(el, n) { + if ( isNaN(n) ) + return; + n = n < 1 ? '0' : n.toString(); + if ( n.length > 3 ) + n = n.substr(0, n.length-3) + thousandsSeparator + n.substr(-3); + el.html(n); + } + // In admin-ajax.php, we send back the unix time stamp instead of 1 on success delAfter = function( r, settings ) { - var total, pageLinks, untrash = $(settings.target).parent().is('span.untrash'); + var total, pageLinks, N, untrash = $(settings.target).parent().is('span.untrash'), spam, trash; + + function getUpdate(s) { + if ( $(settings.target).parent().is('span.' + s) ) + return 1; + else if ( $('#' + settings.element).is('.' + s) ) + return -1; + + return 0; + } + spam = getUpdate('spam'); + trash = getUpdate('trash'); + + if ( untrash ) + trash = -1; $('span.pending-count').each( function() { - var a = $(this), n, unapproved = $('#' + settings.element).is('.unapproved'); - n = a.html().replace(/[ ,.]+/g, ''); - n = parseInt(n,10); - if ( isNaN(n) ) return; + var a = $(this), n = getCount(a), unapproved = $('#' + settings.element).is('.unapproved'); + if ( $(settings.target).parent().is('span.unapprove') || ( untrash && unapproved ) ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove" n = n + 1; } else if ( unapproved ) { // we deleted a formerly unapproved comment @@ -113,65 +156,41 @@ setCommentsList = function() { } if ( n < 0 ) { n = 0; } a.closest('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0'); - n = n.toString(); - if ( n.length > 3 ) - n = n.substr(0, n.length-3)+' '+n.substr(-3); - a.html(n); + updateCount(a, n); + dashboardTotals(); }); $('span.spam-count').each( function() { - var a = $(this), n; - n = a.html().replace(/[ ,.]+/g, ''); - n = parseInt(n,10); - if ( isNaN(n) ) return; - if ( $(settings.target).parent().is( 'span.spam' ) ) { // we marked a comment as spam - n = n + 1; - } else if ( $('#' + settings.element).is('.spam') ) { // we approved, deleted, or destroyed a comment marked as spam - n = n - 1; - } - if ( n < 0 ) { n = 0; } - n = n.toString(); - if ( n.length > 3 ) - n = n.substr(0, n.length-3)+' '+n.substr(-3); - a.html(n); + var a = $(this), n = getCount(a) + spam; + updateCount(a, n); }); $('span.trash-count').each( function() { - var a = $(this), n; - n = a.html().replace(/[ ,.]+/g, ''); - n = parseInt(n,10); - if ( isNaN(n) ) return; - if ( $(settings.target).parent().is( 'span.trash' ) ) { // we trashed a comment - n = n + 1; - } else if ( $('#' + settings.element).is('.trash') || untrash ) { // we deleted or untrashed a trash comment - n = n - 1; - } - if ( n < 0 ) { n = 0; } - n = n.toString(); - if ( n.length > 3 ) - n = n.substr(0, n.length-3)+' '+n.substr(-3); - a.html(n); + var a = $(this), n = getCount(a) + trash; + updateCount(a, n); }); - // XML response - if ( ( 'object' == typeof r ) && lastConfidentTime < settings.parsed.responses[0].supplemental.time ) { - // Set the total to the known good value (even if this value is a little old, newer values should only be a few less, and so shouldn't mess up the page links) - total = settings.parsed.responses[0].supplemental.total || false; - pageLinks = settings.parsed.responses[0].supplemental.pageLinks || false; - - if ( total && pageLinks ) { - updateTotalCount( total, settings.parsed.responses[0].supplemental.time, true ); - if ( $.trim( pageLinks ) ) { - $('.tablenav-pages').find( '.page-numbers' ).remove().end().append( $( pageLinks ) ); - } else { - $('.tablenav-pages').find( '.page-numbers' ).remove(); - } - } + if ( $('#dashboard_right_now').length ) { + N = spam || trash || 0; + if ( N > 0 ) + dashboardTotals(-1); + else if ( N < 0 ) + dashboardTotals(1); } else { - // Decrement the total + // XML response + if ( ( 'object' == typeof r ) && lastConfidentTime < settings.parsed.responses[0].supplemental.time ) { + pageLinks = settings.parsed.responses[0].supplemental.pageLinks || ''; + if ( $.trim( pageLinks ) ) + $('.tablenav-pages').find( '.page-numbers' ).remove().end().append( $( pageLinks ) ); + else + $('.tablenav-pages').find( '.page-numbers' ).remove(); + } + total = totalInput.val() ? parseInt( totalInput.val(), 10 ) : 0; - if ( total-- < 0 ) + total = total - spam - trash; + if ( total < 0 ) total = 0; + updateTotalCount( total, r, false ); } @@ -420,26 +439,33 @@ $(document).ready(function(){ window.location = l[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g, '')+'&hotkeys_highlight_'+first_last+'=1'; } }; + edit_comment = function(event, current_row) { window.location = $('span.edit a', current_row).attr('href'); }; + toggle_all = function() { toggleWithKeyboard = true; - $('#comments-form thead #cb input:checkbox').click().attr('checked', ''); + $('input:checkbox', '#cb').click().attr('checked', ''); toggleWithKeyboard = false; - } + }; + make_bulk = function(value) { - return function(event, _) { - $('option[value='+value+']').attr('selected', 'selected'); - $('form#comments-form')[0].submit(); + return function() { + var scope = $('select[name="action"]'); + $('option[value='+value+']', scope).attr('selected', 'selected'); + $('#comments-form').submit(); } }; - $.table_hotkeys($('table.widefat'),['a', 'u', 's', 'd', 'r', 'q', ['e', edit_comment], - ['shift+a', make_bulk('approve')], ['shift+s', make_bulk('markspam')], - ['shift+d', make_bulk('delete')], ['shift+x', toggle_all], - ['shift+u', make_bulk('unapprove')]], - {highlight_first: adminCommentsL10n.hotkeys_highlight_first, highlight_last: adminCommentsL10n.hotkeys_highlight_last, - prev_page_link_cb: make_hotkeys_redirect('prev'), next_page_link_cb: make_hotkeys_redirect('next')} + + $.table_hotkeys( + $('table.widefat'), + ['a', 'u', 's', 'd', 'r', 'q', 't', 'z', ['e', edit_comment], ['shift+x', toggle_all], + ['shift+a', make_bulk('approve')], ['shift+s', make_bulk('markspam')], + ['shift+d', make_bulk('delete')], ['shift+t', make_bulk('trash')], + ['shift+z', make_bulk('untrash')], ['shift+u', make_bulk('unapprove')]], + { highlight_first: adminCommentsL10n.hotkeys_highlight_first, highlight_last: adminCommentsL10n.hotkeys_highlight_last, + prev_page_link_cb: make_hotkeys_redirect('prev'), next_page_link_cb: make_hotkeys_redirect('next') } ); } }); diff --git a/wp-admin/js/edit-comments.js b/wp-admin/js/edit-comments.js index 9f036a172f..9e6bfd8277 100644 --- a/wp-admin/js/edit-comments.js +++ b/wp-admin/js/edit-comments.js @@ -1 +1 @@ -var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var g,i,h,f=0,c,e,d,b;g=a('.tablenav input[name="_total"]',"#comments-form");i=a('.tablenav input[name="_per_page"]',"#comments-form");h=a('.tablenav input[name="_page"]',"#comments-form");c=function(k,j){var l=a("#"+j.element);if(l.is(".unapproved")){l.find("div.comment_status").html("0")}else{l.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var m=a(this),o;o=m.html().replace(/[ ,.]+/g,"");o=parseInt(o,10);if(isNaN(o)){return}o=o+(a("#"+j.element).is("."+j.dimClass)?1:-1);if(o<0){o=0}m.closest("#awaiting-mod")[0==o?"addClass":"removeClass"]("count-0");o=o.toString();if(o.length>3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};e=function(m,q){var s=a(m.target).attr("className"),j,k,l,p,r,o;m.data._total=g.val()||0;m.data._per_page=i.val()||0;m.data._page=h.val()||0;m.data._url=document.location.href;if(s.indexOf(":trash=1")!=-1){j=s.replace(/.*?comment-([0-9]+).*/,"$1");k=a("#comment-"+j);note=a("#undo-holder").html();if(k.is("tr")){l=k.children(":visible").length;o=a(".author strong",k).html();p=a(''+note+"")}else{o=a(".comment-author",k).html();p=a('")}k.before(p);p.fadeIn(400);a("strong","#trashundo-"+j).html(o);r=a("a.undo-trash","#trashundo-"+j);r.attr("href","comment.php?action=untrashcomment&c="+j+"&_ajax_nonce="+m.data._ajax_nonce);r.attr("className","delete:the-comment-list:comment-"+j+"::untrash=1 vim-t vim-destructive");r.click(function(){q.wpList.del(this);a("#trashundo-"+j).fadeOut(250,function(){a(this).remove();a("#comment-"+j).css("backgroundColor","").fadeIn(400)});return false});window.setTimeout(function(){a("#trashundo-"+j).fadeOut("slow",function(){a(this).remove()})},200000)}return m};d=function(j,k,l){if(k3){o=o.substr(0,o.length-3)+" "+o.substr(-3)}m.html(o)})};b=function(m,k){var l,n,j=a(k.target).parent().is("span.untrash");a("span.pending-count").each(function(){var o=a(this),q,p=a("#"+k.element).is(".unapproved");q=o.html().replace(/[ ,.]+/g,"");q=parseInt(q,10);if(isNaN(q)){return}if(a(k.target).parent().is("span.unapprove")||(j&&p)){q=q+1}else{if(p){q=q-1}}if(q<0){q=0}o.closest("#awaiting-mod")[0==q?"addClass":"removeClass"]("count-0");q=q.toString();if(q.length>3){q=q.substr(0,q.length-3)+" "+q.substr(-3)}o.html(q)});a("span.spam-count").each(function(){var o=a(this),p;p=o.html().replace(/[ ,.]+/g,"");p=parseInt(p,10);if(isNaN(p)){return}if(a(k.target).parent().is("span.spam")){p=p+1}else{if(a("#"+k.element).is(".spam")){p=p-1}}if(p<0){p=0}p=p.toString();if(p.length>3){p=p.substr(0,p.length-3)+" "+p.substr(-3)}o.html(p)});a("span.trash-count").each(function(){var o=a(this),p;p=o.html().replace(/[ ,.]+/g,"");p=parseInt(p,10);if(isNaN(p)){return}if(a(k.target).parent().is("span.trash")){p=p+1}else{if(a("#"+k.element).is(".trash")||j){p=p-1}}if(p<0){p=0}p=p.toString();if(p.length>3){p=p.substr(0,p.length-3)+" "+p.substr(-3)}o.html(p)});if(("object"==typeof m)&&f p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){a(this.o).fadeIn("fast").css("backgroundColor","");a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("#edithead input").val("");a("#replysubmit .error").html("").hide();a("#replysubmit .waiting").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}},open:function(i,g,c){var e=this,d,b,f;e.close();e.o="#comment-"+i;a("#replyrow td").attr("colspan",a(".widefat thead th:visible").length);d=a("#replyrow"),rowData=a("#inline-"+i);b=e.act=(c=="edit")?"edit-comment":"replyto-comment";a("#action",d).val(b);a("#comment_post_ID",d).val(g);a("#comment_ID",d).val(i);if(c=="edit"){a("#author",d).val(a("div.author",rowData).text());a("#author-email",d).val(a("div.author-email",rowData).text());a("#author-url",d).val(a("div.author-url",rowData).text());a("#status",d).val(a("div.comment_status",rowData).text());a("#replycontent",d).val(a("textarea.comment",rowData).val());a("#edithead, #savebtn",d).show();a("#replyhead, #replybtn",d).hide();f=a(e.o).height();if(f>220){if(a.browser.msie){a("#replycontainer, #replycontent",d).height(f-105)}else{a("#replycontainer",d).height(f-105)}}a(e.o).after(d.hide()).fadeOut("fast",function(){a("#replyrow").fadeIn("fast")})}else{a("#edithead, #savebtn",d).hide();a("#replyhead, #replybtn",d).show();a(e.o).after(d);a("#replyrow").hide().fadeIn("fast")}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var l,j,m,h,k;l=a("#replyrow").offset().top;j=l+a("#replyrow").height();m=window.pageYOffset||document.documentElement.scrollTop;h=document.documentElement.clientHeight||self.innerHeight||0;k=m+h;if(k-20]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("#comments-form thead #cb input:checkbox").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(h,g){a("option[value="+f+"]").attr("selected","selected");a("form#comments-form")[0].submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q",["e",b],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+x",c],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery); \ No newline at end of file +var theList,theExtraList,toggleWithKeyboard=false;(function(a){setCommentsList=function(){var c,e,h,l=0,g,i,d,k;c=a('.tablenav input[name="_total"]',"#comments-form");e=a('.tablenav input[name="_per_page"]',"#comments-form");h=a('.tablenav input[name="_page"]',"#comments-form");g=function(n,m){var o=a("#"+m.element);if(o.is(".unapproved")){o.find("div.comment_status").html("0")}else{o.find("div.comment_status").html("1")}a("span.pending-count").each(function(){var p=a(this),r,q;r=p.html().replace(/[^0-9]+/g,"");r=parseInt(r,10);if(isNaN(r)){return}q=a("#"+m.element).is("."+m.dimClass)?1:-1;r=r+q;if(r<0){r=0}p.closest("#awaiting-mod")[0==r?"addClass":"removeClass"]("count-0");f(p,r);j()})};i=function(q,t){var w=a(q.target).attr("className"),m,o,p,s,u,v,r;q.data._total=c.val()||0;q.data._per_page=e.val()||0;q.data._page=h.val()||0;q.data._url=document.location.href;if(w.indexOf(":trash=1")!=-1){m=w.replace(/.*?comment-([0-9]+).*/,"$1");o=a("#comment-"+m);note=a("#undo-holder").html();if(o.is("tr")){p=o.children(":visible").length;r=a(".author strong",o).html();s=a(''+note+"")}else{r=a(".comment-author",o).html();s=a('")}o.before(s);s.fadeIn(400);a("strong","#trashundo-"+m).html(r);u=a("a.undo-trash","#trashundo-"+m);u.attr("href","comment.php?action=untrashcomment&c="+m+"&_ajax_nonce="+q.data._ajax_nonce);u.attr("className","delete:the-comment-list:comment-"+m+"::untrash=1 vim-z vim-destructive");u.click(function(){t.wpList.del(this);a("#trashundo-"+m).fadeOut(250,function(){a(this).remove();a("#comment-"+m).css("backgroundColor","").fadeIn(400)});return false});v=window.setTimeout(function(){a("#trashundo-"+m).fadeOut("slow",function(){a(this).remove()})},200000)}return q};d=function(m,n,o){if(n3){o=o.substr(0,o.length-3)+thousandsSeparator+o.substr(-3)}m.html(o)}k=function(m,n){var q,o,p,u=a(n.target).parent().is("span.untrash"),t,s;function v(r){if(a(n.target).parent().is("span."+r)){return 1}else{if(a("#"+n.element).is("."+r)){return -1}}return 0}t=v("spam");s=v("trash");if(u){s=-1}a("span.pending-count").each(function(){var r=a(this),x=b(r),w=a("#"+n.element).is(".unapproved");if(a(n.target).parent().is("span.unapprove")||(u&&w)){x=x+1}else{if(w){x=x-1}}if(x<0){x=0}r.closest("#awaiting-mod")[0==x?"addClass":"removeClass"]("count-0");f(r,x);j()});a("span.spam-count").each(function(){var r=a(this),w=b(r)+t;f(r,w)});a("span.trash-count").each(function(){var r=a(this),w=b(r)+s;f(r,w)});if(a("#dashboard_right_now").length){p=t||s||0;if(p>0){j(-1)}else{if(p<0){j(1)}}}else{if(("object"==typeof m)&&l p").dblclick(function(){commentReply.toggle(a(this).parent())});a("#doaction, #doaction2, #post-query-submit").click(function(c){if(a("#the-comment-list #replyrow").length>0){commentReply.close()}});this.comments_listing=a('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(b){b.each(function(){a(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())})})},toggle:function(b){if(a(b).css("display")!="none"){a(b).find("a.vim-q").click()}},revert:function(){if(a("#the-comment-list #replyrow").length<1){return false}a("#replyrow").fadeOut("fast",function(){commentReply.close()});return false},close:function(){a(this.o).fadeIn("fast").css("backgroundColor","");a("#com-reply").append(a("#replyrow"));a("#replycontent").val("");a("#edithead input").val("");a("#replysubmit .error").html("").hide();a("#replysubmit .waiting").hide();if(a.browser.msie){a("#replycontainer, #replycontent").css("height","120px")}else{a("#replycontainer").resizable("destroy").css("height","120px")}},open:function(i,g,c){var e=this,d,b,f;e.close();e.o="#comment-"+i;a("#replyrow td").attr("colspan",a(".widefat thead th:visible").length);d=a("#replyrow"),rowData=a("#inline-"+i);b=e.act=(c=="edit")?"edit-comment":"replyto-comment";a("#action",d).val(b);a("#comment_post_ID",d).val(g);a("#comment_ID",d).val(i);if(c=="edit"){a("#author",d).val(a("div.author",rowData).text());a("#author-email",d).val(a("div.author-email",rowData).text());a("#author-url",d).val(a("div.author-url",rowData).text());a("#status",d).val(a("div.comment_status",rowData).text());a("#replycontent",d).val(a("textarea.comment",rowData).val());a("#edithead, #savebtn",d).show();a("#replyhead, #replybtn",d).hide();f=a(e.o).height();if(f>220){if(a.browser.msie){a("#replycontainer, #replycontent",d).height(f-105)}else{a("#replycontainer",d).height(f-105)}}a(e.o).after(d.hide()).fadeOut("fast",function(){a("#replyrow").fadeIn("fast")})}else{a("#edithead, #savebtn",d).hide();a("#replyhead, #replybtn",d).show();a(e.o).after(d);a("#replyrow").hide().fadeIn("fast")}if(!a.browser.msie){a("#replycontainer").resizable({handles:"s",axis:"y",minHeight:80,stop:function(){a("#replycontainer").width("auto")}})}setTimeout(function(){var l,j,m,h,k;l=a("#replyrow").offset().top;j=l+a("#replyrow").height();m=window.pageYOffset||document.documentElement.scrollTop;h=document.documentElement.clientHeight||self.innerHeight||0;k=m+h;if(k-20]*?>/g,"")}if(c){a("#replysubmit .error").html(c).show()}}};a(document).ready(function(){var e,b,c,d;setCommentsList();commentReply.init();a("span.delete a.delete").click(function(){return false});if(typeof QTags!="undefined"){ed_reply=new QTags("ed_reply","replycontent","replycontainer","more")}if(typeof a.table_hotkeys!="undefined"){e=function(f){return function(){var h,g;h="next"==f?"first":"last";g=a("."+f+".page-numbers");if(g.length){window.location=g[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+h+"=1"}}};b=function(g,f){window.location=a("span.edit a",f).attr("href")};c=function(){toggleWithKeyboard=true;a("input:checkbox","#cb").click().attr("checked","");toggleWithKeyboard=false};d=function(f){return function(){var g=a('select[name="action"]');a("option[value="+f+"]",g).attr("selected","selected");a("#comments-form").submit()}};a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q","t","z",["e",b],["shift+x",c],["shift+a",d("approve")],["shift+s",d("markspam")],["shift+d",d("delete")],["shift+t",d("trash")],["shift+z",d("untrash")],["shift+u",d("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:e("prev"),next_page_link_cb:e("next")})}})})(jQuery); \ No newline at end of file diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index c6e74a1931..903d196a34 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -256,7 +256,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array('jquery'), '20090514' ); $scripts->add_data( 'user-profile', 'group', 1 ); - $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20091007' ); + $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20091008' ); $scripts->add_data( 'admin-comments', 'group', 1 ); $scripts->localize( 'admin-comments', 'adminCommentsL10n', array( 'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),