From 0318a92948a3006e7a22e8d054ae0fb5a9059ed7 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 1 Jun 2020 20:53:15 +0000 Subject: [PATCH] Plugins and Themes Auto-Updates: update the state of the auto-update link on the themes screen after successfully saving the setting. Props desrosj, pbiron, azaozz. Fixes #50291. Built from https://develop.svn.wordpress.org/trunk@47883 git-svn-id: http://core.svn.wordpress.org/trunk@47657 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/theme.js | 20 +++++++++++++++++++- wp-admin/js/theme.min.js | 2 +- wp-admin/js/updates.js | 2 ++ wp-admin/js/updates.min.js | 2 +- wp-includes/version.php | 2 +- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/wp-admin/js/theme.js b/wp-admin/js/theme.js index 7f7f0ce1fb..d5618c4028 100644 --- a/wp-admin/js/theme.js +++ b/wp-admin/js/theme.js @@ -666,7 +666,8 @@ themes.view.Details = wp.Backbone.View.extend({ 'click .delete-theme': 'deleteTheme', 'click .left': 'previousTheme', 'click .right': 'nextTheme', - 'click #update-theme': 'updateTheme' + 'click #update-theme': 'updateTheme', + 'click .toggle-auto-update': 'autoupdateState' }, // The HTML template for the theme overlay. @@ -787,6 +788,23 @@ themes.view.Details = wp.Backbone.View.extend({ this.trigger( 'theme:collapse' ); }, + // Set state of the auto-update settings link after it has been changed and saved. + autoupdateState: function() { + var callback, + _this = this; + + // Support concurrent clicks in different Theme Details overlays. + callback = function( event, data ) { + if ( _this.model.get( 'id' ) === data.asset ) { + _this.model.set( { autoupdate: 'enable' === data.state } ); + $( document ).off( 'wp-auto-update-setting-changed', callback ); + } + } + + // Triggered in updates.js + $( document ).on( 'wp-auto-update-setting-changed', callback ); + }, + updateTheme: function( event ) { var _this = this; event.preventDefault(); diff --git a/wp-admin/js/theme.min.js b/wp-admin/js/theme.min.js index 4e01926e1b..1a5cefdfe2 100644 --- a/wp-admin/js/theme.min.js +++ b/wp-admin/js/theme.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -window.wp=window.wp||{},function(o){var l,a;function e(e,t){Backbone.history._hasPushState&&Backbone.Router.prototype.navigate.call(this,e,t)}(l=wp.themes=wp.themes||{}).data=_wpThemeSettings,a=l.data.l10n,l.isInstall=!!l.data.settings.isInstall,_.extend(l,{model:{},view:{},routes:{},router:{},template:wp.template}),l.Model=Backbone.Model.extend({initialize:function(){var e;-1!==_.indexOf(l.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}))}}),l.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?e.SearchView:l.view.Search,this.window.bind("scroll",_.throttle(this.scroller,300))},render:function(){this.view=new l.view.Themes({collection:this.collection,parent:this}),this.search(),this.$el.removeClass("search-loading"),this.view.render(),this.$el.empty().append(this.view.el).addClass("rendered")},searchContainer:o(".search-form"),search:function(){var e;1!==l.data.themes.length&&(e=new this.SearchView({collection:this.collection,parent:this}),(this.SearchView=e).render(),this.searchContainer.append(o.parseHTML('")).append(e.el).on("submit",function(e){e.preventDefault()}))},scroller:function(){var e,t,i=this;e=this.window.scrollTop()+i.window.height(),t=i.$el.offset().top+i.$el.outerHeight(!1)-i.window.height(),(t=Math.round(.9*t))]+)>)/gi,""),a=e.get("description").replace(/(<([^>]+)>)/gi,""),n=e.get("author").replace(/(<([^>]+)>)/gi,""),s=_.union([r,e.get("id"),a,n,e.get("tags")]),i.test(e.get("author"))&&2

'+a.addNew+"

"),this.parent.page++):this.parent.trigger("theme:end")},currentTheme:function(){var e;(e=this.collection.findWhere({active:!0}))&&(this.collection.remove(e),this.collection.add(e,{at:0}))},setView:function(e){return e},expand:function(e){var t,i,s=this;this.model=s.collection.get(e),l.router.navigate(l.router.baseUrl(l.router.themePath+this.model.id)),this.setView("detail"),o("body").addClass("modal-open"),this.overlay=new l.view.Details({model:s.model}),this.overlay.render(),this.model.get("hasUpdate")&&(t=o('[data-slug="'+this.model.id+'"]'),i=o(this.overlay.el),t.find(".updating-message").length?(i.find(".notice-warning h3").remove(),i.find(".notice-warning").removeClass("notice-large").addClass("updating-message").find("p").text(wp.updates.l10n.updating)):t.find(".notice-error").length&&i.find(".notice-warning").remove()),this.$overlay.html(this.overlay.el),this.listenTo(this.overlay,"theme:next",function(){s.next([s.model.cid])}).listenTo(this.overlay,"theme:previous",function(){s.previous([s.model.cid])})},next:function(e){var t,i;t=this.collection.get(e[0]),void 0!==(i=this.collection.at(this.collection.indexOf(t)+1))&&(this.overlay.closeOverlay(),this.theme.trigger("theme:expand",i.cid))},previous:function(e){var t,i;t=this.collection.get(e[0]),void 0!==(i=this.collection.at(this.collection.indexOf(t)-1))&&(this.overlay.closeOverlay(),this.theme.trigger("theme:expand",i.cid))},announceSearchResults:function(e){0===e?wp.a11y.speak(a.noThemesFound):wp.a11y.speak(a.themesFound.replace("%d",e))}}),l.view.Search=wp.Backbone.View.extend({tagName:"input",className:"wp-filter-search",id:"wp-filter-search-input",searching:!1,attributes:{placeholder:a.searchPlaceholder,type:"search","aria-describedby":"live-search-desc"},events:{input:"search",keyup:"search",blur:"pushState"},initialize:function(e){this.parent=e.parent,this.listenTo(this.parent,"theme:close",function(){this.searching=!1})},search:function(e){"keyup"===e.type&&27===e.which&&(e.target.value=""),this.doSearch(e)},doSearch:function(e){var t={};this.collection.doSearch(e.target.value.replace(/\+/g," ")),this.searching&&13!==e.which?t.replace=!0:this.searching=!0,e.target.value?l.router.navigate(l.router.baseUrl(l.router.searchPath+e.target.value),t):l.router.navigate(l.router.baseUrl(""))},pushState:function(e){var t=l.router.baseUrl("");e.target.value&&(t=l.router.baseUrl(l.router.searchPath+encodeURIComponent(e.target.value))),this.searching=!1,l.router.navigate(t)}}),l.Router=Backbone.Router.extend({routes:{"themes.php?theme=:slug":"theme","themes.php?search=:query":"search","themes.php?s=:query":"search","themes.php":"themes","":"themes"},baseUrl:function(e){return"themes.php"+e},themePath:"?theme=",searchPath:"?search=",search:function(e){o(".wp-filter-search").val(e.replace(/\+/g," "))},themes:function(){o(".wp-filter-search").val("")},navigate:e}),l.Run={init:function(){this.themes=new l.Collection(l.data.themes),this.view=new l.view.Appearance({collection:this.themes}),this.render(),this.view.SearchView.doSearch=_.debounce(this.view.SearchView.doSearch,500)},render:function(){this.view.render(),this.routes(),Backbone.History.started&&Backbone.history.stop(),Backbone.history.start({root:l.data.settings.adminUrl,pushState:!0,hashChange:!1})},routes:function(){var t=this;l.router=new l.Router,l.router.on("route:theme",function(e){t.view.view.expand(e)}),l.router.on("route:themes",function(){t.themes.doSearch(""),t.view.trigger("theme:close")}),l.router.on("route:search",function(){o(".wp-filter-search").trigger("keyup")}),this.extraRoutes()},extraRoutes:function(){return!1}},l.view.InstallerSearch=l.view.Search.extend({events:{input:"search",keyup:"search"},terms:"",search:function(e){("keyup"!==e.type||9!==e.which&&16!==e.which)&&(this.collection=this.options.parent.view.collection,"keyup"===e.type&&27===e.which&&(e.target.value=""),this.doSearch(e.target.value))},doSearch:function(e){var t={};this.terms!==e&&(this.terms=e,"author:"===(t.search=e).substring(0,7)&&(t.search="",t.author=e.slice(7)),"tag:"===e.substring(0,4)&&(t.search="",t.tag=[e.slice(4)]),o(".filter-links li > a.current").removeClass("current").removeAttr("aria-current"),o("body").removeClass("show-filters filters-applied show-favorites-form"),o(".drawer-toggle").attr("aria-expanded","false"),this.collection.query(t),l.router.navigate(l.router.baseUrl(l.router.searchPath+encodeURIComponent(e)),{replace:!0}))}}),l.view.Installer=l.view.Appearance.extend({el:"#wpbody-content .wrap",events:{"click .filter-links li > a":"onSort","click .theme-filter":"onFilter","click .drawer-toggle":"moreFilters","click .filter-drawer .apply-filters":"applyFilters",'click .filter-group [type="checkbox"]':"addFilter","click .filter-drawer .clear-filters":"clearFilters","click .edit-filters":"backToFilters","click .favorites-form-submit":"saveUsername","keyup #wporg-username-input":"saveUsername"},render:function(){var e=this;this.search(),this.uploader(),this.collection=new l.Collection,this.listenTo(this,"theme:end",function(){e.collection.loadingThemes||(e.collection.loadingThemes=!0,e.collection.currentQuery.page++,_.extend(e.collection.currentQuery.request,{page:e.collection.currentQuery.page}),e.collection.query(e.collection.currentQuery.request))}),this.listenTo(this.collection,"query:success",function(){o("body").removeClass("loading-content"),o(".theme-browser").find("div.error").remove()}),this.listenTo(this.collection,"query:fail",function(){o("body").removeClass("loading-content"),o(".theme-browser").find("div.error").remove(),o(".theme-browser").find("div.themes").before('

'+a.error+'

