From 2d1952a662abbc344bf6380d64988e2c8cba1b5b Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Mon, 30 Nov 2020 15:51:31 +0100 Subject: [PATCH] Update to 3.3.2 Change-Id: I96d5af00c33c464cd293e4fde648569ea949516d --- xstatic/pkg/jquery_migrate/__init__.py | 4 +- .../pkg/jquery_migrate/data/jquery-migrate.js | 1210 +++++++++++------ .../jquery_migrate/data/jquery-migrate.min.js | 4 +- 3 files changed, 778 insertions(+), 440 deletions(-) diff --git a/xstatic/pkg/jquery_migrate/__init__.py b/xstatic/pkg/jquery_migrate/__init__.py index f18d656..3226425 100644 --- a/xstatic/pkg/jquery_migrate/__init__.py +++ b/xstatic/pkg/jquery_migrate/__init__.py @@ -11,9 +11,9 @@ NAME = __name__.split('.')[-1] # package name (e.g. 'foo' or 'foo_bar') # please use a all-lowercase valid python # package name -VERSION = '1.2.1' # version of the packaged files, please use the upstream +VERSION = '3.3.2' # version of the packaged files, please use the upstream # version number -BUILD = '2' # our package build number, so we can release new builds +BUILD = '1' # our package build number, so we can release new builds # with fixes for xstatic stuff. PACKAGE_VERSION = VERSION + '.' + BUILD # version used for PyPi diff --git a/xstatic/pkg/jquery_migrate/data/jquery-migrate.js b/xstatic/pkg/jquery_migrate/data/jquery-migrate.js index 25b6c81..7917349 100644 --- a/xstatic/pkg/jquery_migrate/data/jquery-migrate.js +++ b/xstatic/pkg/jquery_migrate/data/jquery-migrate.js @@ -1,26 +1,85 @@ /*! - * jQuery Migrate - v1.2.1 - 2013-05-08 - * https://github.com/jquery/jquery-migrate - * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT + * jQuery Migrate - v3.3.2 - 2020-11-17T23:22Z + * Copyright OpenJS Foundation and other contributors */ -(function( jQuery, window, undefined ) { -// See http://bugs.jquery.com/ticket/13335 -// "use strict"; +( function( factory ) { + "use strict"; + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define( [ "jquery" ], function( jQuery ) { + return factory( jQuery, window ); + } ); + } else if ( typeof module === "object" && module.exports ) { + + // Node/CommonJS + // eslint-disable-next-line no-undef + module.exports = factory( require( "jquery" ), window ); + } else { + + // Browser globals + factory( jQuery, window ); + } +} )( function( jQuery, window ) { +"use strict"; + +jQuery.migrateVersion = "3.3.2"; + +// 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 true to prevent console output; migrateWarnings still maintained -// jQuery.migrateMute = false; - -// Show a message on the console so devs know we're active -if ( !jQuery.migrateMute && window.console && window.console.log ) { - window.console.log("JQMIGRATE: Logging is active"); -} - // Set to false to disable traces that appear with warnings if ( jQuery.migrateTrace === undefined ) { jQuery.migrateTrace = true; @@ -32,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 ) { @@ -47,475 +106,754 @@ 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 $( "