mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-23 07:51:49 +01:00
This updates the 4.2 branch to support the latest LTS version of NodeJS (currently 14.x), allowing the same version to be used across all WordPress branches that receive security updates as a courtesy. Because older branches use (really) old versions of NodeJS, the local Docker environment cannot be backported since the needed dependencies will not run on these older versions (see #48301). This also blocks the ability to move automated testing over to GitHub Actions (see #50401). This change also introduces a `packager-lock.json` file to the branch. In addition to backporting the package updates that happened after branching 4.2, dependencies that were removed in future releases have also been updated to their latest versions. Props desrosj, dd32, netweb, jorbin. Merges [32356-32357,32988,33726,34888,35335,35363,35513,35521,35538-35541,35859,36861-36865,36935,36979,37017,37019-37020,37212,37612,38111,39110,39113,39115-39119,39478,41835,42460,42461,42463,42887,43320,43323,43977,44219,44233,45321,45765,46404,46408-46409,47404,47867,47872-47873,48705,49636,49933,49937,49939,50126,50176,50185] to the 4.2 branch. See #52341. Built from https://develop.svn.wordpress.org/branches/4.2@50214 git-svn-id: http://core.svn.wordpress.org/branches/4.2@49883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
var setCommentsList,theList,theExtraList,commentReply;!function(h){var f,v,g;setCommentsList=function(){var t,c,s,m=0,p=h('input[name="_total"]',"#comments-form"),l=h('input[name="_per_page"]',"#comments-form"),d=h('input[name="_page"]',"#comments-form"),e=function(t,e){var n=h("#"+e.element),a=h("#replyrow"),o=h("#comment_ID",a).val(),a=h("#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")),s=h("#"+e.element).is("."+e.dimClass)?1:-1,g(s)},n=function(t,e){var n,a,o,s,i=!1,r=h(t.target).attr("data-wp-lists");return t.data._total=p.val()||0,t.data._per_page=l.val()||0,t.data._page=d.val()||0,t.data._url=document.location.href,t.data.comment_status=h('input[name="comment_status"]',"#comments-form").val(),-1!=r.indexOf(":trash=1")?i="trash":-1!=r.indexOf(":spam=1")&&(i="spam"),i&&(n=r.replace(/.*?comment-([0-9]+).*/,"$1"),a=h("#comment-"+n),o=h("#"+i+"-undo-holder").html(),a.find(".check-column :checkbox").prop("checked",!1),a.siblings("#replyrow").length&&commentReply.cid==n&&commentReply.close(),o=a.is("tr")?(r=a.children(":visible").length,s=h(".author strong",a).text(),h('<tr id="undo-'+n+'" class="undo un'+i+'" style="display:none;"><td colspan="'+r+'">'+o+"</td></tr>")):(s=h(".comment-author",a).text(),h('<div id="undo-'+n+'" style="display:none;" class="undo un'+i+'">'+o+"</div>")),a.before(o),h("strong","#undo-"+n).text(s),(s=h(".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"),h(".avatar",a).first().clone().prependTo("#undo-"+n+" ."+i+"-undo-inside"),s.click(function(){return e.wpList.del(this),h("#undo-"+n).css({backgroundColor:"#ceb"}).fadeOut(350,function(){h(this).remove(),h("#comment-"+n).css("backgroundColor","").fadeIn(300,function(){h(this).show()})}),!1})),t},u=function(t,e,n){e<m||(n&&(m=e),p.val(t.toString()))};f=function(t){t=parseInt(t.html().replace(/[^0-9]+/g,""),10);return isNaN(t)?0:t},v=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){h("span.pending-count").each(function(){var t=h(this),e=f(t)+n;e<1&&(e=0),t.closest(".awaiting-mod")[0===e?"addClass":"removeClass"]("count-0"),v(t,e)})},t=function(t,e){var n,a,o,s=h(e.target).parent().is("span.untrash"),i=h(e.target).parent().is("span.unspam"),r=h("#"+e.element).is(".unapproved");function l(t){return h(e.target).parent().is("span."+t)?1:h("#"+e.element).is("."+t)?-1:0}a=s?-1:l("trash"),n=i?-1:l("spam"),h(e.target).parent().is("span.unapprove")||(s||i)&&r?o=1:r&&(o=-1),o&&g(o),h("span.spam-count").each(function(){var t=h(this),e=f(t)+n;v(t,e)}),h("span.trash-count").each(function(){var t=h(this),e=f(t)+a;v(t,e)}),h("#dashboard_right_now").length||(r=p.val()?parseInt(p.val(),10):0,h(e.target).parent().is("span.undo")?r++:r--,r<0&&(r=0),"object"==typeof t&&m<e.parsed.responses[0].supplemental.time?((o=e.parsed.responses[0].supplemental.total_items_i18n||"")&&(h(".displaying-num").text(o),h(".total-pages").text(e.parsed.responses[0].supplemental.total_pages_i18n),h(".tablenav-pages").find(".next-page, .last-page").toggleClass("disabled",e.parsed.responses[0].supplemental.total_pages==h(".current-page").val())),u(r,e.parsed.responses[0].supplemental.time,!0)):u(r,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=h.query.get(),n=h(".total-pages").text(),a=h('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=h.extend(e,{action:"fetch-list",list_args:list_args,_ajax_fetch_list_nonce:h("#_ajax_fetch_list_nonce").val()}),h.ajax({url:ajaxurl,global:!1,dataType:"json",data:e,success:function(t){theExtraList.get(0).wpList.add(t.rows)}}))},theExtraList=h("#the-extra-comment-list").wpList({alt:"",delColor:"none",addColor:"none"}),theList=h("#the-comment-list").wpList({alt:"",delBefore:n,dimAfter:e,delAfter:t,addColor:"none"}).bind("wpListDelEnd",function(t,e){var n=h(e.target).attr("data-wp-lists"),e=e.element.replace(/[^0-9]+/g,"");-1==n.indexOf(":trash=1")&&-1==n.indexOf(":spam=1")||h("#undo-"+e).fadeIn(300,function(){h(this).show()})})},commentReply={cid:"",act:"",init:function(){var t=h("#replyrow");h("a.cancel",t).click(function(){return commentReply.revert()}),h("a.save",t).click(function(){return commentReply.send()}),h("input#author, input#author-email, input#author-url",t).keypress(function(t){if(13==t.which)return commentReply.send(),t.preventDefault(),!1}),h("#the-comment-list .column-comment > p").dblclick(function(){commentReply.toggle(h(this).parent())}),h("#doaction, #doaction2, #post-query-submit").click(function(){0<h("#the-comment-list #replyrow").length&&commentReply.close()}),this.comments_listing=h('#comments-form > input[name="comment_status"]').val()||""},addEvents:function(t){t.each(function(){h(this).find(".column-comment > p").dblclick(function(){commentReply.toggle(h(this).parent())})})},toggle:function(t){"none"!=h(t).css("display")&&h(t).find("a.vim-q").click()},revert:function(){return h("#the-comment-list #replyrow").length<1||h("#replyrow").fadeOut("fast",function(){commentReply.close()}),!1},close:function(){var t,e=h("#replyrow");e.parent().is("#com-reply")||(this.cid&&"edit-comment"==this.act&&(t=h("#comment-"+this.cid)).fadeIn(300,function(){t.show()}).css("backgroundColor",""),"undefined"!=typeof QTags&&QTags.closeAllTags("replycontent"),h("#add-new-comment").css("display",""),e.hide(),h("#com-reply").append(e),h("#replycontent").css("height","").val(""),h("#edithead input").val(""),h(".error",e).empty().hide(),h(".spinner",e).removeClass("is-active"),this.cid="")},open:function(t,e,n){var a,o,s,i=h("#comment-"+t),r=i.height();return this.close(),this.cid=t,a=h("#replyrow"),o=h("#inline-"+t),s="edit"==(n=n||"replyto")?"edit":"replyto",s=this.act=s+"-comment",h("#action",a).val(s),h("#comment_post_ID",a).val(e),h("#comment_ID",a).val(t),"edit"==n?(h("#author",a).val(h("div.author",o).text()),h("#author-email",a).val(h("div.author-email",o).text()),h("#author-url",a).val(h("div.author-url",o).text()),h("#status",a).val(h("div.comment_status",o).text()),h("#replycontent",a).val(h("textarea.comment",o).val()),h("#edithead, #savebtn",a).show(),h("#replyhead, #replybtn, #addhead, #addbtn",a).hide(),120<r&&(r=500<r?500:r,h("#replycontent",a).css("height",r+"px")),i.after(a).fadeOut("fast",function(){h("#replyrow").fadeIn(300,function(){h(this).show()})})):"add"==n?(h("#addhead, #addbtn",a).show(),h("#replyhead, #replybtn, #edithead, #editbtn",a).hide(),h("#the-comment-list").prepend(a),h("#replyrow").fadeIn(300)):(n=h("#replybtn",a),h("#edithead, #savebtn, #addhead, #addbtn",a).hide(),h("#replyhead, #replybtn",a).show(),i.after(a),i.hasClass("unapproved")?n.text(adminCommentsL10n.replyApprove):n.text(adminCommentsL10n.reply),h("#replyrow").fadeIn(300,function(){h(this).show()})),setTimeout(function(){var t=h("#replyrow").offset().top,e=t+h("#replyrow").height(),n=window.pageYOffset||document.documentElement.scrollTop,a=document.documentElement.clientHeight||window.innerHeight||0;n+a-20<e?window.scroll(0,e-a+35):t-20<n&&window.scroll(0,t-35),h("#replycontent").focus().keyup(function(t){27==t.which&&commentReply.revert()})},600),!1},send:function(){var e={};return h("#replysubmit .error").hide(),h("#replysubmit .spinner").addClass("is-active"),h("#replyrow input").not(":button").each(function(){var t=h(this);e[t.attr("name")]=t.val()}),e.content=h("#replycontent").val(),e.id=e.comment_post_ID,e.comments_listing=this.comments_listing,e.p=h('[name="p"]').val(),h("#comment-"+h("#comment_ID").val()).hasClass("unapproved")&&(e.approve_parent=1),h.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&&h(t).remove(),void(e.supplemental.parent_approved&&(a=h("#comment-"+e.supplemental.parent_approved),g(-1),"moderated"==this.comments_listing)?a.animate({backgroundColor:"#CCEEBB"},400,function(){a.fadeOut()}):(e=h.trim(e.data),h(e).hide(),h("#replyrow").after(e),t=h(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;h("#replysubmit .spinner").removeClass("is-active"),(e=t.responseText?t.responseText.replace(/<.[^<>]*?>/g,""):e)&&h("#replysubmit .error").html(e).show()},addcomment:function(t){var e=this;h("#add-new-comment").fadeOut(200,function(){e.open(0,t,"add"),h("table.comments-box").css("display",""),h("#no-comments").remove()})}},h(document).ready(function(){var t,e,n,a;setCommentsList(),commentReply.init(),h(document).delegate("span.delete a.delete","click",function(){return!1}),void 0!==h.table_hotkeys&&(t=function(n){return function(){var t="next"==n?"first":"last",e=h(".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=h("span.edit a",e).attr("href")},n=function(){h("#cb-select-all-1").data("wp-toggle",1).trigger("click").removeData("wp-toggle")},a=function(e){return function(){var t=h('select[name="action"]');h('option[value="'+e+'"]',t).prop("selected",!0),h("#doaction").click()}},h.table_hotkeys(h("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})),h("#the-comment-list").on("click",".comment-inline",function(t){t.preventDefault();var e=h(this),t="replyto";void 0!==e.data("action")&&(t=e.data("action")),commentReply.open(e.data("commentId"),e.data("postId"),t)})})}(jQuery); |