"),o(".theme-browser .error .try-again").on("click",function(e){e.preventDefault(),o("input.wp-filter-search").trigger("input")})}),this.view&&this.view.remove(),this.view=new l.view.Themes({collection:this.collection,parent:this}),this.page=0,this.$el.find(".themes").remove(),this.view.render(),this.$el.find(".theme-browser").append(this.view.el).addClass("rendered")},browse:function(e){this.collection.query({browse:e})},onSort:function(e){var t=o(e.target),i=t.data("sort");e.preventDefault(),o("body").removeClass("filters-applied show-filters"),o(".drawer-toggle").attr("aria-expanded","false"),t.hasClass(this.activeClass)||(this.sort(i),l.router.navigate(l.router.baseUrl(l.router.browsePath+i)))},sort:function(e){this.clearSearch(),l.router.selectedTab=e,o(".filter-links li > a, .theme-filter").removeClass(this.activeClass).removeAttr("aria-current"),o('[data-sort="'+e+'"]').addClass(this.activeClass).attr("aria-current","page"),"favorites"===e?o("body").addClass("show-favorites-form"):o("body").removeClass("show-favorites-form"),this.browse(e)},onFilter:function(e){var t,i=o(e.target),s=i.data("filter");i.hasClass(this.activeClass)||(o(".filter-links li > a, .theme-section").removeClass(this.activeClass).removeAttr("aria-current"),i.addClass(this.activeClass).attr("aria-current","page"),s&&(t={tag:[s=_.union([s,this.filtersChecked()])]},this.collection.query(t)))},addFilter:function(){this.filtersChecked()},applyFilters:function(e){var t,i=this.filtersChecked(),s={tag:i},r=o(".filtered-by .tags");e&&e.preventDefault(),i?(o("body").addClass("filters-applied"),o(".filter-links li > a.current").removeClass("current").removeAttr("aria-current"),r.empty(),_.each(i,function(e){t=o('label[for="filter-id-'+e+'"]').text(),r.append(''+t+"")}),this.collection.query(s)):wp.a11y.speak(a.selectFeatureFilter)},saveUsername:function(e){var t=o("#wporg-username-input").val(),i=o("#wporg-username-nonce").val(),s={browse:"favorites",user:t},r=this;if(e&&e.preventDefault(),"keyup"!==e.type||13===e.which)return wp.ajax.send("save-wporg-username",{data:{_wpnonce:i,username:t},success:function(){r.collection.query(s)}})},filtersChecked:function(){var e=o(".filter-group").find(":checkbox"),t=[];return _.each(e.filter(":checked"),function(e){t.push(o(e).prop("value"))}),0===t.length?(o(".filter-drawer .apply-filters").find("span").text(""),o(".filter-drawer .clear-filters").hide(),o("body").removeClass("filters-applied"),!1):(o(".filter-drawer .apply-filters").find("span").text(t.length),o(".filter-drawer .clear-filters").css("display","inline-block"),t)},activeClass:"current",uploader:function(){var e=o(".upload-view-toggle"),t=o(document.body);e.on("click",function(){t.toggleClass("show-upload-view"),e.attr("aria-expanded",t.hasClass("show-upload-view"))})},moreFilters:function(e){var t=o("body"),i=o(".drawer-toggle");if(e.preventDefault(),t.hasClass("filters-applied"))return this.backToFilters();this.clearSearch(),l.router.navigate(l.router.baseUrl("")),t.toggleClass("show-filters"),i.attr("aria-expanded",t.hasClass("show-filters"))},clearFilters:function(e){var t=o(".filter-group").find(":checkbox"),i=this;e.preventDefault(),_.each(t.filter(":checked"),function(e){return o(e).prop("checked",!1),i.filtersChecked()})},backToFilters:function(e){e&&e.preventDefault(),o("body").removeClass("filters-applied")},clearSearch:function(){o("#wp-filter-search-input").val("")}}),l.InstallerRouter=Backbone.Router.extend({routes:{"theme-install.php?theme=:slug":"preview","theme-install.php?browse=:sort":"sort","theme-install.php?search=:query":"search","theme-install.php":"sort"},baseUrl:function(e){return"theme-install.php"+e},themePath:"?theme=",browsePath:"?browse=",searchPath:"?search=",search:function(e){o(".wp-filter-search").val(e.replace(/\+/g," "))},navigate:e}),l.RunInstaller={init:function(){this.view=new l.view.Installer({section:"featured",SearchView:l.view.InstallerSearch}),this.render(),this.view.SearchView.doSearch=_.debounce(this.view.SearchView.doSearch,500)},render:function(){this.view.render(),this.routes(),Backbone.History.started&&Backbone.history.stop(),Backbone.history.start({root:l.data.settings.adminUrl,pushState:!0,hashChange:!1})},routes:function(){var t=this,i={};l.router=new l.InstallerRouter,l.router.on("route:preview",function(e){l.preview&&(l.preview.undelegateEvents(),l.preview.unbind()),t.view.view.theme&&t.view.view.theme.preview?(t.view.view.theme.model=t.view.collection.findWhere({slug:e}),t.view.view.theme.preview()):(i.theme=e,t.view.collection.query(i),t.view.collection.trigger("update"),t.view.collection.once("query:success",function(){o('div[data-slug="'+e+'"]').trigger("click")}))}),l.router.on("route:sort",function(e){e||(e="featured",l.router.navigate(l.router.baseUrl("?browse=featured"),{replace:!0})),t.view.sort(e),l.preview&&l.preview.close()}),l.router.on("route:search",function(){o(".wp-filter-search").focus().trigger("keyup")}),this.extraRoutes()},extraRoutes:function(){return!1}},o(document).ready(function(){l.isInstall?l.RunInstaller.init():l.Run.init(),o(document.body).on("click",".load-customize",function(){var e=o(this),t=document.createElement("a");t.href=e.prop("href"),t.search=o.param(_.extend(wp.customize.utils.parseQueryString(t.search.substr(1)),{return:window.location.href})),e.prop("href",t.href)}),o(".broken-themes .delete-theme").on("click",function(){return confirm(_wpThemeSettings.settings.confirmDelete)})})}(jQuery),jQuery(document).ready(function(a){window.tb_position=function(){var e=a("#TB_window"),t=a(window).width(),i=a(window).height(),s=1040'+a.search+"")).append(e.el).on("submit",function(e){e.preventDefault()}))},scroller:function(){var e,t,i=this;e=this.window.scrollTop()+i.window.height(),t=i.$el.offset().top+i.$el.outerHeight(!1)-i.window.height(),(t=Math.round(.9*t))]+)>)/gi,""),a=e.get("description").replace(/(<([^>]+)>)/gi,""),n=e.get("author").replace(/(<([^>]+)>)/gi,""),s=_.union([r,e.get("id"),a,n,e.get("tags")]),i.test(e.get("author"))&&2

'+a.addNew+"

"),this.parent.page++):this.parent.trigger("theme:end")},currentTheme:function(){var e;(e=this.collection.findWhere({active:!0}))&&(this.collection.remove(e),this.collection.add(e,{at:0}))},setView:function(e){return e},expand:function(e){var t,i,s=this;this.model=s.collection.get(e),l.router.navigate(l.router.baseUrl(l.router.themePath+this.model.id)),this.setView("detail"),o("body").addClass("modal-open"),this.overlay=new l.view.Details({model:s.model}),this.overlay.render(),this.model.get("hasUpdate")&&(t=o('[data-slug="'+this.model.id+'"]'),i=o(this.overlay.el),t.find(".updating-message").length?(i.find(".notice-warning h3").remove(),i.find(".notice-warning").removeClass("notice-large").addClass("updating-message").find("p").text(wp.updates.l10n.updating)):t.find(".notice-error").length&&i.find(".notice-warning").remove()),this.$overlay.html(this.overlay.el),this.listenTo(this.overlay,"theme:next",function(){s.next([s.model.cid])}).listenTo(this.overlay,"theme:previous",function(){s.previous([s.model.cid])})},next:function(e){var t,i;t=this.collection.get(e[0]),void 0!==(i=this.collection.at(this.collection.indexOf(t)+1))&&(this.overlay.closeOverlay(),this.theme.trigger("theme:expand",i.cid))},previous:function(e){var t,i;t=this.collection.get(e[0]),void 0!==(i=this.collection.at(this.collection.indexOf(t)-1))&&(this.overlay.closeOverlay(),this.theme.trigger("theme:expand",i.cid))},announceSearchResults:function(e){0===e?wp.a11y.speak(a.noThemesFound):wp.a11y.speak(a.themesFound.replace("%d",e))}}),l.view.Search=wp.Backbone.View.extend({tagName:"input",className:"wp-filter-search",id:"wp-filter-search-input",searching:!1,attributes:{placeholder:a.searchPlaceholder,type:"search","aria-describedby":"live-search-desc"},events:{input:"search",keyup:"search",blur:"pushState"},initialize:function(e){this.parent=e.parent,this.listenTo(this.parent,"theme:close",function(){this.searching=!1})},search:function(e){"keyup"===e.type&&27===e.which&&(e.target.value=""),this.doSearch(e)},doSearch:function(e){var t={};this.collection.doSearch(e.target.value.replace(/\+/g," ")),this.searching&&13!==e.which?t.replace=!0:this.searching=!0,e.target.value?l.router.navigate(l.router.baseUrl(l.router.searchPath+e.target.value),t):l.router.navigate(l.router.baseUrl(""))},pushState:function(e){var t=l.router.baseUrl("");e.target.value&&(t=l.router.baseUrl(l.router.searchPath+encodeURIComponent(e.target.value))),this.searching=!1,l.router.navigate(t)}}),l.Router=Backbone.Router.extend({routes:{"themes.php?theme=:slug":"theme","themes.php?search=:query":"search","themes.php?s=:query":"search","themes.php":"themes","":"themes"},baseUrl:function(e){return"themes.php"+e},themePath:"?theme=",searchPath:"?search=",search:function(e){o(".wp-filter-search").val(e.replace(/\+/g," "))},themes:function(){o(".wp-filter-search").val("")},navigate:e}),l.Run={init:function(){this.themes=new l.Collection(l.data.themes),this.view=new l.view.Appearance({collection:this.themes}),this.render(),this.view.SearchView.doSearch=_.debounce(this.view.SearchView.doSearch,500)},render:function(){this.view.render(),this.routes(),Backbone.History.started&&Backbone.history.stop(),Backbone.history.start({root:l.data.settings.adminUrl,pushState:!0,hashChange:!1})},routes:function(){var t=this;l.router=new l.Router,l.router.on("route:theme",function(e){t.view.view.expand(e)}),l.router.on("route:themes",function(){t.themes.doSearch(""),t.view.trigger("theme:close")}),l.router.on("route:search",function(){o(".wp-filter-search").trigger("keyup")}),this.extraRoutes()},extraRoutes:function(){return!1}},l.view.InstallerSearch=l.view.Search.extend({events:{input:"search",keyup:"search"},terms:"",search:function(e){("keyup"!==e.type||9!==e.which&&16!==e.which)&&(this.collection=this.options.parent.view.collection,"keyup"===e.type&&27===e.which&&(e.target.value=""),this.doSearch(e.target.value))},doSearch:function(e){var t={};this.terms!==e&&(this.terms=e,"author:"===(t.search=e).substring(0,7)&&(t.search="",t.author=e.slice(7)),"tag:"===e.substring(0,4)&&(t.search="",t.tag=[e.slice(4)]),o(".filter-links li > a.current").removeClass("current").removeAttr("aria-current"),o("body").removeClass("show-filters filters-applied show-favorites-form"),o(".drawer-toggle").attr("aria-expanded","false"),this.collection.query(t),l.router.navigate(l.router.baseUrl(l.router.searchPath+encodeURIComponent(e)),{replace:!0}))}}),l.view.Installer=l.view.Appearance.extend({el:"#wpbody-content .wrap",events:{"click .filter-links li > a":"onSort","click .theme-filter":"onFilter","click .drawer-toggle":"moreFilters","click .filter-drawer .apply-filters":"applyFilters",'click .filter-group [type="checkbox"]':"addFilter","click .filter-drawer .clear-filters":"clearFilters","click .edit-filters":"backToFilters","click .favorites-form-submit":"saveUsername","keyup #wporg-username-input":"saveUsername"},render:function(){var e=this;this.search(),this.uploader(),this.collection=new l.Collection,this.listenTo(this,"theme:end",function(){e.collection.loadingThemes||(e.collection.loadingThemes=!0,e.collection.currentQuery.page++,_.extend(e.collection.currentQuery.request,{page:e.collection.currentQuery.page}),e.collection.query(e.collection.currentQuery.request))}),this.listenTo(this.collection,"query:success",function(){o("body").removeClass("loading-content"),o(".theme-browser").find("div.error").remove()}),this.listenTo(this.collection,"query:fail",function(){o("body").removeClass("loading-content"),o(".theme-browser").find("div.error").remove(),o(".theme-browser").find("div.themes").before('

'+a.error+'

