CoreFiles by mySites.guru
edit-comments.min.js1 lines, 10,905 bytes, from wordpress-3.7.39.zip
Raw History Compare with 3.7.38
md5
51ab08a82d0d36dc3d621ac7edc61be9
sha1
1da3194997ac551c29d2214553be654df65659aa
sha256
4783baecc8d5ea3045bb2b787420326a79c6135f1bf0a52bd6a8d3c22b3204e6
var theList,theExtraList,toggleWithKeyboard=!1;!function(u){var h,f,g,v;setCommentsList=function(){var t,c,p=0,m=u('input[name="_total"]',"#comments-form"),r=u('input[name="_per_page"]',"#comments-form"),l=u('input[name="_page"]',"#comments-form"),e=function(t,e){var n=u("#"+e.element),a=u("#replyrow"),o=u("#comment_ID",a).val(),a=u("#replybtn",a);n.is(".unapproved")?(e.data.id==o&&a.text(adminCommentsL10n.replyApprove),n.find("div.comment_status").html("0")):(e.data.id==o&&a.text(adminCommentsL10n.reply),n.find("div.comment_status").html("1"));e=u("#"+e.element).is("."+e.dimClass)?1:-1;g(e)},n=function(t,e){var n,a,o,s=u(t.target).attr("data-wp-lists"),i=!1;return t.data._total=m.val()||0,t.data._per_page=r.val()||0,t.data._page=l.val()||0,t.data._url=document.location.href,t.data.comment_status=u('input[name="comment_status"]',"#comments-form").val(),-1!=s.indexOf(":trash=1")?i="trash":-1!=s.indexOf(":spam=1")&&(i="spam"),i&&(n=s.replace(/.*?comment-([0-9]+).*/,"$1"),s=u("#comment-"+n),note=u("#"+i+"-undo-holder").html(),s.find(".check-column :checkbox").prop("checked",!1),s.siblings("#replyrow").length&&commentReply.cid==n&&commentReply.close(),a=s.is("tr")?(a=s.children(":visible").length,o=u(".author strong",s).text(),u('<tr id="undo-'+n+'" class="undo un'+i+'" style="display:none;"><td colspan="'+a+'">'+note+"</td></tr>")):(o=u(".comment-author",s).text(),u('<div id="undo-'+n+'" style="display:none;" class="undo un'+i+'">'+note+"</div>")),s.before(a),u("strong","#undo-"+n).text(o),(o=u(".undo a","#undo-"+n)).attr("href","comment.php?action=un"+i+"comment&c="+n+"&_wpnonce="+t.data._ajax_nonce),o.attr("data-wp-lists","delete:the-comment-list:comment-"+n+"::un"+i+"=1"),o.attr("class","vim-z vim-destructive"),u(".avatar",s).clone().prependTo("#undo-"+n+" ."+i+"-undo-inside"),o.click(function(){return e.wpList.del(this),u("#undo-"+n).css({backgroundColor:"#ceb"}).fadeOut(350,function(){u(this).remove(),u("#comment-"+n).css("backgroundColor","").fadeIn(300,function(){u(this).show()})}),!1})),t},d=function(t,e,n){e<p||(n&&(p=e),m.val(t.toString()))};v=function(t){var e,n,a,o=u("#dashboard_right_now");t=t||0,!isNaN(t)&&o.length&&(e=u("span.total-count",o),n=u("span.approved-count",o),a=h(e),o=(a+=t)-h(u("span.pending-count",o))-h(u("span.spam-count",o)),f(e,a),f(n,o))},h=function(t){t=parseInt(t.html().replace(/[^0-9]+/g,""),10);return isNaN(t)?0:t},f=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)}},g=function(n){u("span.pending-count").each(function(){var t=u(this),e=h(t)+n;e<1&&(e=0),t.closest(".awaiting-mod")[0==e?"addClass":"removeClass"]("count-0"),f(t,e)}),v()},t=function(t,e){var n,a,o,s=u(e.target).parent().is("span.untrash"),i=u(e.target).parent().is("span.unspam"),r=u("#"+e.element).is(".unapproved");function l(t){return u(e.target).parent().is("span."+t)?1:u("#"+e.element).is("."+t)?-1:0}a=s?-1:l("trash"),n=i?-1:l("spam"),u(e.target).parent().is("span.unapprove")||(s||i)&&r?o=1:r&&(o=-1),o&&g(o),u("span.spam-count").each(function(){var t=u(this),e=h(t)+n;f(t,e)}),u("span.trash-count").each(function(){var t=u(this),e=h(t)+a;f(t,e)}),u("#dashboard_right_now").length?v(a?-1*a:0):(o=m.val()?parseInt(m.val(),10):0,u(e.target).parent().is("span.undo")?o++:o--,o<0&&(o=0),"object"==typeof t&&p<e.parsed.responses[0].supplemental.time?(total_items_i18n=e.parsed.responses[0].supplemental.total_items_i18n||"",total_items_i18n&&(u(".displaying-num").text(total_items_i18n),u(".total-pages").text(e.parsed.responses[0].supplemental.total_pages_i18n),u(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",e.parsed.responses[0].supplemental.total_pages==u(".current-page").val())),d(o,e.parsed.responses[0].supplemental.time,!0)):d(o,t,!1)),!theExtraList||0==theExtraList.size()||0==theExtraList.children().size()||s||i||(theList.get(0).wpList.add(theExtraList.children(":eq(0)").remove().clone()),c())},c=function(t){var e=u.query.get(),n=u(".total-pages").text(),a=u('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=u.extend(e,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:u("#_ajax_fetch_list_nonce").val()}),u.ajax({url:ajaxurl,global:!1,dataType:"json",data:e,success:function(t){theExtraList.get(0).wpList.add(t.rows)}}))},theExtraList=u("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"}),theList=u("#the-comment-list").wpList({alt:"",delBefore:n,dimAfter:e,delAfter:t,addColor:"none"}).bind("wpListDelEnd",function(t,e){var n=u(e.target).attr("data-wp-lists"),e=e.element.replace(/[^0-9]+/g,"");-1==n.indexOf(":trash=1")&&-1==n.indexOf(":spam=1")||u("#undo-"+e).fadeIn(300,function(){u(this).show()})})},commentReply={cid:"",act:"",init:function(){var t=u("#replyrow");u("a.cancel",t).click(function(){return commentReply.revert()}),u("a.save",t).click(function(){return commentReply.send()}),u("input#author, input#author-email, input#author-url",t).keypress(function(t){if(13==t.which)return commentReply.send(),t.preventDefault(),!1}),u("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(u(this).parent())}),u("#doaction, #doaction2, #post-query-submit").click(function(t){0<u("#the-comment-list #replyrow").length&&commentReply.close()}),this.comments_listing=u('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(t){t.each(function(){u(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(u(this).parent())})})},toggle:function(t){"none"!=u(t).css("display")&&u(t).find("a.vim-q").click()},revert:function(){return u("#the-comment-list #replyrow").length<1||u("#replyrow").fadeOut("fast",function(){commentReply.close()}),!1},close:function(){var t,e=u("#replyrow");e.parent().is("#com-reply")||(this.cid&&"edit-comment"==this.act&&(t=u("#comment-"+this.cid)).fadeIn(300,function(){t.show()}).css("backgroundColor",""),"undefined"!=typeof QTags&&QTags.closeAllTags("replycontent"),u("#add-new-comment").css("display",""),e.hide(),u("#com-reply").append(e),u("#replycontent").css("height","").val(""),u("#edithead input").val(""),u(".error",e).html("").hide(),u(".spinner",e).hide(),this.cid="")},open:function(t,e,n){var a,o,s,i=u("#comment-"+t),r=i.height();return this.close(),this.cid=t,a=u("#replyrow"),o=u("#inline-"+t),s="edit"==(n=n||"replyto")?"edit":"replyto",s=this.act=s+"-comment",u("#action",a).val(s),u("#comment_post_ID",a).val(e),u("#comment_ID",a).val(t),120<r&&u("#replycontent",a).css("height",35+r+"px"),"edit"==n?(u("#author",a).val(u("div.author",o).text()),u("#author-email",a).val(u("div.author-email",o).text()),u("#author-url",a).val(u("div.author-url",o).text()),u("#status",a).val(u("div.comment_status",o).text()),u("#replycontent",a).val(u("textarea.comment",o).val()),u("#edithead, #savebtn",a).show(),u("#replyhead, #replybtn, #addhead, #addbtn",a).hide(),i.after(a).fadeOut("fast",function(){u("#replyrow").fadeIn(300,function(){u(this).show()})})):"add"==n?(u("#addhead, #addbtn",a).show(),u("#replyhead, #replybtn, #edithead, #editbtn",a).hide(),u("#the-comment-list").prepend(a),u("#replyrow").fadeIn(300)):(n=u("#replybtn",a),u("#edithead, #savebtn, #addhead, #addbtn",a).hide(),u("#replyhead, #replybtn",a).show(),i.after(a),i.hasClass("unapproved")?n.text(adminCommentsL10n.replyApprove):n.text(adminCommentsL10n.reply),u("#replyrow").fadeIn(300,function(){u(this).show()})),setTimeout(function(){var t=u("#replyrow").offset().top,e=t+u("#replyrow").height(),n=window.pageYOffset||document.documentElement.scrollTop,a=document.documentElement.clientHeight||self.innerHeight||0;n+a-20<e?window.scroll(0,e-a+35):t-20<n&&window.scroll(0,t-35),u("#replycontent").focus().keyup(function(t){27==t.which&&commentReply.revert()})},600),!1},send:function(){var e={};return u("#replysubmit .error").hide(),u("#replysubmit .spinner").show(),u("#replyrow input").not(":button").each(function(){var t=u(this);e[t.attr("name")]=t.val()}),e.content=u("#replycontent").val(),e.id=e.comment_post_ID,e.comments_listing=this.comments_listing,e.p=u('[name="p"]').val(),u("#comment-"+u("#comment_ID").val()).hasClass("unapproved")&&(e.approve_parent=1),u.ajax({type:"POST",url:ajaxurl,data:e,success:function(t){commentReply.show(t)},error:function(t){commentReply.error(t)}}),!1},show:function(t){var e,n,a,o=this;return"string"==typeof t?(o.error({responseText:t}),!1):(e=wpAjax.parseAjaxResponse(t)).errors?(o.error({responseText:wpAjax.broken}),!1):(o.revert(),t="#comment-"+(e=e.responses[0]).id,"edit-comment"==o.act&&u(t).remove(),void(e.supplemental.parent_approved&&(a=u("#comment-"+e.supplemental.parent_approved),g(-1),"moderated"==this.comments_listing)?a.animate({backgroundColor:"#CCEEBB"},400,function(){a.fadeOut()}):(e=u.trim(e.data),u(e).hide(),u("#replyrow").after(e),t=u(t),o.addEvents(t),n=t.hasClass("unapproved")?"#FFFFE0":t.closest(".widefat, .postbox").css("backgroundColor"),t.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:n},300,function(){a&&a.length&&a.animate({backgroundColor:"#CCEEBB"},300).animate({backgroundColor:n},300).removeClass("unapproved").addClass("approved").find("div.comment_status").html("1")}))))},error:function(t){var e=t.statusText;u("#replysubmit .spinner").hide(),(e=t.responseText?t.responseText.replace(/<.[^<>]*?>/g,""):e)&&u("#replysubmit .error").html(e).show()},addcomment:function(t){var e=this;u("#add-new-comment").fadeOut(200,function(){e.open(0,t,"add"),u("table.comments-box").css("display",""),u("#no-comments").remove()})}},u(document).ready(function(){var t,e,n,a;setCommentsList(),commentReply.init(),u(document).delegate("span.delete a.delete","click",function(){return!1}),void 0!==u.table_hotkeys&&(t=function(n){return function(){var t="next"==n?"first":"last",e=u(".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=u("span.edit a",e).attr("href")},n=function(){toggleWithKeyboard=!0,u("input:checkbox","#cb").click().prop("checked",!1),toggleWithKeyboard=!1},a=function(e){return function(){var t=u('select[name="action"]');u('option[value="'+e+'"]',t).prop("selected",!0),u("#doaction").click()}},u.table_hotkeys(u("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")}))})}(jQuery);

The same content is in 6 releases, WordPress 3.7.36 to 3.7.41. See them all, or every version of this file.