Build/Test Tools: Support NodeJS 14.x in the 4.2 branch.
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
2021-02-04 23:28:43 -05:00
|
|
|
var tb_position;window.wp=window.wp||{},function(o){var i,a=wp.themes=wp.themes||{};a.data=_wpThemeSettings,i=a.data.l10n,a.isInstall=!!a.data.settings.isInstall,_.extend(a,{model:{},view:{},routes:{},router:{},template:wp.template}),a.Model=Backbone.Model.extend({initialize:function(){var e;-1!==_.indexOf(a.data.installedThemes,this.get("slug"))&&this.set({installed:!0}),this.set({id:this.get("slug")||this.get("id")}),this.has("sections")&&(e=this.get("sections").description,this.set({description:e}))}}),a.view.Appearance=wp.Backbone.View.extend({el:"#wpbody-content .wrap .theme-browser",window:o(window),page:0,initialize:function(e){_.bindAll(this,"scroller"),this.SearchView=e.SearchView||a.view.Search,this.window.bind("scroll",_.throttle(this.scroller,300))},render:function(){this.view=new a.view.Themes({collection:this.collection,parent:this}),this.search(),this.view.render(),this.$el.empty().append(this.view.el).addClass("rendered"),this.$el.append('<br class="clear"/>')},searchContainer:o("#wpbody h2:first"),search:function(){var e;1!==a.data.themes.length&&((e=new this.SearchView({collection:this.collection,parent:this})).render(),this.searchContainer.append(o.parseHTML('<label class="screen-reader-text" for="wp-filter-search-input">'+i.search+"</label>")).append(e.el))},scroller:function(){var e=this,t=this.window.scrollTop()+e.window.height(),e=e.$el.offset().top+e.$el.outerHeight(!1)-e.window.height();Math.round(.9*e)<t&&this.trigger("theme:scroll")}}),a.Collection=Backbone.Collection.extend({model:a.Model,terms:"",doSearch:function(e){this.terms!==e&&(this.terms=e,0<this.terms.length&&this.search(this.terms),""===this.terms&&(this.reset(a.data.themes),o("body").removeClass("no-results")),this.trigger("update"))},search:function(t){var i,e,s,r,n;this.reset(a.data.themes,{silent:!0}),t=(t=t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")).replace(/ /g,")(?=.*"),i=new RegExp("^(?=.*"+t+").+","i"),0===(e=this.filter(function(e){return s=e.get("name").replace(/(<([^>]+)>)/gi,""),r=e.get("description").replace(/(<([^>]+)>)/gi,""),n=e.get("author").replace(/(<([^>]+)>)/gi,""),n=_.union(s,e.get("id"),r,n,e.get("tags")),i.test(e.get("author"))&&2<t.length&&e.set("displayAuthor",!0),i.test(n)})).length?this.trigger("query:empty"):o("body").removeClass("no-results"),this.reset(e)},paginate:function(e){var t=this;return e=e||0,t=_(t.rest(20*e)),t=_(t.first(20))},count:!1,query:function(t){var e,i,s,r=this.queries,n=this;if(this.currentQuery.request=t,e=_.find(r,function(e){return _.isEqual(e.request,t)}),(i=_.has(t,"page"))||(this.currentQuery.page=1),e||i){if(i)return this.apiCall(t,i).done(function(e){n.add(e.themes),n.trigger("query:success"),n.loadingThemes=!1}).fail(function(){n.trigger("query:fail")});0===e.themes.length?n.trigger("query:empty"):o("body").removeClass("no-results"),_.isNumber(e.total)&&(this.count=e.total),this.reset(e.themes),e.total||(this.count=this.length),this.trigger("update"),this.trigger("query:success",this.count)}else e=this.apiCall(t).done(function(e){e.themes&&(n.reset(e.themes),s=e.info.results,r.push({themes:e.themes,request:t,total:s})),n.trigger("update"),n.trigger("query:success",s),e.themes&&0===e.themes.length&&n.trigger("query:empty")}).fail(function(){n.trigger("query:fail")})},queries:[],currentQuery:{page:1,request:{}},apiCall:function(e,t){return wp.ajax.send("query-themes",{data:{request:_.extend({per_page:100,fields:{description:!0,tested:!0,requires:!0,rating:!0,downloaded:!0,downloadLink:!0,last_updated:!0,homepage:!0,num_ratings:!0}},e)},beforeSend:function(){t||o("body").addClass("loading-content").removeClass("no-results")}})},loadingThemes:!1}),a.view.Theme=wp.Backbone.View.extend({className:"theme",state:"grid",html:a.template("theme"),events:{click:a.isInstall?"preview":"expand",keydown:a.isInstall?"preview":"expand",touchend:a.isInstall?"preview":"expand",keyup:"addFocus",touchmove:"preventExpand"},touchDrag:!1,render:function(){var e=this.model.toJSON();this.$el.html(this.html(e)).attr({tabindex:0,"aria-describedby":e.id+"-action "+e.id+"-name"}),this.activeTheme(),this.
|