From 5cee7eced0b691089a875d7e918d4380bac408af Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 7 Oct 2020 16:33:25 +0000 Subject: [PATCH] Update jQuery step two: - Add jquery-migrate.js v.3.3.1 to core and load it in debug mode when `SCRIPT_DEBUG` is true. - Add jquery.min.js, update jquery.js to 3.5.1 non-minified. This should help when debugging. - Rebuild jQuery UI 1.12.1 and add it to core. - Fix/adjust tests to match the above changes. See #50564. Built from https://develop.svn.wordpress.org/trunk@49101 git-svn-id: http://core.svn.wordpress.org/trunk@48863 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/jquery/jquery-migrate.js | 1163 +- wp-includes/js/jquery/jquery-migrate.min.js | 4 +- wp-includes/js/jquery/jquery.js | 10877 +++++++++++++++- wp-includes/js/jquery/jquery.min.js | 3 + wp-includes/js/jquery/ui/accordion.js | 610 + wp-includes/js/jquery/ui/accordion.min.js | 6 +- wp-includes/js/jquery/ui/autocomplete.js | 678 + wp-includes/js/jquery/ui/autocomplete.min.js | 6 +- wp-includes/js/jquery/ui/button.js | 385 + wp-includes/js/jquery/ui/button.min.js | 6 +- wp-includes/js/jquery/ui/checkboxradio.js | 283 + wp-includes/js/jquery/ui/checkboxradio.min.js | 9 + wp-includes/js/jquery/ui/controlgroup.js | 298 + wp-includes/js/jquery/ui/controlgroup.min.js | 9 + wp-includes/js/jquery/ui/core.js | 1768 +++ wp-includes/js/jquery/ui/core.min.js | 111 +- wp-includes/js/jquery/ui/datepicker.js | 2119 +++ wp-includes/js/jquery/ui/datepicker.min.js | 6 +- wp-includes/js/jquery/ui/dialog.js | 932 ++ wp-includes/js/jquery/ui/dialog.min.js | 6 +- wp-includes/js/jquery/ui/draggable.js | 1244 ++ wp-includes/js/jquery/ui/draggable.min.js | 6 +- wp-includes/js/jquery/ui/droppable.js | 496 + wp-includes/js/jquery/ui/droppable.min.js | 6 +- wp-includes/js/jquery/ui/effect-blind.js | 69 + wp-includes/js/jquery/ui/effect-blind.min.js | 6 +- wp-includes/js/jquery/ui/effect-bounce.js | 109 + wp-includes/js/jquery/ui/effect-bounce.min.js | 6 +- wp-includes/js/jquery/ui/effect-clip.js | 64 + wp-includes/js/jquery/ui/effect-clip.min.js | 6 +- wp-includes/js/jquery/ui/effect-drop.js | 68 + wp-includes/js/jquery/ui/effect-drop.min.js | 6 +- wp-includes/js/jquery/ui/effect-explode.js | 110 + .../js/jquery/ui/effect-explode.min.js | 6 +- wp-includes/js/jquery/ui/effect-fade.js | 46 + wp-includes/js/jquery/ui/effect-fade.min.js | 6 +- wp-includes/js/jquery/ui/effect-fold.js | 88 + wp-includes/js/jquery/ui/effect-fold.min.js | 6 +- wp-includes/js/jquery/ui/effect-highlight.js | 56 + .../js/jquery/ui/effect-highlight.min.js | 6 +- wp-includes/js/jquery/ui/effect-puff.js | 41 + wp-includes/js/jquery/ui/effect-puff.min.js | 6 +- wp-includes/js/jquery/ui/effect-pulsate.js | 63 + .../js/jquery/ui/effect-pulsate.min.js | 6 +- wp-includes/js/jquery/ui/effect-scale.js | 55 + wp-includes/js/jquery/ui/effect-scale.min.js | 6 +- wp-includes/js/jquery/ui/effect-shake.js | 73 + wp-includes/js/jquery/ui/effect-shake.min.js | 6 +- wp-includes/js/jquery/ui/effect-size.js | 190 + wp-includes/js/jquery/ui/effect-size.min.js | 6 +- wp-includes/js/jquery/ui/effect-slide.js | 75 + wp-includes/js/jquery/ui/effect-slide.min.js | 6 +- wp-includes/js/jquery/ui/effect-transfer.js | 39 + .../js/jquery/ui/effect-transfer.min.js | 6 +- wp-includes/js/jquery/ui/effect.js | 1639 +++ wp-includes/js/jquery/ui/effect.min.js | 8 +- wp-includes/js/jquery/ui/menu.js | 668 + wp-includes/js/jquery/ui/menu.min.js | 6 +- wp-includes/js/jquery/ui/mouse.js | 224 + wp-includes/js/jquery/ui/mouse.min.js | 6 +- wp-includes/js/jquery/ui/position.min.js | 11 - wp-includes/js/jquery/ui/progressbar.js | 177 + wp-includes/js/jquery/ui/progressbar.min.js | 6 +- wp-includes/js/jquery/ui/resizable.js | 1198 ++ wp-includes/js/jquery/ui/resizable.min.js | 6 +- wp-includes/js/jquery/ui/selectable.js | 309 + wp-includes/js/jquery/ui/selectable.min.js | 6 +- wp-includes/js/jquery/ui/selectmenu.js | 680 + wp-includes/js/jquery/ui/selectmenu.min.js | 6 +- wp-includes/js/jquery/ui/slider.js | 750 ++ wp-includes/js/jquery/ui/slider.min.js | 6 +- wp-includes/js/jquery/ui/sortable.js | 1550 +++ wp-includes/js/jquery/ui/sortable.min.js | 6 +- wp-includes/js/jquery/ui/spinner.js | 572 + wp-includes/js/jquery/ui/spinner.min.js | 6 +- wp-includes/js/jquery/ui/tabs.js | 919 ++ wp-includes/js/jquery/ui/tabs.min.js | 6 +- wp-includes/js/jquery/ui/tooltip.js | 516 + wp-includes/js/jquery/ui/tooltip.min.js | 6 +- wp-includes/js/jquery/ui/widget.min.js | 11 - wp-includes/script-loader.php | 99 +- wp-includes/version.php | 2 +- 82 files changed, 30914 insertions(+), 752 deletions(-) create mode 100644 wp-includes/js/jquery/jquery.min.js create mode 100644 wp-includes/js/jquery/ui/accordion.js create mode 100644 wp-includes/js/jquery/ui/autocomplete.js create mode 100644 wp-includes/js/jquery/ui/button.js create mode 100644 wp-includes/js/jquery/ui/checkboxradio.js create mode 100644 wp-includes/js/jquery/ui/checkboxradio.min.js create mode 100644 wp-includes/js/jquery/ui/controlgroup.js create mode 100644 wp-includes/js/jquery/ui/controlgroup.min.js create mode 100644 wp-includes/js/jquery/ui/core.js create mode 100644 wp-includes/js/jquery/ui/datepicker.js create mode 100644 wp-includes/js/jquery/ui/dialog.js create mode 100644 wp-includes/js/jquery/ui/draggable.js create mode 100644 wp-includes/js/jquery/ui/droppable.js create mode 100644 wp-includes/js/jquery/ui/effect-blind.js create mode 100644 wp-includes/js/jquery/ui/effect-bounce.js create mode 100644 wp-includes/js/jquery/ui/effect-clip.js create mode 100644 wp-includes/js/jquery/ui/effect-drop.js create mode 100644 wp-includes/js/jquery/ui/effect-explode.js create mode 100644 wp-includes/js/jquery/ui/effect-fade.js create mode 100644 wp-includes/js/jquery/ui/effect-fold.js create mode 100644 wp-includes/js/jquery/ui/effect-highlight.js create mode 100644 wp-includes/js/jquery/ui/effect-puff.js create mode 100644 wp-includes/js/jquery/ui/effect-pulsate.js create mode 100644 wp-includes/js/jquery/ui/effect-scale.js create mode 100644 wp-includes/js/jquery/ui/effect-shake.js create mode 100644 wp-includes/js/jquery/ui/effect-size.js create mode 100644 wp-includes/js/jquery/ui/effect-slide.js create mode 100644 wp-includes/js/jquery/ui/effect-transfer.js create mode 100644 wp-includes/js/jquery/ui/effect.js create mode 100644 wp-includes/js/jquery/ui/menu.js create mode 100644 wp-includes/js/jquery/ui/mouse.js delete mode 100644 wp-includes/js/jquery/ui/position.min.js create mode 100644 wp-includes/js/jquery/ui/progressbar.js create mode 100644 wp-includes/js/jquery/ui/resizable.js create mode 100644 wp-includes/js/jquery/ui/selectable.js create mode 100644 wp-includes/js/jquery/ui/selectmenu.js create mode 100644 wp-includes/js/jquery/ui/slider.js create mode 100644 wp-includes/js/jquery/ui/sortable.js create mode 100644 wp-includes/js/jquery/ui/spinner.js create mode 100644 wp-includes/js/jquery/ui/tabs.js create mode 100644 wp-includes/js/jquery/ui/tooltip.js delete mode 100644 wp-includes/js/jquery/ui/widget.min.js diff --git a/wp-includes/js/jquery/jquery-migrate.js b/wp-includes/js/jquery/jquery-migrate.js index 6fc343c44e..2e4bde47fb 100644 --- a/wp-includes/js/jquery/jquery-migrate.js +++ b/wp-includes/js/jquery/jquery-migrate.js @@ -1,29 +1,84 @@ -/*! - * jQuery Migrate - v1.4.1 - 2016-05-19 - * Copyright jQuery Foundation and other contributors - */ -(function( jQuery, window, undefined ) { -// See http://bugs.jquery.com/ticket/13335 -// "use strict"; - +/*! + * jQuery Migrate - v3.3.1 - 2020-06-25T01:07Z + * Copyright OpenJS Foundation and other contributors + */ +( function( factory ) { + "use strict"; -jQuery.migrateVersion = "1.4.1"; - + if ( typeof define === "function" && define.amd ) { -var warnedAbout = {}; + // AMD. Register as an anonymous module. + define( [ "jquery" ], function( jQuery ) { + return factory( jQuery, window ); + } ); + } else if ( typeof module === "object" && module.exports ) { -// List of warnings already given; public read only -jQuery.migrateWarnings = []; + // Node/CommonJS + // eslint-disable-next-line no-undef + module.exports = factory( require( "jquery" ), window ); + } else { -// Set to true to prevent console output; migrateWarnings still maintained -// jQuery.migrateMute = false; + // Browser globals + factory( jQuery, window ); + } +} )( function( jQuery, window ) { +"use strict"; -// Show a message on the console so devs know we're active -if ( window.console && window.console.log ) { +jQuery.migrateVersion = "3.3.1"; + +// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2 +function compareVersions( v1, v2 ) { + var i, + rVersionParts = /^(\d+)\.(\d+)\.(\d+)/, + v1p = rVersionParts.exec( v1 ) || [ ], + v2p = rVersionParts.exec( v2 ) || [ ]; + + for ( i = 1; i <= 3; i++ ) { + if ( +v1p[ i ] > +v2p[ i ] ) { + return 1; + } + if ( +v1p[ i ] < +v2p[ i ] ) { + return -1; + } + } + return 0; +} + +function jQueryVersionSince( version ) { + return compareVersions( jQuery.fn.jquery, version ) >= 0; +} + +( function() { + + // Support: IE9 only + // IE9 only creates console object when dev tools are first opened + // IE9 console is a host object, callable but doesn't have .apply() + if ( !window.console || !window.console.log ) { + return; + } + + // Need jQuery 3.0.0+ and no older Migrate loaded + if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ) { + window.console.log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" ); + } + if ( jQuery.migrateWarnings ) { + window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" ); + } + + // Show a message on the console so devs know we're active window.console.log( "JQMIGRATE: Migrate is installed" + ( jQuery.migrateMute ? "" : " with logging active" ) + ", version " + jQuery.migrateVersion ); -} + +} )(); + +var warnedAbout = {}; + +// By default each warning is only reported once. +jQuery.migrateDeduplicateWarnings = true; + +// List of warnings already given; public read only +jQuery.migrateWarnings = []; // Set to false to disable traces that appear with warnings if ( jQuery.migrateTrace === undefined ) { @@ -36,9 +91,9 @@ jQuery.migrateReset = function() { jQuery.migrateWarnings.length = 0; }; -function migrateWarn( msg) { +function migrateWarn( msg ) { var console = window.console; - if ( !warnedAbout[ msg ] ) { + if ( !jQuery.migrateDeduplicateWarnings || !warnedAbout[ msg ] ) { warnedAbout[ msg ] = true; jQuery.migrateWarnings.push( msg ); if ( console && console.warn && !jQuery.migrateMute ) { @@ -51,209 +106,56 @@ function migrateWarn( msg) { } function migrateWarnProp( obj, prop, value, msg ) { - if ( Object.defineProperty ) { - // On ES5 browsers (non-oldIE), warn if the code tries to get prop; - // allow property to be overwritten in case some other plugin wants it - try { - Object.defineProperty( obj, prop, { - configurable: true, - enumerable: true, - get: function() { - migrateWarn( msg ); - return value; - }, - set: function( newValue ) { - migrateWarn( msg ); - value = newValue; - } - }); - return; - } catch( err ) { - // IE8 is a dope about Object.defineProperty, can't warn there + Object.defineProperty( obj, prop, { + configurable: true, + enumerable: true, + get: function() { + migrateWarn( msg ); + return value; + }, + set: function( newValue ) { + migrateWarn( msg ); + value = newValue; } - } - - // Non-ES5 (or broken) browser; just set the property - jQuery._definePropertyBroken = true; - obj[ prop ] = value; + } ); } -if ( document.compatMode === "BackCompat" ) { - // jQuery has never supported or tested Quirks Mode +function migrateWarnFunc( obj, prop, newFunc, msg ) { + obj[ prop ] = function() { + migrateWarn( msg ); + return newFunc.apply( this, arguments ); + }; +} + +if ( window.document.compatMode === "BackCompat" ) { + + // JQuery has never supported or tested Quirks Mode migrateWarn( "jQuery is not compatible with Quirks Mode" ); } - -var attrFn = jQuery( "", { size: 1 } ).attr("size") && jQuery.attrFn, - oldAttr = jQuery.attr, - valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get || - function() { return null; }, - valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set || - function() { return undefined; }, - rnoType = /^(?:input|button)$/i, - rnoAttrNodeType = /^[238]$/, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - ruseDefault = /^(?:checked|selected)$/i; - -// jQuery.attrFn -migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" ); - -jQuery.attr = function( elem, name, value, pass ) { - var lowerName = name.toLowerCase(), - nType = elem && elem.nodeType; - - if ( pass ) { - // Since pass is used internally, we only warn for new jQuery - // versions where there isn't a pass arg in the formal params - if ( oldAttr.length < 4 ) { - migrateWarn("jQuery.fn.attr( props, pass ) is deprecated"); - } - if ( elem && !rnoAttrNodeType.test( nType ) && - (attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) { - return jQuery( elem )[ name ]( value ); - } - } - - // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking - // for disconnected elements we don't warn on $( "