WordPress/wp-admin/js/edit-comments.min.js

1 line
13 KiB
JavaScript
Raw Normal View History

var setCommentsList,theList,theExtraList,commentReply;!function(a){var b,c,d,e,f,g,h=document.title;setCommentsList=function(){var i,j,k,l,m,n,o,p,q,r,s,t=0,u=a("#dashboard_right_now").length;i=a('input[name="_total"]',"#comments-form"),j=a('input[name="_per_page"]',"#comments-form"),k=a('input[name="_page"]',"#comments-form"),l=function(b,c){var d,g,h,i,j=a("#"+c.element);d=a("#replyrow"),g=a("#comment_ID",d).val(),h=a("#replybtn",d),j.is(".unapproved")?(c.data.id==g&&h.text(adminCommentsL10n.replyApprove),j.find("div.comment_status").html("0")):(c.data.id==g&&h.text(adminCommentsL10n.reply),j.find("div.comment_status").html("1")),q=a("#"+c.element).is("."+c.dimClass)?1:-1,!0!==c.parsed&&c.parsed.responses.length?(i=c.parsed.responses[0].supplemental,e(q,i.postId),f(-1*q,i.postId)):(e(q),f(-1*q))},m=function(b,c){var d,e,f,g,h,l,m,n=!1,o=a(b.target).attr("data-wp-lists");return b.data._total=i.val()||0,b.data._per_page=j.val()||0,b.data._page=k.val()||0,b.data._url=document.location.href,b.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&&(e=o.replace(/.*?comment-([0-9]+).*/,"$1"),f=a("#comment-"+e),d=a("#"+n+"-undo-holder").html(),f.find(".check-column :checkbox").prop("checked",!1),f.siblings("#replyrow").length&&commentReply.cid==e&&commentReply.close(),f.is("tr")?(g=f.children(":visible").length,m=a(".author strong",f).text(),h=a('<tr id="undo-'+e+'" class="undo un'+n+'" style="display:none;"><td colspan="'+g+'">'+d+"</td></tr>")):(m=a(".comment-author",f).text(),h=a('<div id="undo-'+e+'" style="display:none;" class="undo un'+n+'">'+d+"</div>")),f.before(h),a("strong","#undo-"+e).text(m),l=a(".undo a","#undo-"+e),l.attr("href","comment.php?action=un"+n+"comment&c="+e+"&_wpnonce="+b.data._ajax_nonce),l.attr("data-wp-lists","delete:the-comment-list:comment-"+e+"::un"+n+"=1"),l.attr("class","vim-z vim-destructive"),a(".avatar",f).first().clone().prependTo("#undo-"+e+" ."+n+"-undo-inside"),l.click(function(){return c.wpList.del(this),a("#undo-"+e).css({backgroundColor:"#ceb"}).fadeOut(350,function(){a(this).remove(),a("#comment-"+e).css("backgroundColor","").fadeIn(300,function(){a(this).show()})}),!1})),b},n=function(a,b,c){t>b||(c&&(t=b),i.val(a.toString()))},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)}},g=function(d){var e,f,g,i;s=s||new RegExp("Comments (\\([0-9"+thousandsSeparator+"]+\\))?"),r=r||a("<div />"),e=h,i=s.exec(document.title),i?(i=i[0],r.html(i),g=b(r)+d):(r.html(0),g=d),g>=1?(c(r,g),f=s.exec(document.title),f&&(e=document.title.replace(f[0],"Comments ("+r.text()+") "))):(f=s.exec(e),f&&(e=e.replace(f[0],"Comments"))),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",l="comment-count-pending";u||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."+l,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(l).addClass(j)):(e.parent().removeClass(k),e.addClass(l).removeClass(j)),c(e,f)}),h.each(function(){var b=a(this);d>0?(b.parent().removeClass(k),b.removeClass(j).addClass(l)):(b.parent().addClass(k),b.addClass(j).removeClass(l)),c(b,d)}))},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)})},o=function(b,c){var g,h,j