From 87db5b833dc80e902b824014f14feeac26bf26dd Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 18 Mar 2021 19:01:03 +0000 Subject: [PATCH] External Libraries: Further fix jQuery deprecations in WordPress core. Follow-up to [50001], [50270], [50367], [50383], [50410], [50420], [50429]. Props Clorith. See #51812. Built from https://develop.svn.wordpress.org/trunk@50547 git-svn-id: http://core.svn.wordpress.org/trunk@50160 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/accordion.js | 2 +- wp-admin/js/accordion.min.js | 2 +- wp-admin/js/color-picker.js | 4 ++-- wp-admin/js/color-picker.min.js | 2 +- wp-admin/js/comment.js | 2 +- wp-admin/js/comment.min.js | 2 +- wp-admin/js/common.js | 10 +++++----- wp-admin/js/common.min.js | 2 +- wp-admin/js/custom-background.js | 2 +- wp-admin/js/custom-background.min.js | 2 +- wp-admin/js/customize-controls.js | 20 ++++++++++---------- wp-admin/js/customize-controls.min.js | 2 +- wp-admin/js/customize-nav-menus.js | 13 +++++++------ wp-admin/js/customize-nav-menus.min.js | 2 +- wp-admin/js/customize-widgets.js | 16 ++++++++-------- wp-admin/js/customize-widgets.min.js | 2 +- wp-admin/js/dashboard.js | 4 ++-- wp-admin/js/dashboard.min.js | 2 +- wp-admin/js/edit-comments.js | 2 +- wp-admin/js/edit-comments.min.js | 2 +- wp-admin/js/editor.js | 2 +- wp-admin/js/editor.min.js | 2 +- wp-admin/js/gallery.js | 2 +- wp-admin/js/gallery.min.js | 2 +- wp-admin/js/inline-edit-post.js | 16 ++++++++-------- wp-admin/js/inline-edit-post.min.js | 2 +- wp-admin/js/inline-edit-tax.js | 2 +- wp-admin/js/inline-edit-tax.min.js | 2 +- wp-admin/js/link.js | 8 ++++++-- wp-admin/js/link.min.js | 2 +- wp-admin/js/media.js | 2 +- wp-admin/js/media.min.js | 2 +- wp-admin/js/nav-menu.js | 2 +- wp-admin/js/nav-menu.min.js | 2 +- wp-admin/js/plugin-install.js | 2 +- wp-admin/js/plugin-install.min.js | 2 +- wp-admin/js/post.js | 10 +++++----- wp-admin/js/post.min.js | 2 +- wp-admin/js/privacy-tools.js | 2 +- wp-admin/js/privacy-tools.min.js | 2 +- wp-admin/js/site-health.js | 2 +- wp-admin/js/site-health.min.js | 2 +- wp-admin/js/svg-painter.js | 2 +- wp-admin/js/svg-painter.min.js | 2 +- wp-admin/js/tags-box.js | 9 ++++++--- wp-admin/js/tags-box.min.js | 2 +- wp-admin/js/tags.js | 2 +- wp-admin/js/tags.min.js | 2 +- wp-admin/js/theme-plugin-editor.js | 4 ++-- wp-admin/js/theme-plugin-editor.min.js | 2 +- wp-admin/js/theme.js | 4 ++-- wp-admin/js/theme.min.js | 2 +- wp-admin/js/updates.js | 2 +- wp-admin/js/updates.min.js | 2 +- wp-admin/js/user-profile.js | 6 +++--- wp-admin/js/user-profile.min.js | 2 +- wp-admin/js/user-suggest.js | 2 +- wp-admin/js/user-suggest.min.js | 2 +- wp-admin/js/widgets.js | 2 +- wp-admin/js/widgets.min.js | 2 +- wp-admin/js/widgets/media-widgets.js | 4 ++-- wp-admin/js/widgets/media-widgets.min.js | 2 +- wp-admin/js/xfn.js | 2 +- wp-admin/js/xfn.min.js | 2 +- wp-includes/js/autosave.js | 16 ++++++++-------- wp-includes/js/autosave.min.js | 2 +- wp-includes/js/customize-base.js | 4 ++-- wp-includes/js/customize-base.min.js | 2 +- wp-includes/js/heartbeat.js | 2 +- wp-includes/js/heartbeat.min.js | 2 +- wp-includes/js/media-views.js | 9 +++++---- wp-includes/js/media-views.min.js | 2 +- wp-includes/js/quicktags.js | 2 +- wp-includes/js/quicktags.min.js | 2 +- wp-includes/js/wp-ajax-response.js | 2 +- wp-includes/js/wp-ajax-response.min.js | 2 +- wp-includes/js/wp-auth-check.js | 18 +++++++++--------- wp-includes/js/wp-auth-check.min.js | 2 +- wp-includes/js/wplink.js | 13 +++++++------ wp-includes/js/wplink.min.js | 2 +- wp-includes/version.php | 2 +- 81 files changed, 161 insertions(+), 151 deletions(-) diff --git a/wp-admin/js/accordion.js b/wp-admin/js/accordion.js index 7eacbec966..c420e8ccb8 100644 --- a/wp-admin/js/accordion.js +++ b/wp-admin/js/accordion.js @@ -31,7 +31,7 @@ ( function( $ ){ - $( document ).ready( function () { + $( function () { // Expand/Collapse accordion sections on click. $( '.accordion-container' ).on( 'click keydown', '.accordion-section-title', function( e ) { diff --git a/wp-admin/js/accordion.min.js b/wp-admin/js/accordion.min.js index 6b8b468234..e38d98b733 100644 --- a/wp-admin/js/accordion.min.js +++ b/wp-admin/js/accordion.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(s){s(document).ready(function(){s(".accordion-container").on("click keydown",".accordion-section-title",function(e){var n,o,a,i,t;"keydown"===e.type&&13!==e.which||(e.preventDefault(),n=s(this),o=n.closest(".accordion-section"),a=o.find("[aria-expanded]").first(),i=o.closest(".accordion-container"),t=i.find(".open"),e=t.find("[aria-expanded]").first(),n=o.find(".accordion-section-content"),o.hasClass("cannot-expand")||(i.addClass("opening"),o.hasClass("open")?(o.toggleClass("open"),n.toggle(!0).slideToggle(150)):(e.attr("aria-expanded","false"),t.removeClass("open"),t.find(".accordion-section-content").show().slideUp(150),n.toggle(!1).slideToggle(150),o.toggleClass("open")),setTimeout(function(){i.removeClass("opening")},150),a&&a.attr("aria-expanded",String("false"===a.attr("aria-expanded")))))})})}(jQuery); \ No newline at end of file +!function(s){s(function(){s(".accordion-container").on("click keydown",".accordion-section-title",function(e){var n,o,a,i,t;"keydown"===e.type&&13!==e.which||(e.preventDefault(),n=s(this),o=n.closest(".accordion-section"),a=o.find("[aria-expanded]").first(),i=o.closest(".accordion-container"),t=i.find(".open"),e=t.find("[aria-expanded]").first(),n=o.find(".accordion-section-content"),o.hasClass("cannot-expand")||(i.addClass("opening"),o.hasClass("open")?(o.toggleClass("open"),n.toggle(!0).slideToggle(150)):(e.attr("aria-expanded","false"),t.removeClass("open"),t.find(".accordion-section-content").show().slideUp(150),n.toggle(!1).slideToggle(150),o.toggleClass("open")),setTimeout(function(){i.removeClass("opening")},150),a&&a.attr("aria-expanded",String("false"===a.attr("aria-expanded")))))})})}(jQuery); \ No newline at end of file diff --git a/wp-admin/js/color-picker.js b/wp-admin/js/color-picker.js index f41f00af18..600e0235b3 100644 --- a/wp-admin/js/color-picker.js +++ b/wp-admin/js/color-picker.js @@ -101,7 +101,7 @@ } // Bind the close event. - self.close = $.proxy( self.close, self ); + self.close = self.close.bind( self ); self.initialValue = el.val(); @@ -277,7 +277,7 @@ if ( me.hasClass( 'wp-picker-clear' ) ) { self.element.val( '' ); self.toggler.css( 'backgroundColor', '' ); - if ( $.isFunction( self.options.clear ) ) { + if ( typeof self.options.clear === 'function' ) { self.options.clear.call( this, event ); } } else if ( me.hasClass( 'wp-picker-default' ) ) { diff --git a/wp-admin/js/color-picker.min.js b/wp-admin/js/color-picker.min.js index 6162cd79ff..00867643e8 100644 --- a/wp-admin/js/color-picker.min.js +++ b/wp-admin/js/color-picker.min.js @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -!function(i,t){var a=wp.i18n.__,e={options:{defaultColor:!1,change:!1,clear:!1,hide:!0,palettes:!0,width:255,mode:"hsv",type:"full",slider:"horizontal"},_createHueOnly:function(){var e,o=this,t=o.element;t.hide(),e="hsl("+t.val()+", 100, 50)",t.iris({mode:"hsl",type:"hue",hide:!1,color:e,change:function(e,t){"function"==typeof o.options.change&&o.options.change.call(this,e,t)},width:o.options.width,slider:o.options.slider})},_create:function(){if(i.support.iris){var o=this,e=o.element;if(i.extend(o.options,e.data()),"hue"===o.options.type)return o._createHueOnly();o.close=i.proxy(o.close,o),o.initialValue=e.val(),e.addClass("wp-color-picker"),e.parent("label").length||(e.wrap(""),o.wrappingLabelText=i('').insertBefore(e).text(a("Color value"))),o.wrappingLabel=e.parent(),o.wrappingLabel.wrap('
'),o.wrap=o.wrappingLabel.parent(),o.toggler=i('').insertBefore(o.wrappingLabel).css({backgroundColor:o.initialValue}),o.toggler.find(".wp-color-result-text").text(a("Select Color")),o.pickerContainer=i('
').insertAfter(o.wrappingLabel),o.button=i(''),o.options.defaultColor?o.button.addClass("wp-picker-default").val(a("Default")).attr("aria-label",a("Select default color")):o.button.addClass("wp-picker-clear").val(a("Clear")).attr("aria-label",a("Clear color")),o.wrappingLabel.wrap('