1 !function(a){var b,c,d,e,f,g,h,i,j,k,l=document.title,m=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=b<1?"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;f<1&&(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;f<1&&(f=0),c(d,f)})},h=function(b){m&&b&&b.i18n_comments_text&&a(".comment-count a","#dashboard_right_now").text(b.i18n_comments_text)},i=function(b){b&&b.i18n_moderation_text&&(a(".comments-in-moderation-text").text(b.i18n_moderation_text),m&&b.in_moderation&&a(".comment-mod-count","#dashboard_right_now")[b.in_moderation>0?"removeClass":"addClass"]("hidden"))},g=function(d){var e,f,g,h;k=k||new RegExp(adminCommentsL10n.docTitleCommentsCount.replace("%s","\\([0-9"+thousandsSeparator+"]+\\)")+"?"),j=j||a("<div />"),e=l,h=k.exec(document.title),h?(h=h[0],j.html(h),g=b(j)+d):(j.html(0),g=d),g>=1?(c(j,g),f=k.exec(document.title),f&&(e=document.title.replace(f[0],adminCommentsL10n.docTitleCommentsCount.replace("%s",j.text())+" "))):(f=k.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",l="comment-count-pending";m||g(d),a("span.pending-count").each(function(){var e=a(this),f=b(e)+d;f<1&&(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;f<1&&(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)}))},window.setCommentsList=function(){var c,g,j,k,l,n,o,p,q,r=0;c=a('input[name="_total"]',"#comments-form"),g=a('input[name="_per_page"]',"#comments-form"),j=a('input[name="_page"]',"#comments-form"),n=function(a,b,d){b<r||(d&&(r=b),c.val(a.toString()))},k=function(b,c){var d,g,j,k,l=a("#"+c.element);!0!==c.parsed&&(k=c.parsed.responses[0]),d=a("#replyrow"),g=a("#comment_ID",d).val(),j=a("#replybtn",d),l.is(".unapproved")?(c.data.id==g&&j.text(adminCommentsL10n.replyApprove),l.find(".row-actions span.view").addClass("hidden").end().find("div.comment_status").html("0")):(c.data.id==g&&j.text(adminCommentsL10n.reply),l.find(".row-actions span.view").removeClass("hidden").end().find("div.comment_status").html("1")),q=a("#"+c.element).is("."+c.dimClass)?1:-1,k?(h(k.supplemental),i(k.supplemental),e(q,k.supplemental.postId),f(-1*q,k.supplemental.postId)):(e(q),f(-1*q))},l=function(b,d){var e,f,h,i,k,l,m,n=!1,o=a(b.target).attr("data-wp-lists");return b.data._total=c.val()||0,b.data._per_page=g.val()||0,b.data._page=j.val()||0,b.data._url=document.location.href,b.data.comment_status=a('input[name="comment_status"]',"#comments-form").val(),o.indexOf(":trash=1")!=-1?n="trash":o.indexOf(":spam=1")!=-1&&(n="spam"),n&&(f=o.replace(/.*?comment-([0-9]+).*/,"$1"),h=a("#comment-"+f),e=a("#"+n+"-undo-holder").html(),h.find(".check-column :checkbox").prop("checked",!1),h.siblings("#replyrow").length&&commentReply.cid==f&&commentReply.close(),h.is("tr")?(i=h.children(":visible").length,m=a(".author strong",h).text(),k=a('<tr id="undo-'+f+'" class="undo un'+n+'" style="display:none;"><td colspan="'+i+'">'+e+"</td></tr>")):(m=a(".comment-author",h).text(),k=a('<div id="undo-'+f+'" style="display:none;" class="undo un'+n+'">'+e+"</div>")),h.before(k),a("strong","#undo-"+f).text(m),l=a(".undo a","#undo-"+f),l.attr("href","comment.php?action=un"+n+"comment&c="+f+"&_wpnonce="+b.data._ajax_nonce),l.attr("data-wp-lists","delete:the-comment-list:comment-"+f+"::un"+n+"=1"),l.attr("class","vim-z vim-destructive aria-button-if-js"),a(".avatar",h).first().clone().prependTo("#undo-"+f+" ."+n+"-undo-inside"),l.click(function(b){b.preventDefault(),b.stopPropagation(),d.wpList.del(this),a("#undo-"+f).css({backgroundColor:"#ceb"}).fadeOut(350,function(){a(this).remove(),a("#comment-"+f).css("backgroundColor","").fadeIn(300,function(){a(this).show()})})})),b},o=function(g,j){var k,l,o,q,s,t,u,v,w=!0===j.parsed?{}:j.parsed.responses[0],x=!0===j.parsed?"":w.supplemental.status,y=!0===j.parsed?"":w.supplemental.postId,z=!0===j.parsed?"":w.supplemental,A=a(j.target).parent(),B=a("#"+j.element),C=B.hasClass("approved")&&!B.hasClass("unapproved"),D=B.hasClass("unapproved"),E=B.hasClass("spam"),F=B.hasClass("trash"),G=!1;h(z),i(z),A.is("span.undo")?(A.hasClass("unspam")?(s=-1,"trash"===x?t=1:"1"===x?v=1:"0"===x&&(u=1)):A.hasClass("untrash")&&(t=-1,"spam"===x?s=1:"1"===x?v=1:"0"===x&&(u=1)),G=!0):A.is("span.spam")?(C?v=-1:D?u=-1:F&&(t=-1),s=1):A.is("span.unspam")?(C?u=1:D?v=1:F?A.hasClass("approve")?v=1:A.hasClass("unapprove")&&(u=1):E&&(A.hasClass("approve")?v=1:A.hasClass("unapprove")&&(u=1)),s=-1):A.is("span.trash")?(C?v=-1:D?u=-1:E&&(s=-1),t=1):A.is("span.untrash")?(C?u=1:D?v=1:F&&(A.hasClass("approve")?v=1:A.hasClass("unapprove")&&(u=1)),t=-1):A.is("span.approve:not(.unspam):not(.untrash)")?(v=1,u=-1):A.is("span.unapprove:not(.unspam):not(.untrash)")?(v=-1,u=1):A.is("span.delete")&&(E?s=-1:F&&(t=-1)),u&&(e(u,y),d("span.all-count",u)),v&&(f(v,y),d("span.all-count",v)),s&&d("span.spam-count",s),t&&d("span.trash-count",t),("trash"===j.data.comment_status&&!b(a("span.trash-count"))||"spam"===j.data.comment_status&&!b(a("span.spam-count")))&&a("#delete_all").hide(),m||(l=c.val()?parseInt(c.val(),10):0,a(j.target).parent().is("span.undo")?l++:l--,l<0&&(l=0),"object"==typeof g?w.supplemental.total_items_i18n&&r<w.supplemental.time?(k=w.supplemental.total_items_i18n||"",k&&(a(".displaying-num").text(k),a(".total-pages").text(w.supplemental.total_pages_i18n),a(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",w.supplemental.total_pages==a(".current-page").val())),n(l,w.supplemental.time,!0)):w.supplemental.time&&n(l,w.supplemental.time,!1):n(l,g,!1)),theExtraList&&0!==theExtraList.length&&0!==theExtraList.children().length&&!G&&(theList.get(0).wpList.add(theExtraList.children(":eq(0):not(.no-items)").remove().clone()),p(),o=a(":animated","#the-comment-list"),q=function(){a("#the-comment-list tr:visible").length||theList.get(0).wpList.add(theExtraList.find(".no-items").clone())},o.length?o.promise().done(q):q())},p=function(b){var c=a.query.get(),d=a(".total-pages").text(),e=a('input[name="_per_page"]',"#comments-form").val();c.paged||(c.paged=1),c.paged>d||(b?(theExtraList.empty(),c.number=Math.min(8,e)):(c.number=1,c.offset=Math.min(8,e)-1),c.no_placeholder=!0,c.paged++,!0===c.comment_type&&(c.comment_type=""),c=a.extend(c,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:a("#_ajax_fetch_list_nonce").val()}),a.ajax({url:ajaxurl,global:!1,dataType:"json",data:c,success:function(a){theExtraList.get(0).wpList.add(a.rows)}}))},window.theExtraList=a("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"}),window.theList=a("#the-comment-list").wpList({alt:"",delBefore:l,dimAfter:k,delAfter:o,addColor:"none"}).bind("wpListDelEnd",function(b,c){var d=a(c.target).attr("data-wp-lists"),e=c.element.replace(/[^0-9]+/g,"");d.indexOf(":trash=1")==-1&&d.indexOf(":spam=1")==-1||a("#undo-"+e).fadeIn(300,function(){a(this).show()})})},window.commentReply={cid:"",act:"",originalContent:"",init:function(){var b=a("#replyrow");a(".cancel",b).click(function(){return commentReply.revert()}),a(".save",b).click(function(){return commentReply.send()}),a("input#author-name, input#author-email, input#author-url",b).keypress(function(a){if(13==a.which)return commentReply.send(),a.preventDefault(),!1}),a("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(a(this).parent())}),a("#doaction, #doaction2, #post-query-submit").click(function(){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){"none"!==a(b).css("display")&&(a("#replyrow").parent().is("#com-reply")||window.confirm(adminCommentsL10n.warnQuickEdit))&&a(b).find("a.vim-q").click()},revert:function(){return!(a("#the-comment-list #replyrow").length<1)&&void a("#replyrow").fadeOut("fast",function(){commentReply.close()})},close:function(){var b=a(),c=a("#replyrow");c.parent().is("#com-reply")||(this.cid&&(b=a("#comment-"+this.cid)),"edit-comment"===this.act&&b.fadeIn(300,function(){b.show().find(".vim-q").attr("aria-expanded","false").focus()}).css("backgroundColor",""),"replyto-comment"===this.act&&b.find(".vim-r").attr("aria-expanded","false").focus(),"undefined"!=typeof QTags&&QTags.closeAllTags("replycontent"),a("#add-new-comment").css("display",""),c.hide(),a("#com-reply").append(c),a("#replycontent").css("height","").val(""),a("#edithead input").val(""),a(".notice-error",c).addClass("hidden").find(".error").empty(),a(".spinner",c).removeClass("is-active"),this.cid="",this.originalContent="")},open:function(b,c,d){var e,f,g,h,i,j=this,k=a("#comment-"+b),l=k.height(),m=0;return!!this.discardCommentChanges()&&(j.close(),j.cid=b,e=a("#replyrow"),f=a("#inline-"+b),d=d||"replyto",g="edit"==d?"edit":"replyto",g=j.act=g+"-comment",j.originalContent=a("textarea.comment",f).val(),m=a("> th:visible, > td:visible",k).length,e.hasClass("inline-edit-row")&&0!==m&&a("td",e).attr("colspan",m),a("#action",e).val(g),a("#comment_post_ID",e).val(c),a("#comment_ID",e).val(b),"edit"==d?(a("#author-name",e).val(a("div.author",f).text()),a("#author-email",e).val(a("div.author-email",f).text()),a("#author-url",e).val(a("div.author-url",f).text()),a("#status",e).val(a("div.comment_status",f).text()),a("#replycontent",e).val(a("textarea.comment",f).val()),a("#edithead, #editlegend, #savebtn",e).show(),a("#replyhead, #replybtn, #addhead, #addbtn",e).hide(),l>120&&(i=l>500?500:l,a("#replycontent",e).css("height",i+"px")),k.after(e).fadeOut("fast",function(){a("#replyrow").fadeIn(300,function(){a(this).show()})})):"add"==d?(a("#addhead, #addbtn",e).show(),a("#replyhead, #replybtn, #edithead, #editlegend, #savebtn",e).hide(),a("#the-comment-list").prepend(e),a("#replyrow").fadeIn(300)):(h=a("#replybtn",e),a("#edithead, #editlegend, #savebtn, #addhead, #addbtn",e).hide(),a("#replyhead, #replybtn",e).show(),k.after(e),k.hasClass("unapproved")?h.text(adminCommentsL10n.replyApprove):h.text(adminCommentsL10n.reply),a("#replyrow").fadeIn(300,function(){a(this).show()})),setTimeout(function(){var b,c,d,e,f;b=a("#replyrow").offset().top,c=b+a("#replyrow").height(),d=window.pageYOffset||document.documentElement.scrollTop,e=document.documentElement.clientHeight||window.innerHeight||0,f=d+e,f-20<c?window.scroll(0,c-e+35):b-20<d&&window.scroll(0,b-35),a("#replycontent").focus().keyup(function(a){27==a.which&&commentReply.revert()})},600),!1)},send:function(){var b={},c=a("#replysubmit .error-notice");c.addClass("hidden"),a("#replysubmit .spinner").addClass("is-active"),a("#replyrow input").not(":button").each(function(){var c=a(this);b[c.attr("name")]=c.val()}),b.content=a("#replycontent").val(),b.id=b.comment_post_ID,b.comments_listing=this.comments_listing,b.p=a('[name="p"]').val(),a("#comment-"+a("#comment_ID").val()).hasClass("unapproved")&&(b.approve_parent=1),a.ajax({type:"POST",url:ajaxurl,data:b,success:function(a){commentReply.show(a)},error:function(a){commentReply.error(a)}})},show:function(b){var c,g,j,k,l,m=this;return"string"==typeof b?(m.error({responseText:b}),!1):(c=wpAjax.parseAjaxResponse(b),c.errors?(m.error({responseText:wpAjax.broken}),!1):(m.revert(),c=c.responses[0],j="#comment-"+c.id,"edit-comment"==m.act&&a(j).remove(),c.supplemental.parent_approved&&(l=a("#comment-"+c.supplemental.parent_approved),e(-1,c.supplemental.parent_post_id),"moderated"==this.comments_listing)?void l.animate({backgroundColor:"#CCEEBB"},400,function(){l.fadeOut()}):(c.supplemental.i18n_comments_text&&(h(c.supplemental),i(c.supplemental),f(1,c.supplemental.parent_post_id),d("span.all-count",1)),g=a.trim(c.data),a(g).hide(),a("#replyrow").after(g),j=a(j),m.addEvents(j),k=j.hasClass("unapproved")?"#FFFFE0":j.closest(".widefat, .postbox").css("backgroundColor"),void j.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:k},300,function(){l&&l.length&&l.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:k},300).removeClass("unapproved").addClass("approved").find("div.comment_status").html("1")}))))},error:function(b){var c=b.statusText,d=a("#replysubmit .notice-error"),e=d.find(".error");a("#replysubmit .spinner").removeClass("is-active"),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&(d.removeClass("hidden"),e.html(c))},addcomment:function(b){var c=this;a("#add-new-comment").fadeOut(200,function(){c.open(0,b,"add"),a("table.comments-box").css("display",""),a("#no-comments").remove()})},discardCommentChanges:function(){var b=a("#replyrow");return this.originalContent===a("#replycontent",b).val()||window.confirm(adminCommentsL10n.warnCommentChanges)}},a(document).ready(function(){var b,c,d,e;setCommentsList(),commentReply.init(),a(document).on("click","span.delete a.delete",function(a){a.preventDefault()}),"undefined"!=typeof a.table_hotkeys&&(b=function(b){return function(){var c,d;c="next"==b?"first":"last",d=a(".tablenav-pages ."+b+"-page:not(.disabled)"),d.length&&(window.location=d[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+c+"=1")}},c=function(b,c){window.location=a("span.edit a",c).attr("href")},d=function(){a("#cb-select-all-1").data("wp-toggle",1).trigger("click").removeData("wp-toggle")},e=function(b){return function(){var c=a('select[name="action"]');a('option[value="'+b+'"]',c).prop("selected",!0),a("#doaction").click()}},a.table_hotkeys(a("table.widefat"),["a","u","s","d","r","q","z",["e",c],["shift+x",d],["shift+a",e("approve")],["shift+s",e("spam")],["shift+d",e("delete")],["shift+t",e("trash")],["shift+z",e("untrash")],["shift+u",e("unapprove")]],{highlight_first:adminCommentsL10n.hotkeys_highlight_first,highlight_last:adminCommentsL10n.hotkeys_highlight_last,prev_page_link_cb:b("prev"),next_page_link_cb:b("next"),hotkeys_opts:{disableInInput:!0,type:"keypress",noDisable:'.check-column input[type="checkbox"]'},cycle_expr:"#the-comment-list tr",start_row_index:0})),a("#the-comment-list").on("click",".comment-inline",function(){var b=a(this),c="replyto";"undefined"!=typeof b.data("action")&&(c=b.data("action")),a(this).attr("aria-expanded","true"),commentReply.open(b.data("commentId"),b.data("postId"),c)})})}(jQuery); |
1 /*! This file is auto-generated */ |
|
2 !function(E){var R,l,I,L,T,p,j,D,s,i,r=document.title,O=E("#dashboard_right_now").length,u=wp.i18n.__;R=function(t){var e=parseInt(t.html().replace(/[^0-9]+/g,""),10);return isNaN(e)?0:e},l=function(t,e){var n="";if(!isNaN(e)){if(3<(e=e<1?"0":e.toString()).length){for(;3<e.length;)n=thousandsSeparator+e.substr(e.length-3)+n,e=e.substr(0,e.length-3);e+=n}t.html(e)}},T=function(n,t){var e,a,o=".post-com-count-"+t,s="comment-count-no-comments",i="comment-count-approved";I("span.approved-count",n),t&&(e=E("span."+i,o),a=E("span."+s,o),e.each(function(){var t=E(this),e=R(t)+n;e<1&&(e=0),0===e?t.removeClass(i).addClass(s):t.addClass(i).removeClass(s),l(t,e)}),a.each(function(){var t=E(this);0<n?t.removeClass(s).addClass(i):t.addClass(s).removeClass(i),l(t,n)}))},I=function(t,n){E(t).each(function(){var t=E(this),e=R(t)+n;e<1&&(e=0),l(t,e)})},j=function(t){O&&t&&t.i18n_comments_text&&E(".comment-count a","#dashboard_right_now").text(t.i18n_comments_text)},D=function(t){t&&t.i18n_moderation_text&&(E(".comments-in-moderation-text").text(t.i18n_moderation_text),O&&t.in_moderation&&E(".comment-mod-count","#dashboard_right_now")[0<t.in_moderation?"removeClass":"addClass"]("hidden"))},p=function(t){var e,n,a,o;i=i||new RegExp(u("Comments (%s)").replace("%s","\\([0-9"+thousandsSeparator+"]+\\)")+"?"),s=s||E("<div />"),e=r,1<=(a=(o=i.exec(document.title))?(o=o[0],s.html(o),R(s)+t):(s.html(0),t))?(l(s,a),(n=i.exec(document.title))&&(e=document.title.replace(n[0],u("Comments (%s)").replace("%s",s.text())+" "))):(n=i.exec(e))&&(e=e.replace(n[0],u("Comments"))),document.title=e},L=function(n,t){var e,a,o=".post-com-count-"+t,s="comment-count-no-pending",i="post-com-count-no-pending",r="comment-count-pending";O||p(n),E("span.pending-count").each(function(){var t=E(this),e=R(t)+n;e<1&&(e=0),t.closest(".awaiting-mod")[0===e?"addClass":"removeClass"]("count-0"),l(t,e)}),t&&(e=E("span."+r,o),a=E("span."+s,o),e.each(function(){var t=E(this),e=R(t)+n;e<1&&(e=0),0===e?(t.parent().addClass(i),t.removeClass(r).addClass(s)):(t.parent().removeClass(i),t.addClass(r).removeClass(s)),l(t,e)}),a.each(function(){var t=E(this);0<n?(t.parent().removeClass(i),t.removeClass(s).addClass(r)):(t.parent().addClass(i),t.addClass(s).removeClass(r)),l(t,n)}))},window.setCommentsList=function(){var w,d,m,t,e,x,n,b,r,k=0;w=E('input[name="_total"]',"#comments-form"),d=E('input[name="_per_page"]',"#comments-form"),m=E('input[name="_page"]',"#comments-form"),x=function(t,e,n){e<k||(n&&(k=e),w.val(t.toString()))},t=function(t,e){var n,a,o,s,i=E("#"+e.element);!0!==e.parsed&&(s=e.parsed.responses[0]),n=E("#replyrow"),a=E("#comment_ID",n).val(),o=E("#replybtn",n),i.is(".unapproved")?(e.data.id==a&&o.text(u("Approve and Reply")),i.find(".row-actions span.view").addClass("hidden").end().find("div.comment_status").html("0")):(e.data.id==a&&o.text(u("Reply")),i.find(".row-actions span.view").removeClass("hidden").end().find("div.comment_status").html("1")),r=E("#"+e.element).is("."+e.dimClass)?1:-1,s?(j(s.supplemental),D(s.supplemental),L(r,s.supplemental.postId),T(-1*r,s.supplemental.postId)):(L(r),T(-1*r))},e=function(t,e){var n,a,o,s,i,r,l,p=!1,c=E(t.target).attr("data-wp-lists");return t.data._total=w.val()||0,t.data._per_page=d.val()||0,t.data._page=m.val()||0,t.data._url=document.location.href,t.data.comment_status=E('input[name="comment_status"]',"#comments-form").val(),-1!=c.indexOf(":trash=1")?p="trash":-1!=c.indexOf(":spam=1")&&(p="spam"),p&&(a=c.replace(/.*?comment-([0-9]+).*/,"$1"),o=E("#comment-"+a),n=E("#"+p+"-undo-holder").html(),o.find(".check-column :checkbox").prop("checked",!1),o.siblings("#replyrow").length&&commentReply.cid==a&&commentReply.close(),i=o.is("tr")?(s=o.children(":visible").length,l=E(".author strong",o).text(),E('<tr id="undo-'+a+'" class="undo un'+p+'" style="display:none;"><td colspan="'+s+'">'+n+"</td></tr>")):(l=E(".comment-author",o).text(),E('<div id="undo-'+a+'" style="display:none;" class="undo un'+p+'">'+n+"</div>")),o.before(i),E("strong","#undo-"+a).text(l),(r=E(".undo a","#undo-"+a)).attr("href","comment.php?action=un"+p+"comment&c="+a+"&_wpnonce="+t.data._ajax_nonce),r.attr("data-wp-lists","delete:the-comment-list:comment-"+a+"::un"+p+"=1"),r.attr("class","vim-z vim-destructive aria-button-if-js"),E(".avatar",o).first().clone().prependTo("#undo-"+a+" ."+p+"-undo-inside"),r.click(function(t){t.preventDefault(),t.stopPropagation(),e.wpList.del(this),E("#undo-"+a).css({backgroundColor:"#ceb"}).fadeOut(350,function(){E(this).remove(),E("#comment-"+a).css("backgroundColor","").fadeIn(300,function(){E(this).show()})})})),t},n=function(t,e){var n,a,o,s,i,r,l,p,c=!0===e.parsed?{}:e.parsed.responses[0],d=!0===e.parsed?"":c.supplemental.status,m=!0===e.parsed?"":c.supplemental.postId,u=!0===e.parsed?"":c.supplemental,h=E(e.target).parent(),f=E("#"+e.element),v=f.hasClass("approved")&&!f.hasClass("unapproved"),g=f.hasClass("unapproved"),_=f.hasClass("spam"),y=f.hasClass("trash"),C=!1;j(u),D(u),h.is("span.undo")?(h.hasClass("unspam")?(i=-1,"trash"===d?r=1:"1"===d?p=1:"0"===d&&(l=1)):h.hasClass("untrash")&&(r=-1,"spam"===d?i=1:"1"===d?p=1:"0"===d&&(l=1)),C=!0):h.is("span.spam")?(v?p=-1:g?l=-1:y&&(r=-1),i=1):h.is("span.unspam")?(v?l=1:g?p=1:y?h.hasClass("approve")?p=1:h.hasClass("unapprove")&&(l=1):_&&(h.hasClass("approve")?p=1:h.hasClass("unapprove")&&(l=1)),i=-1):h.is("span.trash")?(v?p=-1:g?l=-1:_&&(i=-1),r=1):h.is("span.untrash")?(v?l=1:g?p=1:y&&(h.hasClass("approve")?p=1:h.hasClass("unapprove")&&(l=1)),r=-1):h.is("span.approve:not(.unspam):not(.untrash)")?l=-(p=1):h.is("span.unapprove:not(.unspam):not(.untrash)")?(p=-1,l=1):h.is("span.delete")&&(_?i=-1:y&&(r=-1)),l&&(L(l,m),I("span.all-count",l)),p&&(T(p,m),I("span.all-count",p)),i&&I("span.spam-count",i),r&&I("span.trash-count",r),("trash"===e.data.comment_status&&!R(E("span.trash-count"))||"spam"===e.data.comment_status&&!R(E("span.spam-count")))&&E("#delete_all").hide(),O||(a=w.val()?parseInt(w.val(),10):0,E(e.target).parent().is("span.undo")?a++:a--,a<0&&(a=0),"object"==typeof t?c.supplemental.total_items_i18n&&k<c.supplemental.time?((n=c.supplemental.total_items_i18n||"")&&(E(".displaying-num").text(n.replace(" ",String.fromCharCode(160))),E(".total-pages").text(c.supplemental.total_pages_i18n.replace(" ",String.fromCharCode(160))),E(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",c.supplemental.total_pages==E(".current-page").val())),x(a,c.supplemental.time,!0)):c.supplemental.time&&x(a,c.supplemental.time,!1):x(a,t,!1)),theExtraList&&0!==theExtraList.length&&0!==theExtraList.children().length&&!C&&(theList.get(0).wpList.add(theExtraList.children(":eq(0):not(.no-items)").remove().clone()),b(),s=function(){E("#the-comment-list tr:visible").length||theList.get(0).wpList.add(theExtraList.find(".no-items").clone())},(o=E(":animated","#the-comment-list")).length?o.promise().done(s):s())},b=function(t){var e=E.query.get(),n=E(".total-pages").text(),a=E('input[name="_per_page"]',"#comments-form").val();e.paged||(e.paged=1),e.paged>n||(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=E.extend(e,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:E("#_ajax_fetch_list_nonce").val()}),E.ajax({url:ajaxurl,global:!1,dataType:"json",data:e,success:function(t){theExtraList.get(0).wpList.add(t.rows)}}))},window.theExtraList=E("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"}),window.theList=E("#the-comment-list").wpList({alt:"",delBefore:e,dimAfter:t,delAfter:n,addColor:"none"}).bind("wpListDelEnd",function(t,e){var n=E(e.target).attr("data-wp-lists"),a=e.element.replace(/[^0-9]+/g,"");-1==n.indexOf(":trash=1")&&-1==n.indexOf(":spam=1")||E("#undo-"+a).fadeIn(300,function(){E(this).show()})})},window.commentReply={cid:"",act:"",originalContent:"",init:function(){var t=E("#replyrow");E(".cancel",t).click(function(){return commentReply.revert()}),E(".save",t).click(function(){return commentReply.send()}),E("input#author-name, input#author-email, input#author-url",t).keypress(function(t){if(13==t.which)return commentReply.send(),t.preventDefault(),!1}),E("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(E(this).parent())}),E("#doaction, #doaction2, #post-query-submit").click(function(){0<E("#the-comment-list #replyrow").length&&commentReply.close()}),this.comments_listing=E('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(t){t.each(function(){E(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(E(this).parent())})})},toggle:function(t){"none"!==E(t).css("display")&&(E("#replyrow").parent().is("#com-reply")||window.confirm(u("Are you sure you want to edit this comment?\nThe changes you made will be lost.")))&&E(t).find("button.vim-q").click()},revert:function(){if(E("#the-comment-list #replyrow").length<1)return!1;E("#replyrow").fadeOut("fast",function(){commentReply.close()})},close:function(){var t=E(),e=E("#replyrow");e.parent().is("#com-reply")||(this.cid&&(t=E("#comment-"+this.cid)),"edit-comment"===this.act&&t.fadeIn(300,function(){t.show().find(".vim-q").attr("aria-expanded","false").focus()}).css("backgroundColor",""),"replyto-comment"===this.act&&t.find(".vim-r").attr("aria-expanded","false").focus(),"undefined"!=typeof QTags&&QTags.closeAllTags("replycontent"),E("#add-new-comment").css("display",""),e.hide(),E("#com-reply").append(e),E("#replycontent").css("height","").val(""),E("#edithead input").val(""),E(".notice-error",e).addClass("hidden").find(".error").empty(),E(".spinner",e).removeClass("is-active"),this.cid="",this.originalContent="")},open:function(t,e,n){var a,o,s,i,r,l,p=E("#comment-"+t),c=p.height();return this.discardCommentChanges()&&(this.close(),this.cid=t,a=E("#replyrow"),o=E("#inline-"+t),s="edit"==(n=n||"replyto")?"edit":"replyto",s=this.act=s+"-comment",this.originalContent=E("textarea.comment",o).val(),l=E("> th:visible, > td:visible",p).length,a.hasClass("inline-edit-row")&&0!==l&&E("td",a).attr("colspan",l),E("#action",a).val(s),E("#comment_post_ID",a).val(e),E("#comment_ID",a).val(t),"edit"==n?(E("#author-name",a).val(E("div.author",o).text()),E("#author-email",a).val(E("div.author-email",o).text()),E("#author-url",a).val(E("div.author-url",o).text()),E("#status",a).val(E("div.comment_status",o).text()),E("#replycontent",a).val(E("textarea.comment",o).val()),E("#edithead, #editlegend, #savebtn",a).show(),E("#replyhead, #replybtn, #addhead, #addbtn",a).hide(),120<c&&(r=500<c?500:c,E("#replycontent",a).css("height",r+"px")),p.after(a).fadeOut("fast",function(){E("#replyrow").fadeIn(300,function(){E(this).show()})})):"add"==n?(E("#addhead, #addbtn",a).show(),E("#replyhead, #replybtn, #edithead, #editlegend, #savebtn",a).hide(),E("#the-comment-list").prepend(a),E("#replyrow").fadeIn(300)):(i=E("#replybtn",a),E("#edithead, #editlegend, #savebtn, #addhead, #addbtn",a).hide(),E("#replyhead, #replybtn",a).show(),p.after(a),p.hasClass("unapproved")?i.text(u("Approve and Reply")):i.text(u("Reply")),E("#replyrow").fadeIn(300,function(){E(this).show()})),setTimeout(function(){var t,e,n,a;e=(t=E("#replyrow").offset().top)+E("#replyrow").height(),(n=window.pageYOffset||document.documentElement.scrollTop)+(a=document.documentElement.clientHeight||window.innerHeight||0)-20<e?window.scroll(0,e-a+35):t-20<n&&window.scroll(0,t-35),E("#replycontent").focus().keyup(function(t){27==t.which&&commentReply.revert()})},600)),!1},send:function(){var e={};E("#replysubmit .error-notice").addClass("hidden"),E("#replysubmit .spinner").addClass("is-active"),E("#replyrow input").not(":button").each(function(){var t=E(this);e[t.attr("name")]=t.val()}),e.content=E("#replycontent").val(),e.id=e.comment_post_ID,e.comments_listing=this.comments_listing,e.p=E('[name="p"]').val(),E("#comment-"+E("#comment_ID").val()).hasClass("unapproved")&&(e.approve_parent=1),E.ajax({type:"POST",url:ajaxurl,data:e,success:function(t){commentReply.show(t)},error:function(t){commentReply.error(t)}})},show:function(t){var e,n,a,o,s,i=this;return"string"==typeof t?(i.error({responseText:t}),!1):(e=wpAjax.parseAjaxResponse(t)).errors?(i.error({responseText:wpAjax.broken}),!1):(i.revert(),a="#comment-"+(e=e.responses[0]).id,"edit-comment"==i.act&&E(a).remove(),void(e.supplemental.parent_approved&&(s=E("#comment-"+e.supplemental.parent_approved),L(-1,e.supplemental.parent_post_id),"moderated"==this.comments_listing)?s.animate({backgroundColor:"#CCEEBB"},400,function(){s.fadeOut()}):(e.supplemental.i18n_comments_text&&(j(e.supplemental),D(e.supplemental),T(1,e.supplemental.parent_post_id),I("span.all-count",1)),n=E.trim(e.data),E(n).hide(),E("#replyrow").after(n),a=E(a),i.addEvents(a),o=a.hasClass("unapproved")?"#FFFFE0":a.closest(".widefat, .postbox").css("backgroundColor"),a.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:o},300,function(){s&&s.length&&s.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:o},300).removeClass("unapproved").addClass("approved").find("div.comment_status").html("1")}))))},error:function(t){var e=t.statusText,n=E("#replysubmit .notice-error"),a=n.find(".error");E("#replysubmit .spinner").removeClass("is-active"),t.responseText&&(e=t.responseText.replace(/<.[^<>]*?>/g,"")),e&&(n.removeClass("hidden"),a.html(e))},addcomment:function(t){var e=this;E("#add-new-comment").fadeOut(200,function(){e.open(0,t,"add"),E("table.comments-box").css("display",""),E("#no-comments").remove()})},discardCommentChanges:function(){var t=E("#replyrow");return this.originalContent===E("#replycontent",t).val()||window.confirm(u("Are you sure you want to do this?\nThe comment changes you made will be lost."))}},E(document).ready(function(){var t,e,n,a;setCommentsList(),commentReply.init(),E(document).on("click","span.delete a.delete",function(t){t.preventDefault()}),void 0!==E.table_hotkeys&&(t=function(n){return function(){var t,e;t="next"==n?"first":"last",(e=E(".tablenav-pages ."+n+"-page:not(.disabled)")).length&&(window.location=e[0].href.replace(/\&hotkeys_highlight_(first|last)=1/g,"")+"&hotkeys_highlight_"+t+"=1")}},e=function(t,e){window.location=E("span.edit a",e).attr("href")},n=function(){E("#cb-select-all-1").data("wp-toggle",1).trigger("click").removeData("wp-toggle")},a=function(e){return function(){var t=E('select[name="action"]');E('option[value="'+e+'"]',t).prop("selected",!0),E("#doaction").click()}},E.table_hotkeys(E("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:adminCommentsSettings.hotkeys_highlight_first,highlight_last:adminCommentsSettings.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})),E("#the-comment-list").on("click",".comment-inline",function(){var t=E(this),e="replyto";void 0!==t.data("action")&&(e=t.data("action")),E(this).attr("aria-expanded","true"),commentReply.open(t.data("commentId"),t.data("postId"),e)})})}(jQuery); |