"),o(".theme-browser .error .try-again").on("click",function(e){e.preventDefault(),o("input.wp-filter-search").trigger("input")})}),this.view&&this.view.remove(),this.view=new l.view.Themes({collection:this.collection,parent:this}),this.page=0,this.$el.find(".themes").remove(),this.view.render(),this.$el.find(".theme-browser").append(this.view.el).addClass("rendered")},browse:function(e){this.collection.query({browse:e})},onSort:function(e){var t=o(e.target),i=t.data("sort");e.preventDefault(),o("body").removeClass("filters-applied show-filters"),o(".drawer-toggle").attr("aria-expanded","false"),t.hasClass(this.activeClass)||(this.sort(i),l.router.navigate(l.router.baseUrl(l.router.browsePath+i)))},sort:function(e){this.clearSearch(),l.router.selectedTab=e,o(".filter-links li > a, .theme-filter").removeClass(this.activeClass).removeAttr("aria-current"),o('[data-sort="'+e+'"]').addClass(this.activeClass).attr("aria-current","page"),"favorites"===e?o("body").addClass("show-favorites-form"):o("body").removeClass("show-favorites-form"),this.browse(e)},onFilter:function(e){var t,i=o(e.target),s=i.data("filter");i.hasClass(this.activeClass)||(o(".filter-links li > a, .theme-section").removeClass(this.activeClass).removeAttr("aria-current"),i.addClass(this.activeClass).attr("aria-current","page"),s&&(t={tag:[s=_.union([s,this.filtersChecked()])]},this.collection.query(t)))},addFilter:function(){this.filtersChecked()},applyFilters:function(e){var t,i=this.filtersChecked(),s={tag:i},r=o(".filtered-by .tags");e&&e.preventDefault(),i?(o("body").addClass("filters-applied"),o(".filter-links li > a.current").removeClass("current").removeAttr("aria-current"),r.empty(),_.each(i,function(e){t=o('label[for="filter-id-'+e+'"]').text(),r.append(''+t+"")}),this.collection.query(s)):wp.a11y.speak(a.selectFeatureFilter)},saveUsername:function(e){var t=o("#wporg-username-input").val(),i=o("#wporg-username-nonce").val(),s={browse:"favorites",user:t},r=this;if(e&&e.preventDefault(),"keyup"!==e.type||13===e.which)return wp.ajax.send("save-wporg-username",{data:{_wpnonce:i,username:t},success:function(){r.collection.query(s)}})},filtersChecked:function(){var e=o(".filter-group").find(":checkbox"),t=[];return _.each(e.filter(":checked"),function(e){t.push(o(e).prop("value"))}),0===t.length?(o(".filter-drawer .apply-filters").find("span").text(""),o(".filter-drawer .clear-filters").hide(),o("body").removeClass("filters-applied"),!1):(o(".filter-drawer .apply-filters").find("span").text(t.length),o(".filter-drawer .clear-filters").css("display","inline-block"),t)},activeClass:"current",uploader:function(){var e=o(".upload-view-toggle"),t=o(document.body);e.on("click",function(){t.toggleClass("show-upload-view"),e.attr("aria-expanded",t.hasClass("show-upload-view"))})},moreFilters:function(e){var t=o("body"),i=o(".drawer-toggle");if(e.preventDefault(),t.hasClass("filters-applied"))return this.backToFilters();this.clearSearch(),l.router.navigate(l.router.baseUrl("")),t.toggleClass("show-filters"),i.attr("aria-expanded",t.hasClass("show-filters"))},clearFilters:function(e){var t=o(".filter-group").find(":checkbox"),i=this;e.preventDefault(),_.each(t.filter(":checked"),function(e){return o(e).prop("checked",!1),i.filtersChecked()})},backToFilters:function(e){e&&e.preventDefault(),o("body").removeClass("filters-applied")},clearSearch:function(){o("#wp-filter-search-input").val("")}}),l.InstallerRouter=Backbone.Router.extend({routes:{"theme-install.php?theme=:slug":"preview","theme-install.php?browse=:sort":"sort","theme-install.php?search=:query":"search","theme-install.php":"sort"},baseUrl:function(e){return"theme-install.php"+e},themePath:"?theme=",browsePath:"?browse=",searchPath:"?search=",search:function(e){o(".wp-filter-search").val(e.replace(/\+/g," "))},navigate:e}),l.RunInstaller={init:function(){this.view=new l.view.Installer({section:"featured",SearchView:l.view.InstallerSearch}),this.render(),this.view.SearchView.doSearch=_.debounce(this.view.SearchView.doSearch,500)},render:function(){this.view.render(),this.routes(),Backbone.History.started&&Backbone.history.stop(),Backbone.history.start({root:l.data.settings.adminUrl,pushState:!0,hashChange:!1})},routes:function(){var t=this,i={};l.router=new l.InstallerRouter,l.router.on("route:preview",function(e){l.preview&&(l.preview.undelegateEvents(),l.preview.unbind()),t.view.view.theme&&t.view.view.theme.preview?(t.view.view.theme.model=t.view.collection.findWhere({slug:e}),t.view.view.theme.preview()):(i.theme=e,t.view.collection.query(i),t.view.collection.trigger("update"),t.view.collection.once("query:success",function(){o('div[data-slug="'+e+'"]').trigger("click")}))}),l.router.on("route:sort",function(e){e||(e="featured",l.router.navigate(l.router.baseUrl("?browse=featured"),{replace:!0})),t.view.sort(e),l.preview&&l.preview.close()}),l.router.on("route:search",function(){o(".wp-filter-search").focus().trigger("keyup")}),this.extraRoutes()},extraRoutes:function(){return!1}},o(document).ready(function(){l.isInstall?l.RunInstaller.init():l.Run.init(),o(document.body).on("click",".load-customize",function(){var e=o(this),t=document.createElement("a");t.href=e.prop("href"),t.search=o.param(_.extend(wp.customize.utils.parseQueryString(t.search.substr(1)),{return:window.location.href})),e.prop("href",t.href)}),o(".broken-themes .delete-theme").on("click",function(){return confirm(_wpThemeSettings.settings.confirmDelete)})})}(jQuery),jQuery(document).ready(function(a){window.tb_position=function(){var e=a("#TB_window"),t=a(window).width(),i=a(window).height(),s=1040 h1").after(t),o.trigger("wp-updates-notice-added")},c.updates.ajax=function(e,t){var a={};return c.updates.ajaxLocked?(c.updates.queue.push({action:e,data:t}),p.Deferred()):(c.updates.ajaxLocked=!0,t.success&&(a.success=t.success,delete t.success),t.error&&(a.error=t.error,delete t.error),a.data=_.extend(t,{action:e,_ajax_nonce:c.updates.ajaxNonce,_fs_nonce:c.updates.filesystemCredentials.fsNonce,username:c.updates.filesystemCredentials.ftp.username,password:c.updates.filesystemCredentials.ftp.password,hostname:c.updates.filesystemCredentials.ftp.hostname,connection_type:c.updates.filesystemCredentials.ftp.connectionType,public_key:c.updates.filesystemCredentials.ssh.publicKey,private_key:c.updates.filesystemCredentials.ssh.privateKey}),c.ajax.send(a).always(c.updates.ajaxAlways))},c.updates.ajaxAlways=function(e){e.errorCode&&"unable_to_connect_to_filesystem"===e.errorCode||(c.updates.ajaxLocked=!1,c.updates.queueChecker()),void 0!==e.debug&&window.console&&window.console.log&&_.map(e.debug,function(e){window.console.log(c.sanitize.stripTagsAndEncodeText(e))})},c.updates.refreshCount=function(){var e,t=p("#wp-admin-bar-updates"),a=p('a[href="update-core.php"] .update-plugins'),s=p('a[href="plugins.php"] .update-plugins'),n=p('a[href="themes.php"] .update-plugins');t.find(".ab-item").removeAttr("title"),t.find(".ab-label").text(g.totals.counts.total),0===g.totals.counts.total&&t.find(".ab-label").parents("li").remove(),a.each(function(e,t){t.className=t.className.replace(/count-\d+/,"count-"+g.totals.counts.total)}),0

'+t+"

