1/*! 2 * jQuery Migrate - v3.0.0 - 2016-06-09 3 * Copyright jQuery Foundation and other contributors 4 */ 5(function( jQuery, window ) { 6"use strict"; 7 8 9jQuery.migrateVersion = "3.0.0"; 10 11 12( function() { 13 14 // Support: IE9 only 15 // IE9 only creates console object when dev tools are first opened 16 // Also, avoid Function#bind here to simplify PhantomJS usage 17 18 19} )(); 20 21var warnedAbout = {}; 22 23// List of warnings already given; public read only 24jQuery.migrateWarnings = []; 25 26// Set to false to disable traces that appear with warnings 27if ( jQuery.migrateTrace === undefined ) { 28 jQuery.migrateTrace = true; 29} 30 31// Forget any warnings we've already given; public 32jQuery.migrateReset = function() { 33 warnedAbout = {}; 34 jQuery.migrateWarnings.length = 0; 35}; 36 37function migrateWarn( msg ) { 38 var console = window.console; 39 if ( !warnedAbout[ msg ] ) { 40 warnedAbout[ msg ] = true; 41 jQuery.migrateWarnings.push( msg ); 42 if ( console && console.warn && !jQuery.migrateMute ) { 43 console.warn( "JQMIGRATE: " + msg ); 44 if ( jQuery.migrateTrace && console.trace ) { 45 console.trace(); 46 } 47 } 48 } 49} 50 51function migrateWarnProp( obj, prop, value, msg ) { 52 Object.defineProperty( obj, prop, { 53 configurable: true, 54 enumerable: true, 55 get: function() { 56 migrateWarn( msg ); 57 return value; 58 } 59 } ); 60} 61 62if ( document.compatMode === "BackCompat" ) { 63 64 // JQuery has never supported or tested Quirks Mode 65 migrateWarn( "jQuery is not compatible with Quirks Mode" ); 66} 67 68 69var oldInit = jQuery.fn.init, 70 oldIsNumeric = jQuery.isNumeric, 71 oldFind = jQuery.find, 72 rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/, 73 rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g; 74 75jQuery.fn.init = function( arg1 ) { 76 var args = Array.prototype.slice.call( arguments ); 77 78 if ( typeof arg1 === "string" && arg1 === "#" ) { 79 80 // JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0 81 migrateWarn( "jQuery( '#' ) is not a valid selector" ); 82 args[ 0 ] = []; 83 } 84 85 return oldInit.apply( this, args ); 86}; 87jQuery.fn.init.prototype = jQuery.fn; 88 89jQuery.find = function( selector ) { 90 var args = Array.prototype.slice.call( arguments ); 91 92 // Support: PhantomJS 1.x 93 // String#match fails to match when used with a //g RegExp, only on some strings 94 if ( typeof selector === "string" && rattrHashTest.test( selector ) ) { 95 96 // The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0 97 // First see if qS thinks it's a valid selector, if so avoid a false positive 98 try { 99 document.querySelector( selector ); 100 } catch ( err1 ) { 101 102 // Didn't *look* valid to qSA, warn and try quoting what we think is the value 103 selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) { 104 return "[" + attr + op + "\"" + value + "\"]"; 105 } ); 106 107 // If the regexp *may* have created an invalid selector, don't update it 108 // Note that there may be false alarms if selector uses jQuery extensions 109 try { 110 document.querySelector( selector ); 111 migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] ); 112 args[ 0 ] = selector; 113 } catch ( err2 ) { 114 migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] ); 115 } 116 } 117 } 118 119 return oldFind.apply( this, args ); 120}; 121 122// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML) 123var findProp; 124for ( findProp in oldFind ) { 125 if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) { 126 jQuery.find[ findProp ] = oldFind[ findProp ]; 127 } 128} 129 130// The number of elements contained in the matched element set 131jQuery.fn.size = function() { 132 migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" ); 133 return this.length; 134}; 135 136jQuery.parseJSON = function() { 137 migrateWarn( "jQuery.parseJSON is deprecated; use JSON.parse" ); 138 return JSON.parse.apply( null, arguments ); 139}; 140 141jQuery.isNumeric = function( val ) { 142 143 // The jQuery 2.2.3 implementation of isNumeric 144 function isNumeric2( obj ) { 145 var realStringObj = obj && obj.toString(); 146 return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; 147 } 148 149 var newValue = oldIsNumeric( val ), 150 oldValue = isNumeric2( val ); 151 152 if ( newValue !== oldValue ) { 153 migrateWarn( "jQuery.isNumeric() should not be called on constructed objects" ); 154 } 155 156 return oldValue; 157}; 158 159migrateWarnProp( jQuery, "unique", jQuery.uniqueSort, 160 "jQuery.unique is deprecated, use jQuery.uniqueSort" ); 161 162// Now jQuery.expr.pseudos is the standard incantation 163migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos, 164 "jQuery.expr.filters is now jQuery.expr.pseudos" ); 165migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, 166 "jQuery.expr[\":\"] is now jQuery.expr.pseudos" ); 167 168 169var oldAjax = jQuery.ajax; 170 171jQuery.ajax = function( ) { 172 var jQXHR = oldAjax.apply( this, arguments ); 173 174 // Be sure we got a jQXHR (e.g., not sync) 175 if ( jQXHR.promise ) { 176 migrateWarnProp( jQXHR, "success", jQXHR.done, 177 "jQXHR.success is deprecated and removed" ); 178 migrateWarnProp( jQXHR, "error", jQXHR.fail, 179 "jQXHR.error is deprecated and removed" ); 180 migrateWarnProp( jQXHR, "complete", jQXHR.always, 181 "jQXHR.complete is deprecated and removed" ); 182 } 183 184 return jQXHR; 185}; 186 187 188var oldRemoveAttr = jQuery.fn.removeAttr, 189 oldToggleClass = jQuery.fn.toggleClass, 190 rmatchNonSpace = /\S+/g; 191 192jQuery.fn.removeAttr = function( name ) { 193 var self = this; 194 195 jQuery.each( name.match( rmatchNonSpace ), function( i, attr ) { 196 if ( jQuery.expr.match.bool.test( attr ) ) { 197 migrateWarn( "jQuery.fn.removeAttr no longer sets boolean properties: " + attr ); 198 self.prop( attr, false ); 199 } 200 } ); 201 202 return oldRemoveAttr.apply( this, arguments ); 203};
204 205jQuery.fn.toggleClass = function( state ) { 206 207 // Only deprecating no-args or single boolean arg 208 if ( state !== undefined && typeof state !== "boolean" ) { 209 return oldToggleClass.apply( this, arguments ); 210 } 211 212 migrateWarn( "jQuery.fn.toggleClass( boolean ) is deprecated" ); 213 214 // Toggle entire class name of each element 215 return this.each( function() { 216 var className = this.getAttribute && this.getAttribute( "class" ) || ""; 217 218 if ( className ) { 219 jQuery.data( this, "__className__", className ); 220 } 221 222 // If the element has a class name or if we're passed `false`, 223 // then remove the whole classname (if there was one, the above saved it). 224 // Otherwise bring back whatever was previously saved (if anything), 225 // falling back to the empty string if nothing was stored. 226 if ( this.setAttribute ) { 227 this.setAttribute( "class", 228 className || state === false ? 229 "" : 230 jQuery.data( this, "__className__" ) || "" 231 ); 232 } 233 } ); 234}; 235 236 237var internalSwapCall = false; 238 239// If this version of jQuery has .swap(), don't false-alarm on internal uses 240if ( jQuery.swap ) { 241 jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) { 242 var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get; 243 244 if ( oldHook ) { 245 jQuery.cssHooks[ name ].get = function() { 246 var ret; 247 248 internalSwapCall = true; 249 ret = oldHook.apply( this, arguments ); 250 internalSwapCall = false; 251 return ret; 252 }; 253 } 254 } ); 255} 256 257jQuery.swap = function( elem, options, callback, args ) { 258 var ret, name, 259 old = {}; 260 261 if ( !internalSwapCall ) { 262 migrateWarn( "jQuery.swap() is undocumented and deprecated" ); 263 } 264 265 // Remember the old values, and insert the new ones 266 for ( name in options ) { 267 old[ name ] = elem.style[ name ]; 268 elem.style[ name ] = options[ name ]; 269 } 270 271 ret = callback.apply( elem, args || [] ); 272 273 // Revert the old values 274 for ( name in options ) { 275 elem.style[ name ] = old[ name ]; 276 } 277 278 return ret; 279}; 280 281var oldData = jQuery.data; 282 283jQuery.data = function( elem, name, value ) { 284 var curData; 285 286 // If the name is transformed, look for the un-transformed name in the data object 287 if ( name && name !== jQuery.camelCase( name ) ) { 288 curData = jQuery.hasData( elem ) && oldData.call( this, elem ); 289 if ( curData && name in curData ) { 290 migrateWarn( "jQuery.data() always sets/gets camelCased names: " + name ); 291 if ( arguments.length > 2 ) { 292 curData[ name ] = value; 293 } 294 return curData[ name ]; 295 } 296 } 297 298 return oldData.apply( this, arguments ); 299}; 300 301var oldTweenRun = jQuery.Tween.prototype.run; 302 303jQuery.Tween.prototype.run = function( percent ) { 304 if ( jQuery.easing[ this.easing ].length > 1 ) { 305 migrateWarn( 306 "easing function " + 307 "\"jQuery.easing." + this.easing.toString() + 308 "\" should use only first argument" 309 ); 310 311 jQuery.easing[ this.easing ] = jQuery.easing[ this.easing ].bind( 312 jQuery.easing, 313 percent, this.options.duration * percent, 0, 1, this.options.duration 314 ); 315 } 316 317 oldTweenRun.apply( this, arguments ); 318}; 319 320var oldLoad = jQuery.fn.load, 321 originalFix = jQuery.event.fix; 322 323jQuery.event.props = []; 324jQuery.event.fixHooks = {}; 325 326jQuery.event.fix = function( originalEvent ) { 327 var event, 328 type = originalEvent.type, 329 fixHook = this.fixHooks[ type ], 330 props = jQuery.event.props; 331 332 if ( props.length ) { 333 migrateWarn( "jQuery.event.props are deprecated and removed: " + props.join() ); 334 while ( props.length ) { 335 jQuery.event.addProp( props.pop() ); 336 } 337 } 338 339 if ( fixHook && !fixHook._migrated_ ) { 340 fixHook._migrated_ = true; 341 migrateWarn( "jQuery.event.fixHooks are deprecated and removed: " + type ); 342 if ( ( props = fixHook.props ) && props.length ) { 343 while ( props.length ) { 344 jQuery.event.addProp( props.pop() ); 345 } 346 } 347 } 348 349 event = originalFix.call( this, originalEvent ); 350 351 return fixHook && fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 352}; 353 354jQuery.each( [ "load", "unload", "error" ], function( _, name ) { 355 356 jQuery.fn[ name ] = function() { 357 var args = Array.prototype.slice.call( arguments, 0 ); 358 359 // If this is an ajax load() the first arg should be the string URL; 360 // technically this could also be the "Anything" arg of the event .load() 361 // which just goes to show why this dumb signature has been deprecated! 362 // jQuery custom builds that exclude the Ajax module justifiably die here. 363 if ( name === "load" && typeof args[ 0 ] === "string" ) { 364 return oldLoad.apply( this, args ); 365 } 366 367 migrateWarn( "jQuery.fn." + name + "() is deprecated" ); 368 369 args.splice( 0, 0, name ); 370 if ( arguments.length ) { 371 return this.on.apply( this, args ); 372 } 373 374 // Use .triggerHandler here because: 375 // - load and unload events don't need to bubble, only applied to window or image 376 // - error event should not bubble to window, although it does pre-1.7 377 // See http://bugs.jquery.com/ticket/11820 378 this.triggerHandler.apply( this, args ); 379 return this; 380 }; 381 382} ); 383 384// Trigger "ready" event only once, on document ready 385jQuery( function() { 386 jQuery( document ).triggerHandler( "ready" ); 387} ); 388 389jQuery.event.special.ready = { 390 setup: function() { 391 if ( this === document ) { 392 migrateWarn( "'ready' event is deprecated" ); 393 } 394 } 395}; 396 397jQuery.fn.extend( { 398 399 bind: function( types, data, fn ) { 400 migrateWarn( "jQuery.fn.bind() is deprecated" ); 401 return this.on( types, null, data, fn ); 402 }, 403 unbind: function( types, fn ) { 404 migrateWarn( "jQuery.fn.unbind() is deprecated" ); 405 return this.off( types, null, fn ); 406 }, 407 delegate: function( selector, types, data, fn ) { 408 migrateWarn( "jQuery.fn.delegate() is deprecated" ); 409 return this.on( types, selector, data, fn ); 410 }, 411 undelegate: function( selector, types, fn ) { 412 migrateWarn( "jQuery.fn.undelegate() is deprecated" ); 413 return arguments.length === 1 ? 414 this.off( selector, "**" ) : 415 this.off( types, selector || "**", fn ); 416 } 417} ); 418 419 420var oldOffset = jQuery.fn.offset; 421 422jQuery.fn.offset = function() { 423 var docElem, 424 elem = this[ 0 ], 425 origin = { top: 0, left: 0 }; 426 427 if ( !elem || !elem.nodeType ) { 428 migrateWarn( "jQuery.fn.offset() requires a valid DOM element" ); 429 return origin; 430 } 431 432 docElem = ( elem.ownerDocument || document ).documentElement; 433 if ( !jQuery.contains( docElem, elem ) ) { 434 migrateWarn( "jQuery.fn.offset() requires an element connected to a document" ); 435 return origin; 436 } 437 438 return oldOffset.apply( this, arguments ); 439};
440 441 442var oldParam = jQuery.param; 443 444jQuery.param = function( data, traditional ) { 445 var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 446 447 if ( traditional === undefined && ajaxTraditional ) { 448 449 migrateWarn( "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" ); 450 traditional = ajaxTraditional; 451 } 452 453 return oldParam.call( this, data, traditional ); 454}; 455 456var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack; 457 458jQuery.fn.andSelf = function() { 459 migrateWarn( "jQuery.fn.andSelf() replaced by jQuery.fn.addBack()" ); 460 return oldSelf.apply( this, arguments ); 461}; 462 463 464var oldDeferred = jQuery.Deferred, 465 tuples = [ 466 467 // Action, add listener, callbacks, .then handlers, final state 468 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 469 jQuery.Callbacks( "once memory" ), "resolved" ], 470 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 471 jQuery.Callbacks( "once memory" ), "rejected" ], 472 [ "notify", "progress", jQuery.Callbacks( "memory" ), 473 jQuery.Callbacks( "memory" ) ] 474 ]; 475 476jQuery.Deferred = function( func ) { 477 var deferred = oldDeferred(), 478 promise = deferred.promise(); 479 480 deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) { 481 var fns = arguments; 482 483 migrateWarn( "deferred.pipe() is deprecated" ); 484 485 return jQuery.Deferred( function( newDefer ) { 486 jQuery.each( tuples, function( i, tuple ) { 487 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; 488 489 // Deferred.done(function() { bind to newDefer or newDefer.resolve }) 490 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 491 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 492 deferred[ tuple[ 1 ] ]( function() { 493 var returned = fn && fn.apply( this, arguments ); 494 if ( returned && jQuery.isFunction( returned.promise ) ) { 495 returned.promise() 496 .done( newDefer.resolve ) 497 .fail( newDefer.reject ) 498 .progress( newDefer.notify ); 499 } else { 500 newDefer[ tuple[ 0 ] + "With" ]( 501 this === promise ? newDefer.promise() : this, 502 fn ? [ returned ] : arguments 503 ); 504 } 505 } ); 506 } ); 507 fns = null; 508 } ).promise(); 509 510 }; 511 512 if ( func ) { 513 func.call( deferred, deferred ); 514 } 515 516 return deferred; 517}; 518 519 520 521})( jQuery, window );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.