External Libraries: Further fix jQuery deprecations in WordPress core.

This includes many minor adjustments to a wide array of core files to replace shorthands with full declarations.

Follow-up to [50001], [50270], [50367].

Props Clorith, hellofromTonya, peterwilsoncc, adamsilverstein, aristath.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@50420


git-svn-id: http://core.svn.wordpress.org/trunk@50031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-02-23 19:45:04 +00:00
parent 5fd4f8e993
commit b65d83b872
60 changed files with 155 additions and 158 deletions

View File

@ -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();
/**

View File

@ -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<s.length&&(a.app_id=s),a=wp.hooks.applyFilters("wp_application_passwords_approve_app_request",a,i),wp.apiRequest({path:"/wp/v2/users/me/application-passwords?_locale=user",method:"POST",data:a}).done(function(e,a,s){wp.hooks.doAction("wp_application_passwords_approve_app_request_success",e,a,s);var o,s=p.success;s?(o=s+(-1===s.indexOf("?")?"?":"&")+"site_url="+encodeURIComponent(p.site_url)+"&user_login="+encodeURIComponent(p.user_login)+"&password="+encodeURIComponent(e.password),window.location=o):(o=wp.i18n.sprintf('<label for="new-application-password-value">'+wp.i18n.__("Your new password for %s is:")+"</label>","<strong></strong>")+' <input id="new-application-password-value" type="text" class="code" readonly="readonly" value="" />',o=t("<div></div>").attr("role","alert").attr("tabindex",-1).addClass("notice notice-success notice-alt").append(t("<p></p>").addClass("application-password-display").html(o)).append("<p>"+wp.i18n.__("Be sure to save this in a safe location. You will not be able to retrieve it.")+"</p>"),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("<div></div>").attr("role","alert").addClass("notice notice-error").append(t("<p></p>").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);
!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<o.length&&(a.app_id=o),a=wp.hooks.applyFilters("wp_application_passwords_approve_app_request",a,i),wp.apiRequest({path:"/wp/v2/users/me/application-passwords?_locale=user",method:"POST",data:a}).done(function(e,a,o){wp.hooks.doAction("wp_application_passwords_approve_app_request_success",e,a,o);var s,o=p.success;o?(s=o+(-1===o.indexOf("?")?"?":"&")+"site_url="+encodeURIComponent(p.site_url)+"&user_login="+encodeURIComponent(p.user_login)+"&password="+encodeURIComponent(e.password),window.location=s):(s=wp.i18n.sprintf('<label for="new-application-password-value">'+wp.i18n.__("Your new password for %s is:")+"</label>","<strong></strong>")+' <input id="new-application-password-value" type="text" class="code" readonly="readonly" value="" />',s=t("<div></div>").attr("role","alert").attr("tabindex",-1).addClass("notice notice-success notice-alt").append(t("<p></p>").addClass("application-password-display").html(s)).append("<p>"+wp.i18n.__("Be sure to save this in a safe location. You will not be able to retrieve it.")+"</p>"),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("<div></div>").attr("role","alert").addClass("notice notice-error").append(t("<p></p>").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);

View File

@ -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 );
}
}

View File

@ -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("<label></label>"),o.wrappingLabelText=i('<span class="screen-reader-text"></span>').insertBefore(e).text(a("Color value"))),o.wrappingLabel=e.parent(),o.wrappingLabel.wrap('<div class="wp-picker-container" />'),o.wrap=o.wrappingLabel.parent(),o.toggler=i('<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>').insertBefore(o.wrappingLabel).css({backgroundColor:o.initialValue}),o.toggler.find(".wp-color-result-text").text(a("Select Color")),o.pickerContainer=i('<div class="wp-picker-holder" />').insertAfter(o.wrappingLabel),o.button=i('<input type="button" class="button button-small" />'),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('<span class="wp-picker-input-wrap hidden" />').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);
!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){"function"==typeof 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("<label></label>"),o.wrappingLabelText=i('<span class="screen-reader-text"></span>').insertBefore(e).text(a("Color value"))),o.wrappingLabel=e.parent(),o.wrappingLabel.wrap('<div class="wp-picker-container" />'),o.wrap=o.wrappingLabel.parent(),o.toggler=i('<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>').insertBefore(o.wrappingLabel).css({backgroundColor:o.initialValue}),o.toggler.find(".wp-color-result-text").text(a("Select Color")),o.pickerContainer=i('<div class="wp-picker-holder" />').insertAfter(o.wrappingLabel),o.button=i('<input type="button" class="button button-small" />'),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('<span class="wp-picker-input-wrap hidden" />').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()}),"function"==typeof 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",""),"function"==typeof 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);

View File

@ -840,7 +840,7 @@ $document.ready( function() {
* @return {void}
*/
$adminmenu.on('click.wp-submenu-head', '.wp-submenu-head', function(e){
$(e.target).parent().siblings('a').get(0).click();
$(e.target).parent().siblings('a').get(0).trigger( 'click' );
});
/**

File diff suppressed because one or more lines are too long

View File

@ -39,7 +39,7 @@
*
* @return {void}
*/
$( 'select[name="background-size"]' ).change( function() {
$( 'select[name="background-size"]' ).on( 'change', function() {
bgImage.css( 'background-size', $( this ).val() );
});
@ -50,7 +50,7 @@
*
* @return {void}
*/
$( 'input[name="background-position"]' ).change( function() {
$( 'input[name="background-position"]' ).on( 'change', function() {
bgImage.css( 'background-position', $( this ).val() );
});
@ -61,7 +61,7 @@
*
* @return {void}
*/
$( 'input[name="background-repeat"]' ).change( function() {
$( 'input[name="background-repeat"]' ).on( 'change', function() {
bgImage.css( 'background-repeat', $( this ).is( ':checked' ) ? 'repeat' : 'no-repeat' );
});
@ -72,7 +72,7 @@
*
* @return {void}
*/
$( 'input[name="background-attachment"]' ).change( function() {
$( 'input[name="background-attachment"]' ).on( 'change', function() {
bgImage.css( 'background-attachment', $( this ).is( ':checked' ) ? 'scroll' : 'fixed' );
});
@ -83,7 +83,7 @@
*
* @return {void}
*/
$('#choose-from-library-link').click( function( event ) {
$('#choose-from-library-link').on( 'click', function( event ) {
var $el = $(this);
event.preventDefault();

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */
!function(e){e(document).ready(function(){var o,a=e("#custom-background-image");e("#background-color").wpColorPicker({change:function(n,c){a.css("background-color",c.color.toString())},clear:function(){a.css("background-color","")}}),e('select[name="background-size"]').change(function(){a.css("background-size",e(this).val())}),e('input[name="background-position"]').change(function(){a.css("background-position",e(this).val())}),e('input[name="background-repeat"]').change(function(){a.css("background-repeat",e(this).is(":checked")?"repeat":"no-repeat")}),e('input[name="background-attachment"]').change(function(){a.css("background-attachment",e(this).is(":checked")?"scroll":"fixed")}),e("#choose-from-library-link").click(function(n){var c=e(this);n.preventDefault(),o||(o=wp.media.frames.customBackground=wp.media({title:c.data("choose"),library:{type:"image"},button:{text:c.data("update"),close:!1}})).on("select",function(){var n=o.state().get("selection").first(),c=e("#_wpnonce").val()||"";e.post(ajaxurl,{action:"set-background-image",attachment_id:n.id,_ajax_nonce:c,size:"full"}).done(function(){window.location.reload()})}),o.open()})})}(jQuery);
!function(e){e(document).ready(function(){var c,a=e("#custom-background-image");e("#background-color").wpColorPicker({change:function(n,o){a.css("background-color",o.color.toString())},clear:function(){a.css("background-color","")}}),e('select[name="background-size"]').on("change",function(){a.css("background-size",e(this).val())}),e('input[name="background-position"]').on("change",function(){a.css("background-position",e(this).val())}),e('input[name="background-repeat"]').on("change",function(){a.css("background-repeat",e(this).is(":checked")?"repeat":"no-repeat")}),e('input[name="background-attachment"]').on("change",function(){a.css("background-attachment",e(this).is(":checked")?"scroll":"fixed")}),e("#choose-from-library-link").on("click",function(n){var o=e(this);n.preventDefault(),c||(c=wp.media.frames.customBackground=wp.media({title:o.data("choose"),library:{type:"image"},button:{text:o.data("update"),close:!1}})).on("select",function(){var n=c.state().get("selection").first(),o=e("#_wpnonce").val()||"";e.post(ajaxurl,{action:"set-background-image",attachment_id:n.id,_ajax_nonce:o,size:"full"}).done(function(){window.location.reload()})}),c.open()})})}(jQuery);

View File

@ -35,7 +35,7 @@
*
* @return {void}
*/
$('#choose-from-library-link').click( function( event ) {
$('#choose-from-library-link').on( 'click', function( event ) {
var $el = $(this);
event.preventDefault();

View File

@ -154,7 +154,7 @@ jQuery(document).ready( function($) {
highlightLatestPost();
// Focus the title to allow for quickly drafting another post.
$('#title').focus();
$('#title').trigger( 'focus' );
});
/**
@ -391,7 +391,7 @@ jQuery( function( $ ) {
* lose their place.
*/
if ( $target.hasClass( 'community-events-cancel' ) ) {
$toggleButton.focus();
$toggleButton.trigger( 'focus' );
}
} else {
$toggleButton.attr( 'aria-expanded', 'true' );
@ -610,7 +610,7 @@ jQuery( function( $ ) {
* bring the focus back to the toggle button so users relying
* on screen readers don't lose their place.
*/
$toggleButton.focus();
$toggleButton.trigger( 'focus' );
}
} else {
app.toggleLocationForm( 'show' );

File diff suppressed because one or more lines are too long

View File

@ -850,7 +850,7 @@ window.commentReply = {
*/
toggle : function(el) {
if ( 'none' !== $( el ).css( 'display' ) && ( $( '#replyrow' ).parent().is('#com-reply') || window.confirm( __( 'Are you sure you want to edit this comment?\nThe changes you made will be lost.' ) ) ) ) {
$( el ).find( 'button.vim-q' ).click();
$( el ).find( 'button.vim-q' ).trigger( 'click' );
}
},
@ -1298,7 +1298,7 @@ $(document).ready(function(){
return function() {
var scope = $('select[name="action"]');
$('option[value="' + value + '"]', scope).prop('selected', true);
$('#doaction').click();
$('#doaction').trigger( 'click' );
};
};

File diff suppressed because one or more lines are too long

View File

@ -42,28 +42,28 @@ jQuery(document).ready(function($) {
});
};
$('#asc').click( function( e ) {
$('#asc').on( 'click', function( e ) {
e.preventDefault();
desc = false;
sortIt();
});
$('#desc').click( function( e ) {
$('#desc').on( 'click', function( e ) {
e.preventDefault();
desc = true;
sortIt();
});
$('#clear').click( function( e ) {
$('#clear').on( 'click', function( e ) {
e.preventDefault();
clearAll(1);
});
$('#showall').click( function( e ) {
$('#showall').on( 'click', function( e ) {
e.preventDefault();
$('#sort-buttons span a').toggle();
$('a.describe-toggle-on').hide();
$('a.describe-toggle-off, table.slidetoggle').show();
$('img.pinkynail').toggle(false);
});
$('#hideall').click( function( e ) {
$('#hideall').on( 'click', function( e ) {
e.preventDefault();
$('#sort-buttons span a').toggle();
$('a.describe-toggle-on').show();
@ -88,7 +88,7 @@ jQuery(document).ready(function($) {
}
});
jQuery(window).unload( function () { window.tinymce = window.tinyMCE = window.wpgallery = null; } ); // Cleanup.
jQuery(window).on( 'unload', function () { window.tinymce = window.tinyMCE = window.wpgallery = null; } ); // Cleanup.
/* gallery settings */
window.tinymce = null;

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */
jQuery(document).ready(function(n){var l=!1,e=function(){n("#media-items").sortable({items:"div.media-item",placeholder:"sorthelper",axis:"y",distance:2,handle:"div.filename",stop:function(){var e=n("#media-items").sortable("toArray"),i=e.length;n.each(e,function(e,t){e=l?i-e:1+e;n("#"+t+" .menu_order input").val(e)})}})},t=function(){var e=n(".menu_order_input"),t=e.length;e.each(function(e){e=l?t-e:1+e;n(this).val(e)})},i=function(e){e=e||0,n(".menu_order_input").each(function(){"0"!==this.value&&!e||(this.value="")})};n("#asc").click(function(e){e.preventDefault(),l=!1,t()}),n("#desc").click(function(e){e.preventDefault(),l=!0,t()}),n("#clear").click(function(e){e.preventDefault(),i(1)}),n("#showall").click(function(e){e.preventDefault(),n("#sort-buttons span a").toggle(),n("a.describe-toggle-on").hide(),n("a.describe-toggle-off, table.slidetoggle").show(),n("img.pinkynail").toggle(!1)}),n("#hideall").click(function(e){e.preventDefault(),n("#sort-buttons span a").toggle(),n("a.describe-toggle-on").show(),n("a.describe-toggle-off, table.slidetoggle").hide(),n("img.pinkynail").toggle(!0)}),e(),i(),1<n("#media-items>*").length&&(e=wpgallery.getWin(),n("#save-all, #gallery-settings").show(),void 0!==e.tinyMCE&&e.tinyMCE.activeEditor&&!e.tinyMCE.activeEditor.isHidden()?(wpgallery.mcemode=!0,wpgallery.init()):n("#insert-gallery").show())}),jQuery(window).unload(function(){window.tinymce=window.tinyMCE=window.wpgallery=null}),window.tinymce=null,window.wpgallery={mcemode:!1,editor:{},dom:{},is_update:!1,el:{},I:function(e){return document.getElementById(e)},init:function(){var e,t,i,n,l=this,o=l.getWin();if(l.mcemode){for(e=(""+document.location.search).replace(/^\?/,"").split("&"),t={},i=0;i<e.length;i++)n=e[i].split("="),t[unescape(n[0])]=unescape(n[1]);t.mce_rdomain&&(document.domain=t.mce_rdomain),window.tinymce=o.tinymce,window.tinyMCE=o.tinyMCE,l.editor=tinymce.EditorManager.activeEditor,l.setup()}},getWin:function(){return window.dialogArguments||opener||parent||top},setup:function(){var e,t,i,n=this,l=n.editor;if(n.mcemode){if(n.el=l.selection.getNode(),"IMG"!==n.el.nodeName||!l.dom.hasClass(n.el,"wpGallery")){if(!(t=l.dom.select("img.wpGallery"))||!t[0])return"1"===getUserSetting("galfile")&&(n.I("linkto-file").checked="checked"),"1"===getUserSetting("galdesc")&&(n.I("order-desc").checked="checked"),getUserSetting("galcols")&&(n.I("columns").value=getUserSetting("galcols")),getUserSetting("galord")&&(n.I("orderby").value=getUserSetting("galord")),void jQuery("#insert-gallery").show();n.el=t[0]}i=l.dom.getAttrib(n.el,"title"),(i=l.dom.decode(i))?(jQuery("#update-gallery").show(),n.is_update=!0,e=i.match(/columns=['"]([0-9]+)['"]/),t=i.match(/link=['"]([^'"]+)['"]/i),l=i.match(/order=['"]([^'"]+)['"]/i),i=i.match(/orderby=['"]([^'"]+)['"]/i),t&&t[1]&&(n.I("linkto-file").checked="checked"),l&&l[1]&&(n.I("order-desc").checked="checked"),e&&e[1]&&(n.I("columns").value=""+e[1]),i&&i[1]&&(n.I("orderby").value=i[1])):jQuery("#insert-gallery").show()}},update:function(){var e,t=this,i=t.editor,n="";if(!t.mcemode||!t.is_update)return e="[gallery"+t.getSettings()+"]",void t.getWin().send_to_editor(e);"IMG"===t.el.nodeName&&(n=(n=i.dom.decode(i.dom.getAttrib(t.el,"title"))).replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,""),n+=t.getSettings(),i.dom.setAttrib(t.el,"title",n),t.getWin().tb_remove())},getSettings:function(){var e=this.I,t="";return e("linkto-file").checked&&(t+=' link="file"',setUserSetting("galfile","1")),e("order-desc").checked&&(t+=' order="DESC"',setUserSetting("galdesc","1")),3!==e("columns").value&&(t+=' columns="'+e("columns").value+'"',setUserSetting("galcols",e("columns").value)),"menu_order"!==e("orderby").value&&(t+=' orderby="'+e("orderby").value+'"',setUserSetting("galord",e("orderby").value)),t}};
jQuery(document).ready(function(n){var o=!1,e=function(){n("#media-items").sortable({items:"div.media-item",placeholder:"sorthelper",axis:"y",distance:2,handle:"div.filename",stop:function(){var e=n("#media-items").sortable("toArray"),i=e.length;n.each(e,function(e,t){e=o?i-e:1+e;n("#"+t+" .menu_order input").val(e)})}})},t=function(){var e=n(".menu_order_input"),t=e.length;e.each(function(e){e=o?t-e:1+e;n(this).val(e)})},i=function(e){e=e||0,n(".menu_order_input").each(function(){"0"!==this.value&&!e||(this.value="")})};n("#asc").on("click",function(e){e.preventDefault(),o=!1,t()}),n("#desc").on("click",function(e){e.preventDefault(),o=!0,t()}),n("#clear").on("click",function(e){e.preventDefault(),i(1)}),n("#showall").on("click",function(e){e.preventDefault(),n("#sort-buttons span a").toggle(),n("a.describe-toggle-on").hide(),n("a.describe-toggle-off, table.slidetoggle").show(),n("img.pinkynail").toggle(!1)}),n("#hideall").on("click",function(e){e.preventDefault(),n("#sort-buttons span a").toggle(),n("a.describe-toggle-on").show(),n("a.describe-toggle-off, table.slidetoggle").hide(),n("img.pinkynail").toggle(!0)}),e(),i(),1<n("#media-items>*").length&&(e=wpgallery.getWin(),n("#save-all, #gallery-settings").show(),void 0!==e.tinyMCE&&e.tinyMCE.activeEditor&&!e.tinyMCE.activeEditor.isHidden()?(wpgallery.mcemode=!0,wpgallery.init()):n("#insert-gallery").show())}),jQuery(window).on("unload",function(){window.tinymce=window.tinyMCE=window.wpgallery=null}),window.tinymce=null,window.wpgallery={mcemode:!1,editor:{},dom:{},is_update:!1,el:{},I:function(e){return document.getElementById(e)},init:function(){var e,t,i,n,o=this,l=o.getWin();if(o.mcemode){for(e=(""+document.location.search).replace(/^\?/,"").split("&"),t={},i=0;i<e.length;i++)n=e[i].split("="),t[unescape(n[0])]=unescape(n[1]);t.mce_rdomain&&(document.domain=t.mce_rdomain),window.tinymce=l.tinymce,window.tinyMCE=l.tinyMCE,o.editor=tinymce.EditorManager.activeEditor,o.setup()}},getWin:function(){return window.dialogArguments||opener||parent||top},setup:function(){var e,t,i,n=this,o=n.editor;if(n.mcemode){if(n.el=o.selection.getNode(),"IMG"!==n.el.nodeName||!o.dom.hasClass(n.el,"wpGallery")){if(!(t=o.dom.select("img.wpGallery"))||!t[0])return"1"===getUserSetting("galfile")&&(n.I("linkto-file").checked="checked"),"1"===getUserSetting("galdesc")&&(n.I("order-desc").checked="checked"),getUserSetting("galcols")&&(n.I("columns").value=getUserSetting("galcols")),getUserSetting("galord")&&(n.I("orderby").value=getUserSetting("galord")),void jQuery("#insert-gallery").show();n.el=t[0]}i=o.dom.getAttrib(n.el,"title"),(i=o.dom.decode(i))?(jQuery("#update-gallery").show(),n.is_update=!0,e=i.match(/columns=['"]([0-9]+)['"]/),t=i.match(/link=['"]([^'"]+)['"]/i),o=i.match(/order=['"]([^'"]+)['"]/i),i=i.match(/orderby=['"]([^'"]+)['"]/i),t&&t[1]&&(n.I("linkto-file").checked="checked"),o&&o[1]&&(n.I("order-desc").checked="checked"),e&&e[1]&&(n.I("columns").value=""+e[1]),i&&i[1]&&(n.I("orderby").value=i[1])):jQuery("#insert-gallery").show()}},update:function(){var e,t=this,i=t.editor,n="";if(!t.mcemode||!t.is_update)return e="[gallery"+t.getSettings()+"]",void t.getWin().send_to_editor(e);"IMG"===t.el.nodeName&&(n=(n=i.dom.decode(i.dom.getAttrib(t.el,"title"))).replace(/\s*(order|link|columns|orderby)=['"]([^'"]+)['"]/gi,""),n+=t.getSettings(),i.dom.setAttrib(t.el,"title",n),t.getWin().tb_remove())},getSettings:function(){var e=this.I,t="";return e("linkto-file").checked&&(t+=' link="file"',setUserSetting("galfile","1")),e("order-desc").checked&&(t+=' order="DESC"',setUserSetting("galdesc","1")),3!==e("columns").value&&(t+=' columns="'+e("columns").value+'"',setUserSetting("galcols",e("columns").value)),"menu_order"!==e("orderby").value&&(t+=' orderby="'+e("orderby").value+'"',setUserSetting("galord",e("orderby").value)),t}};

View File

@ -127,7 +127,7 @@
// Key codes 37 through 40 are the arrow keys.
if ( 36 < k && k < 41 ) {
$(this).blur();
$(this).trigger( 'blur' );
}
// The key code 13 is the Enter key.

File diff suppressed because one or more lines are too long

View File

@ -14,7 +14,7 @@ if ( ! $( 'body' ).hasClass( 'language-chooser' ) ) {
return;
}
select.focus().on( 'change', function() {
select.trigger( 'focus' ).on( 'change', function() {
/*
* When a language is selected, set matching translation to continue button
* and attach the language attribute.
@ -26,7 +26,7 @@ select.focus().on( 'change', function() {
});
});
$( 'form' ).submit( function() {
$( 'form' ).on( 'submit', function() {
// Show spinner for languages that need to be downloaded.
if ( ! select.children( 'option:selected' ).data( 'installed' ) ) {
$( this ).find( '.step .spinner' ).css( 'visibility', 'visible' );

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */
jQuery(function(n){var a=n("#language"),e=n("#language-continue");n("body").hasClass("language-chooser")&&(a.focus().on("change",function(){var n=a.children("option:selected");e.attr({value:n.data("continue"),lang:n.attr("lang")})}),n("form").submit(function(){a.children("option:selected").data("installed")||n(this).find(".step .spinner").css("visibility","visible")}))});
jQuery(function(n){var e=n("#language"),a=n("#language-continue");n("body").hasClass("language-chooser")&&(e.trigger("focus").on("change",function(){var n=e.children("option:selected");a.attr({value:n.data("continue"),lang:n.attr("lang")})}),n("form").on("submit",function(){e.children("option:selected").data("installed")||n(this).find(".step .spinner").css("visibility","visible")}))});

View File

@ -8,7 +8,7 @@ jQuery(document).ready( function($) {
var newCat, noSyncChecks = false, syncChecks, catAddAfter;
$('#link_name').focus();
$('#link_name').trigger( 'focus' );
// Postboxes.
postboxes.add_postbox_toggles('link');
@ -19,7 +19,7 @@ jQuery(document).ready( function($) {
*
* @return {boolean} Always returns false to prevent the default behavior.
*/
$('#category-tabs a').click(function(){
$('#category-tabs a').on( 'click', function(){
var t = $(this).attr('href');
$(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
$('.tabs-panel').hide();
@ -31,7 +31,7 @@ jQuery(document).ready( function($) {
return false;
});
if ( getUserSetting('cats') )
$('#category-tabs a[href="#categories-pop"]').click();
$('#category-tabs a[href="#categories-pop"]').trigger( 'click' );
// Ajax Cat.
newCat = $('#newcat').one( 'focus', function() { $(this).val( '' ).removeClass( 'form-input-tip' ); } );
@ -41,7 +41,7 @@ jQuery(document).ready( function($) {
*
* @return {void}
*/
$('#link-category-add-submit').click( function() { newCat.focus(); } );
$('#link-category-add-submit').on( 'click', function() { newCat.focus(); } );
/**
* Synchronize category checkboxes.
@ -82,7 +82,7 @@ jQuery(document).ready( function($) {
var t = $($(this).text());
t.find( 'label' ).each( function() {
var th = $(this), val = th.find('input').val(), id = th.find('input')[0].id, name = $.trim( th.text() ), o;
$('#' + id).change( syncChecks );
$('#' + id).on( 'change', syncChecks );
o = $( '<option value="' + parseInt( val, 10 ) + '"></option>' ).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' );
});

View File

@ -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('<option value="'+parseInt(e,10)+'"></option>').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()});
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('<option value="'+parseInt(e,10)+'"></option>').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")});

View File

@ -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' ) ) {

View File

@ -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())})});
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())})});

View File

@ -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();
}

View File

@ -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('<div class="ui-find-overlay"></div>'),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);
!function(o){window.findPosts={open:function(n,e){var i=o(".ui-find-overlay");return 0===i.length&&(o("body").append('<div class="ui-find-overlay"></div>'),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);

View File

@ -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);
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -75,7 +75,7 @@ jQuery( document ).ready( function( $ ) {
.on( 'thickbox:removed', function() {
// Set focus back to the element that opened the modal dialog.
// Note: IE 8 would need this wrapped in a fake setTimeout `0`.
$focusedBefore.focus();
$focusedBefore.trigger( 'focus' );
});
function iframeLoaded() {
@ -88,7 +88,7 @@ jQuery( document ).ready( function( $ ) {
handleTabbables();
// Set initial focus on the "Close" button.
$firstTabbable.focus();
$firstTabbable.trigger( 'focus' );
/*
* When the "Install" button is disabled (e.g. the Plugin is already installed)
@ -141,10 +141,10 @@ jQuery( document ).ready( function( $ ) {
if ( $lastTabbable[0] === event.target && ! event.shiftKey ) {
event.preventDefault();
$firstTabbable.focus();
$firstTabbable.trigger( 'focus' );
} else if ( $firstTabbable[0] === event.target && event.shiftKey ) {
event.preventDefault();
$lastTabbable.focus();
$lastTabbable.trigger( 'focus' );
}
}

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */
jQuery(document).ready(function(o){var e,i,n,a,l,d=o(),s=o(".upload-view-toggle"),t=o(".wrap"),r=o(document.body);function c(){var t;n=o(":tabbable",i),a=e.find("#TB_closeWindowButton"),l=n.last(),(t=a.add(l)).off("keydown.wp-plugin-details"),t.on("keydown.wp-plugin-details",function(t){9===(t=t).which&&(l[0]!==t.target||t.shiftKey?a[0]===t.target&&t.shiftKey&&(t.preventDefault(),l.focus()):(t.preventDefault(),a.focus()))})}window.tb_position=function(){var t=o(window).width(),i=o(window).height()-(792<t?60:20),n=792<t?772:t-20;return(e=o("#TB_window")).length&&(e.width(n).height(i),o("#TB_iframeContent").width(n).height(i),e.css({"margin-left":"-"+parseInt(n/2,10)+"px"}),void 0!==document.body.style.maxWidth&&e.css({top:"30px","margin-top":"0"})),o("a.thickbox").each(function(){var t=o(this).attr("href");t&&(t=(t=t.replace(/&width=[0-9]+/g,"")).replace(/&height=[0-9]+/g,""),o(this).attr("href",t+"&width="+n+"&height="+i))})},o(window).on("resize",function(){tb_position()}),r.on("thickbox:iframe:loaded",e,function(){var t;e.hasClass("plugin-details-modal")&&(t=e.find("#TB_iframeContent"),i=t.contents().find("body"),c(),a.focus(),o("#plugin-information-tabs a",i).on("click",function(){c()}),i.on("keydown",function(t){27===t.which&&tb_remove()}))}).on("thickbox:removed",function(){d.focus()}),o(".wrap").on("click",".thickbox.open-plugin-details-modal",function(t){var i=o(this).data("title")?wp.i18n.sprintf(wp.i18n.__("Plugin: %s"),o(this).data("title")):wp.i18n.__("Plugin details");t.preventDefault(),t.stopPropagation(),d=o(this),tb_click.call(this),e.attr({role:"dialog","aria-label":wp.i18n.__("Plugin details")}).addClass("plugin-details-modal"),e.find("#TB_iframeContent").attr("title",i)}),o("#plugin-information-tabs a").on("click",function(t){var i=o(this).attr("name");t.preventDefault(),o("#plugin-information-tabs a.current").removeClass("current"),o(this).addClass("current"),"description"!==i&&o(window).width()<772?o("#plugin-information-content").find(".fyi").hide():o("#plugin-information-content").find(".fyi").show(),o("#section-holder div.section").hide(),o("#section-"+i).show()}),t.hasClass("plugin-install-tab-upload")||s.attr({role:"button","aria-expanded":"false"}).on("click",function(t){t.preventDefault(),r.toggleClass("show-upload-view"),s.attr("aria-expanded",r.hasClass("show-upload-view"))})});
jQuery(document).ready(function(e){var o,i,n,a,l,r=e(),d=e(".upload-view-toggle"),t=e(".wrap"),s=e(document.body);function c(){var t;n=e(":tabbable",i),a=o.find("#TB_closeWindowButton"),l=n.last(),(t=a.add(l)).off("keydown.wp-plugin-details"),t.on("keydown.wp-plugin-details",function(t){9===(t=t).which&&(l[0]!==t.target||t.shiftKey?a[0]===t.target&&t.shiftKey&&(t.preventDefault(),l.trigger("focus")):(t.preventDefault(),a.trigger("focus")))})}window.tb_position=function(){var t=e(window).width(),i=e(window).height()-(792<t?60:20),n=792<t?772:t-20;return(o=e("#TB_window")).length&&(o.width(n).height(i),e("#TB_iframeContent").width(n).height(i),o.css({"margin-left":"-"+parseInt(n/2,10)+"px"}),void 0!==document.body.style.maxWidth&&o.css({top:"30px","margin-top":"0"})),e("a.thickbox").each(function(){var t=e(this).attr("href");t&&(t=(t=t.replace(/&width=[0-9]+/g,"")).replace(/&height=[0-9]+/g,""),e(this).attr("href",t+"&width="+n+"&height="+i))})},e(window).on("resize",function(){tb_position()}),s.on("thickbox:iframe:loaded",o,function(){var t;o.hasClass("plugin-details-modal")&&(t=o.find("#TB_iframeContent"),i=t.contents().find("body"),c(),a.trigger("focus"),e("#plugin-information-tabs a",i).on("click",function(){c()}),i.on("keydown",function(t){27===t.which&&tb_remove()}))}).on("thickbox:removed",function(){r.trigger("focus")}),e(".wrap").on("click",".thickbox.open-plugin-details-modal",function(t){var i=e(this).data("title")?wp.i18n.sprintf(wp.i18n.__("Plugin: %s"),e(this).data("title")):wp.i18n.__("Plugin details");t.preventDefault(),t.stopPropagation(),r=e(this),tb_click.call(this),o.attr({role:"dialog","aria-label":wp.i18n.__("Plugin details")}).addClass("plugin-details-modal"),o.find("#TB_iframeContent").attr("title",i)}),e("#plugin-information-tabs a").on("click",function(t){var i=e(this).attr("name");t.preventDefault(),e("#plugin-information-tabs a.current").removeClass("current"),e(this).addClass("current"),"description"!==i&&e(window).width()<772?e("#plugin-information-content").find(".fyi").hide():e("#plugin-information-content").find(".fyi").show(),e("#section-holder div.section").hide(),e("#section-"+i).show()}),t.hasClass("plugin-install-tab-upload")||d.attr({role:"button","aria-expanded":"false"}).on("click",function(t){t.preventDefault(),s.toggleClass("show-upload-view"),d.attr("aria-expanded",s.hasClass("show-upload-view"))})});

View File

@ -68,7 +68,7 @@ window.wp = window.wp || {};
$('#the-comment-list').append( r.responses[0].data );
theList = theExtraList = null;
$( 'a[className*=\':\']' ).unbind();
$( 'a[className*=\':\']' ).off();
// If the offset is over the total number of comments we cannot fetch any more, so hide the button.
if ( commentsBox.st > 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 );

File diff suppressed because one or more lines are too long

View File

@ -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 );
}

File diff suppressed because one or more lines are too long

View File

@ -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.

File diff suppressed because one or more lines are too long

View File

@ -160,17 +160,14 @@ wp.svgPainter = ( function( $, window, document, undefined ) {
painter.paintElement( $element, 'base' );
// Set hover callbacks.
$menuitem.hover(
function() {
painter.paintElement( $element, 'focus' );
},
function() {
// Match the delay from hoverIntent.
window.setTimeout( function() {
painter.paintElement( $element, 'base' );
}, 100 );
}
);
$menuitem.on( 'mouseenter', function() {
painter.paintElement( $element, 'focus' );
} ).on( 'mouseleave', function() {
// Match the delay from hoverIntent.
window.setTimeout( function() {
painter.paintElement( $element, 'base' );
}, 100 );
} );
}
});
},

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */
window.wp=window.wp||{},wp.svgPainter=function(e,o,n){"use strict";var t,r,a,m,i,s,c,u,l,f={},g=[];function p(){for(;l<256;)m=String.fromCharCode(l),s+=m,u[l]=l,c[l]=i.indexOf(m),++l}function d(n,t,e,a,i,o){for(var r,s=0,c=0,u="",l=0,f=(n=String(n)).length;c<f;){for(s=(s<<i)+(m=(m=n.charCodeAt(c))<256?e[m]:-1),l+=i;o<=l;)r=s>>(l-=o),u+=a.charAt(r),s^=r<<l;++c}return!t&&0<l&&(u+=a.charAt(s<<o-l)),u}return e(n).ready(function(){n.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")&&(e(n.body).removeClass("no-svg").addClass("svg"),wp.svgPainter.init())}),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s="",c=[256],u=[256],l=0,r={atob:function(n){var t;for(m||p(),n=n.replace(/[^A-Za-z0-9\+\/\=]/g,""),n=String(n).split("="),t=n.length;n[--t]=d(n[t],!0,c,s,6,8),0<t;);return n=n.join("")},btoa:function(n){return m||p(),(n=d(n,!1,u,i,8,6))+"====".slice(n.length%4||4)}},{init:function(){a=this,t=e("#adminmenu .wp-menu-image, #wpadminbar .ab-item"),this.setColors(),this.findElements(),this.paint()},setColors:function(n){(n=void 0===n&&void 0!==o._wpColorScheme?o._wpColorScheme:n)&&n.icons&&n.icons.base&&n.icons.current&&n.icons.focus&&(f=n.icons)},findElements:function(){t.each(function(){var n=e(this),t=n.css("background-image");t&&-1!=t.indexOf("data:image/svg+xml;base64")&&g.push(n)})},paint:function(){e.each(g,function(n,t){var e=t.parent().parent();e.hasClass("current")||e.hasClass("wp-has-current-submenu")?a.paintElement(t,"current"):(a.paintElement(t,"base"),e.hover(function(){a.paintElement(t,"focus")},function(){o.setTimeout(function(){a.paintElement(t,"base")},100)}))})},paintElement:function(n,t){var e,a,i;if(t&&f.hasOwnProperty(t)&&(i=f[t],i.match(/^(#[0-9a-f]{3}|#[0-9a-f]{6})$/i)&&"none"!==(e=n.data("wp-ui-svg-"+i)))){if(!e){if(!(a=n.css("background-image").match(/.+data:image\/svg\+xml;base64,([A-Za-z0-9\+\/\=]+)/))||!a[1])return void n.data("wp-ui-svg-"+i,"none");try{e=("atob"in o?o:r).atob(a[1])}catch(n){}if(!e)return void n.data("wp-ui-svg-"+i,"none");e=(e=(e=e.replace(/fill="(.+?)"/g,'fill="'+i+'"')).replace(/style="(.+?)"/g,'style="fill:'+i+'"')).replace(/fill:.*?;/g,"fill: "+i+";"),e=("btoa"in o?o:r).btoa(e),n.data("wp-ui-svg-"+i,e)}n.attr("style",'background-image: url("data:image/svg+xml;base64,'+e+'") !important;')}}}}(jQuery,window,document);
window.wp=window.wp||{},wp.svgPainter=function(e,o,n){"use strict";var t,r,a,m,i,s,c,u,l,f={},g=[];function p(){for(;l<256;)m=String.fromCharCode(l),s+=m,u[l]=l,c[l]=i.indexOf(m),++l}function d(n,t,e,a,i,o){for(var r,s=0,c=0,u="",l=0,f=(n=String(n)).length;c<f;){for(s=(s<<i)+(m=(m=n.charCodeAt(c))<256?e[m]:-1),l+=i;o<=l;)r=s>>(l-=o),u+=a.charAt(r),s^=r<<l;++c}return!t&&0<l&&(u+=a.charAt(s<<o-l)),u}return e(n).ready(function(){n.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")&&(e(n.body).removeClass("no-svg").addClass("svg"),wp.svgPainter.init())}),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s="",c=[256],u=[256],l=0,r={atob:function(n){var t;for(m||p(),n=n.replace(/[^A-Za-z0-9\+\/\=]/g,""),n=String(n).split("="),t=n.length;n[--t]=d(n[t],!0,c,s,6,8),0<t;);return n=n.join("")},btoa:function(n){return m||p(),(n=d(n,!1,u,i,8,6))+"====".slice(n.length%4||4)}},{init:function(){a=this,t=e("#adminmenu .wp-menu-image, #wpadminbar .ab-item"),this.setColors(),this.findElements(),this.paint()},setColors:function(n){(n=void 0===n&&void 0!==o._wpColorScheme?o._wpColorScheme:n)&&n.icons&&n.icons.base&&n.icons.current&&n.icons.focus&&(f=n.icons)},findElements:function(){t.each(function(){var n=e(this),t=n.css("background-image");t&&-1!=t.indexOf("data:image/svg+xml;base64")&&g.push(n)})},paint:function(){e.each(g,function(n,t){var e=t.parent().parent();e.hasClass("current")||e.hasClass("wp-has-current-submenu")?a.paintElement(t,"current"):(a.paintElement(t,"base"),e.on("mouseenter",function(){a.paintElement(t,"focus")}).on("mouseleave",function(){o.setTimeout(function(){a.paintElement(t,"base")},100)}))})},paintElement:function(n,t){var e,a,i;if(t&&f.hasOwnProperty(t)&&(i=f[t],i.match(/^(#[0-9a-f]{3}|#[0-9a-f]{6})$/i)&&"none"!==(e=n.data("wp-ui-svg-"+i)))){if(!e){if(!(a=n.css("background-image").match(/.+data:image\/svg\+xml;base64,([A-Za-z0-9\+\/\=]+)/))||!a[1])return void n.data("wp-ui-svg-"+i,"none");try{e=("atob"in o?o:r).atob(a[1])}catch(n){}if(!e)return void n.data("wp-ui-svg-"+i,"none");e=(e=(e=e.replace(/fill="(.+?)"/g,'fill="'+i+'"')).replace(/style="(.+?)"/g,'style="fill:'+i+'"')).replace(/fill:.*?;/g,"fill: "+i+";"),e=("btoa"in o?o:r).btoa(e),n.data("wp-ui-svg-"+i,e)}n.attr("style",'background-image: url("data:image/svg+xml;base64,'+e+'") !important;')}}}}(jQuery,window,document);

View File

@ -188,7 +188,7 @@
* key this will fire the `keyup` event on the input.
*/
if ( 13 === e.keyCode || 32 === e.keyCode ) {
$( this ).closest( '.tagsdiv' ).find( 'input.newtag' ).focus();
$( this ).closest( '.tagsdiv' ).find( 'input.newtag' ).trigger( 'focus' );
}
tagBox.userAction = 'remove';
@ -255,7 +255,7 @@
if ( ! a )
newtag.val('');
if ( 'undefined' == typeof( f ) )
newtag.focus();
newtag.trigger( 'focus' );
return false;
},
@ -303,7 +303,7 @@
*
* @return {boolean} Returns false to prevent the default action.
*/
$( 'a', r ).click( function() {
$( 'a', r ).on( 'click', function() {
tagBox.userAction = 'add';
tagBox.flushTags( $( '#' + tax ), this );
return false;
@ -368,7 +368,7 @@
tagBox.quickClicks( this );
});
$( '.tagadd', ajaxtag ).click( function() {
$( '.tagadd', ajaxtag ).on( 'click', function() {
tagBox.userAction = 'add';
tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
});
@ -385,7 +385,7 @@
*
* @return {void}
*/
$( 'input.newtag', ajaxtag ).keypress( function( event ) {
$( 'input.newtag', ajaxtag ).on( 'keypress', function( event ) {
if ( 13 == event.which ) {
tagBox.userAction = 'add';
tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
@ -404,7 +404,7 @@
*
* @return {void}
*/
$('#post').submit(function(){
$('#post').on( 'submit', function(){
$('div.tagsdiv').each( function() {
tagBox.flushTags(this, false, 1);
});
@ -419,14 +419,14 @@
*
* @return {void}
*/
$('.tagcloud-link').click(function(){
$('.tagcloud-link').on( 'click', function(){
// On the first click, fetch the tag cloud and insert it in the DOM.
tagBox.get( $( this ).attr( 'id' ) );
// Update button state, remove previous click event and attach a new one to toggle the cloud.
$( this )
.attr( 'aria-expanded', 'true' )
.unbind()
.click( function() {
.off()
.on( 'click', function() {
$( this )
.attr( 'aria-expanded', 'false' === $( this ).attr( 'aria-expanded' ) ? 'true' : 'false' )
.siblings( '.the-tagcloud' ).toggle();

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */
!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("<li />").text(e),a||((t=o('<button type="button" id="'+n+"-check-num-"+t+'" class="ntdelbutton"><span class="remove-tag-icon" aria-hidden="true"></span><span class="screen-reader-text">'+wp.i18n.__("Remove term:")+" "+e.html()+"</span></button>")).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("&nbsp;").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('<div id="tagcloud-'+i+'" class="the-tagcloud">'+t+"</div>"),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);
!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("<li />").text(e),a||((t=o('<button type="button" id="'+n+"-check-num-"+t+'" class="ntdelbutton"><span class="remove-tag-icon" aria-hidden="true"></span><span class="screen-reader-text">'+wp.i18n.__("Remove term:")+" "+e.html()+"</span></button>")).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("&nbsp;").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('<div id="tagcloud-'+i+'" class="the-tagcloud">'+t+"</div>"),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);

View File

@ -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 );
};

File diff suppressed because one or more lines are too long

View File

@ -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 ) {

File diff suppressed because one or more lines are too long

View File

@ -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.' );

File diff suppressed because one or more lines are too long

View File

@ -59,7 +59,7 @@ wp.textWidgets = ( function( $ ) {
control.customHtmlWidgetPointer.find( '.close' ).on( 'click', function( event ) {
event.preventDefault();
control.customHtmlWidgetPointer.hide();
$( '#' + control.fields.text.attr( 'id' ) + '-html' ).focus();
$( '#' + control.fields.text.attr( 'id' ) + '-html' ).trigger( 'focus' );
control.dismissPointers( [ 'text_widget_custom_html' ] );
});
control.customHtmlWidgetPointer.find( '.add-widget' ).on( 'click', function( event ) {
@ -278,7 +278,7 @@ wp.textWidgets = ( function( $ ) {
*/
showPointerElement = function( pointerElement ) {
pointerElement.show();
pointerElement.find( '.close' ).focus();
pointerElement.find( '.close' ).trigger( 'focus' );
wp.a11y.speak( pointerElement.find( 'h3, p' ).map( function() {
return $( this ).text();
} ).get().join( '\n\n' ) );

File diff suppressed because one or more lines are too long

View File

@ -541,7 +541,7 @@ window.autosave = function() {
lastCompareString = getCompareString( postData );
if ( $( '#title' ).val() !== postData.post_title ) {
$( '#title' ).focus().val( postData.post_title || '' );
$( '#title' ).trigger( 'focus' ).val( postData.post_title || '' );
}
$( '#excerpt' ).val( postData.excerpt || '' );
@ -560,8 +560,8 @@ window.autosave = function() {
} else {
// Make sure the Text editor is selected.
$( '#content-html' ).click();
$( '#content' ).focus();
$( '#content-html' ).trigger( 'click' );
$( '#content' ).trigger( 'focus' );
// Using document.execCommand() will let the user undo.
document.execCommand( 'selectAll' );

File diff suppressed because one or more lines are too long

View File

@ -39,7 +39,7 @@ USAGE:
".":">", "/":"?", "\\":"|" };
this.add = function(combi, options, callback) {
if (jQuery.isFunction(options)){
if ( typeof options === 'function' ){
callback = options;
options = {};
}

View File

@ -1,7 +1,7 @@
/*!
* jQuery serializeObject - v0.2 - 1/20/2010
* jQuery serializeObject - v0.2-wp - 1/20/2010
* http://benalman.com/projects/jquery-misc-plugins/
*
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
@ -12,20 +12,20 @@
(function($,undefined){
'$:nomunge'; // Used by YUI compressor.
$.fn.serializeObject = function(){
var obj = {};
$.each( this.serializeArray(), function(i,o){
var n = o.name,
v = o.value;
obj[n] = obj[n] === undefined ? v
: $.isArray( obj[n] ) ? obj[n].concat( v )
: Array.isArray( obj[n] ) ? obj[n].concat( v )
: [ obj[n], v ];
});
return obj;
};
})(jQuery);

View File

@ -14,7 +14,7 @@
$.table_hotkeys = function(table, keys, opts) {
opts = $.extend($.table_hotkeys.defaults, opts);
var selected_class, destructive_class, set_current_row, adjacent_row_callback, get_adjacent_row, adjacent_row, prev_row, next_row, check, get_first_row, get_last_row, make_key_callback, first_row;
selected_class = opts.class_prefix + opts.selected_suffix;
destructive_class = opts.class_prefix + opts.destructive_suffix;
set_current_row = function (tr) {
@ -24,13 +24,13 @@
$.table_hotkeys.current_row = tr;
};
adjacent_row_callback = function(which) {
if (!adjacent_row(which) && $.isFunction(opts[which+'_page_link_cb'])) {
if (!adjacent_row(which) && typeof opts[which+'_page_link_cb'] === 'function' ) {
opts[which+'_page_link_cb']();
}
};
get_adjacent_row = function(which) {
var first_row, method;
if (!$.table_hotkeys.current_row) {
first_row = get_first_row();
$.table_hotkeys.current_row = first_row;
@ -65,7 +65,7 @@
var clickable = $(expr, $.table_hotkeys.current_row);
if (!clickable.length) return false;
if (clickable.is('.'+destructive_class)) next_row() || prev_row();
clickable.click();
clickable.trigger( 'click' );
};
};
first_row = get_first_row();
@ -79,8 +79,8 @@
$.hotkeys.add(opts.mark_key, opts.hotkeys_opts, check);
$.each(keys, function() {
var callback, key;
if ($.isFunction(this[1])) {
if ( typeof this[1] === 'function' ) {
callback = this[1];
key = this[0];
$.hotkeys.add(key, opts.hotkeys_opts, function(event) { return callback(event, $.table_hotkeys.current_row); });

View File

@ -11,7 +11,7 @@ window.wpAjax = jQuery.extend( {
q = s.split('?'); if ( q[1] ) { s = q[1]; }
pp = s.split('&');
for ( i in pp ) {
if ( jQuery.isFunction(pp.hasOwnProperty) && !pp.hasOwnProperty(i) ) { continue; }
if ( typeof pp.hasOwnProperty === 'function' && !pp.hasOwnProperty(i) ) { continue; }
p = pp[i].split('=');
r[p[0]] = p[1];
}

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */
window.wpAjax=jQuery.extend({unserialize:function(e){var r,t,n,i,a={};if(!e)return a;for(n in t=(e=(r=e.split("?"))[1]?r[1]:e).split("&"))jQuery.isFunction(t.hasOwnProperty)&&!t.hasOwnProperty(n)||(a[(i=t[n].split("="))[0]]=i[1]);return a},parseAjaxResponse:function(i,e,a){var o={},e=jQuery("#"+e).empty(),s="";return i&&"object"==typeof i&&i.getElementsByTagName("wp_ajax")?(o.responses=[],o.errors=!1,jQuery("response",i).each(function(){var e=jQuery(this),r=jQuery(this.firstChild),n={action:e.attr("action"),what:r.get(0).nodeName,id:r.attr("id"),oldId:r.attr("old_id"),position:r.attr("position")};n.data=jQuery("response_data",r).text(),n.supplemental={},jQuery("supplemental",r).children().each(function(){n.supplemental[this.nodeName]=jQuery(this).text()}).length||(n.supplemental=!1),n.errors=[],jQuery("wp_error",r).each(function(){var e=jQuery(this).attr("code"),r={code:e,message:this.firstChild.nodeValue,data:!1},t=jQuery('wp_error_data[code="'+e+'"]',i);t&&(r.data=t.get()),(t=jQuery("form-field",t).text())&&(e=t),a&&wpAjax.invalidateForm(jQuery("#"+a+' :input[name="'+e+'"]').parents(".form-field:first")),s+="<p>"+r.message+"</p>",n.errors.push(r),o.errors=!0}).length||(n.errors=!1),o.responses.push(n)}),s.length&&e.html('<div class="error">'+s+"</div>"),o):isNaN(i)?!e.html('<div class="error"><p>'+i+"</p></div>"):-1===(i=parseInt(i,10))?!e.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>"):0!==i||!e.html('<div class="error"><p>'+wpAjax.broken+"</p></div>")},invalidateForm:function(e){return jQuery(e).addClass("form-invalid").find("input").one("change wp-check-valid-field",function(){jQuery(this).closest(".form-invalid").removeClass("form-invalid")})},validateForm:function(e){return e=jQuery(e),!wpAjax.invalidateForm(e.find(".form-required").filter(function(){return""===jQuery("input:visible",this).val()})).length}},wpAjax||{noPerm:"Sorry, you are not allowed to do that.",broken:"Something went wrong."}),jQuery(document).ready(function(e){e("form.validate").on("submit",function(){return wpAjax.validateForm(e(this))})});
window.wpAjax=jQuery.extend({unserialize:function(e){var r,t,n,a,i={};if(!e)return i;for(n in t=(e=(r=e.split("?"))[1]?r[1]:e).split("&"))"function"==typeof t.hasOwnProperty&&!t.hasOwnProperty(n)||(i[(a=t[n].split("="))[0]]=a[1]);return i},parseAjaxResponse:function(a,e,i){var o={},e=jQuery("#"+e).empty(),s="";return a&&"object"==typeof a&&a.getElementsByTagName("wp_ajax")?(o.responses=[],o.errors=!1,jQuery("response",a).each(function(){var e=jQuery(this),r=jQuery(this.firstChild),n={action:e.attr("action"),what:r.get(0).nodeName,id:r.attr("id"),oldId:r.attr("old_id"),position:r.attr("position")};n.data=jQuery("response_data",r).text(),n.supplemental={},jQuery("supplemental",r).children().each(function(){n.supplemental[this.nodeName]=jQuery(this).text()}).length||(n.supplemental=!1),n.errors=[],jQuery("wp_error",r).each(function(){var e=jQuery(this).attr("code"),r={code:e,message:this.firstChild.nodeValue,data:!1},t=jQuery('wp_error_data[code="'+e+'"]',a);t&&(r.data=t.get()),(t=jQuery("form-field",t).text())&&(e=t),i&&wpAjax.invalidateForm(jQuery("#"+i+' :input[name="'+e+'"]').parents(".form-field:first")),s+="<p>"+r.message+"</p>",n.errors.push(r),o.errors=!0}).length||(n.errors=!1),o.responses.push(n)}),s.length&&e.html('<div class="error">'+s+"</div>"),o):isNaN(a)?!e.html('<div class="error"><p>'+a+"</p></div>"):-1===(a=parseInt(a,10))?!e.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>"):0!==a||!e.html('<div class="error"><p>'+wpAjax.broken+"</p></div>")},invalidateForm:function(e){return jQuery(e).addClass("form-invalid").find("input").one("change wp-check-valid-field",function(){jQuery(this).closest(".form-invalid").removeClass("form-invalid")})},validateForm:function(e){return e=jQuery(e),!wpAjax.invalidateForm(e.find(".form-required").filter(function(){return""===jQuery("input:visible",this).val()})).length}},wpAjax||{noPerm:"Sorry, you are not allowed to do that.",broken:"Something went wrong."}),jQuery(document).ready(function(e){e("form.validate").on("submit",function(){return wpAjax.validateForm(e(this))})});

View File

@ -271,7 +271,7 @@ wpList = {
target: list.get( 0 )
}, settings || {} );
if ( $.isFunction( settings.confirm ) ) {
if ( typeof settings.confirm === 'function' ) {
$element = $( '#' + settings.element );
if ( 'add' !== action ) {
@ -337,13 +337,13 @@ wpList = {
}, wpAjax.unserialize( data[4] || '' ) ) );
formValues = $( '#' + settings.element + ' :input' ).not( '[name="_ajax_nonce"], [name="_wpnonce"], [name="action"]' );
formData = $.isFunction( formValues.fieldSerialize ) ? formValues.fieldSerialize() : formValues.serialize();
formData = typeof formValues.fieldSerialize === 'function' ? formValues.fieldSerialize() : formValues.serialize();
if ( formData ) {
settings.data += '&' + formData;
}
if ( $.isFunction( settings.addBefore ) ) {
if ( typeof settings.addBefore === 'function' ) {
settings = settings.addBefore( settings );
if ( ! settings ) {
@ -381,7 +381,7 @@ wpList = {
};
settings.complete = function( jqXHR, status ) {
if ( $.isFunction( settings.addAfter ) ) {
if ( typeof settings.addAfter === 'function' ) {
settings.addAfter( returnedResponse, $.extend( {
xml: jqXHR,
status: status,
@ -427,7 +427,7 @@ wpList = {
id: settings.element.split( '-' ).pop()
}, wpAjax.unserialize( data[4] || '' ) );
if ( $.isFunction( settings.delBefore ) ) {
if ( typeof settings.delBefore === 'function' ) {
settings = settings.delBefore( settings, list );
if ( ! settings ) {
@ -466,7 +466,7 @@ wpList = {
};
settings.complete = function( jqXHR, status ) {
if ( $.isFunction( settings.delAfter ) ) {
if ( typeof settings.delAfter === 'function' ) {
$eventTarget.queue( function() {
settings.delAfter( returnedResponse, $.extend( {
xml: jqXHR,
@ -522,7 +522,7 @@ wpList = {
dimClass: settings.dimClass
}, wpAjax.unserialize( data[6] || '' ) );
if ( $.isFunction( settings.dimBefore ) ) {
if ( typeof settings.dimBefore === 'function' ) {
settings = settings.dimBefore( settings );
if ( ! settings ) {
@ -591,7 +591,7 @@ wpList = {
};
settings.complete = function( jqXHR, status ) {
if ( $.isFunction( settings.dimAfter ) ) {
if ( typeof settings.dimAfter === 'function' ) {
$eventTarget.queue( function() {
settings.dimAfter( returnedResponse, $.extend( {
xml: jqXHR,

File diff suppressed because one or more lines are too long

View File

@ -181,7 +181,7 @@
if ( isTouch ) {
// Close the onscreen keyboard.
inputs.url.focus().blur();
inputs.url.trigger( 'focus' ).trigger( 'blur' );
} else {
/*
* Focus the URL field and highlight its contents.
@ -190,7 +190,7 @@
*/
window.setTimeout( function() {
inputs.url[0].select();
inputs.url.focus();
inputs.url.trigger( 'focus' );
} );
}
@ -557,10 +557,10 @@
// wp-link-submit must always be the last focusable element in the dialog.
// Following focusable elements will be skipped on keyboard navigation.
if ( id === 'wp-link-submit' && ! event.shiftKey ) {
inputs.close.focus();
inputs.close.trigger( 'focus' );
event.preventDefault();
} else if ( id === 'wp-link-close' && event.shiftKey ) {
inputs.submit.focus();
inputs.submit.trigger( 'focus' );
event.preventDefault();
}
}

File diff suppressed because one or more lines are too long

View File

@ -827,7 +827,7 @@ function wp_default_scripts( $scripts ) {
$scripts->add( 'jquery-color', '/wp-includes/js/jquery/jquery.color.min.js', array( 'jquery' ), '2.1.2', 1 );
$scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array( 'jquery' ), '20m', 1 );
$scripts->add( 'jquery-query', '/wp-includes/js/jquery/jquery.query.js', array( 'jquery' ), '2.1.7', 1 );
$scripts->add( 'jquery-serialize-object', '/wp-includes/js/jquery/jquery.serialize-object.js', array( 'jquery' ), '0.2', 1 );
$scripts->add( 'jquery-serialize-object', '/wp-includes/js/jquery/jquery.serialize-object.js', array( 'jquery' ), '0.2-wp', 1 );
$scripts->add( 'jquery-hotkeys', "/wp-includes/js/jquery/jquery.hotkeys$suffix.js", array( 'jquery' ), '0.0.2m', 1 );
$scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array( 'jquery', 'jquery-hotkeys' ), false, 1 );
$scripts->add( 'jquery-touch-punch', '/wp-includes/js/jquery/jquery.ui.touch-punch.js', array( 'jquery-ui-core', 'jquery-ui-mouse' ), '0.2.2', 1 );

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-beta3-50419';
$wp_version = '5.7-beta3-50420';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.