"),a.on("click",".notice.is-dismissible .notice-dismiss",function(){setTimeout(function(){a.removeClass("plugin-card-update-failed").find(".column-name a").focus()},200)}),s.removeClass("updating-message").addClass("button-disabled").attr("aria-label",c.updates.l10n.pluginInstallFailedLabel.replace("%s",s.data("name"))).text(c.updates.l10n.installFailedShort),c.a11y.speak(t,"assertive"),o.trigger("wp-plugin-install-error",e)))},c.updates.installImporterSuccess=function(e){c.updates.addAdminNotice({id:"install-success",className:"notice-success is-dismissible",message:c.updates.l10n.importerInstalledMsg.replace("%s",e.activateUrl+"&from=import")}),p('[data-slug="'+e.slug+'"]').removeClass("install-now updating-message").addClass("activate-now").attr({href:e.activateUrl+"&from=import","aria-label":c.updates.l10n.activateImporterLabel.replace("%s",e.pluginName)}).text(c.updates.l10n.activateImporter),c.a11y.speak(c.updates.l10n.installedMsg,"polite"),o.trigger("wp-importer-install-success",e)},c.updates.installImporterError=function(e){var t=c.updates.l10n.installFailed.replace("%s",e.errorMessage),a=p('[data-slug="'+e.slug+'"]'),s=a.data("name");c.updates.isValidResponse(e,"install")&&(c.updates.maybeHandleCredentialError(e,"install-plugin")||(c.updates.addAdminNotice({id:e.errorCode,className:"notice-error is-dismissible",message:t}),a.removeClass("updating-message").text(c.updates.l10n.installNow).attr("aria-label",c.updates.l10n.pluginInstallNowLabel.replace("%s",s)),c.a11y.speak(t,"assertive"),o.trigger("wp-importer-install-error",e)))},c.updates.deletePlugin=function(e){var t=p('[data-plugin="'+e.plugin+'"]').find(".row-actions a.delete");return e=_.extend({success:c.updates.deletePluginSuccess,error:c.updates.deletePluginError},e),t.html()!==c.updates.l10n.deleting&&t.data("originaltext",t.html()).text(c.updates.l10n.deleting),c.a11y.speak(c.updates.l10n.deleting,"polite"),o.trigger("wp-plugin-deleting",e),c.updates.ajax("delete-plugin",e)},c.updates.deletePluginSuccess=function(i){p('[data-plugin="'+i.plugin+'"]').css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=p("#bulk-action-form"),t=p(".subsubsub"),a=p(this),s=e.find("thead th:not(.hidden), thead td").length,n=c.template("item-deleted-row"),l=g.plugins;a.hasClass("plugin-update-tr")||a.after(n({slug:i.slug,plugin:i.plugin,colspan:s,name:i.pluginName})),a.remove(),-1!==_.indexOf(l.upgrade,i.plugin)&&(l.upgrade=_.without(l.upgrade,i.plugin),c.updates.decrementCount("plugin")),-1!==_.indexOf(l.inactive,i.plugin)&&(l.inactive=_.without(l.inactive,i.plugin),l.inactive.length?t.find(".inactive .count").text("("+l.inactive.length+")"):t.find(".inactive").remove()),-1!==_.indexOf(l.active,i.plugin)&&(l.active=_.without(l.active,i.plugin),l.active.length?t.find(".active .count").text("("+l.active.length+")"):t.find(".active").remove()),-1!==_.indexOf(l.recently_activated,i.plugin)&&(l.recently_activated=_.without(l.recently_activated,i.plugin),l.recently_activated.length?t.find(".recently_activated .count").text("("+l.recently_activated.length+")"):t.find(".recently_activated").remove()),l.all=_.without(l.all,i.plugin),l.all.length?t.find(".all .count").text("("+l.all.length+")"):(e.find(".tablenav").css({visibility:"hidden"}),t.find(".all").remove(),e.find("tr.no-items").length||e.find("#the-list").append(''+c.updates.l10n.noPlugins+""))}),c.a11y.speak(c.updates.l10n.pluginDeleted,"polite"),o.trigger("wp-plugin-delete-success",i)},c.updates.deletePluginError=function(e){var t,a,s=c.template("item-update-row"),n=c.updates.adminNotice({className:"update-message notice-error notice-alt",message:e.errorMessage});a=e.plugin?(t=p('tr.inactive[data-plugin="'+e.plugin+'"]')).siblings('[data-plugin="'+e.plugin+'"]'):(t=p('tr.inactive[data-slug="'+e.slug+'"]')).siblings('[data-slug="'+e.slug+'"]'),c.updates.isValidResponse(e,"delete")&&(c.updates.maybeHandleCredentialError(e,"delete-plugin")||(a.length?(a.find(".notice-error").remove(),a.find(".plugin-update").append(n)):t.addClass("update").after(s({slug:e.slug,plugin:e.plugin||e.slug,colspan:p("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:n})),o.trigger("wp-plugin-delete-error",e)))},c.updates.updateTheme=function(e){var t;return e=_.extend({success:c.updates.updateThemeSuccess,error:c.updates.updateThemeError},e),(t="themes-network"===pagenow?p('[data-slug="'+e.slug+'"]').find(".update-message").removeClass("notice-error").addClass("updating-message notice-warning").find("p"):"customize"===pagenow?((t=p('[data-slug="'+e.slug+'"].notice').removeClass("notice-large")).find("h3").remove(),(t=t.add(p("#customize-control-installed_theme_"+e.slug).find(".update-message"))).addClass("updating-message").find("p")):((t=p("#update-theme").closest(".notice").removeClass("notice-large")).find("h3").remove(),(t=t.add(p('[data-slug="'+e.slug+'"]').find(".update-message"))).addClass("updating-message").find("p"))).html()!==c.updates.l10n.updating&&t.data("originaltext",t.html()),c.a11y.speak(c.updates.l10n.updatingMsg,"polite"),t.text(c.updates.l10n.updating),o.trigger("wp-theme-updating",e),c.updates.ajax("update-theme",e)},c.updates.updateThemeSuccess=function(e){var t,a,s=p("body.modal-open").length,n=p('[data-slug="'+e.slug+'"]'),l={className:"updated-message notice-success notice-alt",message:c.updates.l10n.themeUpdated};"customize"===pagenow?((n=p(".updating-message").siblings(".theme-name")).length&&(a=n.html().replace(e.oldVersion,e.newVersion),n.html(a)),t=p(".theme-info .notice").add(c.customize.control("installed_theme_"+e.slug).container.find(".theme").find(".update-message"))):"themes-network"===pagenow?(t=n.find(".update-message"),a=n.find(".theme-version-author-uri").html().replace(e.oldVersion,e.newVersion),n.find(".theme-version-author-uri").html(a),n.find(".auto-update-time").empty()):(t=p(".theme-info .notice").add(n.find(".update-message")),s?(p(".load-customize:visible").focus(),p(".theme-info .theme-autoupdate").find(".auto-update-time").empty()):n.find(".load-customize").focus()),c.updates.addAdminNotice(_.extend({selector:t},l)),c.a11y.speak(c.updates.l10n.updatedMsg,"polite"),c.updates.decrementCount("theme"),o.trigger("wp-theme-update-success",e),s&&"customize"!==pagenow&&p(".theme-info .theme-author").after(c.updates.adminNotice(l))},c.updates.updateThemeError=function(e){var t,a=p('[data-slug="'+e.slug+'"]'),s=c.updates.l10n.updateFailed.replace("%s",e.errorMessage);c.updates.isValidResponse(e,"update")&&(c.updates.maybeHandleCredentialError(e,"update-theme")||("customize"===pagenow&&(a=c.customize.control("installed_theme_"+e.slug).container.find(".theme")),"themes-network"===pagenow?t=a.find(".update-message "):(t=p(".theme-info .notice").add(a.find(".notice")),p("body.modal-open").length?p(".load-customize:visible").focus():a.find(".load-customize").focus()),c.updates.addAdminNotice({selector:t,className:"update-message notice-error notice-alt is-dismissible",message:s}),c.a11y.speak(s,"polite"),o.trigger("wp-theme-update-error",e)))},c.updates.installTheme=function(e){var t=p('.theme-install[data-slug="'+e.slug+'"]');return e=_.extend({success:c.updates.installThemeSuccess,error:c.updates.installThemeError},e),t.addClass("updating-message"),t.parents(".theme").addClass("focus"),t.html()!==c.updates.l10n.installing&&t.data("originaltext",t.html()),t.text(c.updates.l10n.installing).attr("aria-label",c.updates.l10n.themeInstallingLabel.replace("%s",t.data("name"))),c.a11y.speak(c.updates.l10n.installingMsg,"polite"),p('.install-theme-info, [data-slug="'+e.slug+'"]').removeClass("theme-install-failed").find(".notice.notice-error").remove(),o.trigger("wp-theme-installing",e),c.updates.ajax("install-theme",e)},c.updates.installThemeSuccess=function(e){var t,a=p(".wp-full-overlay-header, [data-slug="+e.slug+"]");o.trigger("wp-theme-install-success",e),t=a.find(".button-primary").removeClass("updating-message").addClass("updated-message disabled").attr("aria-label",c.updates.l10n.themeInstalledLabel.replace("%s",e.themeName)).text(c.updates.l10n.themeInstalled),c.a11y.speak(c.updates.l10n.installedMsg,"polite"),setTimeout(function(){e.activateUrl&&t.attr("href",e.activateUrl).removeClass("theme-install updated-message disabled").addClass("activate").attr("aria-label",c.updates.l10n.activateThemeLabel.replace("%s",e.themeName)).text(c.updates.l10n.activateTheme),e.customizeUrl&&t.siblings(".preview").replaceWith(function(){return p("").attr("href",e.customizeUrl).addClass("button load-customize").text(c.updates.l10n.livePreview)})},1e3)},c.updates.installThemeError=function(e){var t,a=c.updates.l10n.installFailed.replace("%s",e.errorMessage),s=c.updates.adminNotice({className:"update-message notice-error notice-alt",message:a});c.updates.isValidResponse(e,"install")&&(c.updates.maybeHandleCredentialError(e,"install-theme")||("customize"===pagenow?(o.find("body").hasClass("modal-open")?(t=p('.theme-install[data-slug="'+e.slug+'"]'),p(".theme-overlay .theme-info").prepend(s)):(t=p('.theme-install[data-slug="'+e.slug+'"]')).closest(".theme").addClass("theme-install-failed").append(s),c.customize.notifications.remove("theme_installing")):o.find("body").hasClass("full-overlay-active")?(t=p('.theme-install[data-slug="'+e.slug+'"]'),p(".install-theme-info").prepend(s)):t=p('[data-slug="'+e.slug+'"]').removeClass("focus").addClass("theme-install-failed").append(s).find(".theme-install"),t.removeClass("updating-message").attr("aria-label",c.updates.l10n.themeInstallFailedLabel.replace("%s",t.data("name"))).text(c.updates.l10n.installFailedShort),c.a11y.speak(a,"assertive"),o.trigger("wp-theme-install-error",e)))},c.updates.deleteTheme=function(e){var t;return"themes"===pagenow?t=p(".theme-actions .delete-theme"):"themes-network"===pagenow&&(t=p('[data-slug="'+e.slug+'"]').find(".row-actions a.delete")),e=_.extend({success:c.updates.deleteThemeSuccess,error:c.updates.deleteThemeError},e),t&&t.html()!==c.updates.l10n.deleting&&t.data("originaltext",t.html()).text(c.updates.l10n.deleting),c.a11y.speak(c.updates.l10n.deleting,"polite"),p(".theme-info .update-message").remove(),o.trigger("wp-theme-deleting",e),c.updates.ajax("delete-theme",e)},c.updates.deleteThemeSuccess=function(n){var e=p('[data-slug="'+n.slug+'"]');"themes-network"===pagenow&&e.css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=p(".subsubsub"),t=p(this),a=g.themes,s=c.template("item-deleted-row");t.hasClass("plugin-update-tr")||t.after(s({slug:n.slug,colspan:p("#bulk-action-form").find("thead th:not(.hidden), thead td").length,name:t.find(".theme-title strong").text()})),t.remove(),t.hasClass("update")&&(a.upgrade--,c.updates.decrementCount("theme")),t.hasClass("inactive")&&(a.disabled--,a.disabled?e.find(".disabled .count").text("("+a.disabled+")"):e.find(".disabled").remove()),e.find(".all .count").text("("+--a.all+")")}),c.a11y.speak(c.updates.l10n.themeDeleted,"polite"),o.trigger("wp-theme-delete-success",n)},c.updates.deleteThemeError=function(e){var t=p('tr.inactive[data-slug="'+e.slug+'"]'),a=p(".theme-actions .delete-theme"),s=c.template("item-update-row"),n=t.siblings("#"+e.slug+"-update"),l=c.updates.l10n.deleteFailed.replace("%s",e.errorMessage),i=c.updates.adminNotice({className:"update-message notice-error notice-alt",message:l});c.updates.maybeHandleCredentialError(e,"delete-theme")||("themes-network"===pagenow?n.length?(n.find(".notice-error").remove(),n.find(".plugin-update").append(i)):t.addClass("update").after(s({slug:e.slug,colspan:p("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:i})):p(".theme-info .theme-description").before(i),a.html(a.data("originaltext")),c.a11y.speak(l,"assertive"),o.trigger("wp-theme-delete-error",e))},c.updates._addCallbacks=function(e,t){return"import"===pagenow&&"install-plugin"===t&&(e.success=c.updates.installImporterSuccess,e.error=c.updates.installImporterError),e},c.updates.queueChecker=function(){var e;if(!c.updates.ajaxLocked&&c.updates.queue.length)switch((e=c.updates.queue.shift()).action){case"install-plugin":c.updates.installPlugin(e.data);break;case"update-plugin":c.updates.updatePlugin(e.data);break;case"delete-plugin":c.updates.deletePlugin(e.data);break;case"install-theme":c.updates.installTheme(e.data);break;case"update-theme":c.updates.updateTheme(e.data);break;case"delete-theme":c.updates.deleteTheme(e.data)}},c.updates.requestFilesystemCredentials=function(e){!1===c.updates.filesystemCredentials.available&&(e&&!c.updates.$elToReturnFocusToFromCredentialsModal&&(c.updates.$elToReturnFocusToFromCredentialsModal=p(e.target)),c.updates.ajaxLocked=!0,c.updates.requestForCredentialsModalOpen())},c.updates.maybeRequestFilesystemCredentials=function(e){c.updates.shouldRequestFilesystemCredentials&&!c.updates.ajaxLocked&&c.updates.requestFilesystemCredentials(e)},c.updates.keydown=function(e){27===e.keyCode?c.updates.requestForCredentialsModalCancel():9===e.keyCode&&("upgrade"!==e.target.id||e.shiftKey?"hostname"===e.target.id&&e.shiftKey&&(p("#upgrade").focus(),e.preventDefault()):(p("#hostname").focus(),e.preventDefault()))},c.updates.requestForCredentialsModalOpen=function(){var e=p("#request-filesystem-credentials-dialog");p("body").addClass("modal-open"),e.show(),e.find("input:enabled:first").focus(),e.on("keydown",c.updates.keydown)},c.updates.requestForCredentialsModalClose=function(){p("#request-filesystem-credentials-dialog").hide(),p("body").removeClass("modal-open"),c.updates.$elToReturnFocusToFromCredentialsModal&&c.updates.$elToReturnFocusToFromCredentialsModal.focus()},c.updates.requestForCredentialsModalCancel=function(){(c.updates.ajaxLocked||c.updates.queue.length)&&(_.each(c.updates.queue,function(e){o.trigger("credential-modal-cancel",e)}),c.updates.ajaxLocked=!1,c.updates.queue=[],c.updates.requestForCredentialsModalClose())},c.updates.showErrorInCredentialsForm=function(e){var t=p("#request-filesystem-credentials-form");t.find(".notice").remove(),t.find("#request-filesystem-credentials-title").after('

'+e+"

