var setCommentsList,theList,theExtraList,commentReply;!function(C){var o,s,i=document.title,w=C("#dashboard_right_now").length,r=function(t){t=parseInt(t.html().replace(/[^0-9]+/g,""),10);return isNaN(t)?0:t},l=function(t,e){var n="";if(!isNaN(e)){if(3<(e=e<1?"0":e.toString()).length){for(;3"),e=i,1<=(t=(a=s.exec(document.title))?(a=a[0],o.html(a),r(o)+t):(o.html(0),t))?(l(o,t),(n=s.exec(document.title))&&(e=document.title.replace(n[0],adminCommentsL10n.docTitleCommentsCount.replace("%s",o.text())+" "))):(n=s.exec(e))&&(e=e.replace(n[0],adminCommentsL10n.docTitleComments)),document.title=e},L=function(n,t){var e=".post-com-count-"+t,a="comment-count-no-pending",o="post-com-count-no-pending",s="comment-count-pending";w||m(n),C("span.pending-count").each(function(){var t=C(this),e=r(t)+n;e<1&&(e=0),t.closest(".awaiting-mod")[0===e?"addClass":"removeClass"]("count-0"),l(t,e)}),t&&(t=C("span."+s,e),e=C("span."+a,e),t.each(function(){var t=C(this),e=r(t)+n;0===(e=e<1?0:e)?(t.parent().addClass(o),t.removeClass(s).addClass(a)):(t.parent().removeClass(o),t.addClass(s).removeClass(a)),l(t,e)}),e.each(function(){var t=C(this);0'+o+" | ")):(s=C(".comment-author",a).text(),C(''+o+"
")),a.before(o),C("strong","#undo-"+n).text(s),(s=C(".undo a","#undo-"+n)).attr("href","comment.php?action=un"+i+"comment&c="+n+"&_wpnonce="+t.data._ajax_nonce),s.attr("data-wp-lists","delete:the-comment-list:comment-"+n+"::un"+i+"=1"),s.attr("class","vim-z vim-destructive"),C(".avatar",a).first().clone().prependTo("#undo-"+n+" ."+i+"-undo-inside"),s.click(function(t){t.preventDefault(),t.stopPropagation(),e.wpList.del(this),C("#undo-"+n).css({backgroundColor:"#ceb"}).fadeOut(350,function(){C(this).remove(),C("#comment-"+n).css("backgroundColor","").fadeIn(300,function(){C(this).show()})})})),t},n=function(t,e){var n,a,o,s,i=!0===e.parsed?{}:e.parsed.responses[0],r=!0===e.parsed?"":i.supplemental.status,l=!0===e.parsed?"":i.supplemental.postId,m=!0===e.parsed?"":i.supplemental,p=C(e.target).parent(),c=C("#"+e.element),d=c.hasClass("approved"),u=c.hasClass("unapproved"),h=c.hasClass("spam"),v=c.hasClass("trash"),c=!1;k(m),p.is("span.undo")?(p.hasClass("unspam")?(n=-1,"trash"===r?a=1:"1"===r?s=1:"0"===r&&(o=1)):p.hasClass("untrash")&&(a=-1,"spam"===r?n=1:"1"===r?s=1:"0"===r&&(o=1)),c=!0):p.is("span.spam")?(d?s=-1:u?o=-1:v&&(a=-1),n=1):p.is("span.unspam")?(d?o=1:u?s=1:(v||h)&&(p.hasClass("approve")?s=1:p.hasClass("unapprove")&&(o=1)),n=-1):p.is("span.trash")?(d?s=-1:u?o=-1:h&&(n=-1),a=1):p.is("span.untrash")?(d?o=1:u?s=1:v&&(p.hasClass("approve")?s=1:p.hasClass("unapprove")&&(o=1)),a=-1):p.is("span.approve:not(.unspam):not(.untrash)")?o=-(s=1):p.is("span.unapprove:not(.unspam):not(.untrash)")?(s=-1,o=1):p.is("span.delete")&&(h?n=-1:v&&(a=-1)),o&&(L(o,l),b("span.all-count",o)),s&&(x(s,l),b("span.all-count",s)),n&&b("span.spam-count",n),a&&b("span.trash-count",a),w||(a=g.val()?parseInt(g.val(),10):0,C(e.target).parent().is("span.undo")?a++:a--,a<0&&(a=0),"object"==typeof t?i.supplemental.total_items_i18n&&fn||(t?(theExtraList.empty(),e.number=Math.min(8,a)):(e.number=1,e.offset=Math.min(8,a)-1),e.no_placeholder=!0,e.paged++,!0===e.comment_type&&(e.comment_type=""),e=C.extend(e,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:C("#_ajax_fetch_list_nonce").val()}),C.ajax({url:ajaxurl,global:!1,dataType:"json",data:e,success:function(t){theExtraList.get(0).wpList.add(t.rows)}}))};theExtraList=C("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"}),theList=C("#the-comment-list").wpList({alt:"",delBefore:e,dimAfter:t,delAfter:n,addColor:"none"}).bind("wpListDelEnd",function(t,e){var n=C(e.target).attr("data-wp-lists"),e=e.element.replace(/[^0-9]+/g,"");-1==n.indexOf(":trash=1")&&-1==n.indexOf(":spam=1")||C("#undo-"+e).fadeIn(300,function(){C(this).show()})})},commentReply={cid:"",act:"",init:function(){var t=C("#replyrow");C("a.cancel",t).click(function(){return commentReply.revert()}),C("a.save",t).click(function(){return commentReply.send()}),C("input#author-name, input#author-email, input#author-url",t).keypress(function(t){if(13==t.which)return commentReply.send(),t.preventDefault(),!1}),C("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(C(this).parent())}),C("#doaction, #doaction2, #post-query-submit").click(function(){0 input[name="comment_status"]').val()||""},addEvents:function(t){t.each(function(){C(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(C(this).parent())})})},toggle:function(t){"none"!==C(t).css("display")&&(C("#replyrow").parent().is("#com-reply")||window.confirm(adminCommentsL10n.warnQuickEdit))&&C(t).find("a.vim-q").click()},revert:function(){return C("#the-comment-list #replyrow").length<1||C("#replyrow").fadeOut("fast",function(){commentReply.close()}),!1},close:function(){var t,e=C("#replyrow");e.parent().is("#com-reply")||(this.cid&&"edit-comment"==this.act&&(t=C("#comment-"+this.cid)).fadeIn(300,function(){t.show()}).css("backgroundColor",""),"undefined"!=typeof QTags&&QTags.closeAllTags("replycontent"),C("#add-new-comment").css("display",""),e.hide(),C("#com-reply").append(e),C("#replycontent").css("height","").val(""),C("#edithead input").val(""),C(".error",e).empty().hide(),C(".spinner",e).removeClass("is-active"),this.cid="")},open:function(t,e,n){var a,o,s,i,r=C("#comment-"+t),l=r.height();return this.close(),this.cid=t,a=C("#replyrow"),o=C("#inline-"+t),s="edit"==(n=n||"replyto")?"edit":"replyto",s=this.act=s+"-comment",i=C("> th:visible, > td:visible",r).length,a.hasClass("inline-edit-row")&&0!==i&&C("td",a).attr("colspan",i),C("#action",a).val(s),C("#comment_post_ID",a).val(e),C("#comment_ID",a).val(t),"edit"==n?(C("#author-name",a).val(C("div.author",o).text()),C("#author-email",a).val(C("div.author-email",o).text()),C("#author-url",a).val(C("div.author-url",o).text()),C("#status",a).val(C("div.comment_status",o).text()),C("#replycontent",a).val(C("textarea.comment",o).val()),C("#edithead, #editlegend, #savebtn",a).show(),C("#replyhead, #replybtn, #addhead, #addbtn",a).hide(),120]*?>/g,""):e)&&C("#replysubmit .error").html(e).show()},addcomment:function(t){var e=this;C("#add-new-comment").fadeOut(200,function(){e.open(0,t,"add"),C("table.comments-box").css("display",""),C("#no-comments").remove()})}},C(document).ready(function(){var t,e,n,a;setCommentsList(),commentReply.init(),C(document).on("click","span.delete a.delete",function(t){t.preventDefault()}),void 0!==C.table_hotkeys&&(t=function(n){return function(){var t="next"==n?"first":"last",e=C(".tablenav-pages ."+n+"-page:not(.disabled)");e.length&&(window.location=e[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+t+"=1")}},e=function(t,e){window.location=C("span.edit a",e).attr("href")},n=function(){C("#cb-select-all-1").data("wp-toggle",1).trigger("click").removeData("wp-toggle")},a=function(e){return function(){var t=C('select[name="action"]');C('option[value="'+e+'"]',t).prop("selected",!0),C("#doaction").click()}},C.table_hotkeys(C("table.widefat"),["a","u","s","d","r","q","z",["e",e],["shift+x",n],["shift+a",a("approve")],["shift+s",a("spam")],["shift+d",a("delete")],["shift+t",a("trash")],["shift+z",a("untrash")],["shift+u",a("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:t("prev"),next_page_link_cb:t("next"),hotkeys_opts:{disableInInput:!0,type:"keypress",noDisable:'.check-column input[type="checkbox"]'},cycle_expr:"#the-comment-list tr",start_row_index:0})),C("#the-comment-list").on("click",".comment-inline",function(t){t.preventDefault();var e=C(this),t="replyto";void 0!==e.data("action")&&(t=e.data("action")),commentReply.open(e.data("commentId"),e.data("postId"),t)})})}(jQuery);