2016-02-29 04:20:26 +01:00
|
|
|
var setCommentsList,theList,theExtraList,commentReply;!function(a){var b,c,d,e,f,g,h,i,j,k=document.title,l=a("#dashboard_right_now").length;b=function(a){var b=parseInt(a.html().replace(/[^0-9]+/g,""),10);return isNaN(b)?0:b},c=function(a,b){var c="";if(!isNaN(b)){if(b=1>b?"0":b.toString(),b.length>3){for(;b.length>3;)c=thousandsSeparator+b.substr(b.length-3)+c,b=b.substr(0,b.length-3);b+=c}a.html(b)}},f=function(e,f){var g,h,i=".post-com-count-"+f,j="comment-count-no-comments",k="comment-count-approved";d("span.approved-count",e),f&&(g=a("span."+k,i),h=a("span."+j,i),g.each(function(){var d=a(this),f=b(d)+e;1>f&&(f=0),0===f?d.removeClass(k).addClass(j):d.addClass(k).removeClass(j),c(d,f)}),h.each(function(){var b=a(this);e>0?b.removeClass(j).addClass(k):b.addClass(j).removeClass(k),c(b,e)}))},d=function(d,e){a(d).each(function(){var d=a(this),f=b(d)+e;1>f&&(f=0),c(d,f)})},h=function(b){if(l&&b&&b.i18n_comments_text){var c=a("#dashboard_right_now");a(".comment-count a",c).text(b.i18n_comments_text),a(".comment-mod-count a",c).text(b.i18n_moderation_text).parent()[b.in_moderation>0?"removeClass":"addClass"]("hidden")}},g=function(d){var e,f,g,h;j=j||new RegExp(adminCommentsL10n.docTitleCommentsCount.replace("%s","\\([0-9"+thousandsSeparator+"]+\\)")+"?"),i=i||a("<div />"),e=k,h=j.exec(document.title),h?(h=h[0],i.html(h),g=b(i)+d):(i.html(0),g=d),g>=1?(c(i,g),f=j.exec(document.title),f&&(e=document.title.replace(f[0],adminCommentsL10n.docTitleCommentsCount.replace("%s",i.text())+" "))):(f=j.exec(e),f&&(e=e.replace(f[0],adminCommentsL10n.docTitleComments))),document.title=e},e=function(d,e){var f,h,i=".post-com-count-"+e,j="comment-count-no-pending",k="post-com-count-no-pending",m="comment-count-pending";l||g(d),a("span.pending-count").each(function(){var e=a(this),f=b(e)+d;1>f&&(f=0),e.closest(".awaiting-mod")[0===f?"addClass":"removeClass"]("count-0"),c(e,f)}),e&&(f=a("span."+m,i),h=a("span."+j,i),f.each(function(){var e=a(this),f=b(e)+d;1>f&&(f=0),0===f?(e.parent().addClass(k),e.removeClass(m).addClass(j)):(e.parent().removeClass(k),e.addClass(m).removeClass(j)),c(e,f)}),h.each(function(){var b=a(this);d>0?(b.parent().removeClass(k),b.removeClass(j).addClass(m)):(b.parent().addClass(k),b.addClass(j).removeClass(m)),c(b,d)}))},setCommentsList=function(){var b,c,g,i,j,k,m,n,o,p=0;b=a('input[name="_total"]',"#comments-form"),c=a('input[name="_per_page"]',"#comments-form"),g=a('input[name="_page"]',"#comments-form"),k=function(a,c,d){p>c||(d&&(p=c),b.val(a.toString()))},i=function(b,c){var d,g,i,j,k=a("#"+c.element);!0!==c.parsed&&(j=c.parsed.responses[0]),d=a("#replyrow"),g=a("#comment_ID",d).val(),i=a("#replybtn",d),k.is(".unapproved")?(c.data.id==g&&i.text(adminCommentsL10n.replyApprove),k.find("div.comment_status").html("0")):(c.data.id==g&&i.text(adminCommentsL10n.reply),k.find("div.comment_status").html("1")),o=a("#"+c.element).is("."+c.dimClass)?1:-1,j?(h(j.supplemental),e(o,j.supplemental.postId),f(-1*o,j.supplemental.postId)):(e(o),f(-1*o))},j=function(d,e){var f,h,i,j,k,l,m,n=!1,o=a(d.target).attr("data-wp-lists");return d.data._total=b.val()||0,d.data._per_page=c.val()||0,d.data._page=g.val()||0,d.data._url=document.location.href,d.data.comment_status=a('input[name="comment_status"]',"#comments-form").val(),-1!=o.indexOf(":trash=1")?n="trash":-1!=o.indexOf(":spam=1")&&(n="spam"),n&&(h=o.replace(/.*?comment-([0-9]+).*/,"$1"),i=a("#comment-"+h),f=a("#"+n+"-undo-holder").html(),i.find(".check-column :checkbox").prop("checked",!1),i.siblings("#replyrow").length&&commentReply.cid==h&&commentReply.close(),i.is("tr")?(j=i.children(":visible").length,m=a(".author strong",i).text(),k=a('<tr id="undo-'+h+'" class="undo un'+n+'" style="display:none;"><td colspan="'+j+'">'+f+"</td></tr>")):(m=a(".comment-author",i).text(),k=a('<div id="undo-'+h+'" style="display:none;" class="undo un'+n+'">'+f+"</div>")),i.before(k),a("strong","#undo-"+h).text(m),l=a(".undo a","#undo-"+h),l.attr("href","comment.php?action=un"+n+"comment&c="+h+"&_wpnonce="+d.data._ajax_nonce),l.attr("data-wp-lists","delete:the-comment-list:comment-"+h+"::un"
|