")},c.updates.credentialError=function(e,t){e=c.updates._addCallbacks(e,t),c.updates.queue.unshift({action:t,data:e}),c.updates.filesystemCredentials.available=!1,c.updates.showErrorInCredentialsForm(e.errorMessage),c.updates.requestFilesystemCredentials()},c.updates.maybeHandleCredentialError=function(e,t){return!(!c.updates.shouldRequestFilesystemCredentials||!e.errorCode||"unable_to_connect_to_filesystem"!==e.errorCode)&&(c.updates.credentialError(e,t),!0)},c.updates.isValidResponse=function(e,t){var a,s=c.updates.l10n.unknownError;if(_.isObject(e)&&!_.isFunction(e.always))return!0;switch(_.isString(e)&&"-1"===e?s=c.updates.l10n.nonceError:_.isString(e)?s=e:void 0!==e.readyState&&0===e.readyState?s=c.updates.l10n.connectionError:_.isString(e.responseText)&&""!==e.responseText?s=e.responseText:_.isString(e.statusText)&&(s=e.statusText),t){case"update":a=c.updates.l10n.updateFailed;break;case"install":a=c.updates.l10n.installFailed;break;case"delete":a=c.updates.l10n.deleteFailed}return s=s.replace(/<[\/a-z][^<>]*>/gi,""),a=a.replace("%s",s),c.updates.addAdminNotice({id:"unknown_error",className:"notice-error is-dismissible",message:_.escape(a)}),c.updates.ajaxLocked=!1,c.updates.queue=[],p(".button.updating-message").removeClass("updating-message").removeAttr("aria-label").prop("disabled",!0).text(c.updates.l10n.updateFailedShort),p(".updating-message:not(.button):not(.thickbox)").removeClass("updating-message notice-warning").addClass("notice-error").find("p").removeAttr("aria-label").text(a),c.a11y.speak(a,"assertive"),!1},c.updates.beforeunload=function(){if(c.updates.ajaxLocked)return c.updates.l10n.beforeunload},p(function(){var l=p("#plugin-filter"),r=p("#bulk-action-form"),e=p("#request-filesystem-credentials-form"),t=p("#request-filesystem-credentials-dialog"),a=p(".plugins-php .wp-filter-search"),s=p(".plugin-install-php .wp-filter-search");(g=_.extend(g,window._wpUpdatesItemCounts||{})).totals&&c.updates.refreshCount(),c.updates.shouldRequestFilesystemCredentials=0").html(a.find("p").data("originaltext"))),a.removeClass("updating-message").html(s),"plugin-install"!==pagenow&&"plugin-install-network"!==pagenow||("update-plugin"===t.action?a.attr("aria-label",c.updates.l10n.pluginUpdateNowLabel.replace("%s",a.data("name"))):"install-plugin"===t.action&&a.attr("aria-label",c.updates.l10n.pluginInstallNowLabel.replace("%s",a.data("name"))))),c.a11y.speak(c.updates.l10n.updateCancel,"polite")}),r.on("click","[data-plugin] .update-link",function(e){var t=p(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.maybeRequestFilesystemCredentials(e),c.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),c.updates.updatePlugin({plugin:a.data("plugin"),slug:a.data("slug")}))}),l.on("click",".update-now",function(e){var t=p(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.maybeRequestFilesystemCredentials(e),c.updates.updatePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),l.on("click",".install-now",function(e){var t=p(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.shouldRequestFilesystemCredentials&&!c.updates.ajaxLocked&&(c.updates.requestFilesystemCredentials(e),o.on("credential-modal-cancel",function(){p(".install-now.updating-message").removeClass("updating-message").text(c.updates.l10n.installNow),c.a11y.speak(c.updates.l10n.updateCancel,"polite")})),c.updates.installPlugin({slug:t.data("slug")}))}),o.on("click",".importer-item .install-now",function(e){var t=p(e.target),a=p(this).data("name");e.preventDefault(),t.hasClass("updating-message")||(c.updates.shouldRequestFilesystemCredentials&&!c.updates.ajaxLocked&&(c.updates.requestFilesystemCredentials(e),o.on("credential-modal-cancel",function(){t.removeClass("updating-message").text(c.updates.l10n.installNow).attr("aria-label",c.updates.l10n.pluginInstallNowLabel.replace("%s",a)),c.a11y.speak(c.updates.l10n.updateCancel,"polite")})),c.updates.installPlugin({slug:t.data("slug"),pagenow:pagenow,success:c.updates.installImporterSuccess,error:c.updates.installImporterError}))}),r.on("click","[data-plugin] a.delete",function(e){var t=p(e.target).parents("tr");e.preventDefault(),window.confirm(c.updates.l10n.aysDeleteUninstall.replace("%s",t.find(".plugin-title strong").text()))&&(c.updates.maybeRequestFilesystemCredentials(e),c.updates.deletePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),o.on("click",".themes-php.network-admin .update-link",function(e){var t=p(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.maybeRequestFilesystemCredentials(e),c.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),c.updates.updateTheme({slug:a.data("slug")}))}),o.on("click",".themes-php.network-admin a.delete",function(e){var t=p(e.target).parents("tr");e.preventDefault(),window.confirm(c.updates.l10n.aysDelete.replace("%s",t.find(".theme-title strong").text()))&&(c.updates.maybeRequestFilesystemCredentials(e),c.updates.deleteTheme({slug:t.data("slug")}))}),r.on("click",'[type="submit"]:not([name="clear-recent-list"])',function(e){var t,n,l=p(e.target).siblings("select").val(),a=r.find('input[name="checked[]"]:checked'),i=0,d=0,u=[];switch(pagenow){case"plugins":case"plugins-network":t="plugin";break;case"themes-network":t="theme";break;default:return}if(!a.length)return e.preventDefault(),p("html, body").animate({scrollTop:0}),c.updates.addAdminNotice({id:"no-items-selected",className:"notice-error is-dismissible",message:c.updates.l10n.noItemsSelected});switch(l){case"update-selected":n=l.replace("selected",t);break;case"delete-selected":if(!window.confirm("plugin"===t?c.updates.l10n.aysBulkDelete:c.updates.l10n.aysBulkDeleteThemes))return void e.preventDefault();n=l.replace("selected",t);break;default:return}c.updates.maybeRequestFilesystemCredentials(e),e.preventDefault(),r.find('.manage-column [type="checkbox"]').prop("checked",!1),o.trigger("wp-"+t+"-bulk-"+l,a),a.each(function(e,t){var a=p(t),s=a.parents("tr");"update-selected"!==l||s.hasClass("update")&&!s.find("notice-error").length?c.updates.queue.push({action:n,data:{plugin:s.data("plugin"),slug:s.data("slug")}}):a.prop("checked",!1)}),o.on("wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error",function(e,t){var a,s,n=p('[data-slug="'+t.slug+'"]');"wp-"+t.update+"-update-success"===e.type?i++:(s=t.pluginName?t.pluginName:n.find(".column-primary strong").text(),d++,u.push(s+": "+t.errorMessage)),n.find('input[name="checked[]"]:checked').prop("checked",!1),c.updates.adminNotice=c.template("wp-bulk-updates-admin-notice"),c.updates.addAdminNotice({id:"bulk-action-notice",className:"bulk-action-notice",successes:i,errors:d,errorMessages:u,type:t.update}),a=p("#bulk-action-notice").on("click","button",function(){p(this).toggleClass("bulk-action-errors-collapsed").attr("aria-expanded",!p(this).hasClass("bulk-action-errors-collapsed")),a.find(".bulk-action-errors").toggleClass("hidden")}),0').append(p("
",{class:"current",href:s,text:c.updates.l10n.searchResultsLabel})),p(".wp-filter .filter-links .current").removeClass("current").parents(".filter-links").prepend(n),l.prev("p").remove(),p(".plugins-popular-tags-wrapper").remove()),void 0!==c.updates.searchRequest&&c.updates.searchRequest.abort(),p("body").addClass("loading-content"),c.updates.searchRequest=c.ajax.post("search-install-plugins",a).done(function(e){p("body").removeClass("loading-content"),l.append(e.items),delete c.updates.searchRequest,0===e.count?c.a11y.speak(c.updates.l10n.noPluginsFound):c.a11y.speak(c.updates.l10n.pluginsFound.replace("%d",e.count))}))},1e3)),a.length&&a.attr("aria-describedby","live-search-desc"),a.on("keyup input",_.debounce(function(e){var t,s={_ajax_nonce:c.updates.ajaxNonce,s:e.target.value,pagenow:pagenow,plugin_status:"all"};"keyup"===e.type&&27===e.which&&(e.target.value=""),c.updates.searchTerm!==s.s&&(c.updates.searchTerm=s.s,t=_.object(_.compact(_.map(location.search.slice(1).split("&"),function(e){if(e)return e.split("=")}))),s.plugin_status=t.plugin_status||"all",window.history&&window.history.replaceState&&window.history.replaceState(null,"",location.href.split("?")[0]+"?s="+s.s+"&plugin_status="+s.plugin_status),void 0!==c.updates.searchRequest&&c.updates.searchRequest.abort(),r.empty(),p("body").addClass("loading-content"),p(".subsubsub .current").removeClass("current"),c.updates.searchRequest=c.ajax.post("search-plugins",s).done(function(e){var t=p("").addClass("subtitle").html(c.updates.l10n.searchResults.replace("%s",_.escape(s.s))),a=p(".wrap .subtitle");s.s.length?a.length?a.replaceWith(t):p(".wp-header-end").before(t):(a.remove(),p(".subsubsub ."+s.plugin_status+" a").addClass("current")),p("body").removeClass("loading-content"),r.append(e.items),delete c.updates.searchRequest,0===e.count?c.a11y.speak(c.updates.l10n.noPluginsFound):c.a11y.speak(c.updates.l10n.pluginsFound.replace("%d",e.count))}))},500)),o.on("submit",".search-plugins",function(e){e.preventDefault(),p("input.wp-filter-search").trigger("input")}),o.on("click",".try-again",function(e){e.preventDefault(),s.trigger("input")}),p("#typeselector").on("change",function(){var e=p('input[name="s"]');e.val().length&&e.trigger("input","typechange")}),p("#plugin_update_from_iframe").on("click",function(e){var t,a=window.parent===window?null:window.parent;p.support.postMessage=!!window.postMessage,!1!==p.support.postMessage&&null!==a&&-1===window.parent.location.pathname.indexOf("update-core.php")&&(e.preventDefault(),t={action:"update-plugin",data:{plugin:p(this).data("plugin"),slug:p(this).data("slug")}},a.postMessage(JSON.stringify(t),window.location.origin))}),p("#plugin_install_from_iframe").on("click",function(e){var t,a=window.parent===window?null:window.parent;p.support.postMessage=!!window.postMessage,!1!==p.support.postMessage&&null!==a&&-1===window.parent.location.pathname.indexOf("index.php")&&(e.preventDefault(),t={action:"install-plugin",data:{slug:p(this).data("slug")}},a.postMessage(JSON.stringify(t),window.location.origin))}),p(window).on("message",function(e){var t,a=e.originalEvent,s=document.location.protocol+"//"+document.location.host;if(a.origin===s){try{t=p.parseJSON(a.data)}catch(e){return}if(t&&void 0!==t.action)switch(t.action){case"decrementUpdateCount":c.updates.decrementCount(t.upgradeType);break;case"install-plugin":case"update-plugin":window.tb_remove(),t.data=c.updates._addCallbacks(t.data,t.action),c.updates.queue.push(t),c.updates.queueChecker()}}}),p(window).on("beforeunload",c.updates.beforeunload),o.on("click",".column-auto-updates a.toggle-auto-update, .theme-overlay a.toggle-auto-update",function(e){var t,a,s,d,u=p(this),r=u.attr("data-wp-action"),o=u.find(".label");if(d="themes"!==pagenow?u.closest(".column-auto-updates"):u.closest(".theme-autoupdate"),e.preventDefault(),"yes"!==u.attr("data-doing-ajax")){switch(u.attr("data-doing-ajax","yes"),pagenow){case"plugins":case"plugins-network":s="plugin",a=u.closest("tr").attr("data-plugin");break;case"themes-network":s="theme",a=u.closest("tr").attr("data-slug");break;case"themes":s="theme",a=u.attr("data-slug")}d.find(".notice.error").addClass("hidden"),"enable"===r?o.text(c.updates.l10n.autoUpdatesEnabling):o.text(c.updates.l10n.autoUpdatesDisabling),u.find(".dashicons-update").removeClass("hidden"),t={action:"toggle-auto-updates",_ajax_nonce:g.ajax_nonce,state:r,type:s,asset:a},p.post(window.ajaxurl,t).done(function(e){var t,a,s,n,l,i=u.attr("href");if(!e.success)return l=e.data&&e.data.error?e.data.error:c.updates.l10n.autoUpdatesError,d.find(".notice.error").removeClass("hidden").find("p").text(l),void c.a11y.speak(l,"polite");if("themes"!==pagenow){switch(t=p(".auto-update-enabled span"),a=p(".auto-update-disabled span"),s=parseInt(t.text().replace(/[^\d]+/g,""),10)||0,n=parseInt(a.text().replace(/[^\d]+/g,""),10)||0,r){case"enable":++s,--n;break;case"disable":--s,++n}s=Math.max(0,s),n=Math.max(0,n),t.text("("+s+")"),a.text("("+n+")")}"enable"===r?(i=i.replace("action=enable-auto-update","action=disable-auto-update"),u.attr({"data-wp-action":"disable",href:i}),o.text(c.updates.l10n.autoUpdatesDisable),d.find(".auto-update-time").removeClass("hidden"),c.a11y.speak(c.updates.l10n.autoUpdatesEnabled,"polite")):(i=i.replace("action=disable-auto-update","action=enable-auto-update"),u.attr({"data-wp-action":"enable",href:i}),o.text(c.updates.l10n.autoUpdatesEnable),d.find(".auto-update-time").addClass("hidden"),c.a11y.speak(c.updates.l10n.autoUpdatesDisabled,"polite"))}).fail(function(){d.find(".notice.error").removeClass("hidden").find("p").text(c.updates.l10n.autoUpdatesError),c.a11y.speak(c.updates.l10n.autoUpdatesError,"polite")}).always(function(){u.removeAttr("data-doing-ajax").find(".dashicons-update").addClass("hidden")})}})})}(jQuery,window.wp,window._wpUpdatesSettings); \ No newline at end of file +!function(g,m,h){var f=g(document);(m=m||{}).updates={},m.updates.ajaxNonce=h.ajax_nonce,m.updates.l10n=h.l10n,m.updates.searchTerm="",m.updates.shouldRequestFilesystemCredentials=!1,m.updates.filesystemCredentials={ftp:{host:"",username:"",password:"",connectionType:""},ssh:{publicKey:"",privateKey:""},fsNonce:"",available:!1},m.updates.ajaxLocked=!1,m.updates.adminNotice=m.template("wp-updates-admin-notice"),m.updates.queue=[],m.updates.$elToReturnFocusToFromCredentialsModal=void 0,m.updates.addAdminNotice=function(e){var t,a=g(e.selector),s=g(".wp-header-end");delete e.selector,t=m.updates.adminNotice(e),a.length||(a=g("#"+e.id)),a.length?a.replaceWith(t):s.length?s.after(t):"customize"===pagenow?g(".customize-themes-notifications").append(t):g(".wrap").find("> h1").after(t),f.trigger("wp-updates-notice-added")},m.updates.ajax=function(e,t){var a={};return m.updates.ajaxLocked?(m.updates.queue.push({action:e,data:t}),g.Deferred()):(m.updates.ajaxLocked=!0,t.success&&(a.success=t.success,delete t.success),t.error&&(a.error=t.error,delete t.error),a.data=_.extend(t,{action:e,_ajax_nonce:m.updates.ajaxNonce,_fs_nonce:m.updates.filesystemCredentials.fsNonce,username:m.updates.filesystemCredentials.ftp.username,password:m.updates.filesystemCredentials.ftp.password,hostname:m.updates.filesystemCredentials.ftp.hostname,connection_type:m.updates.filesystemCredentials.ftp.connectionType,public_key:m.updates.filesystemCredentials.ssh.publicKey,private_key:m.updates.filesystemCredentials.ssh.privateKey}),m.ajax.send(a).always(m.updates.ajaxAlways))},m.updates.ajaxAlways=function(e){e.errorCode&&"unable_to_connect_to_filesystem"===e.errorCode||(m.updates.ajaxLocked=!1,m.updates.queueChecker()),void 0!==e.debug&&window.console&&window.console.log&&_.map(e.debug,function(e){window.console.log(m.sanitize.stripTagsAndEncodeText(e))})},m.updates.refreshCount=function(){var e,t=g("#wp-admin-bar-updates"),a=g('a[href="update-core.php"] .update-plugins'),s=g('a[href="plugins.php"] .update-plugins'),n=g('a[href="themes.php"] .update-plugins');t.find(".ab-item").removeAttr("title"),t.find(".ab-label").text(h.totals.counts.total),0===h.totals.counts.total&&t.find(".ab-label").parents("li").remove(),a.each(function(e,t){t.className=t.className.replace(/count-\d+/,"count-"+h.totals.counts.total)}),0

