diff --git a/wp-admin/js/auth-app.js b/wp-admin/js/auth-app.js index f358dd7e64..99478d1824 100644 --- a/wp-admin/js/auth-app.js +++ b/wp-admin/js/auth-app.js @@ -15,7 +15,7 @@ rejectUrl: authApp.reject }; - $approveBtn.click( function( e ) { + $approveBtn.on( 'click', function( e ) { var name = $appNameField.val(), appId = $( 'input[name="app_id"]', $form ).val(); @@ -26,7 +26,7 @@ } if ( 0 === name.length ) { - $appNameField.focus(); + $appNameField.trigger( 'focus' ); return; } @@ -102,7 +102,7 @@ $( 'input', $notice ).val( response.password ); $form.replaceWith( $notice ); - $notice.focus(); + $notice.trigger( 'focus' ); } } ).fail( function( jqXHR, textStatus, errorThrown ) { var errorMessage = errorThrown, @@ -140,7 +140,7 @@ } ); } ); - $rejectBtn.click( function( e ) { + $rejectBtn.on( 'click', function( e ) { e.preventDefault(); /** diff --git a/wp-admin/js/auth-app.min.js b/wp-admin/js/auth-app.min.js index 062f3b31a5..7085ef24d1 100644 --- a/wp-admin/js/auth-app.min.js +++ b/wp-admin/js/auth-app.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(t,p){var o=t("#app_name"),n=t("#approve"),e=t("#reject"),r=o.closest("form"),i={userLogin:p.user_login,successUrl:p.success,rejectUrl:p.reject};n.click(function(e){var a=o.val(),s=t('input[name="app_id"]',r).val();e.preventDefault(),n.prop("aria-disabled")||(0!==a.length?(n.prop("aria-disabled",!0).addClass("disabled"),a={name:a},0'+wp.i18n.__("Your new password for %s is:")+"","")+' ',o=t("
").attr("role","alert").attr("tabindex",-1).addClass("notice notice-success notice-alt").append(t("

").addClass("application-password-display").html(o)).append("

"+wp.i18n.__("Be sure to save this in a safe location. You will not be able to retrieve it.")+"

"),t("strong",o).text(e.name),t("input",o).val(e.password),r.replaceWith(o),o.focus())}).fail(function(e,a,s){var o=s,p=null;e.responseJSON&&(p=e.responseJSON).message&&(o=p.message);o=t("
").attr("role","alert").addClass("notice notice-error").append(t("

").text(o));t("h1").after(o),n.removeProp("aria-disabled",!1).removeClass("disabled"),wp.hooks.doAction("wp_application_passwords_approve_app_request_error",p,a,s,e)})):o.focus())}),e.click(function(e){e.preventDefault(),wp.hooks.doAction("wp_application_passwords_reject_app",i),window.location=p.reject}),r.on("submit",function(e){e.preventDefault()})}(jQuery,authApp); \ No newline at end of file +!function(t,p){var s=t("#app_name"),r=t("#approve"),e=t("#reject"),n=s.closest("form"),i={userLogin:p.user_login,successUrl:p.success,rejectUrl:p.reject};r.on("click",function(e){var a=s.val(),o=t('input[name="app_id"]',n).val();e.preventDefault(),r.prop("aria-disabled")||(0!==a.length?(r.prop("aria-disabled",!0).addClass("disabled"),a={name:a},0'+wp.i18n.__("Your new password for %s is:")+"","")+' ',s=t("
").attr("role","alert").attr("tabindex",-1).addClass("notice notice-success notice-alt").append(t("

").addClass("application-password-display").html(s)).append("

"+wp.i18n.__("Be sure to save this in a safe location. You will not be able to retrieve it.")+"

"),t("strong",s).text(e.name),t("input",s).val(e.password),n.replaceWith(s),s.trigger("focus"))}).fail(function(e,a,o){var s=o,p=null;e.responseJSON&&(p=e.responseJSON).message&&(s=p.message);s=t("
").attr("role","alert").addClass("notice notice-error").append(t("

").text(s));t("h1").after(s),r.removeProp("aria-disabled",!1).removeClass("disabled"),wp.hooks.doAction("wp_application_passwords_approve_app_request_error",p,a,o,e)})):s.trigger("focus"))}),e.on("click",function(e){e.preventDefault(),wp.hooks.doAction("wp_application_passwords_reject_app",i),window.location=p.reject}),n.on("submit",function(e){e.preventDefault()})}(jQuery,authApp); \ No newline at end of file diff --git a/wp-admin/js/color-picker.js b/wp-admin/js/color-picker.js index 6f3d1ce5a5..f41f00af18 100644 --- a/wp-admin/js/color-picker.js +++ b/wp-admin/js/color-picker.js @@ -67,7 +67,7 @@ * @return {void} */ change: function( event, ui ) { - if ( $.isFunction( self.options.change ) ) { + if ( typeof self.options.change === 'function' ) { self.options.change.call( this, event, ui ); } }, @@ -189,7 +189,7 @@ change: function( event, ui ) { self.toggler.css( { backgroundColor: ui.color.toString() } ); - if ( $.isFunction( self.options.change ) ) { + if ( typeof self.options.change === 'function' ) { self.options.change.call( this, event, ui ); } } @@ -257,7 +257,7 @@ if ( val === '' || val === '#' ) { self.toggler.css( 'backgroundColor', '' ); // Fire clear callback if we have one. - if ( $.isFunction( self.options.clear ) ) { + if ( typeof self.options.clear === 'function' ) { self.options.clear.call( this, event ); } } diff --git a/wp-admin/js/color-picker.min.js b/wp-admin/js/color-picker.min.js index 0f018e9ef0..6162cd79ff 100644 --- a/wp-admin/js/color-picker.min.js +++ b/wp-admin/js/color-picker.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(i,t){var a=wp.i18n.__,e={options:{defaultColor:!1,change:!1,clear:!1,hide:!0,palettes:!0,width:255,mode:"hsv",type:"full",slider:"horizontal"},_createHueOnly:function(){var e,o=this,t=o.element;t.hide(),e="hsl("+t.val()+", 100, 50)",t.iris({mode:"hsl",type:"hue",hide:!1,color:e,change:function(e,t){i.isFunction(o.options.change)&&o.options.change.call(this,e,t)},width:o.options.width,slider:o.options.slider})},_create:function(){if(i.support.iris){var o=this,e=o.element;if(i.extend(o.options,e.data()),"hue"===o.options.type)return o._createHueOnly();o.close=i.proxy(o.close,o),o.initialValue=e.val(),e.addClass("wp-color-picker"),e.parent("label").length||(e.wrap(""),o.wrappingLabelText=i('').insertBefore(e).text(a("Color value"))),o.wrappingLabel=e.parent(),o.wrappingLabel.wrap('
'),o.wrap=o.wrappingLabel.parent(),o.toggler=i('').insertBefore(o.wrappingLabel).css({backgroundColor:o.initialValue}),o.toggler.find(".wp-color-result-text").text(a("Select Color")),o.pickerContainer=i('
').insertAfter(o.wrappingLabel),o.button=i(''),o.options.defaultColor?o.button.addClass("wp-picker-default").val(a("Default")).attr("aria-label",a("Select default color")):o.button.addClass("wp-picker-clear").val(a("Clear")).attr("aria-label",a("Clear color")),o.wrappingLabel.wrap('
'),n=s(".quick-draft-textarea-clone"),o=s("#content"),i=o.height(),a=s(window).height()-100,n.css({"font-family":o.css("font-family"),"font-size":o.css("font-size"),"line-height":o.css("line-height"),"padding-bottom":o.css("paddingBottom"),"padding-left":o.css("paddingLeft"),"padding-right":o.css("paddingRight"),"padding-top":o.css("paddingTop"),"white-space":"pre-wrap","word-wrap":"break-word",display:"none"}),o.on("focus input propertychange",function(){var e=s(this),t=e.val()+" ",t=n.css("width",e.css("width")).text(t).outerHeight()+2;o.css("overflow-y","auto"),t===i||a<=t&&a<=i||(i=a"),e=i,1<=(t=(a=s.exec(document.title))?(a=a[0],o.html(a),x(o)+t):(o.html(0),t))?(r(o,t),(n=s.exec(document.title))&&(e=document.title.replace(n[0],c("Comments (%s)").replace("%s",o.text())+" "))):(n=s.exec(e))&&(e=e.replace(n[0],c("Comments"))),document.title=e},I=function(n,t){var e=".post-com-count-"+t,a="comment-count-no-pending",o="post-com-count-no-pending",s="comment-count-pending";C||l(n),w("span.pending-count").each(function(){var t=w(this),e=x(t)+n;e<1&&(e=0),t.closest(".awaiting-mod")[0===e?"addClass":"removeClass"]("count-0"),r(t,e)}),t&&(t=w("span."+s,e),e=w("span."+a,e),t.each(function(){var t=w(this),e=x(t)+n;0===(e=e<1?0:e)?(t.parent().addClass(o),t.removeClass(s).addClass(a)):(t.parent().removeClass(o),t.addClass(s).removeClass(a)),r(t,e)}),e.each(function(){var t=w(this);0
"),t.toggleEditor(o,0,!0),wp.a11y.speak(i,"assertive")}).attr("src",ajaxurl+"?"+g.param(i))},action:function(t,i,e){var a,o,s,n,d=this;if(d.notsaved(t))return!1;if(a={action:"image-editor",_ajax_nonce:i,postid:t},"scale"===e){if(o=g("#imgedit-scale-width-"+t),s=g("#imgedit-scale-height-"+t),n=d.intval(o.val()),i=d.intval(s.val()),n<1)return o.trigger("focus"),!1;if(i<1)return s.trigger("focus"),!1;if(n===d.hold.ow||i===d.hold.oh)return!1;a.do="scale",a.fwidth=n,a.fheight=i}else{if("restore"!==e)return!1;a.do="restore"}d.toggleEditor(t,1),g.post(ajaxurl,a,function(i){g("#image-editor-"+t).empty().append(i.data.html),d.toggleEditor(t,0,!0),d._view&&d._view.refresh()}).done(function(i){i&&i.data.message.msg?wp.a11y.speak(i.data.message.msg):i&&i.data.message.error&&wp.a11y.speak(i.data.message.error)})},save:function(t,i){var e=this.getTarget(t),a=this.filterHistory(t,0),o=this;if(""===a)return!1;this.toggleEditor(t,1),e={action:"image-editor",_ajax_nonce:i,postid:t,history:a,target:e,context:g("#image-edit-context").length?g("#image-edit-context").val():null,do:"save"},g.post(ajaxurl,e,function(i){return i.data.error?(g("#imgedit-response-"+t).html('"),r.close(t),void wp.a11y.speak(i.data.error)):(i.data.fw&&i.data.fh&&g("#media-dims-"+t).html(i.data.fw+" × "+i.data.fh),i.data.thumbnail&&g(".thumbnail","#thumbnail-head-"+t).attr("src",""+i.data.thumbnail),i.data.msg&&(g("#imgedit-response-"+t).html('"),wp.a11y.speak(i.data.msg)),void(o._view?o._view.save():r.close(t)))})},open:function(e,i,t){this._view=t;var a=g("#image-editor-"+e),o=g("#media-head-"+e),s=g("#imgedit-open-btn-"+e),n=s.siblings(".spinner");if(!s.hasClass("button-activated"))return n.addClass("is-active"),i={action:"image-editor",_ajax_nonce:i,postid:e,do:"open"},g.ajax({url:ajaxurl,type:"post",data:i,beforeSend:function(){s.addClass("button-activated")}}).done(function(i){var t;"-1"===i&&(t=d("Could not load the preview image."),a.html('")),i.data&&i.data.html&&a.html(i.data.html),o.fadeOut("fast",function(){a.fadeIn("fast",function(){t&&g(document).trigger("image-editor-ui-ready")}),s.removeClass("button-activated"),n.removeClass("is-active")}),r.init(e)})},imgLoaded:function(i){var t=g("#image-preview-"+i),e=g("#imgedit-crop-"+i);void 0===this.hold.sizer&&this.init(i),this.initCrop(i,t,e),this.setCropSelection(i,{x1:0,y1:0,x2:0,y2:0,width:t.innerWidth(),height:t.innerHeight()}),this.toggleEditor(i,0,!0)},focusManager:function(){setTimeout(function(){var i=g('.notice[role="alert"]');(i=!i.length?g(".imgedit-wrap").find(":tabbable:first"):i).trigger("focus")},100)},initCrop:function(a,i,t){var o=this,s=g("#imgedit-sel-width-"+a),n=g("#imgedit-sel-height-"+a),i=g(i);i.data("imgAreaSelect")||(o.iasapi=i.imgAreaSelect({parent:t,instance:!0,handles:!0,keys:!0,minWidth:3,minHeight:3,onInit:function(i){g(i).next().css("position","absolute").nextAll(".imgareaselect-outer").css("position","absolute"),t.children().on("mousedown, touchstart",function(i){var t,e=!1;i.shiftKey&&(t=o.iasapi.getSelection(),i=o.getSelRatio(a),e=t&&t.width&&t.height?t.width+":"+t.height:i),o.iasapi.setOptions({aspectRatio:e})})},onSelectStart:function(){r.setDisabled(g("#imgedit-crop-sel-"+a),1)},onSelectEnd:function(i,t){r.setCropSelection(a,t)},onSelectChange:function(i,t){var e=r.hold.sizer;s.val(r.round(t.width/e)),n.val(r.round(t.height/e))}}))},setCropSelection:function(i,t){if(!(t=t||0)||t.width<3&&t.height<3)return this.setDisabled(g(".imgedit-crop","#imgedit-panel-"+i),1),this.setDisabled(g("#imgedit-crop-sel-"+i),1),g("#imgedit-sel-width-"+i).val(""),g("#imgedit-sel-height-"+i).val(""),g("#imgedit-selection-"+i).val(""),!1;t={x:t.x1,y:t.y1,w:t.width,h:t.height},this.setDisabled(g(".imgedit-crop","#imgedit-panel-"+i),1),g("#imgedit-selection-"+i).val(JSON.stringify(t))},close:function(i,t){if((t=t||!1)&&this.notsaved(i))return!1;this.iasapi={},this.hold={},this._view?this._view.back():g("#image-editor-"+i).fadeOut("fast",function(){g("#media-head-"+i).fadeIn("fast",function(){g("#imgedit-open-btn-"+i).trigger("focus")}),g(this).empty()})},notsaved:function(i){var t=g("#imgedit-history-"+i).val(),t=""!==t?JSON.parse(t):[];return this.intval(g("#imgedit-undone-"+i).val())this.hold.oh||n&&n>this.hold.ow?s.css("visibility","visible"):s.css("visibility","hidden"))},getSelRatio:function(i){var t=this.hold.w,e=this.hold.h,a=this.intval(g("#imgedit-crop-width-"+i).val()),i=this.intval(g("#imgedit-crop-height-"+i).val());return a&&i?a+":"+i:t&&e?t+":"+e:"1:1"},filterHistory:function(i,t){var e,a,o,s=g("#imgedit-history-"+i).val(),n=[];if(""===s)return"";if(s=JSON.parse(s),0<(e=this.intval(g("#imgedit-undone-"+i).val())))for(;0').on("load",{history:i.history},function(i){var t,e=g("#imgedit-crop-"+o),a=d;""!==i.data.history&&(t=JSON.parse(i.data.history))[t.length-1].hasOwnProperty("c")&&(a.setDisabled(g("#image-undo-"+o),!0),g("#image-undo-"+o).trigger("focus")),e.empty().append(n),i=Math.max(a.hold.w,a.hold.h),t=Math.max(g(n).width(),g(n).height()),a.hold.sizer=t

'+i+"

"),t.toggleEditor(o,0,!0),wp.a11y.speak(i,"assertive")}).attr("src",ajaxurl+"?"+g.param(i))},action:function(t,i,e){var a,o,s,n,r=this;if(r.notsaved(t))return!1;if(a={action:"image-editor",_ajax_nonce:i,postid:t},"scale"===e){if(o=g("#imgedit-scale-width-"+t),s=g("#imgedit-scale-height-"+t),n=r.intval(o.val()),i=r.intval(s.val()),n<1)return o.trigger("focus"),!1;if(i<1)return s.trigger("focus"),!1;if(n===r.hold.ow||i===r.hold.oh)return!1;a.do="scale",a.fwidth=n,a.fheight=i}else{if("restore"!==e)return!1;a.do="restore"}r.toggleEditor(t,1),g.post(ajaxurl,a,function(i){g("#image-editor-"+t).empty().append(i.data.html),r.toggleEditor(t,0,!0),r._view&&r._view.refresh()}).done(function(i){i&&i.data.message.msg?wp.a11y.speak(i.data.message.msg):i&&i.data.message.error&&wp.a11y.speak(i.data.message.error)})},save:function(t,i){var e=this.getTarget(t),a=this.filterHistory(t,0),o=this;if(""===a)return!1;this.toggleEditor(t,1),e={action:"image-editor",_ajax_nonce:i,postid:t,history:a,target:e,context:g("#image-edit-context").length?g("#image-edit-context").val():null,do:"save"},g.post(ajaxurl,e,function(i){return i.data.error?(g("#imgedit-response-"+t).html('"),d.close(t),void wp.a11y.speak(i.data.error)):(i.data.fw&&i.data.fh&&g("#media-dims-"+t).html(i.data.fw+" × "+i.data.fh),i.data.thumbnail&&g(".thumbnail","#thumbnail-head-"+t).attr("src",""+i.data.thumbnail),i.data.msg&&(g("#imgedit-response-"+t).html('"),wp.a11y.speak(i.data.msg)),void(o._view?o._view.save():d.close(t)))})},open:function(e,i,t){this._view=t;var a=g("#image-editor-"+e),o=g("#media-head-"+e),s=g("#imgedit-open-btn-"+e),n=s.siblings(".spinner");if(!s.hasClass("button-activated"))return n.addClass("is-active"),i={action:"image-editor",_ajax_nonce:i,postid:e,do:"open"},g.ajax({url:ajaxurl,type:"post",data:i,beforeSend:function(){s.addClass("button-activated")}}).done(function(i){var t;"-1"===i&&(t=r("Could not load the preview image."),a.html('")),i.data&&i.data.html&&a.html(i.data.html),o.fadeOut("fast",function(){a.fadeIn("fast",function(){t&&g(document).trigger("image-editor-ui-ready")}),s.removeClass("button-activated"),n.removeClass("is-active")}),d.init(e)})},imgLoaded:function(i){var t=g("#image-preview-"+i),e=g("#imgedit-crop-"+i);void 0===this.hold.sizer&&this.init(i),this.initCrop(i,t,e),this.setCropSelection(i,{x1:0,y1:0,x2:0,y2:0,width:t.innerWidth(),height:t.innerHeight()}),this.toggleEditor(i,0,!0)},focusManager:function(){setTimeout(function(){var i=g('.notice[role="alert"]');(i=!i.length?g(".imgedit-wrap").find(":tabbable:first"):i).trigger("focus")},100)},initCrop:function(a,i,t){var o=this,s=g("#imgedit-sel-width-"+a),n=g("#imgedit-sel-height-"+a),i=g(i);i.data("imgAreaSelect")||(o.iasapi=i.imgAreaSelect({parent:t,instance:!0,handles:!0,keys:!0,minWidth:3,minHeight:3,onInit:function(i){g(i).next().css("position","absolute").nextAll(".imgareaselect-outer").css("position","absolute"),t.children().on("mousedown, touchstart",function(i){var t,e=!1;i.shiftKey&&(t=o.iasapi.getSelection(),i=o.getSelRatio(a),e=t&&t.width&&t.height?t.width+":"+t.height:i),o.iasapi.setOptions({aspectRatio:e})})},onSelectStart:function(){d.setDisabled(g("#imgedit-crop-sel-"+a),1)},onSelectEnd:function(i,t){d.setCropSelection(a,t)},onSelectChange:function(i,t){var e=d.hold.sizer;s.val(d.round(t.width/e)),n.val(d.round(t.height/e))}}))},setCropSelection:function(i,t){if(!(t=t||0)||t.width<3&&t.height<3)return this.setDisabled(g(".imgedit-crop","#imgedit-panel-"+i),1),this.setDisabled(g("#imgedit-crop-sel-"+i),1),g("#imgedit-sel-width-"+i).val(""),g("#imgedit-sel-height-"+i).val(""),g("#imgedit-selection-"+i).val(""),!1;t={x:t.x1,y:t.y1,w:t.width,h:t.height},this.setDisabled(g(".imgedit-crop","#imgedit-panel-"+i),1),g("#imgedit-selection-"+i).val(JSON.stringify(t))},close:function(i,t){if((t=t||!1)&&this.notsaved(i))return!1;this.iasapi={},this.hold={},this._view?this._view.back():g("#image-editor-"+i).fadeOut("fast",function(){g("#media-head-"+i).fadeIn("fast",function(){g("#imgedit-open-btn-"+i).trigger("focus")}),g(this).empty()})},notsaved:function(i){var t=g("#imgedit-history-"+i).val(),t=""!==t?JSON.parse(t):[];return this.intval(g("#imgedit-undone-"+i).val())' ).text( name ); } ); } ); @@ -108,13 +108,13 @@ jQuery(document).ready( function($) { } ); // All categories is the default tab, so we delete the user setting. - $('a[href="#categories-all"]').click(function(){deleteUserSetting('cats');}); + $('a[href="#categories-all"]').on( 'click', function(){deleteUserSetting('cats');}); // Set a preference for the popular categories to cookies. - $('a[href="#categories-pop"]').click(function(){setUserSetting('cats','pop');}); + $('a[href="#categories-pop"]').on( 'click', function(){setUserSetting('cats','pop');}); if ( 'pop' == getUserSetting('cats') ) - $('a[href="#categories-pop"]').click(); + $('a[href="#categories-pop"]').trigger( 'click' ); /** * Adds event handler that shows the interface controls to add a new category. @@ -125,12 +125,12 @@ jQuery(document).ready( function($) { * @return {boolean} Always returns false to prevent regular link * functionality. */ - $('#category-add-toggle').click( function() { + $('#category-add-toggle').on( 'click', function() { $(this).parents('div:first').toggleClass( 'wp-hidden-children' ); - $('#category-tabs a[href="#categories-all"]').click(); - $('#newcategory').focus(); + $('#category-tabs a[href="#categories-all"]').trigger( 'click' ); + $('#newcategory').trigger( 'focus' ); return false; } ); - $('.categorychecklist :checkbox').change( syncChecks ).filter( ':checked' ).change(); + $('.categorychecklist :checkbox').on( 'change', syncChecks ).filter( ':checked' ).trigger( 'change' ); }); diff --git a/wp-admin/js/link.min.js b/wp-admin/js/link.min.js index 07eeaaac7a..ecb8d3cf80 100644 --- a/wp-admin/js/link.min.js +++ b/wp-admin/js/link.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -jQuery(document).ready(function(c){var t,i,e,a=!1;c("#link_name").focus(),postboxes.add_postbox_toggles("link"),c("#category-tabs a").click(function(){var t=c(this).attr("href");return c(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),c(".tabs-panel").hide(),c(t).show(),"#categories-all"==t?deleteUserSetting("cats"):setUserSetting("cats","pop"),!1}),getUserSetting("cats")&&c('#category-tabs a[href="#categories-pop"]').click(),t=c("#newcat").one("focus",function(){c(this).val("").removeClass("form-input-tip")}),c("#link-category-add-submit").click(function(){t.focus()}),i=function(){var t,e;a||(a=!0,t=(e=c(this)).is(":checked"),e=e.val().toString(),c("#in-link-category-"+e+", #in-popular-link_category-"+e).prop("checked",t),a=!1)},e=function(t,e){c(e.what+" response_data",t).each(function(){c(c(this).text()).find("label").each(function(){var t=c(this),e=t.find("input").val(),a=t.find("input")[0].id,t=c.trim(t.text());c("#"+a).change(i),c('').text(t)})})},c("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:e}),c('a[href="#categories-all"]').click(function(){deleteUserSetting("cats")}),c('a[href="#categories-pop"]').click(function(){setUserSetting("cats","pop")}),"pop"==getUserSetting("cats")&&c('a[href="#categories-pop"]').click(),c("#category-add-toggle").click(function(){return c(this).parents("div:first").toggleClass("wp-hidden-children"),c('#category-tabs a[href="#categories-all"]').click(),c("#newcategory").focus(),!1}),c(".categorychecklist :checkbox").change(i).filter(":checked").change()}); \ No newline at end of file +jQuery(document).ready(function(i){var t,c,e,a=!1;i("#link_name").trigger("focus"),postboxes.add_postbox_toggles("link"),i("#category-tabs a").on("click",function(){var t=i(this).attr("href");return i(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),i(".tabs-panel").hide(),i(t).show(),"#categories-all"==t?deleteUserSetting("cats"):setUserSetting("cats","pop"),!1}),getUserSetting("cats")&&i('#category-tabs a[href="#categories-pop"]').trigger("click"),t=i("#newcat").one("focus",function(){i(this).val("").removeClass("form-input-tip")}),i("#link-category-add-submit").on("click",function(){t.focus()}),c=function(){var t,e;a||(a=!0,t=(e=i(this)).is(":checked"),e=e.val().toString(),i("#in-link-category-"+e+", #in-popular-link_category-"+e).prop("checked",t),a=!1)},e=function(t,e){i(e.what+" response_data",t).each(function(){i(i(this).text()).find("label").each(function(){var t=i(this),e=t.find("input").val(),a=t.find("input")[0].id,t=i.trim(t.text());i("#"+a).on("change",c),i('').text(t)})})},i("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:e}),i('a[href="#categories-all"]').on("click",function(){deleteUserSetting("cats")}),i('a[href="#categories-pop"]').on("click",function(){setUserSetting("cats","pop")}),"pop"==getUserSetting("cats")&&i('a[href="#categories-pop"]').trigger("click"),i("#category-add-toggle").on("click",function(){return i(this).parents("div:first").toggleClass("wp-hidden-children"),i('#category-tabs a[href="#categories-all"]').trigger("click"),i("#newcategory").trigger("focus"),!1}),i(".categorychecklist :checkbox").on("change",c).filter(":checked").trigger("change")}); \ No newline at end of file diff --git a/wp-admin/js/media-gallery.js b/wp-admin/js/media-gallery.js index e96222c67a..6df4c37e6a 100644 --- a/wp-admin/js/media-gallery.js +++ b/wp-admin/js/media-gallery.js @@ -10,7 +10,7 @@ jQuery(function($) { /** * Adds a click event handler to the element with a 'wp-gallery' class. */ - $( 'body' ).bind( 'click.wp-gallery', function(e) { + $( 'body' ).on( 'click.wp-gallery', function(e) { var target = $( e.target ), id, img_size, nonceValue; if ( target.hasClass( 'wp-set-header' ) ) { diff --git a/wp-admin/js/media-gallery.min.js b/wp-admin/js/media-gallery.min.js index 8ecfecd2ae..b61b212449 100644 --- a/wp-admin/js/media-gallery.min.js +++ b/wp-admin/js/media-gallery.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -jQuery(function(o){o("body").bind("click.wp-gallery",function(a){var e,t,n=o(a.target);n.hasClass("wp-set-header")?((window.dialogArguments||opener||parent||top).location.href=n.data("location"),a.preventDefault()):n.hasClass("wp-set-background")&&(e=n.data("attachment-id"),t=o('input[name="attachments['+e+'][image-size]"]:checked').val(),n=o("#_wpnonce").val()&&"",jQuery.post(ajaxurl,{action:"set-background-image",attachment_id:e,_ajax_nonce:n,size:t},function(){var a=window.dialogArguments||opener||parent||top;a.tb_remove(),a.location.reload()}),a.preventDefault())})}); \ No newline at end of file +jQuery(function(o){o("body").on("click.wp-gallery",function(a){var e,t,n=o(a.target);n.hasClass("wp-set-header")?((window.dialogArguments||opener||parent||top).location.href=n.data("location"),a.preventDefault()):n.hasClass("wp-set-background")&&(e=n.data("attachment-id"),t=o('input[name="attachments['+e+'][image-size]"]:checked').val(),n=o("#_wpnonce").val()&&"",jQuery.post(ajaxurl,{action:"set-background-image",attachment_id:e,_ajax_nonce:n,size:t},function(){var a=window.dialogArguments||opener||parent||top;a.tb_remove(),a.location.reload()}),a.preventDefault())})}); \ No newline at end of file diff --git a/wp-admin/js/media.js b/wp-admin/js/media.js index 97310d2a63..fa11305117 100644 --- a/wp-admin/js/media.js +++ b/wp-admin/js/media.js @@ -46,7 +46,7 @@ $( '#find-posts' ).show(); // Close the dialog when the escape key is pressed. - $('#find-posts-input').focus().keyup( function( event ){ + $('#find-posts-input').trigger( 'focus' ).on( 'keyup', function( event ){ if ( event.which == 27 ) { findPosts.close(); } diff --git a/wp-admin/js/media.min.js b/wp-admin/js/media.min.js index 60dad4c6e9..fb29857ede 100644 --- a/wp-admin/js/media.min.js +++ b/wp-admin/js/media.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(s){window.findPosts={open:function(n,e){var i=s(".ui-find-overlay");return 0===i.length&&(s("body").append('
'),findPosts.overlay()),i.show(),n&&e&&s("#affected").attr("name",n).val(e),s("#find-posts").show(),s("#find-posts-input").focus().keyup(function(n){27==n.which&&findPosts.close()}),findPosts.send(),!1},close:function(){s("#find-posts-response").empty(),s("#find-posts").hide(),s(".ui-find-overlay").hide()},overlay:function(){s(".ui-find-overlay").on("click",function(){findPosts.close()})},send:function(){var n={ps:s("#find-posts-input").val(),action:"find_posts",_ajax_nonce:s("#_ajax_nonce").val()},e=s(".find-box-search .spinner");e.addClass("is-active"),s.ajax(ajaxurl,{type:"POST",data:n,dataType:"json"}).always(function(){e.removeClass("is-active")}).done(function(n){n.success||s("#find-posts-response").text(wp.i18n.__("An error has occurred. Please reload the page and try again.")),s("#find-posts-response").html(n.data)}).fail(function(){s("#find-posts-response").text(wp.i18n.__("An error has occurred. Please reload the page and try again."))})}},s(document).ready(function(){var n,e=s("#wp-media-grid");e.length&&window.wp&&window.wp.media&&(n=_wpMediaGridSettings,n=window.wp.media({frame:"manage",container:e,library:n.queryVars}).open(),e.trigger("wp-media-grid-ready",n)),s("#find-posts-submit").on("click",function(n){s('#find-posts-response input[type="radio"]:checked').length||n.preventDefault()}),s("#find-posts .find-box-search :input").on("keypress",function(n){if(13==n.which)return findPosts.send(),!1}),s("#find-posts-search").on("click",findPosts.send),s("#find-posts-close").on("click",findPosts.close),s("#doaction").on("click",function(e){s('select[name="action"]').each(function(){var n=s(this).val();"attach"===n?(e.preventDefault(),findPosts.open()):"delete"===n&&(showNotice.warn()||e.preventDefault())})}),s(".find-box-inside").on("click","tr",function(){s(this).find(".found-radio input").prop("checked",!0)})})}(jQuery); \ No newline at end of file +!function(o){window.findPosts={open:function(n,e){var i=o(".ui-find-overlay");return 0===i.length&&(o("body").append('
'),findPosts.overlay()),i.show(),n&&e&&o("#affected").attr("name",n).val(e),o("#find-posts").show(),o("#find-posts-input").trigger("focus").on("keyup",function(n){27==n.which&&findPosts.close()}),findPosts.send(),!1},close:function(){o("#find-posts-response").empty(),o("#find-posts").hide(),o(".ui-find-overlay").hide()},overlay:function(){o(".ui-find-overlay").on("click",function(){findPosts.close()})},send:function(){var n={ps:o("#find-posts-input").val(),action:"find_posts",_ajax_nonce:o("#_ajax_nonce").val()},e=o(".find-box-search .spinner");e.addClass("is-active"),o.ajax(ajaxurl,{type:"POST",data:n,dataType:"json"}).always(function(){e.removeClass("is-active")}).done(function(n){n.success||o("#find-posts-response").text(wp.i18n.__("An error has occurred. Please reload the page and try again.")),o("#find-posts-response").html(n.data)}).fail(function(){o("#find-posts-response").text(wp.i18n.__("An error has occurred. Please reload the page and try again."))})}},o(document).ready(function(){var n,e=o("#wp-media-grid");e.length&&window.wp&&window.wp.media&&(n=_wpMediaGridSettings,n=window.wp.media({frame:"manage",container:e,library:n.queryVars}).open(),e.trigger("wp-media-grid-ready",n)),o("#find-posts-submit").on("click",function(n){o('#find-posts-response input[type="radio"]:checked').length||n.preventDefault()}),o("#find-posts .find-box-search :input").on("keypress",function(n){if(13==n.which)return findPosts.send(),!1}),o("#find-posts-search").on("click",findPosts.send),o("#find-posts-close").on("click",findPosts.close),o("#doaction").on("click",function(e){o('select[name="action"]').each(function(){var n=o(this).val();"attach"===n?(e.preventDefault(),findPosts.open()):"delete"===n&&(showNotice.warn()||e.preventDefault())})}),o(".find-box-inside").on("click","tr",function(){o(this).find(".found-radio input").prop("checked",!0)})})}(jQuery); \ No newline at end of file diff --git a/wp-admin/js/nav-menu.js b/wp-admin/js/nav-menu.js index 12e02a3036..bd031d9905 100644 --- a/wp-admin/js/nav-menu.js +++ b/wp-admin/js/nav-menu.js @@ -857,7 +857,7 @@ if ( e.keyCode === 13 ) { e.preventDefault(); - $( '#submit-customlinkdiv' ).click(); + $( '#submit-customlinkdiv' ).trigger( 'click' ); } }); }, @@ -967,7 +967,7 @@ // Remove the Ajax spinner. $( '.customlinkdiv .spinner' ).removeClass( 'is-active' ); // Set custom link form back to defaults. - $('#custom-menu-item-name').val('').blur(); + $('#custom-menu-item-name').val('').trigger( 'blur' ); $( '#custom-menu-item-url' ).val( '' ).attr( 'placeholder', 'https://' ); }); }, @@ -1059,7 +1059,7 @@ }; } else { // Make the post boxes read-only, as they can't be used yet. - $( '#menu-settings-column' ).find( 'input,select' ).end().find( 'a' ).attr( 'href', '#' ).unbind( 'click' ); + $( '#menu-settings-column' ).find( 'input,select' ).end().find( 'a' ).attr( 'href', '#' ).off( 'click' ); } }, @@ -1141,7 +1141,7 @@ $.post( ajaxurl, this.href.replace( /.*\?/, '' ).replace( /action=([^&]*)/, '' ) + '&action=menu-get-metabox', function( resp ) { - var metaBoxData = $.parseJSON( resp ), + var metaBoxData = JSON.parse( resp ), toReplace; if ( -1 === resp.indexOf( 'replace-id' ) ) { @@ -1354,4 +1354,4 @@ }); }); -})(jQuery); \ No newline at end of file +})(jQuery); diff --git a/wp-admin/js/nav-menu.min.js b/wp-admin/js/nav-menu.min.js index 9f4ac718e3..a82605a9de 100644 --- a/wp-admin/js/nav-menu.min.js +++ b/wp-admin/js/nav-menu.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(I){var k=window.wpNavMenu={options:{menuItemDepthPerLevel:30,globalMaxDepth:11,sortableItems:"> *",targetTolerance:0},menuList:void 0,targetList:void 0,menusChanged:!1,isRTL:!("undefined"==typeof isRtl||!isRtl),negateIfRTL:"undefined"!=typeof isRtl&&isRtl?-1:1,lastSearch:"",init:function(){k.menuList=I("#menu-to-edit"),k.targetList=k.menuList,this.jQueryExtensions(),this.attachMenuEditListeners(),this.attachQuickSearchListeners(),this.attachThemeLocationsListeners(),this.attachMenuSaveSubmitListeners(),this.attachTabsPanelListeners(),this.attachUnsavedChangesListener(),k.menuList.length&&this.initSortables(),menus.oneThemeLocationNoMenus&&I("#posttype-page").addSelectedToMenu(k.addMenuItemToBottom),this.initManageLocations(),this.initAccessibility(),this.initToggles(),this.initPreviewing()},jQueryExtensions:function(){I.fn.extend({menuItemDepth:function(){var e=k.isRTL?this.eq(0).css("margin-right"):this.eq(0).css("margin-left");return k.pxToDepth(e&&-1!=e.indexOf("px")?e.slice(0,-2):0)},updateDepthClass:function(t,n){return this.each(function(){var e=I(this);n=n||e.menuItemDepth(),I(this).removeClass("menu-item-depth-"+n).addClass("menu-item-depth-"+t)})},shiftDepthClass:function(i){return this.each(function(){var e=I(this),t=e.menuItemDepth(),n=t+i;e.removeClass("menu-item-depth-"+t).addClass("menu-item-depth-"+n),0===n&&e.find(".is-submenu").hide()})},childMenuItems:function(){var i=I();return this.each(function(){for(var e=I(this),t=e.menuItemDepth(),n=e.next(".menu-item");n.length&&n.menuItemDepth()>t;)i=i.add(n),n=n.next(".menu-item")}),i},shiftHorizontally:function(i){return this.each(function(){var e=I(this),t=e.menuItemDepth(),n=t+i;e.moveHorizontally(n,t)})},moveHorizontally:function(a,s){return this.each(function(){var e=I(this),t=e.childMenuItems(),i=a-s,n=e.find(".is-submenu");e.updateDepthClass(a,s).updateParentMenuItemDBId(),t&&t.each(function(){var e=I(this),t=e.menuItemDepth(),n=t+i;e.updateDepthClass(n,t).updateParentMenuItemDBId()}),0===a?n.hide():n.show()})},updateParentMenuItemDBId:function(){return this.each(function(){var e=I(this),t=e.find(".menu-item-data-parent-id"),n=parseInt(e.menuItemDepth(),10),i=n-1,i=e.prevAll(".menu-item-depth-"+i).first();0===n?t.val(0):t.val(i.find(".menu-item-data-db-id").val())})},hideAdvancedMenuItemFields:function(){return this.each(function(){var e=I(this);I(".hide-column-tog").not(":checked").each(function(){e.find(".field-"+I(this).val()).addClass("hidden-field")})})},addSelectedToMenu:function(a){return 0!==I("#menu-to-edit").length&&this.each(function(){var e=I(this),n={},t=menus.oneThemeLocationNoMenus&&0===e.find(".tabs-panel-active .categorychecklist li input:checked").length?e.find('#page-all li input[type="checkbox"]'):e.find(".tabs-panel-active .categorychecklist li input:checked"),i=/menu-item\[([^\]]*)/;if(a=a||k.addMenuItemToBottom,!t.length)return!1;e.find(".button-controls .spinner").addClass("is-active"),I(t).each(function(){var e=I(this),t=i.exec(e.attr("name")),t=void 0===t[1]?0:parseInt(t[1],10);this.className&&-1!=this.className.indexOf("add-to-top")&&(a=k.addMenuItemToTop),n[t]=e.closest("li").getItemData("add-menu-item",t)}),k.addItemToMenu(n,a,function(){t.prop("checked",!1),e.find(".button-controls .select-all").prop("checked",!1),e.find(".button-controls .spinner").removeClass("is-active")})})},getItemData:function(t,n){t=t||"menu-item";var i,a={},s=["menu-item-db-id","menu-item-object-id","menu-item-object","menu-item-parent-id","menu-item-position","menu-item-type","menu-item-title","menu-item-url","menu-item-description","menu-item-attr-title","menu-item-target","menu-item-classes","menu-item-xfn"];return(n=n||"menu-item"!=t?n:this.find(".menu-item-data-db-id").val())&&this.find("input").each(function(){var e;for(i=s.length;i--;)"menu-item"==t?e=s[i]+"["+n+"]":"add-menu-item"==t&&(e="menu-item["+n+"]["+s[i]+"]"),this.name&&e==this.name&&(a[s[i]]=this.value)}),a},setItemData:function(e,a,s){return a=a||"menu-item",(s=s||"menu-item"!=a?s:I(".menu-item-data-db-id",this).val())&&this.find("input").each(function(){var n,i=I(this);I.each(e,function(e,t){"menu-item"==a?n=e+"["+s+"]":"add-menu-item"==a&&(n="menu-item["+s+"]["+e+"]"),n==i.attr("name")&&i.val(t)})}),this}})},countMenuItems:function(e){return I(".menu-item-depth-"+e).length},moveMenuItem:function(e,t){var n,i,a=I("#menu-to-edit li"),s=a.length,m=e.parents("li.menu-item"),o=m.childMenuItems(),u=m.getItemData(),c=parseInt(m.menuItemDepth(),10),r=parseInt(m.index(),10),l=m.next(),d=l.childMenuItems(),h=parseInt(l.menuItemDepth(),10)+1,p=m.prev(),f=parseInt(p.menuItemDepth(),10),v=p.getItemData()["menu-item-db-id"];switch(t){case"up":if(i=r-1,0===r)break;0==i&&0!==c&&m.moveHorizontally(0,c),0!==f&&m.moveHorizontally(f,c),(o?n=m.add(o):m).detach().insertBefore(a.eq(i)).updateParentMenuItemDBId();break;case"down":if(o){if(n=m.add(o),(d=0!==(l=a.eq(n.length+r)).childMenuItems().length)&&(i=parseInt(l.menuItemDepth(),10)+1,m.moveHorizontally(i,c)),s===r+n.length)break;n.detach().insertAfter(a.eq(r+n.length)).updateParentMenuItemDBId()}else{if(0!==d.length&&m.moveHorizontally(h,c),s===r+1)break;m.detach().insertAfter(a.eq(r+1)).updateParentMenuItemDBId()}break;case"top":if(0===r)break;(o?n=m.add(o):m).detach().insertBefore(a.eq(0)).updateParentMenuItemDBId();break;case"left":if(0===c)break;m.shiftHorizontally(-1);break;case"right":if(0===r)break;if(u["menu-item-parent-id"]===v)break;m.shiftHorizontally(1)}e.trigger("focus"),k.registerChange(),k.refreshKeyboardAccessibility(),k.refreshAdvancedAccessibility()},initAccessibility:function(){var e=I("#menu-to-edit");k.refreshKeyboardAccessibility(),k.refreshAdvancedAccessibility(),e.on("mouseenter.refreshAccessibility focus.refreshAccessibility touchstart.refreshAccessibility",".menu-item",function(){k.refreshAdvancedAccessibilityOfItem(I(this).find("a.item-edit"))}),e.on("click","a.item-edit",function(){k.refreshAdvancedAccessibilityOfItem(I(this))}),e.on("click",".menus-move",function(){var e=I(this).data("dir");void 0!==e&&k.moveMenuItem(I(this).parents("li.menu-item").find("a.item-edit"),e)})},refreshAdvancedAccessibilityOfItem:function(e){var t,n,i,a,s,m,o,u,c,r,l,d,h;!0===I(e).data("needs_accessibility_refresh")&&(u=0===(o=(m=(s=I(e)).closest("li.menu-item").first()).menuItemDepth()),c=s.closest(".menu-item-handle").find(".menu-item-title").text(),r=parseInt(m.index(),10),h=u?o:parseInt(o-1,10),l=m.prevAll(".menu-item-depth-"+h).first().find(".menu-item-title").text(),d=m.prevAll(".menu-item-depth-"+o).first().find(".menu-item-title").text(),e=I("#menu-to-edit li").length,h=m.nextAll(".menu-item-depth-"+o).length,m.find(".field-move").toggle(1k.options.globalMaxDepth?k.options.globalMaxDepth:e:0}function b(e,t){e.placeholder.updateDepthClass(t,h),h=t}0!==I("#menu-to-edit li").length&&I(".drag-instructions").show(),p+=k.isRTL?k.menuList.width():0,k.menuList.sortable({handle:".menu-item-handle",placeholder:"sortable-placeholder",items:k.options.sortableItems,start:function(e,t){var n,i;k.isRTL&&(t.item[0].style.right="auto"),l=t.item.children(".menu-item-transport"),s=t.item.menuItemDepth(),b(t,s),i=(t.item.next()[0]==t.placeholder[0]?t.item.next():t.item).childMenuItems(),l.append(i),n=l.outerHeight(),n+=0c&&(o.after(t.placeholder),g(t),I(this).sortable("refreshPositions"))}})},initManageLocations:function(){I("#menu-locations-wrap form").on("submit",function(){window.onbeforeunload=null}),I(".menu-location-menus select").on("change",function(){var e=I(this).closest("tr").find(".locations-edit-menu-link");I(this).find("option:selected").data("orig")?e.show():e.hide()})},attachMenuEditListeners:function(){var t=this;I("#update-nav-menu").on("click",function(e){if(e.target&&e.target.className)return-1!=e.target.className.indexOf("item-edit")?t.eventOnClickEditLink(e.target):-1!=e.target.className.indexOf("menu-save")?t.eventOnClickMenuSave(e.target):-1!=e.target.className.indexOf("menu-delete")?t.eventOnClickMenuDelete(e.target):-1!=e.target.className.indexOf("item-delete")?t.eventOnClickMenuItemDelete(e.target):-1!=e.target.className.indexOf("item-cancel")?t.eventOnClickCancelLink(e.target):void 0}),I("#menu-name").on("input",_.debounce(function(){var e=I(document.getElementById("menu-name")),t=e.val();t&&t.replace(/\s+/,"")?e.parent().removeClass("form-invalid"):e.parent().addClass("form-invalid")},500)),I('#add-custom-links input[type="text"]').on("keypress",function(e){I("#customlinkdiv").removeClass("form-invalid"),13===e.keyCode&&(e.preventDefault(),I("#submit-customlinkdiv").click())})},attachMenuSaveSubmitListeners:function(){I("#update-nav-menu").on("submit",function(){var e=I("#update-nav-menu").serializeArray();I('[name="nav-menu-data"]').val(JSON.stringify(e))})},attachThemeLocationsListeners:function(){var e=I("#nav-menu-theme-locations"),t={action:"menu-locations-save"};t["menu-settings-column-nonce"]=I("#menu-settings-column-nonce").val(),e.find('input[type="submit"]').on("click",function(){return e.find("select").each(function(){t[this.name]=I(this).val()}),e.find(".spinner").addClass("is-active"),I.post(ajaxurl,t,function(){e.find(".spinner").removeClass("is-active")}),!1})},attachQuickSearchListeners:function(){var t;I("#nav-menu-meta").on("submit",function(e){e.preventDefault()}),I("#nav-menu-meta").on("input",".quick-search",function(){var e=I(this);e.attr("autocomplete","off"),t&&clearTimeout(t),t=setTimeout(function(){k.updateQuickSearchResults(e)},500)}).on("blur",".quick-search",function(){k.lastSearch=""})},updateQuickSearchResults:function(e){var t,n,i=e.val();i.length<2||k.lastSearch==i||(k.lastSearch=i,t=e.parents(".tabs-panel"),n={action:"menu-quick-search","response-format":"markup",menu:I("#menu").val(),"menu-settings-column-nonce":I("#menu-settings-column-nonce").val(),q:i,type:e.attr("name")},I(".spinner",t).addClass("is-active"),I.post(ajaxurl,n,function(e){k.processQuickSearchQueryResponse(e,n,t)}))},addCustomLink:function(e){var t=I("#custom-menu-item-url").val().toString(),n=I("#custom-menu-item-name").val();if(""!==t&&(t=t.trim()),e=e||k.addMenuItemToBottom,""===t||"https://"==t||"http://"==t)return I("#customlinkdiv").addClass("form-invalid"),!1;I(".customlinkdiv .spinner").addClass("is-active"),this.addLinkToMenu(t,n,e,function(){I(".customlinkdiv .spinner").removeClass("is-active"),I("#custom-menu-item-name").val("").blur(),I("#custom-menu-item-url").val("").attr("placeholder","https://")})},addLinkToMenu:function(e,t,n,i){n=n||k.addMenuItemToBottom,i=i||function(){},k.addItemToMenu({"-1":{"menu-item-type":"custom","menu-item-url":e,"menu-item-title":t}},n,i)},addItemToMenu:function(e,n,i){var a,t=I("#menu").val(),s=I("#menu-settings-column-nonce").val();n=n||function(){},i=i||function(){},a={action:"add-menu-item",menu:t,"menu-settings-column-nonce":s,"menu-item":e},I.post(ajaxurl,a,function(e){var t=I("#menu-instructions");e=(e=e||"").toString().trim(),n(e,a),I("li.pending").hide().fadeIn("slow"),I(".drag-instructions").show(),!t.hasClass("menu-instructions-inactive")&&t.siblings().length&&t.addClass("menu-instructions-inactive"),i()})},addMenuItemToBottom:function(e){e=I(e);e.hideAdvancedMenuItemFields().appendTo(k.targetList),k.refreshKeyboardAccessibility(),k.refreshAdvancedAccessibility(),I(document).trigger("menu-item-added",[e])},addMenuItemToTop:function(e){e=I(e);e.hideAdvancedMenuItemFields().prependTo(k.targetList),k.refreshKeyboardAccessibility(),k.refreshAdvancedAccessibility(),I(document).trigger("menu-item-added",[e])},attachUnsavedChangesListener:function(){I("#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select").on("change",function(){k.registerChange()}),0!==I("#menu-to-edit").length||0!==I(".menu-location-menus select").length?window.onbeforeunload=function(){if(k.menusChanged)return wp.i18n.__("The changes you made will be lost if you navigate away from this page.")}:I("#menu-settings-column").find("input,select").end().find("a").attr("href","#").unbind("click")},registerChange:function(){k.menusChanged=!0},attachTabsPanelListeners:function(){I("#menu-settings-column").on("click",function(e){var t,n,i,a,s=I(e.target);if(s.hasClass("nav-tab-link"))n=s.data("type"),i=s.parents(".accordion-section-content").first(),I("input",i).prop("checked",!1),I(".tabs-panel-active",i).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),I("#"+n,i).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),I(".tabs",i).removeClass("tabs"),s.parent().addClass("tabs"),I(".quick-search",i).trigger("focus"),i.find(".tabs-panel-active .menu-item-title").length?i.removeClass("has-no-menu-item"):i.addClass("has-no-menu-item"),e.preventDefault();else if(s.hasClass("select-all"))(t=s.closest(".button-controls").data("items-type"))&&((a=I("#"+t+" .tabs-panel-active .menu-item-title input")).length!==a.filter(":checked").length||s.is(":checked")?s.is(":checked")&&a.prop("checked",!0):a.prop("checked",!1));else if(s.hasClass("menu-item-checkbox"))(t=s.closest(".tabs-panel-active").parent().attr("id"))&&(a=I("#"+t+" .tabs-panel-active .menu-item-title input"),t=I('.button-controls[data-items-type="'+t+'"] .select-all'),a.length!==a.filter(":checked").length||t.is(":checked")?t.is(":checked")&&t.prop("checked",!1):t.prop("checked",!0));else if(s.hasClass("submit-add-to-menu"))return k.registerChange(),e.target.id&&"submit-customlinkdiv"==e.target.id?k.addCustomLink(k.addMenuItemToBottom):e.target.id&&-1!=e.target.id.indexOf("submit-")&&I("#"+e.target.id.replace(/submit-/,"")).addSelectedToMenu(k.addMenuItemToBottom),!1}),I("#nav-menu-meta").on("click","a.page-numbers",function(){var n=I(this).closest(".inside");return I.post(ajaxurl,this.href.replace(/.*\?/,"").replace(/action=([^&]*)/,"")+"&action=menu-get-metabox",function(e){var t=I.parseJSON(e);-1!==e.indexOf("replace-id")&&(e=document.getElementById(t["replace-id"]),t.markup&&e&&n.html(t.markup))}),!1})},eventOnClickEditLink:function(e){var t,n,e=/#(.*)$/.exec(e.href);if(e&&e[1]&&0!==(n=(t=I("#"+e[1])).parent()).length)return n.hasClass("menu-item-edit-inactive")?(t.data("menu-item-data")||t.data("menu-item-data",t.getItemData()),t.slideDown("fast"),n.removeClass("menu-item-edit-inactive").addClass("menu-item-edit-active")):(t.slideUp("fast"),n.removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive")),!1},eventOnClickCancelLink:function(e){var t=I(e).closest(".menu-item-settings"),e=I(e).closest(".menu-item");return e.removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive"),t.setItemData(t.data("menu-item-data")).hide(),e.find(".menu-item-title").text(t.data("menu-item-data")["menu-item-title"]),!1},eventOnClickMenuSave:function(){var e="",t=I("#menu-name"),n=t.val();return n&&n.replace(/\s+/,"")?(I("#nav-menu-theme-locations select").each(function(){e+=''}),I("#update-nav-menu").append(e),k.menuList.find(".menu-item-data-position").val(function(e){return e+1}),!(window.onbeforeunload=null)):(t.parent().addClass("form-invalid"),!1)},eventOnClickMenuDelete:function(){return!!window.confirm(wp.i18n.__("You are about to permanently delete this menu.\n'Cancel' to stop, 'OK' to delete."))&&!(window.onbeforeunload=null)},eventOnClickMenuItemDelete:function(e){e=parseInt(e.id.replace("delete-",""),10);return k.removeMenuItem(I("#menu-item-"+e)),k.registerChange(),!1},processQuickSearchQueryResponse:function(e,t,n){var i,a,s,m={},o=document.getElementById("nav-menu-meta"),u=/menu-item[(\[^]\]*/,c=I("
").html(e).find("li"),r=n.closest(".accordion-section-content"),e=r.find(".button-controls .select-all");if(!c.length)return I(".categorychecklist",n).html("
  • "+wp.i18n.__("No results found.")+"

  • "),I(".spinner",n).removeClass("is-active"),void r.addClass("has-no-menu-item");c.each(function(){if(s=I(this),(i=u.exec(s.html()))&&i[1]){for(a=i[1];o.elements["menu-item["+a+"][menu-item-type]"]||m[a];)a--;m[a]=!0,a!=i[1]&&s.html(s.html().replace(new RegExp("menu-item\\["+i[1]+"\\]","g"),"menu-item["+a+"]"))}}),I(".categorychecklist",n).html(c),I(".spinner",n).removeClass("is-active"),r.removeClass("has-no-menu-item"),e.is(":checked")&&e.prop("checked",!1)},removeMenuItem:function(t){var n=t.childMenuItems();I(document).trigger("menu-removing-item",[t]),t.addClass("deleting").animate({opacity:0,height:0},350,function(){var e=I("#menu-instructions");t.remove(),n.shiftDepthClass(-1).updateParentMenuItemDBId(),0===I("#menu-to-edit li").length&&(I(".drag-instructions").hide(),e.removeClass("menu-instructions-inactive")),k.refreshAdvancedAccessibility()})},depthToPx:function(e){return e*k.options.menuItemDepthPerLevel},pxToDepth:function(e){return Math.floor(e/k.options.menuItemDepthPerLevel)}};I(document).ready(function(){wpNavMenu.init(),I(".menu-edit a, .menu-edit button, .menu-edit input, .menu-edit textarea, .menu-edit select").on("focus",function(){var e,t,n;783<=window.innerWidth&&(e=I("#nav-menu-footer").height()+20,0<(t=I(this).offset().top-(I(window).scrollTop()+I(window).height()-I(this).height()))&&(t=0),(t*=-1) *",targetTolerance:0},menuList:void 0,targetList:void 0,menusChanged:!1,isRTL:!("undefined"==typeof isRtl||!isRtl),negateIfRTL:"undefined"!=typeof isRtl&&isRtl?-1:1,lastSearch:"",init:function(){k.menuList=I("#menu-to-edit"),k.targetList=k.menuList,this.jQueryExtensions(),this.attachMenuEditListeners(),this.attachQuickSearchListeners(),this.attachThemeLocationsListeners(),this.attachMenuSaveSubmitListeners(),this.attachTabsPanelListeners(),this.attachUnsavedChangesListener(),k.menuList.length&&this.initSortables(),menus.oneThemeLocationNoMenus&&I("#posttype-page").addSelectedToMenu(k.addMenuItemToBottom),this.initManageLocations(),this.initAccessibility(),this.initToggles(),this.initPreviewing()},jQueryExtensions:function(){I.fn.extend({menuItemDepth:function(){var e=k.isRTL?this.eq(0).css("margin-right"):this.eq(0).css("margin-left");return k.pxToDepth(e&&-1!=e.indexOf("px")?e.slice(0,-2):0)},updateDepthClass:function(t,n){return this.each(function(){var e=I(this);n=n||e.menuItemDepth(),I(this).removeClass("menu-item-depth-"+n).addClass("menu-item-depth-"+t)})},shiftDepthClass:function(i){return this.each(function(){var e=I(this),t=e.menuItemDepth(),n=t+i;e.removeClass("menu-item-depth-"+t).addClass("menu-item-depth-"+n),0===n&&e.find(".is-submenu").hide()})},childMenuItems:function(){var i=I();return this.each(function(){for(var e=I(this),t=e.menuItemDepth(),n=e.next(".menu-item");n.length&&n.menuItemDepth()>t;)i=i.add(n),n=n.next(".menu-item")}),i},shiftHorizontally:function(i){return this.each(function(){var e=I(this),t=e.menuItemDepth(),n=t+i;e.moveHorizontally(n,t)})},moveHorizontally:function(a,s){return this.each(function(){var e=I(this),t=e.childMenuItems(),i=a-s,n=e.find(".is-submenu");e.updateDepthClass(a,s).updateParentMenuItemDBId(),t&&t.each(function(){var e=I(this),t=e.menuItemDepth(),n=t+i;e.updateDepthClass(n,t).updateParentMenuItemDBId()}),0===a?n.hide():n.show()})},updateParentMenuItemDBId:function(){return this.each(function(){var e=I(this),t=e.find(".menu-item-data-parent-id"),n=parseInt(e.menuItemDepth(),10),i=n-1,i=e.prevAll(".menu-item-depth-"+i).first();0===n?t.val(0):t.val(i.find(".menu-item-data-db-id").val())})},hideAdvancedMenuItemFields:function(){return this.each(function(){var e=I(this);I(".hide-column-tog").not(":checked").each(function(){e.find(".field-"+I(this).val()).addClass("hidden-field")})})},addSelectedToMenu:function(a){return 0!==I("#menu-to-edit").length&&this.each(function(){var e=I(this),n={},t=menus.oneThemeLocationNoMenus&&0===e.find(".tabs-panel-active .categorychecklist li input:checked").length?e.find('#page-all li input[type="checkbox"]'):e.find(".tabs-panel-active .categorychecklist li input:checked"),i=/menu-item\[([^\]]*)/;if(a=a||k.addMenuItemToBottom,!t.length)return!1;e.find(".button-controls .spinner").addClass("is-active"),I(t).each(function(){var e=I(this),t=i.exec(e.attr("name")),t=void 0===t[1]?0:parseInt(t[1],10);this.className&&-1!=this.className.indexOf("add-to-top")&&(a=k.addMenuItemToTop),n[t]=e.closest("li").getItemData("add-menu-item",t)}),k.addItemToMenu(n,a,function(){t.prop("checked",!1),e.find(".button-controls .select-all").prop("checked",!1),e.find(".button-controls .spinner").removeClass("is-active")})})},getItemData:function(t,n){t=t||"menu-item";var i,a={},s=["menu-item-db-id","menu-item-object-id","menu-item-object","menu-item-parent-id","menu-item-position","menu-item-type","menu-item-title","menu-item-url","menu-item-description","menu-item-attr-title","menu-item-target","menu-item-classes","menu-item-xfn"];return(n=n||"menu-item"!=t?n:this.find(".menu-item-data-db-id").val())&&this.find("input").each(function(){var e;for(i=s.length;i--;)"menu-item"==t?e=s[i]+"["+n+"]":"add-menu-item"==t&&(e="menu-item["+n+"]["+s[i]+"]"),this.name&&e==this.name&&(a[s[i]]=this.value)}),a},setItemData:function(e,a,s){return a=a||"menu-item",(s=s||"menu-item"!=a?s:I(".menu-item-data-db-id",this).val())&&this.find("input").each(function(){var n,i=I(this);I.each(e,function(e,t){"menu-item"==a?n=e+"["+s+"]":"add-menu-item"==a&&(n="menu-item["+s+"]["+e+"]"),n==i.attr("name")&&i.val(t)})}),this}})},countMenuItems:function(e){return I(".menu-item-depth-"+e).length},moveMenuItem:function(e,t){var n,i,a=I("#menu-to-edit li"),s=a.length,m=e.parents("li.menu-item"),o=m.childMenuItems(),u=m.getItemData(),r=parseInt(m.menuItemDepth(),10),c=parseInt(m.index(),10),l=m.next(),d=l.childMenuItems(),h=parseInt(l.menuItemDepth(),10)+1,f=m.prev(),p=parseInt(f.menuItemDepth(),10),v=f.getItemData()["menu-item-db-id"];switch(t){case"up":if(i=c-1,0===c)break;0==i&&0!==r&&m.moveHorizontally(0,r),0!==p&&m.moveHorizontally(p,r),(o?n=m.add(o):m).detach().insertBefore(a.eq(i)).updateParentMenuItemDBId();break;case"down":if(o){if(n=m.add(o),(d=0!==(l=a.eq(n.length+c)).childMenuItems().length)&&(i=parseInt(l.menuItemDepth(),10)+1,m.moveHorizontally(i,r)),s===c+n.length)break;n.detach().insertAfter(a.eq(c+n.length)).updateParentMenuItemDBId()}else{if(0!==d.length&&m.moveHorizontally(h,r),s===c+1)break;m.detach().insertAfter(a.eq(c+1)).updateParentMenuItemDBId()}break;case"top":if(0===c)break;(o?n=m.add(o):m).detach().insertBefore(a.eq(0)).updateParentMenuItemDBId();break;case"left":if(0===r)break;m.shiftHorizontally(-1);break;case"right":if(0===c)break;if(u["menu-item-parent-id"]===v)break;m.shiftHorizontally(1)}e.trigger("focus"),k.registerChange(),k.refreshKeyboardAccessibility(),k.refreshAdvancedAccessibility()},initAccessibility:function(){var e=I("#menu-to-edit");k.refreshKeyboardAccessibility(),k.refreshAdvancedAccessibility(),e.on("mouseenter.refreshAccessibility focus.refreshAccessibility touchstart.refreshAccessibility",".menu-item",function(){k.refreshAdvancedAccessibilityOfItem(I(this).find("a.item-edit"))}),e.on("click","a.item-edit",function(){k.refreshAdvancedAccessibilityOfItem(I(this))}),e.on("click",".menus-move",function(){var e=I(this).data("dir");void 0!==e&&k.moveMenuItem(I(this).parents("li.menu-item").find("a.item-edit"),e)})},refreshAdvancedAccessibilityOfItem:function(e){var t,n,i,a,s,m,o,u,r,c,l,d,h;!0===I(e).data("needs_accessibility_refresh")&&(u=0===(o=(m=(s=I(e)).closest("li.menu-item").first()).menuItemDepth()),r=s.closest(".menu-item-handle").find(".menu-item-title").text(),c=parseInt(m.index(),10),h=u?o:parseInt(o-1,10),l=m.prevAll(".menu-item-depth-"+h).first().find(".menu-item-title").text(),d=m.prevAll(".menu-item-depth-"+o).first().find(".menu-item-title").text(),e=I("#menu-to-edit li").length,h=m.nextAll(".menu-item-depth-"+o).length,m.find(".field-move").toggle(1k.options.globalMaxDepth?k.options.globalMaxDepth:e:0}function b(e,t){e.placeholder.updateDepthClass(t,h),h=t}0!==I("#menu-to-edit li").length&&I(".drag-instructions").show(),f+=k.isRTL?k.menuList.width():0,k.menuList.sortable({handle:".menu-item-handle",placeholder:"sortable-placeholder",items:k.options.sortableItems,start:function(e,t){var n,i;k.isRTL&&(t.item[0].style.right="auto"),l=t.item.children(".menu-item-transport"),s=t.item.menuItemDepth(),b(t,s),i=(t.item.next()[0]==t.placeholder[0]?t.item.next():t.item).childMenuItems(),l.append(i),n=l.outerHeight(),n+=0r&&(o.after(t.placeholder),g(t),I(this).sortable("refreshPositions"))}})},initManageLocations:function(){I("#menu-locations-wrap form").on("submit",function(){window.onbeforeunload=null}),I(".menu-location-menus select").on("change",function(){var e=I(this).closest("tr").find(".locations-edit-menu-link");I(this).find("option:selected").data("orig")?e.show():e.hide()})},attachMenuEditListeners:function(){var t=this;I("#update-nav-menu").on("click",function(e){if(e.target&&e.target.className)return-1!=e.target.className.indexOf("item-edit")?t.eventOnClickEditLink(e.target):-1!=e.target.className.indexOf("menu-save")?t.eventOnClickMenuSave(e.target):-1!=e.target.className.indexOf("menu-delete")?t.eventOnClickMenuDelete(e.target):-1!=e.target.className.indexOf("item-delete")?t.eventOnClickMenuItemDelete(e.target):-1!=e.target.className.indexOf("item-cancel")?t.eventOnClickCancelLink(e.target):void 0}),I("#menu-name").on("input",_.debounce(function(){var e=I(document.getElementById("menu-name")),t=e.val();t&&t.replace(/\s+/,"")?e.parent().removeClass("form-invalid"):e.parent().addClass("form-invalid")},500)),I('#add-custom-links input[type="text"]').on("keypress",function(e){I("#customlinkdiv").removeClass("form-invalid"),13===e.keyCode&&(e.preventDefault(),I("#submit-customlinkdiv").trigger("click"))})},attachMenuSaveSubmitListeners:function(){I("#update-nav-menu").on("submit",function(){var e=I("#update-nav-menu").serializeArray();I('[name="nav-menu-data"]').val(JSON.stringify(e))})},attachThemeLocationsListeners:function(){var e=I("#nav-menu-theme-locations"),t={action:"menu-locations-save"};t["menu-settings-column-nonce"]=I("#menu-settings-column-nonce").val(),e.find('input[type="submit"]').on("click",function(){return e.find("select").each(function(){t[this.name]=I(this).val()}),e.find(".spinner").addClass("is-active"),I.post(ajaxurl,t,function(){e.find(".spinner").removeClass("is-active")}),!1})},attachQuickSearchListeners:function(){var t;I("#nav-menu-meta").on("submit",function(e){e.preventDefault()}),I("#nav-menu-meta").on("input",".quick-search",function(){var e=I(this);e.attr("autocomplete","off"),t&&clearTimeout(t),t=setTimeout(function(){k.updateQuickSearchResults(e)},500)}).on("blur",".quick-search",function(){k.lastSearch=""})},updateQuickSearchResults:function(e){var t,n,i=e.val();i.length<2||k.lastSearch==i||(k.lastSearch=i,t=e.parents(".tabs-panel"),n={action:"menu-quick-search","response-format":"markup",menu:I("#menu").val(),"menu-settings-column-nonce":I("#menu-settings-column-nonce").val(),q:i,type:e.attr("name")},I(".spinner",t).addClass("is-active"),I.post(ajaxurl,n,function(e){k.processQuickSearchQueryResponse(e,n,t)}))},addCustomLink:function(e){var t=I("#custom-menu-item-url").val().toString(),n=I("#custom-menu-item-name").val();if(""!==t&&(t=t.trim()),e=e||k.addMenuItemToBottom,""===t||"https://"==t||"http://"==t)return I("#customlinkdiv").addClass("form-invalid"),!1;I(".customlinkdiv .spinner").addClass("is-active"),this.addLinkToMenu(t,n,e,function(){I(".customlinkdiv .spinner").removeClass("is-active"),I("#custom-menu-item-name").val("").trigger("blur"),I("#custom-menu-item-url").val("").attr("placeholder","https://")})},addLinkToMenu:function(e,t,n,i){n=n||k.addMenuItemToBottom,i=i||function(){},k.addItemToMenu({"-1":{"menu-item-type":"custom","menu-item-url":e,"menu-item-title":t}},n,i)},addItemToMenu:function(e,n,i){var a,t=I("#menu").val(),s=I("#menu-settings-column-nonce").val();n=n||function(){},i=i||function(){},a={action:"add-menu-item",menu:t,"menu-settings-column-nonce":s,"menu-item":e},I.post(ajaxurl,a,function(e){var t=I("#menu-instructions");e=(e=e||"").toString().trim(),n(e,a),I("li.pending").hide().fadeIn("slow"),I(".drag-instructions").show(),!t.hasClass("menu-instructions-inactive")&&t.siblings().length&&t.addClass("menu-instructions-inactive"),i()})},addMenuItemToBottom:function(e){e=I(e);e.hideAdvancedMenuItemFields().appendTo(k.targetList),k.refreshKeyboardAccessibility(),k.refreshAdvancedAccessibility(),I(document).trigger("menu-item-added",[e])},addMenuItemToTop:function(e){e=I(e);e.hideAdvancedMenuItemFields().prependTo(k.targetList),k.refreshKeyboardAccessibility(),k.refreshAdvancedAccessibility(),I(document).trigger("menu-item-added",[e])},attachUnsavedChangesListener:function(){I("#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select").on("change",function(){k.registerChange()}),0!==I("#menu-to-edit").length||0!==I(".menu-location-menus select").length?window.onbeforeunload=function(){if(k.menusChanged)return wp.i18n.__("The changes you made will be lost if you navigate away from this page.")}:I("#menu-settings-column").find("input,select").end().find("a").attr("href","#").off("click")},registerChange:function(){k.menusChanged=!0},attachTabsPanelListeners:function(){I("#menu-settings-column").on("click",function(e){var t,n,i,a,s=I(e.target);if(s.hasClass("nav-tab-link"))n=s.data("type"),i=s.parents(".accordion-section-content").first(),I("input",i).prop("checked",!1),I(".tabs-panel-active",i).removeClass("tabs-panel-active").addClass("tabs-panel-inactive"),I("#"+n,i).removeClass("tabs-panel-inactive").addClass("tabs-panel-active"),I(".tabs",i).removeClass("tabs"),s.parent().addClass("tabs"),I(".quick-search",i).trigger("focus"),i.find(".tabs-panel-active .menu-item-title").length?i.removeClass("has-no-menu-item"):i.addClass("has-no-menu-item"),e.preventDefault();else if(s.hasClass("select-all"))(t=s.closest(".button-controls").data("items-type"))&&((a=I("#"+t+" .tabs-panel-active .menu-item-title input")).length!==a.filter(":checked").length||s.is(":checked")?s.is(":checked")&&a.prop("checked",!0):a.prop("checked",!1));else if(s.hasClass("menu-item-checkbox"))(t=s.closest(".tabs-panel-active").parent().attr("id"))&&(a=I("#"+t+" .tabs-panel-active .menu-item-title input"),t=I('.button-controls[data-items-type="'+t+'"] .select-all'),a.length!==a.filter(":checked").length||t.is(":checked")?t.is(":checked")&&t.prop("checked",!1):t.prop("checked",!0));else if(s.hasClass("submit-add-to-menu"))return k.registerChange(),e.target.id&&"submit-customlinkdiv"==e.target.id?k.addCustomLink(k.addMenuItemToBottom):e.target.id&&-1!=e.target.id.indexOf("submit-")&&I("#"+e.target.id.replace(/submit-/,"")).addSelectedToMenu(k.addMenuItemToBottom),!1}),I("#nav-menu-meta").on("click","a.page-numbers",function(){var n=I(this).closest(".inside");return I.post(ajaxurl,this.href.replace(/.*\?/,"").replace(/action=([^&]*)/,"")+"&action=menu-get-metabox",function(e){var t=JSON.parse(e);-1!==e.indexOf("replace-id")&&(e=document.getElementById(t["replace-id"]),t.markup&&e&&n.html(t.markup))}),!1})},eventOnClickEditLink:function(e){var t,n,e=/#(.*)$/.exec(e.href);if(e&&e[1]&&0!==(n=(t=I("#"+e[1])).parent()).length)return n.hasClass("menu-item-edit-inactive")?(t.data("menu-item-data")||t.data("menu-item-data",t.getItemData()),t.slideDown("fast"),n.removeClass("menu-item-edit-inactive").addClass("menu-item-edit-active")):(t.slideUp("fast"),n.removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive")),!1},eventOnClickCancelLink:function(e){var t=I(e).closest(".menu-item-settings"),e=I(e).closest(".menu-item");return e.removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive"),t.setItemData(t.data("menu-item-data")).hide(),e.find(".menu-item-title").text(t.data("menu-item-data")["menu-item-title"]),!1},eventOnClickMenuSave:function(){var e="",t=I("#menu-name"),n=t.val();return n&&n.replace(/\s+/,"")?(I("#nav-menu-theme-locations select").each(function(){e+=''}),I("#update-nav-menu").append(e),k.menuList.find(".menu-item-data-position").val(function(e){return e+1}),!(window.onbeforeunload=null)):(t.parent().addClass("form-invalid"),!1)},eventOnClickMenuDelete:function(){return!!window.confirm(wp.i18n.__("You are about to permanently delete this menu.\n'Cancel' to stop, 'OK' to delete."))&&!(window.onbeforeunload=null)},eventOnClickMenuItemDelete:function(e){e=parseInt(e.id.replace("delete-",""),10);return k.removeMenuItem(I("#menu-item-"+e)),k.registerChange(),!1},processQuickSearchQueryResponse:function(e,t,n){var i,a,s,m={},o=document.getElementById("nav-menu-meta"),u=/menu-item[(\[^]\]*/,r=I("
    ").html(e).find("li"),c=n.closest(".accordion-section-content"),e=c.find(".button-controls .select-all");if(!r.length)return I(".categorychecklist",n).html("
  • "+wp.i18n.__("No results found.")+"

  • "),I(".spinner",n).removeClass("is-active"),void c.addClass("has-no-menu-item");r.each(function(){if(s=I(this),(i=u.exec(s.html()))&&i[1]){for(a=i[1];o.elements["menu-item["+a+"][menu-item-type]"]||m[a];)a--;m[a]=!0,a!=i[1]&&s.html(s.html().replace(new RegExp("menu-item\\["+i[1]+"\\]","g"),"menu-item["+a+"]"))}}),I(".categorychecklist",n).html(r),I(".spinner",n).removeClass("is-active"),c.removeClass("has-no-menu-item"),e.is(":checked")&&e.prop("checked",!1)},removeMenuItem:function(t){var n=t.childMenuItems();I(document).trigger("menu-removing-item",[t]),t.addClass("deleting").animate({opacity:0,height:0},350,function(){var e=I("#menu-instructions");t.remove(),n.shiftDepthClass(-1).updateParentMenuItemDBId(),0===I("#menu-to-edit li").length&&(I(".drag-instructions").hide(),e.removeClass("menu-instructions-inactive")),k.refreshAdvancedAccessibility()})},depthToPx:function(e){return e*k.options.menuItemDepthPerLevel},pxToDepth:function(e){return Math.floor(e/k.options.menuItemDepthPerLevel)}};I(document).ready(function(){wpNavMenu.init(),I(".menu-edit a, .menu-edit button, .menu-edit input, .menu-edit textarea, .menu-edit select").on("focus",function(){var e,t,n;783<=window.innerWidth&&(e=I("#nav-menu-footer").height()+20,0<(t=I(this).offset().top-(I(window).scrollTop()+I(window).height()-I(this).height()))&&(t=0),(t*=-1) commentsBox.total ) @@ -414,7 +414,7 @@ jQuery(document).ready( function($) { } $previewField.val('dopreview'); - $form.attr( 'target', target ).submit().attr( 'target', '' ); + $form.attr( 'target', target ).trigger( 'submit' ).attr( 'target', '' ); // Workaround for WebKit bug preventing a form submitting twice to the same action. // https://bugs.webkit.org/show_bug.cgi?id=28633 @@ -448,7 +448,7 @@ jQuery(document).ready( function($) { // Auto save new posts after a title is typed. if ( $( '#auto_draft' ).val() ) { - $( '#title' ).blur( function() { + $( '#title' ).on( 'blur', function() { var cancel; if ( ! this.value || $('#edit-slug-box > *').length ) { @@ -592,7 +592,7 @@ jQuery(document).ready( function($) { }); if ( getUserSetting( settingName ) ) - $('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs').click(); + $('a[href="#' + taxonomy + '-pop"]', '#' + taxonomy + '-tabs').trigger( 'click' ); // Add category button controls. $('#new' + taxonomy).one( 'focus', function() { @@ -600,10 +600,10 @@ jQuery(document).ready( function($) { }); // On [Enter] submit the taxonomy. - $('#new' + taxonomy).keypress( function(event){ + $('#new' + taxonomy).on( 'keypress', function(event){ if( 13 === event.keyCode ) { event.preventDefault(); - $('#' + taxonomy + '-add-submit').click(); + $('#' + taxonomy + '-add-submit').trigger( 'click' ); } }); @@ -1001,7 +1001,7 @@ jQuery(document).ready( function($) { var new_slug = $el.children( 'input' ).val(); if ( new_slug == $('#editable-post-name-full').text() ) { - buttons.children('.cancel').click(); + buttons.children('.cancel').trigger( 'click' ); return; } @@ -1054,11 +1054,11 @@ jQuery(document).ready( function($) { // On [Enter], just save the new slug, don't save the post. if ( 13 === key ) { e.preventDefault(); - buttons.children( '.save' ).click(); + buttons.children( '.save' ).trigger( 'click' ); } // On [Esc] cancel the editing. if ( 27 === key ) { - buttons.children( '.cancel' ).click(); + buttons.children( '.cancel' ).trigger( 'click' ); } } ).on( 'keyup', function() { real_slug.val( this.value ); @@ -1177,7 +1177,7 @@ jQuery(document).ready( function($) { } else { mce = false; offset = $textarea.height() - event.pageY; - $textarea.blur(); + $textarea.trigger( 'blur' ); } $document.on( 'mousemove.wp-editor-resize', dragging ) @@ -1261,7 +1261,7 @@ jQuery(document).ready( function($) { // Clear the selection and move focus back to the trigger. event.clearSelection(); // Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680 - triggerElement.focus(); + triggerElement.trigger( 'focus' ); // Show success visual feedback. clearTimeout( copyAttachmentURLSuccessTimeout ); diff --git a/wp-admin/js/post.min.js b/wp-admin/js/post.min.js index ca230d07fc..c826b82bd2 100644 --- a/wp-admin/js/post.min.js +++ b/wp-admin/js/post.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -window.makeSlugeditClickable=window.editPermalink=function(){},window.wp=window.wp||{},function(s){var t=!1,a=wp.i18n.__;window.commentsBox={st:0,get:function(t,e){var i=this.st;return e=e||20,this.st+=e,this.total=t,s("#commentsdiv .spinner").addClass("is-active"),e={action:"get-comments",mode:"single",_ajax_nonce:s("#add_comment_nonce").val(),p:s("#post_ID").val(),start:i,number:e},s.post(ajaxurl,e,function(t){return t=wpAjax.parseAjaxResponse(t),s("#commentsdiv .widefat").show(),s("#commentsdiv .spinner").removeClass("is-active"),"object"==typeof t&&t.responses[0]?(s("#the-comment-list").append(t.responses[0].data),theList=theExtraList=null,s("a[className*=':']").unbind(),void(commentsBox.st>commentsBox.total?s("#show-comments").hide():s("#show-comments").show().children("a").text(a("Show more comments")))):void(1!=t?s("#the-comment-list").append(''+wpAjax.broken+""):s("#show-comments").text(a("No more comments found.")))}),!1},load:function(t){this.st=jQuery("#the-comment-list tr.comment:visible").length,this.get(t)}},window.WPSetThumbnailHTML=function(t){s(".inside","#postimagediv").html(t)},window.WPSetThumbnailID=function(t){var e=s('input[value="_thumbnail_id"]',"#list-table");0",{class:"avatar avatar-64 photo",width:64,height:64,alt:"",src:i.lock_error.avatar_src,srcset:i.lock_error.avatar_src_2x?i.lock_error.avatar_src_2x+" 2x":void 0}),a.find("div.post-locked-avatar").empty().append(e)),a.show().find(".currently-editing").text(i.lock_error.text),a.find(".wp-tab-first").trigger("focus")):i.new_lock&&s("#active_post_lock").val(i.new_lock))}).on("before-autosave.update-post-slug",function(){t=document.activeElement&&"title"===document.activeElement.id}).on("after-autosave.update-post-slug",function(){s("#edit-slug-box > *").length||t||s.post(ajaxurl,{action:"sample-permalink",post_id:s("#post_ID").val(),new_title:s("#title").val(),samplepermalinknonce:s("#samplepermalinknonce").val()},function(t){"-1"!=t&&s("#edit-slug-box").html(t)})})}(jQuery),function(n){var s,t;function i(){s=!1,window.clearTimeout(t),t=window.setTimeout(function(){s=!0},3e5)}n(document).on("heartbeat-send.wp-refresh-nonces",function(t,e){var i,a=n("#wp-auth-check-wrap");(s||a.length&&!a.hasClass("hidden"))&&(i=n("#post_ID").val())&&n("#_wpnonce").val()&&(e["wp-refresh-post-nonces"]={post_id:i})}).on("heartbeat-tick.wp-refresh-nonces",function(t,e){e=e["wp-refresh-post-nonces"];e&&(i(),e.replace&&n.each(e.replace,function(t,e){n("#"+t).val(e)}),e.heartbeatNonce&&(window.heartbeatSettings.nonce=e.heartbeatNonce))}).ready(function(){i()})}(jQuery),jQuery(document).ready(function(u){var p,e,i,a,n,s,o,l,r,t,c,d,h=u("#content"),f=u(document),v=u("#post_ID").val()||0,m=u("#submitpost"),w=!0,g=u("#post-visibility-select"),b=u("#timestampdiv"),k=u("#post-status-select"),_=!!window.navigator.platform&&-1!==window.navigator.platform.indexOf("Mac"),y=new ClipboardJS(".copy-attachment-url.edit-media"),x=wp.i18n.__,C=wp.i18n._x;function D(t){c.hasClass("wp-editor-expand")||(r?o.theme.resizeTo(null,l+t.pageY):h.height(Math.max(50,l+t.pageY)),t.preventDefault())}function j(){var t;c.hasClass("wp-editor-expand")||(t=r?(o.focus(),((t=parseInt(u("#wp-content-editor-container .mce-toolbar-grp").height(),10))<10||200 *").length&&(u("form#post").one("submit",function(){t=!0}),window.setTimeout(function(){!t&&wp.autosave&&wp.autosave.server.triggerSave()},200))}),f.on("autosave-disable-buttons.edit-post",function(){i.addClass("disabled")}).on("autosave-enable-buttons.edit-post",function(){wp.heartbeat&&wp.heartbeat.hasConnectionError()||i.removeClass("disabled")}).on("before-autosave.edit-post",function(){u(".autosave-message").text(x("Saving Draft\u2026"))}).on("after-autosave.edit-post",function(t,e){u(".autosave-message").text(e.message),u(document.body).hasClass("post-new-php")&&u(".submitbox .submitdelete").show()}),u(window).on("beforeunload.edit-post",function(t){var e=window.tinymce&&window.tinymce.get("content"),i=!1;if(wp.autosave?i=wp.autosave.server.postChanged():e&&(i=!e.isHidden()&&e.isDirty()),i)return t.preventDefault(),x("The changes you made will be lost if you navigate away from this page.")}).on("unload.edit-post",function(t){if(w&&(!t.target||"#document"==t.target.nodeName)){var e=u("#post_ID").val(),t=u("#active_post_lock").val();if(e&&t){t={action:"wp-remove-post-lock",_wpnonce:u("#_wpnonce").val(),post_ID:e,active_post_lock:t};if(window.FormData&&window.navigator.sendBeacon){var i=new window.FormData;if(u.each(t,function(t,e){i.append(t,e)}),window.navigator.sendBeacon(ajaxurl,i))return}u.post({async:!1,data:t,url:ajaxurl})}}}),u("#tagsdiv-post_tag").length?window.tagBox&&window.tagBox.init():u(".meta-box-sortables").children("div.postbox").each(function(){if(0===this.id.indexOf("tagsdiv-"))return window.tagBox&&window.tagBox.init(),!1}),u(".categorydiv").each(function(){var t,n,e,i=u(this).attr("id").split("-");i.shift(),n=i.join("-"),e="category"==n?"cats":n+"_tab",u("a","#"+n+"-tabs").on("click",function(t){t.preventDefault();t=u(this).attr("href");u(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),u("#"+n+"-tabs").siblings(".tabs-panel").hide(),u(t).show(),"#"+n+"-all"==t?deleteUserSetting(e):setUserSetting(e,"pop")}),getUserSetting(e)&&u('a[href="#'+n+'-pop"]',"#"+n+"-tabs").click(),u("#new"+n).one("focus",function(){u(this).val("").removeClass("form-input-tip")}),u("#new"+n).keypress(function(t){13===t.keyCode&&(t.preventDefault(),u("#"+n+"-add-submit").click())}),u("#"+n+"-add-submit").on("click",function(){u("#new"+n).trigger("focus")}),t=function(t){return!!u("#new"+n).val()&&(t.data+="&"+u(":checked","#"+n+"checklist").serialize(),u("#"+n+"-add-submit").prop("disabled",!0),t)},i=function(t,e){var i,a=u("#new"+n+"_parent");u("#"+n+"-add-submit").prop("disabled",!1),"undefined"!=e.parsed.responses[0]&&(i=e.parsed.responses[0].supplemental.newcat_parent)&&(a.before(i),a.remove())},u("#"+n+"checklist").wpList({alt:"",response:n+"-ajax-response",addBefore:t,addAfter:i}),u("#"+n+"-add-toggle").on("click",function(t){t.preventDefault(),u("#"+n+"-adder").toggleClass("wp-hidden-children"),u('a[href="#'+n+'-all"]',"#"+n+"-tabs").click(),u("#new"+n).trigger("focus")}),u("#"+n+"checklist, #"+n+"checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var t=u(this),e=t.is(":checked"),i=t.val();i&&t.parents("#taxonomy-"+n).length&&u("#in-"+n+"-"+i+", #in-popular-"+n+"-"+i).prop("checked",e)})}),u("#postcustom").length&&u("#the-list").wpList({addBefore:function(t){return t.data+="&post_id="+u("#post_ID").val(),t},addAfter:function(){u("table#list-table").show()}}),u("#submitdiv").length&&(p=u("#timestamp").html(),e=u("#post-visibility-display").html(),a=function(){"public"!=g.find("input:radio:checked").val()?(u("#sticky").prop("checked",!1),u("#sticky-span").hide()):u("#sticky-span").show(),"password"!=g.find("input:radio:checked").val()?u("#password-span").hide():u("#password-span").show()},n=function(){if(!b.length)return!0;var t,e=u("#post_status"),i=u('option[value="publish"]',e),a=u("#aa").val(),n=u("#mm").val(),s=u("#jj").val(),o=u("#hh").val(),l=u("#mn").val(),r=new Date(a,n-1,s,o,l),c=new Date(u("#hidden_aa").val(),u("#hidden_mm").val()-1,u("#hidden_jj").val(),u("#hidden_hh").val(),u("#hidden_mn").val()),d=new Date(u("#cur_aa").val(),u("#cur_mm").val()-1,u("#cur_jj").val(),u("#cur_hh").val(),u("#cur_mn").val());return r.getFullYear()!=a||1+r.getMonth()!=n||r.getDate()!=s||r.getMinutes()!=l?(b.find(".timestamp-wrap").addClass("form-invalid"),!1):(b.find(".timestamp-wrap").removeClass("form-invalid"),d"+x("%1$s %2$s, %3$s at %4$s:%5$s").replace("%1$s",u('option[value="'+n+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(s,10)).replace("%3$s",a).replace("%4$s",("00"+o).slice(-2)).replace("%5$s",("00"+l).slice(-2))+" "),"private"==g.find("input:radio:checked").val()?(u("#publish").val(x("Update")),0===i.length?e.append('"):i.html(x("Privately Published")),u('option[value="publish"]',e).prop("selected",!0),u("#misc-publishing-actions .edit-post-status").hide()):("future"==u("#original_post_status").val()||"draft"==u("#original_post_status").val()?i.length&&(i.remove(),e.val(u("#hidden_post_status").val())):i.html(x("Published")),e.is(":hidden")&&u("#misc-publishing-actions .edit-post-status").show()),u("#post-status-display").text(wp.sanitize.stripTagsAndEncodeText(u("option:selected",e).text())),"private"==u("option:selected",e).val()||"publish"==u("option:selected",e).val()?u("#save-post").hide():(u("#save-post").show(),"pending"==u("option:selected",e).val()?u("#save-post").show().val(x("Save as Pending")):u("#save-post").show().val(x("Save Draft"))),!0)},u("#visibility .edit-visibility").on("click",function(t){t.preventDefault(),g.is(":hidden")&&(a(),g.slideDown("fast",function(){g.find('input[type="radio"]').first().trigger("focus")}),u(this).hide())}),g.find(".cancel-post-visibility").on("click",function(t){g.slideUp("fast"),u("#visibility-radio-"+u("#hidden-post-visibility").val()).prop("checked",!0),u("#post_password").val(u("#hidden-post-password").val()),u("#sticky").prop("checked",u("#hidden-post-sticky").prop("checked")),u("#post-visibility-display").html(e),u("#visibility .edit-visibility").show().trigger("focus"),n(),t.preventDefault()}),g.find(".save-post-visibility").on("click",function(t){var e="",i=g.find("input:radio:checked").val();switch(g.slideUp("fast"),u("#visibility .edit-visibility").show().trigger("focus"),n(),"public"!==i&&u("#sticky").prop("checked",!1),i){case"public":e=u("#sticky").prop("checked")?x("Public, Sticky"):x("Public");break;case"private":e=x("Private");break;case"password":e=x("Password Protected")}u("#post-visibility-display").text(e),t.preventDefault()}),g.find("input:radio").on("change",function(){a()}),b.siblings("a.edit-timestamp").on("click",function(t){b.is(":hidden")&&(b.slideDown("fast",function(){u("input, select",b.find(".timestamp-wrap")).first().trigger("focus")}),u(this).hide()),t.preventDefault()}),b.find(".cancel-timestamp").on("click",function(t){b.slideUp("fast").siblings("a.edit-timestamp").show().trigger("focus"),u("#mm").val(u("#hidden_mm").val()),u("#jj").val(u("#hidden_jj").val()),u("#aa").val(u("#hidden_aa").val()),u("#hh").val(u("#hidden_hh").val()),u("#mn").val(u("#hidden_mn").val()),n(),t.preventDefault()}),b.find(".save-timestamp").on("click",function(t){n()&&(b.slideUp("fast"),b.siblings("a.edit-timestamp").show().trigger("focus")),t.preventDefault()}),u("#post").on("submit",function(t){n()||(t.preventDefault(),b.show(),wp.autosave&&wp.autosave.enableButtons(),u("#publishing-action .spinner").removeClass("is-active"))}),k.siblings("a.edit-post-status").on("click",function(t){k.is(":hidden")&&(k.slideDown("fast",function(){k.find("select").trigger("focus")}),u(this).hide()),t.preventDefault()}),k.find(".save-post-status").on("click",function(t){k.slideUp("fast").siblings("a.edit-post-status").show().trigger("focus"),n(),t.preventDefault()}),k.find(".cancel-post-status").on("click",function(t){k.slideUp("fast").siblings("a.edit-post-status").show().trigger("focus"),u("#post_status").val(u("#hidden_post_status").val()),n(),t.preventDefault()})),u("#titlediv").on("click",".edit-slug",function(){!function(){var t,e,i,a=0,n=u("#post_name"),s=n.val(),o=u("#sample-permalink"),l=o.html(),r=u("#sample-permalink a").html(),c=u("#edit-slug-buttons"),d=c.html(),p=u("#editable-post-name-full");for(p.find("img").replaceWith(function(){return this.alt}),p=p.html(),o.html(r),e=u("#editable-post-name"),i=e.html(),c.html(' "),c.children(".save").on("click",function(){var i=e.children("input").val();i!=u("#editable-post-name-full").text()?u.post(ajaxurl,{action:"sample-permalink",post_id:v,new_slug:i,new_title:u("#title").val(),samplepermalinknonce:u("#samplepermalinknonce").val()},function(t){var e=u("#edit-slug-box");e.html(t),e.hasClass("hidden")&&e.fadeIn("fast",function(){e.removeClass("hidden")}),c.html(d),o.html(l),n.val(i),u(".edit-slug").trigger("focus"),wp.a11y.speak(x("Permalink saved"))}):c.children(".cancel").click()}),c.children(".cancel").on("click",function(){u("#view-post-btn").show(),e.html(i),c.html(d),o.html(l),n.val(s),u(".edit-slug").trigger("focus")}),t=0;tp.length/4?"":p,e.html('').children("input").on("keydown",function(t){var e=t.which;13===e&&(t.preventDefault(),c.children(".save").click()),27===e&&c.children(".cancel").click()}).on("keyup",function(){n.val(this.value)}).trigger("focus")}()}),window.wptitlehint=function(t){var e=u("#"+(t=t||"title")),i=u("#"+t+"-prompt-text");""===e.val()&&i.removeClass("screen-reader-text"),e.on("input",function(){""!==this.value?i.addClass("screen-reader-text"):i.removeClass("screen-reader-text")})},wptitlehint(),t=u("#post-status-info"),c=u("#postdivrich"),!h.length||"ontouchstart"in window?u("#content-resize-handle").hide():t.on("mousedown.wp-editor-resize",function(t){(o="undefined"!=typeof tinymce?tinymce.get("content"):o)&&!o.isHidden()?(r=!0,l=u("#content_ifr").height()-t.pageY):(r=!1,l=h.height()-t.pageY,h.blur()),f.on("mousemove.wp-editor-resize",D).on("mouseup.wp-editor-resize mouseleave.wp-editor-resize",j),t.preventDefault()}).on("mouseup.wp-editor-resize",j),"undefined"!=typeof tinymce&&(u("#post-formats-select input.post-format").on("change.set-editor-class",function(){var t,e,i=this.id;i&&u(this).prop("checked")&&(t=tinymce.get("content"))&&((e=t.getBody()).className=e.className.replace(/\bpost-format-[^ ]+/,""),t.dom.addClass(e,"post-format-0"==i?"post-format-standard":i),u(document).trigger("editor-classchange"))}),u("#page_template").on("change.set-editor-class",function(){var t,e,i=u(this).val()||"";(i=i.substr(i.lastIndexOf("/")+1,i.length).replace(/\.php$/,"").replace(/\./g,"-"))&&(t=tinymce.get("content"))&&((e=t.getBody()).className=e.className.replace(/\bpage-template-[^ ]+/,""),t.dom.addClass(e,"page-template-"+i),u(document).trigger("editor-classchange"))})),h.on("keydown.wp-autosave",function(t){83===t.which&&(t.shiftKey||t.altKey||_&&(!t.metaKey||t.ctrlKey)||!_&&!t.ctrlKey||(wp.autosave&&wp.autosave.server.triggerSave(),t.preventDefault()))}),"auto-draft"===u("#original_post_status").val()&&window.history.replaceState&&u("#publish").on("click",function(){d=window.location.href,d+=-1!==d.indexOf("?")?"&":"?",d+="wp-post-new-reload=true",window.history.replaceState(null,null,d)}),y.on("success",function(t){var e=u(t.trigger),i=u(".success",e.closest(".copy-to-clipboard-container"));t.clearSelection(),e.focus(),clearTimeout(s),i.removeClass("hidden"),s=setTimeout(function(){i.addClass("hidden")},3e3),wp.a11y.speak(x("The file URL has been copied to your clipboard"))})}),function(t,o){t(function(){var i,e=t("#content"),a=t("#wp-word-count").find(".word-count"),n=0;function s(){var t=!i||i.isHidden()?e.val():i.getContent({format:"raw"}),t=o.count(t);t!==n&&a.text(t),n=t}t(document).on("tinymce-editor-init",function(t,e){"content"===e.id&&(i=e).on("nodechange keyup",_.debounce(s,1e3))}),e.on("input keyup",_.debounce(s,1e3)),s()})}(jQuery,new wp.utils.WordCounter); \ No newline at end of file +window.makeSlugeditClickable=window.editPermalink=function(){},window.wp=window.wp||{},function(s){var t=!1,a=wp.i18n.__;window.commentsBox={st:0,get:function(t,e){var i=this.st;return e=e||20,this.st+=e,this.total=t,s("#commentsdiv .spinner").addClass("is-active"),e={action:"get-comments",mode:"single",_ajax_nonce:s("#add_comment_nonce").val(),p:s("#post_ID").val(),start:i,number:e},s.post(ajaxurl,e,function(t){return t=wpAjax.parseAjaxResponse(t),s("#commentsdiv .widefat").show(),s("#commentsdiv .spinner").removeClass("is-active"),"object"==typeof t&&t.responses[0]?(s("#the-comment-list").append(t.responses[0].data),theList=theExtraList=null,s("a[className*=':']").off(),void(commentsBox.st>commentsBox.total?s("#show-comments").hide():s("#show-comments").show().children("a").text(a("Show more comments")))):void(1!=t?s("#the-comment-list").append(''+wpAjax.broken+""):s("#show-comments").text(a("No more comments found.")))}),!1},load:function(t){this.st=jQuery("#the-comment-list tr.comment:visible").length,this.get(t)}},window.WPSetThumbnailHTML=function(t){s(".inside","#postimagediv").html(t)},window.WPSetThumbnailID=function(t){var e=s('input[value="_thumbnail_id"]',"#list-table");0",{class:"avatar avatar-64 photo",width:64,height:64,alt:"",src:i.lock_error.avatar_src,srcset:i.lock_error.avatar_src_2x?i.lock_error.avatar_src_2x+" 2x":void 0}),a.find("div.post-locked-avatar").empty().append(e)),a.show().find(".currently-editing").text(i.lock_error.text),a.find(".wp-tab-first").trigger("focus")):i.new_lock&&s("#active_post_lock").val(i.new_lock))}).on("before-autosave.update-post-slug",function(){t=document.activeElement&&"title"===document.activeElement.id}).on("after-autosave.update-post-slug",function(){s("#edit-slug-box > *").length||t||s.post(ajaxurl,{action:"sample-permalink",post_id:s("#post_ID").val(),new_title:s("#title").val(),samplepermalinknonce:s("#samplepermalinknonce").val()},function(t){"-1"!=t&&s("#edit-slug-box").html(t)})})}(jQuery),function(n){var s,t;function i(){s=!1,window.clearTimeout(t),t=window.setTimeout(function(){s=!0},3e5)}n(document).on("heartbeat-send.wp-refresh-nonces",function(t,e){var i,a=n("#wp-auth-check-wrap");(s||a.length&&!a.hasClass("hidden"))&&(i=n("#post_ID").val())&&n("#_wpnonce").val()&&(e["wp-refresh-post-nonces"]={post_id:i})}).on("heartbeat-tick.wp-refresh-nonces",function(t,e){e=e["wp-refresh-post-nonces"];e&&(i(),e.replace&&n.each(e.replace,function(t,e){n("#"+t).val(e)}),e.heartbeatNonce&&(window.heartbeatSettings.nonce=e.heartbeatNonce))}).ready(function(){i()})}(jQuery),jQuery(document).ready(function(u){var p,e,i,a,n,s,o,l,r,t,c,d,h=u("#content"),f=u(document),v=u("#post_ID").val()||0,m=u("#submitpost"),g=!0,w=u("#post-visibility-select"),b=u("#timestampdiv"),k=u("#post-status-select"),_=!!window.navigator.platform&&-1!==window.navigator.platform.indexOf("Mac"),y=new ClipboardJS(".copy-attachment-url.edit-media"),x=wp.i18n.__,C=wp.i18n._x;function D(t){c.hasClass("wp-editor-expand")||(r?o.theme.resizeTo(null,l+t.pageY):h.height(Math.max(50,l+t.pageY)),t.preventDefault())}function j(){var t;c.hasClass("wp-editor-expand")||(t=r?(o.focus(),((t=parseInt(u("#wp-content-editor-container .mce-toolbar-grp").height(),10))<10||200 *").length&&(u("form#post").one("submit",function(){t=!0}),window.setTimeout(function(){!t&&wp.autosave&&wp.autosave.server.triggerSave()},200))}),f.on("autosave-disable-buttons.edit-post",function(){i.addClass("disabled")}).on("autosave-enable-buttons.edit-post",function(){wp.heartbeat&&wp.heartbeat.hasConnectionError()||i.removeClass("disabled")}).on("before-autosave.edit-post",function(){u(".autosave-message").text(x("Saving Draft\u2026"))}).on("after-autosave.edit-post",function(t,e){u(".autosave-message").text(e.message),u(document.body).hasClass("post-new-php")&&u(".submitbox .submitdelete").show()}),u(window).on("beforeunload.edit-post",function(t){var e=window.tinymce&&window.tinymce.get("content"),i=!1;if(wp.autosave?i=wp.autosave.server.postChanged():e&&(i=!e.isHidden()&&e.isDirty()),i)return t.preventDefault(),x("The changes you made will be lost if you navigate away from this page.")}).on("unload.edit-post",function(t){if(g&&(!t.target||"#document"==t.target.nodeName)){var e=u("#post_ID").val(),t=u("#active_post_lock").val();if(e&&t){t={action:"wp-remove-post-lock",_wpnonce:u("#_wpnonce").val(),post_ID:e,active_post_lock:t};if(window.FormData&&window.navigator.sendBeacon){var i=new window.FormData;if(u.each(t,function(t,e){i.append(t,e)}),window.navigator.sendBeacon(ajaxurl,i))return}u.post({async:!1,data:t,url:ajaxurl})}}}),u("#tagsdiv-post_tag").length?window.tagBox&&window.tagBox.init():u(".meta-box-sortables").children("div.postbox").each(function(){if(0===this.id.indexOf("tagsdiv-"))return window.tagBox&&window.tagBox.init(),!1}),u(".categorydiv").each(function(){var t,n,e,i=u(this).attr("id").split("-");i.shift(),n=i.join("-"),e="category"==n?"cats":n+"_tab",u("a","#"+n+"-tabs").on("click",function(t){t.preventDefault();t=u(this).attr("href");u(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),u("#"+n+"-tabs").siblings(".tabs-panel").hide(),u(t).show(),"#"+n+"-all"==t?deleteUserSetting(e):setUserSetting(e,"pop")}),getUserSetting(e)&&u('a[href="#'+n+'-pop"]',"#"+n+"-tabs").trigger("click"),u("#new"+n).one("focus",function(){u(this).val("").removeClass("form-input-tip")}),u("#new"+n).on("keypress",function(t){13===t.keyCode&&(t.preventDefault(),u("#"+n+"-add-submit").trigger("click"))}),u("#"+n+"-add-submit").on("click",function(){u("#new"+n).trigger("focus")}),t=function(t){return!!u("#new"+n).val()&&(t.data+="&"+u(":checked","#"+n+"checklist").serialize(),u("#"+n+"-add-submit").prop("disabled",!0),t)},i=function(t,e){var i,a=u("#new"+n+"_parent");u("#"+n+"-add-submit").prop("disabled",!1),"undefined"!=e.parsed.responses[0]&&(i=e.parsed.responses[0].supplemental.newcat_parent)&&(a.before(i),a.remove())},u("#"+n+"checklist").wpList({alt:"",response:n+"-ajax-response",addBefore:t,addAfter:i}),u("#"+n+"-add-toggle").on("click",function(t){t.preventDefault(),u("#"+n+"-adder").toggleClass("wp-hidden-children"),u('a[href="#'+n+'-all"]',"#"+n+"-tabs").click(),u("#new"+n).trigger("focus")}),u("#"+n+"checklist, #"+n+"checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var t=u(this),e=t.is(":checked"),i=t.val();i&&t.parents("#taxonomy-"+n).length&&u("#in-"+n+"-"+i+", #in-popular-"+n+"-"+i).prop("checked",e)})}),u("#postcustom").length&&u("#the-list").wpList({addBefore:function(t){return t.data+="&post_id="+u("#post_ID").val(),t},addAfter:function(){u("table#list-table").show()}}),u("#submitdiv").length&&(p=u("#timestamp").html(),e=u("#post-visibility-display").html(),a=function(){"public"!=w.find("input:radio:checked").val()?(u("#sticky").prop("checked",!1),u("#sticky-span").hide()):u("#sticky-span").show(),"password"!=w.find("input:radio:checked").val()?u("#password-span").hide():u("#password-span").show()},n=function(){if(!b.length)return!0;var t,e=u("#post_status"),i=u('option[value="publish"]',e),a=u("#aa").val(),n=u("#mm").val(),s=u("#jj").val(),o=u("#hh").val(),l=u("#mn").val(),r=new Date(a,n-1,s,o,l),c=new Date(u("#hidden_aa").val(),u("#hidden_mm").val()-1,u("#hidden_jj").val(),u("#hidden_hh").val(),u("#hidden_mn").val()),d=new Date(u("#cur_aa").val(),u("#cur_mm").val()-1,u("#cur_jj").val(),u("#cur_hh").val(),u("#cur_mn").val());return r.getFullYear()!=a||1+r.getMonth()!=n||r.getDate()!=s||r.getMinutes()!=l?(b.find(".timestamp-wrap").addClass("form-invalid"),!1):(b.find(".timestamp-wrap").removeClass("form-invalid"),d"+x("%1$s %2$s, %3$s at %4$s:%5$s").replace("%1$s",u('option[value="'+n+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(s,10)).replace("%3$s",a).replace("%4$s",("00"+o).slice(-2)).replace("%5$s",("00"+l).slice(-2))+" "),"private"==w.find("input:radio:checked").val()?(u("#publish").val(x("Update")),0===i.length?e.append('"):i.html(x("Privately Published")),u('option[value="publish"]',e).prop("selected",!0),u("#misc-publishing-actions .edit-post-status").hide()):("future"==u("#original_post_status").val()||"draft"==u("#original_post_status").val()?i.length&&(i.remove(),e.val(u("#hidden_post_status").val())):i.html(x("Published")),e.is(":hidden")&&u("#misc-publishing-actions .edit-post-status").show()),u("#post-status-display").text(wp.sanitize.stripTagsAndEncodeText(u("option:selected",e).text())),"private"==u("option:selected",e).val()||"publish"==u("option:selected",e).val()?u("#save-post").hide():(u("#save-post").show(),"pending"==u("option:selected",e).val()?u("#save-post").show().val(x("Save as Pending")):u("#save-post").show().val(x("Save Draft"))),!0)},u("#visibility .edit-visibility").on("click",function(t){t.preventDefault(),w.is(":hidden")&&(a(),w.slideDown("fast",function(){w.find('input[type="radio"]').first().trigger("focus")}),u(this).hide())}),w.find(".cancel-post-visibility").on("click",function(t){w.slideUp("fast"),u("#visibility-radio-"+u("#hidden-post-visibility").val()).prop("checked",!0),u("#post_password").val(u("#hidden-post-password").val()),u("#sticky").prop("checked",u("#hidden-post-sticky").prop("checked")),u("#post-visibility-display").html(e),u("#visibility .edit-visibility").show().trigger("focus"),n(),t.preventDefault()}),w.find(".save-post-visibility").on("click",function(t){var e="",i=w.find("input:radio:checked").val();switch(w.slideUp("fast"),u("#visibility .edit-visibility").show().trigger("focus"),n(),"public"!==i&&u("#sticky").prop("checked",!1),i){case"public":e=u("#sticky").prop("checked")?x("Public, Sticky"):x("Public");break;case"private":e=x("Private");break;case"password":e=x("Password Protected")}u("#post-visibility-display").text(e),t.preventDefault()}),w.find("input:radio").on("change",function(){a()}),b.siblings("a.edit-timestamp").on("click",function(t){b.is(":hidden")&&(b.slideDown("fast",function(){u("input, select",b.find(".timestamp-wrap")).first().trigger("focus")}),u(this).hide()),t.preventDefault()}),b.find(".cancel-timestamp").on("click",function(t){b.slideUp("fast").siblings("a.edit-timestamp").show().trigger("focus"),u("#mm").val(u("#hidden_mm").val()),u("#jj").val(u("#hidden_jj").val()),u("#aa").val(u("#hidden_aa").val()),u("#hh").val(u("#hidden_hh").val()),u("#mn").val(u("#hidden_mn").val()),n(),t.preventDefault()}),b.find(".save-timestamp").on("click",function(t){n()&&(b.slideUp("fast"),b.siblings("a.edit-timestamp").show().trigger("focus")),t.preventDefault()}),u("#post").on("submit",function(t){n()||(t.preventDefault(),b.show(),wp.autosave&&wp.autosave.enableButtons(),u("#publishing-action .spinner").removeClass("is-active"))}),k.siblings("a.edit-post-status").on("click",function(t){k.is(":hidden")&&(k.slideDown("fast",function(){k.find("select").trigger("focus")}),u(this).hide()),t.preventDefault()}),k.find(".save-post-status").on("click",function(t){k.slideUp("fast").siblings("a.edit-post-status").show().trigger("focus"),n(),t.preventDefault()}),k.find(".cancel-post-status").on("click",function(t){k.slideUp("fast").siblings("a.edit-post-status").show().trigger("focus"),u("#post_status").val(u("#hidden_post_status").val()),n(),t.preventDefault()})),u("#titlediv").on("click",".edit-slug",function(){!function(){var t,e,i,a=0,n=u("#post_name"),s=n.val(),o=u("#sample-permalink"),l=o.html(),r=u("#sample-permalink a").html(),c=u("#edit-slug-buttons"),d=c.html(),p=u("#editable-post-name-full");for(p.find("img").replaceWith(function(){return this.alt}),p=p.html(),o.html(r),e=u("#editable-post-name"),i=e.html(),c.html(' "),c.children(".save").on("click",function(){var i=e.children("input").val();i!=u("#editable-post-name-full").text()?u.post(ajaxurl,{action:"sample-permalink",post_id:v,new_slug:i,new_title:u("#title").val(),samplepermalinknonce:u("#samplepermalinknonce").val()},function(t){var e=u("#edit-slug-box");e.html(t),e.hasClass("hidden")&&e.fadeIn("fast",function(){e.removeClass("hidden")}),c.html(d),o.html(l),n.val(i),u(".edit-slug").trigger("focus"),wp.a11y.speak(x("Permalink saved"))}):c.children(".cancel").trigger("click")}),c.children(".cancel").on("click",function(){u("#view-post-btn").show(),e.html(i),c.html(d),o.html(l),n.val(s),u(".edit-slug").trigger("focus")}),t=0;tp.length/4?"":p,e.html('').children("input").on("keydown",function(t){var e=t.which;13===e&&(t.preventDefault(),c.children(".save").trigger("click")),27===e&&c.children(".cancel").trigger("click")}).on("keyup",function(){n.val(this.value)}).trigger("focus")}()}),window.wptitlehint=function(t){var e=u("#"+(t=t||"title")),i=u("#"+t+"-prompt-text");""===e.val()&&i.removeClass("screen-reader-text"),e.on("input",function(){""!==this.value?i.addClass("screen-reader-text"):i.removeClass("screen-reader-text")})},wptitlehint(),t=u("#post-status-info"),c=u("#postdivrich"),!h.length||"ontouchstart"in window?u("#content-resize-handle").hide():t.on("mousedown.wp-editor-resize",function(t){(o="undefined"!=typeof tinymce?tinymce.get("content"):o)&&!o.isHidden()?(r=!0,l=u("#content_ifr").height()-t.pageY):(r=!1,l=h.height()-t.pageY,h.trigger("blur")),f.on("mousemove.wp-editor-resize",D).on("mouseup.wp-editor-resize mouseleave.wp-editor-resize",j),t.preventDefault()}).on("mouseup.wp-editor-resize",j),"undefined"!=typeof tinymce&&(u("#post-formats-select input.post-format").on("change.set-editor-class",function(){var t,e,i=this.id;i&&u(this).prop("checked")&&(t=tinymce.get("content"))&&((e=t.getBody()).className=e.className.replace(/\bpost-format-[^ ]+/,""),t.dom.addClass(e,"post-format-0"==i?"post-format-standard":i),u(document).trigger("editor-classchange"))}),u("#page_template").on("change.set-editor-class",function(){var t,e,i=u(this).val()||"";(i=i.substr(i.lastIndexOf("/")+1,i.length).replace(/\.php$/,"").replace(/\./g,"-"))&&(t=tinymce.get("content"))&&((e=t.getBody()).className=e.className.replace(/\bpage-template-[^ ]+/,""),t.dom.addClass(e,"page-template-"+i),u(document).trigger("editor-classchange"))})),h.on("keydown.wp-autosave",function(t){83===t.which&&(t.shiftKey||t.altKey||_&&(!t.metaKey||t.ctrlKey)||!_&&!t.ctrlKey||(wp.autosave&&wp.autosave.server.triggerSave(),t.preventDefault()))}),"auto-draft"===u("#original_post_status").val()&&window.history.replaceState&&u("#publish").on("click",function(){d=window.location.href,d+=-1!==d.indexOf("?")?"&":"?",d+="wp-post-new-reload=true",window.history.replaceState(null,null,d)}),y.on("success",function(t){var e=u(t.trigger),i=u(".success",e.closest(".copy-to-clipboard-container"));t.clearSelection(),e.trigger("focus"),clearTimeout(s),i.removeClass("hidden"),s=setTimeout(function(){i.addClass("hidden")},3e3),wp.a11y.speak(x("The file URL has been copied to your clipboard"))})}),function(t,o){t(function(){var i,e=t("#content"),a=t("#wp-word-count").find(".word-count"),n=0;function s(){var t=!i||i.isHidden()?e.val():i.getContent({format:"raw"}),t=o.count(t);t!==n&&a.text(t),n=t}t(document).on("tinymce-editor-init",function(t,e){"content"===e.id&&(i=e).on("nodechange keyup",_.debounce(s,1e3))}),e.on("input keyup",_.debounce(s,1e3)),s()})}(jQuery,new wp.utils.WordCounter); \ No newline at end of file diff --git a/wp-admin/js/postbox.js b/wp-admin/js/postbox.js index c4958c126a..4f521acd93 100644 --- a/wp-admin/js/postbox.js +++ b/wp-admin/js/postbox.js @@ -127,7 +127,7 @@ } postbox.prevAll( '.postbox:visible' ).eq( 0 ).before( postbox ); - button.focus(); + button.trigger( 'focus' ); postboxes.updateOrderButtonsProperties(); postboxes.save_order( postboxes.page ); } @@ -141,7 +141,7 @@ } postbox.nextAll( '.postbox:visible' ).eq( 0 ).after( postbox ); - button.focus(); + button.trigger( 'focus' ); postboxes.updateOrderButtonsProperties(); postboxes.save_order( postboxes.page ); } diff --git a/wp-admin/js/postbox.min.js b/wp-admin/js/postbox.min.js index 6a0cbd3238..3a4ce9aa03 100644 --- a/wp-admin/js/postbox.min.js +++ b/wp-admin/js/postbox.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(l){var a=l(document),r=wp.i18n.__;window.postboxes={handle_click:function(){var e,o=l(this),s=o.closest(".postbox"),t=s.attr("id");"dashboard_browser_nag"!==t&&(s.toggleClass("closed"),e=!s.hasClass("closed"),(o.hasClass("handlediv")?o:o.closest(".postbox").find("button.handlediv")).attr("aria-expanded",e),"press-this"!==postboxes.page&&postboxes.save_state(postboxes.page),t&&(s.hasClass("closed")||"function"!=typeof postboxes.pbshow?s.hasClass("closed")&&"function"==typeof postboxes.pbhide&&postboxes.pbhide(t):postboxes.pbshow(t)),a.trigger("postbox-toggled",s))},handleOrder:function(){var e=l(this),o=e.closest(".postbox"),s=o.attr("id"),t=o.closest(".meta-box-sortables").find(".postbox:visible"),a=t.length,t=t.index(o);if("dashboard_browser_nag"!==s){if("true"===e.attr("aria-disabled"))return s=e.hasClass("handle-order-higher")?r("The box is on the first position"):r("The box is on the last position"),void wp.a11y.speak(s);if(e.hasClass("handle-order-higher")){if(0===t)return void postboxes.handleOrderBetweenSortables("previous",e,o);o.prevAll(".postbox:visible").eq(0).before(o),e.focus(),postboxes.updateOrderButtonsProperties(),postboxes.save_order(postboxes.page)}e.hasClass("handle-order-lower")&&(t+1!==a?(o.nextAll(".postbox:visible").eq(0).after(o),e.focus(),postboxes.updateOrderButtonsProperties(),postboxes.save_order(postboxes.page)):postboxes.handleOrderBetweenSortables("next",e,o))}},handleOrderBetweenSortables:function(e,o,s){var t=o.closest(".meta-box-sortables").attr("id"),a=[];l(".meta-box-sortables:visible").each(function(){a.push(l(this).attr("id"))}),1!==a.length&&(t=l.inArray(t,a),s=s.detach(),"previous"===e&&l(s).appendTo("#"+a[t-1]),"next"===e&&l(s).prependTo("#"+a[t+1]),postboxes._mark_area(),o.focus(),postboxes.updateOrderButtonsProperties(),postboxes.save_order(postboxes.page))},updateOrderButtonsProperties:function(){var e=l(".meta-box-sortables:visible:first").attr("id"),o=l(".meta-box-sortables:visible:last").attr("id"),s=l(".postbox:visible:first"),t=l(".postbox:visible:last"),a=s.attr("id"),r=t.attr("id"),i=s.closest(".meta-box-sortables").attr("id"),n=t.closest(".meta-box-sortables").attr("id"),d=l(".handle-order-higher"),t=l(".handle-order-lower");d.attr("aria-disabled","false").removeClass("hidden"),t.attr("aria-disabled","false").removeClass("hidden"),e===o&&a===r&&(d.addClass("hidden"),t.addClass("hidden")),e===i&&l(s).find(".handle-order-higher").attr("aria-disabled","true"),o===n&&l(".postbox:visible .handle-order-lower").last().attr("aria-disabled","true")},add_postbox_toggles:function(t,e){var o=l(".postbox .hndle, .postbox .handlediv"),s=l(".postbox .handle-order-higher, .postbox .handle-order-lower");this.page=t,this.init(t,e),o.on("click.postboxes",this.handle_click),s.on("click.postboxes",this.handleOrder),l(".postbox .hndle a").on("click",function(e){e.stopPropagation()}),l(".postbox a.dismiss").on("click.postboxes",function(e){var o=l(this).parents(".postbox").attr("id")+"-hide";e.preventDefault(),l("#"+o).prop("checked",!1).triggerHandler("click")}),l(".hide-postbox-tog").on("click.postboxes",function(){var e=l(this),o=e.val(),s=l("#"+o);e.prop("checked")?(s.show(),"function"==typeof postboxes.pbshow&&postboxes.pbshow(o)):(s.hide(),"function"==typeof postboxes.pbhide&&postboxes.pbhide(o)),postboxes.save_state(t),postboxes._mark_area(),a.trigger("postbox-toggled",s)}),l('.columns-prefs input[type="radio"]').on("click.postboxes",function(){var e=parseInt(l(this).val(),10);e&&(postboxes._pb_edit(e),postboxes.save_order(t))})},init:function(o,e){var s=l(document.body).hasClass("mobile"),t=l(".postbox .handlediv");l.extend(this,e||{}),l(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",delay:s?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,helper:function(e,o){return o.clone().find(":input").attr("name",function(e,o){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+o}).end()},opacity:.65,start:function(){l("body").addClass("is-dragging-metaboxes"),l(".meta-box-sortables").sortable("refreshPositions")},stop:function(){var e=l(this);l("body").removeClass("is-dragging-metaboxes"),e.find("#dashboard_browser_nag").is(":visible")&&"dashboard_browser_nag"!=this.firstChild.id?e.sortable("cancel"):(postboxes.updateOrderButtonsProperties(),postboxes.save_order(o))},receive:function(e,o){"dashboard_browser_nag"==o.item[0].id&&l(o.sender).sortable("cancel"),postboxes._mark_area(),a.trigger("postbox-moved",o.item)}}),s&&(l(document.body).on("orientationchange.postboxes",function(){postboxes._pb_change()}),this._pb_change()),this._mark_area(),this.updateOrderButtonsProperties(),a.on("postbox-toggled",this.updateOrderButtonsProperties),t.each(function(){var e=l(this);e.attr("aria-expanded",!e.closest(".postbox").hasClass("closed"))})},save_state:function(e){var o,s;"nav-menus"!==e&&(o=l(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),s=l(".postbox").filter(":hidden").map(function(){return this.id}).get().join(","),l.post(ajaxurl,{action:"closed-postboxes",closed:o,hidden:s,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:e}))},save_order:function(e){var o=l(".columns-prefs input:checked").val()||0,s={action:"meta-box-order",_ajax_nonce:l("#meta-box-order-nonce").val(),page_columns:o,page:e};l(".meta-box-sortables").each(function(){s["order["+this.id.split("-")[0]+"]"]=l(this).sortable("toArray").join(",")}),l.post(ajaxurl,s,function(e){e.success&&wp.a11y.speak(r("The boxes order has been saved."))})},_mark_area:function(){var o=l("div.postbox:visible").length,e=l("#dashboard-widgets .meta-box-sortables:visible, #post-body .meta-box-sortables:visible"),s=!0;e.each(function(){var e=l(this);1==o||e.children(".postbox:visible").length?(e.removeClass("empty-container"),s=!1):e.addClass("empty-container")}),postboxes.updateEmptySortablesText(e,s)},updateEmptySortablesText:function(e,o){var s=l("#dashboard-widgets").length,t=r(o?"Add boxes from the Screen Options menu":"Drag boxes here");s&&e.each(function(){l(this).hasClass("empty-container")&&l(this).attr("data-emptyString",t)})},_pb_edit:function(e){var o=l(".metabox-holder").get(0);o&&(o.className=o.className.replace(/columns-\d+/,"columns-"+e)),l(document).trigger("postboxes-columnchange")},_pb_change:function(){var e=l('label.columns-prefs-1 input[type="radio"]');switch(window.orientation){case 90:case-90:e.length&&e.is(":checked")||this._pb_edit(2);break;case 0:case 180:l("#poststuff").length?this._pb_edit(1):e.length&&e.is(":checked")||this._pb_edit(2)}},pbshow:!1,pbhide:!1}}(jQuery); \ No newline at end of file +!function(l){var a=l(document),r=wp.i18n.__;window.postboxes={handle_click:function(){var e,o=l(this),s=o.closest(".postbox"),t=s.attr("id");"dashboard_browser_nag"!==t&&(s.toggleClass("closed"),e=!s.hasClass("closed"),(o.hasClass("handlediv")?o:o.closest(".postbox").find("button.handlediv")).attr("aria-expanded",e),"press-this"!==postboxes.page&&postboxes.save_state(postboxes.page),t&&(s.hasClass("closed")||"function"!=typeof postboxes.pbshow?s.hasClass("closed")&&"function"==typeof postboxes.pbhide&&postboxes.pbhide(t):postboxes.pbshow(t)),a.trigger("postbox-toggled",s))},handleOrder:function(){var e=l(this),o=e.closest(".postbox"),s=o.attr("id"),t=o.closest(".meta-box-sortables").find(".postbox:visible"),a=t.length,t=t.index(o);if("dashboard_browser_nag"!==s){if("true"===e.attr("aria-disabled"))return s=e.hasClass("handle-order-higher")?r("The box is on the first position"):r("The box is on the last position"),void wp.a11y.speak(s);if(e.hasClass("handle-order-higher")){if(0===t)return void postboxes.handleOrderBetweenSortables("previous",e,o);o.prevAll(".postbox:visible").eq(0).before(o),e.trigger("focus"),postboxes.updateOrderButtonsProperties(),postboxes.save_order(postboxes.page)}e.hasClass("handle-order-lower")&&(t+1!==a?(o.nextAll(".postbox:visible").eq(0).after(o),e.trigger("focus"),postboxes.updateOrderButtonsProperties(),postboxes.save_order(postboxes.page)):postboxes.handleOrderBetweenSortables("next",e,o))}},handleOrderBetweenSortables:function(e,o,s){var t=o.closest(".meta-box-sortables").attr("id"),a=[];l(".meta-box-sortables:visible").each(function(){a.push(l(this).attr("id"))}),1!==a.length&&(t=l.inArray(t,a),s=s.detach(),"previous"===e&&l(s).appendTo("#"+a[t-1]),"next"===e&&l(s).prependTo("#"+a[t+1]),postboxes._mark_area(),o.focus(),postboxes.updateOrderButtonsProperties(),postboxes.save_order(postboxes.page))},updateOrderButtonsProperties:function(){var e=l(".meta-box-sortables:visible:first").attr("id"),o=l(".meta-box-sortables:visible:last").attr("id"),s=l(".postbox:visible:first"),t=l(".postbox:visible:last"),a=s.attr("id"),r=t.attr("id"),i=s.closest(".meta-box-sortables").attr("id"),n=t.closest(".meta-box-sortables").attr("id"),d=l(".handle-order-higher"),t=l(".handle-order-lower");d.attr("aria-disabled","false").removeClass("hidden"),t.attr("aria-disabled","false").removeClass("hidden"),e===o&&a===r&&(d.addClass("hidden"),t.addClass("hidden")),e===i&&l(s).find(".handle-order-higher").attr("aria-disabled","true"),o===n&&l(".postbox:visible .handle-order-lower").last().attr("aria-disabled","true")},add_postbox_toggles:function(t,e){var o=l(".postbox .hndle, .postbox .handlediv"),s=l(".postbox .handle-order-higher, .postbox .handle-order-lower");this.page=t,this.init(t,e),o.on("click.postboxes",this.handle_click),s.on("click.postboxes",this.handleOrder),l(".postbox .hndle a").on("click",function(e){e.stopPropagation()}),l(".postbox a.dismiss").on("click.postboxes",function(e){var o=l(this).parents(".postbox").attr("id")+"-hide";e.preventDefault(),l("#"+o).prop("checked",!1).triggerHandler("click")}),l(".hide-postbox-tog").on("click.postboxes",function(){var e=l(this),o=e.val(),s=l("#"+o);e.prop("checked")?(s.show(),"function"==typeof postboxes.pbshow&&postboxes.pbshow(o)):(s.hide(),"function"==typeof postboxes.pbhide&&postboxes.pbhide(o)),postboxes.save_state(t),postboxes._mark_area(),a.trigger("postbox-toggled",s)}),l('.columns-prefs input[type="radio"]').on("click.postboxes",function(){var e=parseInt(l(this).val(),10);e&&(postboxes._pb_edit(e),postboxes.save_order(t))})},init:function(o,e){var s=l(document.body).hasClass("mobile"),t=l(".postbox .handlediv");l.extend(this,e||{}),l(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",delay:s?200:0,distance:2,tolerance:"pointer",forcePlaceholderSize:!0,helper:function(e,o){return o.clone().find(":input").attr("name",function(e,o){return"sort_"+parseInt(1e5*Math.random(),10).toString()+"_"+o}).end()},opacity:.65,start:function(){l("body").addClass("is-dragging-metaboxes"),l(".meta-box-sortables").sortable("refreshPositions")},stop:function(){var e=l(this);l("body").removeClass("is-dragging-metaboxes"),e.find("#dashboard_browser_nag").is(":visible")&&"dashboard_browser_nag"!=this.firstChild.id?e.sortable("cancel"):(postboxes.updateOrderButtonsProperties(),postboxes.save_order(o))},receive:function(e,o){"dashboard_browser_nag"==o.item[0].id&&l(o.sender).sortable("cancel"),postboxes._mark_area(),a.trigger("postbox-moved",o.item)}}),s&&(l(document.body).on("orientationchange.postboxes",function(){postboxes._pb_change()}),this._pb_change()),this._mark_area(),this.updateOrderButtonsProperties(),a.on("postbox-toggled",this.updateOrderButtonsProperties),t.each(function(){var e=l(this);e.attr("aria-expanded",!e.closest(".postbox").hasClass("closed"))})},save_state:function(e){var o,s;"nav-menus"!==e&&(o=l(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),s=l(".postbox").filter(":hidden").map(function(){return this.id}).get().join(","),l.post(ajaxurl,{action:"closed-postboxes",closed:o,hidden:s,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:e}))},save_order:function(e){var o=l(".columns-prefs input:checked").val()||0,s={action:"meta-box-order",_ajax_nonce:l("#meta-box-order-nonce").val(),page_columns:o,page:e};l(".meta-box-sortables").each(function(){s["order["+this.id.split("-")[0]+"]"]=l(this).sortable("toArray").join(",")}),l.post(ajaxurl,s,function(e){e.success&&wp.a11y.speak(r("The boxes order has been saved."))})},_mark_area:function(){var o=l("div.postbox:visible").length,e=l("#dashboard-widgets .meta-box-sortables:visible, #post-body .meta-box-sortables:visible"),s=!0;e.each(function(){var e=l(this);1==o||e.children(".postbox:visible").length?(e.removeClass("empty-container"),s=!1):e.addClass("empty-container")}),postboxes.updateEmptySortablesText(e,s)},updateEmptySortablesText:function(e,o){var s=l("#dashboard-widgets").length,t=r(o?"Add boxes from the Screen Options menu":"Drag boxes here");s&&e.each(function(){l(this).hasClass("empty-container")&&l(this).attr("data-emptyString",t)})},_pb_edit:function(e){var o=l(".metabox-holder").get(0);o&&(o.className=o.className.replace(/columns-\d+/,"columns-"+e)),l(document).trigger("postboxes-columnchange")},_pb_change:function(){var e=l('label.columns-prefs-1 input[type="radio"]');switch(window.orientation){case 90:case-90:e.length&&e.is(":checked")||this._pb_edit(2);break;case 0:case 180:l("#poststuff").length?this._pb_edit(1):e.length&&e.is(":checked")||this._pb_edit(2)}},pbshow:!1,pbhide:!1}}(jQuery); \ No newline at end of file diff --git a/wp-admin/js/privacy-tools.js b/wp-admin/js/privacy-tools.js index c4565550da..331af439c9 100644 --- a/wp-admin/js/privacy-tools.js +++ b/wp-admin/js/privacy-tools.js @@ -328,7 +328,7 @@ jQuery( document ).ready( function( $ ) { // Label handling to focus the create page button on Privacy settings page. $( 'body.options-privacy-php label[for=create-page]' ).on( 'click', function( e ) { e.preventDefault(); - $( 'input#create-page' ).focus(); + $( 'input#create-page' ).trigger( 'focus' ); } ); // Accordion handling in various new Privacy settings pages. diff --git a/wp-admin/js/privacy-tools.min.js b/wp-admin/js/privacy-tools.min.js index 93fc5744f5..e2e6e6ea48 100644 --- a/wp-admin/js/privacy-tools.min.js +++ b/wp-admin/js/privacy-tools.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -jQuery(document).ready(function(g){var r,h=wp.i18n.__;function w(e,t){e.children().addClass("hidden"),e.children("."+t).removeClass("hidden")}function x(e){e.removeClass("has-request-results"),e.next().hasClass("request-results")&&e.next().remove()}function y(e,t,a,o){var s="",n="request-results";x(e),o.length&&(g.each(o,function(e,t){s=s+"
  • "+t+"
  • "}),s="
      "+s+"
    "),e.addClass("has-request-results"),e.hasClass("status-request-confirmed")&&(n+=" status-request-confirmed"),e.hasClass("status-request-failed")&&(n+=" status-request-failed"),e.after(function(){return'

    '+a+"

    "+s+"
    "})}g(".export-personal-data-handle").on("click",function(e){var t=g(this),n=t.parents(".export-personal-data"),r=t.parents("tr"),a=r.find(".export-progress"),i=t.parents(".row-actions"),c=n.data("request-id"),d=n.data("nonce"),l=n.data("exporters-count"),u=!!n.data("send-as-email");function p(e){var t=h("An error occurred while attempting to export personal data.");w(n,"export-personal-data-failed"),e&&y(r,"notice-error",t,[e]),setTimeout(function(){i.removeClass("processing")},500)}function m(e){e=0"+t+""}),s="
      "+s+"
    "),e.addClass("has-request-results"),e.hasClass("status-request-confirmed")&&(n+=" status-request-confirmed"),e.hasClass("status-request-failed")&&(n+=" status-request-failed"),e.after(function(){return'

    '+a+"

    "+s+"
    "})}v(".export-personal-data-handle").on("click",function(e){var t=v(this),n=t.parents(".export-personal-data"),r=t.parents("tr"),a=r.find(".export-progress"),i=t.parents(".row-actions"),c=n.data("request-id"),d=n.data("nonce"),l=n.data("exporters-count"),u=!!n.data("send-as-email");function p(e){var t=h("An error occurred while attempting to export personal data.");w(n,"export-personal-data-failed"),e&&y(r,"notice-error",t,[e]),setTimeout(function(){i.removeClass("processing")},500)}function m(e){e=0>(l-=o),u+=a.charAt(r),s^=r<>(l-=o),u+=a.charAt(r),s^=r<").text(e),a||((t=o('")).on("click keypress",function(t){"click"!==t.type&&13!==t.keyCode&&32!==t.keyCode||(13!==t.keyCode&&32!==t.keyCode||o(this).closest(".tagsdiv").find("input.newtag").focus(),tagBox.userAction="remove",tagBox.parseTags(this))}),e.prepend(" ").prepend(t)),i.append(e))}),tagBox.screenReadersMessage())},flushTags:function(t,e,a){var i,n,s=o(".the-tags",t),c=o("input.newtag",t);return void 0===(n=(e=e||!1)?o(e).text():c.val())||""===n||(n=(i=s.val())?i+r+n:n,n=this.clean(n),n=array_unique_noempty(n.split(r)).join(r),s.val(n),this.quickClicks(t),e||c.val(""),void 0===a&&c.focus()),!1},get:function(a){var i=a.substr(a.indexOf("-")+1);o.post(ajaxurl,{action:"get-tagcloud",tax:i},function(t,e){0!==t&&"success"==e&&(t=o('
    '+t+"
    "),o("a",t).click(function(){return tagBox.userAction="add",tagBox.flushTags(o("#"+i),this),!1}),o("#"+a).after(t))})},userAction:"",screenReadersMessage:function(){var t;switch(this.userAction){case"remove":t=wp.i18n.__("Term removed.");break;case"add":t=wp.i18n.__("Term added.");break;default:return}window.wp.a11y.speak(t,"assertive")},init:function(){var t=o("div.ajaxtag");o(".tagsdiv").each(function(){tagBox.quickClicks(this)}),o(".tagadd",t).click(function(){tagBox.userAction="add",tagBox.flushTags(o(this).closest(".tagsdiv"))}),o("input.newtag",t).keypress(function(t){13==t.which&&(tagBox.userAction="add",tagBox.flushTags(o(this).closest(".tagsdiv")),t.preventDefault(),t.stopPropagation())}).each(function(t,e){o(e).wpTagsSuggest()}),o("#post").submit(function(){o("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),o(".tagcloud-link").click(function(){tagBox.get(o(this).attr("id")),o(this).attr("aria-expanded","true").unbind().click(function(){o(this).attr("aria-expanded","false"===o(this).attr("aria-expanded")?"true":"false").siblings(".the-tagcloud").toggle()})})}}}(jQuery); \ No newline at end of file +!function(o){var r=wp.i18n._x(",","tag delimiter")||",";window.array_unique_noempty=function(t){var a=[];return o.each(t,function(t,e){(e=o.trim(e))&&-1===o.inArray(e,a)&&a.push(e)}),a},window.tagBox={clean:function(t){return t=(t=","!==r?t.replace(new RegExp(r,"g"),","):t).replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),t=","!==r?t.replace(/,/g,r):t},parseTags:function(t){var e=t.id.split("-check-num-")[1],a=o(t).closest(".tagsdiv"),i=a.find(".the-tags"),t=i.val().split(r),n=[];return delete t[e],o.each(t,function(t,e){(e=o.trim(e))&&n.push(e)}),i.val(this.clean(n.join(r))),this.quickClicks(a),!1},quickClicks:function(t){var a,e=o(".the-tags",t),i=o(".tagchecklist",t),n=o(t).attr("id");e.length&&(a=e.prop("disabled"),e=e.val().split(r),i.empty(),o.each(e,function(t,e){(e=o.trim(e))&&(e=o("
  • ").text(e),a||((t=o('")).on("click keypress",function(t){"click"!==t.type&&13!==t.keyCode&&32!==t.keyCode||(13!==t.keyCode&&32!==t.keyCode||o(this).closest(".tagsdiv").find("input.newtag").trigger("focus"),tagBox.userAction="remove",tagBox.parseTags(this))}),e.prepend(" ").prepend(t)),i.append(e))}),tagBox.screenReadersMessage())},flushTags:function(t,e,a){var i,n,s=o(".the-tags",t),c=o("input.newtag",t);return void 0===(n=(e=e||!1)?o(e).text():c.val())||""===n||(n=(i=s.val())?i+r+n:n,n=this.clean(n),n=array_unique_noempty(n.split(r)).join(r),s.val(n),this.quickClicks(t),e||c.val(""),void 0===a&&c.trigger("focus")),!1},get:function(a){var i=a.substr(a.indexOf("-")+1);o.post(ajaxurl,{action:"get-tagcloud",tax:i},function(t,e){0!==t&&"success"==e&&(t=o('
    '+t+"
    "),o("a",t).on("click",function(){return tagBox.userAction="add",tagBox.flushTags(o("#"+i),this),!1}),o("#"+a).after(t))})},userAction:"",screenReadersMessage:function(){var t;switch(this.userAction){case"remove":t=wp.i18n.__("Term removed.");break;case"add":t=wp.i18n.__("Term added.");break;default:return}window.wp.a11y.speak(t,"assertive")},init:function(){var t=o("div.ajaxtag");o(".tagsdiv").each(function(){tagBox.quickClicks(this)}),o(".tagadd",t).on("click",function(){tagBox.userAction="add",tagBox.flushTags(o(this).closest(".tagsdiv"))}),o("input.newtag",t).on("keypress",function(t){13==t.which&&(tagBox.userAction="add",tagBox.flushTags(o(this).closest(".tagsdiv")),t.preventDefault(),t.stopPropagation())}).each(function(t,e){o(e).wpTagsSuggest()}),o("#post").on("submit",function(){o("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),o(".tagcloud-link").on("click",function(){tagBox.get(o(this).attr("id")),o(this).attr("aria-expanded","true").off().on("click",function(){o(this).attr("aria-expanded","false"===o(this).attr("aria-expanded")?"true":"false").siblings(".the-tagcloud").toggle()})})}}}(jQuery); \ No newline at end of file diff --git a/wp-admin/js/updates.js b/wp-admin/js/updates.js index 3371e84d27..f98a48e5d6 100644 --- a/wp-admin/js/updates.js +++ b/wp-admin/js/updates.js @@ -629,7 +629,7 @@ setTimeout( function() { $card .removeClass( 'plugin-card-update-failed' ) - .find( '.column-name a' ).focus(); + .find( '.column-name a' ).trigger( 'focus' ); $card.find( '.update-now' ) .attr( 'aria-label', false ) @@ -801,7 +801,7 @@ setTimeout( function() { $card .removeClass( 'plugin-card-update-failed' ) - .find( '.column-name a' ).focus(); + .find( '.column-name a' ).trigger( 'focus' ); }, 200 ); } ); @@ -1215,10 +1215,10 @@ // Focus on Customize button after updating. if ( isModalOpen ) { - $( '.load-customize:visible' ).focus(); + $( '.load-customize:visible' ).trigger( 'focus' ); $( '.theme-info .theme-autoupdate' ).find( '.auto-update-time' ).empty(); } else { - $theme.find( '.load-customize' ).focus(); + $theme.find( '.load-customize' ).trigger( 'focus' ); } } @@ -1271,7 +1271,7 @@ } else { $notice = $( '.theme-info .notice' ).add( $theme.find( '.notice' ) ); - $( 'body.modal-open' ).length ? $( '.load-customize:visible' ).focus() : $theme.find( '.load-customize' ).focus(); + $( 'body.modal-open' ).length ? $( '.load-customize:visible' ).trigger( 'focus' ) : $theme.find( '.load-customize' ).trigger( 'focus'); } wp.updates.addAdminNotice( { @@ -1768,11 +1768,11 @@ // #upgrade button must always be the last focus-able element in the dialog. if ( 'upgrade' === event.target.id && ! event.shiftKey ) { - $( '#hostname' ).focus(); + $( '#hostname' ).trigger( 'focus' ); event.preventDefault(); } else if ( 'hostname' === event.target.id && event.shiftKey ) { - $( '#upgrade' ).focus(); + $( '#upgrade' ).trigger( 'focus' ); event.preventDefault(); } @@ -1789,7 +1789,7 @@ $( 'body' ).addClass( 'modal-open' ); $modal.show(); - $modal.find( 'input:enabled:first' ).focus(); + $modal.find( 'input:enabled:first' ).trigger( 'focus' ); $modal.on( 'keydown', wp.updates.keydown ); }; diff --git a/wp-admin/js/updates.min.js b/wp-admin/js/updates.min.js index 09d490d3d2..f04ab21012 100644 --- a/wp-admin/js/updates.min.js +++ b/wp-admin/js/updates.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(p,c,g){var m=p(document),h=c.i18n.__,d=c.i18n._x,u=c.i18n.sprintf;(c=c||{}).updates={},c.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:""},c.updates.l10n=window.wp.deprecateL10nObject("wp.updates.l10n",c.updates.l10n,"5.5.0"),c.updates.ajaxNonce=g.ajax_nonce,c.updates.searchTerm="",c.updates.shouldRequestFilesystemCredentials=!1,c.updates.filesystemCredentials={ftp:{host:"",username:"",password:"",connectionType:""},ssh:{publicKey:"",privateKey:""},fsNonce:"",available:!1},c.updates.ajaxLocked=!1,c.updates.adminNotice=c.template("wp-updates-admin-notice"),c.updates.queue=[],c.updates.$elToReturnFocusToFromCredentialsModal=void 0,c.updates.addAdminNotice=function(e){var t,a=p(e.selector),s=p(".wp-header-end");delete e.selector,t=c.updates.adminNotice(e),(a=!a.length?p("#"+e.id):a).length?a.replaceWith(t):s.length?s.after(t):"customize"===pagenow?p(".customize-themes-notifications").append(t):p(".wrap").find("> h1").after(t),m.trigger("wp-updates-notice-added")},c.updates.ajax=function(e,t){var a={};return c.updates.ajaxLocked?(c.updates.queue.push({action:e,data:t}),p.Deferred()):(c.updates.ajaxLocked=!0,t.success&&(a.success=t.success,delete t.success),t.error&&(a.error=t.error,delete t.error),a.data=_.extend(t,{action:e,_ajax_nonce:c.updates.ajaxNonce,_fs_nonce:c.updates.filesystemCredentials.fsNonce,username:c.updates.filesystemCredentials.ftp.username,password:c.updates.filesystemCredentials.ftp.password,hostname:c.updates.filesystemCredentials.ftp.hostname,connection_type:c.updates.filesystemCredentials.ftp.connectionType,public_key:c.updates.filesystemCredentials.ssh.publicKey,private_key:c.updates.filesystemCredentials.ssh.privateKey}),c.ajax.send(a).always(c.updates.ajaxAlways))},c.updates.ajaxAlways=function(e){e.errorCode&&"unable_to_connect_to_filesystem"===e.errorCode||(c.updates.ajaxLocked=!1,c.updates.queueChecker()),void 0!==e.debug&&window.console&&window.console.log&&_.map(e.debug,function(e){window.console.log(c.sanitize.stripTagsAndEncodeText(e))})},c.updates.refreshCount=function(){var e,t=p("#wp-admin-bar-updates"),a=p('a[href="update-core.php"] .update-plugins'),s=p('a[href="plugins.php"] .update-plugins'),n=p('a[href="themes.php"] .update-plugins');t.find(".ab-item").removeAttr("title"),t.find(".ab-label").text(g.totals.counts.total),0===g.totals.counts.total&&t.find(".ab-label").parents("li").remove(),a.each(function(e,t){t.className=t.className.replace(/count-\d+/,"count-"+g.totals.counts.total)}),0

    '+t+"

  • "),a.on("click",".notice.is-dismissible .notice-dismiss",function(){setTimeout(function(){a.removeClass("plugin-card-update-failed").find(".column-name a").focus()},200)}),s.removeClass("updating-message").addClass("button-disabled").attr("aria-label",u(d("%s installation failed","plugin"),s.data("name"))).text(h("Installation failed.")),c.a11y.speak(t,"assertive"),m.trigger("wp-plugin-install-error",e)))},c.updates.installImporterSuccess=function(e){c.updates.addAdminNotice({id:"install-success",className:"notice-success is-dismissible",message:u(h('Importer installed successfully. Run importer'),e.activateUrl+"&from=import")}),p('[data-slug="'+e.slug+'"]').removeClass("install-now updating-message").addClass("activate-now").attr({href:e.activateUrl+"&from=import","aria-label":u(h("Run %s"),e.pluginName)}).text(h("Run Importer")),c.a11y.speak(h("Installation completed successfully.")),m.trigger("wp-importer-install-success",e)},c.updates.installImporterError=function(e){var t=u(h("Installation failed: %s"),e.errorMessage),a=p('[data-slug="'+e.slug+'"]'),s=a.data("name");c.updates.isValidResponse(e,"install")&&(c.updates.maybeHandleCredentialError(e,"install-plugin")||(c.updates.addAdminNotice({id:e.errorCode,className:"notice-error is-dismissible",message:t}),a.removeClass("updating-message").attr("aria-label",u(d("Install %s now","plugin"),s)).text(h("Install Now")),c.a11y.speak(t,"assertive"),m.trigger("wp-importer-install-error",e)))},c.updates.deletePlugin=function(e){var t=p('[data-plugin="'+e.plugin+'"]').find(".row-actions a.delete");return e=_.extend({success:c.updates.deletePluginSuccess,error:c.updates.deletePluginError},e),t.html()!==h("Deleting...")&&t.data("originaltext",t.html()).text(h("Deleting...")),c.a11y.speak(h("Deleting...")),m.trigger("wp-plugin-deleting",e),c.updates.ajax("delete-plugin",e)},c.updates.deletePluginSuccess=function(i){p('[data-plugin="'+i.plugin+'"]').css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=p("#bulk-action-form"),t=p(".subsubsub"),a=p(this),s=e.find("thead th:not(.hidden), thead td").length,n=c.template("item-deleted-row"),l=g.plugins;a.hasClass("plugin-update-tr")||a.after(n({slug:i.slug,plugin:i.plugin,colspan:s,name:i.pluginName})),a.remove(),-1!==_.indexOf(l.upgrade,i.plugin)&&(l.upgrade=_.without(l.upgrade,i.plugin),c.updates.decrementCount("plugin")),-1!==_.indexOf(l.inactive,i.plugin)&&(l.inactive=_.without(l.inactive,i.plugin),l.inactive.length?t.find(".inactive .count").text("("+l.inactive.length+")"):t.find(".inactive").remove()),-1!==_.indexOf(l.active,i.plugin)&&(l.active=_.without(l.active,i.plugin),l.active.length?t.find(".active .count").text("("+l.active.length+")"):t.find(".active").remove()),-1!==_.indexOf(l.recently_activated,i.plugin)&&(l.recently_activated=_.without(l.recently_activated,i.plugin),l.recently_activated.length?t.find(".recently_activated .count").text("("+l.recently_activated.length+")"):t.find(".recently_activated").remove()),-1!==_.indexOf(l["auto-update-enabled"],i.plugin)&&(l["auto-update-enabled"]=_.without(l["auto-update-enabled"],i.plugin),l["auto-update-enabled"].length?t.find(".auto-update-enabled .count").text("("+l["auto-update-enabled"].length+")"):t.find(".auto-update-enabled").remove()),-1!==_.indexOf(l["auto-update-disabled"],i.plugin)&&(l["auto-update-disabled"]=_.without(l["auto-update-disabled"],i.plugin),l["auto-update-disabled"].length?t.find(".auto-update-disabled .count").text("("+l["auto-update-disabled"].length+")"):t.find(".auto-update-disabled").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(''+h("No plugins are currently available.")+""))}),c.a11y.speak(d("Deleted!","plugin")),m.trigger("wp-plugin-delete-success",i)},c.updates.deletePluginError=function(e){var t,a=c.template("item-update-row"),s=c.updates.adminNotice({className:"update-message notice-error notice-alt",message:e.errorMessage}),n=e.plugin?(t=p('tr.inactive[data-plugin="'+e.plugin+'"]')).siblings('[data-plugin="'+e.plugin+'"]'):(t=p('tr.inactive[data-slug="'+e.slug+'"]')).siblings('[data-slug="'+e.slug+'"]');c.updates.isValidResponse(e,"delete")&&(c.updates.maybeHandleCredentialError(e,"delete-plugin")||(n.length?(n.find(".notice-error").remove(),n.find(".plugin-update").append(s)):t.addClass("update").after(a({slug:e.slug,plugin:e.plugin||e.slug,colspan:p("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:s})),m.trigger("wp-plugin-delete-error",e)))},c.updates.updateTheme=function(e){var t;return e=_.extend({success:c.updates.updateThemeSuccess,error:c.updates.updateThemeError},e),(t="themes-network"===pagenow?p('[data-slug="'+e.slug+'"]').find(".update-message").removeClass("notice-error").addClass("updating-message notice-warning").find("p"):"customize"===pagenow?((t=p('[data-slug="'+e.slug+'"].notice').removeClass("notice-large")).find("h3").remove(),(t=t.add(p("#customize-control-installed_theme_"+e.slug).find(".update-message"))).addClass("updating-message").find("p")):((t=p("#update-theme").closest(".notice").removeClass("notice-large")).find("h3").remove(),(t=t.add(p('[data-slug="'+e.slug+'"]').find(".update-message"))).addClass("updating-message").find("p"))).html()!==h("Updating...")&&t.data("originaltext",t.html()),c.a11y.speak(h("Updating... please wait.")),t.text(h("Updating...")),m.trigger("wp-theme-updating",e),c.updates.ajax("update-theme",e)},c.updates.updateThemeSuccess=function(e){var t,a,s=p("body.modal-open").length,n=p('[data-slug="'+e.slug+'"]'),l={className:"updated-message notice-success notice-alt",message:d("Updated!","theme")};"customize"===pagenow?((n=p(".updating-message").siblings(".theme-name")).length&&(a=n.html().replace(e.oldVersion,e.newVersion),n.html(a)),t=p(".theme-info .notice").add(c.customize.control("installed_theme_"+e.slug).container.find(".theme").find(".update-message"))):"themes-network"===pagenow?(t=n.find(".update-message"),a=n.find(".theme-version-author-uri").html().replace(e.oldVersion,e.newVersion),n.find(".theme-version-author-uri").html(a),n.find(".auto-update-time").empty()):(t=p(".theme-info .notice").add(n.find(".update-message")),s?(p(".load-customize:visible").focus(),p(".theme-info .theme-autoupdate").find(".auto-update-time").empty()):n.find(".load-customize").focus()),c.updates.addAdminNotice(_.extend({selector:t},l)),c.a11y.speak(h("Update completed successfully.")),c.updates.decrementCount("theme"),m.trigger("wp-theme-update-success",e),s&&"customize"!==pagenow&&p(".theme-info .theme-author").after(c.updates.adminNotice(l))},c.updates.updateThemeError=function(e){var t,a=p('[data-slug="'+e.slug+'"]'),s=u(h("Update failed: %s"),e.errorMessage);c.updates.isValidResponse(e,"update")&&(c.updates.maybeHandleCredentialError(e,"update-theme")||("customize"===pagenow&&(a=c.customize.control("installed_theme_"+e.slug).container.find(".theme")),"themes-network"===pagenow?t=a.find(".update-message "):(t=p(".theme-info .notice").add(a.find(".notice")),(p("body.modal-open").length?p(".load-customize:visible"):a.find(".load-customize")).focus()),c.updates.addAdminNotice({selector:t,className:"update-message notice-error notice-alt is-dismissible",message:s}),c.a11y.speak(s),m.trigger("wp-theme-update-error",e)))},c.updates.installTheme=function(e){var t=p('.theme-install[data-slug="'+e.slug+'"]');return e=_.extend({success:c.updates.installThemeSuccess,error:c.updates.installThemeError},e),t.addClass("updating-message"),t.parents(".theme").addClass("focus"),t.html()!==h("Installing...")&&t.data("originaltext",t.html()),t.attr("aria-label",u(d("Installing %s...","theme"),t.data("name"))).text(h("Installing...")),c.a11y.speak(h("Installing... please wait.")),p('.install-theme-info, [data-slug="'+e.slug+'"]').removeClass("theme-install-failed").find(".notice.notice-error").remove(),m.trigger("wp-theme-installing",e),c.updates.ajax("install-theme",e)},c.updates.installThemeSuccess=function(e){var t,a=p(".wp-full-overlay-header, [data-slug="+e.slug+"]");m.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")),c.a11y.speak(h("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(h("Network Enable")):t.attr("aria-label",u(d("Activate %s","theme"),e.themeName)).text(h("Activate"))),e.customizeUrl&&t.siblings(".preview").replaceWith(function(){return p("").attr("href",e.customizeUrl).addClass("button load-customize").text(h("Live Preview"))})},1e3)},c.updates.installThemeError=function(e){var t,a=u(h("Installation failed: %s"),e.errorMessage),s=c.updates.adminNotice({className:"update-message notice-error notice-alt",message:a});c.updates.isValidResponse(e,"install")&&(c.updates.maybeHandleCredentialError(e,"install-theme")||("customize"===pagenow?(m.find("body").hasClass("modal-open")?(t=p('.theme-install[data-slug="'+e.slug+'"]'),p(".theme-overlay .theme-info").prepend(s)):(t=p('.theme-install[data-slug="'+e.slug+'"]')).closest(".theme").addClass("theme-install-failed").append(s),c.customize.notifications.remove("theme_installing")):m.find("body").hasClass("full-overlay-active")?(t=p('.theme-install[data-slug="'+e.slug+'"]'),p(".install-theme-info").prepend(s)):t=p('[data-slug="'+e.slug+'"]').removeClass("focus").addClass("theme-install-failed").append(s).find(".theme-install"),t.removeClass("updating-message").attr("aria-label",u(d("%s installation failed","theme"),t.data("name"))).text(h("Installation failed.")),c.a11y.speak(a,"assertive"),m.trigger("wp-theme-install-error",e)))},c.updates.deleteTheme=function(e){var t;return"themes"===pagenow?t=p(".theme-actions .delete-theme"):"themes-network"===pagenow&&(t=p('[data-slug="'+e.slug+'"]').find(".row-actions a.delete")),e=_.extend({success:c.updates.deleteThemeSuccess,error:c.updates.deleteThemeError},e),t&&t.html()!==h("Deleting...")&&t.data("originaltext",t.html()).text(h("Deleting...")),c.a11y.speak(h("Deleting...")),p(".theme-info .update-message").remove(),m.trigger("wp-theme-deleting",e),c.updates.ajax("delete-theme",e)},c.updates.deleteThemeSuccess=function(n){var e=p('[data-slug="'+n.slug+'"]');"themes-network"===pagenow&&e.css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=p(".subsubsub"),t=p(this),a=g.themes,s=c.template("item-deleted-row");t.hasClass("plugin-update-tr")||t.after(s({slug:n.slug,colspan:p("#bulk-action-form").find("thead th:not(.hidden), thead td").length,name:t.find(".theme-title strong").text()})),t.remove(),-1!==_.indexOf(a.upgrade,n.slug)&&(a.upgrade=_.without(a.upgrade,n.slug),c.updates.decrementCount("theme")),-1!==_.indexOf(a.disabled,n.slug)&&(a.disabled=_.without(a.disabled,n.slug),a.disabled.length?e.find(".disabled .count").text("("+a.disabled.length+")"):e.find(".disabled").remove()),-1!==_.indexOf(a["auto-update-enabled"],n.slug)&&(a["auto-update-enabled"]=_.without(a["auto-update-enabled"],n.slug),a["auto-update-enabled"].length?e.find(".auto-update-enabled .count").text("("+a["auto-update-enabled"].length+")"):e.find(".auto-update-enabled").remove()),-1!==_.indexOf(a["auto-update-disabled"],n.slug)&&(a["auto-update-disabled"]=_.without(a["auto-update-disabled"],n.slug),a["auto-update-disabled"].length?e.find(".auto-update-disabled .count").text("("+a["auto-update-disabled"].length+")"):e.find(".auto-update-disabled").remove()),a.all=_.without(a.all,n.slug),e.find(".all .count").text("("+a.all.length+")")}),c.a11y.speak(d("Deleted!","theme")),m.trigger("wp-theme-delete-success",n)},c.updates.deleteThemeError=function(e){var t=p('tr.inactive[data-slug="'+e.slug+'"]'),a=p(".theme-actions .delete-theme"),s=c.template("item-update-row"),n=t.siblings("#"+e.slug+"-update"),l=u(h("Deletion failed: %s"),e.errorMessage),i=c.updates.adminNotice({className:"update-message notice-error notice-alt",message:l});c.updates.maybeHandleCredentialError(e,"delete-theme")||("themes-network"===pagenow?n.length?(n.find(".notice-error").remove(),n.find(".plugin-update").append(i)):t.addClass("update").after(s({slug:e.slug,colspan:p("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:i})):p(".theme-info .theme-description").before(i),a.html(a.data("originaltext")),c.a11y.speak(l,"assertive"),m.trigger("wp-theme-delete-error",e))},c.updates._addCallbacks=function(e,t){return"import"===pagenow&&"install-plugin"===t&&(e.success=c.updates.installImporterSuccess,e.error=c.updates.installImporterError),e},c.updates.queueChecker=function(){var e;if(!c.updates.ajaxLocked&&c.updates.queue.length)switch((e=c.updates.queue.shift()).action){case"install-plugin":c.updates.installPlugin(e.data);break;case"update-plugin":c.updates.updatePlugin(e.data);break;case"delete-plugin":c.updates.deletePlugin(e.data);break;case"install-theme":c.updates.installTheme(e.data);break;case"update-theme":c.updates.updateTheme(e.data);break;case"delete-theme":c.updates.deleteTheme(e.data)}},c.updates.requestFilesystemCredentials=function(e){!1===c.updates.filesystemCredentials.available&&(e&&!c.updates.$elToReturnFocusToFromCredentialsModal&&(c.updates.$elToReturnFocusToFromCredentialsModal=p(e.target)),c.updates.ajaxLocked=!0,c.updates.requestForCredentialsModalOpen())},c.updates.maybeRequestFilesystemCredentials=function(e){c.updates.shouldRequestFilesystemCredentials&&!c.updates.ajaxLocked&&c.updates.requestFilesystemCredentials(e)},c.updates.keydown=function(e){27===e.keyCode?c.updates.requestForCredentialsModalCancel():9===e.keyCode&&("upgrade"!==e.target.id||e.shiftKey?"hostname"===e.target.id&&e.shiftKey&&(p("#upgrade").focus(),e.preventDefault()):(p("#hostname").focus(),e.preventDefault()))},c.updates.requestForCredentialsModalOpen=function(){var e=p("#request-filesystem-credentials-dialog");p("body").addClass("modal-open"),e.show(),e.find("input:enabled:first").focus(),e.on("keydown",c.updates.keydown)},c.updates.requestForCredentialsModalClose=function(){p("#request-filesystem-credentials-dialog").hide(),p("body").removeClass("modal-open"),c.updates.$elToReturnFocusToFromCredentialsModal&&c.updates.$elToReturnFocusToFromCredentialsModal.focus()},c.updates.requestForCredentialsModalCancel=function(){(c.updates.ajaxLocked||c.updates.queue.length)&&(_.each(c.updates.queue,function(e){m.trigger("credential-modal-cancel",e)}),c.updates.ajaxLocked=!1,c.updates.queue=[],c.updates.requestForCredentialsModalClose())},c.updates.showErrorInCredentialsForm=function(e){var t=p("#request-filesystem-credentials-form");t.find(".notice").remove(),t.find("#request-filesystem-credentials-title").after('

    '+e+"

    ")},c.updates.credentialError=function(e,t){e=c.updates._addCallbacks(e,t),c.updates.queue.unshift({action:t,data:e}),c.updates.filesystemCredentials.available=!1,c.updates.showErrorInCredentialsForm(e.errorMessage),c.updates.requestFilesystemCredentials()},c.updates.maybeHandleCredentialError=function(e,t){return!(!c.updates.shouldRequestFilesystemCredentials||!e.errorCode||"unable_to_connect_to_filesystem"!==e.errorCode)&&(c.updates.credentialError(e,t),!0)},c.updates.isValidResponse=function(e,t){var a,s=h("Something went wrong.");if(_.isObject(e)&&!_.isFunction(e.always))return!0;switch(_.isString(e)&&"-1"===e?s=h("An error has occurred. Please reload the page and try again."):_.isString(e)?s=e:void 0!==e.readyState&&0===e.readyState?s=h("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=h("Update failed: %s");break;case"install":a=h("Installation failed: %s");break;case"delete":a=h("Deletion failed: %s")}return s=s.replace(/<[\/a-z][^<>]*>/gi,""),a=a.replace("%s",s),c.updates.addAdminNotice({id:"unknown_error",className:"notice-error is-dismissible",message:_.escape(a)}),c.updates.ajaxLocked=!1,c.updates.queue=[],p(".button.updating-message").removeClass("updating-message").removeAttr("aria-label").prop("disabled",!0).text(h("Update failed.")),p(".updating-message:not(.button):not(.thickbox)").removeClass("updating-message notice-warning").addClass("notice-error").find("p").removeAttr("aria-label").text(a),c.a11y.speak(a,"assertive"),!1},c.updates.beforeunload=function(){if(c.updates.ajaxLocked)return h("Updates may not complete if you navigate away from this page.")},p(function(){var l=p("#plugin-filter"),o=p("#bulk-action-form"),e=p("#request-filesystem-credentials-form"),t=p("#request-filesystem-credentials-dialog"),a=p(".plugins-php .wp-filter-search"),s=p(".plugin-install-php .wp-filter-search");(g=_.extend(g,window._wpUpdatesItemCounts||{})).totals&&c.updates.refreshCount(),c.updates.shouldRequestFilesystemCredentials=0").html(a.find("p").data("originaltext"))),a.removeClass("updating-message").html(s),"plugin-install"!==pagenow&&"plugin-install-network"!==pagenow||("update-plugin"===t.action?a.attr("aria-label",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"))))),c.a11y.speak(h("Update canceled."))}),o.on("click","[data-plugin] .update-link",function(e){var t=p(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.maybeRequestFilesystemCredentials(e),c.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),c.updates.updatePlugin({plugin:a.data("plugin"),slug:a.data("slug")}))}),l.on("click",".update-now",function(e){var t=p(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.maybeRequestFilesystemCredentials(e),c.updates.updatePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),l.on("click",".install-now",function(e){var t=p(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.shouldRequestFilesystemCredentials&&!c.updates.ajaxLocked&&(c.updates.requestFilesystemCredentials(e),m.on("credential-modal-cancel",function(){p(".install-now.updating-message").removeClass("updating-message").text(h("Install Now")),c.a11y.speak(h("Update canceled."))})),c.updates.installPlugin({slug:t.data("slug")}))}),m.on("click",".importer-item .install-now",function(e){var t=p(e.target),a=p(this).data("name");e.preventDefault(),t.hasClass("updating-message")||(c.updates.shouldRequestFilesystemCredentials&&!c.updates.ajaxLocked&&(c.updates.requestFilesystemCredentials(e),m.on("credential-modal-cancel",function(){t.removeClass("updating-message").attr("aria-label",u(d("Install %s now","plugin"),a)).text(h("Install Now")),c.a11y.speak(h("Update canceled."))})),c.updates.installPlugin({slug:t.data("slug"),pagenow:pagenow,success:c.updates.installImporterSuccess,error:c.updates.installImporterError}))}),o.on("click","[data-plugin] a.delete",function(e){var t=p(e.target).parents("tr"),a=t.hasClass("is-uninstallable")?u(h("Are you sure you want to delete %s and its data?"),t.find(".plugin-title strong").text()):u(h("Are you sure you want to delete %s?"),t.find(".plugin-title strong").text());e.preventDefault(),window.confirm(a)&&(c.updates.maybeRequestFilesystemCredentials(e),c.updates.deletePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),m.on("click",".themes-php.network-admin .update-link",function(e){var t=p(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.maybeRequestFilesystemCredentials(e),c.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),c.updates.updateTheme({slug:a.data("slug")}))}),m.on("click",".themes-php.network-admin a.delete",function(e){var t=p(e.target).parents("tr"),a=u(h("Are you sure you want to delete %s?"),t.find(".theme-title strong").text());e.preventDefault(),window.confirm(a)&&(c.updates.maybeRequestFilesystemCredentials(e),c.updates.deleteTheme({slug:t.data("slug")}))}),o.on("click",'[type="submit"]:not([name="clear-recent-list"])',function(e){var t,s,n=p(e.target).siblings("select").val(),a=o.find('input[name="checked[]"]:checked'),l=0,i=0,d=[];switch(pagenow){case"plugins":case"plugins-network":t="plugin";break;case"themes-network":t="theme";break;default:return}if(!a.length)return e.preventDefault(),p("html, body").animate({scrollTop:0}),c.updates.addAdminNotice({id:"no-items-selected",className:"notice-error is-dismissible",message:h("Please select at least one item to perform this action on.")});switch(n){case"update-selected":s=n.replace("selected",t);break;case"delete-selected":var u=h("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(u))return void e.preventDefault();s=n.replace("selected",t);break;default:return}c.updates.maybeRequestFilesystemCredentials(e),e.preventDefault(),o.find('.manage-column [type="checkbox"]').prop("checked",!1),m.trigger("wp-"+t+"-bulk-"+n,a),a.each(function(e,t){var a=p(t),t=a.parents("tr");"update-selected"!==n||t.hasClass("update")&&!t.find("notice-error").length?c.updates.queue.push({action:s,data:{plugin:t.data("plugin"),slug:t.data("slug")}}):a.prop("checked",!1)}),m.on("wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error",function(e,t){var a,s=p('[data-slug="'+t.slug+'"]');"wp-"+t.update+"-update-success"===e.type?l++:(e=t.pluginName||s.find(".column-primary strong").text(),i++,d.push(e+": "+t.errorMessage)),s.find('input[name="checked[]"]:checked').prop("checked",!1),c.updates.adminNotice=c.template("wp-bulk-updates-admin-notice"),c.updates.addAdminNotice({id:"bulk-action-notice",className:"bulk-action-notice",successes:l,errors:i,errorMessages:d,type:t.update}),a=p("#bulk-action-notice").on("click","button",function(){p(this).toggleClass("bulk-action-errors-collapsed").attr("aria-expanded",!p(this).hasClass("bulk-action-errors-collapsed")),a.find(".bulk-action-errors").toggleClass("hidden")}),0').append(p("
    ",{class:"current",href:n,text:h("Search Results")})),p(".wp-filter .filter-links .current").removeClass("current").parents(".filter-links").prepend(a),l.prev("p").remove(),p(".plugins-popular-tags-wrapper").remove()),void 0!==c.updates.searchRequest&&c.updates.searchRequest.abort(),p("body").addClass("loading-content"),c.updates.searchRequest=c.ajax.post("search-install-plugins",s).done(function(e){p("body").removeClass("loading-content"),l.append(e.items),delete c.updates.searchRequest,0===e.count?c.a11y.speak(h("You do not appear to have any plugins available at this time.")):c.a11y.speak(u(h("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 s={_ajax_nonce:c.updates.ajaxNonce,s:e.target.value,pagenow:pagenow,plugin_status:"all"};"keyup"===e.type&&27===e.which&&(e.target.value=""),c.updates.searchTerm!==s.s&&(c.updates.searchTerm=s.s,e=_.object(_.compact(_.map(location.search.slice(1).split("&"),function(e){if(e)return e.split("=")}))),s.plugin_status=e.plugin_status||"all",window.history&&window.history.replaceState&&window.history.replaceState(null,"",location.href.split("?")[0]+"?s="+s.s+"&plugin_status="+s.plugin_status),void 0!==c.updates.searchRequest&&c.updates.searchRequest.abort(),o.empty(),p("body").addClass("loading-content"),p(".subsubsub .current").removeClass("current"),c.updates.searchRequest=c.ajax.post("search-plugins",s).done(function(e){var t=p("").addClass("subtitle").html(u(h("Search results for: %s"),""+_.escape(s.s)+"")),a=p(".wrap .subtitle");s.s.length?a.length?a.replaceWith(t):p(".wp-header-end").before(t):(a.remove(),p(".subsubsub ."+s.plugin_status+" a").addClass("current")),p("body").removeClass("loading-content"),o.append(e.items),delete c.updates.searchRequest,0===e.count?c.a11y.speak(h("No plugins found. Try a different search.")):c.a11y.speak(u(h("Number of plugins found: %d"),e.count))}))},500)),m.on("submit",".search-plugins",function(e){e.preventDefault(),p("input.wp-filter-search").trigger("input")}),m.on("click",".try-again",function(e){e.preventDefault(),s.trigger("input")}),p("#typeselector").on("change",function(){var e=p('input[name="s"]');e.val().length&&e.trigger("input","typechange")}),p("#plugin_update_from_iframe").on("click",function(e){var t=window.parent===window?null:window.parent;p.support.postMessage=!!window.postMessage,!1!==p.support.postMessage&&null!==t&&-1===window.parent.location.pathname.indexOf("update-core.php")&&(e.preventDefault(),e={action:"update-plugin",data:{plugin:p(this).data("plugin"),slug:p(this).data("slug")}},t.postMessage(JSON.stringify(e),window.location.origin))}),p("#plugin_install_from_iframe").on("click",function(e){var t=window.parent===window?null:window.parent;p.support.postMessage=!!window.postMessage,!1!==p.support.postMessage&&null!==t&&-1===window.parent.location.pathname.indexOf("index.php")&&(e.preventDefault(),e={action:"install-plugin",data:{slug:p(this).data("slug")}},t.postMessage(JSON.stringify(e),window.location.origin))}),p(window).on("message",function(e){var t,a=e.originalEvent,e=document.location.protocol+"//"+document.location.host;if(a.origin===e){try{t=JSON.parse(a.data)}catch(e){return}if(t&&void 0!==t.action)switch(t.action){case"decrementUpdateCount":c.updates.decrementCount(t.upgradeType);break;case"install-plugin":case"update-plugin":window.tb_remove(),t.data=c.updates._addCallbacks(t.data,t.action),c.updates.queue.push(t),c.updates.queueChecker()}}}),p(window).on("beforeunload",c.updates.beforeunload),m.on("keydown",".column-auto-updates .toggle-auto-update, .theme-overlay .toggle-auto-update",function(e){32===e.which&&e.preventDefault()}),m.on("click keyup",".column-auto-updates .toggle-auto-update, .theme-overlay .toggle-auto-update",function(e){var l,i,d,u=p(this),o=u.attr("data-wp-action"),r=u.find(".label");if(("keyup"!==e.type||32===e.which)&&(d="themes"!==pagenow?u.closest(".column-auto-updates"):u.closest(".theme-autoupdate"),e.preventDefault(),"yes"!==u.attr("data-doing-ajax"))){switch(u.attr("data-doing-ajax","yes"),pagenow){case"plugins":case"plugins-network":i="plugin",l=u.closest("tr").attr("data-plugin");break;case"themes-network":i="theme",l=u.closest("tr").attr("data-slug");break;case"themes":i="theme",l=u.attr("data-slug")}d.find(".notice.notice-error").addClass("hidden"),"enable"===o?r.text(h("Enabling...")):r.text(h("Disabling...")),u.find(".dashicons-update").removeClass("hidden"),e={action:"toggle-auto-updates",_ajax_nonce:g.ajax_nonce,state:o,type:i,asset:l},p.post(window.ajaxurl,e).done(function(e){var t,a,s,n=u.attr("href");if(!e.success)return s=e.data&&e.data.error?e.data.error:h("The request could not be completed."),d.find(".notice.notice-error").removeClass("hidden").find("p").text(s),void c.a11y.speak(s,"assertive");if("themes"!==pagenow){switch(e=p(".auto-update-enabled span"),s=p(".auto-update-disabled span"),t=parseInt(e.text().replace(/[^\d]+/g,""),10)||0,a=parseInt(s.text().replace(/[^\d]+/g,""),10)||0,o){case"enable":++t,--a;break;case"disable":--t,++a}t=Math.max(0,t),a=Math.max(0,a),e.text("("+t+")"),s.text("("+a+")")}"enable"===o?(u[0].hasAttribute("href")&&(n=n.replace("action=enable-auto-update","action=disable-auto-update"),u.attr("href",n)),u.attr("data-wp-action","disable"),r.text(h("Disable auto-updates")),d.find(".auto-update-time").removeClass("hidden"),c.a11y.speak(h("Auto-updates enabled"))):(u[0].hasAttribute("href")&&(n=n.replace("action=disable-auto-update","action=enable-auto-update"),u.attr("href",n)),u.attr("data-wp-action","enable"),r.text(h("Enable auto-updates")),d.find(".auto-update-time").addClass("hidden"),c.a11y.speak(h("Auto-updates disabled"))),m.trigger("wp-auto-update-setting-changed",{state:o,type:i,asset:l})}).fail(function(){d.find(".notice.notice-error").removeClass("hidden").find("p").text(h("The request could not be completed.")),c.a11y.speak(h("The request could not be completed."),"assertive")}).always(function(){u.removeAttr("data-doing-ajax").find(".dashicons-update").addClass("hidden")})}})})}(jQuery,window.wp,window._wpUpdatesSettings); \ No newline at end of file +!function(p,c,g){var m=p(document),h=c.i18n.__,d=c.i18n._x,u=c.i18n.sprintf;(c=c||{}).updates={},c.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:""},c.updates.l10n=window.wp.deprecateL10nObject("wp.updates.l10n",c.updates.l10n,"5.5.0"),c.updates.ajaxNonce=g.ajax_nonce,c.updates.searchTerm="",c.updates.shouldRequestFilesystemCredentials=!1,c.updates.filesystemCredentials={ftp:{host:"",username:"",password:"",connectionType:""},ssh:{publicKey:"",privateKey:""},fsNonce:"",available:!1},c.updates.ajaxLocked=!1,c.updates.adminNotice=c.template("wp-updates-admin-notice"),c.updates.queue=[],c.updates.$elToReturnFocusToFromCredentialsModal=void 0,c.updates.addAdminNotice=function(e){var t,a=p(e.selector),s=p(".wp-header-end");delete e.selector,t=c.updates.adminNotice(e),(a=!a.length?p("#"+e.id):a).length?a.replaceWith(t):s.length?s.after(t):"customize"===pagenow?p(".customize-themes-notifications").append(t):p(".wrap").find("> h1").after(t),m.trigger("wp-updates-notice-added")},c.updates.ajax=function(e,t){var a={};return c.updates.ajaxLocked?(c.updates.queue.push({action:e,data:t}),p.Deferred()):(c.updates.ajaxLocked=!0,t.success&&(a.success=t.success,delete t.success),t.error&&(a.error=t.error,delete t.error),a.data=_.extend(t,{action:e,_ajax_nonce:c.updates.ajaxNonce,_fs_nonce:c.updates.filesystemCredentials.fsNonce,username:c.updates.filesystemCredentials.ftp.username,password:c.updates.filesystemCredentials.ftp.password,hostname:c.updates.filesystemCredentials.ftp.hostname,connection_type:c.updates.filesystemCredentials.ftp.connectionType,public_key:c.updates.filesystemCredentials.ssh.publicKey,private_key:c.updates.filesystemCredentials.ssh.privateKey}),c.ajax.send(a).always(c.updates.ajaxAlways))},c.updates.ajaxAlways=function(e){e.errorCode&&"unable_to_connect_to_filesystem"===e.errorCode||(c.updates.ajaxLocked=!1,c.updates.queueChecker()),void 0!==e.debug&&window.console&&window.console.log&&_.map(e.debug,function(e){window.console.log(c.sanitize.stripTagsAndEncodeText(e))})},c.updates.refreshCount=function(){var e,t=p("#wp-admin-bar-updates"),a=p('a[href="update-core.php"] .update-plugins'),s=p('a[href="plugins.php"] .update-plugins'),n=p('a[href="themes.php"] .update-plugins');t.find(".ab-item").removeAttr("title"),t.find(".ab-label").text(g.totals.counts.total),0===g.totals.counts.total&&t.find(".ab-label").parents("li").remove(),a.each(function(e,t){t.className=t.className.replace(/count-\d+/,"count-"+g.totals.counts.total)}),0

    '+t+"

    "),a.on("click",".notice.is-dismissible .notice-dismiss",function(){setTimeout(function(){a.removeClass("plugin-card-update-failed").find(".column-name a").trigger("focus")},200)}),s.removeClass("updating-message").addClass("button-disabled").attr("aria-label",u(d("%s installation failed","plugin"),s.data("name"))).text(h("Installation failed.")),c.a11y.speak(t,"assertive"),m.trigger("wp-plugin-install-error",e)))},c.updates.installImporterSuccess=function(e){c.updates.addAdminNotice({id:"install-success",className:"notice-success is-dismissible",message:u(h('Importer installed successfully. Run importer'),e.activateUrl+"&from=import")}),p('[data-slug="'+e.slug+'"]').removeClass("install-now updating-message").addClass("activate-now").attr({href:e.activateUrl+"&from=import","aria-label":u(h("Run %s"),e.pluginName)}).text(h("Run Importer")),c.a11y.speak(h("Installation completed successfully.")),m.trigger("wp-importer-install-success",e)},c.updates.installImporterError=function(e){var t=u(h("Installation failed: %s"),e.errorMessage),a=p('[data-slug="'+e.slug+'"]'),s=a.data("name");c.updates.isValidResponse(e,"install")&&(c.updates.maybeHandleCredentialError(e,"install-plugin")||(c.updates.addAdminNotice({id:e.errorCode,className:"notice-error is-dismissible",message:t}),a.removeClass("updating-message").attr("aria-label",u(d("Install %s now","plugin"),s)).text(h("Install Now")),c.a11y.speak(t,"assertive"),m.trigger("wp-importer-install-error",e)))},c.updates.deletePlugin=function(e){var t=p('[data-plugin="'+e.plugin+'"]').find(".row-actions a.delete");return e=_.extend({success:c.updates.deletePluginSuccess,error:c.updates.deletePluginError},e),t.html()!==h("Deleting...")&&t.data("originaltext",t.html()).text(h("Deleting...")),c.a11y.speak(h("Deleting...")),m.trigger("wp-plugin-deleting",e),c.updates.ajax("delete-plugin",e)},c.updates.deletePluginSuccess=function(i){p('[data-plugin="'+i.plugin+'"]').css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=p("#bulk-action-form"),t=p(".subsubsub"),a=p(this),s=e.find("thead th:not(.hidden), thead td").length,n=c.template("item-deleted-row"),l=g.plugins;a.hasClass("plugin-update-tr")||a.after(n({slug:i.slug,plugin:i.plugin,colspan:s,name:i.pluginName})),a.remove(),-1!==_.indexOf(l.upgrade,i.plugin)&&(l.upgrade=_.without(l.upgrade,i.plugin),c.updates.decrementCount("plugin")),-1!==_.indexOf(l.inactive,i.plugin)&&(l.inactive=_.without(l.inactive,i.plugin),l.inactive.length?t.find(".inactive .count").text("("+l.inactive.length+")"):t.find(".inactive").remove()),-1!==_.indexOf(l.active,i.plugin)&&(l.active=_.without(l.active,i.plugin),l.active.length?t.find(".active .count").text("("+l.active.length+")"):t.find(".active").remove()),-1!==_.indexOf(l.recently_activated,i.plugin)&&(l.recently_activated=_.without(l.recently_activated,i.plugin),l.recently_activated.length?t.find(".recently_activated .count").text("("+l.recently_activated.length+")"):t.find(".recently_activated").remove()),-1!==_.indexOf(l["auto-update-enabled"],i.plugin)&&(l["auto-update-enabled"]=_.without(l["auto-update-enabled"],i.plugin),l["auto-update-enabled"].length?t.find(".auto-update-enabled .count").text("("+l["auto-update-enabled"].length+")"):t.find(".auto-update-enabled").remove()),-1!==_.indexOf(l["auto-update-disabled"],i.plugin)&&(l["auto-update-disabled"]=_.without(l["auto-update-disabled"],i.plugin),l["auto-update-disabled"].length?t.find(".auto-update-disabled .count").text("("+l["auto-update-disabled"].length+")"):t.find(".auto-update-disabled").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(''+h("No plugins are currently available.")+""))}),c.a11y.speak(d("Deleted!","plugin")),m.trigger("wp-plugin-delete-success",i)},c.updates.deletePluginError=function(e){var t,a=c.template("item-update-row"),s=c.updates.adminNotice({className:"update-message notice-error notice-alt",message:e.errorMessage}),n=e.plugin?(t=p('tr.inactive[data-plugin="'+e.plugin+'"]')).siblings('[data-plugin="'+e.plugin+'"]'):(t=p('tr.inactive[data-slug="'+e.slug+'"]')).siblings('[data-slug="'+e.slug+'"]');c.updates.isValidResponse(e,"delete")&&(c.updates.maybeHandleCredentialError(e,"delete-plugin")||(n.length?(n.find(".notice-error").remove(),n.find(".plugin-update").append(s)):t.addClass("update").after(a({slug:e.slug,plugin:e.plugin||e.slug,colspan:p("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:s})),m.trigger("wp-plugin-delete-error",e)))},c.updates.updateTheme=function(e){var t;return e=_.extend({success:c.updates.updateThemeSuccess,error:c.updates.updateThemeError},e),(t="themes-network"===pagenow?p('[data-slug="'+e.slug+'"]').find(".update-message").removeClass("notice-error").addClass("updating-message notice-warning").find("p"):"customize"===pagenow?((t=p('[data-slug="'+e.slug+'"].notice').removeClass("notice-large")).find("h3").remove(),(t=t.add(p("#customize-control-installed_theme_"+e.slug).find(".update-message"))).addClass("updating-message").find("p")):((t=p("#update-theme").closest(".notice").removeClass("notice-large")).find("h3").remove(),(t=t.add(p('[data-slug="'+e.slug+'"]').find(".update-message"))).addClass("updating-message").find("p"))).html()!==h("Updating...")&&t.data("originaltext",t.html()),c.a11y.speak(h("Updating... please wait.")),t.text(h("Updating...")),m.trigger("wp-theme-updating",e),c.updates.ajax("update-theme",e)},c.updates.updateThemeSuccess=function(e){var t,a,s=p("body.modal-open").length,n=p('[data-slug="'+e.slug+'"]'),l={className:"updated-message notice-success notice-alt",message:d("Updated!","theme")};"customize"===pagenow?((n=p(".updating-message").siblings(".theme-name")).length&&(a=n.html().replace(e.oldVersion,e.newVersion),n.html(a)),t=p(".theme-info .notice").add(c.customize.control("installed_theme_"+e.slug).container.find(".theme").find(".update-message"))):"themes-network"===pagenow?(t=n.find(".update-message"),a=n.find(".theme-version-author-uri").html().replace(e.oldVersion,e.newVersion),n.find(".theme-version-author-uri").html(a),n.find(".auto-update-time").empty()):(t=p(".theme-info .notice").add(n.find(".update-message")),s?(p(".load-customize:visible").trigger("focus"),p(".theme-info .theme-autoupdate").find(".auto-update-time").empty()):n.find(".load-customize").trigger("focus")),c.updates.addAdminNotice(_.extend({selector:t},l)),c.a11y.speak(h("Update completed successfully.")),c.updates.decrementCount("theme"),m.trigger("wp-theme-update-success",e),s&&"customize"!==pagenow&&p(".theme-info .theme-author").after(c.updates.adminNotice(l))},c.updates.updateThemeError=function(e){var t,a=p('[data-slug="'+e.slug+'"]'),s=u(h("Update failed: %s"),e.errorMessage);c.updates.isValidResponse(e,"update")&&(c.updates.maybeHandleCredentialError(e,"update-theme")||("customize"===pagenow&&(a=c.customize.control("installed_theme_"+e.slug).container.find(".theme")),"themes-network"===pagenow?t=a.find(".update-message "):(t=p(".theme-info .notice").add(a.find(".notice")),(p("body.modal-open").length?p(".load-customize:visible"):a.find(".load-customize")).trigger("focus")),c.updates.addAdminNotice({selector:t,className:"update-message notice-error notice-alt is-dismissible",message:s}),c.a11y.speak(s),m.trigger("wp-theme-update-error",e)))},c.updates.installTheme=function(e){var t=p('.theme-install[data-slug="'+e.slug+'"]');return e=_.extend({success:c.updates.installThemeSuccess,error:c.updates.installThemeError},e),t.addClass("updating-message"),t.parents(".theme").addClass("focus"),t.html()!==h("Installing...")&&t.data("originaltext",t.html()),t.attr("aria-label",u(d("Installing %s...","theme"),t.data("name"))).text(h("Installing...")),c.a11y.speak(h("Installing... please wait.")),p('.install-theme-info, [data-slug="'+e.slug+'"]').removeClass("theme-install-failed").find(".notice.notice-error").remove(),m.trigger("wp-theme-installing",e),c.updates.ajax("install-theme",e)},c.updates.installThemeSuccess=function(e){var t,a=p(".wp-full-overlay-header, [data-slug="+e.slug+"]");m.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")),c.a11y.speak(h("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(h("Network Enable")):t.attr("aria-label",u(d("Activate %s","theme"),e.themeName)).text(h("Activate"))),e.customizeUrl&&t.siblings(".preview").replaceWith(function(){return p("").attr("href",e.customizeUrl).addClass("button load-customize").text(h("Live Preview"))})},1e3)},c.updates.installThemeError=function(e){var t,a=u(h("Installation failed: %s"),e.errorMessage),s=c.updates.adminNotice({className:"update-message notice-error notice-alt",message:a});c.updates.isValidResponse(e,"install")&&(c.updates.maybeHandleCredentialError(e,"install-theme")||("customize"===pagenow?(m.find("body").hasClass("modal-open")?(t=p('.theme-install[data-slug="'+e.slug+'"]'),p(".theme-overlay .theme-info").prepend(s)):(t=p('.theme-install[data-slug="'+e.slug+'"]')).closest(".theme").addClass("theme-install-failed").append(s),c.customize.notifications.remove("theme_installing")):m.find("body").hasClass("full-overlay-active")?(t=p('.theme-install[data-slug="'+e.slug+'"]'),p(".install-theme-info").prepend(s)):t=p('[data-slug="'+e.slug+'"]').removeClass("focus").addClass("theme-install-failed").append(s).find(".theme-install"),t.removeClass("updating-message").attr("aria-label",u(d("%s installation failed","theme"),t.data("name"))).text(h("Installation failed.")),c.a11y.speak(a,"assertive"),m.trigger("wp-theme-install-error",e)))},c.updates.deleteTheme=function(e){var t;return"themes"===pagenow?t=p(".theme-actions .delete-theme"):"themes-network"===pagenow&&(t=p('[data-slug="'+e.slug+'"]').find(".row-actions a.delete")),e=_.extend({success:c.updates.deleteThemeSuccess,error:c.updates.deleteThemeError},e),t&&t.html()!==h("Deleting...")&&t.data("originaltext",t.html()).text(h("Deleting...")),c.a11y.speak(h("Deleting...")),p(".theme-info .update-message").remove(),m.trigger("wp-theme-deleting",e),c.updates.ajax("delete-theme",e)},c.updates.deleteThemeSuccess=function(n){var e=p('[data-slug="'+n.slug+'"]');"themes-network"===pagenow&&e.css({backgroundColor:"#faafaa"}).fadeOut(350,function(){var e=p(".subsubsub"),t=p(this),a=g.themes,s=c.template("item-deleted-row");t.hasClass("plugin-update-tr")||t.after(s({slug:n.slug,colspan:p("#bulk-action-form").find("thead th:not(.hidden), thead td").length,name:t.find(".theme-title strong").text()})),t.remove(),-1!==_.indexOf(a.upgrade,n.slug)&&(a.upgrade=_.without(a.upgrade,n.slug),c.updates.decrementCount("theme")),-1!==_.indexOf(a.disabled,n.slug)&&(a.disabled=_.without(a.disabled,n.slug),a.disabled.length?e.find(".disabled .count").text("("+a.disabled.length+")"):e.find(".disabled").remove()),-1!==_.indexOf(a["auto-update-enabled"],n.slug)&&(a["auto-update-enabled"]=_.without(a["auto-update-enabled"],n.slug),a["auto-update-enabled"].length?e.find(".auto-update-enabled .count").text("("+a["auto-update-enabled"].length+")"):e.find(".auto-update-enabled").remove()),-1!==_.indexOf(a["auto-update-disabled"],n.slug)&&(a["auto-update-disabled"]=_.without(a["auto-update-disabled"],n.slug),a["auto-update-disabled"].length?e.find(".auto-update-disabled .count").text("("+a["auto-update-disabled"].length+")"):e.find(".auto-update-disabled").remove()),a.all=_.without(a.all,n.slug),e.find(".all .count").text("("+a.all.length+")")}),c.a11y.speak(d("Deleted!","theme")),m.trigger("wp-theme-delete-success",n)},c.updates.deleteThemeError=function(e){var t=p('tr.inactive[data-slug="'+e.slug+'"]'),a=p(".theme-actions .delete-theme"),s=c.template("item-update-row"),n=t.siblings("#"+e.slug+"-update"),l=u(h("Deletion failed: %s"),e.errorMessage),i=c.updates.adminNotice({className:"update-message notice-error notice-alt",message:l});c.updates.maybeHandleCredentialError(e,"delete-theme")||("themes-network"===pagenow?n.length?(n.find(".notice-error").remove(),n.find(".plugin-update").append(i)):t.addClass("update").after(s({slug:e.slug,colspan:p("#bulk-action-form").find("thead th:not(.hidden), thead td").length,content:i})):p(".theme-info .theme-description").before(i),a.html(a.data("originaltext")),c.a11y.speak(l,"assertive"),m.trigger("wp-theme-delete-error",e))},c.updates._addCallbacks=function(e,t){return"import"===pagenow&&"install-plugin"===t&&(e.success=c.updates.installImporterSuccess,e.error=c.updates.installImporterError),e},c.updates.queueChecker=function(){var e;if(!c.updates.ajaxLocked&&c.updates.queue.length)switch((e=c.updates.queue.shift()).action){case"install-plugin":c.updates.installPlugin(e.data);break;case"update-plugin":c.updates.updatePlugin(e.data);break;case"delete-plugin":c.updates.deletePlugin(e.data);break;case"install-theme":c.updates.installTheme(e.data);break;case"update-theme":c.updates.updateTheme(e.data);break;case"delete-theme":c.updates.deleteTheme(e.data)}},c.updates.requestFilesystemCredentials=function(e){!1===c.updates.filesystemCredentials.available&&(e&&!c.updates.$elToReturnFocusToFromCredentialsModal&&(c.updates.$elToReturnFocusToFromCredentialsModal=p(e.target)),c.updates.ajaxLocked=!0,c.updates.requestForCredentialsModalOpen())},c.updates.maybeRequestFilesystemCredentials=function(e){c.updates.shouldRequestFilesystemCredentials&&!c.updates.ajaxLocked&&c.updates.requestFilesystemCredentials(e)},c.updates.keydown=function(e){27===e.keyCode?c.updates.requestForCredentialsModalCancel():9===e.keyCode&&("upgrade"!==e.target.id||e.shiftKey?"hostname"===e.target.id&&e.shiftKey&&(p("#upgrade").trigger("focus"),e.preventDefault()):(p("#hostname").trigger("focus"),e.preventDefault()))},c.updates.requestForCredentialsModalOpen=function(){var e=p("#request-filesystem-credentials-dialog");p("body").addClass("modal-open"),e.show(),e.find("input:enabled:first").trigger("focus"),e.on("keydown",c.updates.keydown)},c.updates.requestForCredentialsModalClose=function(){p("#request-filesystem-credentials-dialog").hide(),p("body").removeClass("modal-open"),c.updates.$elToReturnFocusToFromCredentialsModal&&c.updates.$elToReturnFocusToFromCredentialsModal.focus()},c.updates.requestForCredentialsModalCancel=function(){(c.updates.ajaxLocked||c.updates.queue.length)&&(_.each(c.updates.queue,function(e){m.trigger("credential-modal-cancel",e)}),c.updates.ajaxLocked=!1,c.updates.queue=[],c.updates.requestForCredentialsModalClose())},c.updates.showErrorInCredentialsForm=function(e){var t=p("#request-filesystem-credentials-form");t.find(".notice").remove(),t.find("#request-filesystem-credentials-title").after('

    '+e+"

    ")},c.updates.credentialError=function(e,t){e=c.updates._addCallbacks(e,t),c.updates.queue.unshift({action:t,data:e}),c.updates.filesystemCredentials.available=!1,c.updates.showErrorInCredentialsForm(e.errorMessage),c.updates.requestFilesystemCredentials()},c.updates.maybeHandleCredentialError=function(e,t){return!(!c.updates.shouldRequestFilesystemCredentials||!e.errorCode||"unable_to_connect_to_filesystem"!==e.errorCode)&&(c.updates.credentialError(e,t),!0)},c.updates.isValidResponse=function(e,t){var a,s=h("Something went wrong.");if(_.isObject(e)&&!_.isFunction(e.always))return!0;switch(_.isString(e)&&"-1"===e?s=h("An error has occurred. Please reload the page and try again."):_.isString(e)?s=e:void 0!==e.readyState&&0===e.readyState?s=h("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=h("Update failed: %s");break;case"install":a=h("Installation failed: %s");break;case"delete":a=h("Deletion failed: %s")}return s=s.replace(/<[\/a-z][^<>]*>/gi,""),a=a.replace("%s",s),c.updates.addAdminNotice({id:"unknown_error",className:"notice-error is-dismissible",message:_.escape(a)}),c.updates.ajaxLocked=!1,c.updates.queue=[],p(".button.updating-message").removeClass("updating-message").removeAttr("aria-label").prop("disabled",!0).text(h("Update failed.")),p(".updating-message:not(.button):not(.thickbox)").removeClass("updating-message notice-warning").addClass("notice-error").find("p").removeAttr("aria-label").text(a),c.a11y.speak(a,"assertive"),!1},c.updates.beforeunload=function(){if(c.updates.ajaxLocked)return h("Updates may not complete if you navigate away from this page.")},p(function(){var l=p("#plugin-filter"),o=p("#bulk-action-form"),e=p("#request-filesystem-credentials-form"),t=p("#request-filesystem-credentials-dialog"),a=p(".plugins-php .wp-filter-search"),s=p(".plugin-install-php .wp-filter-search");(g=_.extend(g,window._wpUpdatesItemCounts||{})).totals&&c.updates.refreshCount(),c.updates.shouldRequestFilesystemCredentials=0").html(a.find("p").data("originaltext"))),a.removeClass("updating-message").html(s),"plugin-install"!==pagenow&&"plugin-install-network"!==pagenow||("update-plugin"===t.action?a.attr("aria-label",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"))))),c.a11y.speak(h("Update canceled."))}),o.on("click","[data-plugin] .update-link",function(e){var t=p(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.maybeRequestFilesystemCredentials(e),c.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),c.updates.updatePlugin({plugin:a.data("plugin"),slug:a.data("slug")}))}),l.on("click",".update-now",function(e){var t=p(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.maybeRequestFilesystemCredentials(e),c.updates.updatePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),l.on("click",".install-now",function(e){var t=p(e.target);e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.shouldRequestFilesystemCredentials&&!c.updates.ajaxLocked&&(c.updates.requestFilesystemCredentials(e),m.on("credential-modal-cancel",function(){p(".install-now.updating-message").removeClass("updating-message").text(h("Install Now")),c.a11y.speak(h("Update canceled."))})),c.updates.installPlugin({slug:t.data("slug")}))}),m.on("click",".importer-item .install-now",function(e){var t=p(e.target),a=p(this).data("name");e.preventDefault(),t.hasClass("updating-message")||(c.updates.shouldRequestFilesystemCredentials&&!c.updates.ajaxLocked&&(c.updates.requestFilesystemCredentials(e),m.on("credential-modal-cancel",function(){t.removeClass("updating-message").attr("aria-label",u(d("Install %s now","plugin"),a)).text(h("Install Now")),c.a11y.speak(h("Update canceled."))})),c.updates.installPlugin({slug:t.data("slug"),pagenow:pagenow,success:c.updates.installImporterSuccess,error:c.updates.installImporterError}))}),o.on("click","[data-plugin] a.delete",function(e){var t=p(e.target).parents("tr"),a=t.hasClass("is-uninstallable")?u(h("Are you sure you want to delete %s and its data?"),t.find(".plugin-title strong").text()):u(h("Are you sure you want to delete %s?"),t.find(".plugin-title strong").text());e.preventDefault(),window.confirm(a)&&(c.updates.maybeRequestFilesystemCredentials(e),c.updates.deletePlugin({plugin:t.data("plugin"),slug:t.data("slug")}))}),m.on("click",".themes-php.network-admin .update-link",function(e){var t=p(e.target),a=t.parents("tr");e.preventDefault(),t.hasClass("updating-message")||t.hasClass("button-disabled")||(c.updates.maybeRequestFilesystemCredentials(e),c.updates.$elToReturnFocusToFromCredentialsModal=a.find(".check-column input"),c.updates.updateTheme({slug:a.data("slug")}))}),m.on("click",".themes-php.network-admin a.delete",function(e){var t=p(e.target).parents("tr"),a=u(h("Are you sure you want to delete %s?"),t.find(".theme-title strong").text());e.preventDefault(),window.confirm(a)&&(c.updates.maybeRequestFilesystemCredentials(e),c.updates.deleteTheme({slug:t.data("slug")}))}),o.on("click",'[type="submit"]:not([name="clear-recent-list"])',function(e){var t,s,n=p(e.target).siblings("select").val(),a=o.find('input[name="checked[]"]:checked'),l=0,i=0,d=[];switch(pagenow){case"plugins":case"plugins-network":t="plugin";break;case"themes-network":t="theme";break;default:return}if(!a.length)return e.preventDefault(),p("html, body").animate({scrollTop:0}),c.updates.addAdminNotice({id:"no-items-selected",className:"notice-error is-dismissible",message:h("Please select at least one item to perform this action on.")});switch(n){case"update-selected":s=n.replace("selected",t);break;case"delete-selected":var u=h("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(u))return void e.preventDefault();s=n.replace("selected",t);break;default:return}c.updates.maybeRequestFilesystemCredentials(e),e.preventDefault(),o.find('.manage-column [type="checkbox"]').prop("checked",!1),m.trigger("wp-"+t+"-bulk-"+n,a),a.each(function(e,t){var a=p(t),t=a.parents("tr");"update-selected"!==n||t.hasClass("update")&&!t.find("notice-error").length?c.updates.queue.push({action:s,data:{plugin:t.data("plugin"),slug:t.data("slug")}}):a.prop("checked",!1)}),m.on("wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error",function(e,t){var a,s=p('[data-slug="'+t.slug+'"]');"wp-"+t.update+"-update-success"===e.type?l++:(e=t.pluginName||s.find(".column-primary strong").text(),i++,d.push(e+": "+t.errorMessage)),s.find('input[name="checked[]"]:checked').prop("checked",!1),c.updates.adminNotice=c.template("wp-bulk-updates-admin-notice"),c.updates.addAdminNotice({id:"bulk-action-notice",className:"bulk-action-notice",successes:l,errors:i,errorMessages:d,type:t.update}),a=p("#bulk-action-notice").on("click","button",function(){p(this).toggleClass("bulk-action-errors-collapsed").attr("aria-expanded",!p(this).hasClass("bulk-action-errors-collapsed")),a.find(".bulk-action-errors").toggleClass("hidden")}),0').append(p("
    ",{class:"current",href:n,text:h("Search Results")})),p(".wp-filter .filter-links .current").removeClass("current").parents(".filter-links").prepend(a),l.prev("p").remove(),p(".plugins-popular-tags-wrapper").remove()),void 0!==c.updates.searchRequest&&c.updates.searchRequest.abort(),p("body").addClass("loading-content"),c.updates.searchRequest=c.ajax.post("search-install-plugins",s).done(function(e){p("body").removeClass("loading-content"),l.append(e.items),delete c.updates.searchRequest,0===e.count?c.a11y.speak(h("You do not appear to have any plugins available at this time.")):c.a11y.speak(u(h("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 s={_ajax_nonce:c.updates.ajaxNonce,s:e.target.value,pagenow:pagenow,plugin_status:"all"};"keyup"===e.type&&27===e.which&&(e.target.value=""),c.updates.searchTerm!==s.s&&(c.updates.searchTerm=s.s,e=_.object(_.compact(_.map(location.search.slice(1).split("&"),function(e){if(e)return e.split("=")}))),s.plugin_status=e.plugin_status||"all",window.history&&window.history.replaceState&&window.history.replaceState(null,"",location.href.split("?")[0]+"?s="+s.s+"&plugin_status="+s.plugin_status),void 0!==c.updates.searchRequest&&c.updates.searchRequest.abort(),o.empty(),p("body").addClass("loading-content"),p(".subsubsub .current").removeClass("current"),c.updates.searchRequest=c.ajax.post("search-plugins",s).done(function(e){var t=p("").addClass("subtitle").html(u(h("Search results for: %s"),""+_.escape(s.s)+"")),a=p(".wrap .subtitle");s.s.length?a.length?a.replaceWith(t):p(".wp-header-end").before(t):(a.remove(),p(".subsubsub ."+s.plugin_status+" a").addClass("current")),p("body").removeClass("loading-content"),o.append(e.items),delete c.updates.searchRequest,0===e.count?c.a11y.speak(h("No plugins found. Try a different search.")):c.a11y.speak(u(h("Number of plugins found: %d"),e.count))}))},500)),m.on("submit",".search-plugins",function(e){e.preventDefault(),p("input.wp-filter-search").trigger("input")}),m.on("click",".try-again",function(e){e.preventDefault(),s.trigger("input")}),p("#typeselector").on("change",function(){var e=p('input[name="s"]');e.val().length&&e.trigger("input","typechange")}),p("#plugin_update_from_iframe").on("click",function(e){var t=window.parent===window?null:window.parent;p.support.postMessage=!!window.postMessage,!1!==p.support.postMessage&&null!==t&&-1===window.parent.location.pathname.indexOf("update-core.php")&&(e.preventDefault(),e={action:"update-plugin",data:{plugin:p(this).data("plugin"),slug:p(this).data("slug")}},t.postMessage(JSON.stringify(e),window.location.origin))}),p("#plugin_install_from_iframe").on("click",function(e){var t=window.parent===window?null:window.parent;p.support.postMessage=!!window.postMessage,!1!==p.support.postMessage&&null!==t&&-1===window.parent.location.pathname.indexOf("index.php")&&(e.preventDefault(),e={action:"install-plugin",data:{slug:p(this).data("slug")}},t.postMessage(JSON.stringify(e),window.location.origin))}),p(window).on("message",function(e){var t,a=e.originalEvent,e=document.location.protocol+"//"+document.location.host;if(a.origin===e){try{t=JSON.parse(a.data)}catch(e){return}if(t&&void 0!==t.action)switch(t.action){case"decrementUpdateCount":c.updates.decrementCount(t.upgradeType);break;case"install-plugin":case"update-plugin":window.tb_remove(),t.data=c.updates._addCallbacks(t.data,t.action),c.updates.queue.push(t),c.updates.queueChecker()}}}),p(window).on("beforeunload",c.updates.beforeunload),m.on("keydown",".column-auto-updates .toggle-auto-update, .theme-overlay .toggle-auto-update",function(e){32===e.which&&e.preventDefault()}),m.on("click keyup",".column-auto-updates .toggle-auto-update, .theme-overlay .toggle-auto-update",function(e){var l,i,d,u=p(this),o=u.attr("data-wp-action"),r=u.find(".label");if(("keyup"!==e.type||32===e.which)&&(d="themes"!==pagenow?u.closest(".column-auto-updates"):u.closest(".theme-autoupdate"),e.preventDefault(),"yes"!==u.attr("data-doing-ajax"))){switch(u.attr("data-doing-ajax","yes"),pagenow){case"plugins":case"plugins-network":i="plugin",l=u.closest("tr").attr("data-plugin");break;case"themes-network":i="theme",l=u.closest("tr").attr("data-slug");break;case"themes":i="theme",l=u.attr("data-slug")}d.find(".notice.notice-error").addClass("hidden"),"enable"===o?r.text(h("Enabling...")):r.text(h("Disabling...")),u.find(".dashicons-update").removeClass("hidden"),e={action:"toggle-auto-updates",_ajax_nonce:g.ajax_nonce,state:o,type:i,asset:l},p.post(window.ajaxurl,e).done(function(e){var t,a,s,n=u.attr("href");if(!e.success)return s=e.data&&e.data.error?e.data.error:h("The request could not be completed."),d.find(".notice.notice-error").removeClass("hidden").find("p").text(s),void c.a11y.speak(s,"assertive");if("themes"!==pagenow){switch(e=p(".auto-update-enabled span"),s=p(".auto-update-disabled span"),t=parseInt(e.text().replace(/[^\d]+/g,""),10)||0,a=parseInt(s.text().replace(/[^\d]+/g,""),10)||0,o){case"enable":++t,--a;break;case"disable":--t,++a}t=Math.max(0,t),a=Math.max(0,a),e.text("("+t+")"),s.text("("+a+")")}"enable"===o?(u[0].hasAttribute("href")&&(n=n.replace("action=enable-auto-update","action=disable-auto-update"),u.attr("href",n)),u.attr("data-wp-action","disable"),r.text(h("Disable auto-updates")),d.find(".auto-update-time").removeClass("hidden"),c.a11y.speak(h("Auto-updates enabled"))):(u[0].hasAttribute("href")&&(n=n.replace("action=disable-auto-update","action=enable-auto-update"),u.attr("href",n)),u.attr("data-wp-action","enable"),r.text(h("Enable auto-updates")),d.find(".auto-update-time").addClass("hidden"),c.a11y.speak(h("Auto-updates disabled"))),m.trigger("wp-auto-update-setting-changed",{state:o,type:i,asset:l})}).fail(function(){d.find(".notice.notice-error").removeClass("hidden").find("p").text(h("The request could not be completed.")),c.a11y.speak(h("The request could not be completed."),"assertive")}).always(function(){u.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/user-profile.js b/wp-admin/js/user-profile.js index dfec0fdba2..06cfba2e12 100644 --- a/wp-admin/js/user-profile.js +++ b/wp-admin/js/user-profile.js @@ -408,7 +408,7 @@ // Repaint icons. if ( typeof wp !== 'undefined' && wp.svgPainter ) { try { - colors = $.parseJSON( $this.children( '.icon_colors' ).val() ); + colors = JSON.parse( $this.children( '.icon_colors' ).val() ); } catch ( error ) {} if ( colors ) { diff --git a/wp-admin/js/user-profile.min.js b/wp-admin/js/user-profile.min.js index 521356f36b..fcc9ab4a88 100644 --- a/wp-admin/js/user-profile.min.js +++ b/wp-admin/js/user-profile.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(o){var e,a,t,n,i,r,d,p,l,c,u=!1,h=wp.i18n.__;function f(){"function"==typeof zxcvbn?(!a.val()||c.hasClass("is-open")?(a.val(a.data("pw")),a.trigger("pwupdate")):b(),g(),1!==parseInt(r.data("start-masked"),10)?a.attr("type","text"):r.trigger("click"),o("#pw-weak-text-label").text(h("Confirm use of weak password"))):setTimeout(f,50)}function w(s){r.attr({"aria-label":h(s?"Show password":"Hide password")}).find(".text").text(h(s?"Show":"Hide")).end().find(".dashicons").removeClass(s?"dashicons-hidden":"dashicons-visibility").addClass(s?"dashicons-visibility":"dashicons-hidden")}function m(s,e,a){var t=o("
    ");t.addClass("notice inline"),t.addClass("notice-"+(e?"success":"error")),t.text(o(o.parseHTML(a)).text()).wrapInner("

    "),s.prop("disabled",e),s.siblings(".notice").remove(),s.before(t)}function v(){var s;e=o(".user-pass1-wrap, .user-pass-wrap, .reset-pass-submit"),o(".user-pass2-wrap").hide(),p=o("#submit, #wp-submit").on("click",function(){u=!1}),d=p.add(" #createusersub"),n=o(".pw-weak"),(i=n.find(".pw-checkbox")).on("change",function(){d.prop("disabled",!i.prop("checked"))}),(a=o("#pass1")).length?(l=a.val(),1===parseInt(a.data("reveal"),10)&&f(),a.on("input pwupdate",function(){a.val()!==l&&(l=a.val(),a.removeClass("short bad good strong"),g())})):a=o("#user_pass"),t=o("#pass2").on("input",function(){0]*>/gi,""),t[s].length&&-1===o.inArray(e,a)&&(a.push(e),o("

    '+s.message+"

    ")}).fail(function(s){e.siblings(".notice").remove(),e.before('

    '+s.message+"

    ")}),s.preventDefault()}),window.generatePassword=f,o(window).on("beforeunload",function(){if(!0===u)return h("Your new password has not been saved.")}),o(document).ready(function(){o(".reset-pass-submit").length&&o(".reset-pass-submit button.wp-generate-pw").trigger("click")})}(jQuery); \ No newline at end of file +!function(o){var e,a,t,n,i,r,d,p,l,c,u=!1,h=wp.i18n.__;function f(){"function"==typeof zxcvbn?(!a.val()||c.hasClass("is-open")?(a.val(a.data("pw")),a.trigger("pwupdate")):b(),g(),1!==parseInt(r.data("start-masked"),10)?a.attr("type","text"):r.trigger("click"),o("#pw-weak-text-label").text(h("Confirm use of weak password"))):setTimeout(f,50)}function w(s){r.attr({"aria-label":h(s?"Show password":"Hide password")}).find(".text").text(h(s?"Show":"Hide")).end().find(".dashicons").removeClass(s?"dashicons-hidden":"dashicons-visibility").addClass(s?"dashicons-visibility":"dashicons-hidden")}function m(s,e,a){var t=o("
    ");t.addClass("notice inline"),t.addClass("notice-"+(e?"success":"error")),t.text(o(o.parseHTML(a)).text()).wrapInner("

    "),s.prop("disabled",e),s.siblings(".notice").remove(),s.before(t)}function v(){var s;e=o(".user-pass1-wrap, .user-pass-wrap, .reset-pass-submit"),o(".user-pass2-wrap").hide(),p=o("#submit, #wp-submit").on("click",function(){u=!1}),d=p.add(" #createusersub"),n=o(".pw-weak"),(i=n.find(".pw-checkbox")).on("change",function(){d.prop("disabled",!i.prop("checked"))}),(a=o("#pass1")).length?(l=a.val(),1===parseInt(a.data("reveal"),10)&&f(),a.on("input pwupdate",function(){a.val()!==l&&(l=a.val(),a.removeClass("short bad good strong"),g())})):a=o("#user_pass"),t=o("#pass2").on("input",function(){0]*>/gi,""),t[s].length&&-1===o.inArray(e,a)&&(a.push(e),o("

    '+s.message+"

    ")}).fail(function(s){e.siblings(".notice").remove(),e.before('

    '+s.message+"

    ")}),s.preventDefault()}),window.generatePassword=f,o(window).on("beforeunload",function(){if(!0===u)return h("Your new password has not been saved.")}),o(document).ready(function(){o(".reset-pass-submit").length&&o(".reset-pass-submit button.wp-generate-pw").trigger("click")})}(jQuery); \ No newline at end of file diff --git a/wp-admin/js/widgets.js b/wp-admin/js/widgets.js index d560811511..245b0c12b2 100644 --- a/wp-admin/js/widgets.js +++ b/wp-admin/js/widgets.js @@ -81,7 +81,7 @@ window.wpWidgets = { }); unsavedWidgetsElements.each( function() { if ( ! $( this ).hasClass( 'open' ) ) { - $( this ).find( '.widget-title-action:first' ).click(); + $( this ).find( '.widget-title-action:first' ).trigger( 'click' ); } }); @@ -92,7 +92,7 @@ window.wpWidgets = { } else { this.scrollIntoView(); } - $( this ).find( '.widget-inside :tabbable:first' ).focus(); + $( this ).find( '.widget-inside :tabbable:first' ).trigger( 'focus' ); } ); event.returnValue = wp.i18n.__( 'The changes you made will be lost if you navigate away from this page.' ); diff --git a/wp-admin/js/widgets.min.js b/wp-admin/js/widgets.min.js index 22f71a5f4b..3005f0248c 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(w){var l=w(document);window.wpWidgets={hoveredSidebar:null,dirtyWidgets:{},init:function(){var r,o,c=this,d=w(".widgets-chooser"),s=d.find(".widgets-chooser-sidebars"),e=w("div.widgets-sortables"),g=!("undefined"==typeof isRtl||!isRtl);w("#widgets-right .sidebar-name").on("click",function(){var e=w(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")),l.triggerHandler("wp-pin-menu")}).find(".handlediv").each(function(e){0!==e&&w(this).attr("aria-expanded","false")}),w(window).on("beforeunload.widgets",function(e){var i,t=[];if(w.each(c.dirtyWidgets,function(e,i){i&&t.push(e)}),0!==t.length)return(i=w("#widgets-right").find(".widget").filter(function(){return-1!==t.indexOf(w(this).prop("id").replace(/^widget-\d+_/,""))})).each(function(){w(this).hasClass("open")||w(this).find(".widget-title-action:first").click()}),i.first().each(function(){this.scrollIntoViewIfNeeded?this.scrollIntoViewIfNeeded():this.scrollIntoView(),w(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}),w("#widgets-left .sidebar-name").on("click",function(){var e=w(this).closest(".widgets-holder-wrap");e.toggleClass("closed").find(".handlediv").attr("aria-expanded",!e.hasClass("closed")),l.triggerHandler("wp-pin-menu")}),w(document.body).on("click.widgets-toggle",function(e){var i,t,d,a,s,n,r=w(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(){c.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=w(this).find(".widgets-chooser");i.helper.find("div.widget-description").hide(),o=this.id,t.length&&(w("#wpbody-content").append(t.hide()),i.helper.find(".widgets-chooser").remove(),c.clearWidgetSelection())},stop:function(){r&&w(r).hide(),r=""}}),e.droppable({tolerance:"intersect",over:function(e){var i=w(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"),w(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=w(this),d=t.parent(),a=i.item.children(".widget-inside");"block"===a.css("display")&&(i.item.removeClass("open"),i.item.find(".widget-top button.widget-action").attr("aria-expanded","false"),a.hide(),w(this).sortable("refreshPositions")),d.hasClass("closed")||(i=i.item.hasClass("ui-draggable")?t.height():1+t.height(),t.css("min-height",i+"px"))},stop:function(e,i){var t,d,a,s=i.item,n=o;if(wpWidgets.hoveredSidebar=null,s.hasClass("deleting"))return wpWidgets.save(s,1,0,1),void s.remove();t=s.find("input.add_new").val(),d=s.find("input.multi_number").val(),s.attr("style","").removeClass("ui-draggable"),o="",t&&("multi"===t?(s.html(s.html().replace(/<[^<>]+>/g,function(e){return e.replace(/__i__|%i%/g,d)})),s.attr("id",n.replace("__i__",d)),d++,w("div#"+n).find("input.multi_number").val(d)):"single"===t&&(s.attr("id","new-"+n),r="div#"+n),wpWidgets.save(s,0,0,1),s.find("input.add_new").val(""),l.trigger("widget-added",[s])),(a=s.parent()).parent().hasClass("closed")&&(a.parent().removeClass("closed").find(".handlediv").attr("aria-expanded","true"),1<(i=a.children(".widget")).length&&(n=i.get(0),i=s.get(0),n.id&&i.id&&n.id!==i.id&&w(n).before(s))),t?s.find(".widget-action").trigger("click"):wpWidgets.saveOrder(a.attr("id"))},activate:function(){w(this).parent().addClass("widget-hover")},deactivate:function(){w(this).css("min-height","").parent().removeClass("widget-hover")},receive:function(e,i){i=w(i.sender);-1"),d=w("