External Libraries: First pass at fixing jQuery deprecations in WordPress core and bundled themes.

To be able to disable jQuery Migrate as step 3 of updating the jQuery version shipped with WordPress, all `JQMIGRATE` warnings in the browser console will have to be addressed.

This includes many minor adjustments to a wide array of core files.

Follow-up to:
* Step 1: Disabling jQuery Migrate 1.4.1 in WordPress 5.5: [48323], [48324]
* Step 2: Updating jQuery to 3.5.1 and adding jQuery Migrate 3.3.x in WordPress 5.6: [49101], [49338], [49615], [49649]

Props Clorith, azaozz.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@50001


git-svn-id: http://core.svn.wordpress.org/trunk@49702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-01-22 12:32:03 +00:00
parent 8b1be13c86
commit 9f12d7f575
77 changed files with 267 additions and 248 deletions

View File

@ -29,7 +29,7 @@ function export_add_js() {
var form = $('#export-filters'), var form = $('#export-filters'),
filters = form.find('.export-filters'); filters = form.find('.export-filters');
filters.hide(); filters.hide();
form.find('input:radio').change(function() { form.find('input:radio').on( 'change', function() {
filters.slideUp('fast'); filters.slideUp('fast');
switch ( $(this).val() ) { switch ( $(this).val() ) {
case 'attachment': $('#attachment-filters').slideDown(); break; case 'attachment': $('#attachment-filters').slideDown(); break;

View File

@ -1001,7 +1001,7 @@ function network_settings_add_js() {
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
var languageSelect = $( '#WPLANG' ); var languageSelect = $( '#WPLANG' );
$( 'form' ).submit( function() { $( 'form' ).on( 'submit', function() {
// Don't show a spinner for English and installed languages, // Don't show a spinner for English and installed languages,
// as there is nothing to download. // as there is nothing to download.
if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) { if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {

View File

@ -18,7 +18,7 @@ function options_discussion_add_js() {
(function($){ (function($){
var parent = $( '#show_avatars' ), var parent = $( '#show_avatars' ),
children = $( '.avatar-settings' ); children = $( '.avatar-settings' );
parent.change(function(){ parent.on( 'change', function(){
children.toggleClass( 'hide-if-js', ! this.checked ); children.toggleClass( 'hide-if-js', ! this.checked );
}); });
})(jQuery); })(jQuery);
@ -49,7 +49,7 @@ function options_general_add_js() {
$siteName.text( title ); $siteName.text( title );
}); });
$( 'input[name="date_format"]' ).click( function() { $( 'input[name="date_format"]' ).on( 'click', function() {
if ( 'date_format_custom_radio' !== $(this).attr( 'id' ) ) if ( 'date_format_custom_radio' !== $(this).attr( 'id' ) )
$( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() ); $( 'input[name="date_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
}); });
@ -58,7 +58,7 @@ function options_general_add_js() {
$( '#date_format_custom_radio' ).prop( 'checked', true ); $( '#date_format_custom_radio' ).prop( 'checked', true );
}); });
$( 'input[name="time_format"]' ).click( function() { $( 'input[name="time_format"]' ).on( 'click', function() {
if ( 'time_format_custom_radio' !== $(this).attr( 'id' ) ) if ( 'time_format_custom_radio' !== $(this).attr( 'id' ) )
$( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() ); $( 'input[name="time_format_custom"]' ).val( $( this ).val() ).closest( 'fieldset' ).find( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
}); });
@ -89,7 +89,7 @@ function options_general_add_js() {
} ); } );
var languageSelect = $( '#WPLANG' ); var languageSelect = $( '#WPLANG' );
$( 'form' ).submit( function() { $( 'form' ).on( 'submit', function() {
// Don't show a spinner for English and installed languages, // Don't show a spinner for English and installed languages,
// as there is nothing to download. // as there is nothing to download.
if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) { if ( ! languageSelect.find( 'option:selected' ).data( 'installed' ) ) {
@ -117,7 +117,7 @@ function options_reading_add_js() {
selects.prop( 'disabled', ! staticPage.prop('checked') ); selects.prop( 'disabled', ! staticPage.prop('checked') );
}; };
check_disabled(); check_disabled();
section.find( 'input:radio' ).change( check_disabled ); section.find( 'input:radio' ).on( 'change', check_disabled );
}); });
</script> </script>
<?php <?php

View File

@ -15,7 +15,7 @@
tmplAppPassRow = wp.template( 'application-password-row' ), tmplAppPassRow = wp.template( 'application-password-row' ),
userId = $( '#user_id' ).val(); userId = $( '#user_id' ).val();
$newAppPassButton.click( function( e ) { $newAppPassButton.on( 'click', function( e ) {
e.preventDefault(); e.preventDefault();
if ( $newAppPassButton.prop( 'aria-disabled' ) ) { if ( $newAppPassButton.prop( 'aria-disabled' ) ) {

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
!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("<div></div>").attr("role","alert").attr("tabindex","-1").addClass("is-dismissible notice notice-"+s).append(o("<p></p>").text(e)).append(o("<button></button>").attr("type","button").addClass("notice-dismiss").append(o("<span></span>").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); !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("<div></div>").attr("role","alert").attr("tabindex","-1").addClass("is-dismissible notice notice-"+s).append(o("<p></p>").text(e)).append(o("<button></button>").attr("type","button").addClass("notice-dismiss").append(o("<span></span>").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);

View File

@ -232,7 +232,7 @@
* *
* @since 3.5.0 * @since 3.5.0
*/ */
self.toggler.click( function(){ self.toggler.on( 'click', function(){
if ( self.toggler.hasClass( 'wp-picker-open' ) ) { if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
self.close(); self.close();
} else { } else {
@ -250,7 +250,7 @@
* *
* @return {void} * @return {void}
*/ */
self.element.change( function( event ) { self.element.on( 'change', function( event ) {
var me = $( this ), var me = $( this ),
val = me.val(); val = me.val();
@ -272,7 +272,7 @@
* *
* @return {void} * @return {void}
*/ */
self.button.click( function( event ) { self.button.on( 'click', function( event ) {
var me = $( this ); var me = $( this );
if ( me.hasClass( 'wp-picker-clear' ) ) { if ( me.hasClass( 'wp-picker-clear' ) ) {
self.element.val( '' ); self.element.val( '' );

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! 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.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); !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);

View File

@ -29,11 +29,11 @@ jQuery(document).ready( function($) {
* @param {Event} event The event object. * @param {Event} event The event object.
* @return {void} * @return {void}
*/ */
$edittimestamp.click( function( event ) { $edittimestamp.on( 'click', function( event ) {
if ( $timestampdiv.is( ':hidden' ) ) { if ( $timestampdiv.is( ':hidden' ) ) {
// Slide down the form and set focus on the first field. // Slide down the form and set focus on the first field.
$timestampdiv.slideDown( 'fast', function() { $timestampdiv.slideDown( 'fast', function() {
$( 'input, select', $timestampwrap ).first().focus(); $( 'input, select', $timestampwrap ).first().trigger( 'focus' );
} ); } );
$(this).hide(); $(this).hide();
} }
@ -49,9 +49,9 @@ jQuery(document).ready( function($) {
* @return {void} * @return {void}
*/ */
$timestampdiv.find('.cancel-timestamp').click( function( event ) { $timestampdiv.find('.cancel-timestamp').on( 'click', function( event ) {
// Move focus back to the Edit link. // Move focus back to the Edit link.
$edittimestamp.show().focus(); $edittimestamp.show().trigger( 'focus' );
$timestampdiv.slideUp( 'fast' ); $timestampdiv.slideUp( 'fast' );
$('#mm').val($('#hidden_mm').val()); $('#mm').val($('#hidden_mm').val());
$('#jj').val($('#hidden_jj').val()); $('#jj').val($('#hidden_jj').val());
@ -70,7 +70,7 @@ jQuery(document).ready( function($) {
* @param {Event} event The event object. * @param {Event} event The event object.
* @return {void} * @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(), 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 ); newD = new Date( aa, mm - 1, jj, hh, mn );
@ -96,7 +96,7 @@ jQuery(document).ready( function($) {
); );
// Move focus back to the Edit link. // Move focus back to the Edit link.
$edittimestamp.show().focus(); $edittimestamp.show().trigger( 'focus' );
$timestampdiv.slideUp( 'fast' ); $timestampdiv.slideUp( 'fast' );
}); });
}); });

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! 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:")+" <b>"+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))+"</b> "),o.show().focus(),d.slideUp("fast")):v.addClass("form-invalid")})}); 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:")+" <b>"+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))+"</b> "),r.show().trigger("focus"),d.slideUp("fast")):c.addClass("form-invalid")})});

View File

@ -382,7 +382,7 @@ window.columns = {
*/ */
init : function() { init : function() {
var that = this; var that = this;
$('.hide-column-tog', '#adv-settings').click( function() { $('.hide-column-tog', '#adv-settings').on( 'click', function() {
var $t = $(this), column = $t.val(); var $t = $(this), column = $t.val();
if ( $t.prop('checked') ) if ( $t.prop('checked') )
that.checked(column); that.checked(column);
@ -500,7 +500,7 @@ window.validateForm = function( form ) {
.filter( function() { return $( ':input:visible', this ).val() === ''; } ) .filter( function() { return $( ':input:visible', this ).val() === ''; } )
.addClass( 'form-invalid' ) .addClass( 'form-invalid' )
.find( ':input:visible' ) .find( ':input:visible' )
.change( function() { $( this ).closest( '.form-invalid' ).removeClass( 'form-invalid' ); } ) .on( 'change', function() { $( this ).closest( '.form-invalid' ).removeClass( 'form-invalid' ); } )
.length; .length;
}; };
@ -571,7 +571,7 @@ window.screenMeta = {
this.toggles = $( '#screen-meta-links' ).find( '.show-settings' ); this.toggles = $( '#screen-meta-links' ).find( '.show-settings' );
this.page = $('#wpcontent'); this.page = $('#wpcontent');
this.toggles.click( this.toggleEvent ); this.toggles.on( 'click', this.toggleEvent );
}, },
/** /**
@ -617,7 +617,7 @@ window.screenMeta = {
* @return {void} * @return {void}
*/ */
panel.slideDown( 'fast', function() { panel.slideDown( 'fast', function() {
panel.focus(); panel.trigger( 'focus' );
button.addClass( 'screen-meta-active' ).attr( 'aria-expanded', true ); button.addClass( 'screen-meta-active' ).attr( 'aria-expanded', true );
}); });
@ -659,7 +659,7 @@ window.screenMeta = {
* *
* @return {void} * @return {void}
*/ */
$('.contextual-help-tabs').delegate('a', 'click', function(e) { $('.contextual-help-tabs').on( 'click', 'a', function(e) {
var link = $(this), var link = $(this),
panel; panel;
@ -798,7 +798,7 @@ $availableStructureTags.on( 'click', function() {
if ( permalinkStructureFocused && $permalinkStructure[0].setSelectionRange ) { if ( permalinkStructureFocused && $permalinkStructure[0].setSelectionRange ) {
newSelectionStart = ( permalinkStructureValue.substr( 0, selectionStart ) + textToAppend ).length; newSelectionStart = ( permalinkStructureValue.substr( 0, selectionStart ) + textToAppend ).length;
$permalinkStructure[0].setSelectionRange( newSelectionStart, newSelectionStart ); $permalinkStructure[0].setSelectionRange( newSelectionStart, newSelectionStart );
$permalinkStructure.focus(); $permalinkStructure.trigger( 'focus' );
} }
} ); } );
@ -1302,7 +1302,7 @@ $document.ready( function() {
$( this ).closest( 'tr' ).toggleClass( 'is-expanded' ); $( this ).closest( 'tr' ).toggleClass( 'is-expanded' );
}); });
$('#default-password-nag-no').click( function() { $('#default-password-nag-no').on( 'click', function() {
setUserSetting('default_password_nag', 'hide'); setUserSetting('default_password_nag', 'hide');
$('div.default-password-nag').hide(); $('div.default-password-nag').hide();
return false; return false;
@ -1315,7 +1315,7 @@ $document.ready( function() {
* *
* @return {void} * @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; var el = e.target, selStart, selEnd, val, scroll, sel;
// After pressing escape key (keyCode: 27), the tab key should tab out of the textarea. // After pressing escape key (keyCode: 27), the tab key should tab out of the textarea.
@ -1374,7 +1374,7 @@ $document.ready( function() {
* *
* @return {void} * @return {void}
*/ */
pageInput.closest('form').submit( function() { pageInput.closest('form').on( 'submit', function() {
/* /*
* action = bulk action dropdown at the top of the table * action = bulk action dropdown at the top of the table
*/ */
@ -1388,7 +1388,7 @@ $document.ready( function() {
* *
* @return {void} * @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'); $('select[name^="action"]').val('-1');
}); });
@ -1689,7 +1689,7 @@ $document.ready( function() {
$wpwrap.toggleClass( 'wp-responsive-open' ); $wpwrap.toggleClass( 'wp-responsive-open' );
if ( $wpwrap.hasClass( 'wp-responsive-open' ) ) { if ( $wpwrap.hasClass( 'wp-responsive-open' ) ) {
$(this).find('a').attr( 'aria-expanded', 'true' ); $(this).find('a').attr( 'aria-expanded', 'true' );
$( '#adminmenu a:first' ).focus(); $( '#adminmenu a:first' ).trigger( 'focus' );
} else { } else {
$(this).find('a').attr( 'aria-expanded', 'false' ); $(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 ); $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. // Set initial focus on a specific element.
$( '.wp-initial-focus' ).focus(); $( '.wp-initial-focus' ).trigger( 'focus' );
// Toggle update details on update-core.php. // Toggle update details on update-core.php.
$body.on( 'click', '.js-update-details-toggle', function() { $body.on( 'click', '.js-update-details-toggle', function() {

File diff suppressed because one or more lines are too long

View File

@ -1342,10 +1342,10 @@
template = wp.template( 'customize-' + container.containerType + '-default' ); template = wp.template( 'customize-' + container.containerType + '-default' );
} }
if ( template && container.container ) { if ( template && container.container ) {
return $.trim( template( _.extend( return template( _.extend(
{ id: container.id }, { id: container.id },
container.params container.params
) ) ); ) ).toString().trim();
} }
return '<li></li>'; return '<li></li>';
@ -1597,7 +1597,7 @@
sectionTitle.attr( 'tabindex', '-1' ); sectionTitle.attr( 'tabindex', '-1' );
backBtn.attr( 'tabindex', '0' ); backBtn.attr( 'tabindex', '0' );
backBtn.focus(); backBtn.trigger( 'focus' );
content.css( 'top', '' ); content.css( 'top', '' );
container.scrollTop( 0 ); container.scrollTop( 0 );
@ -1645,7 +1645,7 @@
backBtn.attr( 'tabindex', '-1' ); backBtn.attr( 'tabindex', '-1' );
sectionTitle.attr( 'tabindex', '0' ); sectionTitle.attr( 'tabindex', '0' );
sectionTitle.focus(); sectionTitle.trigger( 'focus' );
content.css( 'top', '' ); content.css( 'top', '' );
if ( args.completeCallback ) { if ( args.completeCallback ) {
@ -2734,7 +2734,7 @@
backBtn.attr( 'tabindex', '-1' ); backBtn.attr( 'tabindex', '-1' );
sectionTitle.attr( 'tabindex', '0' ); sectionTitle.attr( 'tabindex', '0' );
sectionTitle.focus(); sectionTitle.trigger( 'focus' );
content.css( 'top', '' ); content.css( 'top', '' );
if ( args.completeCallback ) { if ( args.completeCallback ) {
@ -4485,7 +4485,7 @@
y = control.settings.y.get(); y = control.settings.y.get();
inputValue = String( x ) + ' ' + String( y ); inputValue = String( x ) + ' ' + String( y );
radioInput = control.container.find( 'input[name="background-position"][value="' + inputValue + '"]' ); radioInput = control.container.find( 'input[name="background-position"][value="' + inputValue + '"]' );
radioInput.click(); radioInput.trigger( 'click' );
} ); } );
control.settings.x.bind( updateRadios ); control.settings.x.bind( updateRadios );
control.settings.y.bind( updateRadios ); control.settings.y.bind( updateRadios );
@ -5452,7 +5452,7 @@
controls = section.controls(); controls = section.controls();
controlIndex = controls.indexOf( control ); controlIndex = controls.indexOf( control );
if ( controls.length === controlIndex + 1 ) { if ( controls.length === controlIndex + 1 ) {
$( '#customize-footer-actions .collapse-sidebar' ).focus(); $( '#customize-footer-actions .collapse-sidebar' ).trigger( 'focus' );
} else { } else {
controls[ controlIndex + 1 ].container.find( ':focusable:first' ).focus(); controls[ controlIndex + 1 ].container.find( ':focusable:first' ).focus();
} }
@ -6336,7 +6336,7 @@
} ) ); } ) );
} ); } );
previewFrame.container.append( form ); previewFrame.container.append( form );
form.submit(); form.trigger( 'submit' );
form.remove(); // No need to keep the form around after submitted. 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. // Restore focus if there was a reflow and there was an active (focused) element.
if ( wasReflowed && activeElement ) { if ( wasReflowed && activeElement ) {
activeElement.focus(); activeElement.trigger( 'focus' );
} }
api.trigger( 'pane-contents-reflowed' ); api.trigger( 'pane-contents-reflowed' );
}, api ); }, api );
@ -8397,10 +8397,10 @@
} }
// Button bindings. // Button bindings.
saveBtn.click( function( event ) { saveBtn.on( 'click', function( event ) {
api.previewer.save(); api.previewer.save();
event.preventDefault(); event.preventDefault();
}).keydown( function( event ) { }).on( 'keydown', function( event ) {
if ( 9 === event.which ) { // Tab. if ( 9 === event.which ) { // Tab.
return; return;
} }
@ -8410,7 +8410,7 @@
event.preventDefault(); event.preventDefault();
}); });
closeBtn.keydown( function( event ) { closeBtn.on( 'keydown', function( event ) {
if ( 9 === event.which ) { // Tab. if ( 9 === event.which ) { // Tab.
return; return;
} }
@ -8752,7 +8752,8 @@
if ( title.length ) { if ( title.length ) {
api( 'blogname', function( setting ) { api( 'blogname', function( setting ) {
var updateTitle = function() { var updateTitle = function() {
title.text( $.trim( setting() ) || api.l10n.untitledBlogName ); var blogTitle = setting() || '';
title.text( blogTitle.toString().trim() || api.l10n.untitledBlogName );
}; };
setting.bind( updateTitle ); setting.bind( updateTitle );
updateTitle(); updateTitle();

File diff suppressed because one or more lines are too long

View File

@ -226,7 +226,7 @@
}); });
// Load available items if it looks like we'll need them. // Load available items if it looks like we'll need them.
api.panel( 'nav_menus' ).container.bind( 'expanded', function() { api.panel( 'nav_menus' ).container.on( 'expanded', function() {
if ( ! self.rendered ) { if ( ! self.rendered ) {
self.initList(); self.initList();
self.rendered = true; self.rendered = true;
@ -234,7 +234,7 @@
}); });
// Load more items. // Load more items.
this.sectionContent.scroll( function() { this.sectionContent.on( 'scroll', function() {
var totalHeight = self.$el.find( '.accordion-section.open .available-menu-items-list' ).prop( 'scrollHeight' ), var totalHeight = self.$el.find( '.accordion-section.open .available-menu-items-list' ).prop( 'scrollHeight' ),
visibleHeight = self.$el.find( '.accordion-section.open' ).height(); visibleHeight = self.$el.find( '.accordion-section.open' ).height();
@ -827,7 +827,7 @@
*/ */
ready: function() { ready: function() {
var panel = this; var panel = this;
panel.container.find( '.hide-column-tog' ).click( function() { panel.container.find( '.hide-column-tog' ).on( 'click', function() {
panel.saveManageColumnsState(); panel.saveManageColumnsState();
}); });
@ -3421,7 +3421,7 @@
function displayNavMenuName( name ) { function displayNavMenuName( name ) {
name = name || ''; name = name || '';
name = wp.sanitize.stripTagsAndEncodeText( name ); // Remove any potential tags from name. name = wp.sanitize.stripTagsAndEncodeText( name ); // Remove any potential tags from name.
name = $.trim( name ); name = name.toString().trim();
return name || api.Menus.data.l10n.unnamed; return name || api.Menus.data.l10n.unnamed;
} }

File diff suppressed because one or more lines are too long

View File

@ -40,7 +40,7 @@ jQuery(document).ready( function($) {
} }
// Hide the welcome panel when the dismiss button or close button is clicked. // Hide the welcome panel when the dismiss button or close button is clicked.
$('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function(e) { $('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).on( 'click', function(e) {
e.preventDefault(); e.preventDefault();
welcomePanel.addClass('hidden'); welcomePanel.addClass('hidden');
updateWelcomePanel( 0 ); updateWelcomePanel( 0 );
@ -48,7 +48,7 @@ jQuery(document).ready( function($) {
}); });
// Set welcome panel visibility based on Welcome Option checkbox value. // Set welcome panel visibility based on Welcome Option checkbox value.
welcomePanelHide.click( function() { welcomePanelHide.on( 'click', function() {
welcomePanel.toggleClass('hidden', ! this.checked ); welcomePanel.toggleClass('hidden', ! this.checked );
updateWelcomePanel( this.checked ? 1 : 0 ); updateWelcomePanel( this.checked ? 1 : 0 );
}); });
@ -136,7 +136,7 @@ jQuery(document).ready( function($) {
// Enable the submit buttons. // Enable the submit buttons.
$( '#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]' ).prop( 'disabled' , false ); $( '#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]' ).prop( 'disabled' , false );
t = $('#quick-press').submit( function( e ) { t = $('#quick-press').on( 'submit', function( e ) {
e.preventDefault(); e.preventDefault();
// Show a spinner. // Show a spinner.
@ -172,7 +172,7 @@ jQuery(document).ready( function($) {
} ); } );
// Change the QuickPost action to the publish value. // Change the QuickPost action to the publish value.
$('#publish').click( function() { act.val( 'post-quickpress-publish' ); } ); $('#publish').on( 'click', function() { act.val( 'post-quickpress-publish' ); } );
$('#quick-press').on( 'click focusin', function() { $('#quick-press').on( 'click focusin', function() {
wpActiveEditor = 'content'; wpActiveEditor = 'content';

File diff suppressed because one or more lines are too long

View File

@ -445,7 +445,7 @@ window.setCommentsList = function() {
a.attr('class', 'vim-z vim-destructive aria-button-if-js'); a.attr('class', 'vim-z vim-destructive aria-button-if-js');
$('.avatar', el).first().clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside'); $('.avatar', el).first().clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside');
a.click(function( e ){ a.on( 'click', function( e ){
e.preventDefault(); e.preventDefault();
e.stopPropagation(); // Ticket #35904. e.stopPropagation(); // Ticket #35904.
list.wpList.del(this); list.wpList.del(this);
@ -762,7 +762,7 @@ window.setCommentsList = function() {
* @global * @global
*/ */
window.theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } ) window.theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
.bind('wpListDelEnd', function(e, s){ .on('wpListDelEnd', function(e, s){
var wpListsData = $(s.target).attr('data-wp-lists'), id = s.element.replace(/[^0-9]+/g, ''); var wpListsData = $(s.target).attr('data-wp-lists'), id = s.element.replace(/[^0-9]+/g, '');
if ( wpListsData.indexOf(':trash=1') != -1 || wpListsData.indexOf(':spam=1') != -1 ) if ( wpListsData.indexOf(':trash=1') != -1 || wpListsData.indexOf(':spam=1') != -1 )
@ -793,9 +793,9 @@ window.commentReply = {
init : function() { init : function() {
var row = $('#replyrow'); var row = $('#replyrow');
$( '.cancel', row ).click( function() { return commentReply.revert(); } ); $( '.cancel', row ).on( 'click', function() { return commentReply.revert(); } );
$( '.save', row ).click( function() { return commentReply.send(); } ); $( '.save', row ).on( 'click', function() { return commentReply.send(); } );
$( 'input#author-name, input#author-email, input#author-url', row ).keypress( function( e ) { $( 'input#author-name, input#author-email, input#author-url', row ).on( 'keypress', function( e ) {
if ( e.which == 13 ) { if ( e.which == 13 ) {
commentReply.send(); commentReply.send();
e.preventDefault(); e.preventDefault();
@ -804,11 +804,11 @@ window.commentReply = {
}); });
// Add events. // Add events.
$('#the-comment-list .column-comment > p').dblclick(function(){ $('#the-comment-list .column-comment > p').on( 'dblclick', function(){
commentReply.toggle($(this).parent()); commentReply.toggle($(this).parent());
}); });
$('#doaction, #post-query-submit').click(function(){ $('#doaction, #post-query-submit').on( 'click', function(){
if ( $('#the-comment-list #replyrow').length > 0 ) if ( $('#the-comment-list #replyrow').length > 0 )
commentReply.close(); commentReply.close();
}); });
@ -831,7 +831,7 @@ window.commentReply = {
*/ */
addEvents : function(r) { addEvents : function(r) {
r.each(function() { r.each(function() {
$(this).find('.column-comment > p').dblclick(function(){ $(this).find('.column-comment > p').on( 'dblclick', function(){
commentReply.toggle($(this).parent()); commentReply.toggle($(this).parent());
}); });
}); });
@ -905,7 +905,7 @@ window.commentReply = {
.show() .show()
.find( '.vim-q' ) .find( '.vim-q' )
.attr( 'aria-expanded', 'false' ) .attr( 'aria-expanded', 'false' )
.focus(); .trigger( 'focus' );
} ).css( 'backgroundColor', '' ); } ).css( 'backgroundColor', '' );
} }
@ -913,7 +913,7 @@ window.commentReply = {
if ( 'replyto-comment' === this.act ) { if ( 'replyto-comment' === this.act ) {
commentRow.find( '.vim-r' ) commentRow.find( '.vim-r' )
.attr( 'aria-expanded', 'false' ) .attr( 'aria-expanded', 'false' )
.focus(); .trigger( 'focus' );
} }
// Reset the Quicktags buttons. // Reset the Quicktags buttons.
@ -1032,7 +1032,7 @@ window.commentReply = {
else if ( rtop - 20 < scrollTop ) else if ( rtop - 20 < scrollTop )
window.scroll(0, rtop - 35); window.scroll(0, rtop - 35);
$('#replycontent').focus().keyup(function(e){ $('#replycontent').trigger( 'focus' ).on( 'keyup', function(e){
if ( e.which == 27 ) if ( e.which == 27 )
commentReply.revert(); // Close on Escape. commentReply.revert(); // Close on Escape.
}); });
@ -1135,7 +1135,8 @@ window.commentReply = {
updateCountText( 'span.all-count', 1 ); updateCountText( 'span.all-count', 1 );
} }
c = $.trim(r.data); // Trim leading whitespaces. r.data = r.data || '';
c = r.data.toString().trim(); // Trim leading whitespaces.
$(c).hide(); $(c).hide();
$('#replyrow').after(c); $('#replyrow').after(c);

File diff suppressed because one or more lines are too long

View File

@ -51,7 +51,7 @@ window.wp = window.wp || {};
* *
* @return {boolean} The result of revert. * @return {boolean} The result of revert.
*/ */
qeRow.keyup(function(e){ qeRow.on( 'keyup', function(e){
// Revert changes if Escape key is pressed. // Revert changes if Escape key is pressed.
if ( e.which === 27 ) { if ( e.which === 27 ) {
return inlineEditPost.revert(); return inlineEditPost.revert();
@ -63,7 +63,7 @@ window.wp = window.wp || {};
* *
* @return {boolean} The result of revert. * @return {boolean} The result of revert.
*/ */
bulkRow.keyup(function(e){ bulkRow.on( 'keyup', function(e){
// Revert changes if Escape key is pressed. // Revert changes if Escape key is pressed.
if ( e.which === 27 ) { if ( e.which === 27 ) {
return inlineEditPost.revert(); return inlineEditPost.revert();
@ -75,7 +75,7 @@ window.wp = window.wp || {};
* *
* @return {boolean} The result of revert. * @return {boolean} The result of revert.
*/ */
$( '.cancel', qeRow ).click( function() { $( '.cancel', qeRow ).on( 'click', function() {
return inlineEditPost.revert(); return inlineEditPost.revert();
}); });
@ -84,7 +84,7 @@ window.wp = window.wp || {};
* *
* @return {boolean} The result of save. * @return {boolean} The result of save.
*/ */
$( '.save', qeRow ).click( function() { $( '.save', qeRow ).on( 'click', function() {
return inlineEditPost.save(this); return inlineEditPost.save(this);
}); });
@ -93,7 +93,7 @@ window.wp = window.wp || {};
* *
* @return {boolean} The result of save. * @return {boolean} The result of save.
*/ */
$('td', qeRow).keydown(function(e){ $('td', qeRow).on( 'keydown', function(e){
if ( e.which === 13 && ! $( e.target ).hasClass( 'cancel' ) ) { if ( e.which === 13 && ! $( e.target ).hasClass( 'cancel' ) ) {
return inlineEditPost.save(this); return inlineEditPost.save(this);
} }
@ -104,14 +104,14 @@ window.wp = window.wp || {};
* *
* @return {boolean} The result of revert. * @return {boolean} The result of revert.
*/ */
$( '.cancel', bulkRow ).click( function() { $( '.cancel', bulkRow ).on( 'click', function() {
return inlineEditPost.revert(); return inlineEditPost.revert();
}); });
/** /**
* Disables the password input field when the private post checkbox is checked. * Disables the password input field when the private post checkbox is checked.
*/ */
$('#inline-edit .inline-edit-private input[value="private"]').click( function(){ $('#inline-edit .inline-edit-private input[value="private"]').on( 'click', function(){
var pw = $('input.inline-edit-password-input'); var pw = $('input.inline-edit-password-input');
if ( $(this).prop('checked') ) { if ( $(this).prop('checked') ) {
pw.val('').prop('disabled', true); pw.val('').prop('disabled', true);
@ -139,7 +139,7 @@ window.wp = window.wp || {};
/** /**
* Adds onclick events to the apply buttons. * Adds onclick events to the apply buttons.
*/ */
$('#doaction').click(function(e){ $('#doaction').on( 'click', function(e){
var n; var n;
t.whichBulkButtonId = $( this ).attr( 'id' ); t.whichBulkButtonId = $( this ).attr( 'id' );
@ -215,7 +215,7 @@ window.wp = window.wp || {};
* *
* @listens click * @listens click
*/ */
$('#bulk-titles a').click(function(){ $('#bulk-titles a').on( 'click', function(){
var id = $(this).attr('id').substr(1); var id = $(this).attr('id').substr(1);
$('table.widefat input[value="' + id + '"]').prop('checked', false); $('table.widefat input[value="' + id + '"]').prop('checked', false);
@ -383,7 +383,7 @@ window.wp = window.wp || {};
} }
$(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show(); $(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
$('.ptitle', editRow).focus(); $('.ptitle', editRow).trigger( 'focus' );
return false; return false;
}, },
@ -434,7 +434,7 @@ window.wp = window.wp || {};
// Move focus back to the Quick Edit button. $( this ) is the row being animated. // Move focus back to the Quick Edit button. $( this ) is the row being animated.
$( this ).find( '.editinline' ) $( this ).find( '.editinline' )
.attr( 'aria-expanded', 'false' ) .attr( 'aria-expanded', 'false' )
.focus(); .trigger( 'focus' );
wp.a11y.speak( wp.i18n.__( 'Changes saved.' ) ); wp.a11y.speak( wp.i18n.__( 'Changes saved.' ) );
}); });
} else { } else {
@ -481,7 +481,7 @@ window.wp = window.wp || {};
$('#inlineedit').append( $('#bulk-edit') ); $('#inlineedit').append( $('#bulk-edit') );
// Move focus back to the Bulk Action button that was activated. // Move focus back to the Bulk Action button that was activated.
$( '#' + inlineEditPost.whichBulkButtonId ).focus(); $( '#' + inlineEditPost.whichBulkButtonId ).trigger( 'focus' );
} else { } else {
// Remove both the inline-editor and its hidden tr siblings. // Remove both the inline-editor and its hidden tr siblings.
@ -491,7 +491,7 @@ window.wp = window.wp || {};
// Show the post row and move focus back to the Quick Edit button. // Show the post row and move focus back to the Quick Edit button.
$( this.what + id ).show().find( '.editinline' ) $( this.what + id ).show().find( '.editinline' )
.attr( 'aria-expanded', 'false' ) .attr( 'aria-expanded', 'false' )
.focus(); .trigger( 'focus' );
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -47,7 +47,7 @@ window.inlineEditTax = {
* *
* @param {Object} e The keyup event that has been triggered. * @param {Object} e The keyup event that has been triggered.
*/ */
row.keyup( function( e ) { row.on( 'keyup', function( e ) {
// 27 = [Escape]. // 27 = [Escape].
if ( e.which === 27 ) { if ( e.which === 27 ) {
return inlineEditTax.revert(); return inlineEditTax.revert();
@ -57,21 +57,21 @@ window.inlineEditTax = {
/** /**
* Cancels inline editing when clicking the cancel button. * Cancels inline editing when clicking the cancel button.
*/ */
$( '.cancel', row ).click( function() { $( '.cancel', row ).on( 'click', function() {
return inlineEditTax.revert(); return inlineEditTax.revert();
}); });
/** /**
* Saves the inline edits when clicking the save button. * Saves the inline edits when clicking the save button.
*/ */
$( '.save', row ).click( function() { $( '.save', row ).on( 'click', function() {
return inlineEditTax.save(this); return inlineEditTax.save(this);
}); });
/** /**
* Saves the inline edits when pressing Enter inside the inline editor. * Saves the inline edits when pressing Enter inside the inline editor.
*/ */
$( 'input, select', row ).keydown( function( e ) { $( 'input, select', row ).on( 'keydown', function( e ) {
// 13 = [Enter]. // 13 = [Enter].
if ( e.which === 13 ) { if ( e.which === 13 ) {
return inlineEditTax.save( this ); return inlineEditTax.save( this );
@ -81,7 +81,7 @@ window.inlineEditTax = {
/** /**
* Saves the inline edits on submitting the inline edit form. * Saves the inline edits on submitting the inline edit form.
*/ */
$( '#posts-filter input[type="submit"]' ).mousedown( function() { $( '#posts-filter input[type="submit"]' ).on( 'mousedown', function() {
t.revert(); t.revert();
}); });
}, },
@ -143,7 +143,7 @@ window.inlineEditTax = {
$(':input[name="slug"]', editRow).val( val ); $(':input[name="slug"]', editRow).val( val );
$(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show(); $(editRow).attr('id', 'edit-'+id).addClass('inline-editor').show();
$('.ptitle', editRow).eq(0).focus(); $('.ptitle', editRow).eq(0).trigger( 'focus' );
return false; return false;
}, },
@ -223,7 +223,7 @@ window.inlineEditTax = {
// Move focus back to the Quick Edit button. // Move focus back to the Quick Edit button.
row.find( '.editinline' ) row.find( '.editinline' )
.attr( 'aria-expanded', 'false' ) .attr( 'aria-expanded', 'false' )
.focus(); .trigger( 'focus' );
wp.a11y.speak( wp.i18n.__( 'Changes saved.' ) ); wp.a11y.speak( wp.i18n.__( 'Changes saved.' ) );
}); });
@ -268,7 +268,7 @@ window.inlineEditTax = {
// Show the taxonomy row and move focus back to the Quick Edit button. // Show the taxonomy row and move focus back to the Quick Edit button.
$( this.what + id ).show().find( '.editinline' ) $( this.what + id ).show().find( '.editinline' )
.attr( 'aria-expanded', 'false' ) .attr( 'aria-expanded', 'false' )
.focus(); .trigger( 'focus' );
} }
}, },

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
window.wp=window.wp||{},function(s,l){window.inlineEditTax={init:function(){var t=this,e=s("#inline-edit");t.type=s("#the-list").attr("data-wp-lists").substr(5),t.what="#"+t.type+"-",s("#the-list").on("click",".editinline",function(){s(this).attr("aria-expanded","true"),inlineEditTax.edit(this)}),e.keyup(function(t){if(27===t.which)return inlineEditTax.revert()}),s(".cancel",e).click(function(){return inlineEditTax.revert()}),s(".save",e).click(function(){return inlineEditTax.save(this)}),s("input, select",e).keydown(function(t){if(13===t.which)return inlineEditTax.save(this)}),s('#posts-filter input[type="submit"]').mousedown(function(){t.revert()})},toggle:function(t){var e=this;"none"===s(e.what+e.getId(t)).css("display")?e.revert():e.edit(t)},edit:function(t){var e,i,n=this;return n.revert(),"object"==typeof t&&(t=n.getId(t)),e=s("#inline-edit").clone(!0),i=s("#inline_"+t),s("td",e).attr("colspan",s("th:visible, td:visible",".wp-list-table.widefat:first thead").length),s(n.what+t).hide().after(e).after('<tr class="hidden"></tr>'),(n=s(".name",i)).find("img").replaceWith(function(){return this.alt}),n=n.text(),s(':input[name="name"]',e).val(n),(n=s(".slug",i)).find("img").replaceWith(function(){return this.alt}),n=n.text(),s(':input[name="slug"]',e).val(n),s(e).attr("id","edit-"+t).addClass("inline-editor").show(),s(".ptitle",e).eq(0).focus(),!1},save:function(d){var t=s('input[name="taxonomy"]').val()||"";return"object"==typeof d&&(d=this.getId(d)),s("table.widefat .spinner").addClass("is-active"),t={action:"inline-save-tax",tax_type:this.type,tax_ID:d,taxonomy:t},t=s("#edit-"+d).find(":input").serialize()+"&"+s.param(t),s.post(ajaxurl,t,function(t){var e,i,n,a=s("#edit-"+d+" .inline-edit-save .notice-error"),r=a.find(".error");s("table.widefat .spinner").removeClass("is-active"),t?-1!==t.indexOf("<tr")?(s(inlineEditTax.what+d).siblings("tr.hidden").addBack().remove(),i=s(t).attr("id"),s("#edit-"+d).before(t).remove(),e=i?(n=i.replace(inlineEditTax.type+"-",""),s("#"+i)):(n=d,s(inlineEditTax.what+d)),s("#parent").find("option[value="+n+"]").text(e.find(".row-title").text()),e.hide().fadeIn(400,function(){e.find(".editinline").attr("aria-expanded","false").focus(),l.a11y.speak(l.i18n.__("Changes saved."))})):(a.removeClass("hidden"),r.html(t),l.a11y.speak(r.text())):(a.removeClass("hidden"),r.text(l.i18n.__("Error while saving the changes.")),l.a11y.speak(l.i18n.__("Error while saving the changes.")))}),!1},revert:function(){var t=s("table.widefat tr.inline-editor").attr("id");t&&(s("table.widefat .spinner").removeClass("is-active"),s("#"+t).siblings("tr.hidden").addBack().remove(),t=t.substr(t.lastIndexOf("-")+1),s(this.what+t).show().find(".editinline").attr("aria-expanded","false").focus())},getId:function(t){t=("TR"===t.tagName?t.id:s(t).parents("tr").attr("id")).split("-");return t[t.length-1]}},s(document).ready(function(){inlineEditTax.init()})}(jQuery,window.wp); window.wp=window.wp||{},function(s,l){window.inlineEditTax={init:function(){var t=this,e=s("#inline-edit");t.type=s("#the-list").attr("data-wp-lists").substr(5),t.what="#"+t.type+"-",s("#the-list").on("click",".editinline",function(){s(this).attr("aria-expanded","true"),inlineEditTax.edit(this)}),e.on("keyup",function(t){if(27===t.which)return inlineEditTax.revert()}),s(".cancel",e).on("click",function(){return inlineEditTax.revert()}),s(".save",e).on("click",function(){return inlineEditTax.save(this)}),s("input, select",e).on("keydown",function(t){if(13===t.which)return inlineEditTax.save(this)}),s('#posts-filter input[type="submit"]').on("mousedown",function(){t.revert()})},toggle:function(t){var e=this;"none"===s(e.what+e.getId(t)).css("display")?e.revert():e.edit(t)},edit:function(t){var e,i,n=this;return n.revert(),"object"==typeof t&&(t=n.getId(t)),e=s("#inline-edit").clone(!0),i=s("#inline_"+t),s("td",e).attr("colspan",s("th:visible, td:visible",".wp-list-table.widefat:first thead").length),s(n.what+t).hide().after(e).after('<tr class="hidden"></tr>'),(n=s(".name",i)).find("img").replaceWith(function(){return this.alt}),n=n.text(),s(':input[name="name"]',e).val(n),(n=s(".slug",i)).find("img").replaceWith(function(){return this.alt}),n=n.text(),s(':input[name="slug"]',e).val(n),s(e).attr("id","edit-"+t).addClass("inline-editor").show(),s(".ptitle",e).eq(0).trigger("focus"),!1},save:function(d){var t=s('input[name="taxonomy"]').val()||"";return"object"==typeof d&&(d=this.getId(d)),s("table.widefat .spinner").addClass("is-active"),t={action:"inline-save-tax",tax_type:this.type,tax_ID:d,taxonomy:t},t=s("#edit-"+d).find(":input").serialize()+"&"+s.param(t),s.post(ajaxurl,t,function(t){var e,i,n,a=s("#edit-"+d+" .inline-edit-save .notice-error"),r=a.find(".error");s("table.widefat .spinner").removeClass("is-active"),t?-1!==t.indexOf("<tr")?(s(inlineEditTax.what+d).siblings("tr.hidden").addBack().remove(),i=s(t).attr("id"),s("#edit-"+d).before(t).remove(),e=i?(n=i.replace(inlineEditTax.type+"-",""),s("#"+i)):(n=d,s(inlineEditTax.what+d)),s("#parent").find("option[value="+n+"]").text(e.find(".row-title").text()),e.hide().fadeIn(400,function(){e.find(".editinline").attr("aria-expanded","false").trigger("focus"),l.a11y.speak(l.i18n.__("Changes saved."))})):(a.removeClass("hidden"),r.html(t),l.a11y.speak(r.text())):(a.removeClass("hidden"),r.text(l.i18n.__("Error while saving the changes.")),l.a11y.speak(l.i18n.__("Error while saving the changes.")))}),!1},revert:function(){var t=s("table.widefat tr.inline-editor").attr("id");t&&(s("table.widefat .spinner").removeClass("is-active"),s("#"+t).siblings("tr.hidden").addBack().remove(),t=t.substr(t.lastIndexOf("-")+1),s(this.what+t).show().find(".editinline").attr("aria-expanded","false").trigger("focus"))},getId:function(t){t=("TR"===t.tagName?t.id:s(t).parents("tr").attr("id")).split("-");return t[t.length-1]}},s(document).ready(function(){inlineEditTax.init()})}(jQuery,window.wp);

View File

@ -108,6 +108,6 @@ window.send_to_editor = function( html ) {
}; };
// Add handler to recalculates the ThickBox position when the window is resized. // Add handler to recalculates the ThickBox position when the window is resized.
$(window).resize(function(){ tb_position(); }); $(window).on( 'resize', function(){ tb_position(); });
})(jQuery); })(jQuery);

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
window.send_to_editor=function(t){var e,i="undefined"!=typeof tinymce,n="undefined"!=typeof QTags;if(wpActiveEditor)i&&(e=tinymce.get(wpActiveEditor));else if(i&&tinymce.activeEditor)e=tinymce.activeEditor,window.wpActiveEditor=e.id;else if(!n)return!1;if(e&&!e.isHidden()?e.execCommand("mceInsertContent",!1,t):n?QTags.insertContent(t):document.getElementById(wpActiveEditor).value+=t,window.tb_remove)try{window.tb_remove()}catch(t){}},function(d){window.tb_position=function(){var t=d("#TB_window"),e=d(window).width(),i=d(window).height(),n=833<e?833:e,o=0;return d("#wpadminbar").length&&(o=parseInt(d("#wpadminbar").css("height"),10)),t.length&&(t.width(n-50).height(i-45-o),d("#TB_iframeContent").width(n-50).height(i-75-o),t.css({"margin-left":"-"+parseInt((n-50)/2,10)+"px"}),void 0!==document.body.style.maxWidth&&t.css({top:20+o+"px","margin-top":"0"})),d("a.thickbox").each(function(){var t=d(this).attr("href");t&&(t=(t=t.replace(/&width=[0-9]+/g,"")).replace(/&height=[0-9]+/g,""),d(this).attr("href",t+"&width="+(n-80)+"&height="+(i-85-o)))})},d(window).resize(function(){tb_position()})}(jQuery); window.send_to_editor=function(t){var e,i="undefined"!=typeof tinymce,n="undefined"!=typeof QTags;if(wpActiveEditor)i&&(e=tinymce.get(wpActiveEditor));else if(i&&tinymce.activeEditor)e=tinymce.activeEditor,window.wpActiveEditor=e.id;else if(!n)return!1;if(e&&!e.isHidden()?e.execCommand("mceInsertContent",!1,t):n?QTags.insertContent(t):document.getElementById(wpActiveEditor).value+=t,window.tb_remove)try{window.tb_remove()}catch(t){}},function(d){window.tb_position=function(){var t=d("#TB_window"),e=d(window).width(),i=d(window).height(),n=833<e?833:e,o=0;return d("#wpadminbar").length&&(o=parseInt(d("#wpadminbar").css("height"),10)),t.length&&(t.width(n-50).height(i-45-o),d("#TB_iframeContent").width(n-50).height(i-75-o),t.css({"margin-left":"-"+parseInt((n-50)/2,10)+"px"}),void 0!==document.body.style.maxWidth&&t.css({top:20+o+"px","margin-top":"0"})),d("a.thickbox").each(function(){var t=d(this).attr("href");t&&(t=(t=t.replace(/&width=[0-9]+/g,"")).replace(/&height=[0-9]+/g,""),d(this).attr("href",t+"&width="+(n-80)+"&height="+(i-85-o)))})},d(window).on("resize",function(){tb_position()})}(jQuery);

View File

@ -158,13 +158,13 @@
} }
// Prevents form submission if no post has been selected. // Prevents form submission if no post has been selected.
$( '#find-posts-submit' ).click( function( event ) { $( '#find-posts-submit' ).on( 'click', function( event ) {
if ( ! $( '#find-posts-response input[type="radio"]:checked' ).length ) if ( ! $( '#find-posts-response input[type="radio"]:checked' ).length )
event.preventDefault(); event.preventDefault();
}); });
// Submits the search query when hitting the enter key in the search input. // Submits the search query when hitting the enter key in the search input.
$( '#find-posts .find-box-search :input' ).keypress( function( event ) { $( '#find-posts .find-box-search :input' ).on( 'keypress', function( event ) {
if ( 13 == event.which ) { if ( 13 == event.which ) {
findPosts.send(); findPosts.send();
return false; return false;
@ -172,13 +172,13 @@
}); });
// Binds the click event to the search button. // Binds the click event to the search button.
$( '#find-posts-search' ).click( findPosts.send ); $( '#find-posts-search' ).on( 'click', findPosts.send );
// Binds the close dialog click event. // Binds the close dialog click event.
$( '#find-posts-close' ).click( findPosts.close ); $( '#find-posts-close' ).on( 'click', findPosts.close );
// Binds the bulk action events to the submit buttons. // Binds the bulk action events to the submit buttons.
$( '#doaction' ).click( function( event ) { $( '#doaction' ).on( 'click', function( event ) {
/* /*
* Handle the bulk action based on its value. * Handle the bulk action based on its value.

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! 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").click(function(n){s('#find-posts-response input[type="radio"]:checked').length||n.preventDefault()}),s("#find-posts .find-box-search :input").keypress(function(n){if(13==n.which)return findPosts.send(),!1}),s("#find-posts-search").click(findPosts.send),s("#find-posts-close").click(findPosts.close),s("#doaction").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(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);

View File

@ -390,7 +390,7 @@
thisItem.shiftHorizontally( 1 ); thisItem.shiftHorizontally( 1 );
break; break;
} }
$this.focus(); $this.trigger( 'focus' );
api.registerChange(); api.registerChange();
api.refreshKeyboardAccessibility(); api.refreshKeyboardAccessibility();
api.refreshAdvancedAccessibility(); api.refreshAdvancedAccessibility();
@ -572,7 +572,7 @@
break; break;
} }
// Put focus back on same menu item. // Put focus back on same menu item.
$( '#edit-' + thisItemData['menu-item-db-id'] ).focus(); $( '#edit-' + thisItemData['menu-item-db-id'] ).trigger( 'focus' );
return false; return false;
}); });
}); });
@ -608,7 +608,7 @@
// Hide fields. // Hide fields.
api.menuList.hideAdvancedMenuItemFields(); api.menuList.hideAdvancedMenuItemFields();
$('.hide-postbox-tog').click(function () { $('.hide-postbox-tog').on( 'click', function () {
var hidden = $( '.accordion-container li.accordion-section' ).filter(':hidden').map(function() { return this.id; }).get().join(','); var hidden = $( '.accordion-container li.accordion-section' ).filter(':hidden').map(function() { return this.id; }).get().join(',');
$.post(ajaxurl, { $.post(ajaxurl, {
action: 'closed-postboxes', action: 'closed-postboxes',
@ -809,7 +809,7 @@
}, },
initManageLocations : function () { initManageLocations : function () {
$('#menu-locations-wrap form').submit(function(){ $('#menu-locations-wrap form').on( 'submit', function(){
window.onbeforeunload = null; window.onbeforeunload = null;
}); });
$('.menu-location-menus select').on('change', function () { $('.menu-location-menus select').on('change', function () {
@ -823,7 +823,7 @@
attachMenuEditListeners : function() { attachMenuEditListeners : function() {
var that = this; var that = this;
$('#update-nav-menu').bind('click', function(e) { $('#update-nav-menu').on('click', function(e) {
if ( e.target && e.target.className ) { if ( e.target && e.target.className ) {
if ( -1 != e.target.className.indexOf('item-edit') ) { if ( -1 != e.target.className.indexOf('item-edit') ) {
return that.eventOnClickEditLink(e.target); return that.eventOnClickEditLink(e.target);
@ -852,7 +852,7 @@
} }
}, 500 ) ); }, 500 ) );
$('#add-custom-links input[type="text"]').keypress(function(e){ $('#add-custom-links input[type="text"]').on( 'keypress', function(e){
$('#customlinkdiv').removeClass('form-invalid'); $('#customlinkdiv').removeClass('form-invalid');
if ( e.keyCode === 13 ) { if ( e.keyCode === 13 ) {
@ -867,7 +867,7 @@
* When a navigation menu is saved, store a JSON representation of all form data * When a navigation menu is saved, store a JSON representation of all form data
* in a single input to avoid PHP `max_input_vars` limitations. See #14134. * in a single input to avoid PHP `max_input_vars` limitations. See #14134.
*/ */
$( '#update-nav-menu' ).submit( function() { $( '#update-nav-menu' ).on( 'submit', function() {
var navMenuData = $( '#update-nav-menu' ).serializeArray(); var navMenuData = $( '#update-nav-menu' ).serializeArray();
$( '[name="nav-menu-data"]' ).val( JSON.stringify( navMenuData ) ); $( '[name="nav-menu-data"]' ).val( JSON.stringify( navMenuData ) );
}); });
@ -877,7 +877,7 @@
var loc = $('#nav-menu-theme-locations'), params = {}; var loc = $('#nav-menu-theme-locations'), params = {};
params.action = 'menu-locations-save'; params.action = 'menu-locations-save';
params['menu-settings-column-nonce'] = $('#menu-settings-column-nonce').val(); params['menu-settings-column-nonce'] = $('#menu-settings-column-nonce').val();
loc.find('input[type="submit"]').click(function() { loc.find('input[type="submit"]').on( 'click', function() {
loc.find('select').each(function() { loc.find('select').each(function() {
params[this.name] = $(this).val(); params[this.name] = $(this).val();
}); });
@ -947,9 +947,13 @@
}, },
addCustomLink : function( processMethod ) { addCustomLink : function( processMethod ) {
var url = $('#custom-menu-item-url').val().trim(), var url = $('#custom-menu-item-url').val().toString(),
label = $('#custom-menu-item-name').val(); label = $('#custom-menu-item-name').val();
if ( '' !== url ) {
url = url.trim();
}
processMethod = processMethod || api.addMenuItemToBottom; processMethod = processMethod || api.addMenuItemToBottom;
if ( '' === url || 'https://' == url || 'http://' == url ) { if ( '' === url || 'https://' == url || 'http://' == url ) {
@ -999,7 +1003,8 @@
$.post( ajaxurl, params, function(menuMarkup) { $.post( ajaxurl, params, function(menuMarkup) {
var ins = $('#menu-instructions'); var ins = $('#menu-instructions');
menuMarkup = $.trim( menuMarkup ); // Trim leading whitespaces. menuMarkup = menuMarkup || '';
menuMarkup = menuMarkup.toString().trim(); // Trim leading whitespaces.
processMethod(menuMarkup, params); processMethod(menuMarkup, params);
// Make it stand out a bit more visually, by adding a fadeIn. // Make it stand out a bit more visually, by adding a fadeIn.
@ -1043,7 +1048,7 @@
}, },
attachUnsavedChangesListener : function() { attachUnsavedChangesListener : function() {
$('#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select').change(function(){ $('#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select').on( 'change', function(){
api.registerChange(); api.registerChange();
}); });
@ -1063,7 +1068,7 @@
}, },
attachTabsPanelListeners : function() { attachTabsPanelListeners : function() {
$('#menu-settings-column').bind('click', function(e) { $('#menu-settings-column').on('click', function(e) {
var selectAreaMatch, selectAll, panelId, wrapper, items, var selectAreaMatch, selectAll, panelId, wrapper, items,
target = $(e.target); target = $(e.target);
@ -1083,7 +1088,7 @@
target.parent().addClass('tabs'); target.parent().addClass('tabs');
// Select the search bar. // Select the search bar.
$('.quick-search', wrapper).focus(); $('.quick-search', wrapper).trigger( 'focus' );
// Hide controls in the search tab if no items found. // Hide controls in the search tab if no items found.
if ( ! wrapper.find( '.tabs-panel-active .menu-item-title' ).length ) { if ( ! wrapper.find( '.tabs-panel-active .menu-item-title' ).length ) {

File diff suppressed because one or more lines are too long

View File

@ -32,7 +32,7 @@ window.wp = window.wp || {};
* @return {number} The password strength score. * @return {number} The password strength score.
*/ */
meter : function( password1, disallowedList, password2 ) { meter : function( password1, disallowedList, password2 ) {
if ( ! $.isArray( disallowedList ) ) if ( ! Array.isArray( disallowedList ) )
disallowedList = [ disallowedList.toString() ]; disallowedList = [ disallowedList.toString() ];
if (password1 != password2 && password2 && password2.length > 0) if (password1 != password2 && password2 && password2.length > 0)

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
window.wp=window.wp||{},function(l){var e=wp.i18n.__,n=wp.i18n.sprintf;wp.passwordStrength={meter:function(e,n,t){return l.isArray(n)||(n=[n.toString()]),e!=t&&t&&0<t.length?5:void 0===window.zxcvbn?-1:zxcvbn(e,n).score},userInputBlacklist:function(){return window.console.log(n(e("%1$s is deprecated since version %2$s! Use %3$s instead. Please consider writing more inclusive code."),"wp.passwordStrength.userInputBlacklist()","5.5.0","wp.passwordStrength.userInputDisallowedList()")),wp.passwordStrength.userInputDisallowedList()},userInputDisallowedList:function(){var e,n,t,r,s=[],i=[],o=["user_login","first_name","last_name","nickname","display_name","email","url","description","weblog_title","admin_email"];for(s.push(document.title),s.push(document.URL),n=o.length,e=0;e<n;e++)0!==(r=l("#"+o[e])).length&&(s.push(r[0].defaultValue),s.push(r.val()));for(t=s.length,e=0;e<t;e++)s[e]&&(i=i.concat(s[e].replace(/\W/g," ").split(" ")));return i=l.grep(i,function(e,n){return!(""===e||e.length<4)&&l.inArray(e,i)===n})}},window.passwordStrength=wp.passwordStrength.meter}(jQuery); window.wp=window.wp||{},function(a){var e=wp.i18n.__,n=wp.i18n.sprintf;wp.passwordStrength={meter:function(e,n,t){return Array.isArray(n)||(n=[n.toString()]),e!=t&&t&&0<t.length?5:void 0===window.zxcvbn?-1:zxcvbn(e,n).score},userInputBlacklist:function(){return window.console.log(n(e("%1$s is deprecated since version %2$s! Use %3$s instead. Please consider writing more inclusive code."),"wp.passwordStrength.userInputBlacklist()","5.5.0","wp.passwordStrength.userInputDisallowedList()")),wp.passwordStrength.userInputDisallowedList()},userInputDisallowedList:function(){var e,n,t,r,s=[],i=[],o=["user_login","first_name","last_name","nickname","display_name","email","url","description","weblog_title","admin_email"];for(s.push(document.title),s.push(document.URL),n=o.length,e=0;e<n;e++)0!==(r=a("#"+o[e])).length&&(s.push(r[0].defaultValue),s.push(r.val()));for(t=s.length,e=0;e<t;e++)s[e]&&(i=i.concat(s[e].replace(/\W/g," ").split(" ")));return i=a.grep(i,function(e,n){return!(""===e||e.length<4)&&a.inArray(e,i)===n})}},window.passwordStrength=wp.passwordStrength.meter}(jQuery);

View File

@ -50,7 +50,7 @@ jQuery( document ).ready( function( $ ) {
}); });
}; };
$( window ).resize( function() { $( window ).on( 'resize', function() {
tb_position(); tb_position();
}); });
@ -185,7 +185,7 @@ jQuery( document ).ready( function( $ ) {
}); });
/* Plugin install related JS */ /* Plugin install related JS */
$( '#plugin-information-tabs a' ).click( function( event ) { $( '#plugin-information-tabs a' ).on( 'click', function( event ) {
var tab = $( this ).attr( 'name' ); var tab = $( this ).attr( 'name' );
event.preventDefault(); event.preventDefault();

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
jQuery(document).ready(function(e){var o,i,n,a,l,d=e(),s=e(".upload-view-toggle"),t=e(".wrap"),r=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.focus()):(t.preventDefault(),a.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).resize(function(){tb_position()}),r.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.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(){d.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(),d=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").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")||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(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"))})});

View File

@ -213,7 +213,7 @@ window.wp = window.wp || {};
} }
wrap.show().find('.currently-editing').text( received.lock_error.text ); wrap.show().find('.currently-editing').text( received.lock_error.text );
wrap.find('.wp-tab-first').focus(); wrap.find('.wp-tab-first').trigger( 'focus' );
} }
} else if ( received.new_lock ) { } else if ( received.new_lock ) {
$('#active_post_lock').val( received.new_lock ); $('#active_post_lock').val( received.new_lock );
@ -327,14 +327,14 @@ jQuery(document).ready( function($) {
// [Shift] + [Tab] on first tab cycles back to last tab. // [Shift] + [Tab] on first tab cycles back to last tab.
if ( target.hasClass('wp-tab-first') && e.shiftKey ) { if ( target.hasClass('wp-tab-first') && e.shiftKey ) {
$(this).find('.wp-tab-last').focus(); $(this).find('.wp-tab-last').trigger( 'focus' );
e.preventDefault(); e.preventDefault();
// [Tab] on last tab cycles back to first tab. // [Tab] on last tab cycles back to first tab.
} else if ( target.hasClass('wp-tab-last') && ! e.shiftKey ) { } else if ( target.hasClass('wp-tab-last') && ! e.shiftKey ) {
$(this).find('.wp-tab-first').focus(); $(this).find('.wp-tab-first').trigger( 'focus' );
e.preventDefault(); e.preventDefault();
} }
}).filter(':visible').find('.wp-tab-first').focus(); }).filter(':visible').find('.wp-tab-first').trigger( 'focus' );
// Set the heartbeat interval to 15 seconds if post lock dialogs are enabled. // Set the heartbeat interval to 15 seconds if post lock dialogs are enabled.
if ( wp.heartbeat && $('#post-lock-dialog').length ) { if ( wp.heartbeat && $('#post-lock-dialog').length ) {
@ -437,7 +437,7 @@ jQuery(document).ready( function($) {
if ( editor && ! editor.isHidden() ) { if ( editor && ! editor.isHidden() ) {
editor.focus(); editor.focus();
} else if ( $textarea.length ) { } else if ( $textarea.length ) {
$textarea.focus(); $textarea.trigger( 'focus' );
} else { } else {
return; return;
} }
@ -578,7 +578,7 @@ jQuery(document).ready( function($) {
} }
// @todo Move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.js. // @todo Move to jQuery 1.3+, support for multiple hierarchical taxonomies, see wp-lists.js.
$('a', '#' + taxonomy + '-tabs').click( function( e ) { $('a', '#' + taxonomy + '-tabs').on( 'click', function( e ) {
e.preventDefault(); e.preventDefault();
var t = $(this).attr('href'); var t = $(this).attr('href');
$(this).parent().addClass('tabs').siblings('li').removeClass('tabs'); $(this).parent().addClass('tabs').siblings('li').removeClass('tabs');
@ -608,8 +608,8 @@ jQuery(document).ready( function($) {
}); });
// After submitting a new taxonomy, re-focus the input field. // After submitting a new taxonomy, re-focus the input field.
$('#' + taxonomy + '-add-submit').click( function() { $('#' + taxonomy + '-add-submit').on( 'click', function() {
$('#new' + taxonomy).focus(); $('#new' + taxonomy).trigger( 'focus' );
}); });
/** /**
@ -658,11 +658,11 @@ jQuery(document).ready( function($) {
}); });
// Add new taxonomy button toggles input form visibility. // Add new taxonomy button toggles input form visibility.
$('#' + taxonomy + '-add-toggle').click( function( e ) { $('#' + taxonomy + '-add-toggle').on( 'click', function( e ) {
e.preventDefault(); e.preventDefault();
$('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' ); $('#' + taxonomy + '-adder').toggleClass( 'wp-hidden-children' );
$('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click(); $('a[href="#' + taxonomy + '-all"]', '#' + taxonomy + '-tabs').click();
$('#new'+taxonomy).focus(); $('#new'+taxonomy).trigger( 'focus' );
}); });
// Sync checked items between "All {taxonomy}" and "Most used" lists. // Sync checked items between "All {taxonomy}" and "Most used" lists.
@ -834,35 +834,35 @@ jQuery(document).ready( function($) {
}; };
// Show the visibility options and hide the toggle button when opened. // Show the visibility options and hide the toggle button when opened.
$( '#visibility .edit-visibility').click( function( e ) { $( '#visibility .edit-visibility').on( 'click', function( e ) {
e.preventDefault(); e.preventDefault();
if ( $postVisibilitySelect.is(':hidden') ) { if ( $postVisibilitySelect.is(':hidden') ) {
updateVisibility(); updateVisibility();
$postVisibilitySelect.slideDown( 'fast', function() { $postVisibilitySelect.slideDown( 'fast', function() {
$postVisibilitySelect.find( 'input[type="radio"]' ).first().focus(); $postVisibilitySelect.find( 'input[type="radio"]' ).first().trigger( 'focus' );
} ); } );
$(this).hide(); $(this).hide();
} }
}); });
// Cancel visibility selection area and hide it from view. // Cancel visibility selection area and hide it from view.
$postVisibilitySelect.find('.cancel-post-visibility').click( function( event ) { $postVisibilitySelect.find('.cancel-post-visibility').on( 'click', function( event ) {
$postVisibilitySelect.slideUp('fast'); $postVisibilitySelect.slideUp('fast');
$('#visibility-radio-' + $('#hidden-post-visibility').val()).prop('checked', true); $('#visibility-radio-' + $('#hidden-post-visibility').val()).prop('checked', true);
$('#post_password').val($('#hidden-post-password').val()); $('#post_password').val($('#hidden-post-password').val());
$('#sticky').prop('checked', $('#hidden-post-sticky').prop('checked')); $('#sticky').prop('checked', $('#hidden-post-sticky').prop('checked'));
$('#post-visibility-display').html(visibility); $('#post-visibility-display').html(visibility);
$('#visibility .edit-visibility').show().focus(); $('#visibility .edit-visibility').show().trigger( 'focus' );
updateText(); updateText();
event.preventDefault(); event.preventDefault();
}); });
// Set the selected visibility as current. // Set the selected visibility as current.
$postVisibilitySelect.find('.save-post-visibility').click( function( event ) { // Crazyhorse - multiple OK cancels. $postVisibilitySelect.find('.save-post-visibility').on( 'click', function( event ) { // Crazyhorse - multiple OK cancels.
var visibilityLabel = '', selectedVisibility = $postVisibilitySelect.find('input:radio:checked').val(); var visibilityLabel = '', selectedVisibility = $postVisibilitySelect.find('input:radio:checked').val();
$postVisibilitySelect.slideUp('fast'); $postVisibilitySelect.slideUp('fast');
$('#visibility .edit-visibility').show().focus(); $('#visibility .edit-visibility').show().trigger( 'focus' );
updateText(); updateText();
if ( 'public' !== selectedVisibility ) { if ( 'public' !== selectedVisibility ) {
@ -886,15 +886,15 @@ jQuery(document).ready( function($) {
}); });
// When the selection changes, update labels. // When the selection changes, update labels.
$postVisibilitySelect.find('input:radio').change( function() { $postVisibilitySelect.find('input:radio').on( 'change', function() {
updateVisibility(); updateVisibility();
}); });
// Edit publish time click. // Edit publish time click.
$timestampdiv.siblings('a.edit-timestamp').click( function( event ) { $timestampdiv.siblings('a.edit-timestamp').on( 'click', function( event ) {
if ( $timestampdiv.is( ':hidden' ) ) { if ( $timestampdiv.is( ':hidden' ) ) {
$timestampdiv.slideDown( 'fast', function() { $timestampdiv.slideDown( 'fast', function() {
$( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().focus(); $( 'input, select', $timestampdiv.find( '.timestamp-wrap' ) ).first().trigger( 'focus' );
} ); } );
$(this).hide(); $(this).hide();
} }
@ -902,8 +902,8 @@ jQuery(document).ready( function($) {
}); });
// Cancel editing the publish time and hide the settings. // Cancel editing the publish time and hide the settings.
$timestampdiv.find('.cancel-timestamp').click( function( event ) { $timestampdiv.find('.cancel-timestamp').on( 'click', function( event ) {
$timestampdiv.slideUp('fast').siblings('a.edit-timestamp').show().focus(); $timestampdiv.slideUp('fast').siblings('a.edit-timestamp').show().trigger( 'focus' );
$('#mm').val($('#hidden_mm').val()); $('#mm').val($('#hidden_mm').val());
$('#jj').val($('#hidden_jj').val()); $('#jj').val($('#hidden_jj').val());
$('#aa').val($('#hidden_aa').val()); $('#aa').val($('#hidden_aa').val());
@ -914,10 +914,10 @@ jQuery(document).ready( function($) {
}); });
// Save the changed timestamp. // Save the changed timestamp.
$timestampdiv.find('.save-timestamp').click( function( event ) { // Crazyhorse - multiple OK cancels. $timestampdiv.find('.save-timestamp').on( 'click', function( event ) { // Crazyhorse - multiple OK cancels.
if ( updateText() ) { if ( updateText() ) {
$timestampdiv.slideUp('fast'); $timestampdiv.slideUp('fast');
$timestampdiv.siblings('a.edit-timestamp').show().focus(); $timestampdiv.siblings('a.edit-timestamp').show().trigger( 'focus' );
} }
event.preventDefault(); event.preventDefault();
}); });
@ -937,10 +937,10 @@ jQuery(document).ready( function($) {
}); });
// Post Status edit click. // Post Status edit click.
$postStatusSelect.siblings('a.edit-post-status').click( function( event ) { $postStatusSelect.siblings('a.edit-post-status').on( 'click', function( event ) {
if ( $postStatusSelect.is( ':hidden' ) ) { if ( $postStatusSelect.is( ':hidden' ) ) {
$postStatusSelect.slideDown( 'fast', function() { $postStatusSelect.slideDown( 'fast', function() {
$postStatusSelect.find('select').focus(); $postStatusSelect.find('select').trigger( 'focus' );
} ); } );
$(this).hide(); $(this).hide();
} }
@ -948,15 +948,15 @@ jQuery(document).ready( function($) {
}); });
// Save the Post Status changes and hide the options. // Save the Post Status changes and hide the options.
$postStatusSelect.find('.save-post-status').click( function( event ) { $postStatusSelect.find('.save-post-status').on( 'click', function( event ) {
$postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().focus(); $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().trigger( 'focus' );
updateText(); updateText();
event.preventDefault(); event.preventDefault();
}); });
// Cancel Post Status editing and hide the options. // Cancel Post Status editing and hide the options.
$postStatusSelect.find('.cancel-post-status').click( function( event ) { $postStatusSelect.find('.cancel-post-status').on( 'click', function( event ) {
$postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().focus(); $postStatusSelect.slideUp( 'fast' ).siblings( 'a.edit-post-status' ).show().trigger( 'focus' );
$('#post_status').val( $('#hidden_post_status').val() ); $('#post_status').val( $('#hidden_post_status').val() );
updateText(); updateText();
event.preventDefault(); event.preventDefault();
@ -997,7 +997,7 @@ jQuery(document).ready( function($) {
buttons.html( '<button type="button" class="save button button-small">' + __( 'OK' ) + '</button> <button type="button" class="cancel button-link">' + __( 'Cancel' ) + '</button>' ); buttons.html( '<button type="button" class="save button button-small">' + __( 'OK' ) + '</button> <button type="button" class="cancel button-link">' + __( 'Cancel' ) + '</button>' );
// Save permalink changes. // Save permalink changes.
buttons.children( '.save' ).click( function() { buttons.children( '.save' ).on( 'click', function() {
var new_slug = $el.children( 'input' ).val(); var new_slug = $el.children( 'input' ).val();
if ( new_slug == $('#editable-post-name-full').text() ) { if ( new_slug == $('#editable-post-name-full').text() ) {
@ -1026,20 +1026,20 @@ jQuery(document).ready( function($) {
buttons.html(buttonsOrig); buttons.html(buttonsOrig);
permalink.html(permalinkOrig); permalink.html(permalinkOrig);
real_slug.val(new_slug); real_slug.val(new_slug);
$( '.edit-slug' ).focus(); $( '.edit-slug' ).trigger( 'focus' );
wp.a11y.speak( __( 'Permalink saved' ) ); wp.a11y.speak( __( 'Permalink saved' ) );
} }
); );
}); });
// Cancel editing of permalink. // Cancel editing of permalink.
buttons.children( '.cancel' ).click( function() { buttons.children( '.cancel' ).on( 'click', function() {
$('#view-post-btn').show(); $('#view-post-btn').show();
$el.html(revert_e); $el.html(revert_e);
buttons.html(buttonsOrig); buttons.html(buttonsOrig);
permalink.html(permalinkOrig); permalink.html(permalinkOrig);
real_slug.val(revert_slug); real_slug.val(revert_slug);
$( '.edit-slug' ).focus(); $( '.edit-slug' ).trigger( 'focus' );
}); });
// If more than 1/4th of 'full' is '%', make it empty. // If more than 1/4th of 'full' is '%', make it empty.
@ -1049,7 +1049,7 @@ jQuery(document).ready( function($) {
} }
slug_value = ( c > full.length / 4 ) ? '' : full; slug_value = ( c > full.length / 4 ) ? '' : full;
$el.html( '<input type="text" id="new-post-slug" value="' + slug_value + '" autocomplete="off" />' ).children( 'input' ).keydown( function( e ) { $el.html( '<input type="text" id="new-post-slug" value="' + slug_value + '" autocomplete="off" />' ).children( 'input' ).on( 'keydown', function( e ) {
var key = e.which; var key = e.which;
// On [Enter], just save the new slug, don't save the post. // On [Enter], just save the new slug, don't save the post.
if ( 13 === key ) { if ( 13 === key ) {
@ -1060,9 +1060,9 @@ jQuery(document).ready( function($) {
if ( 27 === key ) { if ( 27 === key ) {
buttons.children( '.cancel' ).click(); buttons.children( '.cancel' ).click();
} }
} ).keyup( function() { } ).on( 'keyup', function() {
real_slug.val( this.value ); real_slug.val( this.value );
}).focus(); }).trigger( 'focus' );
} }
$( '#titlediv' ).on( 'click', '.edit-slug', function() { $( '#titlediv' ).on( 'click', '.edit-slug', function() {
@ -1154,7 +1154,7 @@ jQuery(document).ready( function($) {
height = parseInt( $('#content_ifr').css('height'), 10 ) + toolbarHeight - 28; height = parseInt( $('#content_ifr').css('height'), 10 ) + toolbarHeight - 28;
} else { } else {
$textarea.focus(); $textarea.trigger( 'focus' );
height = parseInt( $textarea.css('height'), 10 ); height = parseInt( $textarea.css('height'), 10 );
} }

File diff suppressed because one or more lines are too long

View File

@ -67,9 +67,9 @@
} }
if ( id ) { if ( id ) {
if ( !p.hasClass('closed') && $.isFunction( postboxes.pbshow ) ) { if ( !p.hasClass('closed') && typeof postboxes.pbshow === 'function' ) {
postboxes.pbshow( id ); postboxes.pbshow( id );
} else if ( p.hasClass('closed') && $.isFunction( postboxes.pbhide ) ) { } else if ( p.hasClass('closed') && typeof postboxes.pbhide === 'function' ) {
postboxes.pbhide( id ); postboxes.pbhide( id );
} }
} }
@ -267,7 +267,7 @@
/** /**
* @since 2.7.0 * @since 2.7.0
*/ */
$('.postbox .hndle a').click( function(e) { $('.postbox .hndle a').on( 'click', function(e) {
e.stopPropagation(); e.stopPropagation();
}); });
@ -302,19 +302,19 @@
* *
* @return {void} * @return {void}
*/ */
$('.hide-postbox-tog').bind('click.postboxes', function() { $('.hide-postbox-tog').on('click.postboxes', function() {
var $el = $(this), var $el = $(this),
boxId = $el.val(), boxId = $el.val(),
$postbox = $( '#' + boxId ); $postbox = $( '#' + boxId );
if ( $el.prop( 'checked' ) ) { if ( $el.prop( 'checked' ) ) {
$postbox.show(); $postbox.show();
if ( $.isFunction( postboxes.pbshow ) ) { if ( typeof postboxes.pbshow === 'function' ) {
postboxes.pbshow( boxId ); postboxes.pbshow( boxId );
} }
} else { } else {
$postbox.hide(); $postbox.hide();
if ( $.isFunction( postboxes.pbhide ) ) { if ( typeof postboxes.pbhide === 'function' ) {
postboxes.pbhide( boxId ); postboxes.pbhide( boxId );
} }
} }
@ -336,7 +336,7 @@
* *
* @return {void} * @return {void}
*/ */
$('.columns-prefs input[type="radio"]').bind('click.postboxes', function(){ $('.columns-prefs input[type="radio"]').on('click.postboxes', function(){
var n = parseInt($(this).val(), 10); var n = parseInt($(this).val(), 10);
if ( n ) { if ( n ) {
@ -420,7 +420,7 @@
}); });
if ( isMobile ) { if ( isMobile ) {
$(document.body).bind('orientationchange.postboxes', function(){ postboxes._pb_change(); }); $(document.body).on('orientationchange.postboxes', function(){ postboxes._pb_change(); });
this._pb_change(); this._pb_change();
} }

File diff suppressed because one or more lines are too long

View File

@ -56,7 +56,7 @@ jQuery( document ).ready( function( $ ) {
}); });
} }
$( '.export-personal-data-handle' ).click( function( event ) { $( '.export-personal-data-handle' ).on( 'click', function( event ) {
var $this = $( this ), var $this = $( this ),
$action = $this.parents( '.export-personal-data' ), $action = $this.parents( '.export-personal-data' ),
$requestRow = $this.parents( 'tr' ), $requestRow = $this.parents( 'tr' ),
@ -159,7 +159,7 @@ jQuery( document ).ready( function( $ ) {
doNextExport( 1, 1 ); doNextExport( 1, 1 );
}); });
$( '.remove-personal-data-handle' ).click( function( event ) { $( '.remove-personal-data-handle' ).on( 'click', function( event ) {
var $this = $( this ), var $this = $( this ),
$action = $this.parents( '.remove-personal-data' ), $action = $this.parents( '.remove-personal-data' ),
$requestRow = $this.parents( 'tr' ), $requestRow = $this.parents( 'tr' ),

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
jQuery(document).ready(function(h){var r,g=wp.i18n.__;function w(e,t){e.children().addClass("hidden"),e.children("."+t).removeClass("hidden")}function T(e){e.removeClass("has-request-results"),e.next().hasClass("request-results")&&e.next().remove()}function x(e,t,a,o){var s="",n="request-results";T(e),o.length&&(h.each(o,function(e,t){s=s+"<li>"+t+"</li>"}),s="<ul>"+s+"</ul>"),e.addClass("has-request-results"),e.hasClass("status-request-confirmed")&&(n+=" status-request-confirmed"),e.hasClass("status-request-failed")&&(n+=" status-request-failed"),e.after(function(){return'<tr class="'+n+'"><th colspan="5"><div class="notice inline notice-alt '+t+'"><p>'+a+"</p>"+s+"</div></td></tr>"})}h(".export-personal-data-handle").click(function(e){var t=h(this),n=t.parents(".export-personal-data"),r=t.parents("tr"),a=r.find(".export-progress"),i=t.parents(".row-actions"),d=n.data("request-id"),c=n.data("nonce"),u=n.data("exporters-count"),l=!!n.data("send-as-email");function p(e){var t=g("An error occurred while attempting to export personal data.");w(n,"export-personal-data-failed"),e&&x(r,"notice-error",t,[e]),setTimeout(function(){i.removeClass("processing")},500)}function m(e){e=0<u?e/u:0,e=Math.round(100*e).toString()+"%";a.html(e)}e.preventDefault(),e.stopPropagation(),i.addClass("processing"),n.blur(),T(r),m(0),w(n,"export-personal-data-processing"),function t(o,s){h.ajax({url:window.ajaxurl,data:{action:"wp-privacy-export-personal-data",exporter:o,id:d,page:s,security:c,sendAsEmail:l},method:"post"}).done(function(e){var a=e.data;e.success?a.done?(m(o),o<u?setTimeout(t(o+1,1)):setTimeout(function(){var e,t;e=a.url,t=g("This user&#8217;s personal data export link was sent."),void 0!==e&&(t=g("This user&#8217;s personal data export file was downloaded.")),w(n,"export-personal-data-success"),x(r,"notice-success",t,[]),void 0!==e?window.location=e:l||p(g("No personal data export file was generated.")),setTimeout(function(){i.removeClass("processing")},500)},500)):setTimeout(t(o,s+1)):setTimeout(function(){p(e.data)},500)}).fail(function(e,t,a){setTimeout(function(){p(a)},500)})}(1,1)}),h(".remove-personal-data-handle").click(function(e){var t=h(this),n=t.parents(".remove-personal-data"),r=t.parents("tr"),a=r.find(".erasure-progress"),i=t.parents(".row-actions"),d=n.data("request-id"),c=n.data("nonce"),u=n.data("erasers-count"),l=!1,p=!1,m=[];function f(){var e=g("An error occurred while attempting to find and erase personal data.");w(n,"remove-personal-data-failed"),x(r,"notice-error",e,[]),setTimeout(function(){i.removeClass("processing")},500)}function v(e){e=0<u?e/u:0,e=Math.round(100*e).toString()+"%";a.html(e)}e.preventDefault(),e.stopPropagation(),i.addClass("processing"),n.blur(),T(r),v(0),w(n,"remove-personal-data-processing"),function a(o,s){h.ajax({url:window.ajaxurl,data:{action:"wp-privacy-erase-personal-data",eraser:o,id:d,page:s,security:c},method:"post"}).done(function(e){var t=e.data;e.success?(t.items_removed&&(l=l||t.items_removed),t.items_retained&&(p=p||t.items_retained),t.messages&&(m=m.concat(t.messages)),t.done?(v(o),o<u?setTimeout(a(o+1,1)):setTimeout(function(){var e,t;e=g("No personal data was found for this user."),t="notice-success",w(n,"remove-personal-data-success"),!1===l?!1===p?e=g("No personal data was found for this user."):(e=g("Personal data was found for this user but was not erased."),t="notice-warning"):!1===p?e=g("All of the personal data found for this user was erased."):(e=g("Personal data was found for this user but some of the personal data found was not erased."),t="notice-warning"),x(r,t,e,m),setTimeout(function(){i.removeClass("processing")},500)},500)):setTimeout(a(o,s+1))):setTimeout(function(){f()},500)}).fail(function(){setTimeout(function(){f()},500)})}(1,1)}),h(document).on("click",function(e){var t,a,e=h(e.target),o=e.siblings(".success");if(clearTimeout(r),e.is("button.privacy-text-copy")&&(t=!(t=(e=e.parent().parent()).find("div.wp-suggested-text")).length?e.find("div.policy-text"):t).length)try{var s=document.documentElement.scrollTop,n=document.body.scrollTop;window.getSelection().removeAllRanges(),a=document.createRange(),t.addClass("hide-privacy-policy-tutorial"),a.selectNodeContents(t[0]),window.getSelection().addRange(a),document.execCommand("copy"),t.removeClass("hide-privacy-policy-tutorial"),window.getSelection().removeAllRanges(),0<s&&s!==document.documentElement.scrollTop?document.documentElement.scrollTop=s:0<n&&n!==document.body.scrollTop&&(document.body.scrollTop=n),o.addClass("visible"),wp.a11y.speak(g("The section has been copied to your clipboard.")),r=setTimeout(function(){o.removeClass("visible")},3e3)}catch(e){}})}); jQuery(document).ready(function(h){var r,g=wp.i18n.__;function w(e,t){e.children().addClass("hidden"),e.children("."+t).removeClass("hidden")}function T(e){e.removeClass("has-request-results"),e.next().hasClass("request-results")&&e.next().remove()}function x(e,t,o,a){var s="",n="request-results";T(e),a.length&&(h.each(a,function(e,t){s=s+"<li>"+t+"</li>"}),s="<ul>"+s+"</ul>"),e.addClass("has-request-results"),e.hasClass("status-request-confirmed")&&(n+=" status-request-confirmed"),e.hasClass("status-request-failed")&&(n+=" status-request-failed"),e.after(function(){return'<tr class="'+n+'"><th colspan="5"><div class="notice inline notice-alt '+t+'"><p>'+o+"</p>"+s+"</div></td></tr>"})}h(".export-personal-data-handle").on("click",function(e){var t=h(this),n=t.parents(".export-personal-data"),r=t.parents("tr"),o=r.find(".export-progress"),i=t.parents(".row-actions"),d=n.data("request-id"),c=n.data("nonce"),u=n.data("exporters-count"),l=!!n.data("send-as-email");function p(e){var t=g("An error occurred while attempting to export personal data.");w(n,"export-personal-data-failed"),e&&x(r,"notice-error",t,[e]),setTimeout(function(){i.removeClass("processing")},500)}function m(e){e=0<u?e/u:0,e=Math.round(100*e).toString()+"%";o.html(e)}e.preventDefault(),e.stopPropagation(),i.addClass("processing"),n.blur(),T(r),m(0),w(n,"export-personal-data-processing"),function t(a,s){h.ajax({url:window.ajaxurl,data:{action:"wp-privacy-export-personal-data",exporter:a,id:d,page:s,security:c,sendAsEmail:l},method:"post"}).done(function(e){var o=e.data;e.success?o.done?(m(a),a<u?setTimeout(t(a+1,1)):setTimeout(function(){var e,t;e=o.url,t=g("This user&#8217;s personal data export link was sent."),void 0!==e&&(t=g("This user&#8217;s personal data export file was downloaded.")),w(n,"export-personal-data-success"),x(r,"notice-success",t,[]),void 0!==e?window.location=e:l||p(g("No personal data export file was generated.")),setTimeout(function(){i.removeClass("processing")},500)},500)):setTimeout(t(a,s+1)):setTimeout(function(){p(e.data)},500)}).fail(function(e,t,o){setTimeout(function(){p(o)},500)})}(1,1)}),h(".remove-personal-data-handle").on("click",function(e){var t=h(this),n=t.parents(".remove-personal-data"),r=t.parents("tr"),o=r.find(".erasure-progress"),i=t.parents(".row-actions"),d=n.data("request-id"),c=n.data("nonce"),u=n.data("erasers-count"),l=!1,p=!1,m=[];function f(){var e=g("An error occurred while attempting to find and erase personal data.");w(n,"remove-personal-data-failed"),x(r,"notice-error",e,[]),setTimeout(function(){i.removeClass("processing")},500)}function v(e){e=0<u?e/u:0,e=Math.round(100*e).toString()+"%";o.html(e)}e.preventDefault(),e.stopPropagation(),i.addClass("processing"),n.blur(),T(r),v(0),w(n,"remove-personal-data-processing"),function o(a,s){h.ajax({url:window.ajaxurl,data:{action:"wp-privacy-erase-personal-data",eraser:a,id:d,page:s,security:c},method:"post"}).done(function(e){var t=e.data;e.success?(t.items_removed&&(l=l||t.items_removed),t.items_retained&&(p=p||t.items_retained),t.messages&&(m=m.concat(t.messages)),t.done?(v(a),a<u?setTimeout(o(a+1,1)):setTimeout(function(){var e,t;e=g("No personal data was found for this user."),t="notice-success",w(n,"remove-personal-data-success"),!1===l?!1===p?e=g("No personal data was found for this user."):(e=g("Personal data was found for this user but was not erased."),t="notice-warning"):!1===p?e=g("All of the personal data found for this user was erased."):(e=g("Personal data was found for this user but some of the personal data found was not erased."),t="notice-warning"),x(r,t,e,m),setTimeout(function(){i.removeClass("processing")},500)},500)):setTimeout(o(a,s+1))):setTimeout(function(){f()},500)}).fail(function(){setTimeout(function(){f()},500)})}(1,1)}),h(document).on("click",function(e){var t,o,e=h(e.target),a=e.siblings(".success");if(clearTimeout(r),e.is("button.privacy-text-copy")&&(t=!(t=(e=e.parent().parent()).find("div.wp-suggested-text")).length?e.find("div.policy-text"):t).length)try{var s=document.documentElement.scrollTop,n=document.body.scrollTop;window.getSelection().removeAllRanges(),o=document.createRange(),t.addClass("hide-privacy-policy-tutorial"),o.selectNodeContents(t[0]),window.getSelection().addRange(o),document.execCommand("copy"),t.removeClass("hide-privacy-policy-tutorial"),window.getSelection().removeAllRanges(),0<s&&s!==document.documentElement.scrollTop?document.documentElement.scrollTop=s:0<n&&n!==document.body.scrollTop&&(document.body.scrollTop=n),a.addClass("visible"),wp.a11y.speak(g("The section has been copied to your clipboard.")),r=setTimeout(function(){a.removeClass("visible")},3e3)}catch(e){}})});

View File

@ -205,7 +205,7 @@ jQuery( document ).ready( function( $ ) {
val = 100; val = 100;
} }
pct = ( ( 100 - val ) / 100 ) * c; pct = ( ( 100 - val ) / 100 ) * c + 'px';
$circle.css( { strokeDashoffset: pct } ); $circle.css( { strokeDashoffset: pct } );

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@ jQuery(document).ready(function($) {
* *
* @return {boolean} Always returns false to cancel the default event handling. * @return {boolean} Always returns false to cancel the default event handling.
*/ */
$('#submit').click(function(){ $('#submit').on( 'click', function(){
var form = $(this).parents('form'); var form = $(this).parents('form');
if ( ! validateForm( form ) ) if ( ! validateForm( form ) )

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
jQuery(document).ready(function(r){var o=!1;r("#the-list").on("click",".delete-tag",function(){var t,e=r(this),n=e.parents("tr"),a=!0;return(a="undefined"!=showNotice?showNotice.warn():a)&&(t=e.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag"),r.post(ajaxurl,t,function(e){"1"==e?(r("#ajax-response").empty(),n.fadeOut("normal",function(){n.remove()}),r('select#parent option[value="'+t.match(/tag_ID=(\d+)/)[1]+'"]').remove(),r("a.tag-link-"+t.match(/tag_ID=(\d+)/)[1]).remove()):("-1"==e?r("#ajax-response").empty().append('<div class="error"><p>'+wp.i18n.__("Sorry, you are not allowed to do that.")+"</p></div>"):r("#ajax-response").empty().append('<div class="error"><p>'+wp.i18n.__("Something went wrong.")+"</p></div>"),n.children().css("backgroundColor",""))}),n.children().css("backgroundColor","#f33")),!1}),r("#edittag").on("click",".delete",function(e){return"undefined"==typeof showNotice||void(showNotice.warn()||e.preventDefault())}),r("#submit").click(function(){var s=r(this).parents("form");return validateForm(s)&&(o||(o=!0,s.find(".submit .spinner").addClass("is-active"),r.post(ajaxurl,r("#addtag").serialize(),function(e){var t,n,a;if(o=!1,s.find(".submit .spinner").removeClass("is-active"),r("#ajax-response").empty(),(t=wpAjax.parseAjaxResponse(e,"ajax-response"))&&!t.errors){if(0<(e=s.find("select#parent").val())&&0<r("#tag-"+e).length?r(".tags #tag-"+e).after(t.responses[0].supplemental.noparents):r(".tags").prepend(t.responses[0].supplemental.parents),r(".tags .no-items").remove(),s.find("select#parent")){for(e=t.responses[1].supplemental,n="",a=0;a<t.responses[1].position;a++)n+="&nbsp;&nbsp;&nbsp;";s.find("select#parent option:selected").after('<option value="'+e.term_id+'">'+n+e.name+"</option>")}r('input[type="text"]:visible, textarea:visible',s).val("")}}))),!1})}); jQuery(document).ready(function(r){var o=!1;r("#the-list").on("click",".delete-tag",function(){var t,e=r(this),n=e.parents("tr"),a=!0;return(a="undefined"!=showNotice?showNotice.warn():a)&&(t=e.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag"),r.post(ajaxurl,t,function(e){"1"==e?(r("#ajax-response").empty(),n.fadeOut("normal",function(){n.remove()}),r('select#parent option[value="'+t.match(/tag_ID=(\d+)/)[1]+'"]').remove(),r("a.tag-link-"+t.match(/tag_ID=(\d+)/)[1]).remove()):("-1"==e?r("#ajax-response").empty().append('<div class="error"><p>'+wp.i18n.__("Sorry, you are not allowed to do that.")+"</p></div>"):r("#ajax-response").empty().append('<div class="error"><p>'+wp.i18n.__("Something went wrong.")+"</p></div>"),n.children().css("backgroundColor",""))}),n.children().css("backgroundColor","#f33")),!1}),r("#edittag").on("click",".delete",function(e){return"undefined"==typeof showNotice||void(showNotice.warn()||e.preventDefault())}),r("#submit").on("click",function(){var s=r(this).parents("form");return validateForm(s)&&(o||(o=!0,s.find(".submit .spinner").addClass("is-active"),r.post(ajaxurl,r("#addtag").serialize(),function(e){var t,n,a;if(o=!1,s.find(".submit .spinner").removeClass("is-active"),r("#ajax-response").empty(),(t=wpAjax.parseAjaxResponse(e,"ajax-response"))&&!t.errors){if(0<(e=s.find("select#parent").val())&&0<r("#tag-"+e).length?r(".tags #tag-"+e).after(t.responses[0].supplemental.noparents):r(".tags").prepend(t.responses[0].supplemental.parents),r(".tags .no-items").remove(),s.find("select#parent")){for(e=t.responses[1].supplemental,n="",a=0;a<t.responses[1].position;a++)n+="&nbsp;&nbsp;&nbsp;";s.find("select#parent option:selected").after('<option value="'+e.term_id+'">'+n+e.name+"</option>")}r('input[type="text"]:visible, textarea:visible',s).val("")}}))),!1})});

View File

@ -101,7 +101,7 @@ wp.themePluginEditor = (function( $ ) {
// Reveal the modal and set focus on the go back button. // Reveal the modal and set focus on the go back button.
component.warning component.warning
.removeClass( 'hidden' ) .removeClass( 'hidden' )
.find( '.file-editor-warning-go-back' ).focus(); .find( '.file-editor-warning-go-back' ).trigger( 'focus' );
// Get the links and buttons within the modal. // Get the links and buttons within the modal.
component.warningTabbables = component.warning.find( 'a, button' ); component.warningTabbables = component.warning.find( 'a, button' );
// Attach event handlers. // Attach event handlers.

File diff suppressed because one or more lines are too long

View File

@ -73,7 +73,7 @@ themes.view.Appearance = wp.Backbone.View.extend({
this.SearchView = options.SearchView ? options.SearchView : themes.view.Search; this.SearchView = options.SearchView ? options.SearchView : themes.view.Search;
// Bind to the scroll event and throttle // Bind to the scroll event and throttle
// the results from this.scroller. // the results from this.scroller.
this.window.bind( 'scroll', _.throttle( this.scroller, 300 ) ); this.window.on( 'scroll', _.throttle( this.scroller, 300 ) );
}, },
// Main render control. // Main render control.
@ -550,7 +550,7 @@ themes.view.Theme = wp.Backbone.View.extend({
// Render and append. // Render and append.
preview.render(); preview.render();
this.setNavButtonsState(); this.setNavButtonsState();
$( '.next-theme' ).focus(); $( '.next-theme' ).trigger( 'focus' );
}) })
.listenTo( preview, 'theme:previous', function() { .listenTo( preview, 'theme:previous', function() {
@ -580,7 +580,7 @@ themes.view.Theme = wp.Backbone.View.extend({
// Render and append. // Render and append.
preview.render(); preview.render();
this.setNavButtonsState(); this.setNavButtonsState();
$( '.previous-theme' ).focus(); $( '.previous-theme' ).trigger( 'focus' );
}); });
this.listenTo( preview, 'preview:close', function() { this.listenTo( preview, 'preview:close', function() {
@ -602,7 +602,7 @@ themes.view.Theme = wp.Backbone.View.extend({
.addClass( 'disabled' ) .addClass( 'disabled' )
.prop( 'disabled', true ); .prop( 'disabled', true );
nextThemeButton.focus(); nextThemeButton.trigger( 'focus' );
} }
// Disable next if the next model is undefined. // Disable next if the next model is undefined.
@ -611,7 +611,7 @@ themes.view.Theme = wp.Backbone.View.extend({
.addClass( 'disabled' ) .addClass( 'disabled' )
.prop( 'disabled', true ); .prop( 'disabled', true );
previousThemeButton.focus(); previousThemeButton.trigger( 'focus' );
} }
}, },
@ -705,7 +705,7 @@ themes.view.Details = wp.Backbone.View.extend({
// Set initial focus on the primary action control. // Set initial focus on the primary action control.
_.delay( function() { _.delay( function() {
$( '.theme-overlay' ).focus(); $( '.theme-overlay' ).trigger( 'focus' );
}, 100 ); }, 100 );
// Constrain tabbing within the modal. // Constrain tabbing within the modal.
@ -716,10 +716,10 @@ themes.view.Details = wp.Backbone.View.extend({
// Check for the Tab key. // Check for the Tab key.
if ( 9 === event.which ) { if ( 9 === event.which ) {
if ( $firstFocusable[0] === event.target && event.shiftKey ) { if ( $firstFocusable[0] === event.target && event.shiftKey ) {
$lastFocusable.focus(); $lastFocusable.trigger( 'focus' );
event.preventDefault(); event.preventDefault();
} else if ( $lastFocusable[0] === event.target && ! event.shiftKey ) { } else if ( $lastFocusable[0] === event.target && ! event.shiftKey ) {
$firstFocusable.focus(); $firstFocusable.trigger( 'focus' );
event.preventDefault(); event.preventDefault();
} }
} }
@ -764,7 +764,7 @@ themes.view.Details = wp.Backbone.View.extend({
// Return focus to the theme div. // Return focus to the theme div.
if ( themes.focusedTheme ) { if ( themes.focusedTheme ) {
themes.focusedTheme.focus(); themes.focusedTheme.trigger( 'focus' );
} }
}); });
} }
@ -952,7 +952,7 @@ themes.view.Preview = themes.view.Details.extend({
// Return focus to the theme div. // Return focus to the theme div.
if ( themes.focusedTheme ) { if ( themes.focusedTheme ) {
themes.focusedTheme.focus(); themes.focusedTheme.trigger( 'focus' );
} }
}).removeClass( 'iframe-ready' ); }).removeClass( 'iframe-ready' );
@ -2049,7 +2049,7 @@ themes.RunInstaller = {
// The `search` route event. The router populates the input field. // The `search` route event. The router populates the input field.
themes.router.on( 'route:search', function() { themes.router.on( 'route:search', function() {
$( '.wp-filter-search' ).focus().trigger( 'keyup' ); $( '.wp-filter-search' ).trigger( 'focus' ).trigger( 'keyup' );
}); });
this.extraRoutes(); this.extraRoutes();
@ -2101,7 +2101,7 @@ jQuery(document).ready( function($) {
adminbar_height = parseInt( $('#wpadminbar').css('height'), 10 ); adminbar_height = parseInt( $('#wpadminbar').css('height'), 10 );
} }
if ( tbWindow.size() ) { if ( tbWindow.length >= 1 ) {
tbWindow.width( W - 50 ).height( H - 45 - adminbar_height ); tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
$('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height ); $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
tbWindow.css({'margin-left': '-' + parseInt( ( ( W - 50 ) / 2 ), 10 ) + 'px'}); tbWindow.css({'margin-left': '-' + parseInt( ( ( W - 50 ) / 2 ), 10 ) + 'px'});
@ -2111,5 +2111,5 @@ jQuery(document).ready( function($) {
} }
}; };
$(window).resize(function(){ tb_position(); }); $(window).on( 'resize', function(){ tb_position(); });
}); });

File diff suppressed because one or more lines are too long

View File

@ -1552,7 +1552,7 @@
if ( -1 !== _.indexOf( themes.disabled, response.slug ) ) { if ( -1 !== _.indexOf( themes.disabled, response.slug ) ) {
themes.disabled = _.without( themes.disabled, response.slug ); themes.disabled = _.without( themes.disabled, response.slug );
if ( themes.disabled.length ) { if ( themes.disabled.length ) {
$views.find( '.disabled .count' ).text( '(' + themes.disabled.length + ')' ); $views.find( '.disabled .count' ).text( '(' + themes.disabled.length + ')' );
} else { } else {
$views.find( '.disabled' ).remove(); $views.find( '.disabled' ).remove();
} }
@ -1566,7 +1566,7 @@
$views.find( '.auto-update-enabled' ).remove(); $views.find( '.auto-update-enabled' ).remove();
} }
} }
if ( -1 !== _.indexOf( themes['auto-update-disabled'], response.slug ) ) { if ( -1 !== _.indexOf( themes['auto-update-disabled'], response.slug ) ) {
themes['auto-update-disabled'] = _.without( themes['auto-update-disabled'], response.slug ); themes['auto-update-disabled'] = _.without( themes['auto-update-disabled'], response.slug );
if ( themes['auto-update-disabled'].length ) { if ( themes['auto-update-disabled'].length ) {
@ -2045,7 +2045,7 @@
*/ */
$filesystemForm.on( 'change', 'input[name="connection_type"]', function() { $filesystemForm.on( 'change', 'input[name="connection_type"]', function() {
$( '#ssh-keys' ).toggleClass( 'hidden', ( 'ssh' !== $( this ).val() ) ); $( '#ssh-keys' ).toggleClass( 'hidden', ( 'ssh' !== $( this ).val() ) );
} ).change(); } ).trigger( 'change' );
/** /**
* Handles events after the credential modal was closed. * Handles events after the credential modal was closed.
@ -2765,7 +2765,7 @@
} }
try { try {
message = $.parseJSON( originalEvent.data ); message = JSON.parse( originalEvent.data );
} catch ( e ) { } catch ( e ) {
return; return;
} }

File diff suppressed because one or more lines are too long

View File

@ -108,7 +108,7 @@
$weakRow = $( '.pw-weak' ); $weakRow = $( '.pw-weak' );
$weakCheckbox = $weakRow.find( '.pw-checkbox' ); $weakCheckbox = $weakRow.find( '.pw-checkbox' );
$weakCheckbox.change( function() { $weakCheckbox.on( 'change', function() {
$submitButtons.prop( 'disabled', ! $weakCheckbox.prop( 'checked' ) ); $submitButtons.prop( 'disabled', ! $weakCheckbox.prop( 'checked' ) );
} ); } );
@ -265,12 +265,12 @@
$( '#pass1' ).val( '' ).on( 'input' + ' pwupdate', check_pass_strength ); $( '#pass1' ).val( '' ).on( 'input' + ' pwupdate', check_pass_strength );
$('#pass-strength-result').show(); $('#pass-strength-result').show();
$('.color-palette').click( function() { $('.color-palette').on( 'click', function() {
$(this).siblings('input[name="admin_color"]').prop('checked', true); $(this).siblings('input[name="admin_color"]').prop('checked', true);
}); });
if ( select.length ) { if ( select.length ) {
$('#first_name, #last_name, #nickname').bind( 'blur.user_profile', function() { $('#first_name, #last_name, #nickname').on( 'blur.user_profile', function() {
var dub = [], var dub = [],
inputs = { inputs = {
display_nickname : $('#nickname').val() || '', display_nickname : $('#nickname').val() || '',

File diff suppressed because one or more lines are too long

View File

@ -36,7 +36,7 @@ window.wpWidgets = {
* Toggle the widgets containers when clicked and update the toggle * Toggle the widgets containers when clicked and update the toggle
* button `aria-expanded` attribute value. * button `aria-expanded` attribute value.
*/ */
.click( function() { .on( 'click', function() {
var $this = $( this ), var $this = $( this ),
$wrap = $this.closest( '.widgets-holder-wrap '), $wrap = $this.closest( '.widgets-holder-wrap '),
$toggle = $this.find( '.handlediv' ); $toggle = $this.find( '.handlediv' );
@ -101,7 +101,7 @@ window.wpWidgets = {
}); });
// Handle the widgets containers in the left column. // Handle the widgets containers in the left column.
$( '#widgets-left .sidebar-name' ).click( function() { $( '#widgets-left .sidebar-name' ).on( 'click', function() {
var $wrap = $( this ).closest( '.widgets-holder-wrap' ); var $wrap = $( this ).closest( '.widgets-holder-wrap' );
$wrap $wrap
@ -112,7 +112,7 @@ window.wpWidgets = {
$document.triggerHandler( 'wp-pin-menu' ); $document.triggerHandler( 'wp-pin-menu' );
}); });
$(document.body).bind('click.widgets-toggle', function(e) { $(document.body).on('click.widgets-toggle', function(e) {
var target = $(e.target), css = {}, var target = $(e.target), css = {},
widget, inside, targetWidth, widgetWidth, margin, saveButton, widgetId, widget, inside, targetWidth, widgetWidth, margin, saveButton, widgetId,
toggleBtn = target.closest( '.widget' ).find( '.widget-top button.widget-action' ); toggleBtn = target.closest( '.widget' ).find( '.widget-top button.widget-action' );
@ -419,7 +419,7 @@ window.wpWidgets = {
// Area Chooser. // Area Chooser.
$( '#widgets-right .widgets-holder-wrap' ).each( function( index, element ) { $( '#widgets-right .widgets-holder-wrap' ).each( function( index, element ) {
var $element = $( element ), var $element = $( element ),
name = $element.find( '.sidebar-name h2' ).text(), name = $element.find( '.sidebar-name h2' ).text() || '',
ariaLabel = $element.find( '.sidebar-name' ).data( 'add-to' ), ariaLabel = $element.find( '.sidebar-name' ).data( 'add-to' ),
id = $element.find( '.widgets-sortables' ).attr( 'id' ), id = $element.find( '.widgets-sortables' ).attr( 'id' ),
li = $( '<li>' ), li = $( '<li>' ),
@ -428,7 +428,7 @@ window.wpWidgets = {
'aria-pressed': 'false', 'aria-pressed': 'false',
'class': 'widgets-chooser-button', 'class': 'widgets-chooser-button',
'aria-label': ariaLabel 'aria-label': ariaLabel
} ).text( $.trim( name ) ); } ).text( name.toString().trim() );
li.append( button ); li.append( button );

File diff suppressed because one or more lines are too long

View File

@ -446,9 +446,15 @@ wp.customHtmlWidgets = ( function( $ ) {
}); });
// Accessibility mode. // Accessibility mode.
$( window ).on( 'load', function() { if ( document.readyState === 'complete' ) {
// Page is fully loaded.
component.setupAccessibleMode(); component.setupAccessibleMode();
}); } else {
// Page is still loading.
$( window ).on( 'load', function() {
component.setupAccessibleMode();
});
}
}); });
}; };

File diff suppressed because one or more lines are too long

View File

@ -1320,9 +1320,15 @@ wp.mediaWidgets = ( function( $ ) {
}); });
// Accessibility mode. // Accessibility mode.
$( window ).on( 'load', function() { if ( document.readyState === 'complete' ) {
// Page is fully loaded.
component.setupAccessibleMode(); component.setupAccessibleMode();
}); } else {
// Page is still loading.
$( window ).on( 'load', function() {
component.setupAccessibleMode();
});
}
}); });
}; };

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
(function($) { (function($) {
$(document).ready( function() { $(document).ready( function() {
$('.feature-slider a').click(function(e) { $('.feature-slider a').on( 'click', function(e) {
$('.featured-posts section.featured-post').css({ $('.featured-posts section.featured-post').css({
opacity: 0, opacity: 0,
visibility: 'hidden' visibility: 'hidden'
@ -14,4 +14,4 @@
e.preventDefault(); e.preventDefault();
}); });
}); });
})(jQuery); })(jQuery);

View File

@ -17,7 +17,7 @@
container.find( '.current-menu-ancestor > button' ).addClass( 'toggle-on' ); container.find( '.current-menu-ancestor > button' ).addClass( 'toggle-on' );
container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' ); container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' );
container.find( '.dropdown-toggle' ).click( function( e ) { container.find( '.dropdown-toggle' ).on( 'click', function( e ) {
var _this = $( this ); var _this = $( this );
e.preventDefault(); e.preventDefault();
_this.toggleClass( 'toggle-on' ); _this.toggleClass( 'toggle-on' );

View File

@ -147,12 +147,12 @@
onResizeARIA(); onResizeARIA();
} ); } );
_window.load( function() { _window.on( 'load', function() {
var footerSidebar, var footerSidebar,
isCustomizeSelectiveRefresh = ( 'undefined' !== typeof wp && wp.customize && wp.customize.selectiveRefresh ); isCustomizeSelectiveRefresh = ( 'undefined' !== typeof wp && wp.customize && wp.customize.selectiveRefresh );
// Arrange footer widgets vertically. // Arrange footer widgets vertically.
if ( $.isFunction( $.fn.masonry ) ) { if ( typeof $.fn.masonry === 'function' ) {
footerSidebar = $( '#footer-sidebar' ); footerSidebar = $( '#footer-sidebar' );
footerSidebar.masonry( { footerSidebar.masonry( {
itemSelector: '.widget', itemSelector: '.widget',

View File

@ -26,7 +26,7 @@
resizeTimer; resizeTimer;
// Ensure the sticky navigation doesn't cover current focused links. // Ensure the sticky navigation doesn't cover current focused links.
$( 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]', '.site-content-contain' ).filter( ':visible' ).focus( function() { $( 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]', '.site-content-contain' ).filter( ':visible' ).on( 'focus', function() {
if ( $navigation.hasClass( 'site-navigation-fixed' ) ) { if ( $navigation.hasClass( 'site-navigation-fixed' ) ) {
var windowScrollTop = $( window ).scrollTop(), var windowScrollTop = $( window ).scrollTop(),
fixedNavHeight = $navigation.height(), fixedNavHeight = $navigation.height(),
@ -197,7 +197,7 @@
navigationOuterHeight = 0; navigationOuterHeight = 0;
} }
$menuScrollDown.click( function( e ) { $menuScrollDown.on( 'click', function( e ) {
e.preventDefault(); e.preventDefault();
$( window ).scrollTo( '#primary', { $( window ).scrollTo( '#primary', {
duration: 600, duration: 600,
@ -228,13 +228,13 @@
}); });
// Also want to make sure the navigation is where it should be on resize. // Also want to make sure the navigation is where it should be on resize.
$( window ).resize( function() { $( window ).on( 'resize', function() {
setNavProps(); setNavProps();
setTimeout( adjustScrollClass, 500 ); setTimeout( adjustScrollClass, 500 );
}); });
} }
$( window ).resize( function() { $( window ).on( 'resize', function() {
clearTimeout( resizeTimer ); clearTimeout( resizeTimer );
resizeTimer = setTimeout( function() { resizeTimer = setTimeout( function() {
belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' );

View File

@ -26,7 +26,7 @@
// Set the active submenu initial state. // Set the active submenu initial state.
container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' ); container.find( '.current-menu-ancestor > .sub-menu' ).addClass( 'toggled-on' );
container.find( '.dropdown-toggle' ).click( function( e ) { container.find( '.dropdown-toggle' ).on( 'click', function( e ) {
var _this = $( this ), var _this = $( this ),
screenReaderSpan = _this.find( '.screen-reader-text' ); screenReaderSpan = _this.find( '.screen-reader-text' );

View File

@ -28,7 +28,7 @@
// Add menu items with submenus to aria-haspopup="true". // Add menu items with submenus to aria-haspopup="true".
container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' ); container.find( '.menu-item-has-children' ).attr( 'aria-haspopup', 'true' );
container.find( '.dropdown-toggle' ).click( function( e ) { container.find( '.dropdown-toggle' ).on( 'click', function( e ) {
var _this = $( this ), var _this = $( this ),
screenReaderSpan = _this.find( '.screen-reader-text' ); screenReaderSpan = _this.find( '.screen-reader-text' );

View File

@ -123,7 +123,7 @@
*/ */
$( function() { $( function() {
var columnWidth, widgetArea; var columnWidth, widgetArea;
if ( ! $.isFunction( $.fn.masonry ) ) { if ( typeof $.fn.masonry !== 'function' ) {
return; return;
} }
columnWidth = body.is( '.sidebar' ) ? 228 : 245; columnWidth = body.is( '.sidebar' ) ? 228 : 245;
@ -164,4 +164,4 @@
} ); } );
} }
} ); } );
} )( jQuery ); } )( jQuery );

View File

@ -501,7 +501,7 @@ window.wp = window.wp || {};
dfd = $.Deferred(); dfd = $.Deferred();
// If the last argument is a callback, bind it to .done(). // If the last argument is a callback, bind it to .done().
if ( $.isFunction( ids[ ids.length - 1 ] ) ) { if ( typeof ids[ ids.length - 1 ] === 'function' ) {
dfd.done( ids.pop() ); dfd.done( ids.pop() );
} }
@ -609,7 +609,7 @@ window.wp = window.wp || {};
}; };
this.bind( this.update ); this.bind( this.update );
this.element.bind( this.events, this.refresh ); this.element.on( this.events, this.refresh );
}, },
find: function( selector ) { find: function( selector ) {

File diff suppressed because one or more lines are too long

View File

@ -712,7 +712,7 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
// Remove the keydown event. // Remove the keydown event.
$( 'body' ).off( 'keydown.media-modal' ); $( 'body' ).off( 'keydown.media-modal' );
// Move focus back to the original item in the grid if possible. // Move focus back to the original item in the grid if possible.
$( 'li.attachment[data-id="' + this.model.get( 'id' ) +'"]' ).focus(); $( 'li.attachment[data-id="' + this.model.get( 'id' ) +'"]' ).trigger( 'focus' );
this.resetRoute(); this.resetRoute();
}, this ) ); }, this ) );
@ -850,7 +850,7 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
* @param {string} which A CSS selector to target the button to focus. * @param {string} which A CSS selector to target the button to focus.
*/ */
focusNavButton: function( which ) { focusNavButton: function( which ) {
$( which ).focus(); $( which ).trigger( 'focus' );
}, },
getCurrentIndex: function() { getCurrentIndex: function() {

File diff suppressed because one or more lines are too long

View File

@ -4515,7 +4515,7 @@ Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{
} }
// Set initial focus on the content instead of this view element, to avoid page scrolling. // Set initial focus on the content instead of this view element, to avoid page scrolling.
this.$( '.media-modal' ).focus(); this.$( '.media-modal' ).trigger( 'focus' );
// Hide the page content from assistive technologies. // Hide the page content from assistive technologies.
this.focusManager.setAriaHiddenOnBodyChildren( $el ); this.focusManager.setAriaHiddenOnBodyChildren( $el );
@ -4536,7 +4536,7 @@ Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{
$( 'body' ).removeClass( 'modal-open' ); $( 'body' ).removeClass( 'modal-open' );
// Hide modal and remove restricted media modal tab focus once it's closed. // Hide modal and remove restricted media modal tab focus once it's closed.
this.$el.hide().undelegate( 'keydown' ); this.$el.hide().off( 'keydown' );
/* /*
* Make visible again to assistive technologies all body children that * Make visible again to assistive technologies all body children that
@ -4692,7 +4692,7 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr
* @return {void} * @return {void}
*/ */
focus: function() { focus: function() {
this.$( '.media-modal' ).focus(); this.$( '.media-modal' ).trigger( 'focus' );
}, },
/** /**

File diff suppressed because one or more lines are too long

View File

@ -70,7 +70,7 @@ window.wp = window.wp || {};
// Proxy all methods so this always refers to the current instance. // Proxy all methods so this always refers to the current instance.
for ( key in this ) { for ( key in this ) {
if ( $.isFunction( this[ key ] ) ) { if ( typeof this[ key ] === 'function' ) {
this[ key ] = $.proxy( this[ key ], this ); this[ key ] = $.proxy( this[ key ], this );
} }
} }
@ -284,7 +284,7 @@ window.wp = window.wp || {};
} }
// 'dragenter' doesn't fire correctly, simulate it with a limited 'dragover'. // 'dragenter' doesn't fire correctly, simulate it with a limited 'dragover'.
dropzone.bind( 'dragover.wp-uploader', function() { dropzone.on( 'dragover.wp-uploader', function() {
if ( timer ) { if ( timer ) {
clearTimeout( timer ); clearTimeout( timer );
} }
@ -297,7 +297,7 @@ window.wp = window.wp || {};
active = true; active = true;
}); });
dropzone.bind('dragleave.wp-uploader, drop.wp-uploader', function() { dropzone.on('dragleave.wp-uploader, drop.wp-uploader', function() {
/* /*
* Using an instant timer prevents the drag-over class * Using an instant timer prevents the drag-over class
* from being quickly removed and re-added when elements * from being quickly removed and re-added when elements
@ -440,7 +440,7 @@ window.wp = window.wp || {};
if ( pluploadError.code === plupload[ key ] ) { if ( pluploadError.code === plupload[ key ] ) {
message = Uploader.errorMap[ key ]; message = Uploader.errorMap[ key ];
if ( _.isFunction( message ) ) { if ( typeof message === 'function' ) {
message = message( pluploadError.file, pluploadError ); message = message( pluploadError.file, pluploadError );
} }

File diff suppressed because one or more lines are too long

View File

@ -66,5 +66,5 @@ window.wpAjax = jQuery.extend( {
// Basic form validation. // Basic form validation.
jQuery(document).ready( function($){ jQuery(document).ready( function($){
$('form.validate').submit( function() { return wpAjax.validateForm( $(this) ); } ); $('form.validate').on( 'submit', function() { return wpAjax.validateForm( $(this) ); } );
}); });

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */ /*! This file is auto-generated */
window.wpAjax=jQuery.extend({unserialize:function(e){var r,t,i,n,a={};if(!e)return a;for(i in t=(e=(r=e.split("?"))[1]?r[1]:e).split("&"))jQuery.isFunction(t.hasOwnProperty)&&!t.hasOwnProperty(i)||(a[(n=t[i].split("="))[0]]=n[1]);return a},parseAjaxResponse:function(n,e,a){var o={},e=jQuery("#"+e).empty(),s="";return n&&"object"==typeof n&&n.getElementsByTagName("wp_ajax")?(o.responses=[],o.errors=!1,jQuery("response",n).each(function(){var e=jQuery(this),r=jQuery(this.firstChild),i={action:e.attr("action"),what:r.get(0).nodeName,id:r.attr("id"),oldId:r.attr("old_id"),position:r.attr("position")};i.data=jQuery("response_data",r).text(),i.supplemental={},jQuery("supplemental",r).children().each(function(){i.supplemental[this.nodeName]=jQuery(this).text()}).length||(i.supplemental=!1),i.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+'"]',n);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>",i.errors.push(r),o.errors=!0}).length||(i.errors=!1),o.responses.push(i)}),s.length&&e.html('<div class="error">'+s+"</div>"),o):isNaN(n)?!e.html('<div class="error"><p>'+n+"</p></div>"):-1===(n=parseInt(n,10))?!e.html('<div class="error"><p>'+wpAjax.noPerm+"</p></div>"):0!==n||!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").submit(function(){return wpAjax.validateForm(e(this))})}); 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))})});

View File

@ -54,14 +54,14 @@
inputs.queryNoticeTextHint = inputs.queryNotice.find( '.query-notice-hint' ); inputs.queryNoticeTextHint = inputs.queryNotice.find( '.query-notice-hint' );
// Bind event handlers. // Bind event handlers.
inputs.dialog.keydown( wpLink.keydown ); inputs.dialog.on( 'keydown', wpLink.keydown );
inputs.dialog.keyup( wpLink.keyup ); inputs.dialog.on( 'keyup', wpLink.keyup );
inputs.submit.click( function( event ) { inputs.submit.on( 'click', function( event ) {
event.preventDefault(); event.preventDefault();
wpLink.update(); wpLink.update();
}); });
inputs.close.add( inputs.backdrop ).add( '#wp-link-cancel button' ).click( function( event ) { inputs.close.add( inputs.backdrop ).add( '#wp-link-cancel button' ).on( 'click', function( event ) {
event.preventDefault(); event.preventDefault();
wpLink.close(); wpLink.close();
}); });
@ -625,7 +625,7 @@
this.change( search ); this.change( search );
this.refresh(); this.refresh();
$( '#wp-link .query-results, #wp-link #link-selector' ).scroll( function() { $( '#wp-link .query-results, #wp-link #link-selector' ).on( 'scroll', function() {
self.maybeLoad(); self.maybeLoad();
}); });
element.on( 'click', 'li', function( event ) { element.on( 'click', 'li', function( event ) {

File diff suppressed because one or more lines are too long

View File

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