'+t+"

"),a.on("click",".notice.is-dismissible .notice-dismiss",function(){setTimeout(function(){a.removeClass("plugin-card-update-failed").find(".column-name a").focus()},200)}),s.removeClass("updating-message").addClass("button-disabled").attr("aria-label",m.updates.l10n.pluginInstallFailedLabel.replace("%s",s.data("name"))).text(m.updates.l10n.installFailedShort),m.a11y.speak(t,"assertive"),f.trigger("wp-plugin-install-error",e)))},m.updates.installImporterSuccess=function(e){m.updates.addAdminNotice({id:"install-success",className:"notice-success is-dismissible",message:m.updates.l10n.importerInstalledMsg.replace("%s",e.activateUrl+"&from=import")}),g('[data-slug="'+e.slug+'"]').removeClass("install-now updating-message").addClass("activate-now").attr({href:e.activateUrl+"&from=import","aria-label":m.updates.l10n.activateImporterLabel.replace("%s",e.pluginName)}).text(m.updates.l10n.activateImporter),m.a11y.speak(m.updates.l10n.installedMsg,"polite"),f.trigger("wp-importer-install-success",e)},m.updates.installImporterError=function(e){var t=m.updates.l10n.installFailed.replace("%s",e.errorMessage),a=g('[data-slug="'+e.slug+'"]'),s=a.data("name");m.updates.isValidResponse(e,"install")&&(m.updates.maybeHandleCredentialError(e,"install-plugin")||(m.updates.addAdminNotice({id:e.errorCode,className:"notice-error is-dismissible",message:t}),a.removeClass("updating-message").text(m.updates.l10n.installNow).attr("aria-label",m.updates.l10n.pluginInstallNowLabel.replace("%s",s)),m.a11y.speak(t,"assertive"),f.trigger("wp-importer-install-error",e)))},m.updates.deletePlugin=function(e){var t=g('[data-plugin="'+e.plugin+'"]').find(".row-actions a.delete");return e=_.extend({success:m.updates.deletePluginSuccess,error:m.updates.deletePluginError},e),t.html()!==m.updates.l10n.deleting&&t.data("originaltext",t.html()).text(m.updates.l10n.deleting),m.a11y.speak(m.updates.l10n.deleting,"polite"),f.trigger("wp-plugin-deleting",e),m.updates.ajax("delete-plugin",e)},m.updates.deletePluginSuccess=function(i){g('[data-plugin="'+i.plugin+'"]').css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=g("#bulk-action-form"),t=g(".subsubsub"),a=g(this),s=e.find("thead th:not(.hidden), thead td").length,n=m.template("item-deleted-row"),l=h.plugins;a.hasClass("plugin-update-tr")||a.after(n({slug:i.slug,plugin:i.plugin,colspan:s,name:i.pluginName})),a.remove(),-1!==_.indexOf(l.upgrade,i.plugin)&&(l.upgrade=_.without(l.upgrade,i.plugin),m.updates.decrementCount("plugin")),-1!==_.indexOf(l.inactive,i.plugin)&&(l.inactive=_.without(l.inactive,i.plugin),l.inactive.length?t.find(".inactive .count").text("("+l.inactive.length+")"):t.find(".inactive").remove()),-1!==_.indexOf(l.active,i.plugin)&&(l.active=_.without(l.active,i.plugin),l.active.length?t.find(".active .count").text("("+l.active.length+")"):t.find(".active").remove()),-1!==_.indexOf(l.recently_activated,i.plugin)&&(l.recently_activated=_.without(l.recently_activated,i.plugin),l.recently_activated.length?t.find(".recently_activated .count").text("("+l.recently_activated.length+")"):t.find(".recently_activated").remove()),l.all=_.without(l.all,i.plugin),l.all.length?t.find(".all .count").text("("+l.all.length+")"):(e.find(".tablenav").css({visibility:"hidden"}),t.find(".all").remove(),e.find("tr.no-items").length||e.find("#the-list").append(''+m.updates.l10n.noPlugins+""))}),m.a11y.speak(m.updates.l10n.pluginDeleted,"polite"),f.trigger("wp-plugin-delete-success",i)},m.updates.deletePluginError=function(e){var t,a,s=m.template("item-update-row"),n=m.updates.adminNotice({className:"update-message notice-error notice-alt",message:e.errorMessage});a=e.plugin?(t=g('tr.inactive[data-plugin="'+e.plugin+'"]')).siblings('[data-plugin="'+e.plugin+'"]'):(t=g('tr.inactive[data-slug="'+e.slug+'"]')).siblings('[data-slug="'+e.slug+'"]'),m.updates.isValidResponse(e,"delete")&&(m.updates.maybeHandleCredentialError(e,"delete-plugin")||(a.length?(a.find(".notice-error").remove(),a.find(".plugin-update").append(n)):t.addClass("update").after(s({slug:e.slug,plugin:e.plugin||e.slug,colspan:g("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:n})),f.trigger("wp-plugin-delete-error",e)))},m.updates.updateTheme=function(e){var t;return e=_.extend({success:m.updates.updateThemeSuccess,error:m.updates.updateThemeError},e),(t="themes-network"===pagenow?g('[data-slug="'+e.slug+'"]').find(".update-message").removeClass("notice-error").addClass("updating-message notice-warning").find("p"):"customize"===pagenow?((t=g('[data-slug="'+e.slug+'"].notice').removeClass("notice-large")).find("h3").remove(),(t=t.add(g("#customize-control-installed_theme_"+e.slug).find(".update-message"))).addClass("updating-message").find("p")):((t=g("#update-theme").closest(".notice").removeClass("notice-large")).find("h3").remove(),(t=t.add(g('[data-slug="'+e.slug+'"]').find(".update-message"))).addClass("updating-message").find("p"))).html()!==m.updates.l10n.updating&&t.data("originaltext",t.html()),m.a11y.speak(m.updates.l10n.updatingMsg,"polite"),t.text(m.updates.l10n.updating),f.trigger("wp-theme-updating",e),m.updates.ajax("update-theme",e)},m.updates.updateThemeSuccess=function(e){var t,a,s=g("body.modal-open").length,n=g('[data-slug="'+e.slug+'"]'),l={className:"updated-message notice-success notice-alt",message:m.updates.l10n.themeUpdated};"customize"===pagenow?((n=g(".updating-message").siblings(".theme-name")).length&&(a=n.html().replace(e.oldVersion,e.newVersion),n.html(a)),t=g(".theme-info .notice").add(m.customize.control("installed_theme_"+e.slug).container.find(".theme").find(".update-message"))):"themes-network"===pagenow?(t=n.find(".update-message"),a=n.find(".theme-version-author-uri").html().replace(e.oldVersion,e.newVersion),n.find(".theme-version-author-uri").html(a),n.find(".auto-update-time").empty()):(t=g(".theme-info .notice").add(n.find(".update-message")),s?(g(".load-customize:visible").focus(),g(".theme-info .theme-autoupdate").find(".auto-update-time").empty()):n.find(".load-customize").focus()),m.updates.addAdminNotice(_.extend({selector:t},l)),m.a11y.speak(m.updates.l10n.updatedMsg,"polite"),m.updates.decrementCount("theme"),f.trigger("wp-theme-update-success",e),s&&"customize"!==pagenow&&g(".theme-info .theme-author").after(m.updates.adminNotice(l))},m.updates.updateThemeError=function(e){var t,a=g('[data-slug="'+e.slug+'"]'),s=m.updates.l10n.updateFailed.replace("%s",e.errorMessage);m.updates.isValidResponse(e,"update")&&(m.updates.maybeHandleCredentialError(e,"update-theme")||("customize"===pagenow&&(a=m.customize.control("installed_theme_"+e.slug).container.find(".theme")),"themes-network"===pagenow?t=a.find(".update-message "):(t=g(".theme-info .notice").add(a.find(".notice")),g("body.modal-open").length?g(".load-customize:visible").focus():a.find(".load-customize").focus()),m.updates.addAdminNotice({selector:t,className:"update-message notice-error notice-alt is-dismissible",message:s}),m.a11y.speak(s,"polite"),f.trigger("wp-theme-update-error",e)))},m.updates.installTheme=function(e){var t=g('.theme-install[data-slug="'+e.slug+'"]');return e=_.extend({success:m.updates.installThemeSuccess,error:m.updates.installThemeError},e),t.addClass("updating-message"),t.parents(".theme").addClass("focus"),t.html()!==m.updates.l10n.installing&&t.data("originaltext",t.html()),t.text(m.updates.l10n.installing).attr("aria-label",m.updates.l10n.themeInstallingLabel.replace("%s",t.data("name"))),m.a11y.speak(m.updates.l10n.installingMsg,"polite"),g('.install-theme-info, [data-slug="'+e.slug+'"]').removeClass("theme-install-failed").find(".notice.notice-error").remove(),f.trigger("wp-theme-installing",e),m.updates.ajax("install-theme",e)},m.updates.installThemeSuccess=function(e){var t,a=g(".wp-full-overlay-header, [data-slug="+e.slug+"]");f.trigger("wp-theme-install-success",e),t=a.find(".button-primary").removeClass("updating-message").addClass("updated-message disabled").attr("aria-label",m.updates.l10n.themeInstalledLabel.replace("%s",e.themeName)).text(m.updates.l10n.themeInstalled),m.a11y.speak(m.updates.l10n.installedMsg,"polite"),setTimeout(function(){e.activateUrl&&t.attr("href",e.activateUrl).removeClass("theme-install updated-message disabled").addClass("activate").attr("aria-label",m.updates.l10n.activateThemeLabel.replace("%s",e.themeName)).text(m.updates.l10n.activateTheme),e.customizeUrl&&t.siblings(".preview").replaceWith(function(){return g("
").attr("href",e.customizeUrl).addClass("button load-customize").text(m.updates.l10n.livePreview)})},1e3)},m.updates.installThemeError=function(e){var t,a=m.updates.l10n.installFailed.replace("%s",e.errorMessage),s=m.updates.adminNotice({className:"update-message notice-error notice-alt",message:a});m.updates.isValidResponse(e,"install")&&(m.updates.maybeHandleCredentialError(e,"install-theme")||("customize"===pagenow?(f.find("body").hasClass("modal-open")?(t=g('.theme-install[data-slug="'+e.slug+'"]'),g(".theme-overlay .theme-info").prepend(s)):(t=g('.theme-install[data-slug="'+e.slug+'"]')).closest(".theme").addClass("theme-install-failed").append(s),m.customize.notifications.remove("theme_installing")):f.find("body").hasClass("full-overlay-active")?(t=g('.theme-install[data-slug="'+e.slug+'"]'),g(".install-theme-info").prepend(s)):t=g('[data-slug="'+e.slug+'"]').removeClass("focus").addClass("theme-install-failed").append(s).find(".theme-install"),t.removeClass("updating-message").attr("aria-label",m.updates.l10n.themeInstallFailedLabel.replace("%s",t.data("name"))).text(m.updates.l10n.installFailedShort),m.a11y.speak(a,"assertive"),f.trigger("wp-theme-install-error",e)))},m.updates.deleteTheme=function(e){var t;return"themes"===pagenow?t=g(".theme-actions .delete-theme"):"themes-network"===pagenow&&(t=g('[data-slug="'+e.slug+'"]').find(".row-actions a.delete")),e=_.extend({success:m.updates.deleteThemeSuccess,error:m.updates.deleteThemeError},e),t&&t.html()!==m.updates.l10n.deleting&&t.data("originaltext",t.html()).text(m.updates.l10n.deleting),m.a11y.speak(m.updates.l10n.deleting,"polite"),g(".theme-info .update-message").remove(),f.trigger("wp-theme-deleting",e),m.updates.ajax("delete-theme",e)},m.updates.deleteThemeSuccess=function(n){var e=g('[data-slug="'+n.slug+'"]');"themes-network"===pagenow&&e.css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=g(".subsubsub"),t=g(this),a=h.themes,s=m.template("item-deleted-row");t.hasClass("plugin-update-tr")||t.after(s({slug:n.slug,colspan:g("#bulk-action-form").find("thead th:not(.hidden), thead td").length,name:t.find(".theme-title strong").text()})),t.remove(),t.hasClass("update")&&(a.upgrade--,m.updates.decrementCount("theme")),t.hasClass("inactive")&&(a.disabled--,a.disabled?e.find(".disabled .count").text("("+a.disabled+")"):e.find(".disabled").remove()),e.find(".all .count").text("("+--a.all+")")}),m.a11y.speak(m.updates.l10n.themeDeleted,"polite"),f.trigger("wp-theme-delete-success",n)},m.updates.deleteThemeError=function(e){var t=g('tr.inactive[data-slug="'+e.slug+'"]'),a=g(".theme-actions .delete-theme"),s=m.template("item-update-row"),n=t.siblings("#"+e.slug+"-update"),l=m.updates.l10n.deleteFailed.replace("%s",e.errorMessage),i=m.updates.adminNotice({className:"update-message notice-error notice-alt",message:l});m.updates.maybeHandleCredentialError(e,"delete-theme")||("themes-network"===pagenow?n.length?(n.find(".notice-error").remove(),n.find(".plugin-update").append(i)):t.addClass("update").after(s({slug:e.slug,colspan:g("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:i})):g(".theme-info .theme-description").before(i),a.html(a.data("originaltext")),m.a11y.speak(l,"assertive"),f.trigger("wp-theme-delete-error",e))},m.updates._addCallbacks=function(e,t){return"import"===pagenow&&"install-plugin"===t&&(e.success=m.updates.installImporterSuccess,e.error=m.updates.installImporterError),e},m.updates.queueChecker=function(){var e;if(!m.updates.ajaxLocked&&m.updates.queue.length)switch((e=m.updates.queue.shift()).action){case"install-plugin":m.updates.installPlugin(e.data);break;case"update-plugin":m.updates.updatePlugin(e.data);break;case"delete-plugin":m.updates.deletePlugin(e.data);break;case"install-theme":m.updates.installTheme(e.data);break;case"update-theme":m.updates.updateTheme(e.data);break;case"delete-theme":m.updates.deleteTheme(e.data)}},m.updates.requestFilesystemCredentials=function(e){!1===m.updates.filesystemCredentials.available&&(e&&!m.updates.$elToReturnFocusToFromCredentialsModal&&(m.updates.$elToReturnFocusToFromCredentialsModal=g(e.target)),m.updates.ajaxLocked=!0,m.updates.requestForCredentialsModalOpen())},m.updates.maybeRequestFilesystemCredentials=function(e){m.updates.shouldRequestFilesystemCredentials&&!m.updates.ajaxLocked&&m.updates.requestFilesystemCredentials(e)},m.updates.keydown=function(e){27===e.keyCode?m.updates.requestForCredentialsModalCancel():9===e.keyCode&&("upgrade"!==e.target.id||e.shiftKey?"hostname"===e.target.id&&e.shiftKey&&(g("#upgrade").focus(),e.preventDefault()):(g("#hostname").focus(),e.preventDefault()))},m.updates.requestForCredentialsModalOpen=function(){var e=g("#request-filesystem-credentials-dialog");g("body").addClass("modal-open"),e.show(),e.find("input:enabled:first").focus(),e.on("keydown",m.updates.keydown)},m.updates.requestForCredentialsModalClose=function(){g("#request-filesystem-credentials-dialog").hide(),g("body").removeClass("modal-open"),m.updates.$elToReturnFocusToFromCredentialsModal&&m.updates.$elToReturnFocusToFromCredentialsModal.focus()},m.updates.requestForCredentialsModalCancel=function(){(m.updates.ajaxLocked||m.updates.queue.length)&&(_.each(m.updates.queue,function(e){f.trigger("credential-modal-cancel",e)}),m.updates.ajaxLocked=!1,m.updates.queue=[],m.updates.requestForCredentialsModalClose())},m.updates.showErrorInCredentialsForm=function(e){var t=g("#request-filesystem-credentials-form");t.find(".notice").remove(),t.find("#request-filesystem-credentials-title").after('

