|
|
|
@ -1,12 +1,14 @@
|
|
|
|
|
/*! |
|
|
|
|
* jQuery Migrate - v3.0.1 - 2017-09-26 |
|
|
|
|
* Copyright jQuery Foundation and other contributors |
|
|
|
|
* jQuery Migrate - v3.2.0 - 2020-04-10 |
|
|
|
|
* Copyright OpenJS Foundation and other contributors |
|
|
|
|
*/ |
|
|
|
|
;( function( factory ) { |
|
|
|
|
if ( typeof define === "function" && define.amd ) { |
|
|
|
|
|
|
|
|
|
// AMD. Register as an anonymous module.
|
|
|
|
|
define( [ "jquery" ], window, factory ); |
|
|
|
|
define( [ "jquery" ], function ( jQuery ) { |
|
|
|
|
return factory( jQuery, window ); |
|
|
|
|
} ); |
|
|
|
|
} else if ( typeof module === "object" && module.exports ) { |
|
|
|
|
|
|
|
|
|
// Node/CommonJS
|
|
|
|
@ -21,7 +23,7 @@
|
|
|
|
|
"use strict"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
jQuery.migrateVersion = "3.0.1"; |
|
|
|
|
jQuery.migrateVersion = "3.2.0"; |
|
|
|
|
|
|
|
|
|
// Included only in the minified build, via Uglify2
|
|
|
|
|
// Only turn warnings off if not already overridden
|
|
|
|
@ -29,12 +31,33 @@ if ( typeof jQuery.migrateMute === "undefined" ) {
|
|
|
|
|
jQuery.migrateMute = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* exported jQueryVersionSince, compareVersions */ |
|
|
|
|
|
|
|
|
|
// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2
|
|
|
|
|
function compareVersions( v1, v2 ) { |
|
|
|
|
var rVersionParts = /^(\d+)\.(\d+)\.(\d+)/, |
|
|
|
|
v1p = rVersionParts.exec( v1 ) || [ ], |
|
|
|
|
v2p = rVersionParts.exec( v2 ) || [ ]; |
|
|
|
|
|
|
|
|
|
for ( var 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; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* exported migrateWarn, migrateWarnFunc, migrateWarnProp */ |
|
|
|
|
|
|
|
|
|
( function() { |
|
|
|
|
|
|
|
|
|
var rbadVersions = /^[12]\./; |
|
|
|
|
|
|
|
|
|
// 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()
|
|
|
|
@ -43,7 +66,7 @@ if ( typeof jQuery.migrateMute === "undefined" ) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Need jQuery 3.0.0+ and no older Migrate loaded
|
|
|
|
|
if ( !jQuery || rbadVersions.test( jQuery.fn.jquery ) ) { |
|
|
|
|
if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ) { |
|
|
|
|
window.console.log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" ); |
|
|
|
|
} |
|
|
|
|
if ( jQuery.migrateWarnings ) { |
|
|
|
@ -59,6 +82,9 @@ if ( typeof jQuery.migrateMute === "undefined" ) {
|
|
|
|
|
|
|
|
|
|
var warnedAbout = {}; |
|
|
|
|
|
|
|
|
|
// By default each warning is only reported once.
|
|
|
|
|
jQuery.migrateDeduplicateWarnings = true; |
|
|
|
|
|
|
|
|
|
// List of warnings already given; public read only
|
|
|
|
|
jQuery.migrateWarnings = []; |
|
|
|
|
|
|
|
|
@ -75,7 +101,7 @@ jQuery.migrateReset = function() {
|
|
|
|
|
|
|
|
|
|
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 ) { |
|
|
|
@ -117,10 +143,13 @@ if ( window.document.compatMode === "BackCompat" ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var oldInit = jQuery.fn.init, |
|
|
|
|
oldIsNumeric = jQuery.isNumeric, |
|
|
|
|
oldFind = jQuery.find, |
|
|
|
|
rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/, |
|
|
|
|
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g; |
|
|
|
|
rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g, |
|
|
|
|
|
|
|
|
|
// Support: Android <=4.0 only
|
|
|
|
|
// Make sure we trim BOM and NBSP
|
|
|
|
|
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; |
|
|
|
|
|
|
|
|
|
jQuery.fn.init = function( arg1 ) { |
|
|
|
|
var args = Array.prototype.slice.call( arguments ); |
|
|
|
@ -178,33 +207,15 @@ for ( findProp in oldFind ) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// The number of elements contained in the matched element set
|
|
|
|
|
jQuery.fn.size = function() { |
|
|
|
|
migrateWarn( "jQuery.fn.size() is deprecated and removed; use the .length property" ); |
|
|
|
|
migrateWarnFunc( jQuery.fn, "size", function() { |
|
|
|
|
return this.length; |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
"jQuery.fn.size() is deprecated and removed; use the .length property" ); |
|
|
|
|
|
|
|
|
|
jQuery.parseJSON = function() { |
|
|
|
|
migrateWarn( "jQuery.parseJSON is deprecated; use JSON.parse" ); |
|
|
|
|
migrateWarnFunc( jQuery, "parseJSON", function() { |
|
|
|
|
return JSON.parse.apply( null, arguments ); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
jQuery.isNumeric = function( val ) { |
|
|
|
|
|
|
|
|
|
// The jQuery 2.2.3 implementation of isNumeric
|
|
|
|
|
function isNumeric2( obj ) { |
|
|
|
|
var realStringObj = obj && obj.toString(); |
|
|
|
|
return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var newValue = oldIsNumeric( val ), |
|
|
|
|
oldValue = isNumeric2( val ); |
|
|
|
|
|
|
|
|
|
if ( newValue !== oldValue ) { |
|
|
|
|
migrateWarn( "jQuery.isNumeric() should not be called on constructed objects" ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return oldValue; |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
"jQuery.parseJSON is deprecated; use JSON.parse" ); |
|
|
|
|
|
|
|
|
|
migrateWarnFunc( jQuery, "holdReady", jQuery.holdReady, |
|
|
|
|
"jQuery.holdReady is deprecated" ); |
|
|
|
@ -218,6 +229,80 @@ migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos,
|
|
|
|
|
migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, |
|
|
|
|
"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" ); |
|
|
|
|
|
|
|
|
|
// Prior to jQuery 3.1.1 there were internal refs so we don't warn there
|
|
|
|
|
if ( jQueryVersionSince( "3.1.1" ) ) { |
|
|
|
|
migrateWarnFunc( jQuery, "trim", function( text ) { |
|
|
|
|
return text == null ? |
|
|
|
|
"" : |
|
|
|
|
( text + "" ).replace( rtrim, "" ); |
|
|
|
|
}, |
|
|
|
|
"jQuery.trim is deprecated; use String.prototype.trim" ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Prior to jQuery 3.2 there were internal refs so we don't warn there
|
|
|
|
|
if ( jQueryVersionSince( "3.2.0" ) ) { |
|
|
|
|
migrateWarnFunc( jQuery, "nodeName", function( elem, name ) { |
|
|
|
|
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); |
|
|
|
|
}, |
|
|
|
|
"jQuery.nodeName is deprecated" ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ( jQueryVersionSince( "3.3.0" ) ) { |
|
|
|
|
|
|
|
|
|
migrateWarnFunc( jQuery, "isNumeric", function( obj ) { |
|
|
|
|
|
|
|
|
|
// As of jQuery 3.0, isNumeric is limited to
|
|
|
|
|
// strings and numbers (primitives or objects)
|
|
|
|
|
// that can be coerced to finite numbers (gh-2662)
|
|
|
|
|
var type = typeof obj; |
|
|
|
|
return ( type === "number" || type === "string" ) && |
|
|
|
|
|
|
|
|
|
// parseFloat NaNs numeric-cast false positives ("")
|
|
|
|
|
// ...but misinterprets leading-number strings, e.g. hex literals ("0x...")
|
|
|
|
|
// subtraction forces infinities to NaN
|
|
|
|
|
!isNaN( obj - parseFloat( obj ) ); |
|
|
|
|
}, |
|
|
|
|
"jQuery.isNumeric() is deprecated" |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Populate the class2type map
|
|
|
|
|
var class2type = {}; |
|
|
|
|
jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol". |
|
|
|
|
split( " " ), |
|
|
|
|
function( _, name ) { |
|
|
|
|
class2type[ "[object " + name + "]" ] = name.toLowerCase(); |
|
|
|
|
} ); |
|
|
|
|
|
|
|
|
|
migrateWarnFunc( jQuery, "type", function( obj ) { |
|
|
|
|
if ( obj == null ) { |
|
|
|
|
return obj + ""; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Support: Android <=2.3 only (functionish RegExp)
|
|
|
|
|
return typeof obj === "object" || typeof obj === "function" ? |
|
|
|
|
class2type[ Object.prototype.toString.call( obj ) ] || "object" : |
|
|
|
|
typeof obj; |
|
|
|
|
}, |
|
|
|
|
"jQuery.type is deprecated" ); |
|
|
|
|
|
|
|
|
|
migrateWarnFunc( jQuery, "isFunction", |
|
|
|
|
function( obj ) { |
|
|
|
|
return typeof obj === "function"; |
|
|
|
|
}, |
|
|
|
|
"jQuery.isFunction() is deprecated" ); |
|
|
|
|
|
|
|
|
|
migrateWarnFunc( jQuery, "isWindow", |
|
|
|
|
function( obj ) { |
|
|
|
|
return obj != null && obj === obj.window; |
|
|
|
|
}, |
|
|
|
|
"jQuery.isWindow() is deprecated" |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
migrateWarnFunc( jQuery, "isArray", Array.isArray, |
|
|
|
|
"jQuery.isArray is deprecated; use Array.isArray" |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var oldAjax = jQuery.ajax; |
|
|
|
|
|
|
|
|
@ -245,7 +330,7 @@ var oldRemoveAttr = jQuery.fn.removeAttr,
|
|
|
|
|
jQuery.fn.removeAttr = function( name ) { |
|
|
|
|
var self = this; |
|
|
|
|
|
|
|
|
|
jQuery.each( name.match( rmatchNonSpace ), function( i, attr ) { |
|
|
|
|
jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) { |
|
|
|
|
if ( jQuery.expr.match.bool.test( attr ) ) { |
|
|
|
|
migrateWarn( "jQuery.fn.removeAttr no longer sets boolean properties: " + attr ); |
|
|
|
|
self.prop( attr, false ); |
|
|
|
@ -331,8 +416,24 @@ jQuery.swap = function( elem, options, callback, args ) {
|
|
|
|
|
return ret; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if ( jQueryVersionSince( "3.4.0" ) && typeof Proxy !== "undefined" ) { |
|
|
|
|
|
|
|
|
|
jQuery.cssProps = new Proxy( jQuery.cssProps || {}, { |
|
|
|
|
set: function() { |
|
|
|
|
migrateWarn( "JQMIGRATE: jQuery.cssProps is deprecated" ); |
|
|
|
|
return Reflect.set.apply( this, arguments ); |
|
|
|
|
} |
|
|
|
|
} ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var oldData = jQuery.data; |
|
|
|
|
|
|
|
|
|
var camelCase = function( string ) { |
|
|
|
|
return string.replace( /-([a-z])/g, function( _, letter ) { |
|
|
|
|
return letter.toUpperCase(); |
|
|
|
|
} ); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
jQuery.data = function( elem, name, value ) { |
|
|
|
|
var curData; |
|
|
|
|
|
|
|
|
@ -341,7 +442,7 @@ jQuery.data = function( elem, name, value ) {
|
|
|
|
|
curData = jQuery.hasData( elem ) && oldData.call( this, elem ); |
|
|
|
|
var sameKeys = {}; |
|
|
|
|
for ( var key in name ) { |
|
|
|
|
if ( key !== jQuery.camelCase( key ) ) { |
|
|
|
|
if ( key !== camelCase( key ) ) { |
|
|
|
|
migrateWarn( "jQuery.data() always sets/gets camelCased names: " + key ); |
|
|
|
|
curData[ key ] = name[ key ]; |
|
|
|
|
} else { |
|
|
|
@ -355,7 +456,7 @@ jQuery.data = function( elem, name, value ) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// If the name is transformed, look for the un-transformed name in the data object
|
|
|
|
|
if ( name && typeof name === "string" && name !== jQuery.camelCase( name ) ) { |
|
|
|
|
if ( name && typeof name === "string" && name !== camelCase( name ) ) { |
|
|
|
|
curData = jQuery.hasData( elem ) && oldData.call( this, elem ); |
|
|
|
|
if ( curData && name in curData ) { |
|
|
|
|
migrateWarn( "jQuery.data() always sets/gets camelCased names: " + name ); |
|
|
|
@ -386,13 +487,27 @@ jQuery.Tween.prototype.run = function( ) {
|
|
|
|
|
oldTweenRun.apply( this, arguments ); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
jQuery.fx.interval = jQuery.fx.interval || 13; |
|
|
|
|
var intervalValue = jQuery.fx.interval || 13, |
|
|
|
|
intervalMsg = "jQuery.fx.interval is deprecated"; |
|
|
|
|
|
|
|
|
|
// Support: IE9, Android <=4.4
|
|
|
|
|
// Avoid false positives on browsers that lack rAF
|
|
|
|
|
// Don't warn if document is hidden, jQuery uses setTimeout (#292)
|
|
|
|
|
if ( window.requestAnimationFrame ) { |
|
|
|
|
migrateWarnProp( jQuery.fx, "interval", jQuery.fx.interval, |
|
|
|
|
"jQuery.fx.interval is deprecated" ); |
|
|
|
|
Object.defineProperty( jQuery.fx, "interval", { |
|
|
|
|
configurable: true, |
|
|
|
|
enumerable: true, |
|
|
|
|
get: function() { |
|
|
|
|
if ( !window.document.hidden ) { |
|
|
|
|
migrateWarn( intervalMsg ); |
|
|
|
|
} |
|
|
|
|
return intervalValue; |
|
|
|
|
}, |
|
|
|
|
set: function( newValue ) { |
|
|
|
|
migrateWarn( intervalMsg ); |
|
|
|
|
intervalValue = newValue; |
|
|
|
|
} |
|
|
|
|
} ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var oldLoad = jQuery.fn.load, |
|
|
|
@ -475,7 +590,7 @@ jQuery.each( [ "load", "unload", "error" ], function( _, name ) {
|
|
|
|
|
jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + |
|
|
|
|
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
|
|
|
|
"change select submit keydown keypress keyup contextmenu" ).split( " " ), |
|
|
|
|
function( i, name ) { |
|
|
|
|
function( _i, name ) { |
|
|
|
|
|
|
|
|
|
// Handle event binding
|
|
|
|
|
jQuery.fn[ name ] = function( data, fn ) { |
|
|
|
@ -525,23 +640,31 @@ jQuery.fn.extend( {
|
|
|
|
|
} |
|
|
|
|
} ); |
|
|
|
|
|
|
|
|
|
var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi; |
|
|
|
|
|
|
|
|
|
jQuery.UNSAFE_restoreLegacyHtmlPrefilter = function() { |
|
|
|
|
jQuery.htmlPrefilter = function( html ) { |
|
|
|
|
return html.replace( rxhtmlTag, "<$1></$2>" ); |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var oldOffset = jQuery.fn.offset; |
|
|
|
|
|
|
|
|
|
jQuery.fn.offset = function() { |
|
|
|
|
var docElem, |
|
|
|
|
elem = this[ 0 ], |
|
|
|
|
origin = { top: 0, left: 0 }; |
|
|
|
|
bogus = { top: 0, left: 0 }; |
|
|
|
|
|
|
|
|
|
if ( !elem || !elem.nodeType ) { |
|
|
|
|
migrateWarn( "jQuery.fn.offset() requires a valid DOM element" ); |
|
|
|
|
return origin; |
|
|
|
|
return undefined; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
docElem = ( elem.ownerDocument || window.document ).documentElement; |
|
|
|
|
if ( !jQuery.contains( docElem, elem ) ) { |
|
|
|
|
migrateWarn( "jQuery.fn.offset() requires an element connected to a document" ); |
|
|
|
|
return origin; |
|
|
|
|
return bogus; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return oldOffset.apply( this, arguments ); |
|
|
|
@ -593,14 +716,14 @@ jQuery.Deferred = function( func ) {
|
|
|
|
|
|
|
|
|
|
return jQuery.Deferred( function( newDefer ) { |
|
|
|
|
jQuery.each( tuples, function( i, tuple ) { |
|
|
|
|
var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; |
|
|
|
|
var fn = typeof fns[ i ] === "function" && fns[ i ]; |
|
|
|
|
|
|
|
|
|
// Deferred.done(function() { bind to newDefer or newDefer.resolve })
|
|
|
|
|
// deferred.fail(function() { bind to newDefer or newDefer.reject })
|
|
|
|
|
// deferred.progress(function() { bind to newDefer or newDefer.notify })
|
|
|
|
|
deferred[ tuple[ 1 ] ]( function() { |
|
|
|
|
var returned = fn && fn.apply( this, arguments ); |
|
|
|
|
if ( returned && jQuery.isFunction( returned.promise ) ) { |
|
|
|
|
if ( returned && typeof returned.promise === "function" ) { |
|
|
|
|
returned.promise() |
|
|
|
|
.done( newDefer.resolve ) |
|
|
|
|
.fail( newDefer.reject ) |