diff --git a/wp-admin/js/common.js b/wp-admin/js/common.js index 58f68d110f..772ec1f1f7 100644 --- a/wp-admin/js/common.js +++ b/wp-admin/js/common.js @@ -16,7 +16,340 @@ var $document = $( document ), $window = $( window ), $body = $( document.body ), - __ = wp.i18n.__; + __ = wp.i18n.__, + sprintf = wp.i18n.sprintf; + +/** + * Throws an error for a deprecated property. + * + * @since 5.5.1 + * + * @param {string} propName The property that was used. + * @param {string} version The version of WordPress that deprecated the property. + * @param {string} replacement The property that should have been used. + */ +function deprecatedProperty( propName, version, replacement ) { + var message; + + if ( 'undefined' !== typeof replacement ) { + message = sprintf( + /* translators: 1: Deprecated property name, 2: Version number, 3: Alternative property name. */ + __( '%1$s is deprecated since version %2$s! Use %3$s instead.' ), + propName, + version, + replacement + ); + } else { + message = sprintf( + /* translators: 1: Deprecated property name, 2: Version number. */ + __( '%1$s is deprecated since version %2$s with no alternative available.' ), + propName, + version + ); + } + + window.console.warn( message ); +} + +/** + * Deprecate all properties on an object. + * + * @since 5.5.1 + * + * @param {string} name The name of the object, i.e. commonL10n. + * @param {object} l10nObject The object to deprecate the properties on. + * + * @return {object} The object with all its properties deprecated. + */ +function deprecateL10nObject( name, l10nObject ) { + var deprecatedObject = {}; + + Object.keys( l10nObject ).forEach( function( key ) { + var prop = l10nObject[ key ]; + var propName = name + '.' + key; + + if ( 'object' === typeof prop ) { + Object.defineProperty( deprecatedObject, key, { get: function() { + deprecatedProperty( propName, '5.5.0', prop.alternative ); + return prop.func(); + } } ); + } else { + Object.defineProperty( deprecatedObject, key, { get: function() { + deprecatedProperty( propName, '5.5.0', 'wp.i18n' ); + return prop; + } } ); + } + } ); + + return deprecatedObject; +} + +window.wp.deprecateL10nObject = deprecateL10nObject; + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 2.6.0 + * @deprecated 5.5.0 + */ +window.commonL10n = window.commonL10n || { + warnDelete: '', + dismiss: '', + collapseMenu: '', + expandMenu: '' +}; + +window.commonL10n = deprecateL10nObject( 'commonL10n', window.commonL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 3.3.0 + * @deprecated 5.5.0 + */ +window.wpPointerL10n = window.wpPointerL10n || { + dismiss: '' +}; + +window.wpPointerL10n = deprecateL10nObject( 'wpPointerL10n', window.wpPointerL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 4.3.0 + * @deprecated 5.5.0 + */ +window.userProfileL10n = window.userProfileL10n || { + warn: '', + warnWeak: '', + show: '', + hide: '', + cancel: '', + ariaShow: '', + ariaHide: '' +}; + +window.userProfileL10n = deprecateL10nObject( 'userProfileL10n', window.userProfileL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 4.9.6 + * @deprecated 5.5.0 + */ +window.privacyToolsL10n = window.privacyToolsL10n || { + noDataFound: '', + foundAndRemoved: '', + noneRemoved: '', + someNotRemoved: '', + removalError: '', + emailSent: '', + noExportFile: '', + exportError: '' +}; + +window.privacyToolsL10n = deprecateL10nObject( 'privacyToolsL10n', window.privacyToolsL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 3.6.0 + * @deprecated 5.5.0 + */ +window.authcheckL10n = { + beforeunload: '' +}; + +window.authcheckL10n = window.authcheckL10n || deprecateL10nObject( 'authcheckL10n', window.authcheckL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 2.8.0 + * @deprecated 5.5.0 + */ +window.tagsl10n = { + noPerm: '', + broken: '' +}; + +window.tagsl10n = window.tagsl10n || deprecateL10nObject( 'tagsl10n', window.tagsl10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 2.5.0 + * @deprecated 5.5.0 + */ +window.adminCommentsL10n = window.adminCommentsL10n || { + hotkeys_highlight_first: { + alternative: 'window.adminCommentsSettings.hotkeys_highlight_first', + func: function() { return window.adminCommentsSettings.hotkeys_highlight_first; } + }, + hotkeys_highlight_last: { + alternative: 'window.adminCommentsSettings.hotkeys_highlight_last', + func: function() { return window.adminCommentsSettings.hotkeys_highlight_last; } + }, + replyApprove: '', + reply: '', + warnQuickEdit: '', + warnCommentChanges: '', + docTitleComments: '', + docTitleCommentsCount: '' +}; + +window.adminCommentsL10n = deprecateL10nObject( 'adminCommentsL10n', window.adminCommentsL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 2.5.0 + * @deprecated 5.5.0 + */ +window.tagsSuggestL10n = window.tagsSuggestL10n || { + tagDelimiter: '', + removeTerm: '', + termSelected: '', + termAdded: '', + termRemoved: '' +}; + +window.tagsSuggestL10n = deprecateL10nObject( 'tagsSuggestL10n', window.tagsSuggestL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 3.5.0 + * @deprecated 5.5.0 + */ +window.wpColorPickerL10n = window.wpColorPickerL10n || { + clear: '', + clearAriaLabel: '', + defaultString: '', + defaultAriaLabel: '', + pick: '', + defaultLabel: '' +}; + +window.wpColorPickerL10n = deprecateL10nObject( 'wpColorPickerL10n', window.wpColorPickerL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 2.7.0 + * @deprecated 5.5.0 + */ +window.attachMediaBoxL10n = window.attachMediaBoxL10n || { + error: '' +}; + +window.attachMediaBoxL10n = deprecateL10nObject( 'attachMediaBoxL10n', window.attachMediaBoxL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 2.5.0 + * @deprecated 5.5.0 + */ +window.postL10n = window.postL10n || { + ok: '', + cancel: '', + publishOn: '', + publishOnFuture: '', + publishOnPast: '', + dateFormat: '', + showcomm: '', + endcomm: '', + publish: '', + schedule: '', + update: '', + savePending: '', + saveDraft: '', + 'private': '', + 'public': '', + publicSticky: '', + password: '', + privatelyPublished: '', + published: '', + saveAlert: '', + savingText: '', + permalinkSaved: '' +}; + +window.postL10n = deprecateL10nObject( 'postL10n', window.postL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 2.7.0 + * @deprecated 5.5.0 + */ +window.inlineEditL10n = window.inlineEditL10n || { + error: '', + ntdeltitle: '', + notitle: '', + comma: '', + saved: '' +}; + +window.inlineEditL10n = deprecateL10nObject( 'inlineEditL10n', window.inlineEditL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 2.7.0 + * @deprecated 5.5.0 + */ +window.plugininstallL10n = window.plugininstallL10n || { + plugin_information: '', + plugin_modal_label: '', + ays: '' +}; + +window.plugininstallL10n = deprecateL10nObject( 'plugininstallL10n', window.plugininstallL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 3.0.0 + * @deprecated 5.5.0 + */ +window.navMenuL10n = window.navMenuL10n || { + noResultsFound: '', + warnDeleteMenu: '', + saveAlert: '', + untitled: '' +}; + +window.navMenuL10n = deprecateL10nObject( 'navMenuL10n', window.navMenuL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 2.5.0 + * @deprecated 5.5.0 + */ +window.commentL10n = window.commentL10n || { + submittedOn: '', + dateFormat: '' +}; + +window.commentL10n = deprecateL10nObject( 'commentL10n', window.commentL10n ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 2.9.0 + * @deprecated 5.5.0 + */ +window.setPostThumbnailL10n = window.setPostThumbnailL10n || { + setThumbnail: '', + saving: '', + error: '', + done: '' +}; + +window.setPostThumbnailL10n = deprecateL10nObject( 'setPostThumbnailL10n', window.setPostThumbnailL10n ); /** * Removed in 3.3.0, needed for back-compatibility. diff --git a/wp-admin/js/common.min.js b/wp-admin/js/common.min.js index 110d2ff7b5..f61e647207 100644 --- a/wp-admin/js/common.min.js +++ b/wp-admin/js/common.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(V,q){var B=V(document),H=V(q),Y=V(document.body),G=wp.i18n.__;q.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},q.columns={init:function(){var n=this;V(".hide-column-tog","#adv-settings").click(function(){var e=V(this),t=e.val();e.prop("checked")?n.checked(t):n.unchecked(t),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var e=this.hidden();V.post(ajaxurl,{action:"hidden-columns",hidden:e,screenoptionnonce:V("#screenoptionnonce").val(),page:pagenow})},checked:function(e){V(".column-"+e).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(e){V(".column-"+e).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return V(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return V(".hide-column-tog").not(":checked").map(function(){var e=this.id;return e.substring(e,e.length-5)}).get().join(",")}},colSpanChange:function(e){var t,n=V("table").find(".colspanchange");n.length&&(t=parseInt(n.attr("colspan"),10)+e,n.attr("colspan",t.toString()))}},B.ready(function(){columns.init()}),q.validateForm=function(e){return!V(e).find(".form-required").filter(function(){return""===V(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").change(function(){V(this).closest(".form-invalid").removeClass("form-invalid")}).length},q.showNotice={warn:function(){return!!confirm(G("You are about to permanently delete these items from your site.\nThis action cannot be undone.\n'Cancel' to stop, 'OK' to delete."))},note:function(e){alert(e)}},q.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=V("#screen-meta"),this.toggles=V("#screen-meta-links").find(".show-settings"),this.page=V("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(){var e=V("#"+V(this).attr("aria-controls"));e.length&&(e.is(":visible")?screenMeta.close(e,V(this)):screenMeta.open(e,V(this)))},open:function(e,t){V("#screen-meta-links").find(".screen-meta-toggle").not(t.parent()).css("visibility","hidden"),e.parent().show(),e.slideDown("fast",function(){e.focus(),t.addClass("screen-meta-active").attr("aria-expanded",!0)}),B.trigger("screen:options:open")},close:function(e,t){e.slideUp("fast",function(){t.removeClass("screen-meta-active").attr("aria-expanded",!1),V(".screen-meta-toggle").css("visibility",""),e.parent().hide()}),B.trigger("screen:options:close")}},V(".contextual-help-tabs").delegate("a","click",function(e){var t,n=V(this);if(e.preventDefault(),n.is(".active a"))return!1;V(".contextual-help-tabs .active").removeClass("active"),n.parent("li").addClass("active"),t=V(n.attr("href")),V(".help-tab-content").not(t).removeClass("active").hide(),t.addClass("active").show()});var e,a=!1,r=V("#permalink_structure"),t=V(".permalink-structure input:radio"),l=V("#custom_selection"),n=V(".form-table.permalink-structure .available-structure-tags button");function c(e){-1!==r.val().indexOf(e.text().trim())?(e.attr("data-label",e.attr("aria-label")),e.attr("aria-label",e.attr("data-used")),e.attr("aria-pressed",!0),e.addClass("active")):e.attr("data-label")&&(e.attr("aria-label",e.attr("data-label")),e.attr("aria-pressed",!1),e.removeClass("active"))}function i(){B.trigger("wp-window-resized")}t.on("change",function(){"custom"!==this.value&&(r.val(this.value),n.each(function(){c(V(this))}))}),r.on("click input",function(){l.prop("checked",!0)}),r.on("focus",function(e){a=!0,V(this).off(e)}),n.each(function(){c(V(this))}),r.on("change",function(){n.each(function(){c(V(this))})}),n.on("click",function(){var e,t=r.val(),n=r[0].selectionStart,i=r[0].selectionEnd,o=V(this).text().trim(),s=V(this).attr("data-added");if(-1!==t.indexOf(o))return t=t.replace(o+"/",""),r.val("/"===t?"":t),V("#custom_selection_updated").text(s),void c(V(this));a||0!==n||0!==i||(n=i=t.length),l.prop("checked",!0),"/"!==t.substr(0,n).substr(-1)&&(o="/"+o),"/"!==t.substr(i,1)&&(o+="/"),r.val(t.substr(0,n)+o+t.substr(i)),V("#custom_selection_updated").text(s),c(V(this)),a&&r[0].setSelectionRange&&(e=(t.substr(0,n)+o).length,r[0].setSelectionRange(e,e),r.focus())}),B.ready(function(){var n,i,o,s,e,t,a,r,l,c,d,u=!1,p=V("input.current-page"),h=p.val(),f=/iPhone|iPad|iPod/.test(navigator.userAgent),m=-1!==navigator.userAgent.indexOf("Android"),v=V("#adminmenuwrap"),b=V("#wpwrap"),g=V("#adminmenu"),w=V("#wp-responsive-overlay"),k=V("#wp-toolbar"),C=k.find('a[aria-haspopup="true"]'),y=V(".meta-box-sortables"),x=!1,S=V("#wpadminbar"),D=0,T=!1,M=!1,E=0,_=!1,j={window:H.height(),wpwrap:b.height(),adminbar:S.height(),menu:v.height()},A=V(".wp-header-end");function O(){var e=V("a.wp-has-current-submenu");"folded"===r?e.attr("aria-haspopup","true"):e.attr("aria-haspopup","false")}function I(e){var t,n,i,o,s,a,r=e.find(".wp-submenu");a=(o=e.offset().top)-(s=H.scrollTop())-30,n=60+(t=o+r.height()+1)-b.height(),(i=H.height()+s-50)');e.find(".screen-reader-text").text(G("Dismiss this notice.")),e.on("click.wp-dismiss-notice",function(e){e.preventDefault(),t.fadeTo(100,0,function(){t.slideUp(100,function(){t.remove()})})}),t.append(e)})}function U(){l.prop("disabled",""===c.map(function(){return V(this).val()}).get().join(""))}function z(e){var t=H.scrollTop(),n=!e||"scroll"!==e.type;if(!f&&!g.data("wp-responsive"))if(j.menu+j.adminbarj.wpwrap)P();else{if(_=!0,j.menu+j.adminbar>j.window){if(t<0)return void(T||(M=!(T=!0),v.css({position:"fixed",top:"",bottom:""})));if(t+j.window>B.height()-1)return void(M||(T=!(M=!0),v.css({position:"fixed",top:"",bottom:0})));Dt+j.window&&(E=t),v.css({position:"absolute",top:E,bottom:""})):!T&&v.offset().top>=t+j.adminbar&&(T=!0,v.css({position:"fixed",top:"",bottom:""})):n&&(T=M=!1,0<(E=t+j.window-j.menu-j.adminbar-1)?v.css({position:"absolute",top:E,bottom:""}):P())}D=t}}function N(){j={window:H.height(),wpwrap:b.height(),adminbar:S.height(),menu:v.height()}}function P(){!f&&_&&(T=M=_=!1,v.css({position:"",top:"",bottom:""}))}function R(){N(),g.data("wp-responsive")?(Y.removeClass("sticky-menu"),P()):j.menu+j.adminbar>j.window?(z(),Y.removeClass("sticky-menu")):(Y.addClass("sticky-menu"),P())}function W(){V(".aria-button-if-js").attr("role","button")}function F(){var e=!1;return q.innerWidth&&(e=Math.max(q.innerWidth,document.documentElement.clientWidth)),e}function Q(){var e=F()||961;r=e<=782?"responsive":Y.hasClass("folded")||Y.hasClass("auto-fold")&&e<=960&&782 tr > .check-column :checkbox",function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!u)return!0;n=V(u).closest("form").find(":checkbox").filter(":visible:enabled"),i=n.index(u),o=n.index(this),s=V(this).prop("checked"),0 a",function(e){g.data("wp-responsive")&&(V(this).parent("li").toggleClass("selected"),e.preventDefault())}),e.trigger(),B.on("wp-window-resized.wp-responsive",V.proxy(this.trigger,this)),H.on("load.wp-responsive",this.maybeDisableSortables),B.on("postbox-toggled",this.maybeDisableSortables),V("#screen-options-wrap input").on("click",this.maybeDisableSortables)},maybeDisableSortables:function(){(-1').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){k.find(".menupop.hover").removeClass("hover"),V(this).hide()})),C.on("click.wp-responsive",function(){w.show()})},disableOverlay:function(){C.off("click.wp-responsive"),w.hide()},disableSortables:function(){if(y.length)try{y.sortable("disable"),y.find(".ui-sortable-handle").addClass("is-non-sortable")}catch(e){}},enableSortables:function(){if(y.length)try{y.sortable("enable"),y.find(".ui-sortable-handle").removeClass("is-non-sortable")}catch(e){}}},V(document).ajaxComplete(function(){W()}),B.on("wp-window-resized.set-menu-state",Q),B.on("wp-menu-state-set wp-collapse-menu",function(e,t){var n,i,o=V("#collapse-button");i="folded"===t.state?(n="false",G("Expand Main menu")):(n="true",G("Collapse Main menu")),o.attr({"aria-expanded":n,"aria-label":i})}),q.wpResponsive.init(),R(),Q(),O(),K(),W(),B.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",R),V(".wp-initial-focus").focus(),Y.on("click",".js-update-details-toggle",function(){var e=V(this).closest(".js-update-details"),t=V("#"+e.data("update-details"));t.hasClass("update-details-moved")||t.insertAfter(e).addClass("update-details-moved"),t.toggle(),V(this).attr("aria-expanded",t.is(":visible"))})}),B.ready(function(e){var t,n;Y.hasClass("update-php")&&(t=e("a.update-from-upload-overwrite"),n=e(".update-from-upload-expired"),t.length&&n.length&&q.setTimeout(function(){t.hide(),n.removeClass("hidden"),q.wp&&q.wp.a11y&&q.wp.a11y.speak(n.text())},714e4))}),H.on("resize.wp-fire-once",function(){q.clearTimeout(e),e=q.setTimeout(i,200)}),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var e=document.createElement("style");e.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(e)}}()}(jQuery,window); \ No newline at end of file +!function(W,$){var Q=W(document),H=W($),V=W(document.body),q=wp.i18n.__,o=wp.i18n.sprintf;function a(e,t,n){var i;i=void 0!==n?o(q("%1$s is deprecated since version %2$s! Use %3$s instead."),e,t,n):o(q("%1$s is deprecated since version %2$s with no alternative available."),e,t),$.console.warn(i)}function e(i,o){var s={};return Object.keys(o).forEach(function(e){var t=o[e],n=i+"."+e;"object"==typeof t?Object.defineProperty(s,e,{get:function(){return a(n,"5.5.0",t.alternative),t.func()}}):Object.defineProperty(s,e,{get:function(){return a(n,"5.5.0","wp.i18n"),t}})}),s}$.wp.deprecateL10nObject=e,$.commonL10n=$.commonL10n||{warnDelete:"",dismiss:"",collapseMenu:"",expandMenu:""},$.commonL10n=e("commonL10n",$.commonL10n),$.wpPointerL10n=$.wpPointerL10n||{dismiss:""},$.wpPointerL10n=e("wpPointerL10n",$.wpPointerL10n),$.userProfileL10n=$.userProfileL10n||{warn:"",warnWeak:"",show:"",hide:"",cancel:"",ariaShow:"",ariaHide:""},$.userProfileL10n=e("userProfileL10n",$.userProfileL10n),$.privacyToolsL10n=$.privacyToolsL10n||{noDataFound:"",foundAndRemoved:"",noneRemoved:"",someNotRemoved:"",removalError:"",emailSent:"",noExportFile:"",exportError:""},$.privacyToolsL10n=e("privacyToolsL10n",$.privacyToolsL10n),$.authcheckL10n={beforeunload:""},$.authcheckL10n=$.authcheckL10n||e("authcheckL10n",$.authcheckL10n),$.tagsl10n={noPerm:"",broken:""},$.tagsl10n=$.tagsl10n||e("tagsl10n",$.tagsl10n),$.adminCommentsL10n=$.adminCommentsL10n||{hotkeys_highlight_first:{alternative:"window.adminCommentsSettings.hotkeys_highlight_first",func:function(){return $.adminCommentsSettings.hotkeys_highlight_first}},hotkeys_highlight_last:{alternative:"window.adminCommentsSettings.hotkeys_highlight_last",func:function(){return $.adminCommentsSettings.hotkeys_highlight_last}},replyApprove:"",reply:"",warnQuickEdit:"",warnCommentChanges:"",docTitleComments:"",docTitleCommentsCount:""},$.adminCommentsL10n=e("adminCommentsL10n",$.adminCommentsL10n),$.tagsSuggestL10n=$.tagsSuggestL10n||{tagDelimiter:"",removeTerm:"",termSelected:"",termAdded:"",termRemoved:""},$.tagsSuggestL10n=e("tagsSuggestL10n",$.tagsSuggestL10n),$.wpColorPickerL10n=$.wpColorPickerL10n||{clear:"",clearAriaLabel:"",defaultString:"",defaultAriaLabel:"",pick:"",defaultLabel:""},$.wpColorPickerL10n=e("wpColorPickerL10n",$.wpColorPickerL10n),$.attachMediaBoxL10n=$.attachMediaBoxL10n||{error:""},$.attachMediaBoxL10n=e("attachMediaBoxL10n",$.attachMediaBoxL10n),$.postL10n=$.postL10n||{ok:"",cancel:"",publishOn:"",publishOnFuture:"",publishOnPast:"",dateFormat:"",showcomm:"",endcomm:"",publish:"",schedule:"",update:"",savePending:"",saveDraft:"",private:"",public:"",publicSticky:"",password:"",privatelyPublished:"",published:"",saveAlert:"",savingText:"",permalinkSaved:""},$.postL10n=e("postL10n",$.postL10n),$.inlineEditL10n=$.inlineEditL10n||{error:"",ntdeltitle:"",notitle:"",comma:"",saved:""},$.inlineEditL10n=e("inlineEditL10n",$.inlineEditL10n),$.plugininstallL10n=$.plugininstallL10n||{plugin_information:"",plugin_modal_label:"",ays:""},$.plugininstallL10n=e("plugininstallL10n",$.plugininstallL10n),$.navMenuL10n=$.navMenuL10n||{noResultsFound:"",warnDeleteMenu:"",saveAlert:"",untitled:""},$.navMenuL10n=e("navMenuL10n",$.navMenuL10n),$.commentL10n=$.commentL10n||{submittedOn:"",dateFormat:""},$.commentL10n=e("commentL10n",$.commentL10n),$.setPostThumbnailL10n=$.setPostThumbnailL10n||{setThumbnail:"",saving:"",error:"",done:""},$.setPostThumbnailL10n=e("setPostThumbnailL10n",$.setPostThumbnailL10n),$.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},$.columns={init:function(){var n=this;W(".hide-column-tog","#adv-settings").click(function(){var e=W(this),t=e.val();e.prop("checked")?n.checked(t):n.unchecked(t),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var e=this.hidden();W.post(ajaxurl,{action:"hidden-columns",hidden:e,screenoptionnonce:W("#screenoptionnonce").val(),page:pagenow})},checked:function(e){W(".column-"+e).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(e){W(".column-"+e).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return W(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return W(".hide-column-tog").not(":checked").map(function(){var e=this.id;return e.substring(e,e.length-5)}).get().join(",")}},colSpanChange:function(e){var t,n=W("table").find(".colspanchange");n.length&&(t=parseInt(n.attr("colspan"),10)+e,n.attr("colspan",t.toString()))}},Q.ready(function(){columns.init()}),$.validateForm=function(e){return!W(e).find(".form-required").filter(function(){return""===W(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").change(function(){W(this).closest(".form-invalid").removeClass("form-invalid")}).length},$.showNotice={warn:function(){return!!confirm(q("You are about to permanently delete these items from your site.\nThis action cannot be undone.\n'Cancel' to stop, 'OK' to delete."))},note:function(e){alert(e)}},$.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=W("#screen-meta"),this.toggles=W("#screen-meta-links").find(".show-settings"),this.page=W("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(){var e=W("#"+W(this).attr("aria-controls"));e.length&&(e.is(":visible")?screenMeta.close(e,W(this)):screenMeta.open(e,W(this)))},open:function(e,t){W("#screen-meta-links").find(".screen-meta-toggle").not(t.parent()).css("visibility","hidden"),e.parent().show(),e.slideDown("fast",function(){e.focus(),t.addClass("screen-meta-active").attr("aria-expanded",!0)}),Q.trigger("screen:options:open")},close:function(e,t){e.slideUp("fast",function(){t.removeClass("screen-meta-active").attr("aria-expanded",!1),W(".screen-meta-toggle").css("visibility",""),e.parent().hide()}),Q.trigger("screen:options:close")}},W(".contextual-help-tabs").delegate("a","click",function(e){var t,n=W(this);if(e.preventDefault(),n.is(".active a"))return!1;W(".contextual-help-tabs .active").removeClass("active"),n.parent("li").addClass("active"),t=W(n.attr("href")),W(".help-tab-content").not(t).removeClass("active").hide(),t.addClass("active").show()});var t,r=!1,l=W("#permalink_structure"),n=W(".permalink-structure input:radio"),c=W("#custom_selection"),i=W(".form-table.permalink-structure .available-structure-tags button");function d(e){-1!==l.val().indexOf(e.text().trim())?(e.attr("data-label",e.attr("aria-label")),e.attr("aria-label",e.attr("data-used")),e.attr("aria-pressed",!0),e.addClass("active")):e.attr("data-label")&&(e.attr("aria-label",e.attr("data-label")),e.attr("aria-pressed",!1),e.removeClass("active"))}function s(){Q.trigger("wp-window-resized")}n.on("change",function(){"custom"!==this.value&&(l.val(this.value),i.each(function(){d(W(this))}))}),l.on("click input",function(){c.prop("checked",!0)}),l.on("focus",function(e){r=!0,W(this).off(e)}),i.each(function(){d(W(this))}),l.on("change",function(){i.each(function(){d(W(this))})}),i.on("click",function(){var e,t=l.val(),n=l[0].selectionStart,i=l[0].selectionEnd,o=W(this).text().trim(),s=W(this).attr("data-added");if(-1!==t.indexOf(o))return t=t.replace(o+"/",""),l.val("/"===t?"":t),W("#custom_selection_updated").text(s),void d(W(this));r||0!==n||0!==i||(n=i=t.length),c.prop("checked",!0),"/"!==t.substr(0,n).substr(-1)&&(o="/"+o),"/"!==t.substr(i,1)&&(o+="/"),l.val(t.substr(0,n)+o+t.substr(i)),W("#custom_selection_updated").text(s),d(W(this)),r&&l[0].setSelectionRange&&(e=(t.substr(0,n)+o).length,l[0].setSelectionRange(e,e),l.focus())}),Q.ready(function(){var n,i,o,s,e,t,a,r,l,c,d,u=!1,p=W("input.current-page"),m=p.val(),h=/iPhone|iPad|iPod/.test(navigator.userAgent),f=-1!==navigator.userAgent.indexOf("Android"),v=W("#adminmenuwrap"),b=W("#wpwrap"),g=W("#adminmenu"),w=W("#wp-responsive-overlay"),k=W("#wp-toolbar"),C=k.find('a[aria-haspopup="true"]'),L=W(".meta-box-sortables"),y=!1,x=W("#wpadminbar"),S=0,P=!1,T=!1,M=0,_=!1,D={window:H.height(),wpwrap:b.height(),adminbar:x.height(),menu:v.height()},E=W(".wp-header-end");function A(){var e=W("a.wp-has-current-submenu");"folded"===r?e.attr("aria-haspopup","true"):e.attr("aria-haspopup","false")}function O(e){var t,n,i,o,s,a,r=e.find(".wp-submenu");a=(o=e.offset().top)-(s=H.scrollTop())-30,n=60+(t=o+r.height()+1)-b.height(),(i=H.height()+s-50)');e.find(".screen-reader-text").text(q("Dismiss this notice.")),e.on("click.wp-dismiss-notice",function(e){e.preventDefault(),t.fadeTo(100,0,function(){t.slideUp(100,function(){t.remove()})})}),t.append(e)})}function R(){l.prop("disabled",""===c.map(function(){return W(this).val()}).get().join(""))}function U(e){var t=H.scrollTop(),n=!e||"scroll"!==e.type;if(!h&&!g.data("wp-responsive"))if(D.menu+D.adminbarD.wpwrap)I();else{if(_=!0,D.menu+D.adminbar>D.window){if(t<0)return void(P||(T=!(P=!0),v.css({position:"fixed",top:"",bottom:""})));if(t+D.window>Q.height()-1)return void(T||(P=!(T=!0),v.css({position:"fixed",top:"",bottom:0})));St+D.window&&(M=t),v.css({position:"absolute",top:M,bottom:""})):!P&&v.offset().top>=t+D.adminbar&&(P=!0,v.css({position:"fixed",top:"",bottom:""})):n&&(P=T=!1,0<(M=t+D.window-D.menu-D.adminbar-1)?v.css({position:"absolute",top:M,bottom:""}):I())}S=t}}function F(){D={window:H.height(),wpwrap:b.height(),adminbar:x.height(),menu:v.height()}}function I(){!h&&_&&(P=T=_=!1,v.css({position:"",top:"",bottom:""}))}function K(){F(),g.data("wp-responsive")?(V.removeClass("sticky-menu"),I()):D.menu+D.adminbar>D.window?(U(),V.removeClass("sticky-menu")):(V.addClass("sticky-menu"),I())}function z(){W(".aria-button-if-js").attr("role","button")}function B(){var e=!1;return $.innerWidth&&(e=Math.max($.innerWidth,document.documentElement.clientWidth)),e}function N(){var e=B()||961;r=e<=782?"responsive":V.hasClass("folded")||V.hasClass("auto-fold")&&e<=960&&782 tr > .check-column :checkbox",function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!u)return!0;n=W(u).closest("form").find(":checkbox").filter(":visible:enabled"),i=n.index(u),o=n.index(this),s=W(this).prop("checked"),0 a",function(e){g.data("wp-responsive")&&(W(this).parent("li").toggleClass("selected"),e.preventDefault())}),e.trigger(),Q.on("wp-window-resized.wp-responsive",W.proxy(this.trigger,this)),H.on("load.wp-responsive",this.maybeDisableSortables),Q.on("postbox-toggled",this.maybeDisableSortables),W("#screen-options-wrap input").on("click",this.maybeDisableSortables)},maybeDisableSortables:function(){(-1').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){k.find(".menupop.hover").removeClass("hover"),W(this).hide()})),C.on("click.wp-responsive",function(){w.show()})},disableOverlay:function(){C.off("click.wp-responsive"),w.hide()},disableSortables:function(){if(L.length)try{L.sortable("disable"),L.find(".ui-sortable-handle").addClass("is-non-sortable")}catch(e){}},enableSortables:function(){if(L.length)try{L.sortable("enable"),L.find(".ui-sortable-handle").removeClass("is-non-sortable")}catch(e){}}},W(document).ajaxComplete(function(){z()}),Q.on("wp-window-resized.set-menu-state",N),Q.on("wp-menu-state-set wp-collapse-menu",function(e,t){var n,i,o=W("#collapse-button");i="folded"===t.state?(n="false",q("Expand Main menu")):(n="true",q("Collapse Main menu")),o.attr({"aria-expanded":n,"aria-label":i})}),$.wpResponsive.init(),K(),N(),A(),j(),z(),Q.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",K),W(".wp-initial-focus").focus(),V.on("click",".js-update-details-toggle",function(){var e=W(this).closest(".js-update-details"),t=W("#"+e.data("update-details"));t.hasClass("update-details-moved")||t.insertAfter(e).addClass("update-details-moved"),t.toggle(),W(this).attr("aria-expanded",t.is(":visible"))})}),Q.ready(function(e){var t,n;V.hasClass("update-php")&&(t=e("a.update-from-upload-overwrite"),n=e(".update-from-upload-expired"),t.length&&n.length&&$.setTimeout(function(){t.hide(),n.removeClass("hidden"),$.wp&&$.wp.a11y&&$.wp.a11y.speak(n.text())},714e4))}),H.on("resize.wp-fire-once",function(){$.clearTimeout(t),t=$.setTimeout(s,200)}),function(){if("-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)){var e=document.createElement("style");e.appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(e)}}()}(jQuery,window); \ No newline at end of file diff --git a/wp-admin/js/theme-plugin-editor.js b/wp-admin/js/theme-plugin-editor.js index 9516b0f003..59e8ce3d0c 100644 --- a/wp-admin/js/theme-plugin-editor.js +++ b/wp-admin/js/theme-plugin-editor.js @@ -1000,3 +1000,27 @@ wp.themePluginEditor = (function( $ ) { return component; })( jQuery ); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 4.9.0 + * @deprecated 5.5.0 + * + * @type {object} + */ +wp.themePluginEditor.l10n = wp.themePluginEditor.l10n || { + saveAlert: '', + saveError: '', + lintError: { + alternative: 'wp.i18n', + func: function() { + return { + singular: '', + plural: '' + }; + } + } +}; + +wp.themePluginEditor.l10n = window.wp.deprecateL10nObject( 'wp.themePluginEditor.l10n', wp.themePluginEditor.l10n ); diff --git a/wp-admin/js/theme-plugin-editor.min.js b/wp-admin/js/theme-plugin-editor.min.js index f50ed06d0c..895f879aaa 100644 --- a/wp-admin/js/theme-plugin-editor.min.js +++ b/wp-admin/js/theme-plugin-editor.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -window.wp||(window.wp={}),wp.themePluginEditor=function(o){"use strict";var s,t,n=wp.i18n.__,i=wp.i18n._n,r=wp.i18n.sprintf;s={codeEditor:{},instance:null,noticeElements:{},dirty:!1,lintErrors:[],init:function(e,t){s.form=e,t&&o.extend(s,t),s.noticeTemplate=wp.template("wp-file-editor-notice"),s.noticesContainer=s.form.find(".editor-notices"),s.submitButton=s.form.find(":input[name=submit]"),s.spinner=s.form.find(".submit .spinner"),s.form.on("submit",s.submit),s.textarea=s.form.find("#newcontent"),s.textarea.on("change",s.onChange),s.warning=o(".file-editor-warning"),s.docsLookUpButton=s.form.find("#docs-lookup"),s.docsLookUpList=s.form.find("#docs-list"),0 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",u(d("%s installation failed","plugin"),s.data("name"))).text(w("Installation failed.")),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:u(w('Importer installed successfully. Run importer'),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":u(w("Run %s"),e.pluginName)}).text(w("Run Importer")),m.a11y.speak(w("Installation completed successfully.")),f.trigger("wp-importer-install-success",e)},m.updates.installImporterError=function(e){var t=u(w("Installation failed: %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").attr("aria-label",u(d("Install %s now","plugin"),s)).text(w("Install Now")),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()!==w("Deleting...")&&t.data("originaltext",t.html()).text(w("Deleting...")),m.a11y.speak(w("Deleting...")),f.trigger("wp-plugin-deleting",e),m.updates.ajax("delete-plugin",e)},m.updates.deletePluginSuccess=function(l){g('[data-plugin="'+l.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"),i=h.plugins;a.hasClass("plugin-update-tr")||a.after(n({slug:l.slug,plugin:l.plugin,colspan:s,name:l.pluginName})),a.remove(),-1!==_.indexOf(i.upgrade,l.plugin)&&(i.upgrade=_.without(i.upgrade,l.plugin),m.updates.decrementCount("plugin")),-1!==_.indexOf(i.inactive,l.plugin)&&(i.inactive=_.without(i.inactive,l.plugin),i.inactive.length?t.find(".inactive .count").text("("+i.inactive.length+")"):t.find(".inactive").remove()),-1!==_.indexOf(i.active,l.plugin)&&(i.active=_.without(i.active,l.plugin),i.active.length?t.find(".active .count").text("("+i.active.length+")"):t.find(".active").remove()),-1!==_.indexOf(i.recently_activated,l.plugin)&&(i.recently_activated=_.without(i.recently_activated,l.plugin),i.recently_activated.length?t.find(".recently_activated .count").text("("+i.recently_activated.length+")"):t.find(".recently_activated").remove()),i.all=_.without(i.all,l.plugin),i.all.length?t.find(".all .count").text("("+i.all.length+")"):(e.find(".tablenav").css({visibility:"hidden"}),t.find(".all").remove(),e.find("tr.no-items").length||e.find("#the-list").append(''+w("No plugins are currently available.")+""))}),m.a11y.speak(d("Deleted!","plugin")),f.trigger("wp-plugin-delete-success",l)},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()!==w("Updating...")&&t.data("originaltext",t.html()),m.a11y.speak(w("Updating... please wait.")),t.text(w("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+'"]'),i={className:"updated-message notice-success notice-alt",message:d("Updated!","theme")};"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},i)),m.a11y.speak(w("Update completed successfully.")),m.updates.decrementCount("theme"),f.trigger("wp-theme-update-success",e),s&&"customize"!==pagenow&&g(".theme-info .theme-author").after(m.updates.adminNotice(i))},m.updates.updateThemeError=function(e){var t,a=g('[data-slug="'+e.slug+'"]'),s=u(w("Update failed: %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),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()!==w("Installing...")&&t.data("originaltext",t.html()),t.attr("aria-label",u(d("Installing %s...","theme"),t.data("name"))).text(w("Installing...")),m.a11y.speak(w("Installing... please wait.")),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",u(d("%s installed!","theme"),e.themeName)).text(d("Installed!","theme")),m.a11y.speak(w("Installation completed successfully.")),setTimeout(function(){e.activateUrl&&(t.attr("href",e.activateUrl).removeClass("theme-install updated-message disabled").addClass("activate"),"themes-network"===pagenow?t.attr("aria-label",u(d("Network Activate %s","theme"),e.themeName)).text(w("Network Enable")):t.attr("aria-label",u(d("Activate %s","theme"),e.themeName)).text(w("Activate"))),e.customizeUrl&&t.siblings(".preview").replaceWith(function(){return g("").attr("href",e.customizeUrl).addClass("button load-customize").text(w("Live Preview"))})},1e3)},m.updates.installThemeError=function(e){var t,a=u(w("Installation failed: %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",u(d("%s installation failed","theme"),t.data("name"))).text(w("Installation failed.")),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()!==w("Deleting...")&&t.data("originaltext",t.html()).text(w("Deleting...")),m.a11y.speak(w("Deleting...")),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(d("Deleted!","theme")),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"),i=u(w("Deletion failed: %s"),e.errorMessage),l=m.updates.adminNotice({className:"update-message notice-error notice-alt",message:i});m.updates.maybeHandleCredentialError(e,"delete-theme")||("themes-network"===pagenow?n.length?(n.find(".notice-error").remove(),n.find(".plugin-update").append(l)):t.addClass("update").after(s({slug:e.slug,colspan:g("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:l})):g(".theme-info .theme-description").before(l),a.html(a.data("originaltext")),m.a11y.speak(i,"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=w("Something went wrong.");if(_.isObject(e)&&!_.isFunction(e.always))return!0;switch(_.isString(e)&&"-1"===e?s=w("An error has occurred. Please reload the page and try again."):_.isString(e)?s=e:void 0!==e.readyState&&0===e.readyState?s=w("Connection lost or the server is busy. Please try again later."):_.isString(e.responseText)&&""!==e.responseText?s=e.responseText:_.isString(e.statusText)&&(s=e.statusText),t){case"update":a=w("Update failed: %s");break;case"install":a=w("Installation failed: %s");break;case"delete":a=w("Deletion failed: %s")}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(w("Update failed.")),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 w("Updates may not complete if you navigate away from this page.")},g(function(){var i=g("#plugin-filter"),o=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",u(d("Update %s now","plugin"),a.data("name"))):"install-plugin"===t.action&&a.attr("aria-label",u(d("Install %s now","plugin"),a.data("name"))))),m.a11y.speak(w("Update canceled."))}),o.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")}))}),i.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")}))}),i.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(w("Install Now")),m.a11y.speak(w("Update canceled."))})),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").attr("aria-label",u(d("Install %s now","plugin"),a)).text(w("Install Now")),m.a11y.speak(w("Update canceled."))})),m.updates.installPlugin({slug:t.data("slug"),pagenow:pagenow,success:m.updates.installImporterSuccess,error:m.updates.installImporterError}))}),o.on("click","[data-plugin] a.delete",function(e){var t,a=g(e.target).parents("tr");t=a.hasClass("is-uninstallable")?u(w("Are you sure you want to delete %s and its data?"),a.find(".plugin-title strong").text()):u(w("Are you sure you want to delete %s?"),a.find(".plugin-title strong").text()),e.preventDefault(),window.confirm(t)&&(m.updates.maybeRequestFilesystemCredentials(e),m.updates.deletePlugin({plugin:a.data("plugin"),slug:a.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"),a=u(w("Are you sure you want to delete %s?"),t.find(".theme-title strong").text());e.preventDefault(),window.confirm(a)&&(m.updates.maybeRequestFilesystemCredentials(e),m.updates.deleteTheme({slug:t.data("slug")}))}),o.on("click",'[type="submit"]:not([name="clear-recent-list"])',function(e){var t,n,i=g(e.target).siblings("select").val(),a=o.find('input[name="checked[]"]:checked'),l=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:w("Please select at least one item to perform this action on.")});switch(i){case"update-selected":n=i.replace("selected",t);break;case"delete-selected":var s=w("plugin"===t?"Are you sure you want to delete the selected plugins and their data?":"Caution: These themes may be active on other sites in the network. Are you sure you want to proceed?");if(!window.confirm(s))return void e.preventDefault();n=i.replace("selected",t);break;default:return}m.updates.maybeRequestFilesystemCredentials(e),e.preventDefault(),o.find('.manage-column [type="checkbox"]').prop("checked",!1),f.trigger("wp-"+t+"-bulk-"+i,a),a.each(function(e,t){var a=g(t),s=a.parents("tr");"update-selected"!==i||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?l++:(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:l,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:w("Search Results")})),g(".wp-filter .filter-links .current").removeClass("current").parents(".filter-links").prepend(n),i.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"),i.append(e.items),delete m.updates.searchRequest,0===e.count?m.a11y.speak(w("You do not appear to have any plugins available at this time.")):m.a11y.speak(u(w("Number of plugins found: %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(),o.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(u(w("Search results for “%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"),o.append(e.items),delete m.updates.searchRequest,0===e.count?m.a11y.speak(w("No plugins found. Try a different search.")):m.a11y.speak(u(w("Number of plugins found: %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("keydown",".column-auto-updates .toggle-auto-update, .theme-overlay .toggle-auto-update",function(e){32===e.which&&e.preventDefault()}),f.on("click keyup",".column-auto-updates .toggle-auto-update, .theme-overlay .toggle-auto-update",function(e){var t,d,u,o,r=g(this),p=r.attr("data-wp-action"),c=r.find(".label");if(("keyup"!==e.type||32===e.which)&&(o="themes"!==pagenow?r.closest(".column-auto-updates"):r.closest(".theme-autoupdate"),e.preventDefault(),"yes"!==r.attr("data-doing-ajax"))){switch(r.attr("data-doing-ajax","yes"),pagenow){case"plugins":case"plugins-network":u="plugin",d=r.closest("tr").attr("data-plugin");break;case"themes-network":u="theme",d=r.closest("tr").attr("data-slug");break;case"themes":u="theme",d=r.attr("data-slug")}o.find(".notice.notice-error").addClass("hidden"),"enable"===p?c.text(w("Enabling...")):c.text(w("Disabling...")),r.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,i,l=r.attr("href");if(!e.success)return i=e.data&&e.data.error?e.data.error:w("The request could not be completed."),o.find(".notice.notice-error").removeClass("hidden").find("p").text(i),void m.a11y.speak(i,"assertive");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?(r[0].hasAttribute("href")&&(l=l.replace("action=enable-auto-update","action=disable-auto-update"),r.attr("href",l)),r.attr("data-wp-action","disable"),c.text(w("Disable auto-updates")),o.find(".auto-update-time").removeClass("hidden"),m.a11y.speak(w("Auto-updates enabled"))):(r[0].hasAttribute("href")&&(l=l.replace("action=disable-auto-update","action=enable-auto-update"),r.attr("href",l)),r.attr("data-wp-action","enable"),c.text(w("Enable auto-updates")),o.find(".auto-update-time").addClass("hidden"),m.a11y.speak(w("Auto-updates disabled"))),f.trigger("wp-auto-update-setting-changed",{state:p,type:u,asset:d})}).fail(function(){o.find(".notice.notice-error").removeClass("hidden").find("p").text(w("The request could not be completed.")),m.a11y.speak(w("The request could not be completed."),"assertive")}).always(function(){r.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),w=m.i18n.__,d=m.i18n._x,u=m.i18n.sprintf;(m=m||{}).updates={},m.updates.l10n={searchResults:"",searchResultsLabel:"",noPlugins:"",noItemsSelected:"",updating:"",pluginUpdated:"",themeUpdated:"",update:"",updateNow:"",pluginUpdateNowLabel:"",updateFailedShort:"",updateFailed:"",pluginUpdatingLabel:"",pluginUpdatedLabel:"",pluginUpdateFailedLabel:"",updatingMsg:"",updatedMsg:"",updateCancel:"",beforeunload:"",installNow:"",pluginInstallNowLabel:"",installing:"",pluginInstalled:"",themeInstalled:"",installFailedShort:"",installFailed:"",pluginInstallingLabel:"",themeInstallingLabel:"",pluginInstalledLabel:"",themeInstalledLabel:"",pluginInstallFailedLabel:"",themeInstallFailedLabel:"",installingMsg:"",installedMsg:"",importerInstalledMsg:"",aysDelete:"",aysDeleteUninstall:"",aysBulkDelete:"",aysBulkDeleteThemes:"",deleting:"",deleteFailed:"",pluginDeleted:"",themeDeleted:"",livePreview:"",activatePlugin:"",activateTheme:"",activatePluginLabel:"",activateThemeLabel:"",activateImporter:"",activateImporterLabel:"",unknownError:"",connectionError:"",nonceError:"",pluginsFound:"",noPluginsFound:"",autoUpdatesEnable:"",autoUpdatesEnabling:"",autoUpdatesEnabled:"",autoUpdatesDisable:"",autoUpdatesDisabling:"",autoUpdatesDisabled:"",autoUpdatesError:""},m.updates.l10n=window.wp.deprecateL10nObject("wp.updates.l10n",m.updates.l10n),m.updates.ajaxNonce=h.ajax_nonce,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",u(d("%s installation failed","plugin"),s.data("name"))).text(w("Installation failed.")),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:u(w('Importer installed successfully.
Run importer'),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":u(w("Run %s"),e.pluginName)}).text(w("Run Importer")),m.a11y.speak(w("Installation completed successfully.")),f.trigger("wp-importer-install-success",e)},m.updates.installImporterError=function(e){var t=u(w("Installation failed: %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").attr("aria-label",u(d("Install %s now","plugin"),s)).text(w("Install Now")),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()!==w("Deleting...")&&t.data("originaltext",t.html()).text(w("Deleting...")),m.a11y.speak(w("Deleting...")),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(''+w("No plugins are currently available.")+""))}),m.a11y.speak(d("Deleted!","plugin")),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()!==w("Updating...")&&t.data("originaltext",t.html()),m.a11y.speak(w("Updating... please wait.")),t.text(w("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:d("Updated!","theme")};"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(w("Update completed successfully.")),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=u(w("Update failed: %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),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()!==w("Installing...")&&t.data("originaltext",t.html()),t.attr("aria-label",u(d("Installing %s...","theme"),t.data("name"))).text(w("Installing...")),m.a11y.speak(w("Installing... please wait.")),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",u(d("%s installed!","theme"),e.themeName)).text(d("Installed!","theme")),m.a11y.speak(w("Installation completed successfully.")),setTimeout(function(){e.activateUrl&&(t.attr("href",e.activateUrl).removeClass("theme-install updated-message disabled").addClass("activate"),"themes-network"===pagenow?t.attr("aria-label",u(d("Network Activate %s","theme"),e.themeName)).text(w("Network Enable")):t.attr("aria-label",u(d("Activate %s","theme"),e.themeName)).text(w("Activate"))),e.customizeUrl&&t.siblings(".preview").replaceWith(function(){return g("").attr("href",e.customizeUrl).addClass("button load-customize").text(w("Live Preview"))})},1e3)},m.updates.installThemeError=function(e){var t,a=u(w("Installation failed: %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",u(d("%s installation failed","theme"),t.data("name"))).text(w("Installation failed.")),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()!==w("Deleting...")&&t.data("originaltext",t.html()).text(w("Deleting...")),m.a11y.speak(w("Deleting...")),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(d("Deleted!","theme")),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=u(w("Deletion failed: %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=w("Something went wrong.");if(_.isObject(e)&&!_.isFunction(e.always))return!0;switch(_.isString(e)&&"-1"===e?s=w("An error has occurred. Please reload the page and try again."):_.isString(e)?s=e:void 0!==e.readyState&&0===e.readyState?s=w("Connection lost or the server is busy. Please try again later."):_.isString(e.responseText)&&""!==e.responseText?s=e.responseText:_.isString(e.statusText)&&(s=e.statusText),t){case"update":a=w("Update failed: %s");break;case"install":a=w("Installation failed: %s");break;case"delete":a=w("Deletion failed: %s")}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(w("Update failed.")),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 w("Updates may not complete if you navigate away from this page.")},g(function(){var l=g("#plugin-filter"),o=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",u(d("Update %s now","plugin"),a.data("name"))):"install-plugin"===t.action&&a.attr("aria-label",u(d("Install %s now","plugin"),a.data("name"))))),m.a11y.speak(w("Update canceled."))}),o.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(w("Install Now")),m.a11y.speak(w("Update canceled."))})),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").attr("aria-label",u(d("Install %s now","plugin"),a)).text(w("Install Now")),m.a11y.speak(w("Update canceled."))})),m.updates.installPlugin({slug:t.data("slug"),pagenow:pagenow,success:m.updates.installImporterSuccess,error:m.updates.installImporterError}))}),o.on("click","[data-plugin] a.delete",function(e){var t,a=g(e.target).parents("tr");t=a.hasClass("is-uninstallable")?u(w("Are you sure you want to delete %s and its data?"),a.find(".plugin-title strong").text()):u(w("Are you sure you want to delete %s?"),a.find(".plugin-title strong").text()),e.preventDefault(),window.confirm(t)&&(m.updates.maybeRequestFilesystemCredentials(e),m.updates.deletePlugin({plugin:a.data("plugin"),slug:a.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"),a=u(w("Are you sure you want to delete %s?"),t.find(".theme-title strong").text());e.preventDefault(),window.confirm(a)&&(m.updates.maybeRequestFilesystemCredentials(e),m.updates.deleteTheme({slug:t.data("slug")}))}),o.on("click",'[type="submit"]:not([name="clear-recent-list"])',function(e){var t,n,l=g(e.target).siblings("select").val(),a=o.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:w("Please select at least one item to perform this action on.")});switch(l){case"update-selected":n=l.replace("selected",t);break;case"delete-selected":var s=w("plugin"===t?"Are you sure you want to delete the selected plugins and their data?":"Caution: These themes may be active on other sites in the network. Are you sure you want to proceed?");if(!window.confirm(s))return void e.preventDefault();n=l.replace("selected",t);break;default:return}m.updates.maybeRequestFilesystemCredentials(e),e.preventDefault(),o.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:w("Search Results")})),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(w("You do not appear to have any plugins available at this time.")):m.a11y.speak(u(w("Number of plugins found: %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(),o.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(u(w("Search results for “%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"),o.append(e.items),delete m.updates.searchRequest,0===e.count?m.a11y.speak(w("No plugins found. Try a different search.")):m.a11y.speak(u(w("Number of plugins found: %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("keydown",".column-auto-updates .toggle-auto-update, .theme-overlay .toggle-auto-update",function(e){32===e.which&&e.preventDefault()}),f.on("click keyup",".column-auto-updates .toggle-auto-update, .theme-overlay .toggle-auto-update",function(e){var t,d,u,o,r=g(this),p=r.attr("data-wp-action"),c=r.find(".label");if(("keyup"!==e.type||32===e.which)&&(o="themes"!==pagenow?r.closest(".column-auto-updates"):r.closest(".theme-autoupdate"),e.preventDefault(),"yes"!==r.attr("data-doing-ajax"))){switch(r.attr("data-doing-ajax","yes"),pagenow){case"plugins":case"plugins-network":u="plugin",d=r.closest("tr").attr("data-plugin");break;case"themes-network":u="theme",d=r.closest("tr").attr("data-slug");break;case"themes":u="theme",d=r.attr("data-slug")}o.find(".notice.notice-error").addClass("hidden"),"enable"===p?c.text(w("Enabling...")):c.text(w("Disabling...")),r.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=r.attr("href");if(!e.success)return l=e.data&&e.data.error?e.data.error:w("The request could not be completed."),o.find(".notice.notice-error").removeClass("hidden").find("p").text(l),void m.a11y.speak(l,"assertive");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?(r[0].hasAttribute("href")&&(i=i.replace("action=enable-auto-update","action=disable-auto-update"),r.attr("href",i)),r.attr("data-wp-action","disable"),c.text(w("Disable auto-updates")),o.find(".auto-update-time").removeClass("hidden"),m.a11y.speak(w("Auto-updates enabled"))):(r[0].hasAttribute("href")&&(i=i.replace("action=disable-auto-update","action=enable-auto-update"),r.attr("href",i)),r.attr("data-wp-action","enable"),c.text(w("Enable auto-updates")),o.find(".auto-update-time").addClass("hidden"),m.a11y.speak(w("Auto-updates disabled"))),f.trigger("wp-auto-update-setting-changed",{state:p,type:u,asset:d})}).fail(function(){o.find(".notice.notice-error").removeClass("hidden").find("p").text(w("The request could not be completed.")),m.a11y.speak(w("The request could not be completed."),"assertive")}).always(function(){r.removeAttr("data-doing-ajax").find(".dashicons-update").addClass("hidden")})}})})}(jQuery,window.wp,window._wpUpdatesSettings); \ No newline at end of file diff --git a/wp-admin/js/widgets.js b/wp-admin/js/widgets.js index e0dac1f4db..fb3759bfc9 100644 --- a/wp-admin/js/widgets.js +++ b/wp-admin/js/widgets.js @@ -744,3 +744,20 @@ window.wpWidgets = { $document.ready( function(){ wpWidgets.init(); } ); })(jQuery); + +/** + * Removed in 5.5.0, needed for back-compatibility. + * + * @since 4.9.0 + * @deprecated 5.5.0 + * + * @type {object} +*/ +wpWidgets.l10n = wpWidgets.l10n || { + save: '', + saved: '', + saveAlert: '', + widgetAdded: '' +}; + +wpWidgets.l10n = window.wp.deprecateL10nObject( 'wpWidgets.l10n', wpWidgets.l10n ); diff --git a/wp-admin/js/widgets.min.js b/wp-admin/js/widgets.min.js index 43c173ac00..06ba150fb5 100644 --- a/wp-admin/js/widgets.min.js +++ b/wp-admin/js/widgets.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(h){var v=h(document);window.wpWidgets={hoveredSidebar:null,dirtyWidgets:{},init:function(){var c,g,w=this,d=h(".widgets-chooser"),o=d.find(".widgets-chooser-sidebars"),e=h("div.widgets-sortables"),p=!("undefined"==typeof isRtl||!isRtl);h("#widgets-right .sidebar-name").click(function(){var e=h(this),i=e.closest(".widgets-holder-wrap "),t=e.find(".handlediv");i.hasClass("closed")?(i.removeClass("closed"),t.attr("aria-expanded","true"),e.parent().sortable("refresh")):(i.addClass("closed"),t.attr("aria-expanded","false")),v.triggerHandler("wp-pin-menu")}).find(".handlediv").each(function(e){0!==e&&h(this).attr("aria-expanded","false")}),h(window).on("beforeunload.widgets",function(e){var i,t=[];if(h.each(w.dirtyWidgets,function(e,i){i&&t.push(e)}),0!==t.length)return(i=h("#widgets-right").find(".widget").filter(function(){return-1!==t.indexOf(h(this).prop("id").replace(/^widget-\d+_/,""))})).each(function(){h(this).hasClass("open")||h(this).find(".widget-title-action:first").click()}),i.first().each(function(){this.scrollIntoViewIfNeeded?this.scrollIntoViewIfNeeded():this.scrollIntoView(),h(this).find(".widget-inside :tabbable:first").focus()}),e.returnValue=wp.i18n.__("The changes you made will be lost if you navigate away from this page."),e.returnValue}),h("#widgets-left .sidebar-name").click(function(){var e=h(this).closest(".widgets-holder-wrap");e.toggleClass("closed").find(".handlediv").attr("aria-expanded",!e.hasClass("closed")),v.triggerHandler("wp-pin-menu")}),h(document.body).bind("click.widgets-toggle",function(e){var i,t,d,a,s,n,r=h(e.target),o={},l=r.closest(".widget").find(".widget-top button.widget-action");r.parents(".widget-top").length&&!r.parents("#available-widgets").length?(t=(i=r.closest("div.widget")).children(".widget-inside"),d=parseInt(i.find("input.widget-width").val(),10),a=i.parent().width(),n=t.find(".widget-id").val(),i.data("dirty-state-initialized")||((s=t.find(".widget-control-save")).prop("disabled",!0).val(wp.i18n.__("Saved")),t.on("input change",function(){w.dirtyWidgets[n]=!0,i.addClass("widget-dirty"),s.prop("disabled",!1).val(wp.i18n.__("Save"))}),i.data("dirty-state-initialized",!0)),t.is(":hidden")?(250 .widget-top > .widget-title",distance:2,helper:"clone",zIndex:101,containment:"#wpwrap",refreshPositions:!0,start:function(e,i){var t=h(this).find(".widgets-chooser");i.helper.find("div.widget-description").hide(),g=this.id,t.length&&(h("#wpbody-content").append(t.hide()),i.helper.find(".widgets-chooser").remove(),w.clearWidgetSelection())},stop:function(){c&&h(c).hide(),c=""}}),e.droppable({tolerance:"intersect",over:function(e){var i=h(e.target).parent();wpWidgets.hoveredSidebar&&!i.is(wpWidgets.hoveredSidebar)&&wpWidgets.closeSidebar(e),i.hasClass("closed")&&(wpWidgets.hoveredSidebar=i).removeClass("closed").find(".handlediv").attr("aria-expanded","true"),h(this).sortable("refresh")},out:function(e){wpWidgets.hoveredSidebar&&wpWidgets.closeSidebar(e)}}),e.sortable({placeholder:"widget-placeholder",items:"> .widget",handle:"> .widget-top > .widget-title",cursor:"move",distance:2,containment:"#wpwrap",tolerance:"pointer",refreshPositions:!0,start:function(e,i){var t,d=h(this),a=d.parent(),s=i.item.children(".widget-inside");"block"===s.css("display")&&(i.item.removeClass("open"),i.item.find(".widget-top button.widget-action").attr("aria-expanded","false"),s.hide(),h(this).sortable("refreshPositions")),a.hasClass("closed")||(t=i.item.hasClass("ui-draggable")?d.height():1+d.height(),d.css("min-height",t+"px"))},stop:function(e,i){var t,d,a,s,n,r,o=i.item,l=g;if(wpWidgets.hoveredSidebar=null,o.hasClass("deleting"))return wpWidgets.save(o,1,0,1),void o.remove();t=o.find("input.add_new").val(),d=o.find("input.multi_number").val(),o.attr("style","").removeClass("ui-draggable"),g="",t&&("multi"===t?(o.html(o.html().replace(/<[^<>]+>/g,function(e){return e.replace(/__i__|%i%/g,d)})),o.attr("id",l.replace("__i__",d)),d++,h("div#"+l).find("input.multi_number").val(d)):"single"===t&&(o.attr("id","new-"+l),c="div#"+l),wpWidgets.save(o,0,0,1),o.find("input.add_new").val(""),v.trigger("widget-added",[o])),(a=o.parent()).parent().hasClass("closed")&&(a.parent().removeClass("closed").find(".handlediv").attr("aria-expanded","true"),1<(s=a.children(".widget")).length&&(n=s.get(0),r=o.get(0),n.id&&r.id&&n.id!==r.id&&h(n).before(o))),t?o.find(".widget-action").trigger("click"):wpWidgets.saveOrder(a.attr("id"))},activate:function(){h(this).parent().addClass("widget-hover")},deactivate:function(){h(this).css("min-height","").parent().removeClass("widget-hover")},receive:function(e,i){var t=h(i.sender);-1"),r=h("