'+e+"

")},m.updates.credentialError=function(e,t){e=m.updates._addCallbacks(e,t),m.updates.queue.unshift({action:t,data:e}),m.updates.filesystemCredentials.available=!1,m.updates.showErrorInCredentialsForm(e.errorMessage),m.updates.requestFilesystemCredentials()},m.updates.maybeHandleCredentialError=function(e,t){return!(!m.updates.shouldRequestFilesystemCredentials||!e.errorCode||"unable_to_connect_to_filesystem"!==e.errorCode)&&(m.updates.credentialError(e,t),!0)},m.updates.isValidResponse=function(e,t){var a,s=m.updates.l10n.unknownError;if(_.isObject(e)&&!_.isFunction(e.always))return!0;switch(_.isString(e)&&"-1"===e?s=m.updates.l10n.nonceError:_.isString(e)?s=e:void 0!==e.readyState&&0===e.readyState?s=m.updates.l10n.connectionError:_.isString(e.responseText)&&""!==e.responseText?s=e.responseText:_.isString(e.statusText)&&(s=e.statusText),t){case"update":a=m.updates.l10n.updateFailed;break;case"install":a=m.updates.l10n.installFailed;break;case"delete":a=m.updates.l10n.deleteFailed}return s=s.replace(/<[\/a-z][^<>]*>/gi,""),a=a.replace("%s",s),m.updates.addAdminNotice({id:"unknown_error",className:"notice-error is-dismissible",message:_.escape(a)}),m.updates.ajaxLocked=!1,m.updates.queue=[],g(".button.updating-message").removeClass("updating-message").removeAttr("aria-label").prop("disabled",!0).text(m.updates.l10n.updateFailedShort),g(".updating-message:not(.button):not(.thickbox)").removeClass("updating-message notice-warning").addClass("notice-error").find("p").removeAttr("aria-label").text(a),m.a11y.speak(a,"assertive"),!1},m.updates.beforeunload=function(){if(m.updates.ajaxLocked)return m.updates.l10n.beforeunload},g(function(){var l=g("#plugin-filter"),r=g("#bulk-action-form"),e=g("#request-filesystem-credentials-form"),t=g("#request-filesystem-credentials-dialog"),a=g(".plugins-php .wp-filter-search"),s=g(".plugin-install-php .wp-filter-search");(h=_.extend(h,window._wpUpdatesItemCounts||{})).totals&&m.updates.refreshCount(),m.updates.shouldRequestFilesystemCredentials=0").html(a.find("p").data("originaltext"))),a.removeClass("updating-message").html(s),"plugin-install"!==pagenow&&"plugin-install-network"!==pagenow||("update-plugin"===t.action?a.attr("aria-label",m.updates.l10n.pluginUpdateNowLabel.replace("%s",a.data("name"))):"install-plugin"===t.action&&a.attr("aria-label",m.updates.l10n.pluginInstallNowLabel.replace("%s",a.data("name"))))),m.a11y.speak(m.updates.l10n.updateCancel,"polite")}),r.on("click","[data-plugin] .update-link",function(e){var t=g(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.maybeRequestFilesystemCredentials(e),m.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),m.updates.updatePlugin({plugin:a.data("plugin"),slug:a.data("slug")}))}),l.on("click",".update-now",function(e){var t=g(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.maybeRequestFilesystemCredentials(e),m.updates.updatePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),l.on("click",".install-now",function(e){var t=g(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.shouldRequestFilesystemCredentials&&!m.updates.ajaxLocked&&(m.updates.requestFilesystemCredentials(e),f.on("credential-modal-cancel",function(){g(".install-now.updating-message").removeClass("updating-message").text(m.updates.l10n.installNow),m.a11y.speak(m.updates.l10n.updateCancel,"polite")})),m.updates.installPlugin({slug:t.data("slug")}))}),f.on("click",".importer-item .install-now",function(e){var t=g(e.target),a=g(this).data("name");e.preventDefault(),t.hasClass("updating-message")||(m.updates.shouldRequestFilesystemCredentials&&!m.updates.ajaxLocked&&(m.updates.requestFilesystemCredentials(e),f.on("credential-modal-cancel",function(){t.removeClass("updating-message").text(m.updates.l10n.installNow).attr("aria-label",m.updates.l10n.pluginInstallNowLabel.replace("%s",a)),m.a11y.speak(m.updates.l10n.updateCancel,"polite")})),m.updates.installPlugin({slug:t.data("slug"),pagenow:pagenow,success:m.updates.installImporterSuccess,error:m.updates.installImporterError}))}),r.on("click","[data-plugin] a.delete",function(e){var t=g(e.target).parents("tr");e.preventDefault(),window.confirm(m.updates.l10n.aysDeleteUninstall.replace("%s",t.find(".plugin-title strong").text()))&&(m.updates.maybeRequestFilesystemCredentials(e),m.updates.deletePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),f.on("click",".themes-php.network-admin .update-link",function(e){var t=g(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(m.updates.maybeRequestFilesystemCredentials(e),m.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),m.updates.updateTheme({slug:a.data("slug")}))}),f.on("click",".themes-php.network-admin a.delete",function(e){var t=g(e.target).parents("tr");e.preventDefault(),window.confirm(m.updates.l10n.aysDelete.replace("%s",t.find(".theme-title strong").text()))&&(m.updates.maybeRequestFilesystemCredentials(e),m.updates.deleteTheme({slug:t.data("slug")}))}),r.on("click",'[type="submit"]:not([name="clear-recent-list"])',function(e){var t,n,l=g(e.target).siblings("select").val(),a=r.find('input[name="checked[]"]:checked'),i=0,d=0,u=[];switch(pagenow){case"plugins":case"plugins-network":t="plugin";break;case"themes-network":t="theme";break;default:return}if(!a.length)return e.preventDefault(),g("html, body").animate({scrollTop:0}),m.updates.addAdminNotice({id:"no-items-selected",className:"notice-error is-dismissible",message:m.updates.l10n.noItemsSelected});switch(l){case"update-selected":n=l.replace("selected",t);break;case"delete-selected":if(!window.confirm("plugin"===t?m.updates.l10n.aysBulkDelete:m.updates.l10n.aysBulkDeleteThemes))return void e.preventDefault();n=l.replace("selected",t);break;default:return}m.updates.maybeRequestFilesystemCredentials(e),e.preventDefault(),r.find('.manage-column [type="checkbox"]').prop("checked",!1),f.trigger("wp-"+t+"-bulk-"+l,a),a.each(function(e,t){var a=g(t),s=a.parents("tr");"update-selected"!==l||s.hasClass("update")&&!s.find("notice-error").length?m.updates.queue.push({action:n,data:{plugin:s.data("plugin"),slug:s.data("slug")}}):a.prop("checked",!1)}),f.on("wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error",function(e,t){var a,s,n=g('[data-slug="'+t.slug+'"]');"wp-"+t.update+"-update-success"===e.type?i++:(s=t.pluginName?t.pluginName:n.find(".column-primary strong").text(),d++,u.push(s+": "+t.errorMessage)),n.find('input[name="checked[]"]:checked').prop("checked",!1),m.updates.adminNotice=m.template("wp-bulk-updates-admin-notice"),m.updates.addAdminNotice({id:"bulk-action-notice",className:"bulk-action-notice",successes:i,errors:d,errorMessages:u,type:t.update}),a=g("#bulk-action-notice").on("click","button",function(){g(this).toggleClass("bulk-action-errors-collapsed").attr("aria-expanded",!g(this).hasClass("bulk-action-errors-collapsed")),a.find(".bulk-action-errors").toggleClass("hidden")}),0').append(g("
",{class:"current",href:s,text:m.updates.l10n.searchResultsLabel})),g(".wp-filter .filter-links .current").removeClass("current").parents(".filter-links").prepend(n),l.prev("p").remove(),g(".plugins-popular-tags-wrapper").remove()),void 0!==m.updates.searchRequest&&m.updates.searchRequest.abort(),g("body").addClass("loading-content"),m.updates.searchRequest=m.ajax.post("search-install-plugins",a).done(function(e){g("body").removeClass("loading-content"),l.append(e.items),delete m.updates.searchRequest,0===e.count?m.a11y.speak(m.updates.l10n.noPluginsFound):m.a11y.speak(m.updates.l10n.pluginsFound.replace("%d",e.count))}))},1e3)),a.length&&a.attr("aria-describedby","live-search-desc"),a.on("keyup input",_.debounce(function(e){var t,s={_ajax_nonce:m.updates.ajaxNonce,s:e.target.value,pagenow:pagenow,plugin_status:"all"};"keyup"===e.type&&27===e.which&&(e.target.value=""),m.updates.searchTerm!==s.s&&(m.updates.searchTerm=s.s,t=_.object(_.compact(_.map(location.search.slice(1).split("&"),function(e){if(e)return e.split("=")}))),s.plugin_status=t.plugin_status||"all",window.history&&window.history.replaceState&&window.history.replaceState(null,"",location.href.split("?")[0]+"?s="+s.s+"&plugin_status="+s.plugin_status),void 0!==m.updates.searchRequest&&m.updates.searchRequest.abort(),r.empty(),g("body").addClass("loading-content"),g(".subsubsub .current").removeClass("current"),m.updates.searchRequest=m.ajax.post("search-plugins",s).done(function(e){var t=g("").addClass("subtitle").html(m.updates.l10n.searchResults.replace("%s",_.escape(s.s))),a=g(".wrap .subtitle");s.s.length?a.length?a.replaceWith(t):g(".wp-header-end").before(t):(a.remove(),g(".subsubsub ."+s.plugin_status+" a").addClass("current")),g("body").removeClass("loading-content"),r.append(e.items),delete m.updates.searchRequest,0===e.count?m.a11y.speak(m.updates.l10n.noPluginsFound):m.a11y.speak(m.updates.l10n.pluginsFound.replace("%d",e.count))}))},500)),f.on("submit",".search-plugins",function(e){e.preventDefault(),g("input.wp-filter-search").trigger("input")}),f.on("click",".try-again",function(e){e.preventDefault(),s.trigger("input")}),g("#typeselector").on("change",function(){var e=g('input[name="s"]');e.val().length&&e.trigger("input","typechange")}),g("#plugin_update_from_iframe").on("click",function(e){var t,a=window.parent===window?null:window.parent;g.support.postMessage=!!window.postMessage,!1!==g.support.postMessage&&null!==a&&-1===window.parent.location.pathname.indexOf("update-core.php")&&(e.preventDefault(),t={action:"update-plugin",data:{plugin:g(this).data("plugin"),slug:g(this).data("slug")}},a.postMessage(JSON.stringify(t),window.location.origin))}),g("#plugin_install_from_iframe").on("click",function(e){var t,a=window.parent===window?null:window.parent;g.support.postMessage=!!window.postMessage,!1!==g.support.postMessage&&null!==a&&-1===window.parent.location.pathname.indexOf("index.php")&&(e.preventDefault(),t={action:"install-plugin",data:{slug:g(this).data("slug")}},a.postMessage(JSON.stringify(t),window.location.origin))}),g(window).on("message",function(e){var t,a=e.originalEvent,s=document.location.protocol+"//"+document.location.host;if(a.origin===s){try{t=g.parseJSON(a.data)}catch(e){return}if(t&&void 0!==t.action)switch(t.action){case"decrementUpdateCount":m.updates.decrementCount(t.upgradeType);break;case"install-plugin":case"update-plugin":window.tb_remove(),t.data=m.updates._addCallbacks(t.data,t.action),m.updates.queue.push(t),m.updates.queueChecker()}}}),g(window).on("beforeunload",m.updates.beforeunload),f.on("click",".column-auto-updates a.toggle-auto-update, .theme-overlay a.toggle-auto-update",function(e){var t,d,u,r,o=g(this),p=o.attr("data-wp-action"),c=o.find(".label");if(r="themes"!==pagenow?o.closest(".column-auto-updates"):o.closest(".theme-autoupdate"),e.preventDefault(),"yes"!==o.attr("data-doing-ajax")){switch(o.attr("data-doing-ajax","yes"),pagenow){case"plugins":case"plugins-network":u="plugin",d=o.closest("tr").attr("data-plugin");break;case"themes-network":u="theme",d=o.closest("tr").attr("data-slug");break;case"themes":u="theme",d=o.attr("data-slug")}r.find(".notice.error").addClass("hidden"),"enable"===p?c.text(m.updates.l10n.autoUpdatesEnabling):c.text(m.updates.l10n.autoUpdatesDisabling),o.find(".dashicons-update").removeClass("hidden"),t={action:"toggle-auto-updates",_ajax_nonce:h.ajax_nonce,state:p,type:u,asset:d},g.post(window.ajaxurl,t).done(function(e){var t,a,s,n,l,i=o.attr("href");if(!e.success)return l=e.data&&e.data.error?e.data.error:m.updates.l10n.autoUpdatesError,r.find(".notice.error").removeClass("hidden").find("p").text(l),void m.a11y.speak(l,"polite");if("themes"!==pagenow){switch(t=g(".auto-update-enabled span"),a=g(".auto-update-disabled span"),s=parseInt(t.text().replace(/[^\d]+/g,""),10)||0,n=parseInt(a.text().replace(/[^\d]+/g,""),10)||0,p){case"enable":++s,--n;break;case"disable":--s,++n}s=Math.max(0,s),n=Math.max(0,n),t.text("("+s+")"),a.text("("+n+")")}"enable"===p?(i=i.replace("action=enable-auto-update","action=disable-auto-update"),o.attr({"data-wp-action":"disable",href:i}),c.text(m.updates.l10n.autoUpdatesDisable),r.find(".auto-update-time").removeClass("hidden"),m.a11y.speak(m.updates.l10n.autoUpdatesEnabled,"polite")):(i=i.replace("action=disable-auto-update","action=enable-auto-update"),o.attr({"data-wp-action":"enable",href:i}),c.text(m.updates.l10n.autoUpdatesEnable),r.find(".auto-update-time").addClass("hidden"),m.a11y.speak(m.updates.l10n.autoUpdatesDisabled,"polite")),f.trigger("wp-auto-update-setting-changed",{state:p,type:u,asset:d})}).fail(function(){r.find(".notice.error").removeClass("hidden").find("p").text(m.updates.l10n.autoUpdatesError),m.a11y.speak(m.updates.l10n.autoUpdatesError,"polite")}).always(function(){o.removeAttr("data-doing-ajax").find(".dashicons-update").addClass("hidden")})}})})}(jQuery,window.wp,window._wpUpdatesSettings); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index d134b618c1..3adafa2bcc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47882'; +$wp_version = '5.5-alpha-47883'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.