diff --git a/wp-admin/export.php b/wp-admin/export.php
index a0c76a35b4..51acc7ed3c 100644
--- a/wp-admin/export.php
+++ b/wp-admin/export.php
@@ -29,7 +29,7 @@ function export_add_js() {
var form = $('#export-filters'),
filters = form.find('.export-filters');
filters.hide();
- form.find('input:radio').change(function() {
+ form.find('input:radio').on( 'change', function() {
filters.slideUp('fast');
switch ( $(this).val() ) {
case 'attachment': $('#attachment-filters').slideDown(); break;
diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php
index 9eb2b709d9..5cfe1f43b5 100644
--- a/wp-admin/includes/ms.php
+++ b/wp-admin/includes/ms.php
@@ -1001,7 +1001,7 @@ function network_settings_add_js() {
").attr("role","alert").attr("tabindex","-1").addClass("is-dismissible notice notice-"+s).append(o("
").text(e)).append(o("").attr("type","button").addClass("notice-dismiss").append(o("").addClass("screen-reader-text").text(wp.i18n.__("Dismiss this notice."))));return i.after(e),e}function v(){o(".notice",a).remove()}t.click(function(e){var s,a;e.preventDefault(),t.prop("aria-disabled")||(0!==(s=n.val()).length?(v(),t.prop("aria-disabled",!0).addClass("disabled"),a={name:s},a=wp.hooks.applyFilters("wp_application_passwords_new_password_request",a,u),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords?_locale=user",method:"POST",data:a}).always(function(){t.removeProp("aria-disabled").removeClass("disabled")}).done(function(e){n.val(""),t.prop("disabled",!1),i.after(l({name:s,password:e.password})),o(".new-application-password-notice").focus(),r.prepend(c(e)),p.show(),d.remove(),wp.hooks.doAction("wp_application_passwords_created_password",e,a)}).fail(w)):n.focus())}),r.on("click",".delete",function(e){var s,a;e.preventDefault(),window.confirm(wp.i18n.__("Are you sure you want to revoke this password? This action cannot be undone."))&&(s=o(this),e=(a=s.closest("tr")).data("uuid"),v(),s.prop("disabled",!0),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords/"+e+"?_locale=user",method:"DELETE"}).always(function(){s.prop("disabled",!1)}).done(function(e){e.deleted&&(0===a.siblings().length&&p.hide(),a.remove(),f(wp.i18n.__("Application password revoked."),"success").focus())}).fail(w))}),e.on("click",function(e){var s;e.preventDefault(),window.confirm(wp.i18n.__("Are you sure you want to revoke all passwords? This action cannot be undone."))&&(s=o(this),v(),s.prop("disabled",!0),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords?_locale=user",method:"DELETE"}).always(function(){s.prop("disabled",!1)}).done(function(e){e.deleted&&(r.children().remove(),a.children(".new-application-password").remove(),p.hide(),f(wp.i18n.__("All application passwords revoked."),"success").focus())}).fail(w))}),a.on("click",".notice-dismiss",function(e){e.preventDefault();var s=o(this).parent();s.removeAttr("role"),s.fadeTo(100,0,function(){s.slideUp(100,function(){s.remove(),n.focus()})})}),0===r.children("tr").not(d).length&&p.hide()}(jQuery);
\ No newline at end of file
+!function(o){var a=o("#application-passwords-section"),i=a.find(".create-application-password"),n=i.find(".input"),t=i.find(".button"),p=a.find(".application-passwords-list-table-wrapper"),r=a.find("tbody"),d=r.find(".no-items"),e=o("#revoke-all-application-passwords"),l=wp.template("new-application-password"),c=wp.template("application-password-row"),u=o("#user_id").val();function w(e,s,a){f(e.responseJSON&&e.responseJSON.message?e.responseJSON.message:a,"error")}function f(e,s){e=o("").attr("role","alert").attr("tabindex","-1").addClass("is-dismissible notice notice-"+s).append(o("").text(e)).append(o("").attr("type","button").addClass("notice-dismiss").append(o("").addClass("screen-reader-text").text(wp.i18n.__("Dismiss this notice."))));return i.after(e),e}function v(){o(".notice",a).remove()}t.on("click",function(e){var s,a;e.preventDefault(),t.prop("aria-disabled")||(0!==(s=n.val()).length?(v(),t.prop("aria-disabled",!0).addClass("disabled"),a={name:s},a=wp.hooks.applyFilters("wp_application_passwords_new_password_request",a,u),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords?_locale=user",method:"POST",data:a}).always(function(){t.removeProp("aria-disabled").removeClass("disabled")}).done(function(e){n.val(""),t.prop("disabled",!1),i.after(l({name:s,password:e.password})),o(".new-application-password-notice").focus(),r.prepend(c(e)),p.show(),d.remove(),wp.hooks.doAction("wp_application_passwords_created_password",e,a)}).fail(w)):n.focus())}),r.on("click",".delete",function(e){var s,a;e.preventDefault(),window.confirm(wp.i18n.__("Are you sure you want to revoke this password? This action cannot be undone."))&&(s=o(this),e=(a=s.closest("tr")).data("uuid"),v(),s.prop("disabled",!0),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords/"+e+"?_locale=user",method:"DELETE"}).always(function(){s.prop("disabled",!1)}).done(function(e){e.deleted&&(0===a.siblings().length&&p.hide(),a.remove(),f(wp.i18n.__("Application password revoked."),"success").focus())}).fail(w))}),e.on("click",function(e){var s;e.preventDefault(),window.confirm(wp.i18n.__("Are you sure you want to revoke all passwords? This action cannot be undone."))&&(s=o(this),v(),s.prop("disabled",!0),wp.apiRequest({path:"/wp/v2/users/"+u+"/application-passwords?_locale=user",method:"DELETE"}).always(function(){s.prop("disabled",!1)}).done(function(e){e.deleted&&(r.children().remove(),a.children(".new-application-password").remove(),p.hide(),f(wp.i18n.__("All application passwords revoked."),"success").focus())}).fail(w))}),a.on("click",".notice-dismiss",function(e){e.preventDefault();var s=o(this).parent();s.removeAttr("role"),s.fadeTo(100,0,function(){s.slideUp(100,function(){s.remove(),n.focus()})})}),0===r.children("tr").not(d).length&&p.hide()}(jQuery);
\ No newline at end of file
diff --git a/wp-admin/js/color-picker.js b/wp-admin/js/color-picker.js
index 83e7dc663e..6f3d1ce5a5 100644
--- a/wp-admin/js/color-picker.js
+++ b/wp-admin/js/color-picker.js
@@ -232,7 +232,7 @@
*
* @since 3.5.0
*/
- self.toggler.click( function(){
+ self.toggler.on( 'click', function(){
if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
self.close();
} else {
@@ -250,7 +250,7 @@
*
* @return {void}
*/
- self.element.change( function( event ) {
+ self.element.on( 'change', function( event ) {
var me = $( this ),
val = me.val();
@@ -272,7 +272,7 @@
*
* @return {void}
*/
- self.button.click( function( event ) {
+ self.button.on( 'click', function( event ) {
var me = $( this );
if ( me.hasClass( 'wp-picker-clear' ) ) {
self.element.val( '' );
diff --git a/wp-admin/js/color-picker.min.js b/wp-admin/js/color-picker.min.js
index 10d7fd9ea4..0f018e9ef0 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('').after(o.button),o.inputWrapper=e.closest(".wp-picker-input-wrap"),e.iris({target:o.pickerContainer,hide:o.options.hide,width:o.options.width,mode:o.options.mode,palettes:o.options.palettes,change:function(e,t){o.toggler.css({backgroundColor:t.color.toString()}),i.isFunction(o.options.change)&&o.options.change.call(this,e,t)}}),e.val(o.initialValue),o._addListeners(),o.options.hide||o.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(e){e.stopPropagation()}),o.toggler.click(function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.change(function(e){var t=i(this).val();""!==t&&"#"!==t||(o.toggler.css("backgroundColor",""),i.isFunction(o.options.clear)&&o.options.clear.call(this,e))}),o.button.click(function(e){var t=i(this);t.hasClass("wp-picker-clear")?(o.element.val(""),o.toggler.css("backgroundColor",""),i.isFunction(o.options.clear)&&o.options.clear.call(this,e)):t.hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})},open:function(){this.element.iris("toggle"),this.inputWrapper.removeClass("hidden"),this.wrap.addClass("wp-picker-active"),this.toggler.addClass("wp-picker-open").attr("aria-expanded","true"),i("body").trigger("click.wpcolorpicker").on("click.wpcolorpicker",this.close)},close:function(){this.element.iris("toggle"),this.inputWrapper.addClass("hidden"),this.wrap.removeClass("wp-picker-active"),this.toggler.removeClass("wp-picker-open").attr("aria-expanded","false"),i("body").off("click.wpcolorpicker",this.close)},color:function(e){if(e===t)return this.element.iris("option","color");this.element.iris("option","color",e)},defaultColor:function(e){if(e===t)return this.options.defaultColor;this.options.defaultColor=e}};i.widget("wp.wpColorPicker",e)}(jQuery);
\ No newline at end of file
+!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('').after(o.button),o.inputWrapper=e.closest(".wp-picker-input-wrap"),e.iris({target:o.pickerContainer,hide:o.options.hide,width:o.options.width,mode:o.options.mode,palettes:o.options.palettes,change:function(e,t){o.toggler.css({backgroundColor:t.color.toString()}),i.isFunction(o.options.change)&&o.options.change.call(this,e,t)}}),e.val(o.initialValue),o._addListeners(),o.options.hide||o.toggler.click()}},_addListeners:function(){var o=this;o.wrap.on("click.wpcolorpicker",function(e){e.stopPropagation()}),o.toggler.on("click",function(){o.toggler.hasClass("wp-picker-open")?o.close():o.open()}),o.element.on("change",function(e){var t=i(this).val();""!==t&&"#"!==t||(o.toggler.css("backgroundColor",""),i.isFunction(o.options.clear)&&o.options.clear.call(this,e))}),o.button.on("click",function(e){var t=i(this);t.hasClass("wp-picker-clear")?(o.element.val(""),o.toggler.css("backgroundColor",""),i.isFunction(o.options.clear)&&o.options.clear.call(this,e)):t.hasClass("wp-picker-default")&&o.element.val(o.options.defaultColor).change()})},open:function(){this.element.iris("toggle"),this.inputWrapper.removeClass("hidden"),this.wrap.addClass("wp-picker-active"),this.toggler.addClass("wp-picker-open").attr("aria-expanded","true"),i("body").trigger("click.wpcolorpicker").on("click.wpcolorpicker",this.close)},close:function(){this.element.iris("toggle"),this.inputWrapper.addClass("hidden"),this.wrap.removeClass("wp-picker-active"),this.toggler.removeClass("wp-picker-open").attr("aria-expanded","false"),i("body").off("click.wpcolorpicker",this.close)},color:function(e){if(e===t)return this.element.iris("option","color");this.element.iris("option","color",e)},defaultColor:function(e){if(e===t)return this.options.defaultColor;this.options.defaultColor=e}};i.widget("wp.wpColorPicker",e)}(jQuery);
\ No newline at end of file
diff --git a/wp-admin/js/comment.js b/wp-admin/js/comment.js
index fcf703bf07..d815eee184 100644
--- a/wp-admin/js/comment.js
+++ b/wp-admin/js/comment.js
@@ -29,11 +29,11 @@ jQuery(document).ready( function($) {
* @param {Event} event The event object.
* @return {void}
*/
- $edittimestamp.click( function( event ) {
+ $edittimestamp.on( 'click', function( event ) {
if ( $timestampdiv.is( ':hidden' ) ) {
// Slide down the form and set focus on the first field.
$timestampdiv.slideDown( 'fast', function() {
- $( 'input, select', $timestampwrap ).first().focus();
+ $( 'input, select', $timestampwrap ).first().trigger( 'focus' );
} );
$(this).hide();
}
@@ -49,9 +49,9 @@ jQuery(document).ready( function($) {
* @return {void}
*/
- $timestampdiv.find('.cancel-timestamp').click( function( event ) {
+ $timestampdiv.find('.cancel-timestamp').on( 'click', function( event ) {
// Move focus back to the Edit link.
- $edittimestamp.show().focus();
+ $edittimestamp.show().trigger( 'focus' );
$timestampdiv.slideUp( 'fast' );
$('#mm').val($('#hidden_mm').val());
$('#jj').val($('#hidden_jj').val());
@@ -70,7 +70,7 @@ jQuery(document).ready( function($) {
* @param {Event} event The event object.
* @return {void}
*/
- $timestampdiv.find('.save-timestamp').click( function( event ) { // Crazyhorse - multiple OK cancels.
+ $timestampdiv.find('.save-timestamp').on( 'click', function( event ) { // Crazyhorse - multiple OK cancels.
var aa = $('#aa').val(), mm = $('#mm').val(), jj = $('#jj').val(), hh = $('#hh').val(), mn = $('#mn').val(),
newD = new Date( aa, mm - 1, jj, hh, mn );
@@ -96,7 +96,7 @@ jQuery(document).ready( function($) {
);
// Move focus back to the Edit link.
- $edittimestamp.show().focus();
+ $edittimestamp.show().trigger( 'focus' );
$timestampdiv.slideUp( 'fast' );
});
});
diff --git a/wp-admin/js/comment.min.js b/wp-admin/js/comment.min.js
index 0d56d7df50..9cb1c79c5d 100644
--- a/wp-admin/js/comment.min.js
+++ b/wp-admin/js/comment.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-jQuery(document).ready(function(m){postboxes.add_postbox_toggles("comment");var d=m("#timestampdiv"),c=m("#timestamp"),a=c.html(),v=d.find(".timestamp-wrap"),o=d.siblings("a.edit-timestamp");o.click(function(e){d.is(":hidden")&&(d.slideDown("fast",function(){m("input, select",v).first().focus()}),m(this).hide()),e.preventDefault()}),d.find(".cancel-timestamp").click(function(e){o.show().focus(),d.slideUp("fast"),m("#mm").val(m("#hidden_mm").val()),m("#jj").val(m("#hidden_jj").val()),m("#aa").val(m("#hidden_aa").val()),m("#hh").val(m("#hidden_hh").val()),m("#mn").val(m("#hidden_mn").val()),c.html(a),e.preventDefault()}),d.find(".save-timestamp").click(function(e){var a=m("#aa").val(),t=m("#mm").val(),i=m("#jj").val(),s=m("#hh").val(),l=m("#mn").val(),n=new Date(a,t-1,i,s,l);e.preventDefault(),n.getFullYear()==a&&1+n.getMonth()==t&&n.getDate()==i&&n.getMinutes()==l?(v.removeClass("form-invalid"),c.html(wp.i18n.__("Submitted on:")+" "+wp.i18n.__("%1$s %2$s, %3$s at %4$s:%5$s").replace("%1$s",m('option[value="'+t+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(i,10)).replace("%3$s",a).replace("%4$s",("00"+s).slice(-2)).replace("%5$s",("00"+l).slice(-2))+" "),o.show().focus(),d.slideUp("fast")):v.addClass("form-invalid")})});
\ No newline at end of file
+jQuery(document).ready(function(m){postboxes.add_postbox_toggles("comment");var d=m("#timestampdiv"),o=m("#timestamp"),a=o.html(),c=d.find(".timestamp-wrap"),r=d.siblings("a.edit-timestamp");r.on("click",function(e){d.is(":hidden")&&(d.slideDown("fast",function(){m("input, select",c).first().trigger("focus")}),m(this).hide()),e.preventDefault()}),d.find(".cancel-timestamp").on("click",function(e){r.show().trigger("focus"),d.slideUp("fast"),m("#mm").val(m("#hidden_mm").val()),m("#jj").val(m("#hidden_jj").val()),m("#aa").val(m("#hidden_aa").val()),m("#hh").val(m("#hidden_hh").val()),m("#mn").val(m("#hidden_mn").val()),o.html(a),e.preventDefault()}),d.find(".save-timestamp").on("click",function(e){var a=m("#aa").val(),t=m("#mm").val(),i=m("#jj").val(),s=m("#hh").val(),l=m("#mn").val(),n=new Date(a,t-1,i,s,l);e.preventDefault(),n.getFullYear()==a&&1+n.getMonth()==t&&n.getDate()==i&&n.getMinutes()==l?(c.removeClass("form-invalid"),o.html(wp.i18n.__("Submitted on:")+" "+wp.i18n.__("%1$s %2$s, %3$s at %4$s:%5$s").replace("%1$s",m('option[value="'+t+'"]',"#mm").attr("data-text")).replace("%2$s",parseInt(i,10)).replace("%3$s",a).replace("%4$s",("00"+s).slice(-2)).replace("%5$s",("00"+l).slice(-2))+" "),r.show().trigger("focus"),d.slideUp("fast")):c.addClass("form-invalid")})});
\ No newline at end of file
diff --git a/wp-admin/js/common.js b/wp-admin/js/common.js
index 2a037d81db..f0807f989e 100644
--- a/wp-admin/js/common.js
+++ b/wp-admin/js/common.js
@@ -382,7 +382,7 @@ window.columns = {
*/
init : function() {
var that = this;
- $('.hide-column-tog', '#adv-settings').click( function() {
+ $('.hide-column-tog', '#adv-settings').on( 'click', function() {
var $t = $(this), column = $t.val();
if ( $t.prop('checked') )
that.checked(column);
@@ -500,7 +500,7 @@ window.validateForm = function( form ) {
.filter( function() { return $( ':input:visible', this ).val() === ''; } )
.addClass( 'form-invalid' )
.find( ':input:visible' )
- .change( function() { $( this ).closest( '.form-invalid' ).removeClass( 'form-invalid' ); } )
+ .on( 'change', function() { $( this ).closest( '.form-invalid' ).removeClass( 'form-invalid' ); } )
.length;
};
@@ -571,7 +571,7 @@ window.screenMeta = {
this.toggles = $( '#screen-meta-links' ).find( '.show-settings' );
this.page = $('#wpcontent');
- this.toggles.click( this.toggleEvent );
+ this.toggles.on( 'click', this.toggleEvent );
},
/**
@@ -617,7 +617,7 @@ window.screenMeta = {
* @return {void}
*/
panel.slideDown( 'fast', function() {
- panel.focus();
+ panel.trigger( 'focus' );
button.addClass( 'screen-meta-active' ).attr( 'aria-expanded', true );
});
@@ -659,7 +659,7 @@ window.screenMeta = {
*
* @return {void}
*/
-$('.contextual-help-tabs').delegate('a', 'click', function(e) {
+$('.contextual-help-tabs').on( 'click', 'a', function(e) {
var link = $(this),
panel;
@@ -798,7 +798,7 @@ $availableStructureTags.on( 'click', function() {
if ( permalinkStructureFocused && $permalinkStructure[0].setSelectionRange ) {
newSelectionStart = ( permalinkStructureValue.substr( 0, selectionStart ) + textToAppend ).length;
$permalinkStructure[0].setSelectionRange( newSelectionStart, newSelectionStart );
- $permalinkStructure.focus();
+ $permalinkStructure.trigger( 'focus' );
}
} );
@@ -1302,7 +1302,7 @@ $document.ready( function() {
$( this ).closest( 'tr' ).toggleClass( 'is-expanded' );
});
- $('#default-password-nag-no').click( function() {
+ $('#default-password-nag-no').on( 'click', function() {
setUserSetting('default_password_nag', 'hide');
$('div.default-password-nag').hide();
return false;
@@ -1315,7 +1315,7 @@ $document.ready( function() {
*
* @return {void}
*/
- $('#newcontent').bind('keydown.wpevent_InsertTab', function(e) {
+ $('#newcontent').on('keydown.wpevent_InsertTab', function(e) {
var el = e.target, selStart, selEnd, val, scroll, sel;
// After pressing escape key (keyCode: 27), the tab key should tab out of the textarea.
@@ -1374,7 +1374,7 @@ $document.ready( function() {
*
* @return {void}
*/
- pageInput.closest('form').submit( function() {
+ pageInput.closest('form').on( 'submit', function() {
/*
* action = bulk action dropdown at the top of the table
*/
@@ -1388,7 +1388,7 @@ $document.ready( function() {
*
* @return {void}
*/
- $('.search-box input[type="search"], .search-box input[type="submit"]').mousedown(function () {
+ $('.search-box input[type="search"], .search-box input[type="submit"]').on( 'mousedown', function () {
$('select[name^="action"]').val('-1');
});
@@ -1689,7 +1689,7 @@ $document.ready( function() {
$wpwrap.toggleClass( 'wp-responsive-open' );
if ( $wpwrap.hasClass( 'wp-responsive-open' ) ) {
$(this).find('a').attr( 'aria-expanded', 'true' );
- $( '#adminmenu a:first' ).focus();
+ $( '#adminmenu a:first' ).trigger( 'focus' );
} else {
$(this).find('a').attr( 'aria-expanded', 'false' );
}
@@ -1978,7 +1978,7 @@ $document.ready( function() {
$document.on( 'wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu', setPinMenu );
// Set initial focus on a specific element.
- $( '.wp-initial-focus' ).focus();
+ $( '.wp-initial-focus' ).trigger( 'focus' );
// Toggle update details on update-core.php.
$body.on( 'click', '.js-update-details-toggle', function() {
diff --git a/wp-admin/js/common.min.js b/wp-admin/js/common.min.js
index 5b017dafb8..9f3ef0d664 100644
--- a/wp-admin/js/common.min.js
+++ b/wp-admin/js/common.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-!function(W,$){var Q=W(document),H=W($),V=W(document.body),q=wp.i18n.__,i=wp.i18n.sprintf;function r(e,t,n){t=void 0!==n?i(q("%1$s is deprecated since version %2$s! Use %3$s instead."),e,t,n):i(q("%1$s is deprecated since version %2$s with no alternative available."),e,t);$.console.warn(t)}function e(i,o,s){var a={};return Object.keys(o).forEach(function(e){var t=o[e],n=i+"."+e;"object"==typeof t?Object.defineProperty(a,e,{get:function(){return r(n,s,t.alternative),t.func()}}):Object.defineProperty(a,e,{get:function(){return r(n,s,"wp.i18n"),t}})}),a}$.wp.deprecateL10nObject=e,$.commonL10n=$.commonL10n||{warnDelete:"",dismiss:"",collapseMenu:"",expandMenu:""},$.commonL10n=e("commonL10n",$.commonL10n,"5.5.0"),$.wpPointerL10n=$.wpPointerL10n||{dismiss:""},$.wpPointerL10n=e("wpPointerL10n",$.wpPointerL10n,"5.5.0"),$.userProfileL10n=$.userProfileL10n||{warn:"",warnWeak:"",show:"",hide:"",cancel:"",ariaShow:"",ariaHide:""},$.userProfileL10n=e("userProfileL10n",$.userProfileL10n,"5.5.0"),$.privacyToolsL10n=$.privacyToolsL10n||{noDataFound:"",foundAndRemoved:"",noneRemoved:"",someNotRemoved:"",removalError:"",emailSent:"",noExportFile:"",exportError:""},$.privacyToolsL10n=e("privacyToolsL10n",$.privacyToolsL10n,"5.5.0"),$.authcheckL10n={beforeunload:""},$.authcheckL10n=$.authcheckL10n||e("authcheckL10n",$.authcheckL10n,"5.5.0"),$.tagsl10n={noPerm:"",broken:""},$.tagsl10n=$.tagsl10n||e("tagsl10n",$.tagsl10n,"5.5.0"),$.adminCommentsL10n=$.adminCommentsL10n||{hotkeys_highlight_first:{alternative:"window.adminCommentsSettings.hotkeys_highlight_first",func:function(){return $.adminCommentsSettings.hotkeys_highlight_first}},hotkeys_highlight_last:{alternative:"window.adminCommentsSettings.hotkeys_highlight_last",func:function(){return $.adminCommentsSettings.hotkeys_highlight_last}},replyApprove:"",reply:"",warnQuickEdit:"",warnCommentChanges:"",docTitleComments:"",docTitleCommentsCount:""},$.adminCommentsL10n=e("adminCommentsL10n",$.adminCommentsL10n,"5.5.0"),$.tagsSuggestL10n=$.tagsSuggestL10n||{tagDelimiter:"",removeTerm:"",termSelected:"",termAdded:"",termRemoved:""},$.tagsSuggestL10n=e("tagsSuggestL10n",$.tagsSuggestL10n,"5.5.0"),$.wpColorPickerL10n=$.wpColorPickerL10n||{clear:"",clearAriaLabel:"",defaultString:"",defaultAriaLabel:"",pick:"",defaultLabel:""},$.wpColorPickerL10n=e("wpColorPickerL10n",$.wpColorPickerL10n,"5.5.0"),$.attachMediaBoxL10n=$.attachMediaBoxL10n||{error:""},$.attachMediaBoxL10n=e("attachMediaBoxL10n",$.attachMediaBoxL10n,"5.5.0"),$.postL10n=$.postL10n||{ok:"",cancel:"",publishOn:"",publishOnFuture:"",publishOnPast:"",dateFormat:"",showcomm:"",endcomm:"",publish:"",schedule:"",update:"",savePending:"",saveDraft:"",private:"",public:"",publicSticky:"",password:"",privatelyPublished:"",published:"",saveAlert:"",savingText:"",permalinkSaved:""},$.postL10n=e("postL10n",$.postL10n,"5.5.0"),$.inlineEditL10n=$.inlineEditL10n||{error:"",ntdeltitle:"",notitle:"",comma:"",saved:""},$.inlineEditL10n=e("inlineEditL10n",$.inlineEditL10n,"5.5.0"),$.plugininstallL10n=$.plugininstallL10n||{plugin_information:"",plugin_modal_label:"",ays:""},$.plugininstallL10n=e("plugininstallL10n",$.plugininstallL10n,"5.5.0"),$.navMenuL10n=$.navMenuL10n||{noResultsFound:"",warnDeleteMenu:"",saveAlert:"",untitled:""},$.navMenuL10n=e("navMenuL10n",$.navMenuL10n,"5.5.0"),$.commentL10n=$.commentL10n||{submittedOn:"",dateFormat:""},$.commentL10n=e("commentL10n",$.commentL10n,"5.5.0"),$.setPostThumbnailL10n=$.setPostThumbnailL10n||{setThumbnail:"",saving:"",error:"",done:""},$.setPostThumbnailL10n=e("setPostThumbnailL10n",$.setPostThumbnailL10n,"5.5.0"),$.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},$.columns={init:function(){var n=this;W(".hide-column-tog","#adv-settings").click(function(){var e=W(this),t=e.val();e.prop("checked")?n.checked(t):n.unchecked(t),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var e=this.hidden();W.post(ajaxurl,{action:"hidden-columns",hidden:e,screenoptionnonce:W("#screenoptionnonce").val(),page:pagenow})},checked:function(e){W(".column-"+e).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(e){W(".column-"+e).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return W(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return W(".hide-column-tog").not(":checked").map(function(){var e=this.id;return e.substring(e,e.length-5)}).get().join(",")}},colSpanChange:function(e){var t=W("table").find(".colspanchange");t.length&&(e=parseInt(t.attr("colspan"),10)+e,t.attr("colspan",e.toString()))}},Q.ready(function(){columns.init()}),$.validateForm=function(e){return!W(e).find(".form-required").filter(function(){return""===W(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").change(function(){W(this).closest(".form-invalid").removeClass("form-invalid")}).length},$.showNotice={warn:function(){return!!confirm(q("You are about to permanently delete these items from your site.\nThis action cannot be undone.\n'Cancel' to stop, 'OK' to delete."))},note:function(e){alert(e)}},$.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=W("#screen-meta"),this.toggles=W("#screen-meta-links").find(".show-settings"),this.page=W("#wpcontent"),this.toggles.click(this.toggleEvent)},toggleEvent:function(){var e=W("#"+W(this).attr("aria-controls"));e.length&&(e.is(":visible")?screenMeta.close(e,W(this)):screenMeta.open(e,W(this)))},open:function(e,t){W("#screen-meta-links").find(".screen-meta-toggle").not(t.parent()).css("visibility","hidden"),e.parent().show(),e.slideDown("fast",function(){e.focus(),t.addClass("screen-meta-active").attr("aria-expanded",!0)}),Q.trigger("screen:options:open")},close:function(e,t){e.slideUp("fast",function(){t.removeClass("screen-meta-active").attr("aria-expanded",!1),W(".screen-meta-toggle").css("visibility",""),e.parent().hide()}),Q.trigger("screen:options:close")}},W(".contextual-help-tabs").delegate("a","click",function(e){var t=W(this);if(e.preventDefault(),t.is(".active a"))return!1;W(".contextual-help-tabs .active").removeClass("active"),t.parent("li").addClass("active"),t=W(t.attr("href")),W(".help-tab-content").not(t).removeClass("active").hide(),t.addClass("active").show()});var t,s=!1,a=W("#permalink_structure"),n=W(".permalink-structure input:radio"),l=W("#custom_selection"),o=W(".form-table.permalink-structure .available-structure-tags button");function c(e){-1!==a.val().indexOf(e.text().trim())?(e.attr("data-label",e.attr("aria-label")),e.attr("aria-label",e.attr("data-used")),e.attr("aria-pressed",!0),e.addClass("active")):e.attr("data-label")&&(e.attr("aria-label",e.attr("data-label")),e.attr("aria-pressed",!1),e.removeClass("active"))}function u(){Q.trigger("wp-window-resized")}n.on("change",function(){"custom"!==this.value&&(a.val(this.value),o.each(function(){c(W(this))}))}),a.on("click input",function(){l.prop("checked",!0)}),a.on("focus",function(e){s=!0,W(this).off(e)}),o.each(function(){c(W(this))}),a.on("change",function(){o.each(function(){c(W(this))})}),o.on("click",function(){var e=a.val(),t=a[0].selectionStart,n=a[0].selectionEnd,i=W(this).text().trim(),o=W(this).attr("data-added");if(-1!==e.indexOf(i))return e=e.replace(i+"/",""),a.val("/"===e?"":e),W("#custom_selection_updated").text(o),void c(W(this));s||0!==t||0!==n||(t=n=e.length),l.prop("checked",!0),"/"!==e.substr(0,t).substr(-1)&&(i="/"+i),"/"!==e.substr(n,1)&&(i+="/"),a.val(e.substr(0,t)+i+e.substr(n)),W("#custom_selection_updated").text(o),c(W(this)),s&&a[0].setSelectionRange&&(i=(e.substr(0,t)+i).length,a[0].setSelectionRange(i,i),a.focus())}),Q.ready(function(){var n,i,o,s,e,t,a,r,l,c,u=!1,d=W("input.current-page"),p=d.val(),h=/iPhone|iPad|iPod/.test(navigator.userAgent),m=-1!==navigator.userAgent.indexOf("Android"),f=W("#adminmenuwrap"),v=W("#wpwrap"),b=W("#adminmenu"),g=W("#wp-responsive-overlay"),w=W("#wp-toolbar"),k=w.find('a[aria-haspopup="true"]'),C=W(".meta-box-sortables"),L=!1,y=W("#wpadminbar"),x=0,S=!1,P=!1,T=0,_=!1,M={window:H.height(),wpwrap:v.height(),adminbar:y.height(),menu:f.height()},D=W(".wp-header-end");function E(){var e=W("a.wp-has-current-submenu");"folded"===r?e.attr("aria-haspopup","true"):e.attr("aria-haspopup","false")}function A(e){var t=e.find(".wp-submenu"),n=e.offset().top,i=H.scrollTop(),o=n-i-30,e=n+t.height()+1,n=60+e-v.height(),i=H.height()+i-50;1<(n=o<(n=i');t.find(".notice-dismiss").length||(e.find(".screen-reader-text").text(q("Dismiss this notice.")),e.on("click.wp-dismiss-notice",function(e){e.preventDefault(),t.fadeTo(100,0,function(){t.slideUp(100,function(){t.remove()})})}),t.append(e))})}function j(e,t,n,i){n.on("change",function(){e.val(W(this).val())}),e.on("change",function(){n.val(W(this).val())}),i.on("click",function(e){e.preventDefault(),e.stopPropagation(),t.trigger("click")})}function R(){l.prop("disabled",""===c.map(function(){return W(this).val()}).get().join(""))}function U(e){var t=H.scrollTop(),e=!e||"scroll"!==e.type;if(!h&&!b.data("wp-responsive"))if(M.menu+M.adminbarM.wpwrap)I();else{if(_=!0,M.menu+M.adminbar>M.window){if(t<0)return void(S||(P=!(S=!0),f.css({position:"fixed",top:"",bottom:""})));if(t+M.window>Q.height()-1)return void(P||(S=!(P=!0),f.css({position:"fixed",top:"",bottom:0})));xt+M.window&&(T=t),f.css({position:"absolute",top:T,bottom:""})):!S&&f.offset().top>=t+M.adminbar&&(S=!0,f.css({position:"fixed",top:"",bottom:""})):e&&(S=P=!1,0<(T=t+M.window-M.menu-M.adminbar-1)?f.css({position:"absolute",top:T,bottom:""}):I())}x=t}}function F(){M={window:H.height(),wpwrap:v.height(),adminbar:y.height(),menu:f.height()}}function I(){!h&&_&&(S=P=_=!1,f.css({position:"",top:"",bottom:""}))}function K(){F(),b.data("wp-responsive")?(V.removeClass("sticky-menu"),I()):M.menu+M.adminbar>M.window?(U(),V.removeClass("sticky-menu")):(V.addClass("sticky-menu"),I())}function z(){W(".aria-button-if-js").attr("role","button")}function B(){var e=!1;return e=$.innerWidth?Math.max($.innerWidth,document.documentElement.clientWidth):e}function N(){var e=B()||961;r=e<=782?"responsive":V.hasClass("folded")||V.hasClass("auto-fold")&&e<=960&&782 tr > .check-column :checkbox",function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!u)return!0;n=W(u).closest("form").find(":checkbox").filter(":visible:enabled"),i=n.index(u),o=n.index(this),s=W(this).prop("checked"),0 a",function(e){b.data("wp-responsive")&&(W(this).parent("li").toggleClass("selected"),e.preventDefault())}),e.trigger(),Q.on("wp-window-resized.wp-responsive",W.proxy(this.trigger,this)),H.on("load.wp-responsive",this.maybeDisableSortables),Q.on("postbox-toggled",this.maybeDisableSortables),W("#screen-options-wrap input").on("click",this.maybeDisableSortables)},maybeDisableSortables:function(){(-1').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){w.find(".menupop.hover").removeClass("hover"),W(this).hide()})),k.on("click.wp-responsive",function(){g.show()})},disableOverlay:function(){k.off("click.wp-responsive"),g.hide()},disableSortables:function(){if(C.length)try{C.sortable("disable"),C.find(".ui-sortable-handle").addClass("is-non-sortable")}catch(e){}},enableSortables:function(){if(C.length)try{C.sortable("enable"),C.find(".ui-sortable-handle").removeClass("is-non-sortable")}catch(e){}}},W(document).ajaxComplete(function(){z()}),Q.on("wp-window-resized.set-menu-state",N),Q.on("wp-menu-state-set wp-collapse-menu",function(e,t){var n,i=W("#collapse-button"),t="folded"===t.state?(n="false",q("Expand Main menu")):(n="true",q("Collapse Main menu"));i.attr({"aria-expanded":n,"aria-label":t})}),$.wpResponsive.init(),K(),N(),E(),O(),z(),Q.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",K),W(".wp-initial-focus").focus(),V.on("click",".js-update-details-toggle",function(){var e=W(this).closest(".js-update-details"),t=W("#"+e.data("update-details"));t.hasClass("update-details-moved")||t.insertAfter(e).addClass("update-details-moved"),t.toggle(),W(this).attr("aria-expanded",t.is(":visible"))})}),Q.ready(function(e){var t,n;V.hasClass("update-php")&&(t=e("a.update-from-upload-overwrite"),n=e(".update-from-upload-expired"),t.length&&n.length&&$.setTimeout(function(){t.hide(),n.removeClass("hidden"),$.wp&&$.wp.a11y&&$.wp.a11y.speak(n.text())},714e4))}),H.on("resize.wp-fire-once",function(){$.clearTimeout(t),t=$.setTimeout(u,200)}),"-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)&&((n=document.createElement("style")).appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(n))}(jQuery,window);
\ No newline at end of file
+!function(W,$){var Q=W(document),H=W($),V=W(document.body),q=wp.i18n.__,i=wp.i18n.sprintf;function r(e,t,n){t=void 0!==n?i(q("%1$s is deprecated since version %2$s! Use %3$s instead."),e,t,n):i(q("%1$s is deprecated since version %2$s with no alternative available."),e,t);$.console.warn(t)}function e(i,o,s){var a={};return Object.keys(o).forEach(function(e){var t=o[e],n=i+"."+e;"object"==typeof t?Object.defineProperty(a,e,{get:function(){return r(n,s,t.alternative),t.func()}}):Object.defineProperty(a,e,{get:function(){return r(n,s,"wp.i18n"),t}})}),a}$.wp.deprecateL10nObject=e,$.commonL10n=$.commonL10n||{warnDelete:"",dismiss:"",collapseMenu:"",expandMenu:""},$.commonL10n=e("commonL10n",$.commonL10n,"5.5.0"),$.wpPointerL10n=$.wpPointerL10n||{dismiss:""},$.wpPointerL10n=e("wpPointerL10n",$.wpPointerL10n,"5.5.0"),$.userProfileL10n=$.userProfileL10n||{warn:"",warnWeak:"",show:"",hide:"",cancel:"",ariaShow:"",ariaHide:""},$.userProfileL10n=e("userProfileL10n",$.userProfileL10n,"5.5.0"),$.privacyToolsL10n=$.privacyToolsL10n||{noDataFound:"",foundAndRemoved:"",noneRemoved:"",someNotRemoved:"",removalError:"",emailSent:"",noExportFile:"",exportError:""},$.privacyToolsL10n=e("privacyToolsL10n",$.privacyToolsL10n,"5.5.0"),$.authcheckL10n={beforeunload:""},$.authcheckL10n=$.authcheckL10n||e("authcheckL10n",$.authcheckL10n,"5.5.0"),$.tagsl10n={noPerm:"",broken:""},$.tagsl10n=$.tagsl10n||e("tagsl10n",$.tagsl10n,"5.5.0"),$.adminCommentsL10n=$.adminCommentsL10n||{hotkeys_highlight_first:{alternative:"window.adminCommentsSettings.hotkeys_highlight_first",func:function(){return $.adminCommentsSettings.hotkeys_highlight_first}},hotkeys_highlight_last:{alternative:"window.adminCommentsSettings.hotkeys_highlight_last",func:function(){return $.adminCommentsSettings.hotkeys_highlight_last}},replyApprove:"",reply:"",warnQuickEdit:"",warnCommentChanges:"",docTitleComments:"",docTitleCommentsCount:""},$.adminCommentsL10n=e("adminCommentsL10n",$.adminCommentsL10n,"5.5.0"),$.tagsSuggestL10n=$.tagsSuggestL10n||{tagDelimiter:"",removeTerm:"",termSelected:"",termAdded:"",termRemoved:""},$.tagsSuggestL10n=e("tagsSuggestL10n",$.tagsSuggestL10n,"5.5.0"),$.wpColorPickerL10n=$.wpColorPickerL10n||{clear:"",clearAriaLabel:"",defaultString:"",defaultAriaLabel:"",pick:"",defaultLabel:""},$.wpColorPickerL10n=e("wpColorPickerL10n",$.wpColorPickerL10n,"5.5.0"),$.attachMediaBoxL10n=$.attachMediaBoxL10n||{error:""},$.attachMediaBoxL10n=e("attachMediaBoxL10n",$.attachMediaBoxL10n,"5.5.0"),$.postL10n=$.postL10n||{ok:"",cancel:"",publishOn:"",publishOnFuture:"",publishOnPast:"",dateFormat:"",showcomm:"",endcomm:"",publish:"",schedule:"",update:"",savePending:"",saveDraft:"",private:"",public:"",publicSticky:"",password:"",privatelyPublished:"",published:"",saveAlert:"",savingText:"",permalinkSaved:""},$.postL10n=e("postL10n",$.postL10n,"5.5.0"),$.inlineEditL10n=$.inlineEditL10n||{error:"",ntdeltitle:"",notitle:"",comma:"",saved:""},$.inlineEditL10n=e("inlineEditL10n",$.inlineEditL10n,"5.5.0"),$.plugininstallL10n=$.plugininstallL10n||{plugin_information:"",plugin_modal_label:"",ays:""},$.plugininstallL10n=e("plugininstallL10n",$.plugininstallL10n,"5.5.0"),$.navMenuL10n=$.navMenuL10n||{noResultsFound:"",warnDeleteMenu:"",saveAlert:"",untitled:""},$.navMenuL10n=e("navMenuL10n",$.navMenuL10n,"5.5.0"),$.commentL10n=$.commentL10n||{submittedOn:"",dateFormat:""},$.commentL10n=e("commentL10n",$.commentL10n,"5.5.0"),$.setPostThumbnailL10n=$.setPostThumbnailL10n||{setThumbnail:"",saving:"",error:"",done:""},$.setPostThumbnailL10n=e("setPostThumbnailL10n",$.setPostThumbnailL10n,"5.5.0"),$.adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}},$.columns={init:function(){var n=this;W(".hide-column-tog","#adv-settings").on("click",function(){var e=W(this),t=e.val();e.prop("checked")?n.checked(t):n.unchecked(t),columns.saveManageColumnsState()})},saveManageColumnsState:function(){var e=this.hidden();W.post(ajaxurl,{action:"hidden-columns",hidden:e,screenoptionnonce:W("#screenoptionnonce").val(),page:pagenow})},checked:function(e){W(".column-"+e).removeClass("hidden"),this.colSpanChange(1)},unchecked:function(e){W(".column-"+e).addClass("hidden"),this.colSpanChange(-1)},hidden:function(){return W(".manage-column[id]").filter(".hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return W(".hide-column-tog").not(":checked").map(function(){var e=this.id;return e.substring(e,e.length-5)}).get().join(",")}},colSpanChange:function(e){var t=W("table").find(".colspanchange");t.length&&(e=parseInt(t.attr("colspan"),10)+e,t.attr("colspan",e.toString()))}},Q.ready(function(){columns.init()}),$.validateForm=function(e){return!W(e).find(".form-required").filter(function(){return""===W(":input:visible",this).val()}).addClass("form-invalid").find(":input:visible").on("change",function(){W(this).closest(".form-invalid").removeClass("form-invalid")}).length},$.showNotice={warn:function(){return!!confirm(q("You are about to permanently delete these items from your site.\nThis action cannot be undone.\n'Cancel' to stop, 'OK' to delete."))},note:function(e){alert(e)}},$.screenMeta={element:null,toggles:null,page:null,init:function(){this.element=W("#screen-meta"),this.toggles=W("#screen-meta-links").find(".show-settings"),this.page=W("#wpcontent"),this.toggles.on("click",this.toggleEvent)},toggleEvent:function(){var e=W("#"+W(this).attr("aria-controls"));e.length&&(e.is(":visible")?screenMeta.close(e,W(this)):screenMeta.open(e,W(this)))},open:function(e,t){W("#screen-meta-links").find(".screen-meta-toggle").not(t.parent()).css("visibility","hidden"),e.parent().show(),e.slideDown("fast",function(){e.trigger("focus"),t.addClass("screen-meta-active").attr("aria-expanded",!0)}),Q.trigger("screen:options:open")},close:function(e,t){e.slideUp("fast",function(){t.removeClass("screen-meta-active").attr("aria-expanded",!1),W(".screen-meta-toggle").css("visibility",""),e.parent().hide()}),Q.trigger("screen:options:close")}},W(".contextual-help-tabs").on("click","a",function(e){var t=W(this);if(e.preventDefault(),t.is(".active a"))return!1;W(".contextual-help-tabs .active").removeClass("active"),t.parent("li").addClass("active"),t=W(t.attr("href")),W(".help-tab-content").not(t).removeClass("active").hide(),t.addClass("active").show()});var t,s=!1,a=W("#permalink_structure"),n=W(".permalink-structure input:radio"),l=W("#custom_selection"),o=W(".form-table.permalink-structure .available-structure-tags button");function c(e){-1!==a.val().indexOf(e.text().trim())?(e.attr("data-label",e.attr("aria-label")),e.attr("aria-label",e.attr("data-used")),e.attr("aria-pressed",!0),e.addClass("active")):e.attr("data-label")&&(e.attr("aria-label",e.attr("data-label")),e.attr("aria-pressed",!1),e.removeClass("active"))}function u(){Q.trigger("wp-window-resized")}n.on("change",function(){"custom"!==this.value&&(a.val(this.value),o.each(function(){c(W(this))}))}),a.on("click input",function(){l.prop("checked",!0)}),a.on("focus",function(e){s=!0,W(this).off(e)}),o.each(function(){c(W(this))}),a.on("change",function(){o.each(function(){c(W(this))})}),o.on("click",function(){var e=a.val(),t=a[0].selectionStart,n=a[0].selectionEnd,i=W(this).text().trim(),o=W(this).attr("data-added");if(-1!==e.indexOf(i))return e=e.replace(i+"/",""),a.val("/"===e?"":e),W("#custom_selection_updated").text(o),void c(W(this));s||0!==t||0!==n||(t=n=e.length),l.prop("checked",!0),"/"!==e.substr(0,t).substr(-1)&&(i="/"+i),"/"!==e.substr(n,1)&&(i+="/"),a.val(e.substr(0,t)+i+e.substr(n)),W("#custom_selection_updated").text(o),c(W(this)),s&&a[0].setSelectionRange&&(i=(e.substr(0,t)+i).length,a[0].setSelectionRange(i,i),a.trigger("focus"))}),Q.ready(function(){var n,i,o,s,e,t,a,r,l,c,u=!1,d=W("input.current-page"),p=d.val(),h=/iPhone|iPad|iPod/.test(navigator.userAgent),m=-1!==navigator.userAgent.indexOf("Android"),f=W("#adminmenuwrap"),v=W("#wpwrap"),g=W("#adminmenu"),b=W("#wp-responsive-overlay"),w=W("#wp-toolbar"),k=w.find('a[aria-haspopup="true"]'),C=W(".meta-box-sortables"),L=!1,y=W("#wpadminbar"),x=0,S=!1,P=!1,T=0,_=!1,M={window:H.height(),wpwrap:v.height(),adminbar:y.height(),menu:f.height()},D=W(".wp-header-end");function E(){var e=W("a.wp-has-current-submenu");"folded"===r?e.attr("aria-haspopup","true"):e.attr("aria-haspopup","false")}function A(e){var t=e.find(".wp-submenu"),n=e.offset().top,i=H.scrollTop(),o=n-i-30,e=n+t.height()+1,n=60+e-v.height(),i=H.height()+i-50;1<(n=o<(n=i');t.find(".notice-dismiss").length||(e.find(".screen-reader-text").text(q("Dismiss this notice.")),e.on("click.wp-dismiss-notice",function(e){e.preventDefault(),t.fadeTo(100,0,function(){t.slideUp(100,function(){t.remove()})})}),t.append(e))})}function j(e,t,n,i){n.on("change",function(){e.val(W(this).val())}),e.on("change",function(){n.val(W(this).val())}),i.on("click",function(e){e.preventDefault(),e.stopPropagation(),t.trigger("click")})}function R(){l.prop("disabled",""===c.map(function(){return W(this).val()}).get().join(""))}function U(e){var t=H.scrollTop(),e=!e||"scroll"!==e.type;if(!h&&!g.data("wp-responsive"))if(M.menu+M.adminbarM.wpwrap)I();else{if(_=!0,M.menu+M.adminbar>M.window){if(t<0)return void(S||(P=!(S=!0),f.css({position:"fixed",top:"",bottom:""})));if(t+M.window>Q.height()-1)return void(P||(S=!(P=!0),f.css({position:"fixed",top:"",bottom:0})));xt+M.window&&(T=t),f.css({position:"absolute",top:T,bottom:""})):!S&&f.offset().top>=t+M.adminbar&&(S=!0,f.css({position:"fixed",top:"",bottom:""})):e&&(S=P=!1,0<(T=t+M.window-M.menu-M.adminbar-1)?f.css({position:"absolute",top:T,bottom:""}):I())}x=t}}function F(){M={window:H.height(),wpwrap:v.height(),adminbar:y.height(),menu:f.height()}}function I(){!h&&_&&(S=P=_=!1,f.css({position:"",top:"",bottom:""}))}function K(){F(),g.data("wp-responsive")?(V.removeClass("sticky-menu"),I()):M.menu+M.adminbar>M.window?(U(),V.removeClass("sticky-menu")):(V.addClass("sticky-menu"),I())}function z(){W(".aria-button-if-js").attr("role","button")}function B(){var e=!1;return e=$.innerWidth?Math.max($.innerWidth,document.documentElement.clientWidth):e}function N(){var e=B()||961;r=e<=782?"responsive":V.hasClass("folded")||V.hasClass("auto-fold")&&e<=960&&782 tr > .check-column :checkbox",function(e){if("undefined"==e.shiftKey)return!0;if(e.shiftKey){if(!u)return!0;n=W(u).closest("form").find(":checkbox").filter(":visible:enabled"),i=n.index(u),o=n.index(this),s=W(this).prop("checked"),0 a",function(e){g.data("wp-responsive")&&(W(this).parent("li").toggleClass("selected"),e.preventDefault())}),e.trigger(),Q.on("wp-window-resized.wp-responsive",W.proxy(this.trigger,this)),H.on("load.wp-responsive",this.maybeDisableSortables),Q.on("postbox-toggled",this.maybeDisableSortables),W("#screen-options-wrap input").on("click",this.maybeDisableSortables)},maybeDisableSortables:function(){(-1').insertAfter("#wpcontent").hide().on("click.wp-responsive",function(){w.find(".menupop.hover").removeClass("hover"),W(this).hide()})),k.on("click.wp-responsive",function(){b.show()})},disableOverlay:function(){k.off("click.wp-responsive"),b.hide()},disableSortables:function(){if(C.length)try{C.sortable("disable"),C.find(".ui-sortable-handle").addClass("is-non-sortable")}catch(e){}},enableSortables:function(){if(C.length)try{C.sortable("enable"),C.find(".ui-sortable-handle").removeClass("is-non-sortable")}catch(e){}}},W(document).ajaxComplete(function(){z()}),Q.on("wp-window-resized.set-menu-state",N),Q.on("wp-menu-state-set wp-collapse-menu",function(e,t){var n,i=W("#collapse-button"),t="folded"===t.state?(n="false",q("Expand Main menu")):(n="true",q("Collapse Main menu"));i.attr({"aria-expanded":n,"aria-label":t})}),$.wpResponsive.init(),K(),N(),E(),O(),z(),Q.on("wp-pin-menu wp-window-resized.pin-menu postboxes-columnchange.pin-menu postbox-toggled.pin-menu wp-collapse-menu.pin-menu wp-scroll-start.pin-menu",K),W(".wp-initial-focus").trigger("focus"),V.on("click",".js-update-details-toggle",function(){var e=W(this).closest(".js-update-details"),t=W("#"+e.data("update-details"));t.hasClass("update-details-moved")||t.insertAfter(e).addClass("update-details-moved"),t.toggle(),W(this).attr("aria-expanded",t.is(":visible"))})}),Q.ready(function(e){var t,n;V.hasClass("update-php")&&(t=e("a.update-from-upload-overwrite"),n=e(".update-from-upload-expired"),t.length&&n.length&&$.setTimeout(function(){t.hide(),n.removeClass("hidden"),$.wp&&$.wp.a11y&&$.wp.a11y.speak(n.text())},714e4))}),H.on("resize.wp-fire-once",function(){$.clearTimeout(t),t=$.setTimeout(u,200)}),"-ms-user-select"in document.documentElement.style&&navigator.userAgent.match(/IEMobile\/10\.0/)&&((n=document.createElement("style")).appendChild(document.createTextNode("@-ms-viewport{width:auto!important}")),document.getElementsByTagName("head")[0].appendChild(n))}(jQuery,window);
\ No newline at end of file
diff --git a/wp-admin/js/customize-controls.js b/wp-admin/js/customize-controls.js
index 32a8a87cfa..45122597f0 100644
--- a/wp-admin/js/customize-controls.js
+++ b/wp-admin/js/customize-controls.js
@@ -1342,10 +1342,10 @@
template = wp.template( 'customize-' + container.containerType + '-default' );
}
if ( template && container.container ) {
- return $.trim( template( _.extend(
+ return template( _.extend(
{ id: container.id },
container.params
- ) ) );
+ ) ).toString().trim();
}
return '';
@@ -1597,7 +1597,7 @@
sectionTitle.attr( 'tabindex', '-1' );
backBtn.attr( 'tabindex', '0' );
- backBtn.focus();
+ backBtn.trigger( 'focus' );
content.css( 'top', '' );
container.scrollTop( 0 );
@@ -1645,7 +1645,7 @@
backBtn.attr( 'tabindex', '-1' );
sectionTitle.attr( 'tabindex', '0' );
- sectionTitle.focus();
+ sectionTitle.trigger( 'focus' );
content.css( 'top', '' );
if ( args.completeCallback ) {
@@ -2734,7 +2734,7 @@
backBtn.attr( 'tabindex', '-1' );
sectionTitle.attr( 'tabindex', '0' );
- sectionTitle.focus();
+ sectionTitle.trigger( 'focus' );
content.css( 'top', '' );
if ( args.completeCallback ) {
@@ -4485,7 +4485,7 @@
y = control.settings.y.get();
inputValue = String( x ) + ' ' + String( y );
radioInput = control.container.find( 'input[name="background-position"][value="' + inputValue + '"]' );
- radioInput.click();
+ radioInput.trigger( 'click' );
} );
control.settings.x.bind( updateRadios );
control.settings.y.bind( updateRadios );
@@ -5452,7 +5452,7 @@
controls = section.controls();
controlIndex = controls.indexOf( control );
if ( controls.length === controlIndex + 1 ) {
- $( '#customize-footer-actions .collapse-sidebar' ).focus();
+ $( '#customize-footer-actions .collapse-sidebar' ).trigger( 'focus' );
} else {
controls[ controlIndex + 1 ].container.find( ':focusable:first' ).focus();
}
@@ -6336,7 +6336,7 @@
} ) );
} );
previewFrame.container.append( form );
- form.submit();
+ form.trigger( 'submit' );
form.remove(); // No need to keep the form around after submitted.
}
@@ -7081,7 +7081,7 @@
// Restore focus if there was a reflow and there was an active (focused) element.
if ( wasReflowed && activeElement ) {
- activeElement.focus();
+ activeElement.trigger( 'focus' );
}
api.trigger( 'pane-contents-reflowed' );
}, api );
@@ -8397,10 +8397,10 @@
}
// Button bindings.
- saveBtn.click( function( event ) {
+ saveBtn.on( 'click', function( event ) {
api.previewer.save();
event.preventDefault();
- }).keydown( function( event ) {
+ }).on( 'keydown', function( event ) {
if ( 9 === event.which ) { // Tab.
return;
}
@@ -8410,7 +8410,7 @@
event.preventDefault();
});
- closeBtn.keydown( function( event ) {
+ closeBtn.on( 'keydown', function( event ) {
if ( 9 === event.which ) { // Tab.
return;
}
@@ -8752,7 +8752,8 @@
if ( title.length ) {
api( 'blogname', function( setting ) {
var updateTitle = function() {
- title.text( $.trim( setting() ) || api.l10n.untitledBlogName );
+ var blogTitle = setting() || '';
+ title.text( blogTitle.toString().trim() || api.l10n.untitledBlogName );
};
setting.bind( updateTitle );
updateTitle();
diff --git a/wp-admin/js/customize-controls.min.js b/wp-admin/js/customize-controls.min.js
index dcf395a8d9..cd28741800 100644
--- a/wp-admin/js/customize-controls.min.js
+++ b/wp-admin/js/customize-controls.min.js
@@ -1,2 +1,2 @@
/*! This file is auto-generated */
-!function(Y){var a,e,s,t,n,i,o,G=wp.customize;G.OverlayNotification=G.Notification.extend({loading:!1,initialize:function(e,t){var n=this;G.Notification.prototype.initialize.call(n,e,t),n.containerClasses+=" notification-overlay",n.loading&&(n.containerClasses+=" notification-loading")},render:function(){var e=G.Notification.prototype.render.call(this);return e.on("keydown",_.bind(this.handleEscape,this)),e},handleEscape:function(e){var t=this;27===e.which&&(e.stopPropagation(),t.dismissible&&t.parent&&t.parent.remove(t.code))}}),G.Notifications=G.Values.extend({alt:!1,defaultConstructor:G.Notification,initialize:function(e){var t=this;G.Values.prototype.initialize.call(t,e),_.bindAll(t,"constrainFocus"),t._addedIncrement=0,t._addedOrder={},t.bind("add",function(e){t.trigger("change",e)}),t.bind("removed",function(e){t.trigger("change",e)})},count:function(){return _.size(this._value)},add:function(e,t){var n,i=this,e="string"==typeof e?(n=e,t):(n=e.code,e);return i.has(n)||(i._addedIncrement+=1,i._addedOrder[n]=i._addedIncrement),G.Values.prototype.add.call(i,n,e)},remove:function(e){return delete this._addedOrder[e],G.Values.prototype.remove.call(this,e)},get:function(e){var a,o=this,t=_.values(o._value);return _.extend({sort:!1},e).sort&&(a={error:4,warning:3,success:2,info:1},t.sort(function(e,t){var n=0,i=0;return(n=!_.isUndefined(a[e.type])?a[e.type]:n)!==(i=!_.isUndefined(a[t.type])?a[t.type]:i)?i-n:o._addedOrder[t.code]-o._addedOrder[e.code]})),t},render:function(){var e,n,t,i=this,a=!1,o=[],s={};i.container&&i.container.length&&(e=i.get({sort:!0}),i.container.toggle(0!==e.length),i.container.is(i.previousContainer)&&_.isEqual(e,i.previousNotifications)||((n=i.container.children("ul").first()).length||(n=Y(""),i.container.append(n)),n.find("> [data-code]").remove(),_.each(i.previousNotifications,function(e){s[e.code]=e}),_.each(e,function(e){var t;!wp.a11y||s[e.code]&&_.isEqual(e.message,s[e.code].message)||wp.a11y.speak(e.message,"assertive"),t=Y(e.render()),e.container=t,n.append(t),e.extended(G.OverlayNotification)&&o.push(e)}),(t=Boolean(o.length))!==(a=i.previousNotifications?Boolean(_.find(i.previousNotifications,function(e){return e.extended(G.OverlayNotification)})):a)&&(Y(document.body).toggleClass("customize-loading",t),i.container.toggleClass("has-overlay-notifications",t),t?(i.previousActiveElement=document.activeElement,Y(document).on("keydown",i.constrainFocus)):Y(document).off("keydown",i.constrainFocus)),t?(i.focusContainer=o[o.length-1].container,i.focusContainer.prop("tabIndex",-1),((t=i.focusContainer.find(":focusable")).length?t.first():i.focusContainer).focus()):i.previousActiveElement&&(Y(i.previousActiveElement).focus(),i.previousActiveElement=null),i.previousNotifications=e,i.previousContainer=i.container,i.trigger("rendered")))},constrainFocus:function(e){var t,n=this;e.stopPropagation(),9===e.which&&(0===(t=n.focusContainer.find(":focusable")).length&&(t=n.focusContainer),!Y.contains(n.focusContainer[0],e.target)||!Y.contains(n.focusContainer[0],document.activeElement)||t.last().is(e.target)&&!e.shiftKey?(e.preventDefault(),t.first().focus()):t.first().is(e.target)&&e.shiftKey&&(e.preventDefault(),t.last().focus()))}}),G.Setting=G.Value.extend({defaults:{transport:"refresh",dirty:!1},initialize:function(e,t,n){var i=this,n=_.extend({previewer:G.previewer},i.defaults,n||{});G.Value.prototype.initialize.call(i,t,n),i.id=e,i._dirty=n.dirty,i.notifications=new G.Notifications,i.bind(i.preview)},preview:function(){var e=this,t=e.transport;"postMessage"===(t="postMessage"===t&&!G.state("previewerAlive").get()?"refresh":t)?e.previewer.send("setting",[e.id,e()]):"refresh"===t&&e.previewer.refresh()},findControls:function(){var n=this,i=[];return G.control.each(function(t){_.each(t.settings,function(e){e.id===n.id&&i.push(t)})}),i}}),G._latestRevision=0,G._lastSavedRevision=0,G._latestSettingRevisions={},G.bind("change",function(e){G._latestRevision+=1,G._latestSettingRevisions[e.id]=G._latestRevision}),G.bind("ready",function(){G.bind("add",function(e){e._dirty&&(G._latestRevision+=1,G._latestSettingRevisions[e.id]=G._latestRevision)})}),G.dirtyValues=function(n){var i={};return G.each(function(e){var t;e._dirty&&(t=G._latestSettingRevisions[e.id],G.state("changesetStatus").get()&&n&&n.unsaved&&(_.isUndefined(t)||t<=G._lastSavedRevision)||(i[e.id]=e.get()))}),i},G.requestChangesetUpdate=function(n,e){var t,i={},a=new Y.Deferred;return 0!==G.state("processing").get()?(a.reject("already_processing"),a.promise()):(t=_.extend({title:null,date:null,autosave:!1,force:!1},e),n&&_.extend(i,n),_.each(G.dirtyValues({unsaved:!0}),function(e,t){n&&null===n[t]||(i[t]=_.extend({},i[t]||{},{value:e}))}),G.trigger("changeset-save",i,t),!t.force&&_.isEmpty(i)&&null===t.title&&null===t.date?(a.resolve({}),a.promise()):t.status?a.reject({code:"illegal_status_in_changeset_update"}).promise():t.date&&t.autosave?a.reject({code:"illegal_autosave_with_date_gmt"}).promise():(G.state("processing").set(G.state("processing").get()+1),a.always(function(){G.state("processing").set(G.state("processing").get()-1)}),delete(e=G.previewer.query({excludeCustomizedSaved:!0})).customized,_.extend(e,{nonce:G.settings.nonce.save,customize_theme:G.settings.theme.stylesheet,customize_changeset_data:JSON.stringify(i)}),null!==t.title&&(e.customize_changeset_title=t.title),null!==t.date&&(e.customize_changeset_date=t.date),!1!==t.autosave&&(e.customize_changeset_autosave="true"),G.trigger("save-request-params",e),(e=wp.ajax.post("customize_save",e)).done(function(e){var n={};G._lastSavedRevision=Math.max(G._latestRevision,G._lastSavedRevision),G.state("changesetStatus").set(e.changeset_status),e.changeset_date&&G.state("changesetDate").set(e.changeset_date),a.resolve(e),G.trigger("changeset-saved",e),e.setting_validities&&_.each(e.setting_validities,function(e,t){!0===e&&_.isObject(i[t])&&!_.isUndefined(i[t].value)&&(n[t]=i[t].value)}),G.previewer.send("changeset-saved",_.extend({},e,{saved_changeset_values:n}))}),e.fail(function(e){a.reject(e),G.trigger("changeset-error",e)}),e.always(function(e){e.setting_validities&&G._handleSettingValidities({settingValidities:e.setting_validities})}),a.promise()))},G.utils.bubbleChildValueChanges=function(n,e){Y.each(e,function(e,t){n[t].bind(function(e,t){n.parent&&e!==t&&n.parent.trigger("change",n)})})},e=function(e){var t,n,i=this,a=function(){var e=(i.extended(G.Panel)||i.extended(G.Section))&&i.expanded&&i.expanded()?i.contentContainer:i.container;(n=0===(n=e.find(".control-focus:first")).length?e.find("input, select, textarea, button, object, a[href], [tabindex]").filter(":visible").first():n).focus()};(e=e||{}).completeCallback?(t=e.completeCallback,e.completeCallback=function(){a(),t()}):e.completeCallback=a,G.state("paneVisible").set(!0),i.expand?i.expand(e):e.completeCallback()},G.utils.prioritySort=function(e,t){return e.priority()===t.priority()&&"number"==typeof e.params.instanceNumber&&"number"==typeof t.params.instanceNumber?e.params.instanceNumber-t.params.instanceNumber:e.priority()-t.priority()},G.utils.isKeydownButNotEnterEvent=function(e){return"keydown"===e.type&&13!==e.which},G.utils.areElementListsEqual=function(e,t){return e.length===t.length&&-1===_.indexOf(_.map(_.zip(e,t),function(e){return Y(e[0]).is(e[1])}),!1)},G.utils.highlightButton=function(e,t){var n,i="button-see-me",a=!1;function o(){a=!0}return(n=_.extend({delay:0,focusTarget:e},t)).focusTarget.on("focusin",o),setTimeout(function(){n.focusTarget.off("focusin",o),a||(e.addClass(i),e.one("animationend",function(){e.removeClass(i)}))},n.delay),o},G.utils.getCurrentTimestamp=function(){var e=_.now(),t=new Date(G.settings.initialServerDate.replace(/-/g,"/")),e=e-G.settings.initialClientTimestamp;return e+=G.settings.initialClientTimestamp-G.settings.initialServerTimestamp,t.setTime(t.getTime()+e),t.getTime()},G.utils.getRemainingTime=function(e){var e=e instanceof Date?e.getTime():"string"==typeof e?new Date(e.replace(/-/g,"/")).getTime():e,e=e-G.utils.getCurrentTimestamp();return e=Math.ceil(e/1e3)},t=document.createElement("div"),n={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"},i=_.find(_.keys(n),function(e){return!_.isUndefined(t.style[e])}),s=i?n[i]:null,a=G.Class.extend({defaultActiveArguments:{duration:"fast",completeCallback:Y.noop},defaultExpandedArguments:{duration:"fast",completeCallback:Y.noop},containerType:"container",defaults:{title:"",description:"",priority:100,type:"default",content:null,active:!0,instanceNumber:null},initialize:function(e,t){var n=this;n.id=e,a.instanceCounter||(a.instanceCounter=0),a.instanceCounter++,Y.extend(n,{params:_.defaults(t.params||t,n.defaults)}),n.params.instanceNumber||(n.params.instanceNumber=a.instanceCounter),n.notifications=new G.Notifications,n.templateSelector=n.params.templateId||"customize-"+n.containerType+"-"+n.params.type,n.container=Y(n.params.content),0===n.container.length&&(n.container=Y(n.getContainer())),n.headContainer=n.container,n.contentContainer=n.getContent(),n.container=n.container.add(n.contentContainer),n.deferred={embedded:new Y.Deferred},n.priority=new G.Value,n.active=new G.Value,n.activeArgumentsQueue=[],n.expanded=new G.Value,n.expandedArgumentsQueue=[],n.active.bind(function(e){var t=n.activeArgumentsQueue.shift(),t=Y.extend({},n.defaultActiveArguments,t);e=e&&n.isContextuallyActive(),n.onChangeActive(e,t)}),n.expanded.bind(function(e){var t=n.expandedArgumentsQueue.shift(),t=Y.extend({},n.defaultExpandedArguments,t);n.onChangeExpanded(e,t)}),n.deferred.embedded.done(function(){n.setupNotifications(),n.attachEvents()}),G.utils.bubbleChildValueChanges(n,["priority","active"]),n.priority.set(n.params.priority),n.active.set(n.params.active),n.expanded.set(!1)},getNotificationsContainerElement:function(){return this.contentContainer.find(".customize-control-notifications-container:first")},setupNotifications:function(){var e,t=this;t.notifications.container=t.getNotificationsContainerElement(),e=function(){t.expanded.get()&&t.notifications.render()},t.expanded.bind(e),e(),t.notifications.bind("change",_.debounce(e))},ready:function(){},_children:function(t,e){var n=this,i=[];return G[e].each(function(e){e[t].get()===n.id&&i.push(e)}),i.sort(G.utils.prioritySort),i},isContextuallyActive:function(){throw new Error("Container.isContextuallyActive() must be overridden in a subclass.")},onChangeActive:function(e,t){var n,i=this,a=i.headContainer;t.unchanged?t.completeCallback&&t.completeCallback():(n="resolved"===G.previewer.deferred.active.state()?t.duration:0,i.extended(G.Panel)&&(G.panel.each(function(e){e!==i&&e.expanded()&&(n=0)}),e||_.each(i.sections(),function(e){e.collapse({duration:0})})),Y.contains(document,a.get(0))?e?a.slideDown(n,t.completeCallback):i.expanded()?i.collapse({duration:n,completeCallback:function(){a.slideUp(n,t.completeCallback)}}):a.slideUp(n,t.completeCallback):(a.toggle(e),t.completeCallback&&t.completeCallback()))},_toggleActive:function(e,t){return t=t||{},e&&this.active.get()||!e&&!this.active.get()?(t.unchanged=!0,this.onChangeActive(this.active.get(),t),!1):(t.unchanged=!1,this.activeArgumentsQueue.push(t),this.active.set(e),!0)},activate:function(e){return this._toggleActive(!0,e)},deactivate:function(e){return this._toggleActive(!1,e)},onChangeExpanded:function(){throw new Error("Must override with subclass.")},_toggleExpanded:function(e,t){var n,i=this;return n=(t=t||{}).completeCallback,!(e&&!i.active())&&(G.state("paneVisible").set(!0),t.completeCallback=function(){n&&n.apply(i,arguments),e?i.container.trigger("expanded"):i.container.trigger("collapsed")},e&&i.expanded.get()||!e&&!i.expanded.get()?(t.unchanged=!0,i.onChangeExpanded(i.expanded.get(),t),!1):(t.unchanged=!1,i.expandedArgumentsQueue.push(t),i.expanded.set(e),!0))},expand:function(e){return this._toggleExpanded(!0,e)},collapse:function(e){return this._toggleExpanded(!1,e)},_animateChangeExpanded:function(t){var a,o,n,i;s?(o=(a=this).contentContainer,i=o.closest(".wp-full-overlay").add(o),a.panel&&""!==a.panel()&&!G.panel(a.panel()).contentContainer.hasClass("skip-transition")||(i=i.add("#customize-info, .customize-pane-parent")),n=function(e){2===e.eventPhase&&Y(e.target).is(o)&&(o.off(s,n),i.removeClass("busy"),t&&t())},o.on(s,n),i.addClass("busy"),_.defer(function(){var e=o.closest(".wp-full-overlay-sidebar-content"),t=e.scrollTop(),n=o.data("previous-scrollTop")||0,i=a.expanded();i&&0"},getContent:function(){var e=this.container,t=e.find(".accordion-section-content, .control-panel-content").first(),n="sub-"+e.attr("id"),i=n,a=e.attr("aria-owns");return a&&(i=i+" "+a),e.attr("aria-owns",i),t.detach().attr({id:n,class:"customize-pane-child "+t.attr("class")+" "+e.attr("class")})}}),G.Section=a.extend({containerType:"section",containerParent:"#customize-theme-controls",containerPaneParent:".customize-pane-parent",defaults:{title:"",description:"",priority:100,type:"default",content:null,active:!0,instanceNumber:null,panel:null,customizeAction:""},initialize:function(e,t){var n=this,i=t.params||t;i.type||_.find(G.sectionConstructor,function(e,t){return e===n.constructor&&(i.type=t,!0)}),a.prototype.initialize.call(n,e,i),n.id=e,n.panel=new G.Value,n.panel.bind(function(e){Y(n.headContainer).toggleClass("control-subsection",!!e)}),n.panel.set(n.params.panel||""),G.utils.bubbleChildValueChanges(n,["panel"]),n.embed(),n.deferred.embedded.done(function(){n.ready()})},embed:function(){var e,n=this;n.containerParent=G.ensure(n.containerParent),e=function(e){var t;e?G.panel(e,function(e){e.deferred.embedded.done(function(){t=e.contentContainer,n.headContainer.parent().is(t)||t.append(n.headContainer),n.contentContainer.parent().is(n.headContainer)||n.containerParent.append(n.contentContainer),n.deferred.embedded.resolve()})}):(t=G.ensure(n.containerPaneParent),n.headContainer.parent().is(t)||t.append(n.headContainer),n.contentContainer.parent().is(n.headContainer)||n.containerParent.append(n.contentContainer),n.deferred.embedded.resolve())},n.panel.bind(e),e(n.panel.get())},attachEvents:function(){var e,t,n=this;n.container.hasClass("cannot-expand")||(n.container.find(".accordion-section-title, .customize-section-back").on("click keydown",function(e){G.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),n.expanded()?n.collapse():n.expand())}),n.container.find(".customize-section-title .customize-help-toggle").on("click",function(){(e=n.container.find(".section-meta")).hasClass("cannot-expand")||((t=e.find(".customize-section-description:first")).toggleClass("open"),t.slideToggle(n.defaultExpandedArguments.duration,function(){t.trigger("toggled")}),Y(this).attr("aria-expanded",function(e,t){return"true"===t?"false":"true"}))}))},isContextuallyActive:function(){var e=this.controls(),t=0;return _(e).each(function(e){e.active()&&(t+=1)}),0!==t},controls:function(){return this._children("section","control")},onChangeExpanded:function(e,t){var n,i,a=this,o=a.headContainer.closest(".wp-full-overlay-sidebar-content"),s=a.contentContainer,r=a.headContainer.closest(".wp-full-overlay"),c=s.find(".customize-section-back"),l=a.headContainer.find(".accordion-section-title").first();e&&!s.hasClass("open")?(n=t.unchanged?t.completeCallback:Y.proxy(function(){a._animateChangeExpanded(function(){l.attr("tabindex","-1"),c.attr("tabindex","0"),c.focus(),s.css("top",""),o.scrollTop(0),t.completeCallback&&t.completeCallback()}),s.addClass("open"),r.addClass("section-open"),G.state("expandedSection").set(a)},this),t.allowMultiple||G.section.each(function(e){e!==a&&e.collapse({duration:t.duration})}),a.panel()?G.panel(a.panel()).expand({duration:t.duration,completeCallback:n}):(t.allowMultiple||G.panel.each(function(e){e.collapse()}),n())):!e&&s.hasClass("open")?(a.panel()&&(i=G.panel(a.panel())).contentContainer.hasClass("skip-transition")&&i.collapse(),a._animateChangeExpanded(function(){c.attr("tabindex","-1"),l.attr("tabindex","0"),l.focus(),s.css("top",""),t.completeCallback&&t.completeCallback()}),s.removeClass("open"),r.removeClass("section-open"),a===G.state("expandedSection").get()&&G.state("expandedSection").set(!1)):t.completeCallback&&t.completeCallback()}}),G.ThemesSection=G.Section.extend({currentTheme:"",overlay:"",template:"",screenshotQueue:null,$window:null,$body:null,loaded:0,loading:!1,fullyLoaded:!1,term:"",tags:"",nextTerm:"",nextTags:"",filtersHeight:0,headerContainer:null,updateCountDebounced:null,initialize:function(e,t){var n=this;n.headerContainer=Y(),n.$window=Y(window),n.$body=Y(document.body),G.Section.prototype.initialize.call(n,e,t),n.updateCountDebounced=_.debounce(n.updateCount,500)},embed:function(){var n=this,e=function(e){var t;G.panel(e,function(e){e.deferred.embedded.done(function(){t=e.contentContainer,n.headContainer.parent().is(t)||t.find(".customize-themes-full-container-container").before(n.headContainer),n.contentContainer.parent().is(n.headContainer)||n.containerParent.append(n.contentContainer),n.deferred.embedded.resolve()})})};n.panel.bind(e),e(n.panel.get())},ready:function(){var t=this;t.overlay=t.container.find(".theme-overlay"),t.template=wp.template("customize-themes-details-view"),t.container.on("keydown",function(e){t.overlay.find(".theme-wrap").is(":visible")&&(39===e.keyCode&&t.nextTheme(),37===e.keyCode&&t.previousTheme(),27===e.keyCode&&(t.$body.hasClass("modal-open")?t.closeDetails():t.headerContainer.find(".customize-themes-section-title").focus(),e.stopPropagation()))}),t.renderScreenshots=_.throttle(t.renderScreenshots,100),_.bindAll(t,"renderScreenshots","loadMore","checkTerm","filtersChecked")},isContextuallyActive:function(){return this.active()},attachEvents:function(){var e,n=this;function t(){var e=n.headerContainer.find(".customize-themes-section-title");e.toggleClass("selected",n.expanded()),e.attr("aria-expanded",n.expanded()?"true":"false"),n.expanded()||e.removeClass("details-open")}n.container.find(".customize-section-back").on("click keydown",function(e){G.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),n.collapse())}),n.headerContainer=Y("#accordion-section-"+n.id),n.headerContainer.on("click",".customize-themes-section-title",function(){n.headerContainer.find(".filter-details").length&&(n.headerContainer.find(".customize-themes-section-title").toggleClass("details-open").attr("aria-expanded",function(e,t){return"true"===t?"false":"true"}),n.headerContainer.find(".filter-details").slideToggle(180)),n.expanded()||n.expand()}),n.container.on("click",".theme-actions .preview-theme",function(){G.panel("themes").loadThemePreview(Y(this).data("slug"))}),n.container.on("click",".left",function(){n.previousTheme()}),n.container.on("click",".right",function(){n.nextTheme()}),n.container.on("click",".theme-backdrop, .close",function(){n.closeDetails()}),"local"===n.params.filter_type?n.container.on("input",".wp-filter-search-themes",function(e){n.filterSearch(e.currentTarget.value)}):"remote"===n.params.filter_type&&(e=_.debounce(n.checkTerm,500),n.contentContainer.on("input",".wp-filter-search",function(){G.panel("themes").expanded()&&(e(n),n.expanded()||n.expand())}),n.contentContainer.on("click",".filter-group input",function(){n.filtersChecked(),n.checkTerm(n)})),n.contentContainer.on("click",".feature-filter-toggle",function(e){var t=Y(".customize-themes-full-container"),e=Y(e.currentTarget);n.filtersHeight=e.parent().next(".filter-drawer").height(),0 .accordion-section-title .customize-help-toggle").on("click",function(){var e;t.hasClass("cannot-expand")||(e=t.find(".customize-panel-description:first"),t.hasClass("open")?(t.toggleClass("open"),e.slideUp(n.defaultExpandedArguments.duration,function(){e.trigger("toggled")}),Y(this).attr("aria-expanded",!1)):(e.slideDown(n.defaultExpandedArguments.duration,function(){e.trigger("toggled")}),t.toggleClass("open"),Y(this).attr("aria-expanded",!0)))})},sections:function(){return this._children("panel","section")},isContextuallyActive:function(){var e=this.sections(),t=0;return _(e).each(function(e){e.active()&&e.isContextuallyActive()&&(t+=1)}),0!==t},onChangeExpanded:function(e,t){var n,i,a,o,s,r,c;t.unchanged?t.completeCallback&&t.completeCallback():(a=(i=(n=this).contentContainer).closest(".wp-full-overlay"),o=i.closest(".wp-full-overlay-sidebar-content"),s=n.headContainer.find(".accordion-section-title"),r=i.find(".customize-panel-back"),c=n.sections(),e&&!i.hasClass("current-panel")?(G.section.each(function(e){n.id!==e.panel()&&e.collapse({duration:0})}),G.panel.each(function(e){n!==e&&e.collapse({duration:0})}),n.params.autoExpandSoleSection&&1===c.length&&c[0].active.get()?(i.addClass("current-panel skip-transition"),a.addClass("in-sub-panel"),c[0].expand({completeCallback:t.completeCallback})):(n._animateChangeExpanded(function(){s.attr("tabindex","-1"),r.attr("tabindex","0"),r.focus(),i.css("top",""),o.scrollTop(0),t.completeCallback&&t.completeCallback()}),i.addClass("current-panel"),a.addClass("in-sub-panel")),G.state("expandedPanel").set(n)):!e&&i.hasClass("current-panel")&&(i.hasClass("skip-transition")?i.removeClass("skip-transition"):n._animateChangeExpanded(function(){s.attr("tabindex","0"),r.attr("tabindex","-1"),s.focus(),i.css("top",""),t.completeCallback&&t.completeCallback()}),a.removeClass("in-sub-panel"),i.removeClass("current-panel"),n===G.state("expandedPanel").get()&&G.state("expandedPanel").set(!1)))},renderContent:function(){var e=this,t=0!==Y("#tmpl-"+e.templateSelector+"-content").length?wp.template(e.templateSelector+"-content"):wp.template("customize-panel-default-content");t&&e.headContainer&&e.contentContainer.html(t(_.extend({id:e.id},e.params)))}}),G.ThemesPanel=G.Panel.extend({initialize:function(e,t){this.installingThemes=[],G.Panel.prototype.initialize.call(this,e,t)},canSwitchTheme:function(e){return!(!e||e!==G.settings.theme.stylesheet)||"publish"===G.state("selectedChangesetStatus").get()&&(""===G.state("changesetStatus").get()||"auto-draft"===G.state("changesetStatus").get())},attachEvents:function(){var t=this;function e(){t.canSwitchTheme()?t.notifications.remove("theme_switch_unavailable"):t.notifications.add(new G.Notification("theme_switch_unavailable",{message:G.l10n.themePreviewUnavailable,type:"warning"}))}G.Panel.prototype.attachEvents.apply(t),G.settings.theme._canInstall&&G.settings.theme._filesystemCredentialsNeeded&&t.notifications.add(new G.Notification("theme_install_unavailable",{message:G.l10n.themeInstallUnavailable,type:"info",dismissible:!0})),e(),G.state("selectedChangesetStatus").bind(e),G.state("changesetStatus").bind(e),t.contentContainer.on("click",".customize-theme",function(){t.collapse()}),t.contentContainer.on("click",".customize-themes-section-title, .customize-themes-mobile-back",function(){Y(".wp-full-overlay").toggleClass("showing-themes")}),t.contentContainer.on("click",".theme-install",function(e){t.installTheme(e)}),t.contentContainer.on("click",".update-theme, #update-theme",function(e){e.preventDefault(),e.stopPropagation(),t.updateTheme(e)}),t.contentContainer.on("click",".delete-theme",function(e){t.deleteTheme(e)}),_.bindAll(t,"installTheme","updateTheme")},onChangeExpanded:function(e,t){var n,i=!1;G.Panel.prototype.onChangeExpanded.apply(this,[e,t]),t.unchanged?t.completeCallback&&t.completeCallback():(n=this.headContainer.closest(".wp-full-overlay"),e?(n.addClass("in-themes-panel").delay(200).find(".customize-themes-full-container").addClass("animate"),_.delay(function(){n.addClass("themes-panel-expanded")},200),600",{id:"customize-control-"+e.replace(/]/g,"").replace(/\[/g,"-"),class:"customize-control customize-control-"+i.params.type})),i.id=e,i.selector="#customize-control-"+e.replace(/\]/g,"").replace(/\[/g,"-"),i.params.content?i.container=Y(i.params.content):i.container=Y(i.selector),i.params.templateId?i.templateSelector=i.params.templateId:i.templateSelector="customize-control-"+i.params.type+"-content",i.deferred=_.extend(i.deferred||{},{embedded:new Y.Deferred}),i.section=new G.Value,i.priority=new G.Value,i.active=new G.Value,i.activeArgumentsQueue=[],i.notifications=new G.Notifications({alt:i.altNotice}),i.elements=[],i.active.bind(function(e){var t=i.activeArgumentsQueue.shift(),t=Y.extend({},i.defaultActiveArguments,t);i.onChangeActive(e,t)}),i.section.set(i.params.section),i.priority.set(isNaN(i.params.priority)?10:i.params.priority),i.active.set(i.params.active),G.utils.bubbleChildValueChanges(i,["section","priority","active"]),i.settings={},n={},i.params.setting&&(n.default=i.params.setting),_.extend(n,i.params.settings),_.each(n,function(e,t){var n;_.isObject(e)&&_.isFunction(e.extended)&&e.extended(G.Value)?i.settings[t]=e:_.isString(e)&&((n=G(e))?i.settings[t]=n:a.push(e))}),e=function(){_.each(n,function(e,t){!i.settings[t]&&_.isString(e)&&(i.settings[t]=G(e))}),i.settings[0]&&!i.settings.default&&(i.settings.default=i.settings[0]),i.setting=i.settings.default||null,i.linkElements(),i.embed()},0===a.length?e():G.apply(G,a.concat(e)),i.deferred.embedded.done(function(){i.linkElements(),i.setupNotifications(),i.ready()})},linkElements:function(){var i,a=this,o=a.container.find("[data-customize-setting-link], [data-customize-setting-key-link]"),s={};o.each(function(){var e,t,n=Y(this);if(!n.data("customizeSettingLinked")){if(n.data("customizeSettingLinked",!0),n.is(":radio")){if(e=n.prop("name"),s[e])return;s[e]=!0,n=o.filter('[name="'+e+'"]')}n.data("customizeSettingLink")?t=G(n.data("customizeSettingLink")):n.data("customizeSettingKeyLink")&&(t=a.settings[n.data("customizeSettingKeyLink")]),t&&(i=new G.Element(n),a.elements.push(i),i.sync(t),i.set(t()))}})},embed:function(){var n=this,e=function(e){var t;e&&G.section(e,function(e){e.deferred.embedded.done(function(){t=e.contentContainer.is("ul")?e.contentContainer:e.contentContainer.find("ul:first"),n.container.parent().is(t)||t.append(n.container),n.renderContent(),n.deferred.embedded.resolve()})})};n.section.bind(e),e(n.section.get())},ready:function(){var t,n=this;"dropdown-pages"===n.params.type&&n.params.allow_addition&&((t=n.container.find(".new-content-item")).hide(),n.container.on("click",".add-new-toggle",function(e){Y(e.currentTarget).slideUp(180),t.slideDown(180),t.find(".create-item-input").focus()}),n.container.on("click",".add-content",function(){n.addNewPage()}),n.container.on("keydown",".create-item-input",function(e){13===e.which&&n.addNewPage()}))},getNotificationsContainerElement:function(){var e,t=this,n=t.container.find(".customize-control-notifications-container:first");return n.length||(n=Y(''),t.container.hasClass("customize-control-nav_menu_item")?t.container.find(".menu-item-settings:first").prepend(n):t.container.hasClass("customize-control-widget_form")?t.container.find(".widget-inside:first").prepend(n):(e=t.container.find(".customize-control-title")).length?e.after(n):t.container.prepend(n)),n},setupNotifications:function(){var n,e,i=this;_.each(i.settings,function(n){n.notifications&&(n.notifications.bind("add",function(e){var t=_.extend({},e,{setting:n.id});i.notifications.add(new G.Notification(n.id+":"+e.code,t))}),n.notifications.bind("remove",function(e){i.notifications.remove(n.id+":"+e.code)}))}),n=function(){var e=i.section();(!e||G.section.has(e)&&G.section(e).expanded())&&i.notifications.render()},i.notifications.bind("rendered",function(){var e=i.notifications.get();i.container.toggleClass("has-notifications",0!==e.length),i.container.toggleClass("has-error",0!==_.where(e,{type:"error"}).length)}),e=function(e,t){t&&G.section.has(t)&&G.section(t).expanded.unbind(n),e&&G.section(e,function(e){e.expanded.bind(n),n()})},i.section.bind(e),e(i.section.get()),i.notifications.bind("change",_.debounce(n))},renderNotifications:function(){var e,t,n=this,i=!1;"undefined"!=typeof console&&console.warn&&console.warn("[DEPRECATED] wp.customize.Control.prototype.renderNotifications() is deprecated in favor of instantating a wp.customize.Notifications and calling its render() method."),(e=n.getNotificationsContainerElement())&&e.length&&(t=[],n.notifications.each(function(e){t.push(e),"error"===e.type&&(i=!0)}),0===t.length?e.stop().slideUp("fast"):e.stop().slideDown("fast",null,function(){Y(this).css("height","auto")}),n.notificationsTemplate||(n.notificationsTemplate=wp.template("customize-control-notifications")),n.container.toggleClass("has-notifications",0!==t.length),n.container.toggleClass("has-error",i),e.empty().append(Y.trim(n.notificationsTemplate({notifications:t,altNotice:Boolean(n.altNotice)}))))},expand:function(e){G.section(this.section()).expand(e)},focus:e,onChangeActive:function(e,t){t.unchanged?t.completeCallback&&t.completeCallback():Y.contains(document,this.container[0])?e?this.container.slideDown(t.duration,t.completeCallback):this.container.slideUp(t.duration,t.completeCallback):(this.container.toggle(e),t.completeCallback&&t.completeCallback())},toggle:function(e){return this.onChangeActive(e,this.defaultActiveArguments)},activate:a.prototype.activate,deactivate:a.prototype.deactivate,_toggleActive:a.prototype._toggleActive,dropdownInit:function(){function e(e){"string"==typeof e&&i.statuses&&i.statuses[e]?n.html(i.statuses[e]).show():n.hide()}var t=this,n=this.container.find(".dropdown-status"),i=this.params,a=!1;this.container.on("click keydown",".dropdown",function(e){G.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),a||t.container.toggleClass("open"),t.container.hasClass("open")&&t.container.parent().parent().find("li.library-selected").focus(),a=!0,setTimeout(function(){a=!1},400))}),this.setting.bind(e),e(this.setting())},renderContent:function(){var e,t=this,n=["button","checkbox","date","datetime-local","email","month","number","password","radio","range","search","select","tel","time","text","textarea","week","url"],i=t.templateSelector;i==="customize-control-"+t.params.type+"-content"&&_.contains(n,t.params.type)&&!document.getElementById("tmpl-"+i)&&0===t.container.children().length&&(i="customize-control-default-content"),document.getElementById("tmpl-"+i)&&(e=wp.template(i))&&t.container&&t.container.html(e(t.params)),t.notifications.container=t.getNotificationsContainerElement(),(!(e=t.section())||G.section.has(e)&&G.section(e).expanded())&&t.notifications.render()},addNewPage:function(){var e,a,o,t,s,r,c=this;"dropdown-pages"===c.params.type&&c.params.allow_addition&&G.Menus&&(a=c.container.find(".add-new-toggle"),o=c.container.find(".new-content-item"),t=c.container.find(".create-item-input"),s=t.val(),r=c.container.find("select"),s?(t.removeClass("invalid"),t.attr("disabled","disabled"),(e=G.Menus.insertAutoDraftPost({post_title:s,post_type:"page"})).done(function(e){var t,n,i=new G.Menus.AvailableItemModel({id:"post-"+e.post_id,title:s,type:"post_type",type_label:G.Menus.data.l10n.page_label,object:"page",object_id:e.post_id,url:e.url});G.Menus.availableMenuItemsPanel.collection.add(i),t=Y("#available-menu-items-post_type-page").find(".available-menu-items-list"),n=wp.template("available-menu-item"),t.prepend(n(i.attributes)),r.focus(),c.setting.set(String(e.post_id)),o.slideUp(180),a.slideDown(180)}),e.always(function(){t.val("").removeAttr("disabled")})):t.addClass("invalid"))}}),G.ColorControl=G.Control.extend({ready:function(){var t,n=this,e="hue"===this.params.mode,i=!1;e?(t=this.container.find(".color-picker-hue")).val(n.setting()).wpColorPicker({change:function(e,t){i=!0,n.setting(t.color.h()),i=!1}}):(t=this.container.find(".color-picker-hex")).val(n.setting()).wpColorPicker({change:function(){i=!0,n.setting.set(t.wpColorPicker("color")),i=!1},clear:function(){i=!0,n.setting.set(""),i=!1}}),n.setting.bind(function(e){i||(t.val(e),t.wpColorPicker("color",e))}),n.container.on("keydown",function(e){27===e.which&&n.container.find(".wp-picker-container").hasClass("wp-picker-active")&&(t.wpColorPicker("close"),n.container.find(".wp-color-result").focus(),e.stopPropagation())})}}),G.MediaControl=G.Control.extend({ready:function(){var n=this;function e(e){var t=Y.Deferred();n.extended(G.UploadControl)?t.resolve():(e=parseInt(e,10),_.isNaN(e)||e<=0?(delete n.params.attachment,t.resolve()):n.params.attachment&&n.params.attachment.id===e&&t.resolve()),"pending"===t.state()&&wp.media.attachment(e).fetch().done(function(){n.params.attachment=this.attributes,t.resolve(),wp.customize.previewer.send(n.setting.id+"-attachment-data",this.attributes)}),t.done(function(){n.renderContent()})}_.bindAll(n,"restoreDefault","removeFile","openFrame","select","pausePlayer"),n.container.on("click keydown",".upload-button",n.openFrame),n.container.on("click keydown",".upload-button",n.pausePlayer),n.container.on("click keydown",".thumbnail-image img",n.openFrame),n.container.on("click keydown",".default-button",n.restoreDefault),n.container.on("click keydown",".remove-button",n.pausePlayer),n.container.on("click keydown",".remove-button",n.removeFile),n.container.on("click keydown",".remove-button",n.cleanupPlayer),G.section(n.section()).container.on("expanded",function(){n.player&&n.player.setControlsSize()}).on("collapsed",function(){n.pausePlayer()}),e(n.setting()),n.setting.bind(e)},pausePlayer:function(){this.player&&this.player.pause()},cleanupPlayer:function(){this.player&&wp.media.mixin.removePlayer(this.player)},openFrame:function(e){G.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),this.frame||this.initFrame(),this.frame.open())},initFrame:function(){this.frame=wp.media({button:{text:this.params.button_labels.frame_button},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:this.params.mime_type}),multiple:!1,date:!1})]}),this.frame.on("select",this.select)},select:function(){var e=this.frame.state().get("selection").first().toJSON(),t=window._wpmejsSettings||{};this.params.attachment=e,this.setting(e.id),(e=this.container.find("audio, video").get(0))?this.player=new MediaElementPlayer(e,t):this.cleanupPlayer()},restoreDefault:function(e){G.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),this.params.attachment=this.params.defaultAttachment,this.setting(this.params.defaultAttachment.url))},removeFile:function(e){G.utils.isKeydownButNotEnterEvent(e)||(e.preventDefault(),this.params.attachment={},this.setting(""),this.renderContent())}}),G.UploadControl=G.MediaControl.extend({select:function(){var e=this.frame.state().get("selection").first().toJSON(),t=window._wpmejsSettings||{};this.params.attachment=e,this.setting(e.url),(e=this.container.find("audio, video").get(0))?this.player=new MediaElementPlayer(e,t):this.cleanupPlayer()},success:function(){},removerVisibility:function(){}}),G.ImageControl=G.UploadControl.extend({thumbnailSrc:function(){}}),G.BackgroundControl=G.UploadControl.extend({ready:function(){G.UploadControl.prototype.ready.apply(this,arguments)},select:function(){G.UploadControl.prototype.select.apply(this,arguments),wp.ajax.post("custom-background-add",{nonce:_wpCustomizeBackground.nonces.add,wp_customize:"on",customize_theme:G.settings.theme.stylesheet,attachment_id:this.params.attachment.id})}}),G.BackgroundPositionControl=G.Control.extend({ready:function(){var e,n=this;n.container.on("change",'input[name="background-position"]',function(){var e=Y(this).val().split(" ");n.settings.x(e[0]),n.settings.y(e[1])}),e=_.debounce(function(){var e=n.settings.x.get(),t=n.settings.y.get(),t=String(e)+" "+String(t);n.container.find('input[name="background-position"][value="'+t+'"]').click()}),n.settings.x.bind(e),n.settings.y.bind(e),e()}}),G.CroppedImageControl=G.MediaControl.extend({openFrame:function(e){G.utils.isKeydownButNotEnterEvent(e)||(this.initFrame(),this.frame.setState("library").open())},initFrame:function(){var e=_wpMediaViewsL10n;this.frame=wp.media({button:{text:e.select,close:!1},states:[new wp.media.controller.Library({title:this.params.button_labels.frame_title,library:wp.media.query({type:"image"}),multiple:!1,date:!1,priority:20,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelect,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){var e=this.frame.state().get("selection").first().toJSON();this.params.width!==e.width||this.params.height!==e.height||this.params.flex_width||this.params.flex_height?this.frame.setState("cropper"):(this.setImageFromAttachment(e),this.frame.close())},onCropped:function(e){this.setImageFromAttachment(e)},calculateImageSelectOptions:function(e,t){var n=t.get("control"),i=!!parseInt(n.params.flex_width,10),a=!!parseInt(n.params.flex_height,10),o=e.get("width"),s=e.get("height"),r=parseInt(n.params.width,10),c=parseInt(n.params.height,10),l=r/c,d=r,e=c;return t.set("canSkipCrop",!n.mustBeCropped(i,a,r,c,o,s)),l",{title:G.l10n.previewIframeTitle,name:"customize-"+a.channel()}),a.iframe.attr("onmousewheel",""),a.iframe.attr("sandbox","allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-presentation allow-same-origin allow-scripts"),c?a.iframe.attr("data-src",e.href):a.iframe.attr("src",e.href),a.iframe.appendTo(a.container),a.targetWindow(a.iframe[0].contentWindow),c&&((i=Y("