annotate jquery-2.1.4.js @ 1169:018539fa16c5

Bug #1395: Test timer is reset on each new test page.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Tue, 02 Feb 2016 11:03:01 +0000
parents c44fbf72f7f2
children
rev   line source
n@1116 1 /*!
n@1116 2 * jQuery JavaScript Library v2.1.4
n@1116 3 * http://jquery.com/
n@1116 4 *
n@1116 5 * Includes Sizzle.js
n@1116 6 * http://sizzlejs.com/
n@1116 7 *
n@1116 8 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
n@1116 9 * Released under the MIT license
n@1116 10 * http://jquery.org/license
n@1116 11 *
n@1116 12 * Date: 2015-04-28T16:01Z
n@1116 13 */
n@1116 14
n@1116 15 (function( global, factory ) {
n@1116 16
n@1116 17 if ( typeof module === "object" && typeof module.exports === "object" ) {
n@1116 18 // For CommonJS and CommonJS-like environments where a proper `window`
n@1116 19 // is present, execute the factory and get jQuery.
n@1116 20 // For environments that do not have a `window` with a `document`
n@1116 21 // (such as Node.js), expose a factory as module.exports.
n@1116 22 // This accentuates the need for the creation of a real `window`.
n@1116 23 // e.g. var jQuery = require("jquery")(window);
n@1116 24 // See ticket #14549 for more info.
n@1116 25 module.exports = global.document ?
n@1116 26 factory( global, true ) :
n@1116 27 function( w ) {
n@1116 28 if ( !w.document ) {
n@1116 29 throw new Error( "jQuery requires a window with a document" );
n@1116 30 }
n@1116 31 return factory( w );
n@1116 32 };
n@1116 33 } else {
n@1116 34 factory( global );
n@1116 35 }
n@1116 36
n@1116 37 // Pass this if window is not defined yet
n@1116 38 }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
n@1116 39
n@1116 40 // Support: Firefox 18+
n@1116 41 // Can't be in strict mode, several libs including ASP.NET trace
n@1116 42 // the stack via arguments.caller.callee and Firefox dies if
n@1116 43 // you try to trace through "use strict" call chains. (#13335)
n@1116 44 //
n@1116 45
n@1116 46 var arr = [];
n@1116 47
n@1116 48 var slice = arr.slice;
n@1116 49
n@1116 50 var concat = arr.concat;
n@1116 51
n@1116 52 var push = arr.push;
n@1116 53
n@1116 54 var indexOf = arr.indexOf;
n@1116 55
n@1116 56 var class2type = {};
n@1116 57
n@1116 58 var toString = class2type.toString;
n@1116 59
n@1116 60 var hasOwn = class2type.hasOwnProperty;
n@1116 61
n@1116 62 var support = {};
n@1116 63
n@1116 64
n@1116 65
n@1116 66 var
n@1116 67 // Use the correct document accordingly with window argument (sandbox)
n@1116 68 document = window.document,
n@1116 69
n@1116 70 version = "2.1.4",
n@1116 71
n@1116 72 // Define a local copy of jQuery
n@1116 73 jQuery = function( selector, context ) {
n@1116 74 // The jQuery object is actually just the init constructor 'enhanced'
n@1116 75 // Need init if jQuery is called (just allow error to be thrown if not included)
n@1116 76 return new jQuery.fn.init( selector, context );
n@1116 77 },
n@1116 78
n@1116 79 // Support: Android<4.1
n@1116 80 // Make sure we trim BOM and NBSP
n@1116 81 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
n@1116 82
n@1116 83 // Matches dashed string for camelizing
n@1116 84 rmsPrefix = /^-ms-/,
n@1116 85 rdashAlpha = /-([\da-z])/gi,
n@1116 86
n@1116 87 // Used by jQuery.camelCase as callback to replace()
n@1116 88 fcamelCase = function( all, letter ) {
n@1116 89 return letter.toUpperCase();
n@1116 90 };
n@1116 91
n@1116 92 jQuery.fn = jQuery.prototype = {
n@1116 93 // The current version of jQuery being used
n@1116 94 jquery: version,
n@1116 95
n@1116 96 constructor: jQuery,
n@1116 97
n@1116 98 // Start with an empty selector
n@1116 99 selector: "",
n@1116 100
n@1116 101 // The default length of a jQuery object is 0
n@1116 102 length: 0,
n@1116 103
n@1116 104 toArray: function() {
n@1116 105 return slice.call( this );
n@1116 106 },
n@1116 107
n@1116 108 // Get the Nth element in the matched element set OR
n@1116 109 // Get the whole matched element set as a clean array
n@1116 110 get: function( num ) {
n@1116 111 return num != null ?
n@1116 112
n@1116 113 // Return just the one element from the set
n@1116 114 ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
n@1116 115
n@1116 116 // Return all the elements in a clean array
n@1116 117 slice.call( this );
n@1116 118 },
n@1116 119
n@1116 120 // Take an array of elements and push it onto the stack
n@1116 121 // (returning the new matched element set)
n@1116 122 pushStack: function( elems ) {
n@1116 123
n@1116 124 // Build a new jQuery matched element set
n@1116 125 var ret = jQuery.merge( this.constructor(), elems );
n@1116 126
n@1116 127 // Add the old object onto the stack (as a reference)
n@1116 128 ret.prevObject = this;
n@1116 129 ret.context = this.context;
n@1116 130
n@1116 131 // Return the newly-formed element set
n@1116 132 return ret;
n@1116 133 },
n@1116 134
n@1116 135 // Execute a callback for every element in the matched set.
n@1116 136 // (You can seed the arguments with an array of args, but this is
n@1116 137 // only used internally.)
n@1116 138 each: function( callback, args ) {
n@1116 139 return jQuery.each( this, callback, args );
n@1116 140 },
n@1116 141
n@1116 142 map: function( callback ) {
n@1116 143 return this.pushStack( jQuery.map(this, function( elem, i ) {
n@1116 144 return callback.call( elem, i, elem );
n@1116 145 }));
n@1116 146 },
n@1116 147
n@1116 148 slice: function() {
n@1116 149 return this.pushStack( slice.apply( this, arguments ) );
n@1116 150 },
n@1116 151
n@1116 152 first: function() {
n@1116 153 return this.eq( 0 );
n@1116 154 },
n@1116 155
n@1116 156 last: function() {
n@1116 157 return this.eq( -1 );
n@1116 158 },
n@1116 159
n@1116 160 eq: function( i ) {
n@1116 161 var len = this.length,
n@1116 162 j = +i + ( i < 0 ? len : 0 );
n@1116 163 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
n@1116 164 },
n@1116 165
n@1116 166 end: function() {
n@1116 167 return this.prevObject || this.constructor(null);
n@1116 168 },
n@1116 169
n@1116 170 // For internal use only.
n@1116 171 // Behaves like an Array's method, not like a jQuery method.
n@1116 172 push: push,
n@1116 173 sort: arr.sort,
n@1116 174 splice: arr.splice
n@1116 175 };
n@1116 176
n@1116 177 jQuery.extend = jQuery.fn.extend = function() {
n@1116 178 var options, name, src, copy, copyIsArray, clone,
n@1116 179 target = arguments[0] || {},
n@1116 180 i = 1,
n@1116 181 length = arguments.length,
n@1116 182 deep = false;
n@1116 183
n@1116 184 // Handle a deep copy situation
n@1116 185 if ( typeof target === "boolean" ) {
n@1116 186 deep = target;
n@1116 187
n@1116 188 // Skip the boolean and the target
n@1116 189 target = arguments[ i ] || {};
n@1116 190 i++;
n@1116 191 }
n@1116 192
n@1116 193 // Handle case when target is a string or something (possible in deep copy)
n@1116 194 if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
n@1116 195 target = {};
n@1116 196 }
n@1116 197
n@1116 198 // Extend jQuery itself if only one argument is passed
n@1116 199 if ( i === length ) {
n@1116 200 target = this;
n@1116 201 i--;
n@1116 202 }
n@1116 203
n@1116 204 for ( ; i < length; i++ ) {
n@1116 205 // Only deal with non-null/undefined values
n@1116 206 if ( (options = arguments[ i ]) != null ) {
n@1116 207 // Extend the base object
n@1116 208 for ( name in options ) {
n@1116 209 src = target[ name ];
n@1116 210 copy = options[ name ];
n@1116 211
n@1116 212 // Prevent never-ending loop
n@1116 213 if ( target === copy ) {
n@1116 214 continue;
n@1116 215 }
n@1116 216
n@1116 217 // Recurse if we're merging plain objects or arrays
n@1116 218 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
n@1116 219 if ( copyIsArray ) {
n@1116 220 copyIsArray = false;
n@1116 221 clone = src && jQuery.isArray(src) ? src : [];
n@1116 222
n@1116 223 } else {
n@1116 224 clone = src && jQuery.isPlainObject(src) ? src : {};
n@1116 225 }
n@1116 226
n@1116 227 // Never move original objects, clone them
n@1116 228 target[ name ] = jQuery.extend( deep, clone, copy );
n@1116 229
n@1116 230 // Don't bring in undefined values
n@1116 231 } else if ( copy !== undefined ) {
n@1116 232 target[ name ] = copy;
n@1116 233 }
n@1116 234 }
n@1116 235 }
n@1116 236 }
n@1116 237
n@1116 238 // Return the modified object
n@1116 239 return target;
n@1116 240 };
n@1116 241
n@1116 242 jQuery.extend({
n@1116 243 // Unique for each copy of jQuery on the page
n@1116 244 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
n@1116 245
n@1116 246 // Assume jQuery is ready without the ready module
n@1116 247 isReady: true,
n@1116 248
n@1116 249 error: function( msg ) {
n@1116 250 throw new Error( msg );
n@1116 251 },
n@1116 252
n@1116 253 noop: function() {},
n@1116 254
n@1116 255 isFunction: function( obj ) {
n@1116 256 return jQuery.type(obj) === "function";
n@1116 257 },
n@1116 258
n@1116 259 isArray: Array.isArray,
n@1116 260
n@1116 261 isWindow: function( obj ) {
n@1116 262 return obj != null && obj === obj.window;
n@1116 263 },
n@1116 264
n@1116 265 isNumeric: function( obj ) {
n@1116 266 // parseFloat NaNs numeric-cast false positives (null|true|false|"")
n@1116 267 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
n@1116 268 // subtraction forces infinities to NaN
n@1116 269 // adding 1 corrects loss of precision from parseFloat (#15100)
n@1116 270 return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
n@1116 271 },
n@1116 272
n@1116 273 isPlainObject: function( obj ) {
n@1116 274 // Not plain objects:
n@1116 275 // - Any object or value whose internal [[Class]] property is not "[object Object]"
n@1116 276 // - DOM nodes
n@1116 277 // - window
n@1116 278 if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
n@1116 279 return false;
n@1116 280 }
n@1116 281
n@1116 282 if ( obj.constructor &&
n@1116 283 !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
n@1116 284 return false;
n@1116 285 }
n@1116 286
n@1116 287 // If the function hasn't returned already, we're confident that
n@1116 288 // |obj| is a plain object, created by {} or constructed with new Object
n@1116 289 return true;
n@1116 290 },
n@1116 291
n@1116 292 isEmptyObject: function( obj ) {
n@1116 293 var name;
n@1116 294 for ( name in obj ) {
n@1116 295 return false;
n@1116 296 }
n@1116 297 return true;
n@1116 298 },
n@1116 299
n@1116 300 type: function( obj ) {
n@1116 301 if ( obj == null ) {
n@1116 302 return obj + "";
n@1116 303 }
n@1116 304 // Support: Android<4.0, iOS<6 (functionish RegExp)
n@1116 305 return typeof obj === "object" || typeof obj === "function" ?
n@1116 306 class2type[ toString.call(obj) ] || "object" :
n@1116 307 typeof obj;
n@1116 308 },
n@1116 309
n@1116 310 // Evaluates a script in a global context
n@1116 311 globalEval: function( code ) {
n@1116 312 var script,
n@1116 313 indirect = eval;
n@1116 314
n@1116 315 code = jQuery.trim( code );
n@1116 316
n@1116 317 if ( code ) {
n@1116 318 // If the code includes a valid, prologue position
n@1116 319 // strict mode pragma, execute code by injecting a
n@1116 320 // script tag into the document.
n@1116 321 if ( code.indexOf("use strict") === 1 ) {
n@1116 322 script = document.createElement("script");
n@1116 323 script.text = code;
n@1116 324 document.head.appendChild( script ).parentNode.removeChild( script );
n@1116 325 } else {
n@1116 326 // Otherwise, avoid the DOM node creation, insertion
n@1116 327 // and removal by using an indirect global eval
n@1116 328 indirect( code );
n@1116 329 }
n@1116 330 }
n@1116 331 },
n@1116 332
n@1116 333 // Convert dashed to camelCase; used by the css and data modules
n@1116 334 // Support: IE9-11+
n@1116 335 // Microsoft forgot to hump their vendor prefix (#9572)
n@1116 336 camelCase: function( string ) {
n@1116 337 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
n@1116 338 },
n@1116 339
n@1116 340 nodeName: function( elem, name ) {
n@1116 341 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
n@1116 342 },
n@1116 343
n@1116 344 // args is for internal usage only
n@1116 345 each: function( obj, callback, args ) {
n@1116 346 var value,
n@1116 347 i = 0,
n@1116 348 length = obj.length,
n@1116 349 isArray = isArraylike( obj );
n@1116 350
n@1116 351 if ( args ) {
n@1116 352 if ( isArray ) {
n@1116 353 for ( ; i < length; i++ ) {
n@1116 354 value = callback.apply( obj[ i ], args );
n@1116 355
n@1116 356 if ( value === false ) {
n@1116 357 break;
n@1116 358 }
n@1116 359 }
n@1116 360 } else {
n@1116 361 for ( i in obj ) {
n@1116 362 value = callback.apply( obj[ i ], args );
n@1116 363
n@1116 364 if ( value === false ) {
n@1116 365 break;
n@1116 366 }
n@1116 367 }
n@1116 368 }
n@1116 369
n@1116 370 // A special, fast, case for the most common use of each
n@1116 371 } else {
n@1116 372 if ( isArray ) {
n@1116 373 for ( ; i < length; i++ ) {
n@1116 374 value = callback.call( obj[ i ], i, obj[ i ] );
n@1116 375
n@1116 376 if ( value === false ) {
n@1116 377 break;
n@1116 378 }
n@1116 379 }
n@1116 380 } else {
n@1116 381 for ( i in obj ) {
n@1116 382 value = callback.call( obj[ i ], i, obj[ i ] );
n@1116 383
n@1116 384 if ( value === false ) {
n@1116 385 break;
n@1116 386 }
n@1116 387 }
n@1116 388 }
n@1116 389 }
n@1116 390
n@1116 391 return obj;
n@1116 392 },
n@1116 393
n@1116 394 // Support: Android<4.1
n@1116 395 trim: function( text ) {
n@1116 396 return text == null ?
n@1116 397 "" :
n@1116 398 ( text + "" ).replace( rtrim, "" );
n@1116 399 },
n@1116 400
n@1116 401 // results is for internal usage only
n@1116 402 makeArray: function( arr, results ) {
n@1116 403 var ret = results || [];
n@1116 404
n@1116 405 if ( arr != null ) {
n@1116 406 if ( isArraylike( Object(arr) ) ) {
n@1116 407 jQuery.merge( ret,
n@1116 408 typeof arr === "string" ?
n@1116 409 [ arr ] : arr
n@1116 410 );
n@1116 411 } else {
n@1116 412 push.call( ret, arr );
n@1116 413 }
n@1116 414 }
n@1116 415
n@1116 416 return ret;
n@1116 417 },
n@1116 418
n@1116 419 inArray: function( elem, arr, i ) {
n@1116 420 return arr == null ? -1 : indexOf.call( arr, elem, i );
n@1116 421 },
n@1116 422
n@1116 423 merge: function( first, second ) {
n@1116 424 var len = +second.length,
n@1116 425 j = 0,
n@1116 426 i = first.length;
n@1116 427
n@1116 428 for ( ; j < len; j++ ) {
n@1116 429 first[ i++ ] = second[ j ];
n@1116 430 }
n@1116 431
n@1116 432 first.length = i;
n@1116 433
n@1116 434 return first;
n@1116 435 },
n@1116 436
n@1116 437 grep: function( elems, callback, invert ) {
n@1116 438 var callbackInverse,
n@1116 439 matches = [],
n@1116 440 i = 0,
n@1116 441 length = elems.length,
n@1116 442 callbackExpect = !invert;
n@1116 443
n@1116 444 // Go through the array, only saving the items
n@1116 445 // that pass the validator function
n@1116 446 for ( ; i < length; i++ ) {
n@1116 447 callbackInverse = !callback( elems[ i ], i );
n@1116 448 if ( callbackInverse !== callbackExpect ) {
n@1116 449 matches.push( elems[ i ] );
n@1116 450 }
n@1116 451 }
n@1116 452
n@1116 453 return matches;
n@1116 454 },
n@1116 455
n@1116 456 // arg is for internal usage only
n@1116 457 map: function( elems, callback, arg ) {
n@1116 458 var value,
n@1116 459 i = 0,
n@1116 460 length = elems.length,
n@1116 461 isArray = isArraylike( elems ),
n@1116 462 ret = [];
n@1116 463
n@1116 464 // Go through the array, translating each of the items to their new values
n@1116 465 if ( isArray ) {
n@1116 466 for ( ; i < length; i++ ) {
n@1116 467 value = callback( elems[ i ], i, arg );
n@1116 468
n@1116 469 if ( value != null ) {
n@1116 470 ret.push( value );
n@1116 471 }
n@1116 472 }
n@1116 473
n@1116 474 // Go through every key on the object,
n@1116 475 } else {
n@1116 476 for ( i in elems ) {
n@1116 477 value = callback( elems[ i ], i, arg );
n@1116 478
n@1116 479 if ( value != null ) {
n@1116 480 ret.push( value );
n@1116 481 }
n@1116 482 }
n@1116 483 }
n@1116 484
n@1116 485 // Flatten any nested arrays
n@1116 486 return concat.apply( [], ret );
n@1116 487 },
n@1116 488
n@1116 489 // A global GUID counter for objects
n@1116 490 guid: 1,
n@1116 491
n@1116 492 // Bind a function to a context, optionally partially applying any
n@1116 493 // arguments.
n@1116 494 proxy: function( fn, context ) {
n@1116 495 var tmp, args, proxy;
n@1116 496
n@1116 497 if ( typeof context === "string" ) {
n@1116 498 tmp = fn[ context ];
n@1116 499 context = fn;
n@1116 500 fn = tmp;
n@1116 501 }
n@1116 502
n@1116 503 // Quick check to determine if target is callable, in the spec
n@1116 504 // this throws a TypeError, but we will just return undefined.
n@1116 505 if ( !jQuery.isFunction( fn ) ) {
n@1116 506 return undefined;
n@1116 507 }
n@1116 508
n@1116 509 // Simulated bind
n@1116 510 args = slice.call( arguments, 2 );
n@1116 511 proxy = function() {
n@1116 512 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
n@1116 513 };
n@1116 514
n@1116 515 // Set the guid of unique handler to the same of original handler, so it can be removed
n@1116 516 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
n@1116 517
n@1116 518 return proxy;
n@1116 519 },
n@1116 520
n@1116 521 now: Date.now,
n@1116 522
n@1116 523 // jQuery.support is not used in Core but other projects attach their
n@1116 524 // properties to it so it needs to exist.
n@1116 525 support: support
n@1116 526 });
n@1116 527
n@1116 528 // Populate the class2type map
n@1116 529 jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
n@1116 530 class2type[ "[object " + name + "]" ] = name.toLowerCase();
n@1116 531 });
n@1116 532
n@1116 533 function isArraylike( obj ) {
n@1116 534
n@1116 535 // Support: iOS 8.2 (not reproducible in simulator)
n@1116 536 // `in` check used to prevent JIT error (gh-2145)
n@1116 537 // hasOwn isn't used here due to false negatives
n@1116 538 // regarding Nodelist length in IE
n@1116 539 var length = "length" in obj && obj.length,
n@1116 540 type = jQuery.type( obj );
n@1116 541
n@1116 542 if ( type === "function" || jQuery.isWindow( obj ) ) {
n@1116 543 return false;
n@1116 544 }
n@1116 545
n@1116 546 if ( obj.nodeType === 1 && length ) {
n@1116 547 return true;
n@1116 548 }
n@1116 549
n@1116 550 return type === "array" || length === 0 ||
n@1116 551 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
n@1116 552 }
n@1116 553 var Sizzle =
n@1116 554 /*!
n@1116 555 * Sizzle CSS Selector Engine v2.2.0-pre
n@1116 556 * http://sizzlejs.com/
n@1116 557 *
n@1116 558 * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
n@1116 559 * Released under the MIT license
n@1116 560 * http://jquery.org/license
n@1116 561 *
n@1116 562 * Date: 2014-12-16
n@1116 563 */
n@1116 564 (function( window ) {
n@1116 565
n@1116 566 var i,
n@1116 567 support,
n@1116 568 Expr,
n@1116 569 getText,
n@1116 570 isXML,
n@1116 571 tokenize,
n@1116 572 compile,
n@1116 573 select,
n@1116 574 outermostContext,
n@1116 575 sortInput,
n@1116 576 hasDuplicate,
n@1116 577
n@1116 578 // Local document vars
n@1116 579 setDocument,
n@1116 580 document,
n@1116 581 docElem,
n@1116 582 documentIsHTML,
n@1116 583 rbuggyQSA,
n@1116 584 rbuggyMatches,
n@1116 585 matches,
n@1116 586 contains,
n@1116 587
n@1116 588 // Instance-specific data
n@1116 589 expando = "sizzle" + 1 * new Date(),
n@1116 590 preferredDoc = window.document,
n@1116 591 dirruns = 0,
n@1116 592 done = 0,
n@1116 593 classCache = createCache(),
n@1116 594 tokenCache = createCache(),
n@1116 595 compilerCache = createCache(),
n@1116 596 sortOrder = function( a, b ) {
n@1116 597 if ( a === b ) {
n@1116 598 hasDuplicate = true;
n@1116 599 }
n@1116 600 return 0;
n@1116 601 },
n@1116 602
n@1116 603 // General-purpose constants
n@1116 604 MAX_NEGATIVE = 1 << 31,
n@1116 605
n@1116 606 // Instance methods
n@1116 607 hasOwn = ({}).hasOwnProperty,
n@1116 608 arr = [],
n@1116 609 pop = arr.pop,
n@1116 610 push_native = arr.push,
n@1116 611 push = arr.push,
n@1116 612 slice = arr.slice,
n@1116 613 // Use a stripped-down indexOf as it's faster than native
n@1116 614 // http://jsperf.com/thor-indexof-vs-for/5
n@1116 615 indexOf = function( list, elem ) {
n@1116 616 var i = 0,
n@1116 617 len = list.length;
n@1116 618 for ( ; i < len; i++ ) {
n@1116 619 if ( list[i] === elem ) {
n@1116 620 return i;
n@1116 621 }
n@1116 622 }
n@1116 623 return -1;
n@1116 624 },
n@1116 625
n@1116 626 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
n@1116 627
n@1116 628 // Regular expressions
n@1116 629
n@1116 630 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
n@1116 631 whitespace = "[\\x20\\t\\r\\n\\f]",
n@1116 632 // http://www.w3.org/TR/css3-syntax/#characters
n@1116 633 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
n@1116 634
n@1116 635 // Loosely modeled on CSS identifier characters
n@1116 636 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
n@1116 637 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
n@1116 638 identifier = characterEncoding.replace( "w", "w#" ),
n@1116 639
n@1116 640 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
n@1116 641 attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
n@1116 642 // Operator (capture 2)
n@1116 643 "*([*^$|!~]?=)" + whitespace +
n@1116 644 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
n@1116 645 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
n@1116 646 "*\\]",
n@1116 647
n@1116 648 pseudos = ":(" + characterEncoding + ")(?:\\((" +
n@1116 649 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
n@1116 650 // 1. quoted (capture 3; capture 4 or capture 5)
n@1116 651 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
n@1116 652 // 2. simple (capture 6)
n@1116 653 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
n@1116 654 // 3. anything else (capture 2)
n@1116 655 ".*" +
n@1116 656 ")\\)|)",
n@1116 657
n@1116 658 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
n@1116 659 rwhitespace = new RegExp( whitespace + "+", "g" ),
n@1116 660 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
n@1116 661
n@1116 662 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
n@1116 663 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
n@1116 664
n@1116 665 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
n@1116 666
n@1116 667 rpseudo = new RegExp( pseudos ),
n@1116 668 ridentifier = new RegExp( "^" + identifier + "$" ),
n@1116 669
n@1116 670 matchExpr = {
n@1116 671 "ID": new RegExp( "^#(" + characterEncoding + ")" ),
n@1116 672 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
n@1116 673 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
n@1116 674 "ATTR": new RegExp( "^" + attributes ),
n@1116 675 "PSEUDO": new RegExp( "^" + pseudos ),
n@1116 676 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
n@1116 677 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
n@1116 678 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
n@1116 679 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
n@1116 680 // For use in libraries implementing .is()
n@1116 681 // We use this for POS matching in `select`
n@1116 682 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
n@1116 683 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
n@1116 684 },
n@1116 685
n@1116 686 rinputs = /^(?:input|select|textarea|button)$/i,
n@1116 687 rheader = /^h\d$/i,
n@1116 688
n@1116 689 rnative = /^[^{]+\{\s*\[native \w/,
n@1116 690
n@1116 691 // Easily-parseable/retrievable ID or TAG or CLASS selectors
n@1116 692 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
n@1116 693
n@1116 694 rsibling = /[+~]/,
n@1116 695 rescape = /'|\\/g,
n@1116 696
n@1116 697 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
n@1116 698 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
n@1116 699 funescape = function( _, escaped, escapedWhitespace ) {
n@1116 700 var high = "0x" + escaped - 0x10000;
n@1116 701 // NaN means non-codepoint
n@1116 702 // Support: Firefox<24
n@1116 703 // Workaround erroneous numeric interpretation of +"0x"
n@1116 704 return high !== high || escapedWhitespace ?
n@1116 705 escaped :
n@1116 706 high < 0 ?
n@1116 707 // BMP codepoint
n@1116 708 String.fromCharCode( high + 0x10000 ) :
n@1116 709 // Supplemental Plane codepoint (surrogate pair)
n@1116 710 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
n@1116 711 },
n@1116 712
n@1116 713 // Used for iframes
n@1116 714 // See setDocument()
n@1116 715 // Removing the function wrapper causes a "Permission Denied"
n@1116 716 // error in IE
n@1116 717 unloadHandler = function() {
n@1116 718 setDocument();
n@1116 719 };
n@1116 720
n@1116 721 // Optimize for push.apply( _, NodeList )
n@1116 722 try {
n@1116 723 push.apply(
n@1116 724 (arr = slice.call( preferredDoc.childNodes )),
n@1116 725 preferredDoc.childNodes
n@1116 726 );
n@1116 727 // Support: Android<4.0
n@1116 728 // Detect silently failing push.apply
n@1116 729 arr[ preferredDoc.childNodes.length ].nodeType;
n@1116 730 } catch ( e ) {
n@1116 731 push = { apply: arr.length ?
n@1116 732
n@1116 733 // Leverage slice if possible
n@1116 734 function( target, els ) {
n@1116 735 push_native.apply( target, slice.call(els) );
n@1116 736 } :
n@1116 737
n@1116 738 // Support: IE<9
n@1116 739 // Otherwise append directly
n@1116 740 function( target, els ) {
n@1116 741 var j = target.length,
n@1116 742 i = 0;
n@1116 743 // Can't trust NodeList.length
n@1116 744 while ( (target[j++] = els[i++]) ) {}
n@1116 745 target.length = j - 1;
n@1116 746 }
n@1116 747 };
n@1116 748 }
n@1116 749
n@1116 750 function Sizzle( selector, context, results, seed ) {
n@1116 751 var match, elem, m, nodeType,
n@1116 752 // QSA vars
n@1116 753 i, groups, old, nid, newContext, newSelector;
n@1116 754
n@1116 755 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
n@1116 756 setDocument( context );
n@1116 757 }
n@1116 758
n@1116 759 context = context || document;
n@1116 760 results = results || [];
n@1116 761 nodeType = context.nodeType;
n@1116 762
n@1116 763 if ( typeof selector !== "string" || !selector ||
n@1116 764 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
n@1116 765
n@1116 766 return results;
n@1116 767 }
n@1116 768
n@1116 769 if ( !seed && documentIsHTML ) {
n@1116 770
n@1116 771 // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
n@1116 772 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
n@1116 773 // Speed-up: Sizzle("#ID")
n@1116 774 if ( (m = match[1]) ) {
n@1116 775 if ( nodeType === 9 ) {
n@1116 776 elem = context.getElementById( m );
n@1116 777 // Check parentNode to catch when Blackberry 4.6 returns
n@1116 778 // nodes that are no longer in the document (jQuery #6963)
n@1116 779 if ( elem && elem.parentNode ) {
n@1116 780 // Handle the case where IE, Opera, and Webkit return items
n@1116 781 // by name instead of ID
n@1116 782 if ( elem.id === m ) {
n@1116 783 results.push( elem );
n@1116 784 return results;
n@1116 785 }
n@1116 786 } else {
n@1116 787 return results;
n@1116 788 }
n@1116 789 } else {
n@1116 790 // Context is not a document
n@1116 791 if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
n@1116 792 contains( context, elem ) && elem.id === m ) {
n@1116 793 results.push( elem );
n@1116 794 return results;
n@1116 795 }
n@1116 796 }
n@1116 797
n@1116 798 // Speed-up: Sizzle("TAG")
n@1116 799 } else if ( match[2] ) {
n@1116 800 push.apply( results, context.getElementsByTagName( selector ) );
n@1116 801 return results;
n@1116 802
n@1116 803 // Speed-up: Sizzle(".CLASS")
n@1116 804 } else if ( (m = match[3]) && support.getElementsByClassName ) {
n@1116 805 push.apply( results, context.getElementsByClassName( m ) );
n@1116 806 return results;
n@1116 807 }
n@1116 808 }
n@1116 809
n@1116 810 // QSA path
n@1116 811 if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
n@1116 812 nid = old = expando;
n@1116 813 newContext = context;
n@1116 814 newSelector = nodeType !== 1 && selector;
n@1116 815
n@1116 816 // qSA works strangely on Element-rooted queries
n@1116 817 // We can work around this by specifying an extra ID on the root
n@1116 818 // and working up from there (Thanks to Andrew Dupont for the technique)
n@1116 819 // IE 8 doesn't work on object elements
n@1116 820 if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
n@1116 821 groups = tokenize( selector );
n@1116 822
n@1116 823 if ( (old = context.getAttribute("id")) ) {
n@1116 824 nid = old.replace( rescape, "\\$&" );
n@1116 825 } else {
n@1116 826 context.setAttribute( "id", nid );
n@1116 827 }
n@1116 828 nid = "[id='" + nid + "'] ";
n@1116 829
n@1116 830 i = groups.length;
n@1116 831 while ( i-- ) {
n@1116 832 groups[i] = nid + toSelector( groups[i] );
n@1116 833 }
n@1116 834 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
n@1116 835 newSelector = groups.join(",");
n@1116 836 }
n@1116 837
n@1116 838 if ( newSelector ) {
n@1116 839 try {
n@1116 840 push.apply( results,
n@1116 841 newContext.querySelectorAll( newSelector )
n@1116 842 );
n@1116 843 return results;
n@1116 844 } catch(qsaError) {
n@1116 845 } finally {
n@1116 846 if ( !old ) {
n@1116 847 context.removeAttribute("id");
n@1116 848 }
n@1116 849 }
n@1116 850 }
n@1116 851 }
n@1116 852 }
n@1116 853
n@1116 854 // All others
n@1116 855 return select( selector.replace( rtrim, "$1" ), context, results, seed );
n@1116 856 }
n@1116 857
n@1116 858 /**
n@1116 859 * Create key-value caches of limited size
n@1116 860 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
n@1116 861 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
n@1116 862 * deleting the oldest entry
n@1116 863 */
n@1116 864 function createCache() {
n@1116 865 var keys = [];
n@1116 866
n@1116 867 function cache( key, value ) {
n@1116 868 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
n@1116 869 if ( keys.push( key + " " ) > Expr.cacheLength ) {
n@1116 870 // Only keep the most recent entries
n@1116 871 delete cache[ keys.shift() ];
n@1116 872 }
n@1116 873 return (cache[ key + " " ] = value);
n@1116 874 }
n@1116 875 return cache;
n@1116 876 }
n@1116 877
n@1116 878 /**
n@1116 879 * Mark a function for special use by Sizzle
n@1116 880 * @param {Function} fn The function to mark
n@1116 881 */
n@1116 882 function markFunction( fn ) {
n@1116 883 fn[ expando ] = true;
n@1116 884 return fn;
n@1116 885 }
n@1116 886
n@1116 887 /**
n@1116 888 * Support testing using an element
n@1116 889 * @param {Function} fn Passed the created div and expects a boolean result
n@1116 890 */
n@1116 891 function assert( fn ) {
n@1116 892 var div = document.createElement("div");
n@1116 893
n@1116 894 try {
n@1116 895 return !!fn( div );
n@1116 896 } catch (e) {
n@1116 897 return false;
n@1116 898 } finally {
n@1116 899 // Remove from its parent by default
n@1116 900 if ( div.parentNode ) {
n@1116 901 div.parentNode.removeChild( div );
n@1116 902 }
n@1116 903 // release memory in IE
n@1116 904 div = null;
n@1116 905 }
n@1116 906 }
n@1116 907
n@1116 908 /**
n@1116 909 * Adds the same handler for all of the specified attrs
n@1116 910 * @param {String} attrs Pipe-separated list of attributes
n@1116 911 * @param {Function} handler The method that will be applied
n@1116 912 */
n@1116 913 function addHandle( attrs, handler ) {
n@1116 914 var arr = attrs.split("|"),
n@1116 915 i = attrs.length;
n@1116 916
n@1116 917 while ( i-- ) {
n@1116 918 Expr.attrHandle[ arr[i] ] = handler;
n@1116 919 }
n@1116 920 }
n@1116 921
n@1116 922 /**
n@1116 923 * Checks document order of two siblings
n@1116 924 * @param {Element} a
n@1116 925 * @param {Element} b
n@1116 926 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
n@1116 927 */
n@1116 928 function siblingCheck( a, b ) {
n@1116 929 var cur = b && a,
n@1116 930 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
n@1116 931 ( ~b.sourceIndex || MAX_NEGATIVE ) -
n@1116 932 ( ~a.sourceIndex || MAX_NEGATIVE );
n@1116 933
n@1116 934 // Use IE sourceIndex if available on both nodes
n@1116 935 if ( diff ) {
n@1116 936 return diff;
n@1116 937 }
n@1116 938
n@1116 939 // Check if b follows a
n@1116 940 if ( cur ) {
n@1116 941 while ( (cur = cur.nextSibling) ) {
n@1116 942 if ( cur === b ) {
n@1116 943 return -1;
n@1116 944 }
n@1116 945 }
n@1116 946 }
n@1116 947
n@1116 948 return a ? 1 : -1;
n@1116 949 }
n@1116 950
n@1116 951 /**
n@1116 952 * Returns a function to use in pseudos for input types
n@1116 953 * @param {String} type
n@1116 954 */
n@1116 955 function createInputPseudo( type ) {
n@1116 956 return function( elem ) {
n@1116 957 var name = elem.nodeName.toLowerCase();
n@1116 958 return name === "input" && elem.type === type;
n@1116 959 };
n@1116 960 }
n@1116 961
n@1116 962 /**
n@1116 963 * Returns a function to use in pseudos for buttons
n@1116 964 * @param {String} type
n@1116 965 */
n@1116 966 function createButtonPseudo( type ) {
n@1116 967 return function( elem ) {
n@1116 968 var name = elem.nodeName.toLowerCase();
n@1116 969 return (name === "input" || name === "button") && elem.type === type;
n@1116 970 };
n@1116 971 }
n@1116 972
n@1116 973 /**
n@1116 974 * Returns a function to use in pseudos for positionals
n@1116 975 * @param {Function} fn
n@1116 976 */
n@1116 977 function createPositionalPseudo( fn ) {
n@1116 978 return markFunction(function( argument ) {
n@1116 979 argument = +argument;
n@1116 980 return markFunction(function( seed, matches ) {
n@1116 981 var j,
n@1116 982 matchIndexes = fn( [], seed.length, argument ),
n@1116 983 i = matchIndexes.length;
n@1116 984
n@1116 985 // Match elements found at the specified indexes
n@1116 986 while ( i-- ) {
n@1116 987 if ( seed[ (j = matchIndexes[i]) ] ) {
n@1116 988 seed[j] = !(matches[j] = seed[j]);
n@1116 989 }
n@1116 990 }
n@1116 991 });
n@1116 992 });
n@1116 993 }
n@1116 994
n@1116 995 /**
n@1116 996 * Checks a node for validity as a Sizzle context
n@1116 997 * @param {Element|Object=} context
n@1116 998 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
n@1116 999 */
n@1116 1000 function testContext( context ) {
n@1116 1001 return context && typeof context.getElementsByTagName !== "undefined" && context;
n@1116 1002 }
n@1116 1003
n@1116 1004 // Expose support vars for convenience
n@1116 1005 support = Sizzle.support = {};
n@1116 1006
n@1116 1007 /**
n@1116 1008 * Detects XML nodes
n@1116 1009 * @param {Element|Object} elem An element or a document
n@1116 1010 * @returns {Boolean} True iff elem is a non-HTML XML node
n@1116 1011 */
n@1116 1012 isXML = Sizzle.isXML = function( elem ) {
n@1116 1013 // documentElement is verified for cases where it doesn't yet exist
n@1116 1014 // (such as loading iframes in IE - #4833)
n@1116 1015 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
n@1116 1016 return documentElement ? documentElement.nodeName !== "HTML" : false;
n@1116 1017 };
n@1116 1018
n@1116 1019 /**
n@1116 1020 * Sets document-related variables once based on the current document
n@1116 1021 * @param {Element|Object} [doc] An element or document object to use to set the document
n@1116 1022 * @returns {Object} Returns the current document
n@1116 1023 */
n@1116 1024 setDocument = Sizzle.setDocument = function( node ) {
n@1116 1025 var hasCompare, parent,
n@1116 1026 doc = node ? node.ownerDocument || node : preferredDoc;
n@1116 1027
n@1116 1028 // If no document and documentElement is available, return
n@1116 1029 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
n@1116 1030 return document;
n@1116 1031 }
n@1116 1032
n@1116 1033 // Set our document
n@1116 1034 document = doc;
n@1116 1035 docElem = doc.documentElement;
n@1116 1036 parent = doc.defaultView;
n@1116 1037
n@1116 1038 // Support: IE>8
n@1116 1039 // If iframe document is assigned to "document" variable and if iframe has been reloaded,
n@1116 1040 // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
n@1116 1041 // IE6-8 do not support the defaultView property so parent will be undefined
n@1116 1042 if ( parent && parent !== parent.top ) {
n@1116 1043 // IE11 does not have attachEvent, so all must suffer
n@1116 1044 if ( parent.addEventListener ) {
n@1116 1045 parent.addEventListener( "unload", unloadHandler, false );
n@1116 1046 } else if ( parent.attachEvent ) {
n@1116 1047 parent.attachEvent( "onunload", unloadHandler );
n@1116 1048 }
n@1116 1049 }
n@1116 1050
n@1116 1051 /* Support tests
n@1116 1052 ---------------------------------------------------------------------- */
n@1116 1053 documentIsHTML = !isXML( doc );
n@1116 1054
n@1116 1055 /* Attributes
n@1116 1056 ---------------------------------------------------------------------- */
n@1116 1057
n@1116 1058 // Support: IE<8
n@1116 1059 // Verify that getAttribute really returns attributes and not properties
n@1116 1060 // (excepting IE8 booleans)
n@1116 1061 support.attributes = assert(function( div ) {
n@1116 1062 div.className = "i";
n@1116 1063 return !div.getAttribute("className");
n@1116 1064 });
n@1116 1065
n@1116 1066 /* getElement(s)By*
n@1116 1067 ---------------------------------------------------------------------- */
n@1116 1068
n@1116 1069 // Check if getElementsByTagName("*") returns only elements
n@1116 1070 support.getElementsByTagName = assert(function( div ) {
n@1116 1071 div.appendChild( doc.createComment("") );
n@1116 1072 return !div.getElementsByTagName("*").length;
n@1116 1073 });
n@1116 1074
n@1116 1075 // Support: IE<9
n@1116 1076 support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
n@1116 1077
n@1116 1078 // Support: IE<10
n@1116 1079 // Check if getElementById returns elements by name
n@1116 1080 // The broken getElementById methods don't pick up programatically-set names,
n@1116 1081 // so use a roundabout getElementsByName test
n@1116 1082 support.getById = assert(function( div ) {
n@1116 1083 docElem.appendChild( div ).id = expando;
n@1116 1084 return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
n@1116 1085 });
n@1116 1086
n@1116 1087 // ID find and filter
n@1116 1088 if ( support.getById ) {
n@1116 1089 Expr.find["ID"] = function( id, context ) {
n@1116 1090 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
n@1116 1091 var m = context.getElementById( id );
n@1116 1092 // Check parentNode to catch when Blackberry 4.6 returns
n@1116 1093 // nodes that are no longer in the document #6963
n@1116 1094 return m && m.parentNode ? [ m ] : [];
n@1116 1095 }
n@1116 1096 };
n@1116 1097 Expr.filter["ID"] = function( id ) {
n@1116 1098 var attrId = id.replace( runescape, funescape );
n@1116 1099 return function( elem ) {
n@1116 1100 return elem.getAttribute("id") === attrId;
n@1116 1101 };
n@1116 1102 };
n@1116 1103 } else {
n@1116 1104 // Support: IE6/7
n@1116 1105 // getElementById is not reliable as a find shortcut
n@1116 1106 delete Expr.find["ID"];
n@1116 1107
n@1116 1108 Expr.filter["ID"] = function( id ) {
n@1116 1109 var attrId = id.replace( runescape, funescape );
n@1116 1110 return function( elem ) {
n@1116 1111 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
n@1116 1112 return node && node.value === attrId;
n@1116 1113 };
n@1116 1114 };
n@1116 1115 }
n@1116 1116
n@1116 1117 // Tag
n@1116 1118 Expr.find["TAG"] = support.getElementsByTagName ?
n@1116 1119 function( tag, context ) {
n@1116 1120 if ( typeof context.getElementsByTagName !== "undefined" ) {
n@1116 1121 return context.getElementsByTagName( tag );
n@1116 1122
n@1116 1123 // DocumentFragment nodes don't have gEBTN
n@1116 1124 } else if ( support.qsa ) {
n@1116 1125 return context.querySelectorAll( tag );
n@1116 1126 }
n@1116 1127 } :
n@1116 1128
n@1116 1129 function( tag, context ) {
n@1116 1130 var elem,
n@1116 1131 tmp = [],
n@1116 1132 i = 0,
n@1116 1133 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
n@1116 1134 results = context.getElementsByTagName( tag );
n@1116 1135
n@1116 1136 // Filter out possible comments
n@1116 1137 if ( tag === "*" ) {
n@1116 1138 while ( (elem = results[i++]) ) {
n@1116 1139 if ( elem.nodeType === 1 ) {
n@1116 1140 tmp.push( elem );
n@1116 1141 }
n@1116 1142 }
n@1116 1143
n@1116 1144 return tmp;
n@1116 1145 }
n@1116 1146 return results;
n@1116 1147 };
n@1116 1148
n@1116 1149 // Class
n@1116 1150 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
n@1116 1151 if ( documentIsHTML ) {
n@1116 1152 return context.getElementsByClassName( className );
n@1116 1153 }
n@1116 1154 };
n@1116 1155
n@1116 1156 /* QSA/matchesSelector
n@1116 1157 ---------------------------------------------------------------------- */
n@1116 1158
n@1116 1159 // QSA and matchesSelector support
n@1116 1160
n@1116 1161 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
n@1116 1162 rbuggyMatches = [];
n@1116 1163
n@1116 1164 // qSa(:focus) reports false when true (Chrome 21)
n@1116 1165 // We allow this because of a bug in IE8/9 that throws an error
n@1116 1166 // whenever `document.activeElement` is accessed on an iframe
n@1116 1167 // So, we allow :focus to pass through QSA all the time to avoid the IE error
n@1116 1168 // See http://bugs.jquery.com/ticket/13378
n@1116 1169 rbuggyQSA = [];
n@1116 1170
n@1116 1171 if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
n@1116 1172 // Build QSA regex
n@1116 1173 // Regex strategy adopted from Diego Perini
n@1116 1174 assert(function( div ) {
n@1116 1175 // Select is set to empty string on purpose
n@1116 1176 // This is to test IE's treatment of not explicitly
n@1116 1177 // setting a boolean content attribute,
n@1116 1178 // since its presence should be enough
n@1116 1179 // http://bugs.jquery.com/ticket/12359
n@1116 1180 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
n@1116 1181 "<select id='" + expando + "-\f]' msallowcapture=''>" +
n@1116 1182 "<option selected=''></option></select>";
n@1116 1183
n@1116 1184 // Support: IE8, Opera 11-12.16
n@1116 1185 // Nothing should be selected when empty strings follow ^= or $= or *=
n@1116 1186 // The test attribute must be unknown in Opera but "safe" for WinRT
n@1116 1187 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
n@1116 1188 if ( div.querySelectorAll("[msallowcapture^='']").length ) {
n@1116 1189 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
n@1116 1190 }
n@1116 1191
n@1116 1192 // Support: IE8
n@1116 1193 // Boolean attributes and "value" are not treated correctly
n@1116 1194 if ( !div.querySelectorAll("[selected]").length ) {
n@1116 1195 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
n@1116 1196 }
n@1116 1197
n@1116 1198 // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
n@1116 1199 if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
n@1116 1200 rbuggyQSA.push("~=");
n@1116 1201 }
n@1116 1202
n@1116 1203 // Webkit/Opera - :checked should return selected option elements
n@1116 1204 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
n@1116 1205 // IE8 throws error here and will not see later tests
n@1116 1206 if ( !div.querySelectorAll(":checked").length ) {
n@1116 1207 rbuggyQSA.push(":checked");
n@1116 1208 }
n@1116 1209
n@1116 1210 // Support: Safari 8+, iOS 8+
n@1116 1211 // https://bugs.webkit.org/show_bug.cgi?id=136851
n@1116 1212 // In-page `selector#id sibing-combinator selector` fails
n@1116 1213 if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
n@1116 1214 rbuggyQSA.push(".#.+[+~]");
n@1116 1215 }
n@1116 1216 });
n@1116 1217
n@1116 1218 assert(function( div ) {
n@1116 1219 // Support: Windows 8 Native Apps
n@1116 1220 // The type and name attributes are restricted during .innerHTML assignment
n@1116 1221 var input = doc.createElement("input");
n@1116 1222 input.setAttribute( "type", "hidden" );
n@1116 1223 div.appendChild( input ).setAttribute( "name", "D" );
n@1116 1224
n@1116 1225 // Support: IE8
n@1116 1226 // Enforce case-sensitivity of name attribute
n@1116 1227 if ( div.querySelectorAll("[name=d]").length ) {
n@1116 1228 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
n@1116 1229 }
n@1116 1230
n@1116 1231 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
n@1116 1232 // IE8 throws error here and will not see later tests
n@1116 1233 if ( !div.querySelectorAll(":enabled").length ) {
n@1116 1234 rbuggyQSA.push( ":enabled", ":disabled" );
n@1116 1235 }
n@1116 1236
n@1116 1237 // Opera 10-11 does not throw on post-comma invalid pseudos
n@1116 1238 div.querySelectorAll("*,:x");
n@1116 1239 rbuggyQSA.push(",.*:");
n@1116 1240 });
n@1116 1241 }
n@1116 1242
n@1116 1243 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
n@1116 1244 docElem.webkitMatchesSelector ||
n@1116 1245 docElem.mozMatchesSelector ||
n@1116 1246 docElem.oMatchesSelector ||
n@1116 1247 docElem.msMatchesSelector) )) ) {
n@1116 1248
n@1116 1249 assert(function( div ) {
n@1116 1250 // Check to see if it's possible to do matchesSelector
n@1116 1251 // on a disconnected node (IE 9)
n@1116 1252 support.disconnectedMatch = matches.call( div, "div" );
n@1116 1253
n@1116 1254 // This should fail with an exception
n@1116 1255 // Gecko does not error, returns false instead
n@1116 1256 matches.call( div, "[s!='']:x" );
n@1116 1257 rbuggyMatches.push( "!=", pseudos );
n@1116 1258 });
n@1116 1259 }
n@1116 1260
n@1116 1261 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
n@1116 1262 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
n@1116 1263
n@1116 1264 /* Contains
n@1116 1265 ---------------------------------------------------------------------- */
n@1116 1266 hasCompare = rnative.test( docElem.compareDocumentPosition );
n@1116 1267
n@1116 1268 // Element contains another
n@1116 1269 // Purposefully does not implement inclusive descendent
n@1116 1270 // As in, an element does not contain itself
n@1116 1271 contains = hasCompare || rnative.test( docElem.contains ) ?
n@1116 1272 function( a, b ) {
n@1116 1273 var adown = a.nodeType === 9 ? a.documentElement : a,
n@1116 1274 bup = b && b.parentNode;
n@1116 1275 return a === bup || !!( bup && bup.nodeType === 1 && (
n@1116 1276 adown.contains ?
n@1116 1277 adown.contains( bup ) :
n@1116 1278 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
n@1116 1279 ));
n@1116 1280 } :
n@1116 1281 function( a, b ) {
n@1116 1282 if ( b ) {
n@1116 1283 while ( (b = b.parentNode) ) {
n@1116 1284 if ( b === a ) {
n@1116 1285 return true;
n@1116 1286 }
n@1116 1287 }
n@1116 1288 }
n@1116 1289 return false;
n@1116 1290 };
n@1116 1291
n@1116 1292 /* Sorting
n@1116 1293 ---------------------------------------------------------------------- */
n@1116 1294
n@1116 1295 // Document order sorting
n@1116 1296 sortOrder = hasCompare ?
n@1116 1297 function( a, b ) {
n@1116 1298
n@1116 1299 // Flag for duplicate removal
n@1116 1300 if ( a === b ) {
n@1116 1301 hasDuplicate = true;
n@1116 1302 return 0;
n@1116 1303 }
n@1116 1304
n@1116 1305 // Sort on method existence if only one input has compareDocumentPosition
n@1116 1306 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
n@1116 1307 if ( compare ) {
n@1116 1308 return compare;
n@1116 1309 }
n@1116 1310
n@1116 1311 // Calculate position if both inputs belong to the same document
n@1116 1312 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
n@1116 1313 a.compareDocumentPosition( b ) :
n@1116 1314
n@1116 1315 // Otherwise we know they are disconnected
n@1116 1316 1;
n@1116 1317
n@1116 1318 // Disconnected nodes
n@1116 1319 if ( compare & 1 ||
n@1116 1320 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
n@1116 1321
n@1116 1322 // Choose the first element that is related to our preferred document
n@1116 1323 if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
n@1116 1324 return -1;
n@1116 1325 }
n@1116 1326 if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
n@1116 1327 return 1;
n@1116 1328 }
n@1116 1329
n@1116 1330 // Maintain original order
n@1116 1331 return sortInput ?
n@1116 1332 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
n@1116 1333 0;
n@1116 1334 }
n@1116 1335
n@1116 1336 return compare & 4 ? -1 : 1;
n@1116 1337 } :
n@1116 1338 function( a, b ) {
n@1116 1339 // Exit early if the nodes are identical
n@1116 1340 if ( a === b ) {
n@1116 1341 hasDuplicate = true;
n@1116 1342 return 0;
n@1116 1343 }
n@1116 1344
n@1116 1345 var cur,
n@1116 1346 i = 0,
n@1116 1347 aup = a.parentNode,
n@1116 1348 bup = b.parentNode,
n@1116 1349 ap = [ a ],
n@1116 1350 bp = [ b ];
n@1116 1351
n@1116 1352 // Parentless nodes are either documents or disconnected
n@1116 1353 if ( !aup || !bup ) {
n@1116 1354 return a === doc ? -1 :
n@1116 1355 b === doc ? 1 :
n@1116 1356 aup ? -1 :
n@1116 1357 bup ? 1 :
n@1116 1358 sortInput ?
n@1116 1359 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
n@1116 1360 0;
n@1116 1361
n@1116 1362 // If the nodes are siblings, we can do a quick check
n@1116 1363 } else if ( aup === bup ) {
n@1116 1364 return siblingCheck( a, b );
n@1116 1365 }
n@1116 1366
n@1116 1367 // Otherwise we need full lists of their ancestors for comparison
n@1116 1368 cur = a;
n@1116 1369 while ( (cur = cur.parentNode) ) {
n@1116 1370 ap.unshift( cur );
n@1116 1371 }
n@1116 1372 cur = b;
n@1116 1373 while ( (cur = cur.parentNode) ) {
n@1116 1374 bp.unshift( cur );
n@1116 1375 }
n@1116 1376
n@1116 1377 // Walk down the tree looking for a discrepancy
n@1116 1378 while ( ap[i] === bp[i] ) {
n@1116 1379 i++;
n@1116 1380 }
n@1116 1381
n@1116 1382 return i ?
n@1116 1383 // Do a sibling check if the nodes have a common ancestor
n@1116 1384 siblingCheck( ap[i], bp[i] ) :
n@1116 1385
n@1116 1386 // Otherwise nodes in our document sort first
n@1116 1387 ap[i] === preferredDoc ? -1 :
n@1116 1388 bp[i] === preferredDoc ? 1 :
n@1116 1389 0;
n@1116 1390 };
n@1116 1391
n@1116 1392 return doc;
n@1116 1393 };
n@1116 1394
n@1116 1395 Sizzle.matches = function( expr, elements ) {
n@1116 1396 return Sizzle( expr, null, null, elements );
n@1116 1397 };
n@1116 1398
n@1116 1399 Sizzle.matchesSelector = function( elem, expr ) {
n@1116 1400 // Set document vars if needed
n@1116 1401 if ( ( elem.ownerDocument || elem ) !== document ) {
n@1116 1402 setDocument( elem );
n@1116 1403 }
n@1116 1404
n@1116 1405 // Make sure that attribute selectors are quoted
n@1116 1406 expr = expr.replace( rattributeQuotes, "='$1']" );
n@1116 1407
n@1116 1408 if ( support.matchesSelector && documentIsHTML &&
n@1116 1409 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
n@1116 1410 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
n@1116 1411
n@1116 1412 try {
n@1116 1413 var ret = matches.call( elem, expr );
n@1116 1414
n@1116 1415 // IE 9's matchesSelector returns false on disconnected nodes
n@1116 1416 if ( ret || support.disconnectedMatch ||
n@1116 1417 // As well, disconnected nodes are said to be in a document
n@1116 1418 // fragment in IE 9
n@1116 1419 elem.document && elem.document.nodeType !== 11 ) {
n@1116 1420 return ret;
n@1116 1421 }
n@1116 1422 } catch (e) {}
n@1116 1423 }
n@1116 1424
n@1116 1425 return Sizzle( expr, document, null, [ elem ] ).length > 0;
n@1116 1426 };
n@1116 1427
n@1116 1428 Sizzle.contains = function( context, elem ) {
n@1116 1429 // Set document vars if needed
n@1116 1430 if ( ( context.ownerDocument || context ) !== document ) {
n@1116 1431 setDocument( context );
n@1116 1432 }
n@1116 1433 return contains( context, elem );
n@1116 1434 };
n@1116 1435
n@1116 1436 Sizzle.attr = function( elem, name ) {
n@1116 1437 // Set document vars if needed
n@1116 1438 if ( ( elem.ownerDocument || elem ) !== document ) {
n@1116 1439 setDocument( elem );
n@1116 1440 }
n@1116 1441
n@1116 1442 var fn = Expr.attrHandle[ name.toLowerCase() ],
n@1116 1443 // Don't get fooled by Object.prototype properties (jQuery #13807)
n@1116 1444 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
n@1116 1445 fn( elem, name, !documentIsHTML ) :
n@1116 1446 undefined;
n@1116 1447
n@1116 1448 return val !== undefined ?
n@1116 1449 val :
n@1116 1450 support.attributes || !documentIsHTML ?
n@1116 1451 elem.getAttribute( name ) :
n@1116 1452 (val = elem.getAttributeNode(name)) && val.specified ?
n@1116 1453 val.value :
n@1116 1454 null;
n@1116 1455 };
n@1116 1456
n@1116 1457 Sizzle.error = function( msg ) {
n@1116 1458 throw new Error( "Syntax error, unrecognized expression: " + msg );
n@1116 1459 };
n@1116 1460
n@1116 1461 /**
n@1116 1462 * Document sorting and removing duplicates
n@1116 1463 * @param {ArrayLike} results
n@1116 1464 */
n@1116 1465 Sizzle.uniqueSort = function( results ) {
n@1116 1466 var elem,
n@1116 1467 duplicates = [],
n@1116 1468 j = 0,
n@1116 1469 i = 0;
n@1116 1470
n@1116 1471 // Unless we *know* we can detect duplicates, assume their presence
n@1116 1472 hasDuplicate = !support.detectDuplicates;
n@1116 1473 sortInput = !support.sortStable && results.slice( 0 );
n@1116 1474 results.sort( sortOrder );
n@1116 1475
n@1116 1476 if ( hasDuplicate ) {
n@1116 1477 while ( (elem = results[i++]) ) {
n@1116 1478 if ( elem === results[ i ] ) {
n@1116 1479 j = duplicates.push( i );
n@1116 1480 }
n@1116 1481 }
n@1116 1482 while ( j-- ) {
n@1116 1483 results.splice( duplicates[ j ], 1 );
n@1116 1484 }
n@1116 1485 }
n@1116 1486
n@1116 1487 // Clear input after sorting to release objects
n@1116 1488 // See https://github.com/jquery/sizzle/pull/225
n@1116 1489 sortInput = null;
n@1116 1490
n@1116 1491 return results;
n@1116 1492 };
n@1116 1493
n@1116 1494 /**
n@1116 1495 * Utility function for retrieving the text value of an array of DOM nodes
n@1116 1496 * @param {Array|Element} elem
n@1116 1497 */
n@1116 1498 getText = Sizzle.getText = function( elem ) {
n@1116 1499 var node,
n@1116 1500 ret = "",
n@1116 1501 i = 0,
n@1116 1502 nodeType = elem.nodeType;
n@1116 1503
n@1116 1504 if ( !nodeType ) {
n@1116 1505 // If no nodeType, this is expected to be an array
n@1116 1506 while ( (node = elem[i++]) ) {
n@1116 1507 // Do not traverse comment nodes
n@1116 1508 ret += getText( node );
n@1116 1509 }
n@1116 1510 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
n@1116 1511 // Use textContent for elements
n@1116 1512 // innerText usage removed for consistency of new lines (jQuery #11153)
n@1116 1513 if ( typeof elem.textContent === "string" ) {
n@1116 1514 return elem.textContent;
n@1116 1515 } else {
n@1116 1516 // Traverse its children
n@1116 1517 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
n@1116 1518 ret += getText( elem );
n@1116 1519 }
n@1116 1520 }
n@1116 1521 } else if ( nodeType === 3 || nodeType === 4 ) {
n@1116 1522 return elem.nodeValue;
n@1116 1523 }
n@1116 1524 // Do not include comment or processing instruction nodes
n@1116 1525
n@1116 1526 return ret;
n@1116 1527 };
n@1116 1528
n@1116 1529 Expr = Sizzle.selectors = {
n@1116 1530
n@1116 1531 // Can be adjusted by the user
n@1116 1532 cacheLength: 50,
n@1116 1533
n@1116 1534 createPseudo: markFunction,
n@1116 1535
n@1116 1536 match: matchExpr,
n@1116 1537
n@1116 1538 attrHandle: {},
n@1116 1539
n@1116 1540 find: {},
n@1116 1541
n@1116 1542 relative: {
n@1116 1543 ">": { dir: "parentNode", first: true },
n@1116 1544 " ": { dir: "parentNode" },
n@1116 1545 "+": { dir: "previousSibling", first: true },
n@1116 1546 "~": { dir: "previousSibling" }
n@1116 1547 },
n@1116 1548
n@1116 1549 preFilter: {
n@1116 1550 "ATTR": function( match ) {
n@1116 1551 match[1] = match[1].replace( runescape, funescape );
n@1116 1552
n@1116 1553 // Move the given value to match[3] whether quoted or unquoted
n@1116 1554 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
n@1116 1555
n@1116 1556 if ( match[2] === "~=" ) {
n@1116 1557 match[3] = " " + match[3] + " ";
n@1116 1558 }
n@1116 1559
n@1116 1560 return match.slice( 0, 4 );
n@1116 1561 },
n@1116 1562
n@1116 1563 "CHILD": function( match ) {
n@1116 1564 /* matches from matchExpr["CHILD"]
n@1116 1565 1 type (only|nth|...)
n@1116 1566 2 what (child|of-type)
n@1116 1567 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
n@1116 1568 4 xn-component of xn+y argument ([+-]?\d*n|)
n@1116 1569 5 sign of xn-component
n@1116 1570 6 x of xn-component
n@1116 1571 7 sign of y-component
n@1116 1572 8 y of y-component
n@1116 1573 */
n@1116 1574 match[1] = match[1].toLowerCase();
n@1116 1575
n@1116 1576 if ( match[1].slice( 0, 3 ) === "nth" ) {
n@1116 1577 // nth-* requires argument
n@1116 1578 if ( !match[3] ) {
n@1116 1579 Sizzle.error( match[0] );
n@1116 1580 }
n@1116 1581
n@1116 1582 // numeric x and y parameters for Expr.filter.CHILD
n@1116 1583 // remember that false/true cast respectively to 0/1
n@1116 1584 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
n@1116 1585 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
n@1116 1586
n@1116 1587 // other types prohibit arguments
n@1116 1588 } else if ( match[3] ) {
n@1116 1589 Sizzle.error( match[0] );
n@1116 1590 }
n@1116 1591
n@1116 1592 return match;
n@1116 1593 },
n@1116 1594
n@1116 1595 "PSEUDO": function( match ) {
n@1116 1596 var excess,
n@1116 1597 unquoted = !match[6] && match[2];
n@1116 1598
n@1116 1599 if ( matchExpr["CHILD"].test( match[0] ) ) {
n@1116 1600 return null;
n@1116 1601 }
n@1116 1602
n@1116 1603 // Accept quoted arguments as-is
n@1116 1604 if ( match[3] ) {
n@1116 1605 match[2] = match[4] || match[5] || "";
n@1116 1606
n@1116 1607 // Strip excess characters from unquoted arguments
n@1116 1608 } else if ( unquoted && rpseudo.test( unquoted ) &&
n@1116 1609 // Get excess from tokenize (recursively)
n@1116 1610 (excess = tokenize( unquoted, true )) &&
n@1116 1611 // advance to the next closing parenthesis
n@1116 1612 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
n@1116 1613
n@1116 1614 // excess is a negative index
n@1116 1615 match[0] = match[0].slice( 0, excess );
n@1116 1616 match[2] = unquoted.slice( 0, excess );
n@1116 1617 }
n@1116 1618
n@1116 1619 // Return only captures needed by the pseudo filter method (type and argument)
n@1116 1620 return match.slice( 0, 3 );
n@1116 1621 }
n@1116 1622 },
n@1116 1623
n@1116 1624 filter: {
n@1116 1625
n@1116 1626 "TAG": function( nodeNameSelector ) {
n@1116 1627 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
n@1116 1628 return nodeNameSelector === "*" ?
n@1116 1629 function() { return true; } :
n@1116 1630 function( elem ) {
n@1116 1631 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
n@1116 1632 };
n@1116 1633 },
n@1116 1634
n@1116 1635 "CLASS": function( className ) {
n@1116 1636 var pattern = classCache[ className + " " ];
n@1116 1637
n@1116 1638 return pattern ||
n@1116 1639 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
n@1116 1640 classCache( className, function( elem ) {
n@1116 1641 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
n@1116 1642 });
n@1116 1643 },
n@1116 1644
n@1116 1645 "ATTR": function( name, operator, check ) {
n@1116 1646 return function( elem ) {
n@1116 1647 var result = Sizzle.attr( elem, name );
n@1116 1648
n@1116 1649 if ( result == null ) {
n@1116 1650 return operator === "!=";
n@1116 1651 }
n@1116 1652 if ( !operator ) {
n@1116 1653 return true;
n@1116 1654 }
n@1116 1655
n@1116 1656 result += "";
n@1116 1657
n@1116 1658 return operator === "=" ? result === check :
n@1116 1659 operator === "!=" ? result !== check :
n@1116 1660 operator === "^=" ? check && result.indexOf( check ) === 0 :
n@1116 1661 operator === "*=" ? check && result.indexOf( check ) > -1 :
n@1116 1662 operator === "$=" ? check && result.slice( -check.length ) === check :
n@1116 1663 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
n@1116 1664 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
n@1116 1665 false;
n@1116 1666 };
n@1116 1667 },
n@1116 1668
n@1116 1669 "CHILD": function( type, what, argument, first, last ) {
n@1116 1670 var simple = type.slice( 0, 3 ) !== "nth",
n@1116 1671 forward = type.slice( -4 ) !== "last",
n@1116 1672 ofType = what === "of-type";
n@1116 1673
n@1116 1674 return first === 1 && last === 0 ?
n@1116 1675
n@1116 1676 // Shortcut for :nth-*(n)
n@1116 1677 function( elem ) {
n@1116 1678 return !!elem.parentNode;
n@1116 1679 } :
n@1116 1680
n@1116 1681 function( elem, context, xml ) {
n@1116 1682 var cache, outerCache, node, diff, nodeIndex, start,
n@1116 1683 dir = simple !== forward ? "nextSibling" : "previousSibling",
n@1116 1684 parent = elem.parentNode,
n@1116 1685 name = ofType && elem.nodeName.toLowerCase(),
n@1116 1686 useCache = !xml && !ofType;
n@1116 1687
n@1116 1688 if ( parent ) {
n@1116 1689
n@1116 1690 // :(first|last|only)-(child|of-type)
n@1116 1691 if ( simple ) {
n@1116 1692 while ( dir ) {
n@1116 1693 node = elem;
n@1116 1694 while ( (node = node[ dir ]) ) {
n@1116 1695 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
n@1116 1696 return false;
n@1116 1697 }
n@1116 1698 }
n@1116 1699 // Reverse direction for :only-* (if we haven't yet done so)
n@1116 1700 start = dir = type === "only" && !start && "nextSibling";
n@1116 1701 }
n@1116 1702 return true;
n@1116 1703 }
n@1116 1704
n@1116 1705 start = [ forward ? parent.firstChild : parent.lastChild ];
n@1116 1706
n@1116 1707 // non-xml :nth-child(...) stores cache data on `parent`
n@1116 1708 if ( forward && useCache ) {
n@1116 1709 // Seek `elem` from a previously-cached index
n@1116 1710 outerCache = parent[ expando ] || (parent[ expando ] = {});
n@1116 1711 cache = outerCache[ type ] || [];
n@1116 1712 nodeIndex = cache[0] === dirruns && cache[1];
n@1116 1713 diff = cache[0] === dirruns && cache[2];
n@1116 1714 node = nodeIndex && parent.childNodes[ nodeIndex ];
n@1116 1715
n@1116 1716 while ( (node = ++nodeIndex && node && node[ dir ] ||
n@1116 1717
n@1116 1718 // Fallback to seeking `elem` from the start
n@1116 1719 (diff = nodeIndex = 0) || start.pop()) ) {
n@1116 1720
n@1116 1721 // When found, cache indexes on `parent` and break
n@1116 1722 if ( node.nodeType === 1 && ++diff && node === elem ) {
n@1116 1723 outerCache[ type ] = [ dirruns, nodeIndex, diff ];
n@1116 1724 break;
n@1116 1725 }
n@1116 1726 }
n@1116 1727
n@1116 1728 // Use previously-cached element index if available
n@1116 1729 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
n@1116 1730 diff = cache[1];
n@1116 1731
n@1116 1732 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
n@1116 1733 } else {
n@1116 1734 // Use the same loop as above to seek `elem` from the start
n@1116 1735 while ( (node = ++nodeIndex && node && node[ dir ] ||
n@1116 1736 (diff = nodeIndex = 0) || start.pop()) ) {
n@1116 1737
n@1116 1738 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
n@1116 1739 // Cache the index of each encountered element
n@1116 1740 if ( useCache ) {
n@1116 1741 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
n@1116 1742 }
n@1116 1743
n@1116 1744 if ( node === elem ) {
n@1116 1745 break;
n@1116 1746 }
n@1116 1747 }
n@1116 1748 }
n@1116 1749 }
n@1116 1750
n@1116 1751 // Incorporate the offset, then check against cycle size
n@1116 1752 diff -= last;
n@1116 1753 return diff === first || ( diff % first === 0 && diff / first >= 0 );
n@1116 1754 }
n@1116 1755 };
n@1116 1756 },
n@1116 1757
n@1116 1758 "PSEUDO": function( pseudo, argument ) {
n@1116 1759 // pseudo-class names are case-insensitive
n@1116 1760 // http://www.w3.org/TR/selectors/#pseudo-classes
n@1116 1761 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
n@1116 1762 // Remember that setFilters inherits from pseudos
n@1116 1763 var args,
n@1116 1764 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
n@1116 1765 Sizzle.error( "unsupported pseudo: " + pseudo );
n@1116 1766
n@1116 1767 // The user may use createPseudo to indicate that
n@1116 1768 // arguments are needed to create the filter function
n@1116 1769 // just as Sizzle does
n@1116 1770 if ( fn[ expando ] ) {
n@1116 1771 return fn( argument );
n@1116 1772 }
n@1116 1773
n@1116 1774 // But maintain support for old signatures
n@1116 1775 if ( fn.length > 1 ) {
n@1116 1776 args = [ pseudo, pseudo, "", argument ];
n@1116 1777 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
n@1116 1778 markFunction(function( seed, matches ) {
n@1116 1779 var idx,
n@1116 1780 matched = fn( seed, argument ),
n@1116 1781 i = matched.length;
n@1116 1782 while ( i-- ) {
n@1116 1783 idx = indexOf( seed, matched[i] );
n@1116 1784 seed[ idx ] = !( matches[ idx ] = matched[i] );
n@1116 1785 }
n@1116 1786 }) :
n@1116 1787 function( elem ) {
n@1116 1788 return fn( elem, 0, args );
n@1116 1789 };
n@1116 1790 }
n@1116 1791
n@1116 1792 return fn;
n@1116 1793 }
n@1116 1794 },
n@1116 1795
n@1116 1796 pseudos: {
n@1116 1797 // Potentially complex pseudos
n@1116 1798 "not": markFunction(function( selector ) {
n@1116 1799 // Trim the selector passed to compile
n@1116 1800 // to avoid treating leading and trailing
n@1116 1801 // spaces as combinators
n@1116 1802 var input = [],
n@1116 1803 results = [],
n@1116 1804 matcher = compile( selector.replace( rtrim, "$1" ) );
n@1116 1805
n@1116 1806 return matcher[ expando ] ?
n@1116 1807 markFunction(function( seed, matches, context, xml ) {
n@1116 1808 var elem,
n@1116 1809 unmatched = matcher( seed, null, xml, [] ),
n@1116 1810 i = seed.length;
n@1116 1811
n@1116 1812 // Match elements unmatched by `matcher`
n@1116 1813 while ( i-- ) {
n@1116 1814 if ( (elem = unmatched[i]) ) {
n@1116 1815 seed[i] = !(matches[i] = elem);
n@1116 1816 }
n@1116 1817 }
n@1116 1818 }) :
n@1116 1819 function( elem, context, xml ) {
n@1116 1820 input[0] = elem;
n@1116 1821 matcher( input, null, xml, results );
n@1116 1822 // Don't keep the element (issue #299)
n@1116 1823 input[0] = null;
n@1116 1824 return !results.pop();
n@1116 1825 };
n@1116 1826 }),
n@1116 1827
n@1116 1828 "has": markFunction(function( selector ) {
n@1116 1829 return function( elem ) {
n@1116 1830 return Sizzle( selector, elem ).length > 0;
n@1116 1831 };
n@1116 1832 }),
n@1116 1833
n@1116 1834 "contains": markFunction(function( text ) {
n@1116 1835 text = text.replace( runescape, funescape );
n@1116 1836 return function( elem ) {
n@1116 1837 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
n@1116 1838 };
n@1116 1839 }),
n@1116 1840
n@1116 1841 // "Whether an element is represented by a :lang() selector
n@1116 1842 // is based solely on the element's language value
n@1116 1843 // being equal to the identifier C,
n@1116 1844 // or beginning with the identifier C immediately followed by "-".
n@1116 1845 // The matching of C against the element's language value is performed case-insensitively.
n@1116 1846 // The identifier C does not have to be a valid language name."
n@1116 1847 // http://www.w3.org/TR/selectors/#lang-pseudo
n@1116 1848 "lang": markFunction( function( lang ) {
n@1116 1849 // lang value must be a valid identifier
n@1116 1850 if ( !ridentifier.test(lang || "") ) {
n@1116 1851 Sizzle.error( "unsupported lang: " + lang );
n@1116 1852 }
n@1116 1853 lang = lang.replace( runescape, funescape ).toLowerCase();
n@1116 1854 return function( elem ) {
n@1116 1855 var elemLang;
n@1116 1856 do {
n@1116 1857 if ( (elemLang = documentIsHTML ?
n@1116 1858 elem.lang :
n@1116 1859 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
n@1116 1860
n@1116 1861 elemLang = elemLang.toLowerCase();
n@1116 1862 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
n@1116 1863 }
n@1116 1864 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
n@1116 1865 return false;
n@1116 1866 };
n@1116 1867 }),
n@1116 1868
n@1116 1869 // Miscellaneous
n@1116 1870 "target": function( elem ) {
n@1116 1871 var hash = window.location && window.location.hash;
n@1116 1872 return hash && hash.slice( 1 ) === elem.id;
n@1116 1873 },
n@1116 1874
n@1116 1875 "root": function( elem ) {
n@1116 1876 return elem === docElem;
n@1116 1877 },
n@1116 1878
n@1116 1879 "focus": function( elem ) {
n@1116 1880 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
n@1116 1881 },
n@1116 1882
n@1116 1883 // Boolean properties
n@1116 1884 "enabled": function( elem ) {
n@1116 1885 return elem.disabled === false;
n@1116 1886 },
n@1116 1887
n@1116 1888 "disabled": function( elem ) {
n@1116 1889 return elem.disabled === true;
n@1116 1890 },
n@1116 1891
n@1116 1892 "checked": function( elem ) {
n@1116 1893 // In CSS3, :checked should return both checked and selected elements
n@1116 1894 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
n@1116 1895 var nodeName = elem.nodeName.toLowerCase();
n@1116 1896 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
n@1116 1897 },
n@1116 1898
n@1116 1899 "selected": function( elem ) {
n@1116 1900 // Accessing this property makes selected-by-default
n@1116 1901 // options in Safari work properly
n@1116 1902 if ( elem.parentNode ) {
n@1116 1903 elem.parentNode.selectedIndex;
n@1116 1904 }
n@1116 1905
n@1116 1906 return elem.selected === true;
n@1116 1907 },
n@1116 1908
n@1116 1909 // Contents
n@1116 1910 "empty": function( elem ) {
n@1116 1911 // http://www.w3.org/TR/selectors/#empty-pseudo
n@1116 1912 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
n@1116 1913 // but not by others (comment: 8; processing instruction: 7; etc.)
n@1116 1914 // nodeType < 6 works because attributes (2) do not appear as children
n@1116 1915 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
n@1116 1916 if ( elem.nodeType < 6 ) {
n@1116 1917 return false;
n@1116 1918 }
n@1116 1919 }
n@1116 1920 return true;
n@1116 1921 },
n@1116 1922
n@1116 1923 "parent": function( elem ) {
n@1116 1924 return !Expr.pseudos["empty"]( elem );
n@1116 1925 },
n@1116 1926
n@1116 1927 // Element/input types
n@1116 1928 "header": function( elem ) {
n@1116 1929 return rheader.test( elem.nodeName );
n@1116 1930 },
n@1116 1931
n@1116 1932 "input": function( elem ) {
n@1116 1933 return rinputs.test( elem.nodeName );
n@1116 1934 },
n@1116 1935
n@1116 1936 "button": function( elem ) {
n@1116 1937 var name = elem.nodeName.toLowerCase();
n@1116 1938 return name === "input" && elem.type === "button" || name === "button";
n@1116 1939 },
n@1116 1940
n@1116 1941 "text": function( elem ) {
n@1116 1942 var attr;
n@1116 1943 return elem.nodeName.toLowerCase() === "input" &&
n@1116 1944 elem.type === "text" &&
n@1116 1945
n@1116 1946 // Support: IE<8
n@1116 1947 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
n@1116 1948 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
n@1116 1949 },
n@1116 1950
n@1116 1951 // Position-in-collection
n@1116 1952 "first": createPositionalPseudo(function() {
n@1116 1953 return [ 0 ];
n@1116 1954 }),
n@1116 1955
n@1116 1956 "last": createPositionalPseudo(function( matchIndexes, length ) {
n@1116 1957 return [ length - 1 ];
n@1116 1958 }),
n@1116 1959
n@1116 1960 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
n@1116 1961 return [ argument < 0 ? argument + length : argument ];
n@1116 1962 }),
n@1116 1963
n@1116 1964 "even": createPositionalPseudo(function( matchIndexes, length ) {
n@1116 1965 var i = 0;
n@1116 1966 for ( ; i < length; i += 2 ) {
n@1116 1967 matchIndexes.push( i );
n@1116 1968 }
n@1116 1969 return matchIndexes;
n@1116 1970 }),
n@1116 1971
n@1116 1972 "odd": createPositionalPseudo(function( matchIndexes, length ) {
n@1116 1973 var i = 1;
n@1116 1974 for ( ; i < length; i += 2 ) {
n@1116 1975 matchIndexes.push( i );
n@1116 1976 }
n@1116 1977 return matchIndexes;
n@1116 1978 }),
n@1116 1979
n@1116 1980 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
n@1116 1981 var i = argument < 0 ? argument + length : argument;
n@1116 1982 for ( ; --i >= 0; ) {
n@1116 1983 matchIndexes.push( i );
n@1116 1984 }
n@1116 1985 return matchIndexes;
n@1116 1986 }),
n@1116 1987
n@1116 1988 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
n@1116 1989 var i = argument < 0 ? argument + length : argument;
n@1116 1990 for ( ; ++i < length; ) {
n@1116 1991 matchIndexes.push( i );
n@1116 1992 }
n@1116 1993 return matchIndexes;
n@1116 1994 })
n@1116 1995 }
n@1116 1996 };
n@1116 1997
n@1116 1998 Expr.pseudos["nth"] = Expr.pseudos["eq"];
n@1116 1999
n@1116 2000 // Add button/input type pseudos
n@1116 2001 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
n@1116 2002 Expr.pseudos[ i ] = createInputPseudo( i );
n@1116 2003 }
n@1116 2004 for ( i in { submit: true, reset: true } ) {
n@1116 2005 Expr.pseudos[ i ] = createButtonPseudo( i );
n@1116 2006 }
n@1116 2007
n@1116 2008 // Easy API for creating new setFilters
n@1116 2009 function setFilters() {}
n@1116 2010 setFilters.prototype = Expr.filters = Expr.pseudos;
n@1116 2011 Expr.setFilters = new setFilters();
n@1116 2012
n@1116 2013 tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
n@1116 2014 var matched, match, tokens, type,
n@1116 2015 soFar, groups, preFilters,
n@1116 2016 cached = tokenCache[ selector + " " ];
n@1116 2017
n@1116 2018 if ( cached ) {
n@1116 2019 return parseOnly ? 0 : cached.slice( 0 );
n@1116 2020 }
n@1116 2021
n@1116 2022 soFar = selector;
n@1116 2023 groups = [];
n@1116 2024 preFilters = Expr.preFilter;
n@1116 2025
n@1116 2026 while ( soFar ) {
n@1116 2027
n@1116 2028 // Comma and first run
n@1116 2029 if ( !matched || (match = rcomma.exec( soFar )) ) {
n@1116 2030 if ( match ) {
n@1116 2031 // Don't consume trailing commas as valid
n@1116 2032 soFar = soFar.slice( match[0].length ) || soFar;
n@1116 2033 }
n@1116 2034 groups.push( (tokens = []) );
n@1116 2035 }
n@1116 2036
n@1116 2037 matched = false;
n@1116 2038
n@1116 2039 // Combinators
n@1116 2040 if ( (match = rcombinators.exec( soFar )) ) {
n@1116 2041 matched = match.shift();
n@1116 2042 tokens.push({
n@1116 2043 value: matched,
n@1116 2044 // Cast descendant combinators to space
n@1116 2045 type: match[0].replace( rtrim, " " )
n@1116 2046 });
n@1116 2047 soFar = soFar.slice( matched.length );
n@1116 2048 }
n@1116 2049
n@1116 2050 // Filters
n@1116 2051 for ( type in Expr.filter ) {
n@1116 2052 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
n@1116 2053 (match = preFilters[ type ]( match ))) ) {
n@1116 2054 matched = match.shift();
n@1116 2055 tokens.push({
n@1116 2056 value: matched,
n@1116 2057 type: type,
n@1116 2058 matches: match
n@1116 2059 });
n@1116 2060 soFar = soFar.slice( matched.length );
n@1116 2061 }
n@1116 2062 }
n@1116 2063
n@1116 2064 if ( !matched ) {
n@1116 2065 break;
n@1116 2066 }
n@1116 2067 }
n@1116 2068
n@1116 2069 // Return the length of the invalid excess
n@1116 2070 // if we're just parsing
n@1116 2071 // Otherwise, throw an error or return tokens
n@1116 2072 return parseOnly ?
n@1116 2073 soFar.length :
n@1116 2074 soFar ?
n@1116 2075 Sizzle.error( selector ) :
n@1116 2076 // Cache the tokens
n@1116 2077 tokenCache( selector, groups ).slice( 0 );
n@1116 2078 };
n@1116 2079
n@1116 2080 function toSelector( tokens ) {
n@1116 2081 var i = 0,
n@1116 2082 len = tokens.length,
n@1116 2083 selector = "";
n@1116 2084 for ( ; i < len; i++ ) {
n@1116 2085 selector += tokens[i].value;
n@1116 2086 }
n@1116 2087 return selector;
n@1116 2088 }
n@1116 2089
n@1116 2090 function addCombinator( matcher, combinator, base ) {
n@1116 2091 var dir = combinator.dir,
n@1116 2092 checkNonElements = base && dir === "parentNode",
n@1116 2093 doneName = done++;
n@1116 2094
n@1116 2095 return combinator.first ?
n@1116 2096 // Check against closest ancestor/preceding element
n@1116 2097 function( elem, context, xml ) {
n@1116 2098 while ( (elem = elem[ dir ]) ) {
n@1116 2099 if ( elem.nodeType === 1 || checkNonElements ) {
n@1116 2100 return matcher( elem, context, xml );
n@1116 2101 }
n@1116 2102 }
n@1116 2103 } :
n@1116 2104
n@1116 2105 // Check against all ancestor/preceding elements
n@1116 2106 function( elem, context, xml ) {
n@1116 2107 var oldCache, outerCache,
n@1116 2108 newCache = [ dirruns, doneName ];
n@1116 2109
n@1116 2110 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
n@1116 2111 if ( xml ) {
n@1116 2112 while ( (elem = elem[ dir ]) ) {
n@1116 2113 if ( elem.nodeType === 1 || checkNonElements ) {
n@1116 2114 if ( matcher( elem, context, xml ) ) {
n@1116 2115 return true;
n@1116 2116 }
n@1116 2117 }
n@1116 2118 }
n@1116 2119 } else {
n@1116 2120 while ( (elem = elem[ dir ]) ) {
n@1116 2121 if ( elem.nodeType === 1 || checkNonElements ) {
n@1116 2122 outerCache = elem[ expando ] || (elem[ expando ] = {});
n@1116 2123 if ( (oldCache = outerCache[ dir ]) &&
n@1116 2124 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
n@1116 2125
n@1116 2126 // Assign to newCache so results back-propagate to previous elements
n@1116 2127 return (newCache[ 2 ] = oldCache[ 2 ]);
n@1116 2128 } else {
n@1116 2129 // Reuse newcache so results back-propagate to previous elements
n@1116 2130 outerCache[ dir ] = newCache;
n@1116 2131
n@1116 2132 // A match means we're done; a fail means we have to keep checking
n@1116 2133 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
n@1116 2134 return true;
n@1116 2135 }
n@1116 2136 }
n@1116 2137 }
n@1116 2138 }
n@1116 2139 }
n@1116 2140 };
n@1116 2141 }
n@1116 2142
n@1116 2143 function elementMatcher( matchers ) {
n@1116 2144 return matchers.length > 1 ?
n@1116 2145 function( elem, context, xml ) {
n@1116 2146 var i = matchers.length;
n@1116 2147 while ( i-- ) {
n@1116 2148 if ( !matchers[i]( elem, context, xml ) ) {
n@1116 2149 return false;
n@1116 2150 }
n@1116 2151 }
n@1116 2152 return true;
n@1116 2153 } :
n@1116 2154 matchers[0];
n@1116 2155 }
n@1116 2156
n@1116 2157 function multipleContexts( selector, contexts, results ) {
n@1116 2158 var i = 0,
n@1116 2159 len = contexts.length;
n@1116 2160 for ( ; i < len; i++ ) {
n@1116 2161 Sizzle( selector, contexts[i], results );
n@1116 2162 }
n@1116 2163 return results;
n@1116 2164 }
n@1116 2165
n@1116 2166 function condense( unmatched, map, filter, context, xml ) {
n@1116 2167 var elem,
n@1116 2168 newUnmatched = [],
n@1116 2169 i = 0,
n@1116 2170 len = unmatched.length,
n@1116 2171 mapped = map != null;
n@1116 2172
n@1116 2173 for ( ; i < len; i++ ) {
n@1116 2174 if ( (elem = unmatched[i]) ) {
n@1116 2175 if ( !filter || filter( elem, context, xml ) ) {
n@1116 2176 newUnmatched.push( elem );
n@1116 2177 if ( mapped ) {
n@1116 2178 map.push( i );
n@1116 2179 }
n@1116 2180 }
n@1116 2181 }
n@1116 2182 }
n@1116 2183
n@1116 2184 return newUnmatched;
n@1116 2185 }
n@1116 2186
n@1116 2187 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
n@1116 2188 if ( postFilter && !postFilter[ expando ] ) {
n@1116 2189 postFilter = setMatcher( postFilter );
n@1116 2190 }
n@1116 2191 if ( postFinder && !postFinder[ expando ] ) {
n@1116 2192 postFinder = setMatcher( postFinder, postSelector );
n@1116 2193 }
n@1116 2194 return markFunction(function( seed, results, context, xml ) {
n@1116 2195 var temp, i, elem,
n@1116 2196 preMap = [],
n@1116 2197 postMap = [],
n@1116 2198 preexisting = results.length,
n@1116 2199
n@1116 2200 // Get initial elements from seed or context
n@1116 2201 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
n@1116 2202
n@1116 2203 // Prefilter to get matcher input, preserving a map for seed-results synchronization
n@1116 2204 matcherIn = preFilter && ( seed || !selector ) ?
n@1116 2205 condense( elems, preMap, preFilter, context, xml ) :
n@1116 2206 elems,
n@1116 2207
n@1116 2208 matcherOut = matcher ?
n@1116 2209 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
n@1116 2210 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
n@1116 2211
n@1116 2212 // ...intermediate processing is necessary
n@1116 2213 [] :
n@1116 2214
n@1116 2215 // ...otherwise use results directly
n@1116 2216 results :
n@1116 2217 matcherIn;
n@1116 2218
n@1116 2219 // Find primary matches
n@1116 2220 if ( matcher ) {
n@1116 2221 matcher( matcherIn, matcherOut, context, xml );
n@1116 2222 }
n@1116 2223
n@1116 2224 // Apply postFilter
n@1116 2225 if ( postFilter ) {
n@1116 2226 temp = condense( matcherOut, postMap );
n@1116 2227 postFilter( temp, [], context, xml );
n@1116 2228
n@1116 2229 // Un-match failing elements by moving them back to matcherIn
n@1116 2230 i = temp.length;
n@1116 2231 while ( i-- ) {
n@1116 2232 if ( (elem = temp[i]) ) {
n@1116 2233 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
n@1116 2234 }
n@1116 2235 }
n@1116 2236 }
n@1116 2237
n@1116 2238 if ( seed ) {
n@1116 2239 if ( postFinder || preFilter ) {
n@1116 2240 if ( postFinder ) {
n@1116 2241 // Get the final matcherOut by condensing this intermediate into postFinder contexts
n@1116 2242 temp = [];
n@1116 2243 i = matcherOut.length;
n@1116 2244 while ( i-- ) {
n@1116 2245 if ( (elem = matcherOut[i]) ) {
n@1116 2246 // Restore matcherIn since elem is not yet a final match
n@1116 2247 temp.push( (matcherIn[i] = elem) );
n@1116 2248 }
n@1116 2249 }
n@1116 2250 postFinder( null, (matcherOut = []), temp, xml );
n@1116 2251 }
n@1116 2252
n@1116 2253 // Move matched elements from seed to results to keep them synchronized
n@1116 2254 i = matcherOut.length;
n@1116 2255 while ( i-- ) {
n@1116 2256 if ( (elem = matcherOut[i]) &&
n@1116 2257 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
n@1116 2258
n@1116 2259 seed[temp] = !(results[temp] = elem);
n@1116 2260 }
n@1116 2261 }
n@1116 2262 }
n@1116 2263
n@1116 2264 // Add elements to results, through postFinder if defined
n@1116 2265 } else {
n@1116 2266 matcherOut = condense(
n@1116 2267 matcherOut === results ?
n@1116 2268 matcherOut.splice( preexisting, matcherOut.length ) :
n@1116 2269 matcherOut
n@1116 2270 );
n@1116 2271 if ( postFinder ) {
n@1116 2272 postFinder( null, results, matcherOut, xml );
n@1116 2273 } else {
n@1116 2274 push.apply( results, matcherOut );
n@1116 2275 }
n@1116 2276 }
n@1116 2277 });
n@1116 2278 }
n@1116 2279
n@1116 2280 function matcherFromTokens( tokens ) {
n@1116 2281 var checkContext, matcher, j,
n@1116 2282 len = tokens.length,
n@1116 2283 leadingRelative = Expr.relative[ tokens[0].type ],
n@1116 2284 implicitRelative = leadingRelative || Expr.relative[" "],
n@1116 2285 i = leadingRelative ? 1 : 0,
n@1116 2286
n@1116 2287 // The foundational matcher ensures that elements are reachable from top-level context(s)
n@1116 2288 matchContext = addCombinator( function( elem ) {
n@1116 2289 return elem === checkContext;
n@1116 2290 }, implicitRelative, true ),
n@1116 2291 matchAnyContext = addCombinator( function( elem ) {
n@1116 2292 return indexOf( checkContext, elem ) > -1;
n@1116 2293 }, implicitRelative, true ),
n@1116 2294 matchers = [ function( elem, context, xml ) {
n@1116 2295 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
n@1116 2296 (checkContext = context).nodeType ?
n@1116 2297 matchContext( elem, context, xml ) :
n@1116 2298 matchAnyContext( elem, context, xml ) );
n@1116 2299 // Avoid hanging onto element (issue #299)
n@1116 2300 checkContext = null;
n@1116 2301 return ret;
n@1116 2302 } ];
n@1116 2303
n@1116 2304 for ( ; i < len; i++ ) {
n@1116 2305 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
n@1116 2306 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
n@1116 2307 } else {
n@1116 2308 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
n@1116 2309
n@1116 2310 // Return special upon seeing a positional matcher
n@1116 2311 if ( matcher[ expando ] ) {
n@1116 2312 // Find the next relative operator (if any) for proper handling
n@1116 2313 j = ++i;
n@1116 2314 for ( ; j < len; j++ ) {
n@1116 2315 if ( Expr.relative[ tokens[j].type ] ) {
n@1116 2316 break;
n@1116 2317 }
n@1116 2318 }
n@1116 2319 return setMatcher(
n@1116 2320 i > 1 && elementMatcher( matchers ),
n@1116 2321 i > 1 && toSelector(
n@1116 2322 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
n@1116 2323 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
n@1116 2324 ).replace( rtrim, "$1" ),
n@1116 2325 matcher,
n@1116 2326 i < j && matcherFromTokens( tokens.slice( i, j ) ),
n@1116 2327 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
n@1116 2328 j < len && toSelector( tokens )
n@1116 2329 );
n@1116 2330 }
n@1116 2331 matchers.push( matcher );
n@1116 2332 }
n@1116 2333 }
n@1116 2334
n@1116 2335 return elementMatcher( matchers );
n@1116 2336 }
n@1116 2337
n@1116 2338 function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
n@1116 2339 var bySet = setMatchers.length > 0,
n@1116 2340 byElement = elementMatchers.length > 0,
n@1116 2341 superMatcher = function( seed, context, xml, results, outermost ) {
n@1116 2342 var elem, j, matcher,
n@1116 2343 matchedCount = 0,
n@1116 2344 i = "0",
n@1116 2345 unmatched = seed && [],
n@1116 2346 setMatched = [],
n@1116 2347 contextBackup = outermostContext,
n@1116 2348 // We must always have either seed elements or outermost context
n@1116 2349 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
n@1116 2350 // Use integer dirruns iff this is the outermost matcher
n@1116 2351 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
n@1116 2352 len = elems.length;
n@1116 2353
n@1116 2354 if ( outermost ) {
n@1116 2355 outermostContext = context !== document && context;
n@1116 2356 }
n@1116 2357
n@1116 2358 // Add elements passing elementMatchers directly to results
n@1116 2359 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
n@1116 2360 // Support: IE<9, Safari
n@1116 2361 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
n@1116 2362 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
n@1116 2363 if ( byElement && elem ) {
n@1116 2364 j = 0;
n@1116 2365 while ( (matcher = elementMatchers[j++]) ) {
n@1116 2366 if ( matcher( elem, context, xml ) ) {
n@1116 2367 results.push( elem );
n@1116 2368 break;
n@1116 2369 }
n@1116 2370 }
n@1116 2371 if ( outermost ) {
n@1116 2372 dirruns = dirrunsUnique;
n@1116 2373 }
n@1116 2374 }
n@1116 2375
n@1116 2376 // Track unmatched elements for set filters
n@1116 2377 if ( bySet ) {
n@1116 2378 // They will have gone through all possible matchers
n@1116 2379 if ( (elem = !matcher && elem) ) {
n@1116 2380 matchedCount--;
n@1116 2381 }
n@1116 2382
n@1116 2383 // Lengthen the array for every element, matched or not
n@1116 2384 if ( seed ) {
n@1116 2385 unmatched.push( elem );
n@1116 2386 }
n@1116 2387 }
n@1116 2388 }
n@1116 2389
n@1116 2390 // Apply set filters to unmatched elements
n@1116 2391 matchedCount += i;
n@1116 2392 if ( bySet && i !== matchedCount ) {
n@1116 2393 j = 0;
n@1116 2394 while ( (matcher = setMatchers[j++]) ) {
n@1116 2395 matcher( unmatched, setMatched, context, xml );
n@1116 2396 }
n@1116 2397
n@1116 2398 if ( seed ) {
n@1116 2399 // Reintegrate element matches to eliminate the need for sorting
n@1116 2400 if ( matchedCount > 0 ) {
n@1116 2401 while ( i-- ) {
n@1116 2402 if ( !(unmatched[i] || setMatched[i]) ) {
n@1116 2403 setMatched[i] = pop.call( results );
n@1116 2404 }
n@1116 2405 }
n@1116 2406 }
n@1116 2407
n@1116 2408 // Discard index placeholder values to get only actual matches
n@1116 2409 setMatched = condense( setMatched );
n@1116 2410 }
n@1116 2411
n@1116 2412 // Add matches to results
n@1116 2413 push.apply( results, setMatched );
n@1116 2414
n@1116 2415 // Seedless set matches succeeding multiple successful matchers stipulate sorting
n@1116 2416 if ( outermost && !seed && setMatched.length > 0 &&
n@1116 2417 ( matchedCount + setMatchers.length ) > 1 ) {
n@1116 2418
n@1116 2419 Sizzle.uniqueSort( results );
n@1116 2420 }
n@1116 2421 }
n@1116 2422
n@1116 2423 // Override manipulation of globals by nested matchers
n@1116 2424 if ( outermost ) {
n@1116 2425 dirruns = dirrunsUnique;
n@1116 2426 outermostContext = contextBackup;
n@1116 2427 }
n@1116 2428
n@1116 2429 return unmatched;
n@1116 2430 };
n@1116 2431
n@1116 2432 return bySet ?
n@1116 2433 markFunction( superMatcher ) :
n@1116 2434 superMatcher;
n@1116 2435 }
n@1116 2436
n@1116 2437 compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
n@1116 2438 var i,
n@1116 2439 setMatchers = [],
n@1116 2440 elementMatchers = [],
n@1116 2441 cached = compilerCache[ selector + " " ];
n@1116 2442
n@1116 2443 if ( !cached ) {
n@1116 2444 // Generate a function of recursive functions that can be used to check each element
n@1116 2445 if ( !match ) {
n@1116 2446 match = tokenize( selector );
n@1116 2447 }
n@1116 2448 i = match.length;
n@1116 2449 while ( i-- ) {
n@1116 2450 cached = matcherFromTokens( match[i] );
n@1116 2451 if ( cached[ expando ] ) {
n@1116 2452 setMatchers.push( cached );
n@1116 2453 } else {
n@1116 2454 elementMatchers.push( cached );
n@1116 2455 }
n@1116 2456 }
n@1116 2457
n@1116 2458 // Cache the compiled function
n@1116 2459 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
n@1116 2460
n@1116 2461 // Save selector and tokenization
n@1116 2462 cached.selector = selector;
n@1116 2463 }
n@1116 2464 return cached;
n@1116 2465 };
n@1116 2466
n@1116 2467 /**
n@1116 2468 * A low-level selection function that works with Sizzle's compiled
n@1116 2469 * selector functions
n@1116 2470 * @param {String|Function} selector A selector or a pre-compiled
n@1116 2471 * selector function built with Sizzle.compile
n@1116 2472 * @param {Element} context
n@1116 2473 * @param {Array} [results]
n@1116 2474 * @param {Array} [seed] A set of elements to match against
n@1116 2475 */
n@1116 2476 select = Sizzle.select = function( selector, context, results, seed ) {
n@1116 2477 var i, tokens, token, type, find,
n@1116 2478 compiled = typeof selector === "function" && selector,
n@1116 2479 match = !seed && tokenize( (selector = compiled.selector || selector) );
n@1116 2480
n@1116 2481 results = results || [];
n@1116 2482
n@1116 2483 // Try to minimize operations if there is no seed and only one group
n@1116 2484 if ( match.length === 1 ) {
n@1116 2485
n@1116 2486 // Take a shortcut and set the context if the root selector is an ID
n@1116 2487 tokens = match[0] = match[0].slice( 0 );
n@1116 2488 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
n@1116 2489 support.getById && context.nodeType === 9 && documentIsHTML &&
n@1116 2490 Expr.relative[ tokens[1].type ] ) {
n@1116 2491
n@1116 2492 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
n@1116 2493 if ( !context ) {
n@1116 2494 return results;
n@1116 2495
n@1116 2496 // Precompiled matchers will still verify ancestry, so step up a level
n@1116 2497 } else if ( compiled ) {
n@1116 2498 context = context.parentNode;
n@1116 2499 }
n@1116 2500
n@1116 2501 selector = selector.slice( tokens.shift().value.length );
n@1116 2502 }
n@1116 2503
n@1116 2504 // Fetch a seed set for right-to-left matching
n@1116 2505 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
n@1116 2506 while ( i-- ) {
n@1116 2507 token = tokens[i];
n@1116 2508
n@1116 2509 // Abort if we hit a combinator
n@1116 2510 if ( Expr.relative[ (type = token.type) ] ) {
n@1116 2511 break;
n@1116 2512 }
n@1116 2513 if ( (find = Expr.find[ type ]) ) {
n@1116 2514 // Search, expanding context for leading sibling combinators
n@1116 2515 if ( (seed = find(
n@1116 2516 token.matches[0].replace( runescape, funescape ),
n@1116 2517 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
n@1116 2518 )) ) {
n@1116 2519
n@1116 2520 // If seed is empty or no tokens remain, we can return early
n@1116 2521 tokens.splice( i, 1 );
n@1116 2522 selector = seed.length && toSelector( tokens );
n@1116 2523 if ( !selector ) {
n@1116 2524 push.apply( results, seed );
n@1116 2525 return results;
n@1116 2526 }
n@1116 2527
n@1116 2528 break;
n@1116 2529 }
n@1116 2530 }
n@1116 2531 }
n@1116 2532 }
n@1116 2533
n@1116 2534 // Compile and execute a filtering function if one is not provided
n@1116 2535 // Provide `match` to avoid retokenization if we modified the selector above
n@1116 2536 ( compiled || compile( selector, match ) )(
n@1116 2537 seed,
n@1116 2538 context,
n@1116 2539 !documentIsHTML,
n@1116 2540 results,
n@1116 2541 rsibling.test( selector ) && testContext( context.parentNode ) || context
n@1116 2542 );
n@1116 2543 return results;
n@1116 2544 };
n@1116 2545
n@1116 2546 // One-time assignments
n@1116 2547
n@1116 2548 // Sort stability
n@1116 2549 support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
n@1116 2550
n@1116 2551 // Support: Chrome 14-35+
n@1116 2552 // Always assume duplicates if they aren't passed to the comparison function
n@1116 2553 support.detectDuplicates = !!hasDuplicate;
n@1116 2554
n@1116 2555 // Initialize against the default document
n@1116 2556 setDocument();
n@1116 2557
n@1116 2558 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
n@1116 2559 // Detached nodes confoundingly follow *each other*
n@1116 2560 support.sortDetached = assert(function( div1 ) {
n@1116 2561 // Should return 1, but returns 4 (following)
n@1116 2562 return div1.compareDocumentPosition( document.createElement("div") ) & 1;
n@1116 2563 });
n@1116 2564
n@1116 2565 // Support: IE<8
n@1116 2566 // Prevent attribute/property "interpolation"
n@1116 2567 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
n@1116 2568 if ( !assert(function( div ) {
n@1116 2569 div.innerHTML = "<a href='#'></a>";
n@1116 2570 return div.firstChild.getAttribute("href") === "#" ;
n@1116 2571 }) ) {
n@1116 2572 addHandle( "type|href|height|width", function( elem, name, isXML ) {
n@1116 2573 if ( !isXML ) {
n@1116 2574 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
n@1116 2575 }
n@1116 2576 });
n@1116 2577 }
n@1116 2578
n@1116 2579 // Support: IE<9
n@1116 2580 // Use defaultValue in place of getAttribute("value")
n@1116 2581 if ( !support.attributes || !assert(function( div ) {
n@1116 2582 div.innerHTML = "<input/>";
n@1116 2583 div.firstChild.setAttribute( "value", "" );
n@1116 2584 return div.firstChild.getAttribute( "value" ) === "";
n@1116 2585 }) ) {
n@1116 2586 addHandle( "value", function( elem, name, isXML ) {
n@1116 2587 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
n@1116 2588 return elem.defaultValue;
n@1116 2589 }
n@1116 2590 });
n@1116 2591 }
n@1116 2592
n@1116 2593 // Support: IE<9
n@1116 2594 // Use getAttributeNode to fetch booleans when getAttribute lies
n@1116 2595 if ( !assert(function( div ) {
n@1116 2596 return div.getAttribute("disabled") == null;
n@1116 2597 }) ) {
n@1116 2598 addHandle( booleans, function( elem, name, isXML ) {
n@1116 2599 var val;
n@1116 2600 if ( !isXML ) {
n@1116 2601 return elem[ name ] === true ? name.toLowerCase() :
n@1116 2602 (val = elem.getAttributeNode( name )) && val.specified ?
n@1116 2603 val.value :
n@1116 2604 null;
n@1116 2605 }
n@1116 2606 });
n@1116 2607 }
n@1116 2608
n@1116 2609 return Sizzle;
n@1116 2610
n@1116 2611 })( window );
n@1116 2612
n@1116 2613
n@1116 2614
n@1116 2615 jQuery.find = Sizzle;
n@1116 2616 jQuery.expr = Sizzle.selectors;
n@1116 2617 jQuery.expr[":"] = jQuery.expr.pseudos;
n@1116 2618 jQuery.unique = Sizzle.uniqueSort;
n@1116 2619 jQuery.text = Sizzle.getText;
n@1116 2620 jQuery.isXMLDoc = Sizzle.isXML;
n@1116 2621 jQuery.contains = Sizzle.contains;
n@1116 2622
n@1116 2623
n@1116 2624
n@1116 2625 var rneedsContext = jQuery.expr.match.needsContext;
n@1116 2626
n@1116 2627 var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
n@1116 2628
n@1116 2629
n@1116 2630
n@1116 2631 var risSimple = /^.[^:#\[\.,]*$/;
n@1116 2632
n@1116 2633 // Implement the identical functionality for filter and not
n@1116 2634 function winnow( elements, qualifier, not ) {
n@1116 2635 if ( jQuery.isFunction( qualifier ) ) {
n@1116 2636 return jQuery.grep( elements, function( elem, i ) {
n@1116 2637 /* jshint -W018 */
n@1116 2638 return !!qualifier.call( elem, i, elem ) !== not;
n@1116 2639 });
n@1116 2640
n@1116 2641 }
n@1116 2642
n@1116 2643 if ( qualifier.nodeType ) {
n@1116 2644 return jQuery.grep( elements, function( elem ) {
n@1116 2645 return ( elem === qualifier ) !== not;
n@1116 2646 });
n@1116 2647
n@1116 2648 }
n@1116 2649
n@1116 2650 if ( typeof qualifier === "string" ) {
n@1116 2651 if ( risSimple.test( qualifier ) ) {
n@1116 2652 return jQuery.filter( qualifier, elements, not );
n@1116 2653 }
n@1116 2654
n@1116 2655 qualifier = jQuery.filter( qualifier, elements );
n@1116 2656 }
n@1116 2657
n@1116 2658 return jQuery.grep( elements, function( elem ) {
n@1116 2659 return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
n@1116 2660 });
n@1116 2661 }
n@1116 2662
n@1116 2663 jQuery.filter = function( expr, elems, not ) {
n@1116 2664 var elem = elems[ 0 ];
n@1116 2665
n@1116 2666 if ( not ) {
n@1116 2667 expr = ":not(" + expr + ")";
n@1116 2668 }
n@1116 2669
n@1116 2670 return elems.length === 1 && elem.nodeType === 1 ?
n@1116 2671 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
n@1116 2672 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
n@1116 2673 return elem.nodeType === 1;
n@1116 2674 }));
n@1116 2675 };
n@1116 2676
n@1116 2677 jQuery.fn.extend({
n@1116 2678 find: function( selector ) {
n@1116 2679 var i,
n@1116 2680 len = this.length,
n@1116 2681 ret = [],
n@1116 2682 self = this;
n@1116 2683
n@1116 2684 if ( typeof selector !== "string" ) {
n@1116 2685 return this.pushStack( jQuery( selector ).filter(function() {
n@1116 2686 for ( i = 0; i < len; i++ ) {
n@1116 2687 if ( jQuery.contains( self[ i ], this ) ) {
n@1116 2688 return true;
n@1116 2689 }
n@1116 2690 }
n@1116 2691 }) );
n@1116 2692 }
n@1116 2693
n@1116 2694 for ( i = 0; i < len; i++ ) {
n@1116 2695 jQuery.find( selector, self[ i ], ret );
n@1116 2696 }
n@1116 2697
n@1116 2698 // Needed because $( selector, context ) becomes $( context ).find( selector )
n@1116 2699 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
n@1116 2700 ret.selector = this.selector ? this.selector + " " + selector : selector;
n@1116 2701 return ret;
n@1116 2702 },
n@1116 2703 filter: function( selector ) {
n@1116 2704 return this.pushStack( winnow(this, selector || [], false) );
n@1116 2705 },
n@1116 2706 not: function( selector ) {
n@1116 2707 return this.pushStack( winnow(this, selector || [], true) );
n@1116 2708 },
n@1116 2709 is: function( selector ) {
n@1116 2710 return !!winnow(
n@1116 2711 this,
n@1116 2712
n@1116 2713 // If this is a positional/relative selector, check membership in the returned set
n@1116 2714 // so $("p:first").is("p:last") won't return true for a doc with two "p".
n@1116 2715 typeof selector === "string" && rneedsContext.test( selector ) ?
n@1116 2716 jQuery( selector ) :
n@1116 2717 selector || [],
n@1116 2718 false
n@1116 2719 ).length;
n@1116 2720 }
n@1116 2721 });
n@1116 2722
n@1116 2723
n@1116 2724 // Initialize a jQuery object
n@1116 2725
n@1116 2726
n@1116 2727 // A central reference to the root jQuery(document)
n@1116 2728 var rootjQuery,
n@1116 2729
n@1116 2730 // A simple way to check for HTML strings
n@1116 2731 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
n@1116 2732 // Strict HTML recognition (#11290: must start with <)
n@1116 2733 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
n@1116 2734
n@1116 2735 init = jQuery.fn.init = function( selector, context ) {
n@1116 2736 var match, elem;
n@1116 2737
n@1116 2738 // HANDLE: $(""), $(null), $(undefined), $(false)
n@1116 2739 if ( !selector ) {
n@1116 2740 return this;
n@1116 2741 }
n@1116 2742
n@1116 2743 // Handle HTML strings
n@1116 2744 if ( typeof selector === "string" ) {
n@1116 2745 if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
n@1116 2746 // Assume that strings that start and end with <> are HTML and skip the regex check
n@1116 2747 match = [ null, selector, null ];
n@1116 2748
n@1116 2749 } else {
n@1116 2750 match = rquickExpr.exec( selector );
n@1116 2751 }
n@1116 2752
n@1116 2753 // Match html or make sure no context is specified for #id
n@1116 2754 if ( match && (match[1] || !context) ) {
n@1116 2755
n@1116 2756 // HANDLE: $(html) -> $(array)
n@1116 2757 if ( match[1] ) {
n@1116 2758 context = context instanceof jQuery ? context[0] : context;
n@1116 2759
n@1116 2760 // Option to run scripts is true for back-compat
n@1116 2761 // Intentionally let the error be thrown if parseHTML is not present
n@1116 2762 jQuery.merge( this, jQuery.parseHTML(
n@1116 2763 match[1],
n@1116 2764 context && context.nodeType ? context.ownerDocument || context : document,
n@1116 2765 true
n@1116 2766 ) );
n@1116 2767
n@1116 2768 // HANDLE: $(html, props)
n@1116 2769 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
n@1116 2770 for ( match in context ) {
n@1116 2771 // Properties of context are called as methods if possible
n@1116 2772 if ( jQuery.isFunction( this[ match ] ) ) {
n@1116 2773 this[ match ]( context[ match ] );
n@1116 2774
n@1116 2775 // ...and otherwise set as attributes
n@1116 2776 } else {
n@1116 2777 this.attr( match, context[ match ] );
n@1116 2778 }
n@1116 2779 }
n@1116 2780 }
n@1116 2781
n@1116 2782 return this;
n@1116 2783
n@1116 2784 // HANDLE: $(#id)
n@1116 2785 } else {
n@1116 2786 elem = document.getElementById( match[2] );
n@1116 2787
n@1116 2788 // Support: Blackberry 4.6
n@1116 2789 // gEBID returns nodes no longer in the document (#6963)
n@1116 2790 if ( elem && elem.parentNode ) {
n@1116 2791 // Inject the element directly into the jQuery object
n@1116 2792 this.length = 1;
n@1116 2793 this[0] = elem;
n@1116 2794 }
n@1116 2795
n@1116 2796 this.context = document;
n@1116 2797 this.selector = selector;
n@1116 2798 return this;
n@1116 2799 }
n@1116 2800
n@1116 2801 // HANDLE: $(expr, $(...))
n@1116 2802 } else if ( !context || context.jquery ) {
n@1116 2803 return ( context || rootjQuery ).find( selector );
n@1116 2804
n@1116 2805 // HANDLE: $(expr, context)
n@1116 2806 // (which is just equivalent to: $(context).find(expr)
n@1116 2807 } else {
n@1116 2808 return this.constructor( context ).find( selector );
n@1116 2809 }
n@1116 2810
n@1116 2811 // HANDLE: $(DOMElement)
n@1116 2812 } else if ( selector.nodeType ) {
n@1116 2813 this.context = this[0] = selector;
n@1116 2814 this.length = 1;
n@1116 2815 return this;
n@1116 2816
n@1116 2817 // HANDLE: $(function)
n@1116 2818 // Shortcut for document ready
n@1116 2819 } else if ( jQuery.isFunction( selector ) ) {
n@1116 2820 return typeof rootjQuery.ready !== "undefined" ?
n@1116 2821 rootjQuery.ready( selector ) :
n@1116 2822 // Execute immediately if ready is not present
n@1116 2823 selector( jQuery );
n@1116 2824 }
n@1116 2825
n@1116 2826 if ( selector.selector !== undefined ) {
n@1116 2827 this.selector = selector.selector;
n@1116 2828 this.context = selector.context;
n@1116 2829 }
n@1116 2830
n@1116 2831 return jQuery.makeArray( selector, this );
n@1116 2832 };
n@1116 2833
n@1116 2834 // Give the init function the jQuery prototype for later instantiation
n@1116 2835 init.prototype = jQuery.fn;
n@1116 2836
n@1116 2837 // Initialize central reference
n@1116 2838 rootjQuery = jQuery( document );
n@1116 2839
n@1116 2840
n@1116 2841 var rparentsprev = /^(?:parents|prev(?:Until|All))/,
n@1116 2842 // Methods guaranteed to produce a unique set when starting from a unique set
n@1116 2843 guaranteedUnique = {
n@1116 2844 children: true,
n@1116 2845 contents: true,
n@1116 2846 next: true,
n@1116 2847 prev: true
n@1116 2848 };
n@1116 2849
n@1116 2850 jQuery.extend({
n@1116 2851 dir: function( elem, dir, until ) {
n@1116 2852 var matched = [],
n@1116 2853 truncate = until !== undefined;
n@1116 2854
n@1116 2855 while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
n@1116 2856 if ( elem.nodeType === 1 ) {
n@1116 2857 if ( truncate && jQuery( elem ).is( until ) ) {
n@1116 2858 break;
n@1116 2859 }
n@1116 2860 matched.push( elem );
n@1116 2861 }
n@1116 2862 }
n@1116 2863 return matched;
n@1116 2864 },
n@1116 2865
n@1116 2866 sibling: function( n, elem ) {
n@1116 2867 var matched = [];
n@1116 2868
n@1116 2869 for ( ; n; n = n.nextSibling ) {
n@1116 2870 if ( n.nodeType === 1 && n !== elem ) {
n@1116 2871 matched.push( n );
n@1116 2872 }
n@1116 2873 }
n@1116 2874
n@1116 2875 return matched;
n@1116 2876 }
n@1116 2877 });
n@1116 2878
n@1116 2879 jQuery.fn.extend({
n@1116 2880 has: function( target ) {
n@1116 2881 var targets = jQuery( target, this ),
n@1116 2882 l = targets.length;
n@1116 2883
n@1116 2884 return this.filter(function() {
n@1116 2885 var i = 0;
n@1116 2886 for ( ; i < l; i++ ) {
n@1116 2887 if ( jQuery.contains( this, targets[i] ) ) {
n@1116 2888 return true;
n@1116 2889 }
n@1116 2890 }
n@1116 2891 });
n@1116 2892 },
n@1116 2893
n@1116 2894 closest: function( selectors, context ) {
n@1116 2895 var cur,
n@1116 2896 i = 0,
n@1116 2897 l = this.length,
n@1116 2898 matched = [],
n@1116 2899 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
n@1116 2900 jQuery( selectors, context || this.context ) :
n@1116 2901 0;
n@1116 2902
n@1116 2903 for ( ; i < l; i++ ) {
n@1116 2904 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
n@1116 2905 // Always skip document fragments
n@1116 2906 if ( cur.nodeType < 11 && (pos ?
n@1116 2907 pos.index(cur) > -1 :
n@1116 2908
n@1116 2909 // Don't pass non-elements to Sizzle
n@1116 2910 cur.nodeType === 1 &&
n@1116 2911 jQuery.find.matchesSelector(cur, selectors)) ) {
n@1116 2912
n@1116 2913 matched.push( cur );
n@1116 2914 break;
n@1116 2915 }
n@1116 2916 }
n@1116 2917 }
n@1116 2918
n@1116 2919 return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
n@1116 2920 },
n@1116 2921
n@1116 2922 // Determine the position of an element within the set
n@1116 2923 index: function( elem ) {
n@1116 2924
n@1116 2925 // No argument, return index in parent
n@1116 2926 if ( !elem ) {
n@1116 2927 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
n@1116 2928 }
n@1116 2929
n@1116 2930 // Index in selector
n@1116 2931 if ( typeof elem === "string" ) {
n@1116 2932 return indexOf.call( jQuery( elem ), this[ 0 ] );
n@1116 2933 }
n@1116 2934
n@1116 2935 // Locate the position of the desired element
n@1116 2936 return indexOf.call( this,
n@1116 2937
n@1116 2938 // If it receives a jQuery object, the first element is used
n@1116 2939 elem.jquery ? elem[ 0 ] : elem
n@1116 2940 );
n@1116 2941 },
n@1116 2942
n@1116 2943 add: function( selector, context ) {
n@1116 2944 return this.pushStack(
n@1116 2945 jQuery.unique(
n@1116 2946 jQuery.merge( this.get(), jQuery( selector, context ) )
n@1116 2947 )
n@1116 2948 );
n@1116 2949 },
n@1116 2950
n@1116 2951 addBack: function( selector ) {
n@1116 2952 return this.add( selector == null ?
n@1116 2953 this.prevObject : this.prevObject.filter(selector)
n@1116 2954 );
n@1116 2955 }
n@1116 2956 });
n@1116 2957
n@1116 2958 function sibling( cur, dir ) {
n@1116 2959 while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
n@1116 2960 return cur;
n@1116 2961 }
n@1116 2962
n@1116 2963 jQuery.each({
n@1116 2964 parent: function( elem ) {
n@1116 2965 var parent = elem.parentNode;
n@1116 2966 return parent && parent.nodeType !== 11 ? parent : null;
n@1116 2967 },
n@1116 2968 parents: function( elem ) {
n@1116 2969 return jQuery.dir( elem, "parentNode" );
n@1116 2970 },
n@1116 2971 parentsUntil: function( elem, i, until ) {
n@1116 2972 return jQuery.dir( elem, "parentNode", until );
n@1116 2973 },
n@1116 2974 next: function( elem ) {
n@1116 2975 return sibling( elem, "nextSibling" );
n@1116 2976 },
n@1116 2977 prev: function( elem ) {
n@1116 2978 return sibling( elem, "previousSibling" );
n@1116 2979 },
n@1116 2980 nextAll: function( elem ) {
n@1116 2981 return jQuery.dir( elem, "nextSibling" );
n@1116 2982 },
n@1116 2983 prevAll: function( elem ) {
n@1116 2984 return jQuery.dir( elem, "previousSibling" );
n@1116 2985 },
n@1116 2986 nextUntil: function( elem, i, until ) {
n@1116 2987 return jQuery.dir( elem, "nextSibling", until );
n@1116 2988 },
n@1116 2989 prevUntil: function( elem, i, until ) {
n@1116 2990 return jQuery.dir( elem, "previousSibling", until );
n@1116 2991 },
n@1116 2992 siblings: function( elem ) {
n@1116 2993 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
n@1116 2994 },
n@1116 2995 children: function( elem ) {
n@1116 2996 return jQuery.sibling( elem.firstChild );
n@1116 2997 },
n@1116 2998 contents: function( elem ) {
n@1116 2999 return elem.contentDocument || jQuery.merge( [], elem.childNodes );
n@1116 3000 }
n@1116 3001 }, function( name, fn ) {
n@1116 3002 jQuery.fn[ name ] = function( until, selector ) {
n@1116 3003 var matched = jQuery.map( this, fn, until );
n@1116 3004
n@1116 3005 if ( name.slice( -5 ) !== "Until" ) {
n@1116 3006 selector = until;
n@1116 3007 }
n@1116 3008
n@1116 3009 if ( selector && typeof selector === "string" ) {
n@1116 3010 matched = jQuery.filter( selector, matched );
n@1116 3011 }
n@1116 3012
n@1116 3013 if ( this.length > 1 ) {
n@1116 3014 // Remove duplicates
n@1116 3015 if ( !guaranteedUnique[ name ] ) {
n@1116 3016 jQuery.unique( matched );
n@1116 3017 }
n@1116 3018
n@1116 3019 // Reverse order for parents* and prev-derivatives
n@1116 3020 if ( rparentsprev.test( name ) ) {
n@1116 3021 matched.reverse();
n@1116 3022 }
n@1116 3023 }
n@1116 3024
n@1116 3025 return this.pushStack( matched );
n@1116 3026 };
n@1116 3027 });
n@1116 3028 var rnotwhite = (/\S+/g);
n@1116 3029
n@1116 3030
n@1116 3031
n@1116 3032 // String to Object options format cache
n@1116 3033 var optionsCache = {};
n@1116 3034
n@1116 3035 // Convert String-formatted options into Object-formatted ones and store in cache
n@1116 3036 function createOptions( options ) {
n@1116 3037 var object = optionsCache[ options ] = {};
n@1116 3038 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
n@1116 3039 object[ flag ] = true;
n@1116 3040 });
n@1116 3041 return object;
n@1116 3042 }
n@1116 3043
n@1116 3044 /*
n@1116 3045 * Create a callback list using the following parameters:
n@1116 3046 *
n@1116 3047 * options: an optional list of space-separated options that will change how
n@1116 3048 * the callback list behaves or a more traditional option object
n@1116 3049 *
n@1116 3050 * By default a callback list will act like an event callback list and can be
n@1116 3051 * "fired" multiple times.
n@1116 3052 *
n@1116 3053 * Possible options:
n@1116 3054 *
n@1116 3055 * once: will ensure the callback list can only be fired once (like a Deferred)
n@1116 3056 *
n@1116 3057 * memory: will keep track of previous values and will call any callback added
n@1116 3058 * after the list has been fired right away with the latest "memorized"
n@1116 3059 * values (like a Deferred)
n@1116 3060 *
n@1116 3061 * unique: will ensure a callback can only be added once (no duplicate in the list)
n@1116 3062 *
n@1116 3063 * stopOnFalse: interrupt callings when a callback returns false
n@1116 3064 *
n@1116 3065 */
n@1116 3066 jQuery.Callbacks = function( options ) {
n@1116 3067
n@1116 3068 // Convert options from String-formatted to Object-formatted if needed
n@1116 3069 // (we check in cache first)
n@1116 3070 options = typeof options === "string" ?
n@1116 3071 ( optionsCache[ options ] || createOptions( options ) ) :
n@1116 3072 jQuery.extend( {}, options );
n@1116 3073
n@1116 3074 var // Last fire value (for non-forgettable lists)
n@1116 3075 memory,
n@1116 3076 // Flag to know if list was already fired
n@1116 3077 fired,
n@1116 3078 // Flag to know if list is currently firing
n@1116 3079 firing,
n@1116 3080 // First callback to fire (used internally by add and fireWith)
n@1116 3081 firingStart,
n@1116 3082 // End of the loop when firing
n@1116 3083 firingLength,
n@1116 3084 // Index of currently firing callback (modified by remove if needed)
n@1116 3085 firingIndex,
n@1116 3086 // Actual callback list
n@1116 3087 list = [],
n@1116 3088 // Stack of fire calls for repeatable lists
n@1116 3089 stack = !options.once && [],
n@1116 3090 // Fire callbacks
n@1116 3091 fire = function( data ) {
n@1116 3092 memory = options.memory && data;
n@1116 3093 fired = true;
n@1116 3094 firingIndex = firingStart || 0;
n@1116 3095 firingStart = 0;
n@1116 3096 firingLength = list.length;
n@1116 3097 firing = true;
n@1116 3098 for ( ; list && firingIndex < firingLength; firingIndex++ ) {
n@1116 3099 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
n@1116 3100 memory = false; // To prevent further calls using add
n@1116 3101 break;
n@1116 3102 }
n@1116 3103 }
n@1116 3104 firing = false;
n@1116 3105 if ( list ) {
n@1116 3106 if ( stack ) {
n@1116 3107 if ( stack.length ) {
n@1116 3108 fire( stack.shift() );
n@1116 3109 }
n@1116 3110 } else if ( memory ) {
n@1116 3111 list = [];
n@1116 3112 } else {
n@1116 3113 self.disable();
n@1116 3114 }
n@1116 3115 }
n@1116 3116 },
n@1116 3117 // Actual Callbacks object
n@1116 3118 self = {
n@1116 3119 // Add a callback or a collection of callbacks to the list
n@1116 3120 add: function() {
n@1116 3121 if ( list ) {
n@1116 3122 // First, we save the current length
n@1116 3123 var start = list.length;
n@1116 3124 (function add( args ) {
n@1116 3125 jQuery.each( args, function( _, arg ) {
n@1116 3126 var type = jQuery.type( arg );
n@1116 3127 if ( type === "function" ) {
n@1116 3128 if ( !options.unique || !self.has( arg ) ) {
n@1116 3129 list.push( arg );
n@1116 3130 }
n@1116 3131 } else if ( arg && arg.length && type !== "string" ) {
n@1116 3132 // Inspect recursively
n@1116 3133 add( arg );
n@1116 3134 }
n@1116 3135 });
n@1116 3136 })( arguments );
n@1116 3137 // Do we need to add the callbacks to the
n@1116 3138 // current firing batch?
n@1116 3139 if ( firing ) {
n@1116 3140 firingLength = list.length;
n@1116 3141 // With memory, if we're not firing then
n@1116 3142 // we should call right away
n@1116 3143 } else if ( memory ) {
n@1116 3144 firingStart = start;
n@1116 3145 fire( memory );
n@1116 3146 }
n@1116 3147 }
n@1116 3148 return this;
n@1116 3149 },
n@1116 3150 // Remove a callback from the list
n@1116 3151 remove: function() {
n@1116 3152 if ( list ) {
n@1116 3153 jQuery.each( arguments, function( _, arg ) {
n@1116 3154 var index;
n@1116 3155 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
n@1116 3156 list.splice( index, 1 );
n@1116 3157 // Handle firing indexes
n@1116 3158 if ( firing ) {
n@1116 3159 if ( index <= firingLength ) {
n@1116 3160 firingLength--;
n@1116 3161 }
n@1116 3162 if ( index <= firingIndex ) {
n@1116 3163 firingIndex--;
n@1116 3164 }
n@1116 3165 }
n@1116 3166 }
n@1116 3167 });
n@1116 3168 }
n@1116 3169 return this;
n@1116 3170 },
n@1116 3171 // Check if a given callback is in the list.
n@1116 3172 // If no argument is given, return whether or not list has callbacks attached.
n@1116 3173 has: function( fn ) {
n@1116 3174 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
n@1116 3175 },
n@1116 3176 // Remove all callbacks from the list
n@1116 3177 empty: function() {
n@1116 3178 list = [];
n@1116 3179 firingLength = 0;
n@1116 3180 return this;
n@1116 3181 },
n@1116 3182 // Have the list do nothing anymore
n@1116 3183 disable: function() {
n@1116 3184 list = stack = memory = undefined;
n@1116 3185 return this;
n@1116 3186 },
n@1116 3187 // Is it disabled?
n@1116 3188 disabled: function() {
n@1116 3189 return !list;
n@1116 3190 },
n@1116 3191 // Lock the list in its current state
n@1116 3192 lock: function() {
n@1116 3193 stack = undefined;
n@1116 3194 if ( !memory ) {
n@1116 3195 self.disable();
n@1116 3196 }
n@1116 3197 return this;
n@1116 3198 },
n@1116 3199 // Is it locked?
n@1116 3200 locked: function() {
n@1116 3201 return !stack;
n@1116 3202 },
n@1116 3203 // Call all callbacks with the given context and arguments
n@1116 3204 fireWith: function( context, args ) {
n@1116 3205 if ( list && ( !fired || stack ) ) {
n@1116 3206 args = args || [];
n@1116 3207 args = [ context, args.slice ? args.slice() : args ];
n@1116 3208 if ( firing ) {
n@1116 3209 stack.push( args );
n@1116 3210 } else {
n@1116 3211 fire( args );
n@1116 3212 }
n@1116 3213 }
n@1116 3214 return this;
n@1116 3215 },
n@1116 3216 // Call all the callbacks with the given arguments
n@1116 3217 fire: function() {
n@1116 3218 self.fireWith( this, arguments );
n@1116 3219 return this;
n@1116 3220 },
n@1116 3221 // To know if the callbacks have already been called at least once
n@1116 3222 fired: function() {
n@1116 3223 return !!fired;
n@1116 3224 }
n@1116 3225 };
n@1116 3226
n@1116 3227 return self;
n@1116 3228 };
n@1116 3229
n@1116 3230
n@1116 3231 jQuery.extend({
n@1116 3232
n@1116 3233 Deferred: function( func ) {
n@1116 3234 var tuples = [
n@1116 3235 // action, add listener, listener list, final state
n@1116 3236 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
n@1116 3237 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
n@1116 3238 [ "notify", "progress", jQuery.Callbacks("memory") ]
n@1116 3239 ],
n@1116 3240 state = "pending",
n@1116 3241 promise = {
n@1116 3242 state: function() {
n@1116 3243 return state;
n@1116 3244 },
n@1116 3245 always: function() {
n@1116 3246 deferred.done( arguments ).fail( arguments );
n@1116 3247 return this;
n@1116 3248 },
n@1116 3249 then: function( /* fnDone, fnFail, fnProgress */ ) {
n@1116 3250 var fns = arguments;
n@1116 3251 return jQuery.Deferred(function( newDefer ) {
n@1116 3252 jQuery.each( tuples, function( i, tuple ) {
n@1116 3253 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
n@1116 3254 // deferred[ done | fail | progress ] for forwarding actions to newDefer
n@1116 3255 deferred[ tuple[1] ](function() {
n@1116 3256 var returned = fn && fn.apply( this, arguments );
n@1116 3257 if ( returned && jQuery.isFunction( returned.promise ) ) {
n@1116 3258 returned.promise()
n@1116 3259 .done( newDefer.resolve )
n@1116 3260 .fail( newDefer.reject )
n@1116 3261 .progress( newDefer.notify );
n@1116 3262 } else {
n@1116 3263 newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
n@1116 3264 }
n@1116 3265 });
n@1116 3266 });
n@1116 3267 fns = null;
n@1116 3268 }).promise();
n@1116 3269 },
n@1116 3270 // Get a promise for this deferred
n@1116 3271 // If obj is provided, the promise aspect is added to the object
n@1116 3272 promise: function( obj ) {
n@1116 3273 return obj != null ? jQuery.extend( obj, promise ) : promise;
n@1116 3274 }
n@1116 3275 },
n@1116 3276 deferred = {};
n@1116 3277
n@1116 3278 // Keep pipe for back-compat
n@1116 3279 promise.pipe = promise.then;
n@1116 3280
n@1116 3281 // Add list-specific methods
n@1116 3282 jQuery.each( tuples, function( i, tuple ) {
n@1116 3283 var list = tuple[ 2 ],
n@1116 3284 stateString = tuple[ 3 ];
n@1116 3285
n@1116 3286 // promise[ done | fail | progress ] = list.add
n@1116 3287 promise[ tuple[1] ] = list.add;
n@1116 3288
n@1116 3289 // Handle state
n@1116 3290 if ( stateString ) {
n@1116 3291 list.add(function() {
n@1116 3292 // state = [ resolved | rejected ]
n@1116 3293 state = stateString;
n@1116 3294
n@1116 3295 // [ reject_list | resolve_list ].disable; progress_list.lock
n@1116 3296 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
n@1116 3297 }
n@1116 3298
n@1116 3299 // deferred[ resolve | reject | notify ]
n@1116 3300 deferred[ tuple[0] ] = function() {
n@1116 3301 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
n@1116 3302 return this;
n@1116 3303 };
n@1116 3304 deferred[ tuple[0] + "With" ] = list.fireWith;
n@1116 3305 });
n@1116 3306
n@1116 3307 // Make the deferred a promise
n@1116 3308 promise.promise( deferred );
n@1116 3309
n@1116 3310 // Call given func if any
n@1116 3311 if ( func ) {
n@1116 3312 func.call( deferred, deferred );
n@1116 3313 }
n@1116 3314
n@1116 3315 // All done!
n@1116 3316 return deferred;
n@1116 3317 },
n@1116 3318
n@1116 3319 // Deferred helper
n@1116 3320 when: function( subordinate /* , ..., subordinateN */ ) {
n@1116 3321 var i = 0,
n@1116 3322 resolveValues = slice.call( arguments ),
n@1116 3323 length = resolveValues.length,
n@1116 3324
n@1116 3325 // the count of uncompleted subordinates
n@1116 3326 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
n@1116 3327
n@1116 3328 // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
n@1116 3329 deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
n@1116 3330
n@1116 3331 // Update function for both resolve and progress values
n@1116 3332 updateFunc = function( i, contexts, values ) {
n@1116 3333 return function( value ) {
n@1116 3334 contexts[ i ] = this;
n@1116 3335 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
n@1116 3336 if ( values === progressValues ) {
n@1116 3337 deferred.notifyWith( contexts, values );
n@1116 3338 } else if ( !( --remaining ) ) {
n@1116 3339 deferred.resolveWith( contexts, values );
n@1116 3340 }
n@1116 3341 };
n@1116 3342 },
n@1116 3343
n@1116 3344 progressValues, progressContexts, resolveContexts;
n@1116 3345
n@1116 3346 // Add listeners to Deferred subordinates; treat others as resolved
n@1116 3347 if ( length > 1 ) {
n@1116 3348 progressValues = new Array( length );
n@1116 3349 progressContexts = new Array( length );
n@1116 3350 resolveContexts = new Array( length );
n@1116 3351 for ( ; i < length; i++ ) {
n@1116 3352 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
n@1116 3353 resolveValues[ i ].promise()
n@1116 3354 .done( updateFunc( i, resolveContexts, resolveValues ) )
n@1116 3355 .fail( deferred.reject )
n@1116 3356 .progress( updateFunc( i, progressContexts, progressValues ) );
n@1116 3357 } else {
n@1116 3358 --remaining;
n@1116 3359 }
n@1116 3360 }
n@1116 3361 }
n@1116 3362
n@1116 3363 // If we're not waiting on anything, resolve the master
n@1116 3364 if ( !remaining ) {
n@1116 3365 deferred.resolveWith( resolveContexts, resolveValues );
n@1116 3366 }
n@1116 3367
n@1116 3368 return deferred.promise();
n@1116 3369 }
n@1116 3370 });
n@1116 3371
n@1116 3372
n@1116 3373 // The deferred used on DOM ready
n@1116 3374 var readyList;
n@1116 3375
n@1116 3376 jQuery.fn.ready = function( fn ) {
n@1116 3377 // Add the callback
n@1116 3378 jQuery.ready.promise().done( fn );
n@1116 3379
n@1116 3380 return this;
n@1116 3381 };
n@1116 3382
n@1116 3383 jQuery.extend({
n@1116 3384 // Is the DOM ready to be used? Set to true once it occurs.
n@1116 3385 isReady: false,
n@1116 3386
n@1116 3387 // A counter to track how many items to wait for before
n@1116 3388 // the ready event fires. See #6781
n@1116 3389 readyWait: 1,
n@1116 3390
n@1116 3391 // Hold (or release) the ready event
n@1116 3392 holdReady: function( hold ) {
n@1116 3393 if ( hold ) {
n@1116 3394 jQuery.readyWait++;
n@1116 3395 } else {
n@1116 3396 jQuery.ready( true );
n@1116 3397 }
n@1116 3398 },
n@1116 3399
n@1116 3400 // Handle when the DOM is ready
n@1116 3401 ready: function( wait ) {
n@1116 3402
n@1116 3403 // Abort if there are pending holds or we're already ready
n@1116 3404 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
n@1116 3405 return;
n@1116 3406 }
n@1116 3407
n@1116 3408 // Remember that the DOM is ready
n@1116 3409 jQuery.isReady = true;
n@1116 3410
n@1116 3411 // If a normal DOM Ready event fired, decrement, and wait if need be
n@1116 3412 if ( wait !== true && --jQuery.readyWait > 0 ) {
n@1116 3413 return;
n@1116 3414 }
n@1116 3415
n@1116 3416 // If there are functions bound, to execute
n@1116 3417 readyList.resolveWith( document, [ jQuery ] );
n@1116 3418
n@1116 3419 // Trigger any bound ready events
n@1116 3420 if ( jQuery.fn.triggerHandler ) {
n@1116 3421 jQuery( document ).triggerHandler( "ready" );
n@1116 3422 jQuery( document ).off( "ready" );
n@1116 3423 }
n@1116 3424 }
n@1116 3425 });
n@1116 3426
n@1116 3427 /**
n@1116 3428 * The ready event handler and self cleanup method
n@1116 3429 */
n@1116 3430 function completed() {
n@1116 3431 document.removeEventListener( "DOMContentLoaded", completed, false );
n@1116 3432 window.removeEventListener( "load", completed, false );
n@1116 3433 jQuery.ready();
n@1116 3434 }
n@1116 3435
n@1116 3436 jQuery.ready.promise = function( obj ) {
n@1116 3437 if ( !readyList ) {
n@1116 3438
n@1116 3439 readyList = jQuery.Deferred();
n@1116 3440
n@1116 3441 // Catch cases where $(document).ready() is called after the browser event has already occurred.
n@1116 3442 // We once tried to use readyState "interactive" here, but it caused issues like the one
n@1116 3443 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
n@1116 3444 if ( document.readyState === "complete" ) {
n@1116 3445 // Handle it asynchronously to allow scripts the opportunity to delay ready
n@1116 3446 setTimeout( jQuery.ready );
n@1116 3447
n@1116 3448 } else {
n@1116 3449
n@1116 3450 // Use the handy event callback
n@1116 3451 document.addEventListener( "DOMContentLoaded", completed, false );
n@1116 3452
n@1116 3453 // A fallback to window.onload, that will always work
n@1116 3454 window.addEventListener( "load", completed, false );
n@1116 3455 }
n@1116 3456 }
n@1116 3457 return readyList.promise( obj );
n@1116 3458 };
n@1116 3459
n@1116 3460 // Kick off the DOM ready check even if the user does not
n@1116 3461 jQuery.ready.promise();
n@1116 3462
n@1116 3463
n@1116 3464
n@1116 3465
n@1116 3466 // Multifunctional method to get and set values of a collection
n@1116 3467 // The value/s can optionally be executed if it's a function
n@1116 3468 var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
n@1116 3469 var i = 0,
n@1116 3470 len = elems.length,
n@1116 3471 bulk = key == null;
n@1116 3472
n@1116 3473 // Sets many values
n@1116 3474 if ( jQuery.type( key ) === "object" ) {
n@1116 3475 chainable = true;
n@1116 3476 for ( i in key ) {
n@1116 3477 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
n@1116 3478 }
n@1116 3479
n@1116 3480 // Sets one value
n@1116 3481 } else if ( value !== undefined ) {
n@1116 3482 chainable = true;
n@1116 3483
n@1116 3484 if ( !jQuery.isFunction( value ) ) {
n@1116 3485 raw = true;
n@1116 3486 }
n@1116 3487
n@1116 3488 if ( bulk ) {
n@1116 3489 // Bulk operations run against the entire set
n@1116 3490 if ( raw ) {
n@1116 3491 fn.call( elems, value );
n@1116 3492 fn = null;
n@1116 3493
n@1116 3494 // ...except when executing function values
n@1116 3495 } else {
n@1116 3496 bulk = fn;
n@1116 3497 fn = function( elem, key, value ) {
n@1116 3498 return bulk.call( jQuery( elem ), value );
n@1116 3499 };
n@1116 3500 }
n@1116 3501 }
n@1116 3502
n@1116 3503 if ( fn ) {
n@1116 3504 for ( ; i < len; i++ ) {
n@1116 3505 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
n@1116 3506 }
n@1116 3507 }
n@1116 3508 }
n@1116 3509
n@1116 3510 return chainable ?
n@1116 3511 elems :
n@1116 3512
n@1116 3513 // Gets
n@1116 3514 bulk ?
n@1116 3515 fn.call( elems ) :
n@1116 3516 len ? fn( elems[0], key ) : emptyGet;
n@1116 3517 };
n@1116 3518
n@1116 3519
n@1116 3520 /**
n@1116 3521 * Determines whether an object can have data
n@1116 3522 */
n@1116 3523 jQuery.acceptData = function( owner ) {
n@1116 3524 // Accepts only:
n@1116 3525 // - Node
n@1116 3526 // - Node.ELEMENT_NODE
n@1116 3527 // - Node.DOCUMENT_NODE
n@1116 3528 // - Object
n@1116 3529 // - Any
n@1116 3530 /* jshint -W018 */
n@1116 3531 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
n@1116 3532 };
n@1116 3533
n@1116 3534
n@1116 3535 function Data() {
n@1116 3536 // Support: Android<4,
n@1116 3537 // Old WebKit does not have Object.preventExtensions/freeze method,
n@1116 3538 // return new empty object instead with no [[set]] accessor
n@1116 3539 Object.defineProperty( this.cache = {}, 0, {
n@1116 3540 get: function() {
n@1116 3541 return {};
n@1116 3542 }
n@1116 3543 });
n@1116 3544
n@1116 3545 this.expando = jQuery.expando + Data.uid++;
n@1116 3546 }
n@1116 3547
n@1116 3548 Data.uid = 1;
n@1116 3549 Data.accepts = jQuery.acceptData;
n@1116 3550
n@1116 3551 Data.prototype = {
n@1116 3552 key: function( owner ) {
n@1116 3553 // We can accept data for non-element nodes in modern browsers,
n@1116 3554 // but we should not, see #8335.
n@1116 3555 // Always return the key for a frozen object.
n@1116 3556 if ( !Data.accepts( owner ) ) {
n@1116 3557 return 0;
n@1116 3558 }
n@1116 3559
n@1116 3560 var descriptor = {},
n@1116 3561 // Check if the owner object already has a cache key
n@1116 3562 unlock = owner[ this.expando ];
n@1116 3563
n@1116 3564 // If not, create one
n@1116 3565 if ( !unlock ) {
n@1116 3566 unlock = Data.uid++;
n@1116 3567
n@1116 3568 // Secure it in a non-enumerable, non-writable property
n@1116 3569 try {
n@1116 3570 descriptor[ this.expando ] = { value: unlock };
n@1116 3571 Object.defineProperties( owner, descriptor );
n@1116 3572
n@1116 3573 // Support: Android<4
n@1116 3574 // Fallback to a less secure definition
n@1116 3575 } catch ( e ) {
n@1116 3576 descriptor[ this.expando ] = unlock;
n@1116 3577 jQuery.extend( owner, descriptor );
n@1116 3578 }
n@1116 3579 }
n@1116 3580
n@1116 3581 // Ensure the cache object
n@1116 3582 if ( !this.cache[ unlock ] ) {
n@1116 3583 this.cache[ unlock ] = {};
n@1116 3584 }
n@1116 3585
n@1116 3586 return unlock;
n@1116 3587 },
n@1116 3588 set: function( owner, data, value ) {
n@1116 3589 var prop,
n@1116 3590 // There may be an unlock assigned to this node,
n@1116 3591 // if there is no entry for this "owner", create one inline
n@1116 3592 // and set the unlock as though an owner entry had always existed
n@1116 3593 unlock = this.key( owner ),
n@1116 3594 cache = this.cache[ unlock ];
n@1116 3595
n@1116 3596 // Handle: [ owner, key, value ] args
n@1116 3597 if ( typeof data === "string" ) {
n@1116 3598 cache[ data ] = value;
n@1116 3599
n@1116 3600 // Handle: [ owner, { properties } ] args
n@1116 3601 } else {
n@1116 3602 // Fresh assignments by object are shallow copied
n@1116 3603 if ( jQuery.isEmptyObject( cache ) ) {
n@1116 3604 jQuery.extend( this.cache[ unlock ], data );
n@1116 3605 // Otherwise, copy the properties one-by-one to the cache object
n@1116 3606 } else {
n@1116 3607 for ( prop in data ) {
n@1116 3608 cache[ prop ] = data[ prop ];
n@1116 3609 }
n@1116 3610 }
n@1116 3611 }
n@1116 3612 return cache;
n@1116 3613 },
n@1116 3614 get: function( owner, key ) {
n@1116 3615 // Either a valid cache is found, or will be created.
n@1116 3616 // New caches will be created and the unlock returned,
n@1116 3617 // allowing direct access to the newly created
n@1116 3618 // empty data object. A valid owner object must be provided.
n@1116 3619 var cache = this.cache[ this.key( owner ) ];
n@1116 3620
n@1116 3621 return key === undefined ?
n@1116 3622 cache : cache[ key ];
n@1116 3623 },
n@1116 3624 access: function( owner, key, value ) {
n@1116 3625 var stored;
n@1116 3626 // In cases where either:
n@1116 3627 //
n@1116 3628 // 1. No key was specified
n@1116 3629 // 2. A string key was specified, but no value provided
n@1116 3630 //
n@1116 3631 // Take the "read" path and allow the get method to determine
n@1116 3632 // which value to return, respectively either:
n@1116 3633 //
n@1116 3634 // 1. The entire cache object
n@1116 3635 // 2. The data stored at the key
n@1116 3636 //
n@1116 3637 if ( key === undefined ||
n@1116 3638 ((key && typeof key === "string") && value === undefined) ) {
n@1116 3639
n@1116 3640 stored = this.get( owner, key );
n@1116 3641
n@1116 3642 return stored !== undefined ?
n@1116 3643 stored : this.get( owner, jQuery.camelCase(key) );
n@1116 3644 }
n@1116 3645
n@1116 3646 // [*]When the key is not a string, or both a key and value
n@1116 3647 // are specified, set or extend (existing objects) with either:
n@1116 3648 //
n@1116 3649 // 1. An object of properties
n@1116 3650 // 2. A key and value
n@1116 3651 //
n@1116 3652 this.set( owner, key, value );
n@1116 3653
n@1116 3654 // Since the "set" path can have two possible entry points
n@1116 3655 // return the expected data based on which path was taken[*]
n@1116 3656 return value !== undefined ? value : key;
n@1116 3657 },
n@1116 3658 remove: function( owner, key ) {
n@1116 3659 var i, name, camel,
n@1116 3660 unlock = this.key( owner ),
n@1116 3661 cache = this.cache[ unlock ];
n@1116 3662
n@1116 3663 if ( key === undefined ) {
n@1116 3664 this.cache[ unlock ] = {};
n@1116 3665
n@1116 3666 } else {
n@1116 3667 // Support array or space separated string of keys
n@1116 3668 if ( jQuery.isArray( key ) ) {
n@1116 3669 // If "name" is an array of keys...
n@1116 3670 // When data is initially created, via ("key", "val") signature,
n@1116 3671 // keys will be converted to camelCase.
n@1116 3672 // Since there is no way to tell _how_ a key was added, remove
n@1116 3673 // both plain key and camelCase key. #12786
n@1116 3674 // This will only penalize the array argument path.
n@1116 3675 name = key.concat( key.map( jQuery.camelCase ) );
n@1116 3676 } else {
n@1116 3677 camel = jQuery.camelCase( key );
n@1116 3678 // Try the string as a key before any manipulation
n@1116 3679 if ( key in cache ) {
n@1116 3680 name = [ key, camel ];
n@1116 3681 } else {
n@1116 3682 // If a key with the spaces exists, use it.
n@1116 3683 // Otherwise, create an array by matching non-whitespace
n@1116 3684 name = camel;
n@1116 3685 name = name in cache ?
n@1116 3686 [ name ] : ( name.match( rnotwhite ) || [] );
n@1116 3687 }
n@1116 3688 }
n@1116 3689
n@1116 3690 i = name.length;
n@1116 3691 while ( i-- ) {
n@1116 3692 delete cache[ name[ i ] ];
n@1116 3693 }
n@1116 3694 }
n@1116 3695 },
n@1116 3696 hasData: function( owner ) {
n@1116 3697 return !jQuery.isEmptyObject(
n@1116 3698 this.cache[ owner[ this.expando ] ] || {}
n@1116 3699 );
n@1116 3700 },
n@1116 3701 discard: function( owner ) {
n@1116 3702 if ( owner[ this.expando ] ) {
n@1116 3703 delete this.cache[ owner[ this.expando ] ];
n@1116 3704 }
n@1116 3705 }
n@1116 3706 };
n@1116 3707 var data_priv = new Data();
n@1116 3708
n@1116 3709 var data_user = new Data();
n@1116 3710
n@1116 3711
n@1116 3712
n@1116 3713 // Implementation Summary
n@1116 3714 //
n@1116 3715 // 1. Enforce API surface and semantic compatibility with 1.9.x branch
n@1116 3716 // 2. Improve the module's maintainability by reducing the storage
n@1116 3717 // paths to a single mechanism.
n@1116 3718 // 3. Use the same single mechanism to support "private" and "user" data.
n@1116 3719 // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
n@1116 3720 // 5. Avoid exposing implementation details on user objects (eg. expando properties)
n@1116 3721 // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
n@1116 3722
n@1116 3723 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
n@1116 3724 rmultiDash = /([A-Z])/g;
n@1116 3725
n@1116 3726 function dataAttr( elem, key, data ) {
n@1116 3727 var name;
n@1116 3728
n@1116 3729 // If nothing was found internally, try to fetch any
n@1116 3730 // data from the HTML5 data-* attribute
n@1116 3731 if ( data === undefined && elem.nodeType === 1 ) {
n@1116 3732 name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
n@1116 3733 data = elem.getAttribute( name );
n@1116 3734
n@1116 3735 if ( typeof data === "string" ) {
n@1116 3736 try {
n@1116 3737 data = data === "true" ? true :
n@1116 3738 data === "false" ? false :
n@1116 3739 data === "null" ? null :
n@1116 3740 // Only convert to a number if it doesn't change the string
n@1116 3741 +data + "" === data ? +data :
n@1116 3742 rbrace.test( data ) ? jQuery.parseJSON( data ) :
n@1116 3743 data;
n@1116 3744 } catch( e ) {}
n@1116 3745
n@1116 3746 // Make sure we set the data so it isn't changed later
n@1116 3747 data_user.set( elem, key, data );
n@1116 3748 } else {
n@1116 3749 data = undefined;
n@1116 3750 }
n@1116 3751 }
n@1116 3752 return data;
n@1116 3753 }
n@1116 3754
n@1116 3755 jQuery.extend({
n@1116 3756 hasData: function( elem ) {
n@1116 3757 return data_user.hasData( elem ) || data_priv.hasData( elem );
n@1116 3758 },
n@1116 3759
n@1116 3760 data: function( elem, name, data ) {
n@1116 3761 return data_user.access( elem, name, data );
n@1116 3762 },
n@1116 3763
n@1116 3764 removeData: function( elem, name ) {
n@1116 3765 data_user.remove( elem, name );
n@1116 3766 },
n@1116 3767
n@1116 3768 // TODO: Now that all calls to _data and _removeData have been replaced
n@1116 3769 // with direct calls to data_priv methods, these can be deprecated.
n@1116 3770 _data: function( elem, name, data ) {
n@1116 3771 return data_priv.access( elem, name, data );
n@1116 3772 },
n@1116 3773
n@1116 3774 _removeData: function( elem, name ) {
n@1116 3775 data_priv.remove( elem, name );
n@1116 3776 }
n@1116 3777 });
n@1116 3778
n@1116 3779 jQuery.fn.extend({
n@1116 3780 data: function( key, value ) {
n@1116 3781 var i, name, data,
n@1116 3782 elem = this[ 0 ],
n@1116 3783 attrs = elem && elem.attributes;
n@1116 3784
n@1116 3785 // Gets all values
n@1116 3786 if ( key === undefined ) {
n@1116 3787 if ( this.length ) {
n@1116 3788 data = data_user.get( elem );
n@1116 3789
n@1116 3790 if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
n@1116 3791 i = attrs.length;
n@1116 3792 while ( i-- ) {
n@1116 3793
n@1116 3794 // Support: IE11+
n@1116 3795 // The attrs elements can be null (#14894)
n@1116 3796 if ( attrs[ i ] ) {
n@1116 3797 name = attrs[ i ].name;
n@1116 3798 if ( name.indexOf( "data-" ) === 0 ) {
n@1116 3799 name = jQuery.camelCase( name.slice(5) );
n@1116 3800 dataAttr( elem, name, data[ name ] );
n@1116 3801 }
n@1116 3802 }
n@1116 3803 }
n@1116 3804 data_priv.set( elem, "hasDataAttrs", true );
n@1116 3805 }
n@1116 3806 }
n@1116 3807
n@1116 3808 return data;
n@1116 3809 }
n@1116 3810
n@1116 3811 // Sets multiple values
n@1116 3812 if ( typeof key === "object" ) {
n@1116 3813 return this.each(function() {
n@1116 3814 data_user.set( this, key );
n@1116 3815 });
n@1116 3816 }
n@1116 3817
n@1116 3818 return access( this, function( value ) {
n@1116 3819 var data,
n@1116 3820 camelKey = jQuery.camelCase( key );
n@1116 3821
n@1116 3822 // The calling jQuery object (element matches) is not empty
n@1116 3823 // (and therefore has an element appears at this[ 0 ]) and the
n@1116 3824 // `value` parameter was not undefined. An empty jQuery object
n@1116 3825 // will result in `undefined` for elem = this[ 0 ] which will
n@1116 3826 // throw an exception if an attempt to read a data cache is made.
n@1116 3827 if ( elem && value === undefined ) {
n@1116 3828 // Attempt to get data from the cache
n@1116 3829 // with the key as-is
n@1116 3830 data = data_user.get( elem, key );
n@1116 3831 if ( data !== undefined ) {
n@1116 3832 return data;
n@1116 3833 }
n@1116 3834
n@1116 3835 // Attempt to get data from the cache
n@1116 3836 // with the key camelized
n@1116 3837 data = data_user.get( elem, camelKey );
n@1116 3838 if ( data !== undefined ) {
n@1116 3839 return data;
n@1116 3840 }
n@1116 3841
n@1116 3842 // Attempt to "discover" the data in
n@1116 3843 // HTML5 custom data-* attrs
n@1116 3844 data = dataAttr( elem, camelKey, undefined );
n@1116 3845 if ( data !== undefined ) {
n@1116 3846 return data;
n@1116 3847 }
n@1116 3848
n@1116 3849 // We tried really hard, but the data doesn't exist.
n@1116 3850 return;
n@1116 3851 }
n@1116 3852
n@1116 3853 // Set the data...
n@1116 3854 this.each(function() {
n@1116 3855 // First, attempt to store a copy or reference of any
n@1116 3856 // data that might've been store with a camelCased key.
n@1116 3857 var data = data_user.get( this, camelKey );
n@1116 3858
n@1116 3859 // For HTML5 data-* attribute interop, we have to
n@1116 3860 // store property names with dashes in a camelCase form.
n@1116 3861 // This might not apply to all properties...*
n@1116 3862 data_user.set( this, camelKey, value );
n@1116 3863
n@1116 3864 // *... In the case of properties that might _actually_
n@1116 3865 // have dashes, we need to also store a copy of that
n@1116 3866 // unchanged property.
n@1116 3867 if ( key.indexOf("-") !== -1 && data !== undefined ) {
n@1116 3868 data_user.set( this, key, value );
n@1116 3869 }
n@1116 3870 });
n@1116 3871 }, null, value, arguments.length > 1, null, true );
n@1116 3872 },
n@1116 3873
n@1116 3874 removeData: function( key ) {
n@1116 3875 return this.each(function() {
n@1116 3876 data_user.remove( this, key );
n@1116 3877 });
n@1116 3878 }
n@1116 3879 });
n@1116 3880
n@1116 3881
n@1116 3882 jQuery.extend({
n@1116 3883 queue: function( elem, type, data ) {
n@1116 3884 var queue;
n@1116 3885
n@1116 3886 if ( elem ) {
n@1116 3887 type = ( type || "fx" ) + "queue";
n@1116 3888 queue = data_priv.get( elem, type );
n@1116 3889
n@1116 3890 // Speed up dequeue by getting out quickly if this is just a lookup
n@1116 3891 if ( data ) {
n@1116 3892 if ( !queue || jQuery.isArray( data ) ) {
n@1116 3893 queue = data_priv.access( elem, type, jQuery.makeArray(data) );
n@1116 3894 } else {
n@1116 3895 queue.push( data );
n@1116 3896 }
n@1116 3897 }
n@1116 3898 return queue || [];
n@1116 3899 }
n@1116 3900 },
n@1116 3901
n@1116 3902 dequeue: function( elem, type ) {
n@1116 3903 type = type || "fx";
n@1116 3904
n@1116 3905 var queue = jQuery.queue( elem, type ),
n@1116 3906 startLength = queue.length,
n@1116 3907 fn = queue.shift(),
n@1116 3908 hooks = jQuery._queueHooks( elem, type ),
n@1116 3909 next = function() {
n@1116 3910 jQuery.dequeue( elem, type );
n@1116 3911 };
n@1116 3912
n@1116 3913 // If the fx queue is dequeued, always remove the progress sentinel
n@1116 3914 if ( fn === "inprogress" ) {
n@1116 3915 fn = queue.shift();
n@1116 3916 startLength--;
n@1116 3917 }
n@1116 3918
n@1116 3919 if ( fn ) {
n@1116 3920
n@1116 3921 // Add a progress sentinel to prevent the fx queue from being
n@1116 3922 // automatically dequeued
n@1116 3923 if ( type === "fx" ) {
n@1116 3924 queue.unshift( "inprogress" );
n@1116 3925 }
n@1116 3926
n@1116 3927 // Clear up the last queue stop function
n@1116 3928 delete hooks.stop;
n@1116 3929 fn.call( elem, next, hooks );
n@1116 3930 }
n@1116 3931
n@1116 3932 if ( !startLength && hooks ) {
n@1116 3933 hooks.empty.fire();
n@1116 3934 }
n@1116 3935 },
n@1116 3936
n@1116 3937 // Not public - generate a queueHooks object, or return the current one
n@1116 3938 _queueHooks: function( elem, type ) {
n@1116 3939 var key = type + "queueHooks";
n@1116 3940 return data_priv.get( elem, key ) || data_priv.access( elem, key, {
n@1116 3941 empty: jQuery.Callbacks("once memory").add(function() {
n@1116 3942 data_priv.remove( elem, [ type + "queue", key ] );
n@1116 3943 })
n@1116 3944 });
n@1116 3945 }
n@1116 3946 });
n@1116 3947
n@1116 3948 jQuery.fn.extend({
n@1116 3949 queue: function( type, data ) {
n@1116 3950 var setter = 2;
n@1116 3951
n@1116 3952 if ( typeof type !== "string" ) {
n@1116 3953 data = type;
n@1116 3954 type = "fx";
n@1116 3955 setter--;
n@1116 3956 }
n@1116 3957
n@1116 3958 if ( arguments.length < setter ) {
n@1116 3959 return jQuery.queue( this[0], type );
n@1116 3960 }
n@1116 3961
n@1116 3962 return data === undefined ?
n@1116 3963 this :
n@1116 3964 this.each(function() {
n@1116 3965 var queue = jQuery.queue( this, type, data );
n@1116 3966
n@1116 3967 // Ensure a hooks for this queue
n@1116 3968 jQuery._queueHooks( this, type );
n@1116 3969
n@1116 3970 if ( type === "fx" && queue[0] !== "inprogress" ) {
n@1116 3971 jQuery.dequeue( this, type );
n@1116 3972 }
n@1116 3973 });
n@1116 3974 },
n@1116 3975 dequeue: function( type ) {
n@1116 3976 return this.each(function() {
n@1116 3977 jQuery.dequeue( this, type );
n@1116 3978 });
n@1116 3979 },
n@1116 3980 clearQueue: function( type ) {
n@1116 3981 return this.queue( type || "fx", [] );
n@1116 3982 },
n@1116 3983 // Get a promise resolved when queues of a certain type
n@1116 3984 // are emptied (fx is the type by default)
n@1116 3985 promise: function( type, obj ) {
n@1116 3986 var tmp,
n@1116 3987 count = 1,
n@1116 3988 defer = jQuery.Deferred(),
n@1116 3989 elements = this,
n@1116 3990 i = this.length,
n@1116 3991 resolve = function() {
n@1116 3992 if ( !( --count ) ) {
n@1116 3993 defer.resolveWith( elements, [ elements ] );
n@1116 3994 }
n@1116 3995 };
n@1116 3996
n@1116 3997 if ( typeof type !== "string" ) {
n@1116 3998 obj = type;
n@1116 3999 type = undefined;
n@1116 4000 }
n@1116 4001 type = type || "fx";
n@1116 4002
n@1116 4003 while ( i-- ) {
n@1116 4004 tmp = data_priv.get( elements[ i ], type + "queueHooks" );
n@1116 4005 if ( tmp && tmp.empty ) {
n@1116 4006 count++;
n@1116 4007 tmp.empty.add( resolve );
n@1116 4008 }
n@1116 4009 }
n@1116 4010 resolve();
n@1116 4011 return defer.promise( obj );
n@1116 4012 }
n@1116 4013 });
n@1116 4014 var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
n@1116 4015
n@1116 4016 var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
n@1116 4017
n@1116 4018 var isHidden = function( elem, el ) {
n@1116 4019 // isHidden might be called from jQuery#filter function;
n@1116 4020 // in that case, element will be second argument
n@1116 4021 elem = el || elem;
n@1116 4022 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
n@1116 4023 };
n@1116 4024
n@1116 4025 var rcheckableType = (/^(?:checkbox|radio)$/i);
n@1116 4026
n@1116 4027
n@1116 4028
n@1116 4029 (function() {
n@1116 4030 var fragment = document.createDocumentFragment(),
n@1116 4031 div = fragment.appendChild( document.createElement( "div" ) ),
n@1116 4032 input = document.createElement( "input" );
n@1116 4033
n@1116 4034 // Support: Safari<=5.1
n@1116 4035 // Check state lost if the name is set (#11217)
n@1116 4036 // Support: Windows Web Apps (WWA)
n@1116 4037 // `name` and `type` must use .setAttribute for WWA (#14901)
n@1116 4038 input.setAttribute( "type", "radio" );
n@1116 4039 input.setAttribute( "checked", "checked" );
n@1116 4040 input.setAttribute( "name", "t" );
n@1116 4041
n@1116 4042 div.appendChild( input );
n@1116 4043
n@1116 4044 // Support: Safari<=5.1, Android<4.2
n@1116 4045 // Older WebKit doesn't clone checked state correctly in fragments
n@1116 4046 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
n@1116 4047
n@1116 4048 // Support: IE<=11+
n@1116 4049 // Make sure textarea (and checkbox) defaultValue is properly cloned
n@1116 4050 div.innerHTML = "<textarea>x</textarea>";
n@1116 4051 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
n@1116 4052 })();
n@1116 4053 var strundefined = typeof undefined;
n@1116 4054
n@1116 4055
n@1116 4056
n@1116 4057 support.focusinBubbles = "onfocusin" in window;
n@1116 4058
n@1116 4059
n@1116 4060 var
n@1116 4061 rkeyEvent = /^key/,
n@1116 4062 rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
n@1116 4063 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
n@1116 4064 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
n@1116 4065
n@1116 4066 function returnTrue() {
n@1116 4067 return true;
n@1116 4068 }
n@1116 4069
n@1116 4070 function returnFalse() {
n@1116 4071 return false;
n@1116 4072 }
n@1116 4073
n@1116 4074 function safeActiveElement() {
n@1116 4075 try {
n@1116 4076 return document.activeElement;
n@1116 4077 } catch ( err ) { }
n@1116 4078 }
n@1116 4079
n@1116 4080 /*
n@1116 4081 * Helper functions for managing events -- not part of the public interface.
n@1116 4082 * Props to Dean Edwards' addEvent library for many of the ideas.
n@1116 4083 */
n@1116 4084 jQuery.event = {
n@1116 4085
n@1116 4086 global: {},
n@1116 4087
n@1116 4088 add: function( elem, types, handler, data, selector ) {
n@1116 4089
n@1116 4090 var handleObjIn, eventHandle, tmp,
n@1116 4091 events, t, handleObj,
n@1116 4092 special, handlers, type, namespaces, origType,
n@1116 4093 elemData = data_priv.get( elem );
n@1116 4094
n@1116 4095 // Don't attach events to noData or text/comment nodes (but allow plain objects)
n@1116 4096 if ( !elemData ) {
n@1116 4097 return;
n@1116 4098 }
n@1116 4099
n@1116 4100 // Caller can pass in an object of custom data in lieu of the handler
n@1116 4101 if ( handler.handler ) {
n@1116 4102 handleObjIn = handler;
n@1116 4103 handler = handleObjIn.handler;
n@1116 4104 selector = handleObjIn.selector;
n@1116 4105 }
n@1116 4106
n@1116 4107 // Make sure that the handler has a unique ID, used to find/remove it later
n@1116 4108 if ( !handler.guid ) {
n@1116 4109 handler.guid = jQuery.guid++;
n@1116 4110 }
n@1116 4111
n@1116 4112 // Init the element's event structure and main handler, if this is the first
n@1116 4113 if ( !(events = elemData.events) ) {
n@1116 4114 events = elemData.events = {};
n@1116 4115 }
n@1116 4116 if ( !(eventHandle = elemData.handle) ) {
n@1116 4117 eventHandle = elemData.handle = function( e ) {
n@1116 4118 // Discard the second event of a jQuery.event.trigger() and
n@1116 4119 // when an event is called after a page has unloaded
n@1116 4120 return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
n@1116 4121 jQuery.event.dispatch.apply( elem, arguments ) : undefined;
n@1116 4122 };
n@1116 4123 }
n@1116 4124
n@1116 4125 // Handle multiple events separated by a space
n@1116 4126 types = ( types || "" ).match( rnotwhite ) || [ "" ];
n@1116 4127 t = types.length;
n@1116 4128 while ( t-- ) {
n@1116 4129 tmp = rtypenamespace.exec( types[t] ) || [];
n@1116 4130 type = origType = tmp[1];
n@1116 4131 namespaces = ( tmp[2] || "" ).split( "." ).sort();
n@1116 4132
n@1116 4133 // There *must* be a type, no attaching namespace-only handlers
n@1116 4134 if ( !type ) {
n@1116 4135 continue;
n@1116 4136 }
n@1116 4137
n@1116 4138 // If event changes its type, use the special event handlers for the changed type
n@1116 4139 special = jQuery.event.special[ type ] || {};
n@1116 4140
n@1116 4141 // If selector defined, determine special event api type, otherwise given type
n@1116 4142 type = ( selector ? special.delegateType : special.bindType ) || type;
n@1116 4143
n@1116 4144 // Update special based on newly reset type
n@1116 4145 special = jQuery.event.special[ type ] || {};
n@1116 4146
n@1116 4147 // handleObj is passed to all event handlers
n@1116 4148 handleObj = jQuery.extend({
n@1116 4149 type: type,
n@1116 4150 origType: origType,
n@1116 4151 data: data,
n@1116 4152 handler: handler,
n@1116 4153 guid: handler.guid,
n@1116 4154 selector: selector,
n@1116 4155 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
n@1116 4156 namespace: namespaces.join(".")
n@1116 4157 }, handleObjIn );
n@1116 4158
n@1116 4159 // Init the event handler queue if we're the first
n@1116 4160 if ( !(handlers = events[ type ]) ) {
n@1116 4161 handlers = events[ type ] = [];
n@1116 4162 handlers.delegateCount = 0;
n@1116 4163
n@1116 4164 // Only use addEventListener if the special events handler returns false
n@1116 4165 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
n@1116 4166 if ( elem.addEventListener ) {
n@1116 4167 elem.addEventListener( type, eventHandle, false );
n@1116 4168 }
n@1116 4169 }
n@1116 4170 }
n@1116 4171
n@1116 4172 if ( special.add ) {
n@1116 4173 special.add.call( elem, handleObj );
n@1116 4174
n@1116 4175 if ( !handleObj.handler.guid ) {
n@1116 4176 handleObj.handler.guid = handler.guid;
n@1116 4177 }
n@1116 4178 }
n@1116 4179
n@1116 4180 // Add to the element's handler list, delegates in front
n@1116 4181 if ( selector ) {
n@1116 4182 handlers.splice( handlers.delegateCount++, 0, handleObj );
n@1116 4183 } else {
n@1116 4184 handlers.push( handleObj );
n@1116 4185 }
n@1116 4186
n@1116 4187 // Keep track of which events have ever been used, for event optimization
n@1116 4188 jQuery.event.global[ type ] = true;
n@1116 4189 }
n@1116 4190
n@1116 4191 },
n@1116 4192
n@1116 4193 // Detach an event or set of events from an element
n@1116 4194 remove: function( elem, types, handler, selector, mappedTypes ) {
n@1116 4195
n@1116 4196 var j, origCount, tmp,
n@1116 4197 events, t, handleObj,
n@1116 4198 special, handlers, type, namespaces, origType,
n@1116 4199 elemData = data_priv.hasData( elem ) && data_priv.get( elem );
n@1116 4200
n@1116 4201 if ( !elemData || !(events = elemData.events) ) {
n@1116 4202 return;
n@1116 4203 }
n@1116 4204
n@1116 4205 // Once for each type.namespace in types; type may be omitted
n@1116 4206 types = ( types || "" ).match( rnotwhite ) || [ "" ];
n@1116 4207 t = types.length;
n@1116 4208 while ( t-- ) {
n@1116 4209 tmp = rtypenamespace.exec( types[t] ) || [];
n@1116 4210 type = origType = tmp[1];
n@1116 4211 namespaces = ( tmp[2] || "" ).split( "." ).sort();
n@1116 4212
n@1116 4213 // Unbind all events (on this namespace, if provided) for the element
n@1116 4214 if ( !type ) {
n@1116 4215 for ( type in events ) {
n@1116 4216 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
n@1116 4217 }
n@1116 4218 continue;
n@1116 4219 }
n@1116 4220
n@1116 4221 special = jQuery.event.special[ type ] || {};
n@1116 4222 type = ( selector ? special.delegateType : special.bindType ) || type;
n@1116 4223 handlers = events[ type ] || [];
n@1116 4224 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
n@1116 4225
n@1116 4226 // Remove matching events
n@1116 4227 origCount = j = handlers.length;
n@1116 4228 while ( j-- ) {
n@1116 4229 handleObj = handlers[ j ];
n@1116 4230
n@1116 4231 if ( ( mappedTypes || origType === handleObj.origType ) &&
n@1116 4232 ( !handler || handler.guid === handleObj.guid ) &&
n@1116 4233 ( !tmp || tmp.test( handleObj.namespace ) ) &&
n@1116 4234 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
n@1116 4235 handlers.splice( j, 1 );
n@1116 4236
n@1116 4237 if ( handleObj.selector ) {
n@1116 4238 handlers.delegateCount--;
n@1116 4239 }
n@1116 4240 if ( special.remove ) {
n@1116 4241 special.remove.call( elem, handleObj );
n@1116 4242 }
n@1116 4243 }
n@1116 4244 }
n@1116 4245
n@1116 4246 // Remove generic event handler if we removed something and no more handlers exist
n@1116 4247 // (avoids potential for endless recursion during removal of special event handlers)
n@1116 4248 if ( origCount && !handlers.length ) {
n@1116 4249 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
n@1116 4250 jQuery.removeEvent( elem, type, elemData.handle );
n@1116 4251 }
n@1116 4252
n@1116 4253 delete events[ type ];
n@1116 4254 }
n@1116 4255 }
n@1116 4256
n@1116 4257 // Remove the expando if it's no longer used
n@1116 4258 if ( jQuery.isEmptyObject( events ) ) {
n@1116 4259 delete elemData.handle;
n@1116 4260 data_priv.remove( elem, "events" );
n@1116 4261 }
n@1116 4262 },
n@1116 4263
n@1116 4264 trigger: function( event, data, elem, onlyHandlers ) {
n@1116 4265
n@1116 4266 var i, cur, tmp, bubbleType, ontype, handle, special,
n@1116 4267 eventPath = [ elem || document ],
n@1116 4268 type = hasOwn.call( event, "type" ) ? event.type : event,
n@1116 4269 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
n@1116 4270
n@1116 4271 cur = tmp = elem = elem || document;
n@1116 4272
n@1116 4273 // Don't do events on text and comment nodes
n@1116 4274 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
n@1116 4275 return;
n@1116 4276 }
n@1116 4277
n@1116 4278 // focus/blur morphs to focusin/out; ensure we're not firing them right now
n@1116 4279 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
n@1116 4280 return;
n@1116 4281 }
n@1116 4282
n@1116 4283 if ( type.indexOf(".") >= 0 ) {
n@1116 4284 // Namespaced trigger; create a regexp to match event type in handle()
n@1116 4285 namespaces = type.split(".");
n@1116 4286 type = namespaces.shift();
n@1116 4287 namespaces.sort();
n@1116 4288 }
n@1116 4289 ontype = type.indexOf(":") < 0 && "on" + type;
n@1116 4290
n@1116 4291 // Caller can pass in a jQuery.Event object, Object, or just an event type string
n@1116 4292 event = event[ jQuery.expando ] ?
n@1116 4293 event :
n@1116 4294 new jQuery.Event( type, typeof event === "object" && event );
n@1116 4295
n@1116 4296 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
n@1116 4297 event.isTrigger = onlyHandlers ? 2 : 3;
n@1116 4298 event.namespace = namespaces.join(".");
n@1116 4299 event.namespace_re = event.namespace ?
n@1116 4300 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
n@1116 4301 null;
n@1116 4302
n@1116 4303 // Clean up the event in case it is being reused
n@1116 4304 event.result = undefined;
n@1116 4305 if ( !event.target ) {
n@1116 4306 event.target = elem;
n@1116 4307 }
n@1116 4308
n@1116 4309 // Clone any incoming data and prepend the event, creating the handler arg list
n@1116 4310 data = data == null ?
n@1116 4311 [ event ] :
n@1116 4312 jQuery.makeArray( data, [ event ] );
n@1116 4313
n@1116 4314 // Allow special events to draw outside the lines
n@1116 4315 special = jQuery.event.special[ type ] || {};
n@1116 4316 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
n@1116 4317 return;
n@1116 4318 }
n@1116 4319
n@1116 4320 // Determine event propagation path in advance, per W3C events spec (#9951)
n@1116 4321 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
n@1116 4322 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
n@1116 4323
n@1116 4324 bubbleType = special.delegateType || type;
n@1116 4325 if ( !rfocusMorph.test( bubbleType + type ) ) {
n@1116 4326 cur = cur.parentNode;
n@1116 4327 }
n@1116 4328 for ( ; cur; cur = cur.parentNode ) {
n@1116 4329 eventPath.push( cur );
n@1116 4330 tmp = cur;
n@1116 4331 }
n@1116 4332
n@1116 4333 // Only add window if we got to document (e.g., not plain obj or detached DOM)
n@1116 4334 if ( tmp === (elem.ownerDocument || document) ) {
n@1116 4335 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
n@1116 4336 }
n@1116 4337 }
n@1116 4338
n@1116 4339 // Fire handlers on the event path
n@1116 4340 i = 0;
n@1116 4341 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
n@1116 4342
n@1116 4343 event.type = i > 1 ?
n@1116 4344 bubbleType :
n@1116 4345 special.bindType || type;
n@1116 4346
n@1116 4347 // jQuery handler
n@1116 4348 handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
n@1116 4349 if ( handle ) {
n@1116 4350 handle.apply( cur, data );
n@1116 4351 }
n@1116 4352
n@1116 4353 // Native handler
n@1116 4354 handle = ontype && cur[ ontype ];
n@1116 4355 if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
n@1116 4356 event.result = handle.apply( cur, data );
n@1116 4357 if ( event.result === false ) {
n@1116 4358 event.preventDefault();
n@1116 4359 }
n@1116 4360 }
n@1116 4361 }
n@1116 4362 event.type = type;
n@1116 4363
n@1116 4364 // If nobody prevented the default action, do it now
n@1116 4365 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
n@1116 4366
n@1116 4367 if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
n@1116 4368 jQuery.acceptData( elem ) ) {
n@1116 4369
n@1116 4370 // Call a native DOM method on the target with the same name name as the event.
n@1116 4371 // Don't do default actions on window, that's where global variables be (#6170)
n@1116 4372 if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
n@1116 4373
n@1116 4374 // Don't re-trigger an onFOO event when we call its FOO() method
n@1116 4375 tmp = elem[ ontype ];
n@1116 4376
n@1116 4377 if ( tmp ) {
n@1116 4378 elem[ ontype ] = null;
n@1116 4379 }
n@1116 4380
n@1116 4381 // Prevent re-triggering of the same event, since we already bubbled it above
n@1116 4382 jQuery.event.triggered = type;
n@1116 4383 elem[ type ]();
n@1116 4384 jQuery.event.triggered = undefined;
n@1116 4385
n@1116 4386 if ( tmp ) {
n@1116 4387 elem[ ontype ] = tmp;
n@1116 4388 }
n@1116 4389 }
n@1116 4390 }
n@1116 4391 }
n@1116 4392
n@1116 4393 return event.result;
n@1116 4394 },
n@1116 4395
n@1116 4396 dispatch: function( event ) {
n@1116 4397
n@1116 4398 // Make a writable jQuery.Event from the native event object
n@1116 4399 event = jQuery.event.fix( event );
n@1116 4400
n@1116 4401 var i, j, ret, matched, handleObj,
n@1116 4402 handlerQueue = [],
n@1116 4403 args = slice.call( arguments ),
n@1116 4404 handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
n@1116 4405 special = jQuery.event.special[ event.type ] || {};
n@1116 4406
n@1116 4407 // Use the fix-ed jQuery.Event rather than the (read-only) native event
n@1116 4408 args[0] = event;
n@1116 4409 event.delegateTarget = this;
n@1116 4410
n@1116 4411 // Call the preDispatch hook for the mapped type, and let it bail if desired
n@1116 4412 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
n@1116 4413 return;
n@1116 4414 }
n@1116 4415
n@1116 4416 // Determine handlers
n@1116 4417 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
n@1116 4418
n@1116 4419 // Run delegates first; they may want to stop propagation beneath us
n@1116 4420 i = 0;
n@1116 4421 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
n@1116 4422 event.currentTarget = matched.elem;
n@1116 4423
n@1116 4424 j = 0;
n@1116 4425 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
n@1116 4426
n@1116 4427 // Triggered event must either 1) have no namespace, or 2) have namespace(s)
n@1116 4428 // a subset or equal to those in the bound event (both can have no namespace).
n@1116 4429 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
n@1116 4430
n@1116 4431 event.handleObj = handleObj;
n@1116 4432 event.data = handleObj.data;
n@1116 4433
n@1116 4434 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
n@1116 4435 .apply( matched.elem, args );
n@1116 4436
n@1116 4437 if ( ret !== undefined ) {
n@1116 4438 if ( (event.result = ret) === false ) {
n@1116 4439 event.preventDefault();
n@1116 4440 event.stopPropagation();
n@1116 4441 }
n@1116 4442 }
n@1116 4443 }
n@1116 4444 }
n@1116 4445 }
n@1116 4446
n@1116 4447 // Call the postDispatch hook for the mapped type
n@1116 4448 if ( special.postDispatch ) {
n@1116 4449 special.postDispatch.call( this, event );
n@1116 4450 }
n@1116 4451
n@1116 4452 return event.result;
n@1116 4453 },
n@1116 4454
n@1116 4455 handlers: function( event, handlers ) {
n@1116 4456 var i, matches, sel, handleObj,
n@1116 4457 handlerQueue = [],
n@1116 4458 delegateCount = handlers.delegateCount,
n@1116 4459 cur = event.target;
n@1116 4460
n@1116 4461 // Find delegate handlers
n@1116 4462 // Black-hole SVG <use> instance trees (#13180)
n@1116 4463 // Avoid non-left-click bubbling in Firefox (#3861)
n@1116 4464 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
n@1116 4465
n@1116 4466 for ( ; cur !== this; cur = cur.parentNode || this ) {
n@1116 4467
n@1116 4468 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
n@1116 4469 if ( cur.disabled !== true || event.type !== "click" ) {
n@1116 4470 matches = [];
n@1116 4471 for ( i = 0; i < delegateCount; i++ ) {
n@1116 4472 handleObj = handlers[ i ];
n@1116 4473
n@1116 4474 // Don't conflict with Object.prototype properties (#13203)
n@1116 4475 sel = handleObj.selector + " ";
n@1116 4476
n@1116 4477 if ( matches[ sel ] === undefined ) {
n@1116 4478 matches[ sel ] = handleObj.needsContext ?
n@1116 4479 jQuery( sel, this ).index( cur ) >= 0 :
n@1116 4480 jQuery.find( sel, this, null, [ cur ] ).length;
n@1116 4481 }
n@1116 4482 if ( matches[ sel ] ) {
n@1116 4483 matches.push( handleObj );
n@1116 4484 }
n@1116 4485 }
n@1116 4486 if ( matches.length ) {
n@1116 4487 handlerQueue.push({ elem: cur, handlers: matches });
n@1116 4488 }
n@1116 4489 }
n@1116 4490 }
n@1116 4491 }
n@1116 4492
n@1116 4493 // Add the remaining (directly-bound) handlers
n@1116 4494 if ( delegateCount < handlers.length ) {
n@1116 4495 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
n@1116 4496 }
n@1116 4497
n@1116 4498 return handlerQueue;
n@1116 4499 },
n@1116 4500
n@1116 4501 // Includes some event props shared by KeyEvent and MouseEvent
n@1116 4502 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
n@1116 4503
n@1116 4504 fixHooks: {},
n@1116 4505
n@1116 4506 keyHooks: {
n@1116 4507 props: "char charCode key keyCode".split(" "),
n@1116 4508 filter: function( event, original ) {
n@1116 4509
n@1116 4510 // Add which for key events
n@1116 4511 if ( event.which == null ) {
n@1116 4512 event.which = original.charCode != null ? original.charCode : original.keyCode;
n@1116 4513 }
n@1116 4514
n@1116 4515 return event;
n@1116 4516 }
n@1116 4517 },
n@1116 4518
n@1116 4519 mouseHooks: {
n@1116 4520 props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
n@1116 4521 filter: function( event, original ) {
n@1116 4522 var eventDoc, doc, body,
n@1116 4523 button = original.button;
n@1116 4524
n@1116 4525 // Calculate pageX/Y if missing and clientX/Y available
n@1116 4526 if ( event.pageX == null && original.clientX != null ) {
n@1116 4527 eventDoc = event.target.ownerDocument || document;
n@1116 4528 doc = eventDoc.documentElement;
n@1116 4529 body = eventDoc.body;
n@1116 4530
n@1116 4531 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
n@1116 4532 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
n@1116 4533 }
n@1116 4534
n@1116 4535 // Add which for click: 1 === left; 2 === middle; 3 === right
n@1116 4536 // Note: button is not normalized, so don't use it
n@1116 4537 if ( !event.which && button !== undefined ) {
n@1116 4538 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
n@1116 4539 }
n@1116 4540
n@1116 4541 return event;
n@1116 4542 }
n@1116 4543 },
n@1116 4544
n@1116 4545 fix: function( event ) {
n@1116 4546 if ( event[ jQuery.expando ] ) {
n@1116 4547 return event;
n@1116 4548 }
n@1116 4549
n@1116 4550 // Create a writable copy of the event object and normalize some properties
n@1116 4551 var i, prop, copy,
n@1116 4552 type = event.type,
n@1116 4553 originalEvent = event,
n@1116 4554 fixHook = this.fixHooks[ type ];
n@1116 4555
n@1116 4556 if ( !fixHook ) {
n@1116 4557 this.fixHooks[ type ] = fixHook =
n@1116 4558 rmouseEvent.test( type ) ? this.mouseHooks :
n@1116 4559 rkeyEvent.test( type ) ? this.keyHooks :
n@1116 4560 {};
n@1116 4561 }
n@1116 4562 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
n@1116 4563
n@1116 4564 event = new jQuery.Event( originalEvent );
n@1116 4565
n@1116 4566 i = copy.length;
n@1116 4567 while ( i-- ) {
n@1116 4568 prop = copy[ i ];
n@1116 4569 event[ prop ] = originalEvent[ prop ];
n@1116 4570 }
n@1116 4571
n@1116 4572 // Support: Cordova 2.5 (WebKit) (#13255)
n@1116 4573 // All events should have a target; Cordova deviceready doesn't
n@1116 4574 if ( !event.target ) {
n@1116 4575 event.target = document;
n@1116 4576 }
n@1116 4577
n@1116 4578 // Support: Safari 6.0+, Chrome<28
n@1116 4579 // Target should not be a text node (#504, #13143)
n@1116 4580 if ( event.target.nodeType === 3 ) {
n@1116 4581 event.target = event.target.parentNode;
n@1116 4582 }
n@1116 4583
n@1116 4584 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
n@1116 4585 },
n@1116 4586
n@1116 4587 special: {
n@1116 4588 load: {
n@1116 4589 // Prevent triggered image.load events from bubbling to window.load
n@1116 4590 noBubble: true
n@1116 4591 },
n@1116 4592 focus: {
n@1116 4593 // Fire native event if possible so blur/focus sequence is correct
n@1116 4594 trigger: function() {
n@1116 4595 if ( this !== safeActiveElement() && this.focus ) {
n@1116 4596 this.focus();
n@1116 4597 return false;
n@1116 4598 }
n@1116 4599 },
n@1116 4600 delegateType: "focusin"
n@1116 4601 },
n@1116 4602 blur: {
n@1116 4603 trigger: function() {
n@1116 4604 if ( this === safeActiveElement() && this.blur ) {
n@1116 4605 this.blur();
n@1116 4606 return false;
n@1116 4607 }
n@1116 4608 },
n@1116 4609 delegateType: "focusout"
n@1116 4610 },
n@1116 4611 click: {
n@1116 4612 // For checkbox, fire native event so checked state will be right
n@1116 4613 trigger: function() {
n@1116 4614 if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
n@1116 4615 this.click();
n@1116 4616 return false;
n@1116 4617 }
n@1116 4618 },
n@1116 4619
n@1116 4620 // For cross-browser consistency, don't fire native .click() on links
n@1116 4621 _default: function( event ) {
n@1116 4622 return jQuery.nodeName( event.target, "a" );
n@1116 4623 }
n@1116 4624 },
n@1116 4625
n@1116 4626 beforeunload: {
n@1116 4627 postDispatch: function( event ) {
n@1116 4628
n@1116 4629 // Support: Firefox 20+
n@1116 4630 // Firefox doesn't alert if the returnValue field is not set.
n@1116 4631 if ( event.result !== undefined && event.originalEvent ) {
n@1116 4632 event.originalEvent.returnValue = event.result;
n@1116 4633 }
n@1116 4634 }
n@1116 4635 }
n@1116 4636 },
n@1116 4637
n@1116 4638 simulate: function( type, elem, event, bubble ) {
n@1116 4639 // Piggyback on a donor event to simulate a different one.
n@1116 4640 // Fake originalEvent to avoid donor's stopPropagation, but if the
n@1116 4641 // simulated event prevents default then we do the same on the donor.
n@1116 4642 var e = jQuery.extend(
n@1116 4643 new jQuery.Event(),
n@1116 4644 event,
n@1116 4645 {
n@1116 4646 type: type,
n@1116 4647 isSimulated: true,
n@1116 4648 originalEvent: {}
n@1116 4649 }
n@1116 4650 );
n@1116 4651 if ( bubble ) {
n@1116 4652 jQuery.event.trigger( e, null, elem );
n@1116 4653 } else {
n@1116 4654 jQuery.event.dispatch.call( elem, e );
n@1116 4655 }
n@1116 4656 if ( e.isDefaultPrevented() ) {
n@1116 4657 event.preventDefault();
n@1116 4658 }
n@1116 4659 }
n@1116 4660 };
n@1116 4661
n@1116 4662 jQuery.removeEvent = function( elem, type, handle ) {
n@1116 4663 if ( elem.removeEventListener ) {
n@1116 4664 elem.removeEventListener( type, handle, false );
n@1116 4665 }
n@1116 4666 };
n@1116 4667
n@1116 4668 jQuery.Event = function( src, props ) {
n@1116 4669 // Allow instantiation without the 'new' keyword
n@1116 4670 if ( !(this instanceof jQuery.Event) ) {
n@1116 4671 return new jQuery.Event( src, props );
n@1116 4672 }
n@1116 4673
n@1116 4674 // Event object
n@1116 4675 if ( src && src.type ) {
n@1116 4676 this.originalEvent = src;
n@1116 4677 this.type = src.type;
n@1116 4678
n@1116 4679 // Events bubbling up the document may have been marked as prevented
n@1116 4680 // by a handler lower down the tree; reflect the correct value.
n@1116 4681 this.isDefaultPrevented = src.defaultPrevented ||
n@1116 4682 src.defaultPrevented === undefined &&
n@1116 4683 // Support: Android<4.0
n@1116 4684 src.returnValue === false ?
n@1116 4685 returnTrue :
n@1116 4686 returnFalse;
n@1116 4687
n@1116 4688 // Event type
n@1116 4689 } else {
n@1116 4690 this.type = src;
n@1116 4691 }
n@1116 4692
n@1116 4693 // Put explicitly provided properties onto the event object
n@1116 4694 if ( props ) {
n@1116 4695 jQuery.extend( this, props );
n@1116 4696 }
n@1116 4697
n@1116 4698 // Create a timestamp if incoming event doesn't have one
n@1116 4699 this.timeStamp = src && src.timeStamp || jQuery.now();
n@1116 4700
n@1116 4701 // Mark it as fixed
n@1116 4702 this[ jQuery.expando ] = true;
n@1116 4703 };
n@1116 4704
n@1116 4705 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
n@1116 4706 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
n@1116 4707 jQuery.Event.prototype = {
n@1116 4708 isDefaultPrevented: returnFalse,
n@1116 4709 isPropagationStopped: returnFalse,
n@1116 4710 isImmediatePropagationStopped: returnFalse,
n@1116 4711
n@1116 4712 preventDefault: function() {
n@1116 4713 var e = this.originalEvent;
n@1116 4714
n@1116 4715 this.isDefaultPrevented = returnTrue;
n@1116 4716
n@1116 4717 if ( e && e.preventDefault ) {
n@1116 4718 e.preventDefault();
n@1116 4719 }
n@1116 4720 },
n@1116 4721 stopPropagation: function() {
n@1116 4722 var e = this.originalEvent;
n@1116 4723
n@1116 4724 this.isPropagationStopped = returnTrue;
n@1116 4725
n@1116 4726 if ( e && e.stopPropagation ) {
n@1116 4727 e.stopPropagation();
n@1116 4728 }
n@1116 4729 },
n@1116 4730 stopImmediatePropagation: function() {
n@1116 4731 var e = this.originalEvent;
n@1116 4732
n@1116 4733 this.isImmediatePropagationStopped = returnTrue;
n@1116 4734
n@1116 4735 if ( e && e.stopImmediatePropagation ) {
n@1116 4736 e.stopImmediatePropagation();
n@1116 4737 }
n@1116 4738
n@1116 4739 this.stopPropagation();
n@1116 4740 }
n@1116 4741 };
n@1116 4742
n@1116 4743 // Create mouseenter/leave events using mouseover/out and event-time checks
n@1116 4744 // Support: Chrome 15+
n@1116 4745 jQuery.each({
n@1116 4746 mouseenter: "mouseover",
n@1116 4747 mouseleave: "mouseout",
n@1116 4748 pointerenter: "pointerover",
n@1116 4749 pointerleave: "pointerout"
n@1116 4750 }, function( orig, fix ) {
n@1116 4751 jQuery.event.special[ orig ] = {
n@1116 4752 delegateType: fix,
n@1116 4753 bindType: fix,
n@1116 4754
n@1116 4755 handle: function( event ) {
n@1116 4756 var ret,
n@1116 4757 target = this,
n@1116 4758 related = event.relatedTarget,
n@1116 4759 handleObj = event.handleObj;
n@1116 4760
n@1116 4761 // For mousenter/leave call the handler if related is outside the target.
n@1116 4762 // NB: No relatedTarget if the mouse left/entered the browser window
n@1116 4763 if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
n@1116 4764 event.type = handleObj.origType;
n@1116 4765 ret = handleObj.handler.apply( this, arguments );
n@1116 4766 event.type = fix;
n@1116 4767 }
n@1116 4768 return ret;
n@1116 4769 }
n@1116 4770 };
n@1116 4771 });
n@1116 4772
n@1116 4773 // Support: Firefox, Chrome, Safari
n@1116 4774 // Create "bubbling" focus and blur events
n@1116 4775 if ( !support.focusinBubbles ) {
n@1116 4776 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
n@1116 4777
n@1116 4778 // Attach a single capturing handler on the document while someone wants focusin/focusout
n@1116 4779 var handler = function( event ) {
n@1116 4780 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
n@1116 4781 };
n@1116 4782
n@1116 4783 jQuery.event.special[ fix ] = {
n@1116 4784 setup: function() {
n@1116 4785 var doc = this.ownerDocument || this,
n@1116 4786 attaches = data_priv.access( doc, fix );
n@1116 4787
n@1116 4788 if ( !attaches ) {
n@1116 4789 doc.addEventListener( orig, handler, true );
n@1116 4790 }
n@1116 4791 data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
n@1116 4792 },
n@1116 4793 teardown: function() {
n@1116 4794 var doc = this.ownerDocument || this,
n@1116 4795 attaches = data_priv.access( doc, fix ) - 1;
n@1116 4796
n@1116 4797 if ( !attaches ) {
n@1116 4798 doc.removeEventListener( orig, handler, true );
n@1116 4799 data_priv.remove( doc, fix );
n@1116 4800
n@1116 4801 } else {
n@1116 4802 data_priv.access( doc, fix, attaches );
n@1116 4803 }
n@1116 4804 }
n@1116 4805 };
n@1116 4806 });
n@1116 4807 }
n@1116 4808
n@1116 4809 jQuery.fn.extend({
n@1116 4810
n@1116 4811 on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
n@1116 4812 var origFn, type;
n@1116 4813
n@1116 4814 // Types can be a map of types/handlers
n@1116 4815 if ( typeof types === "object" ) {
n@1116 4816 // ( types-Object, selector, data )
n@1116 4817 if ( typeof selector !== "string" ) {
n@1116 4818 // ( types-Object, data )
n@1116 4819 data = data || selector;
n@1116 4820 selector = undefined;
n@1116 4821 }
n@1116 4822 for ( type in types ) {
n@1116 4823 this.on( type, selector, data, types[ type ], one );
n@1116 4824 }
n@1116 4825 return this;
n@1116 4826 }
n@1116 4827
n@1116 4828 if ( data == null && fn == null ) {
n@1116 4829 // ( types, fn )
n@1116 4830 fn = selector;
n@1116 4831 data = selector = undefined;
n@1116 4832 } else if ( fn == null ) {
n@1116 4833 if ( typeof selector === "string" ) {
n@1116 4834 // ( types, selector, fn )
n@1116 4835 fn = data;
n@1116 4836 data = undefined;
n@1116 4837 } else {
n@1116 4838 // ( types, data, fn )
n@1116 4839 fn = data;
n@1116 4840 data = selector;
n@1116 4841 selector = undefined;
n@1116 4842 }
n@1116 4843 }
n@1116 4844 if ( fn === false ) {
n@1116 4845 fn = returnFalse;
n@1116 4846 } else if ( !fn ) {
n@1116 4847 return this;
n@1116 4848 }
n@1116 4849
n@1116 4850 if ( one === 1 ) {
n@1116 4851 origFn = fn;
n@1116 4852 fn = function( event ) {
n@1116 4853 // Can use an empty set, since event contains the info
n@1116 4854 jQuery().off( event );
n@1116 4855 return origFn.apply( this, arguments );
n@1116 4856 };
n@1116 4857 // Use same guid so caller can remove using origFn
n@1116 4858 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
n@1116 4859 }
n@1116 4860 return this.each( function() {
n@1116 4861 jQuery.event.add( this, types, fn, data, selector );
n@1116 4862 });
n@1116 4863 },
n@1116 4864 one: function( types, selector, data, fn ) {
n@1116 4865 return this.on( types, selector, data, fn, 1 );
n@1116 4866 },
n@1116 4867 off: function( types, selector, fn ) {
n@1116 4868 var handleObj, type;
n@1116 4869 if ( types && types.preventDefault && types.handleObj ) {
n@1116 4870 // ( event ) dispatched jQuery.Event
n@1116 4871 handleObj = types.handleObj;
n@1116 4872 jQuery( types.delegateTarget ).off(
n@1116 4873 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
n@1116 4874 handleObj.selector,
n@1116 4875 handleObj.handler
n@1116 4876 );
n@1116 4877 return this;
n@1116 4878 }
n@1116 4879 if ( typeof types === "object" ) {
n@1116 4880 // ( types-object [, selector] )
n@1116 4881 for ( type in types ) {
n@1116 4882 this.off( type, selector, types[ type ] );
n@1116 4883 }
n@1116 4884 return this;
n@1116 4885 }
n@1116 4886 if ( selector === false || typeof selector === "function" ) {
n@1116 4887 // ( types [, fn] )
n@1116 4888 fn = selector;
n@1116 4889 selector = undefined;
n@1116 4890 }
n@1116 4891 if ( fn === false ) {
n@1116 4892 fn = returnFalse;
n@1116 4893 }
n@1116 4894 return this.each(function() {
n@1116 4895 jQuery.event.remove( this, types, fn, selector );
n@1116 4896 });
n@1116 4897 },
n@1116 4898
n@1116 4899 trigger: function( type, data ) {
n@1116 4900 return this.each(function() {
n@1116 4901 jQuery.event.trigger( type, data, this );
n@1116 4902 });
n@1116 4903 },
n@1116 4904 triggerHandler: function( type, data ) {
n@1116 4905 var elem = this[0];
n@1116 4906 if ( elem ) {
n@1116 4907 return jQuery.event.trigger( type, data, elem, true );
n@1116 4908 }
n@1116 4909 }
n@1116 4910 });
n@1116 4911
n@1116 4912
n@1116 4913 var
n@1116 4914 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
n@1116 4915 rtagName = /<([\w:]+)/,
n@1116 4916 rhtml = /<|&#?\w+;/,
n@1116 4917 rnoInnerhtml = /<(?:script|style|link)/i,
n@1116 4918 // checked="checked" or checked
n@1116 4919 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
n@1116 4920 rscriptType = /^$|\/(?:java|ecma)script/i,
n@1116 4921 rscriptTypeMasked = /^true\/(.*)/,
n@1116 4922 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
n@1116 4923
n@1116 4924 // We have to close these tags to support XHTML (#13200)
n@1116 4925 wrapMap = {
n@1116 4926
n@1116 4927 // Support: IE9
n@1116 4928 option: [ 1, "<select multiple='multiple'>", "</select>" ],
n@1116 4929
n@1116 4930 thead: [ 1, "<table>", "</table>" ],
n@1116 4931 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
n@1116 4932 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
n@1116 4933 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
n@1116 4934
n@1116 4935 _default: [ 0, "", "" ]
n@1116 4936 };
n@1116 4937
n@1116 4938 // Support: IE9
n@1116 4939 wrapMap.optgroup = wrapMap.option;
n@1116 4940
n@1116 4941 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
n@1116 4942 wrapMap.th = wrapMap.td;
n@1116 4943
n@1116 4944 // Support: 1.x compatibility
n@1116 4945 // Manipulating tables requires a tbody
n@1116 4946 function manipulationTarget( elem, content ) {
n@1116 4947 return jQuery.nodeName( elem, "table" ) &&
n@1116 4948 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
n@1116 4949
n@1116 4950 elem.getElementsByTagName("tbody")[0] ||
n@1116 4951 elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
n@1116 4952 elem;
n@1116 4953 }
n@1116 4954
n@1116 4955 // Replace/restore the type attribute of script elements for safe DOM manipulation
n@1116 4956 function disableScript( elem ) {
n@1116 4957 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
n@1116 4958 return elem;
n@1116 4959 }
n@1116 4960 function restoreScript( elem ) {
n@1116 4961 var match = rscriptTypeMasked.exec( elem.type );
n@1116 4962
n@1116 4963 if ( match ) {
n@1116 4964 elem.type = match[ 1 ];
n@1116 4965 } else {
n@1116 4966 elem.removeAttribute("type");
n@1116 4967 }
n@1116 4968
n@1116 4969 return elem;
n@1116 4970 }
n@1116 4971
n@1116 4972 // Mark scripts as having already been evaluated
n@1116 4973 function setGlobalEval( elems, refElements ) {
n@1116 4974 var i = 0,
n@1116 4975 l = elems.length;
n@1116 4976
n@1116 4977 for ( ; i < l; i++ ) {
n@1116 4978 data_priv.set(
n@1116 4979 elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
n@1116 4980 );
n@1116 4981 }
n@1116 4982 }
n@1116 4983
n@1116 4984 function cloneCopyEvent( src, dest ) {
n@1116 4985 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
n@1116 4986
n@1116 4987 if ( dest.nodeType !== 1 ) {
n@1116 4988 return;
n@1116 4989 }
n@1116 4990
n@1116 4991 // 1. Copy private data: events, handlers, etc.
n@1116 4992 if ( data_priv.hasData( src ) ) {
n@1116 4993 pdataOld = data_priv.access( src );
n@1116 4994 pdataCur = data_priv.set( dest, pdataOld );
n@1116 4995 events = pdataOld.events;
n@1116 4996
n@1116 4997 if ( events ) {
n@1116 4998 delete pdataCur.handle;
n@1116 4999 pdataCur.events = {};
n@1116 5000
n@1116 5001 for ( type in events ) {
n@1116 5002 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
n@1116 5003 jQuery.event.add( dest, type, events[ type ][ i ] );
n@1116 5004 }
n@1116 5005 }
n@1116 5006 }
n@1116 5007 }
n@1116 5008
n@1116 5009 // 2. Copy user data
n@1116 5010 if ( data_user.hasData( src ) ) {
n@1116 5011 udataOld = data_user.access( src );
n@1116 5012 udataCur = jQuery.extend( {}, udataOld );
n@1116 5013
n@1116 5014 data_user.set( dest, udataCur );
n@1116 5015 }
n@1116 5016 }
n@1116 5017
n@1116 5018 function getAll( context, tag ) {
n@1116 5019 var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
n@1116 5020 context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
n@1116 5021 [];
n@1116 5022
n@1116 5023 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
n@1116 5024 jQuery.merge( [ context ], ret ) :
n@1116 5025 ret;
n@1116 5026 }
n@1116 5027
n@1116 5028 // Fix IE bugs, see support tests
n@1116 5029 function fixInput( src, dest ) {
n@1116 5030 var nodeName = dest.nodeName.toLowerCase();
n@1116 5031
n@1116 5032 // Fails to persist the checked state of a cloned checkbox or radio button.
n@1116 5033 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
n@1116 5034 dest.checked = src.checked;
n@1116 5035
n@1116 5036 // Fails to return the selected option to the default selected state when cloning options
n@1116 5037 } else if ( nodeName === "input" || nodeName === "textarea" ) {
n@1116 5038 dest.defaultValue = src.defaultValue;
n@1116 5039 }
n@1116 5040 }
n@1116 5041
n@1116 5042 jQuery.extend({
n@1116 5043 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
n@1116 5044 var i, l, srcElements, destElements,
n@1116 5045 clone = elem.cloneNode( true ),
n@1116 5046 inPage = jQuery.contains( elem.ownerDocument, elem );
n@1116 5047
n@1116 5048 // Fix IE cloning issues
n@1116 5049 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
n@1116 5050 !jQuery.isXMLDoc( elem ) ) {
n@1116 5051
n@1116 5052 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
n@1116 5053 destElements = getAll( clone );
n@1116 5054 srcElements = getAll( elem );
n@1116 5055
n@1116 5056 for ( i = 0, l = srcElements.length; i < l; i++ ) {
n@1116 5057 fixInput( srcElements[ i ], destElements[ i ] );
n@1116 5058 }
n@1116 5059 }
n@1116 5060
n@1116 5061 // Copy the events from the original to the clone
n@1116 5062 if ( dataAndEvents ) {
n@1116 5063 if ( deepDataAndEvents ) {
n@1116 5064 srcElements = srcElements || getAll( elem );
n@1116 5065 destElements = destElements || getAll( clone );
n@1116 5066
n@1116 5067 for ( i = 0, l = srcElements.length; i < l; i++ ) {
n@1116 5068 cloneCopyEvent( srcElements[ i ], destElements[ i ] );
n@1116 5069 }
n@1116 5070 } else {
n@1116 5071 cloneCopyEvent( elem, clone );
n@1116 5072 }
n@1116 5073 }
n@1116 5074
n@1116 5075 // Preserve script evaluation history
n@1116 5076 destElements = getAll( clone, "script" );
n@1116 5077 if ( destElements.length > 0 ) {
n@1116 5078 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
n@1116 5079 }
n@1116 5080
n@1116 5081 // Return the cloned set
n@1116 5082 return clone;
n@1116 5083 },
n@1116 5084
n@1116 5085 buildFragment: function( elems, context, scripts, selection ) {
n@1116 5086 var elem, tmp, tag, wrap, contains, j,
n@1116 5087 fragment = context.createDocumentFragment(),
n@1116 5088 nodes = [],
n@1116 5089 i = 0,
n@1116 5090 l = elems.length;
n@1116 5091
n@1116 5092 for ( ; i < l; i++ ) {
n@1116 5093 elem = elems[ i ];
n@1116 5094
n@1116 5095 if ( elem || elem === 0 ) {
n@1116 5096
n@1116 5097 // Add nodes directly
n@1116 5098 if ( jQuery.type( elem ) === "object" ) {
n@1116 5099 // Support: QtWebKit, PhantomJS
n@1116 5100 // push.apply(_, arraylike) throws on ancient WebKit
n@1116 5101 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
n@1116 5102
n@1116 5103 // Convert non-html into a text node
n@1116 5104 } else if ( !rhtml.test( elem ) ) {
n@1116 5105 nodes.push( context.createTextNode( elem ) );
n@1116 5106
n@1116 5107 // Convert html into DOM nodes
n@1116 5108 } else {
n@1116 5109 tmp = tmp || fragment.appendChild( context.createElement("div") );
n@1116 5110
n@1116 5111 // Deserialize a standard representation
n@1116 5112 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
n@1116 5113 wrap = wrapMap[ tag ] || wrapMap._default;
n@1116 5114 tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
n@1116 5115
n@1116 5116 // Descend through wrappers to the right content
n@1116 5117 j = wrap[ 0 ];
n@1116 5118 while ( j-- ) {
n@1116 5119 tmp = tmp.lastChild;
n@1116 5120 }
n@1116 5121
n@1116 5122 // Support: QtWebKit, PhantomJS
n@1116 5123 // push.apply(_, arraylike) throws on ancient WebKit
n@1116 5124 jQuery.merge( nodes, tmp.childNodes );
n@1116 5125
n@1116 5126 // Remember the top-level container
n@1116 5127 tmp = fragment.firstChild;
n@1116 5128
n@1116 5129 // Ensure the created nodes are orphaned (#12392)
n@1116 5130 tmp.textContent = "";
n@1116 5131 }
n@1116 5132 }
n@1116 5133 }
n@1116 5134
n@1116 5135 // Remove wrapper from fragment
n@1116 5136 fragment.textContent = "";
n@1116 5137
n@1116 5138 i = 0;
n@1116 5139 while ( (elem = nodes[ i++ ]) ) {
n@1116 5140
n@1116 5141 // #4087 - If origin and destination elements are the same, and this is
n@1116 5142 // that element, do not do anything
n@1116 5143 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
n@1116 5144 continue;
n@1116 5145 }
n@1116 5146
n@1116 5147 contains = jQuery.contains( elem.ownerDocument, elem );
n@1116 5148
n@1116 5149 // Append to fragment
n@1116 5150 tmp = getAll( fragment.appendChild( elem ), "script" );
n@1116 5151
n@1116 5152 // Preserve script evaluation history
n@1116 5153 if ( contains ) {
n@1116 5154 setGlobalEval( tmp );
n@1116 5155 }
n@1116 5156
n@1116 5157 // Capture executables
n@1116 5158 if ( scripts ) {
n@1116 5159 j = 0;
n@1116 5160 while ( (elem = tmp[ j++ ]) ) {
n@1116 5161 if ( rscriptType.test( elem.type || "" ) ) {
n@1116 5162 scripts.push( elem );
n@1116 5163 }
n@1116 5164 }
n@1116 5165 }
n@1116 5166 }
n@1116 5167
n@1116 5168 return fragment;
n@1116 5169 },
n@1116 5170
n@1116 5171 cleanData: function( elems ) {
n@1116 5172 var data, elem, type, key,
n@1116 5173 special = jQuery.event.special,
n@1116 5174 i = 0;
n@1116 5175
n@1116 5176 for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
n@1116 5177 if ( jQuery.acceptData( elem ) ) {
n@1116 5178 key = elem[ data_priv.expando ];
n@1116 5179
n@1116 5180 if ( key && (data = data_priv.cache[ key ]) ) {
n@1116 5181 if ( data.events ) {
n@1116 5182 for ( type in data.events ) {
n@1116 5183 if ( special[ type ] ) {
n@1116 5184 jQuery.event.remove( elem, type );
n@1116 5185
n@1116 5186 // This is a shortcut to avoid jQuery.event.remove's overhead
n@1116 5187 } else {
n@1116 5188 jQuery.removeEvent( elem, type, data.handle );
n@1116 5189 }
n@1116 5190 }
n@1116 5191 }
n@1116 5192 if ( data_priv.cache[ key ] ) {
n@1116 5193 // Discard any remaining `private` data
n@1116 5194 delete data_priv.cache[ key ];
n@1116 5195 }
n@1116 5196 }
n@1116 5197 }
n@1116 5198 // Discard any remaining `user` data
n@1116 5199 delete data_user.cache[ elem[ data_user.expando ] ];
n@1116 5200 }
n@1116 5201 }
n@1116 5202 });
n@1116 5203
n@1116 5204 jQuery.fn.extend({
n@1116 5205 text: function( value ) {
n@1116 5206 return access( this, function( value ) {
n@1116 5207 return value === undefined ?
n@1116 5208 jQuery.text( this ) :
n@1116 5209 this.empty().each(function() {
n@1116 5210 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
n@1116 5211 this.textContent = value;
n@1116 5212 }
n@1116 5213 });
n@1116 5214 }, null, value, arguments.length );
n@1116 5215 },
n@1116 5216
n@1116 5217 append: function() {
n@1116 5218 return this.domManip( arguments, function( elem ) {
n@1116 5219 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
n@1116 5220 var target = manipulationTarget( this, elem );
n@1116 5221 target.appendChild( elem );
n@1116 5222 }
n@1116 5223 });
n@1116 5224 },
n@1116 5225
n@1116 5226 prepend: function() {
n@1116 5227 return this.domManip( arguments, function( elem ) {
n@1116 5228 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
n@1116 5229 var target = manipulationTarget( this, elem );
n@1116 5230 target.insertBefore( elem, target.firstChild );
n@1116 5231 }
n@1116 5232 });
n@1116 5233 },
n@1116 5234
n@1116 5235 before: function() {
n@1116 5236 return this.domManip( arguments, function( elem ) {
n@1116 5237 if ( this.parentNode ) {
n@1116 5238 this.parentNode.insertBefore( elem, this );
n@1116 5239 }
n@1116 5240 });
n@1116 5241 },
n@1116 5242
n@1116 5243 after: function() {
n@1116 5244 return this.domManip( arguments, function( elem ) {
n@1116 5245 if ( this.parentNode ) {
n@1116 5246 this.parentNode.insertBefore( elem, this.nextSibling );
n@1116 5247 }
n@1116 5248 });
n@1116 5249 },
n@1116 5250
n@1116 5251 remove: function( selector, keepData /* Internal Use Only */ ) {
n@1116 5252 var elem,
n@1116 5253 elems = selector ? jQuery.filter( selector, this ) : this,
n@1116 5254 i = 0;
n@1116 5255
n@1116 5256 for ( ; (elem = elems[i]) != null; i++ ) {
n@1116 5257 if ( !keepData && elem.nodeType === 1 ) {
n@1116 5258 jQuery.cleanData( getAll( elem ) );
n@1116 5259 }
n@1116 5260
n@1116 5261 if ( elem.parentNode ) {
n@1116 5262 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
n@1116 5263 setGlobalEval( getAll( elem, "script" ) );
n@1116 5264 }
n@1116 5265 elem.parentNode.removeChild( elem );
n@1116 5266 }
n@1116 5267 }
n@1116 5268
n@1116 5269 return this;
n@1116 5270 },
n@1116 5271
n@1116 5272 empty: function() {
n@1116 5273 var elem,
n@1116 5274 i = 0;
n@1116 5275
n@1116 5276 for ( ; (elem = this[i]) != null; i++ ) {
n@1116 5277 if ( elem.nodeType === 1 ) {
n@1116 5278
n@1116 5279 // Prevent memory leaks
n@1116 5280 jQuery.cleanData( getAll( elem, false ) );
n@1116 5281
n@1116 5282 // Remove any remaining nodes
n@1116 5283 elem.textContent = "";
n@1116 5284 }
n@1116 5285 }
n@1116 5286
n@1116 5287 return this;
n@1116 5288 },
n@1116 5289
n@1116 5290 clone: function( dataAndEvents, deepDataAndEvents ) {
n@1116 5291 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
n@1116 5292 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
n@1116 5293
n@1116 5294 return this.map(function() {
n@1116 5295 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
n@1116 5296 });
n@1116 5297 },
n@1116 5298
n@1116 5299 html: function( value ) {
n@1116 5300 return access( this, function( value ) {
n@1116 5301 var elem = this[ 0 ] || {},
n@1116 5302 i = 0,
n@1116 5303 l = this.length;
n@1116 5304
n@1116 5305 if ( value === undefined && elem.nodeType === 1 ) {
n@1116 5306 return elem.innerHTML;
n@1116 5307 }
n@1116 5308
n@1116 5309 // See if we can take a shortcut and just use innerHTML
n@1116 5310 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
n@1116 5311 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
n@1116 5312
n@1116 5313 value = value.replace( rxhtmlTag, "<$1></$2>" );
n@1116 5314
n@1116 5315 try {
n@1116 5316 for ( ; i < l; i++ ) {
n@1116 5317 elem = this[ i ] || {};
n@1116 5318
n@1116 5319 // Remove element nodes and prevent memory leaks
n@1116 5320 if ( elem.nodeType === 1 ) {
n@1116 5321 jQuery.cleanData( getAll( elem, false ) );
n@1116 5322 elem.innerHTML = value;
n@1116 5323 }
n@1116 5324 }
n@1116 5325
n@1116 5326 elem = 0;
n@1116 5327
n@1116 5328 // If using innerHTML throws an exception, use the fallback method
n@1116 5329 } catch( e ) {}
n@1116 5330 }
n@1116 5331
n@1116 5332 if ( elem ) {
n@1116 5333 this.empty().append( value );
n@1116 5334 }
n@1116 5335 }, null, value, arguments.length );
n@1116 5336 },
n@1116 5337
n@1116 5338 replaceWith: function() {
n@1116 5339 var arg = arguments[ 0 ];
n@1116 5340
n@1116 5341 // Make the changes, replacing each context element with the new content
n@1116 5342 this.domManip( arguments, function( elem ) {
n@1116 5343 arg = this.parentNode;
n@1116 5344
n@1116 5345 jQuery.cleanData( getAll( this ) );
n@1116 5346
n@1116 5347 if ( arg ) {
n@1116 5348 arg.replaceChild( elem, this );
n@1116 5349 }
n@1116 5350 });
n@1116 5351
n@1116 5352 // Force removal if there was no new content (e.g., from empty arguments)
n@1116 5353 return arg && (arg.length || arg.nodeType) ? this : this.remove();
n@1116 5354 },
n@1116 5355
n@1116 5356 detach: function( selector ) {
n@1116 5357 return this.remove( selector, true );
n@1116 5358 },
n@1116 5359
n@1116 5360 domManip: function( args, callback ) {
n@1116 5361
n@1116 5362 // Flatten any nested arrays
n@1116 5363 args = concat.apply( [], args );
n@1116 5364
n@1116 5365 var fragment, first, scripts, hasScripts, node, doc,
n@1116 5366 i = 0,
n@1116 5367 l = this.length,
n@1116 5368 set = this,
n@1116 5369 iNoClone = l - 1,
n@1116 5370 value = args[ 0 ],
n@1116 5371 isFunction = jQuery.isFunction( value );
n@1116 5372
n@1116 5373 // We can't cloneNode fragments that contain checked, in WebKit
n@1116 5374 if ( isFunction ||
n@1116 5375 ( l > 1 && typeof value === "string" &&
n@1116 5376 !support.checkClone && rchecked.test( value ) ) ) {
n@1116 5377 return this.each(function( index ) {
n@1116 5378 var self = set.eq( index );
n@1116 5379 if ( isFunction ) {
n@1116 5380 args[ 0 ] = value.call( this, index, self.html() );
n@1116 5381 }
n@1116 5382 self.domManip( args, callback );
n@1116 5383 });
n@1116 5384 }
n@1116 5385
n@1116 5386 if ( l ) {
n@1116 5387 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
n@1116 5388 first = fragment.firstChild;
n@1116 5389
n@1116 5390 if ( fragment.childNodes.length === 1 ) {
n@1116 5391 fragment = first;
n@1116 5392 }
n@1116 5393
n@1116 5394 if ( first ) {
n@1116 5395 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
n@1116 5396 hasScripts = scripts.length;
n@1116 5397
n@1116 5398 // Use the original fragment for the last item instead of the first because it can end up
n@1116 5399 // being emptied incorrectly in certain situations (#8070).
n@1116 5400 for ( ; i < l; i++ ) {
n@1116 5401 node = fragment;
n@1116 5402
n@1116 5403 if ( i !== iNoClone ) {
n@1116 5404 node = jQuery.clone( node, true, true );
n@1116 5405
n@1116 5406 // Keep references to cloned scripts for later restoration
n@1116 5407 if ( hasScripts ) {
n@1116 5408 // Support: QtWebKit
n@1116 5409 // jQuery.merge because push.apply(_, arraylike) throws
n@1116 5410 jQuery.merge( scripts, getAll( node, "script" ) );
n@1116 5411 }
n@1116 5412 }
n@1116 5413
n@1116 5414 callback.call( this[ i ], node, i );
n@1116 5415 }
n@1116 5416
n@1116 5417 if ( hasScripts ) {
n@1116 5418 doc = scripts[ scripts.length - 1 ].ownerDocument;
n@1116 5419
n@1116 5420 // Reenable scripts
n@1116 5421 jQuery.map( scripts, restoreScript );
n@1116 5422
n@1116 5423 // Evaluate executable scripts on first document insertion
n@1116 5424 for ( i = 0; i < hasScripts; i++ ) {
n@1116 5425 node = scripts[ i ];
n@1116 5426 if ( rscriptType.test( node.type || "" ) &&
n@1116 5427 !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
n@1116 5428
n@1116 5429 if ( node.src ) {
n@1116 5430 // Optional AJAX dependency, but won't run scripts if not present
n@1116 5431 if ( jQuery._evalUrl ) {
n@1116 5432 jQuery._evalUrl( node.src );
n@1116 5433 }
n@1116 5434 } else {
n@1116 5435 jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
n@1116 5436 }
n@1116 5437 }
n@1116 5438 }
n@1116 5439 }
n@1116 5440 }
n@1116 5441 }
n@1116 5442
n@1116 5443 return this;
n@1116 5444 }
n@1116 5445 });
n@1116 5446
n@1116 5447 jQuery.each({
n@1116 5448 appendTo: "append",
n@1116 5449 prependTo: "prepend",
n@1116 5450 insertBefore: "before",
n@1116 5451 insertAfter: "after",
n@1116 5452 replaceAll: "replaceWith"
n@1116 5453 }, function( name, original ) {
n@1116 5454 jQuery.fn[ name ] = function( selector ) {
n@1116 5455 var elems,
n@1116 5456 ret = [],
n@1116 5457 insert = jQuery( selector ),
n@1116 5458 last = insert.length - 1,
n@1116 5459 i = 0;
n@1116 5460
n@1116 5461 for ( ; i <= last; i++ ) {
n@1116 5462 elems = i === last ? this : this.clone( true );
n@1116 5463 jQuery( insert[ i ] )[ original ]( elems );
n@1116 5464
n@1116 5465 // Support: QtWebKit
n@1116 5466 // .get() because push.apply(_, arraylike) throws
n@1116 5467 push.apply( ret, elems.get() );
n@1116 5468 }
n@1116 5469
n@1116 5470 return this.pushStack( ret );
n@1116 5471 };
n@1116 5472 });
n@1116 5473
n@1116 5474
n@1116 5475 var iframe,
n@1116 5476 elemdisplay = {};
n@1116 5477
n@1116 5478 /**
n@1116 5479 * Retrieve the actual display of a element
n@1116 5480 * @param {String} name nodeName of the element
n@1116 5481 * @param {Object} doc Document object
n@1116 5482 */
n@1116 5483 // Called only from within defaultDisplay
n@1116 5484 function actualDisplay( name, doc ) {
n@1116 5485 var style,
n@1116 5486 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
n@1116 5487
n@1116 5488 // getDefaultComputedStyle might be reliably used only on attached element
n@1116 5489 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
n@1116 5490
n@1116 5491 // Use of this method is a temporary fix (more like optimization) until something better comes along,
n@1116 5492 // since it was removed from specification and supported only in FF
n@1116 5493 style.display : jQuery.css( elem[ 0 ], "display" );
n@1116 5494
n@1116 5495 // We don't have any data stored on the element,
n@1116 5496 // so use "detach" method as fast way to get rid of the element
n@1116 5497 elem.detach();
n@1116 5498
n@1116 5499 return display;
n@1116 5500 }
n@1116 5501
n@1116 5502 /**
n@1116 5503 * Try to determine the default display value of an element
n@1116 5504 * @param {String} nodeName
n@1116 5505 */
n@1116 5506 function defaultDisplay( nodeName ) {
n@1116 5507 var doc = document,
n@1116 5508 display = elemdisplay[ nodeName ];
n@1116 5509
n@1116 5510 if ( !display ) {
n@1116 5511 display = actualDisplay( nodeName, doc );
n@1116 5512
n@1116 5513 // If the simple way fails, read from inside an iframe
n@1116 5514 if ( display === "none" || !display ) {
n@1116 5515
n@1116 5516 // Use the already-created iframe if possible
n@1116 5517 iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
n@1116 5518
n@1116 5519 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
n@1116 5520 doc = iframe[ 0 ].contentDocument;
n@1116 5521
n@1116 5522 // Support: IE
n@1116 5523 doc.write();
n@1116 5524 doc.close();
n@1116 5525
n@1116 5526 display = actualDisplay( nodeName, doc );
n@1116 5527 iframe.detach();
n@1116 5528 }
n@1116 5529
n@1116 5530 // Store the correct default display
n@1116 5531 elemdisplay[ nodeName ] = display;
n@1116 5532 }
n@1116 5533
n@1116 5534 return display;
n@1116 5535 }
n@1116 5536 var rmargin = (/^margin/);
n@1116 5537
n@1116 5538 var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
n@1116 5539
n@1116 5540 var getStyles = function( elem ) {
n@1116 5541 // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
n@1116 5542 // IE throws on elements created in popups
n@1116 5543 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
n@1116 5544 if ( elem.ownerDocument.defaultView.opener ) {
n@1116 5545 return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
n@1116 5546 }
n@1116 5547
n@1116 5548 return window.getComputedStyle( elem, null );
n@1116 5549 };
n@1116 5550
n@1116 5551
n@1116 5552
n@1116 5553 function curCSS( elem, name, computed ) {
n@1116 5554 var width, minWidth, maxWidth, ret,
n@1116 5555 style = elem.style;
n@1116 5556
n@1116 5557 computed = computed || getStyles( elem );
n@1116 5558
n@1116 5559 // Support: IE9
n@1116 5560 // getPropertyValue is only needed for .css('filter') (#12537)
n@1116 5561 if ( computed ) {
n@1116 5562 ret = computed.getPropertyValue( name ) || computed[ name ];
n@1116 5563 }
n@1116 5564
n@1116 5565 if ( computed ) {
n@1116 5566
n@1116 5567 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
n@1116 5568 ret = jQuery.style( elem, name );
n@1116 5569 }
n@1116 5570
n@1116 5571 // Support: iOS < 6
n@1116 5572 // A tribute to the "awesome hack by Dean Edwards"
n@1116 5573 // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
n@1116 5574 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
n@1116 5575 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
n@1116 5576
n@1116 5577 // Remember the original values
n@1116 5578 width = style.width;
n@1116 5579 minWidth = style.minWidth;
n@1116 5580 maxWidth = style.maxWidth;
n@1116 5581
n@1116 5582 // Put in the new values to get a computed value out
n@1116 5583 style.minWidth = style.maxWidth = style.width = ret;
n@1116 5584 ret = computed.width;
n@1116 5585
n@1116 5586 // Revert the changed values
n@1116 5587 style.width = width;
n@1116 5588 style.minWidth = minWidth;
n@1116 5589 style.maxWidth = maxWidth;
n@1116 5590 }
n@1116 5591 }
n@1116 5592
n@1116 5593 return ret !== undefined ?
n@1116 5594 // Support: IE
n@1116 5595 // IE returns zIndex value as an integer.
n@1116 5596 ret + "" :
n@1116 5597 ret;
n@1116 5598 }
n@1116 5599
n@1116 5600
n@1116 5601 function addGetHookIf( conditionFn, hookFn ) {
n@1116 5602 // Define the hook, we'll check on the first run if it's really needed.
n@1116 5603 return {
n@1116 5604 get: function() {
n@1116 5605 if ( conditionFn() ) {
n@1116 5606 // Hook not needed (or it's not possible to use it due
n@1116 5607 // to missing dependency), remove it.
n@1116 5608 delete this.get;
n@1116 5609 return;
n@1116 5610 }
n@1116 5611
n@1116 5612 // Hook needed; redefine it so that the support test is not executed again.
n@1116 5613 return (this.get = hookFn).apply( this, arguments );
n@1116 5614 }
n@1116 5615 };
n@1116 5616 }
n@1116 5617
n@1116 5618
n@1116 5619 (function() {
n@1116 5620 var pixelPositionVal, boxSizingReliableVal,
n@1116 5621 docElem = document.documentElement,
n@1116 5622 container = document.createElement( "div" ),
n@1116 5623 div = document.createElement( "div" );
n@1116 5624
n@1116 5625 if ( !div.style ) {
n@1116 5626 return;
n@1116 5627 }
n@1116 5628
n@1116 5629 // Support: IE9-11+
n@1116 5630 // Style of cloned element affects source element cloned (#8908)
n@1116 5631 div.style.backgroundClip = "content-box";
n@1116 5632 div.cloneNode( true ).style.backgroundClip = "";
n@1116 5633 support.clearCloneStyle = div.style.backgroundClip === "content-box";
n@1116 5634
n@1116 5635 container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
n@1116 5636 "position:absolute";
n@1116 5637 container.appendChild( div );
n@1116 5638
n@1116 5639 // Executing both pixelPosition & boxSizingReliable tests require only one layout
n@1116 5640 // so they're executed at the same time to save the second computation.
n@1116 5641 function computePixelPositionAndBoxSizingReliable() {
n@1116 5642 div.style.cssText =
n@1116 5643 // Support: Firefox<29, Android 2.3
n@1116 5644 // Vendor-prefix box-sizing
n@1116 5645 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
n@1116 5646 "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
n@1116 5647 "border:1px;padding:1px;width:4px;position:absolute";
n@1116 5648 div.innerHTML = "";
n@1116 5649 docElem.appendChild( container );
n@1116 5650
n@1116 5651 var divStyle = window.getComputedStyle( div, null );
n@1116 5652 pixelPositionVal = divStyle.top !== "1%";
n@1116 5653 boxSizingReliableVal = divStyle.width === "4px";
n@1116 5654
n@1116 5655 docElem.removeChild( container );
n@1116 5656 }
n@1116 5657
n@1116 5658 // Support: node.js jsdom
n@1116 5659 // Don't assume that getComputedStyle is a property of the global object
n@1116 5660 if ( window.getComputedStyle ) {
n@1116 5661 jQuery.extend( support, {
n@1116 5662 pixelPosition: function() {
n@1116 5663
n@1116 5664 // This test is executed only once but we still do memoizing
n@1116 5665 // since we can use the boxSizingReliable pre-computing.
n@1116 5666 // No need to check if the test was already performed, though.
n@1116 5667 computePixelPositionAndBoxSizingReliable();
n@1116 5668 return pixelPositionVal;
n@1116 5669 },
n@1116 5670 boxSizingReliable: function() {
n@1116 5671 if ( boxSizingReliableVal == null ) {
n@1116 5672 computePixelPositionAndBoxSizingReliable();
n@1116 5673 }
n@1116 5674 return boxSizingReliableVal;
n@1116 5675 },
n@1116 5676 reliableMarginRight: function() {
n@1116 5677
n@1116 5678 // Support: Android 2.3
n@1116 5679 // Check if div with explicit width and no margin-right incorrectly
n@1116 5680 // gets computed margin-right based on width of container. (#3333)
n@1116 5681 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
n@1116 5682 // This support function is only executed once so no memoizing is needed.
n@1116 5683 var ret,
n@1116 5684 marginDiv = div.appendChild( document.createElement( "div" ) );
n@1116 5685
n@1116 5686 // Reset CSS: box-sizing; display; margin; border; padding
n@1116 5687 marginDiv.style.cssText = div.style.cssText =
n@1116 5688 // Support: Firefox<29, Android 2.3
n@1116 5689 // Vendor-prefix box-sizing
n@1116 5690 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
n@1116 5691 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
n@1116 5692 marginDiv.style.marginRight = marginDiv.style.width = "0";
n@1116 5693 div.style.width = "1px";
n@1116 5694 docElem.appendChild( container );
n@1116 5695
n@1116 5696 ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
n@1116 5697
n@1116 5698 docElem.removeChild( container );
n@1116 5699 div.removeChild( marginDiv );
n@1116 5700
n@1116 5701 return ret;
n@1116 5702 }
n@1116 5703 });
n@1116 5704 }
n@1116 5705 })();
n@1116 5706
n@1116 5707
n@1116 5708 // A method for quickly swapping in/out CSS properties to get correct calculations.
n@1116 5709 jQuery.swap = function( elem, options, callback, args ) {
n@1116 5710 var ret, name,
n@1116 5711 old = {};
n@1116 5712
n@1116 5713 // Remember the old values, and insert the new ones
n@1116 5714 for ( name in options ) {
n@1116 5715 old[ name ] = elem.style[ name ];
n@1116 5716 elem.style[ name ] = options[ name ];
n@1116 5717 }
n@1116 5718
n@1116 5719 ret = callback.apply( elem, args || [] );
n@1116 5720
n@1116 5721 // Revert the old values
n@1116 5722 for ( name in options ) {
n@1116 5723 elem.style[ name ] = old[ name ];
n@1116 5724 }
n@1116 5725
n@1116 5726 return ret;
n@1116 5727 };
n@1116 5728
n@1116 5729
n@1116 5730 var
n@1116 5731 // Swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
n@1116 5732 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
n@1116 5733 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
n@1116 5734 rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
n@1116 5735 rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
n@1116 5736
n@1116 5737 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
n@1116 5738 cssNormalTransform = {
n@1116 5739 letterSpacing: "0",
n@1116 5740 fontWeight: "400"
n@1116 5741 },
n@1116 5742
n@1116 5743 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
n@1116 5744
n@1116 5745 // Return a css property mapped to a potentially vendor prefixed property
n@1116 5746 function vendorPropName( style, name ) {
n@1116 5747
n@1116 5748 // Shortcut for names that are not vendor prefixed
n@1116 5749 if ( name in style ) {
n@1116 5750 return name;
n@1116 5751 }
n@1116 5752
n@1116 5753 // Check for vendor prefixed names
n@1116 5754 var capName = name[0].toUpperCase() + name.slice(1),
n@1116 5755 origName = name,
n@1116 5756 i = cssPrefixes.length;
n@1116 5757
n@1116 5758 while ( i-- ) {
n@1116 5759 name = cssPrefixes[ i ] + capName;
n@1116 5760 if ( name in style ) {
n@1116 5761 return name;
n@1116 5762 }
n@1116 5763 }
n@1116 5764
n@1116 5765 return origName;
n@1116 5766 }
n@1116 5767
n@1116 5768 function setPositiveNumber( elem, value, subtract ) {
n@1116 5769 var matches = rnumsplit.exec( value );
n@1116 5770 return matches ?
n@1116 5771 // Guard against undefined "subtract", e.g., when used as in cssHooks
n@1116 5772 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
n@1116 5773 value;
n@1116 5774 }
n@1116 5775
n@1116 5776 function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
n@1116 5777 var i = extra === ( isBorderBox ? "border" : "content" ) ?
n@1116 5778 // If we already have the right measurement, avoid augmentation
n@1116 5779 4 :
n@1116 5780 // Otherwise initialize for horizontal or vertical properties
n@1116 5781 name === "width" ? 1 : 0,
n@1116 5782
n@1116 5783 val = 0;
n@1116 5784
n@1116 5785 for ( ; i < 4; i += 2 ) {
n@1116 5786 // Both box models exclude margin, so add it if we want it
n@1116 5787 if ( extra === "margin" ) {
n@1116 5788 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
n@1116 5789 }
n@1116 5790
n@1116 5791 if ( isBorderBox ) {
n@1116 5792 // border-box includes padding, so remove it if we want content
n@1116 5793 if ( extra === "content" ) {
n@1116 5794 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
n@1116 5795 }
n@1116 5796
n@1116 5797 // At this point, extra isn't border nor margin, so remove border
n@1116 5798 if ( extra !== "margin" ) {
n@1116 5799 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
n@1116 5800 }
n@1116 5801 } else {
n@1116 5802 // At this point, extra isn't content, so add padding
n@1116 5803 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
n@1116 5804
n@1116 5805 // At this point, extra isn't content nor padding, so add border
n@1116 5806 if ( extra !== "padding" ) {
n@1116 5807 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
n@1116 5808 }
n@1116 5809 }
n@1116 5810 }
n@1116 5811
n@1116 5812 return val;
n@1116 5813 }
n@1116 5814
n@1116 5815 function getWidthOrHeight( elem, name, extra ) {
n@1116 5816
n@1116 5817 // Start with offset property, which is equivalent to the border-box value
n@1116 5818 var valueIsBorderBox = true,
n@1116 5819 val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
n@1116 5820 styles = getStyles( elem ),
n@1116 5821 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
n@1116 5822
n@1116 5823 // Some non-html elements return undefined for offsetWidth, so check for null/undefined
n@1116 5824 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
n@1116 5825 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
n@1116 5826 if ( val <= 0 || val == null ) {
n@1116 5827 // Fall back to computed then uncomputed css if necessary
n@1116 5828 val = curCSS( elem, name, styles );
n@1116 5829 if ( val < 0 || val == null ) {
n@1116 5830 val = elem.style[ name ];
n@1116 5831 }
n@1116 5832
n@1116 5833 // Computed unit is not pixels. Stop here and return.
n@1116 5834 if ( rnumnonpx.test(val) ) {
n@1116 5835 return val;
n@1116 5836 }
n@1116 5837
n@1116 5838 // Check for style in case a browser which returns unreliable values
n@1116 5839 // for getComputedStyle silently falls back to the reliable elem.style
n@1116 5840 valueIsBorderBox = isBorderBox &&
n@1116 5841 ( support.boxSizingReliable() || val === elem.style[ name ] );
n@1116 5842
n@1116 5843 // Normalize "", auto, and prepare for extra
n@1116 5844 val = parseFloat( val ) || 0;
n@1116 5845 }
n@1116 5846
n@1116 5847 // Use the active box-sizing model to add/subtract irrelevant styles
n@1116 5848 return ( val +
n@1116 5849 augmentWidthOrHeight(
n@1116 5850 elem,
n@1116 5851 name,
n@1116 5852 extra || ( isBorderBox ? "border" : "content" ),
n@1116 5853 valueIsBorderBox,
n@1116 5854 styles
n@1116 5855 )
n@1116 5856 ) + "px";
n@1116 5857 }
n@1116 5858
n@1116 5859 function showHide( elements, show ) {
n@1116 5860 var display, elem, hidden,
n@1116 5861 values = [],
n@1116 5862 index = 0,
n@1116 5863 length = elements.length;
n@1116 5864
n@1116 5865 for ( ; index < length; index++ ) {
n@1116 5866 elem = elements[ index ];
n@1116 5867 if ( !elem.style ) {
n@1116 5868 continue;
n@1116 5869 }
n@1116 5870
n@1116 5871 values[ index ] = data_priv.get( elem, "olddisplay" );
n@1116 5872 display = elem.style.display;
n@1116 5873 if ( show ) {
n@1116 5874 // Reset the inline display of this element to learn if it is
n@1116 5875 // being hidden by cascaded rules or not
n@1116 5876 if ( !values[ index ] && display === "none" ) {
n@1116 5877 elem.style.display = "";
n@1116 5878 }
n@1116 5879
n@1116 5880 // Set elements which have been overridden with display: none
n@1116 5881 // in a stylesheet to whatever the default browser style is
n@1116 5882 // for such an element
n@1116 5883 if ( elem.style.display === "" && isHidden( elem ) ) {
n@1116 5884 values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
n@1116 5885 }
n@1116 5886 } else {
n@1116 5887 hidden = isHidden( elem );
n@1116 5888
n@1116 5889 if ( display !== "none" || !hidden ) {
n@1116 5890 data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
n@1116 5891 }
n@1116 5892 }
n@1116 5893 }
n@1116 5894
n@1116 5895 // Set the display of most of the elements in a second loop
n@1116 5896 // to avoid the constant reflow
n@1116 5897 for ( index = 0; index < length; index++ ) {
n@1116 5898 elem = elements[ index ];
n@1116 5899 if ( !elem.style ) {
n@1116 5900 continue;
n@1116 5901 }
n@1116 5902 if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
n@1116 5903 elem.style.display = show ? values[ index ] || "" : "none";
n@1116 5904 }
n@1116 5905 }
n@1116 5906
n@1116 5907 return elements;
n@1116 5908 }
n@1116 5909
n@1116 5910 jQuery.extend({
n@1116 5911
n@1116 5912 // Add in style property hooks for overriding the default
n@1116 5913 // behavior of getting and setting a style property
n@1116 5914 cssHooks: {
n@1116 5915 opacity: {
n@1116 5916 get: function( elem, computed ) {
n@1116 5917 if ( computed ) {
n@1116 5918
n@1116 5919 // We should always get a number back from opacity
n@1116 5920 var ret = curCSS( elem, "opacity" );
n@1116 5921 return ret === "" ? "1" : ret;
n@1116 5922 }
n@1116 5923 }
n@1116 5924 }
n@1116 5925 },
n@1116 5926
n@1116 5927 // Don't automatically add "px" to these possibly-unitless properties
n@1116 5928 cssNumber: {
n@1116 5929 "columnCount": true,
n@1116 5930 "fillOpacity": true,
n@1116 5931 "flexGrow": true,
n@1116 5932 "flexShrink": true,
n@1116 5933 "fontWeight": true,
n@1116 5934 "lineHeight": true,
n@1116 5935 "opacity": true,
n@1116 5936 "order": true,
n@1116 5937 "orphans": true,
n@1116 5938 "widows": true,
n@1116 5939 "zIndex": true,
n@1116 5940 "zoom": true
n@1116 5941 },
n@1116 5942
n@1116 5943 // Add in properties whose names you wish to fix before
n@1116 5944 // setting or getting the value
n@1116 5945 cssProps: {
n@1116 5946 "float": "cssFloat"
n@1116 5947 },
n@1116 5948
n@1116 5949 // Get and set the style property on a DOM Node
n@1116 5950 style: function( elem, name, value, extra ) {
n@1116 5951
n@1116 5952 // Don't set styles on text and comment nodes
n@1116 5953 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
n@1116 5954 return;
n@1116 5955 }
n@1116 5956
n@1116 5957 // Make sure that we're working with the right name
n@1116 5958 var ret, type, hooks,
n@1116 5959 origName = jQuery.camelCase( name ),
n@1116 5960 style = elem.style;
n@1116 5961
n@1116 5962 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
n@1116 5963
n@1116 5964 // Gets hook for the prefixed version, then unprefixed version
n@1116 5965 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
n@1116 5966
n@1116 5967 // Check if we're setting a value
n@1116 5968 if ( value !== undefined ) {
n@1116 5969 type = typeof value;
n@1116 5970
n@1116 5971 // Convert "+=" or "-=" to relative numbers (#7345)
n@1116 5972 if ( type === "string" && (ret = rrelNum.exec( value )) ) {
n@1116 5973 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
n@1116 5974 // Fixes bug #9237
n@1116 5975 type = "number";
n@1116 5976 }
n@1116 5977
n@1116 5978 // Make sure that null and NaN values aren't set (#7116)
n@1116 5979 if ( value == null || value !== value ) {
n@1116 5980 return;
n@1116 5981 }
n@1116 5982
n@1116 5983 // If a number, add 'px' to the (except for certain CSS properties)
n@1116 5984 if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
n@1116 5985 value += "px";
n@1116 5986 }
n@1116 5987
n@1116 5988 // Support: IE9-11+
n@1116 5989 // background-* props affect original clone's values
n@1116 5990 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
n@1116 5991 style[ name ] = "inherit";
n@1116 5992 }
n@1116 5993
n@1116 5994 // If a hook was provided, use that value, otherwise just set the specified value
n@1116 5995 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
n@1116 5996 style[ name ] = value;
n@1116 5997 }
n@1116 5998
n@1116 5999 } else {
n@1116 6000 // If a hook was provided get the non-computed value from there
n@1116 6001 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
n@1116 6002 return ret;
n@1116 6003 }
n@1116 6004
n@1116 6005 // Otherwise just get the value from the style object
n@1116 6006 return style[ name ];
n@1116 6007 }
n@1116 6008 },
n@1116 6009
n@1116 6010 css: function( elem, name, extra, styles ) {
n@1116 6011 var val, num, hooks,
n@1116 6012 origName = jQuery.camelCase( name );
n@1116 6013
n@1116 6014 // Make sure that we're working with the right name
n@1116 6015 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
n@1116 6016
n@1116 6017 // Try prefixed name followed by the unprefixed name
n@1116 6018 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
n@1116 6019
n@1116 6020 // If a hook was provided get the computed value from there
n@1116 6021 if ( hooks && "get" in hooks ) {
n@1116 6022 val = hooks.get( elem, true, extra );
n@1116 6023 }
n@1116 6024
n@1116 6025 // Otherwise, if a way to get the computed value exists, use that
n@1116 6026 if ( val === undefined ) {
n@1116 6027 val = curCSS( elem, name, styles );
n@1116 6028 }
n@1116 6029
n@1116 6030 // Convert "normal" to computed value
n@1116 6031 if ( val === "normal" && name in cssNormalTransform ) {
n@1116 6032 val = cssNormalTransform[ name ];
n@1116 6033 }
n@1116 6034
n@1116 6035 // Make numeric if forced or a qualifier was provided and val looks numeric
n@1116 6036 if ( extra === "" || extra ) {
n@1116 6037 num = parseFloat( val );
n@1116 6038 return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
n@1116 6039 }
n@1116 6040 return val;
n@1116 6041 }
n@1116 6042 });
n@1116 6043
n@1116 6044 jQuery.each([ "height", "width" ], function( i, name ) {
n@1116 6045 jQuery.cssHooks[ name ] = {
n@1116 6046 get: function( elem, computed, extra ) {
n@1116 6047 if ( computed ) {
n@1116 6048
n@1116 6049 // Certain elements can have dimension info if we invisibly show them
n@1116 6050 // but it must have a current display style that would benefit
n@1116 6051 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
n@1116 6052 jQuery.swap( elem, cssShow, function() {
n@1116 6053 return getWidthOrHeight( elem, name, extra );
n@1116 6054 }) :
n@1116 6055 getWidthOrHeight( elem, name, extra );
n@1116 6056 }
n@1116 6057 },
n@1116 6058
n@1116 6059 set: function( elem, value, extra ) {
n@1116 6060 var styles = extra && getStyles( elem );
n@1116 6061 return setPositiveNumber( elem, value, extra ?
n@1116 6062 augmentWidthOrHeight(
n@1116 6063 elem,
n@1116 6064 name,
n@1116 6065 extra,
n@1116 6066 jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
n@1116 6067 styles
n@1116 6068 ) : 0
n@1116 6069 );
n@1116 6070 }
n@1116 6071 };
n@1116 6072 });
n@1116 6073
n@1116 6074 // Support: Android 2.3
n@1116 6075 jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
n@1116 6076 function( elem, computed ) {
n@1116 6077 if ( computed ) {
n@1116 6078 return jQuery.swap( elem, { "display": "inline-block" },
n@1116 6079 curCSS, [ elem, "marginRight" ] );
n@1116 6080 }
n@1116 6081 }
n@1116 6082 );
n@1116 6083
n@1116 6084 // These hooks are used by animate to expand properties
n@1116 6085 jQuery.each({
n@1116 6086 margin: "",
n@1116 6087 padding: "",
n@1116 6088 border: "Width"
n@1116 6089 }, function( prefix, suffix ) {
n@1116 6090 jQuery.cssHooks[ prefix + suffix ] = {
n@1116 6091 expand: function( value ) {
n@1116 6092 var i = 0,
n@1116 6093 expanded = {},
n@1116 6094
n@1116 6095 // Assumes a single number if not a string
n@1116 6096 parts = typeof value === "string" ? value.split(" ") : [ value ];
n@1116 6097
n@1116 6098 for ( ; i < 4; i++ ) {
n@1116 6099 expanded[ prefix + cssExpand[ i ] + suffix ] =
n@1116 6100 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
n@1116 6101 }
n@1116 6102
n@1116 6103 return expanded;
n@1116 6104 }
n@1116 6105 };
n@1116 6106
n@1116 6107 if ( !rmargin.test( prefix ) ) {
n@1116 6108 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
n@1116 6109 }
n@1116 6110 });
n@1116 6111
n@1116 6112 jQuery.fn.extend({
n@1116 6113 css: function( name, value ) {
n@1116 6114 return access( this, function( elem, name, value ) {
n@1116 6115 var styles, len,
n@1116 6116 map = {},
n@1116 6117 i = 0;
n@1116 6118
n@1116 6119 if ( jQuery.isArray( name ) ) {
n@1116 6120 styles = getStyles( elem );
n@1116 6121 len = name.length;
n@1116 6122
n@1116 6123 for ( ; i < len; i++ ) {
n@1116 6124 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
n@1116 6125 }
n@1116 6126
n@1116 6127 return map;
n@1116 6128 }
n@1116 6129
n@1116 6130 return value !== undefined ?
n@1116 6131 jQuery.style( elem, name, value ) :
n@1116 6132 jQuery.css( elem, name );
n@1116 6133 }, name, value, arguments.length > 1 );
n@1116 6134 },
n@1116 6135 show: function() {
n@1116 6136 return showHide( this, true );
n@1116 6137 },
n@1116 6138 hide: function() {
n@1116 6139 return showHide( this );
n@1116 6140 },
n@1116 6141 toggle: function( state ) {
n@1116 6142 if ( typeof state === "boolean" ) {
n@1116 6143 return state ? this.show() : this.hide();
n@1116 6144 }
n@1116 6145
n@1116 6146 return this.each(function() {
n@1116 6147 if ( isHidden( this ) ) {
n@1116 6148 jQuery( this ).show();
n@1116 6149 } else {
n@1116 6150 jQuery( this ).hide();
n@1116 6151 }
n@1116 6152 });
n@1116 6153 }
n@1116 6154 });
n@1116 6155
n@1116 6156
n@1116 6157 function Tween( elem, options, prop, end, easing ) {
n@1116 6158 return new Tween.prototype.init( elem, options, prop, end, easing );
n@1116 6159 }
n@1116 6160 jQuery.Tween = Tween;
n@1116 6161
n@1116 6162 Tween.prototype = {
n@1116 6163 constructor: Tween,
n@1116 6164 init: function( elem, options, prop, end, easing, unit ) {
n@1116 6165 this.elem = elem;
n@1116 6166 this.prop = prop;
n@1116 6167 this.easing = easing || "swing";
n@1116 6168 this.options = options;
n@1116 6169 this.start = this.now = this.cur();
n@1116 6170 this.end = end;
n@1116 6171 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
n@1116 6172 },
n@1116 6173 cur: function() {
n@1116 6174 var hooks = Tween.propHooks[ this.prop ];
n@1116 6175
n@1116 6176 return hooks && hooks.get ?
n@1116 6177 hooks.get( this ) :
n@1116 6178 Tween.propHooks._default.get( this );
n@1116 6179 },
n@1116 6180 run: function( percent ) {
n@1116 6181 var eased,
n@1116 6182 hooks = Tween.propHooks[ this.prop ];
n@1116 6183
n@1116 6184 if ( this.options.duration ) {
n@1116 6185 this.pos = eased = jQuery.easing[ this.easing ](
n@1116 6186 percent, this.options.duration * percent, 0, 1, this.options.duration
n@1116 6187 );
n@1116 6188 } else {
n@1116 6189 this.pos = eased = percent;
n@1116 6190 }
n@1116 6191 this.now = ( this.end - this.start ) * eased + this.start;
n@1116 6192
n@1116 6193 if ( this.options.step ) {
n@1116 6194 this.options.step.call( this.elem, this.now, this );
n@1116 6195 }
n@1116 6196
n@1116 6197 if ( hooks && hooks.set ) {
n@1116 6198 hooks.set( this );
n@1116 6199 } else {
n@1116 6200 Tween.propHooks._default.set( this );
n@1116 6201 }
n@1116 6202 return this;
n@1116 6203 }
n@1116 6204 };
n@1116 6205
n@1116 6206 Tween.prototype.init.prototype = Tween.prototype;
n@1116 6207
n@1116 6208 Tween.propHooks = {
n@1116 6209 _default: {
n@1116 6210 get: function( tween ) {
n@1116 6211 var result;
n@1116 6212
n@1116 6213 if ( tween.elem[ tween.prop ] != null &&
n@1116 6214 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
n@1116 6215 return tween.elem[ tween.prop ];
n@1116 6216 }
n@1116 6217
n@1116 6218 // Passing an empty string as a 3rd parameter to .css will automatically
n@1116 6219 // attempt a parseFloat and fallback to a string if the parse fails.
n@1116 6220 // Simple values such as "10px" are parsed to Float;
n@1116 6221 // complex values such as "rotate(1rad)" are returned as-is.
n@1116 6222 result = jQuery.css( tween.elem, tween.prop, "" );
n@1116 6223 // Empty strings, null, undefined and "auto" are converted to 0.
n@1116 6224 return !result || result === "auto" ? 0 : result;
n@1116 6225 },
n@1116 6226 set: function( tween ) {
n@1116 6227 // Use step hook for back compat.
n@1116 6228 // Use cssHook if its there.
n@1116 6229 // Use .style if available and use plain properties where available.
n@1116 6230 if ( jQuery.fx.step[ tween.prop ] ) {
n@1116 6231 jQuery.fx.step[ tween.prop ]( tween );
n@1116 6232 } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
n@1116 6233 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
n@1116 6234 } else {
n@1116 6235 tween.elem[ tween.prop ] = tween.now;
n@1116 6236 }
n@1116 6237 }
n@1116 6238 }
n@1116 6239 };
n@1116 6240
n@1116 6241 // Support: IE9
n@1116 6242 // Panic based approach to setting things on disconnected nodes
n@1116 6243 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
n@1116 6244 set: function( tween ) {
n@1116 6245 if ( tween.elem.nodeType && tween.elem.parentNode ) {
n@1116 6246 tween.elem[ tween.prop ] = tween.now;
n@1116 6247 }
n@1116 6248 }
n@1116 6249 };
n@1116 6250
n@1116 6251 jQuery.easing = {
n@1116 6252 linear: function( p ) {
n@1116 6253 return p;
n@1116 6254 },
n@1116 6255 swing: function( p ) {
n@1116 6256 return 0.5 - Math.cos( p * Math.PI ) / 2;
n@1116 6257 }
n@1116 6258 };
n@1116 6259
n@1116 6260 jQuery.fx = Tween.prototype.init;
n@1116 6261
n@1116 6262 // Back Compat <1.8 extension point
n@1116 6263 jQuery.fx.step = {};
n@1116 6264
n@1116 6265
n@1116 6266
n@1116 6267
n@1116 6268 var
n@1116 6269 fxNow, timerId,
n@1116 6270 rfxtypes = /^(?:toggle|show|hide)$/,
n@1116 6271 rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
n@1116 6272 rrun = /queueHooks$/,
n@1116 6273 animationPrefilters = [ defaultPrefilter ],
n@1116 6274 tweeners = {
n@1116 6275 "*": [ function( prop, value ) {
n@1116 6276 var tween = this.createTween( prop, value ),
n@1116 6277 target = tween.cur(),
n@1116 6278 parts = rfxnum.exec( value ),
n@1116 6279 unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
n@1116 6280
n@1116 6281 // Starting value computation is required for potential unit mismatches
n@1116 6282 start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
n@1116 6283 rfxnum.exec( jQuery.css( tween.elem, prop ) ),
n@1116 6284 scale = 1,
n@1116 6285 maxIterations = 20;
n@1116 6286
n@1116 6287 if ( start && start[ 3 ] !== unit ) {
n@1116 6288 // Trust units reported by jQuery.css
n@1116 6289 unit = unit || start[ 3 ];
n@1116 6290
n@1116 6291 // Make sure we update the tween properties later on
n@1116 6292 parts = parts || [];
n@1116 6293
n@1116 6294 // Iteratively approximate from a nonzero starting point
n@1116 6295 start = +target || 1;
n@1116 6296
n@1116 6297 do {
n@1116 6298 // If previous iteration zeroed out, double until we get *something*.
n@1116 6299 // Use string for doubling so we don't accidentally see scale as unchanged below
n@1116 6300 scale = scale || ".5";
n@1116 6301
n@1116 6302 // Adjust and apply
n@1116 6303 start = start / scale;
n@1116 6304 jQuery.style( tween.elem, prop, start + unit );
n@1116 6305
n@1116 6306 // Update scale, tolerating zero or NaN from tween.cur(),
n@1116 6307 // break the loop if scale is unchanged or perfect, or if we've just had enough
n@1116 6308 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
n@1116 6309 }
n@1116 6310
n@1116 6311 // Update tween properties
n@1116 6312 if ( parts ) {
n@1116 6313 start = tween.start = +start || +target || 0;
n@1116 6314 tween.unit = unit;
n@1116 6315 // If a +=/-= token was provided, we're doing a relative animation
n@1116 6316 tween.end = parts[ 1 ] ?
n@1116 6317 start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
n@1116 6318 +parts[ 2 ];
n@1116 6319 }
n@1116 6320
n@1116 6321 return tween;
n@1116 6322 } ]
n@1116 6323 };
n@1116 6324
n@1116 6325 // Animations created synchronously will run synchronously
n@1116 6326 function createFxNow() {
n@1116 6327 setTimeout(function() {
n@1116 6328 fxNow = undefined;
n@1116 6329 });
n@1116 6330 return ( fxNow = jQuery.now() );
n@1116 6331 }
n@1116 6332
n@1116 6333 // Generate parameters to create a standard animation
n@1116 6334 function genFx( type, includeWidth ) {
n@1116 6335 var which,
n@1116 6336 i = 0,
n@1116 6337 attrs = { height: type };
n@1116 6338
n@1116 6339 // If we include width, step value is 1 to do all cssExpand values,
n@1116 6340 // otherwise step value is 2 to skip over Left and Right
n@1116 6341 includeWidth = includeWidth ? 1 : 0;
n@1116 6342 for ( ; i < 4 ; i += 2 - includeWidth ) {
n@1116 6343 which = cssExpand[ i ];
n@1116 6344 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
n@1116 6345 }
n@1116 6346
n@1116 6347 if ( includeWidth ) {
n@1116 6348 attrs.opacity = attrs.width = type;
n@1116 6349 }
n@1116 6350
n@1116 6351 return attrs;
n@1116 6352 }
n@1116 6353
n@1116 6354 function createTween( value, prop, animation ) {
n@1116 6355 var tween,
n@1116 6356 collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
n@1116 6357 index = 0,
n@1116 6358 length = collection.length;
n@1116 6359 for ( ; index < length; index++ ) {
n@1116 6360 if ( (tween = collection[ index ].call( animation, prop, value )) ) {
n@1116 6361
n@1116 6362 // We're done with this property
n@1116 6363 return tween;
n@1116 6364 }
n@1116 6365 }
n@1116 6366 }
n@1116 6367
n@1116 6368 function defaultPrefilter( elem, props, opts ) {
n@1116 6369 /* jshint validthis: true */
n@1116 6370 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
n@1116 6371 anim = this,
n@1116 6372 orig = {},
n@1116 6373 style = elem.style,
n@1116 6374 hidden = elem.nodeType && isHidden( elem ),
n@1116 6375 dataShow = data_priv.get( elem, "fxshow" );
n@1116 6376
n@1116 6377 // Handle queue: false promises
n@1116 6378 if ( !opts.queue ) {
n@1116 6379 hooks = jQuery._queueHooks( elem, "fx" );
n@1116 6380 if ( hooks.unqueued == null ) {
n@1116 6381 hooks.unqueued = 0;
n@1116 6382 oldfire = hooks.empty.fire;
n@1116 6383 hooks.empty.fire = function() {
n@1116 6384 if ( !hooks.unqueued ) {
n@1116 6385 oldfire();
n@1116 6386 }
n@1116 6387 };
n@1116 6388 }
n@1116 6389 hooks.unqueued++;
n@1116 6390
n@1116 6391 anim.always(function() {
n@1116 6392 // Ensure the complete handler is called before this completes
n@1116 6393 anim.always(function() {
n@1116 6394 hooks.unqueued--;
n@1116 6395 if ( !jQuery.queue( elem, "fx" ).length ) {
n@1116 6396 hooks.empty.fire();
n@1116 6397 }
n@1116 6398 });
n@1116 6399 });
n@1116 6400 }
n@1116 6401
n@1116 6402 // Height/width overflow pass
n@1116 6403 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
n@1116 6404 // Make sure that nothing sneaks out
n@1116 6405 // Record all 3 overflow attributes because IE9-10 do not
n@1116 6406 // change the overflow attribute when overflowX and
n@1116 6407 // overflowY are set to the same value
n@1116 6408 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
n@1116 6409
n@1116 6410 // Set display property to inline-block for height/width
n@1116 6411 // animations on inline elements that are having width/height animated
n@1116 6412 display = jQuery.css( elem, "display" );
n@1116 6413
n@1116 6414 // Test default display if display is currently "none"
n@1116 6415 checkDisplay = display === "none" ?
n@1116 6416 data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
n@1116 6417
n@1116 6418 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
n@1116 6419 style.display = "inline-block";
n@1116 6420 }
n@1116 6421 }
n@1116 6422
n@1116 6423 if ( opts.overflow ) {
n@1116 6424 style.overflow = "hidden";
n@1116 6425 anim.always(function() {
n@1116 6426 style.overflow = opts.overflow[ 0 ];
n@1116 6427 style.overflowX = opts.overflow[ 1 ];
n@1116 6428 style.overflowY = opts.overflow[ 2 ];
n@1116 6429 });
n@1116 6430 }
n@1116 6431
n@1116 6432 // show/hide pass
n@1116 6433 for ( prop in props ) {
n@1116 6434 value = props[ prop ];
n@1116 6435 if ( rfxtypes.exec( value ) ) {
n@1116 6436 delete props[ prop ];
n@1116 6437 toggle = toggle || value === "toggle";
n@1116 6438 if ( value === ( hidden ? "hide" : "show" ) ) {
n@1116 6439
n@1116 6440 // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
n@1116 6441 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
n@1116 6442 hidden = true;
n@1116 6443 } else {
n@1116 6444 continue;
n@1116 6445 }
n@1116 6446 }
n@1116 6447 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
n@1116 6448
n@1116 6449 // Any non-fx value stops us from restoring the original display value
n@1116 6450 } else {
n@1116 6451 display = undefined;
n@1116 6452 }
n@1116 6453 }
n@1116 6454
n@1116 6455 if ( !jQuery.isEmptyObject( orig ) ) {
n@1116 6456 if ( dataShow ) {
n@1116 6457 if ( "hidden" in dataShow ) {
n@1116 6458 hidden = dataShow.hidden;
n@1116 6459 }
n@1116 6460 } else {
n@1116 6461 dataShow = data_priv.access( elem, "fxshow", {} );
n@1116 6462 }
n@1116 6463
n@1116 6464 // Store state if its toggle - enables .stop().toggle() to "reverse"
n@1116 6465 if ( toggle ) {
n@1116 6466 dataShow.hidden = !hidden;
n@1116 6467 }
n@1116 6468 if ( hidden ) {
n@1116 6469 jQuery( elem ).show();
n@1116 6470 } else {
n@1116 6471 anim.done(function() {
n@1116 6472 jQuery( elem ).hide();
n@1116 6473 });
n@1116 6474 }
n@1116 6475 anim.done(function() {
n@1116 6476 var prop;
n@1116 6477
n@1116 6478 data_priv.remove( elem, "fxshow" );
n@1116 6479 for ( prop in orig ) {
n@1116 6480 jQuery.style( elem, prop, orig[ prop ] );
n@1116 6481 }
n@1116 6482 });
n@1116 6483 for ( prop in orig ) {
n@1116 6484 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
n@1116 6485
n@1116 6486 if ( !( prop in dataShow ) ) {
n@1116 6487 dataShow[ prop ] = tween.start;
n@1116 6488 if ( hidden ) {
n@1116 6489 tween.end = tween.start;
n@1116 6490 tween.start = prop === "width" || prop === "height" ? 1 : 0;
n@1116 6491 }
n@1116 6492 }
n@1116 6493 }
n@1116 6494
n@1116 6495 // If this is a noop like .hide().hide(), restore an overwritten display value
n@1116 6496 } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
n@1116 6497 style.display = display;
n@1116 6498 }
n@1116 6499 }
n@1116 6500
n@1116 6501 function propFilter( props, specialEasing ) {
n@1116 6502 var index, name, easing, value, hooks;
n@1116 6503
n@1116 6504 // camelCase, specialEasing and expand cssHook pass
n@1116 6505 for ( index in props ) {
n@1116 6506 name = jQuery.camelCase( index );
n@1116 6507 easing = specialEasing[ name ];
n@1116 6508 value = props[ index ];
n@1116 6509 if ( jQuery.isArray( value ) ) {
n@1116 6510 easing = value[ 1 ];
n@1116 6511 value = props[ index ] = value[ 0 ];
n@1116 6512 }
n@1116 6513
n@1116 6514 if ( index !== name ) {
n@1116 6515 props[ name ] = value;
n@1116 6516 delete props[ index ];
n@1116 6517 }
n@1116 6518
n@1116 6519 hooks = jQuery.cssHooks[ name ];
n@1116 6520 if ( hooks && "expand" in hooks ) {
n@1116 6521 value = hooks.expand( value );
n@1116 6522 delete props[ name ];
n@1116 6523
n@1116 6524 // Not quite $.extend, this won't overwrite existing keys.
n@1116 6525 // Reusing 'index' because we have the correct "name"
n@1116 6526 for ( index in value ) {
n@1116 6527 if ( !( index in props ) ) {
n@1116 6528 props[ index ] = value[ index ];
n@1116 6529 specialEasing[ index ] = easing;
n@1116 6530 }
n@1116 6531 }
n@1116 6532 } else {
n@1116 6533 specialEasing[ name ] = easing;
n@1116 6534 }
n@1116 6535 }
n@1116 6536 }
n@1116 6537
n@1116 6538 function Animation( elem, properties, options ) {
n@1116 6539 var result,
n@1116 6540 stopped,
n@1116 6541 index = 0,
n@1116 6542 length = animationPrefilters.length,
n@1116 6543 deferred = jQuery.Deferred().always( function() {
n@1116 6544 // Don't match elem in the :animated selector
n@1116 6545 delete tick.elem;
n@1116 6546 }),
n@1116 6547 tick = function() {
n@1116 6548 if ( stopped ) {
n@1116 6549 return false;
n@1116 6550 }
n@1116 6551 var currentTime = fxNow || createFxNow(),
n@1116 6552 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
n@1116 6553 // Support: Android 2.3
n@1116 6554 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
n@1116 6555 temp = remaining / animation.duration || 0,
n@1116 6556 percent = 1 - temp,
n@1116 6557 index = 0,
n@1116 6558 length = animation.tweens.length;
n@1116 6559
n@1116 6560 for ( ; index < length ; index++ ) {
n@1116 6561 animation.tweens[ index ].run( percent );
n@1116 6562 }
n@1116 6563
n@1116 6564 deferred.notifyWith( elem, [ animation, percent, remaining ]);
n@1116 6565
n@1116 6566 if ( percent < 1 && length ) {
n@1116 6567 return remaining;
n@1116 6568 } else {
n@1116 6569 deferred.resolveWith( elem, [ animation ] );
n@1116 6570 return false;
n@1116 6571 }
n@1116 6572 },
n@1116 6573 animation = deferred.promise({
n@1116 6574 elem: elem,
n@1116 6575 props: jQuery.extend( {}, properties ),
n@1116 6576 opts: jQuery.extend( true, { specialEasing: {} }, options ),
n@1116 6577 originalProperties: properties,
n@1116 6578 originalOptions: options,
n@1116 6579 startTime: fxNow || createFxNow(),
n@1116 6580 duration: options.duration,
n@1116 6581 tweens: [],
n@1116 6582 createTween: function( prop, end ) {
n@1116 6583 var tween = jQuery.Tween( elem, animation.opts, prop, end,
n@1116 6584 animation.opts.specialEasing[ prop ] || animation.opts.easing );
n@1116 6585 animation.tweens.push( tween );
n@1116 6586 return tween;
n@1116 6587 },
n@1116 6588 stop: function( gotoEnd ) {
n@1116 6589 var index = 0,
n@1116 6590 // If we are going to the end, we want to run all the tweens
n@1116 6591 // otherwise we skip this part
n@1116 6592 length = gotoEnd ? animation.tweens.length : 0;
n@1116 6593 if ( stopped ) {
n@1116 6594 return this;
n@1116 6595 }
n@1116 6596 stopped = true;
n@1116 6597 for ( ; index < length ; index++ ) {
n@1116 6598 animation.tweens[ index ].run( 1 );
n@1116 6599 }
n@1116 6600
n@1116 6601 // Resolve when we played the last frame; otherwise, reject
n@1116 6602 if ( gotoEnd ) {
n@1116 6603 deferred.resolveWith( elem, [ animation, gotoEnd ] );
n@1116 6604 } else {
n@1116 6605 deferred.rejectWith( elem, [ animation, gotoEnd ] );
n@1116 6606 }
n@1116 6607 return this;
n@1116 6608 }
n@1116 6609 }),
n@1116 6610 props = animation.props;
n@1116 6611
n@1116 6612 propFilter( props, animation.opts.specialEasing );
n@1116 6613
n@1116 6614 for ( ; index < length ; index++ ) {
n@1116 6615 result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
n@1116 6616 if ( result ) {
n@1116 6617 return result;
n@1116 6618 }
n@1116 6619 }
n@1116 6620
n@1116 6621 jQuery.map( props, createTween, animation );
n@1116 6622
n@1116 6623 if ( jQuery.isFunction( animation.opts.start ) ) {
n@1116 6624 animation.opts.start.call( elem, animation );
n@1116 6625 }
n@1116 6626
n@1116 6627 jQuery.fx.timer(
n@1116 6628 jQuery.extend( tick, {
n@1116 6629 elem: elem,
n@1116 6630 anim: animation,
n@1116 6631 queue: animation.opts.queue
n@1116 6632 })
n@1116 6633 );
n@1116 6634
n@1116 6635 // attach callbacks from options
n@1116 6636 return animation.progress( animation.opts.progress )
n@1116 6637 .done( animation.opts.done, animation.opts.complete )
n@1116 6638 .fail( animation.opts.fail )
n@1116 6639 .always( animation.opts.always );
n@1116 6640 }
n@1116 6641
n@1116 6642 jQuery.Animation = jQuery.extend( Animation, {
n@1116 6643
n@1116 6644 tweener: function( props, callback ) {
n@1116 6645 if ( jQuery.isFunction( props ) ) {
n@1116 6646 callback = props;
n@1116 6647 props = [ "*" ];
n@1116 6648 } else {
n@1116 6649 props = props.split(" ");
n@1116 6650 }
n@1116 6651
n@1116 6652 var prop,
n@1116 6653 index = 0,
n@1116 6654 length = props.length;
n@1116 6655
n@1116 6656 for ( ; index < length ; index++ ) {
n@1116 6657 prop = props[ index ];
n@1116 6658 tweeners[ prop ] = tweeners[ prop ] || [];
n@1116 6659 tweeners[ prop ].unshift( callback );
n@1116 6660 }
n@1116 6661 },
n@1116 6662
n@1116 6663 prefilter: function( callback, prepend ) {
n@1116 6664 if ( prepend ) {
n@1116 6665 animationPrefilters.unshift( callback );
n@1116 6666 } else {
n@1116 6667 animationPrefilters.push( callback );
n@1116 6668 }
n@1116 6669 }
n@1116 6670 });
n@1116 6671
n@1116 6672 jQuery.speed = function( speed, easing, fn ) {
n@1116 6673 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
n@1116 6674 complete: fn || !fn && easing ||
n@1116 6675 jQuery.isFunction( speed ) && speed,
n@1116 6676 duration: speed,
n@1116 6677 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
n@1116 6678 };
n@1116 6679
n@1116 6680 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
n@1116 6681 opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
n@1116 6682
n@1116 6683 // Normalize opt.queue - true/undefined/null -> "fx"
n@1116 6684 if ( opt.queue == null || opt.queue === true ) {
n@1116 6685 opt.queue = "fx";
n@1116 6686 }
n@1116 6687
n@1116 6688 // Queueing
n@1116 6689 opt.old = opt.complete;
n@1116 6690
n@1116 6691 opt.complete = function() {
n@1116 6692 if ( jQuery.isFunction( opt.old ) ) {
n@1116 6693 opt.old.call( this );
n@1116 6694 }
n@1116 6695
n@1116 6696 if ( opt.queue ) {
n@1116 6697 jQuery.dequeue( this, opt.queue );
n@1116 6698 }
n@1116 6699 };
n@1116 6700
n@1116 6701 return opt;
n@1116 6702 };
n@1116 6703
n@1116 6704 jQuery.fn.extend({
n@1116 6705 fadeTo: function( speed, to, easing, callback ) {
n@1116 6706
n@1116 6707 // Show any hidden elements after setting opacity to 0
n@1116 6708 return this.filter( isHidden ).css( "opacity", 0 ).show()
n@1116 6709
n@1116 6710 // Animate to the value specified
n@1116 6711 .end().animate({ opacity: to }, speed, easing, callback );
n@1116 6712 },
n@1116 6713 animate: function( prop, speed, easing, callback ) {
n@1116 6714 var empty = jQuery.isEmptyObject( prop ),
n@1116 6715 optall = jQuery.speed( speed, easing, callback ),
n@1116 6716 doAnimation = function() {
n@1116 6717 // Operate on a copy of prop so per-property easing won't be lost
n@1116 6718 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
n@1116 6719
n@1116 6720 // Empty animations, or finishing resolves immediately
n@1116 6721 if ( empty || data_priv.get( this, "finish" ) ) {
n@1116 6722 anim.stop( true );
n@1116 6723 }
n@1116 6724 };
n@1116 6725 doAnimation.finish = doAnimation;
n@1116 6726
n@1116 6727 return empty || optall.queue === false ?
n@1116 6728 this.each( doAnimation ) :
n@1116 6729 this.queue( optall.queue, doAnimation );
n@1116 6730 },
n@1116 6731 stop: function( type, clearQueue, gotoEnd ) {
n@1116 6732 var stopQueue = function( hooks ) {
n@1116 6733 var stop = hooks.stop;
n@1116 6734 delete hooks.stop;
n@1116 6735 stop( gotoEnd );
n@1116 6736 };
n@1116 6737
n@1116 6738 if ( typeof type !== "string" ) {
n@1116 6739 gotoEnd = clearQueue;
n@1116 6740 clearQueue = type;
n@1116 6741 type = undefined;
n@1116 6742 }
n@1116 6743 if ( clearQueue && type !== false ) {
n@1116 6744 this.queue( type || "fx", [] );
n@1116 6745 }
n@1116 6746
n@1116 6747 return this.each(function() {
n@1116 6748 var dequeue = true,
n@1116 6749 index = type != null && type + "queueHooks",
n@1116 6750 timers = jQuery.timers,
n@1116 6751 data = data_priv.get( this );
n@1116 6752
n@1116 6753 if ( index ) {
n@1116 6754 if ( data[ index ] && data[ index ].stop ) {
n@1116 6755 stopQueue( data[ index ] );
n@1116 6756 }
n@1116 6757 } else {
n@1116 6758 for ( index in data ) {
n@1116 6759 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
n@1116 6760 stopQueue( data[ index ] );
n@1116 6761 }
n@1116 6762 }
n@1116 6763 }
n@1116 6764
n@1116 6765 for ( index = timers.length; index--; ) {
n@1116 6766 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
n@1116 6767 timers[ index ].anim.stop( gotoEnd );
n@1116 6768 dequeue = false;
n@1116 6769 timers.splice( index, 1 );
n@1116 6770 }
n@1116 6771 }
n@1116 6772
n@1116 6773 // Start the next in the queue if the last step wasn't forced.
n@1116 6774 // Timers currently will call their complete callbacks, which
n@1116 6775 // will dequeue but only if they were gotoEnd.
n@1116 6776 if ( dequeue || !gotoEnd ) {
n@1116 6777 jQuery.dequeue( this, type );
n@1116 6778 }
n@1116 6779 });
n@1116 6780 },
n@1116 6781 finish: function( type ) {
n@1116 6782 if ( type !== false ) {
n@1116 6783 type = type || "fx";
n@1116 6784 }
n@1116 6785 return this.each(function() {
n@1116 6786 var index,
n@1116 6787 data = data_priv.get( this ),
n@1116 6788 queue = data[ type + "queue" ],
n@1116 6789 hooks = data[ type + "queueHooks" ],
n@1116 6790 timers = jQuery.timers,
n@1116 6791 length = queue ? queue.length : 0;
n@1116 6792
n@1116 6793 // Enable finishing flag on private data
n@1116 6794 data.finish = true;
n@1116 6795
n@1116 6796 // Empty the queue first
n@1116 6797 jQuery.queue( this, type, [] );
n@1116 6798
n@1116 6799 if ( hooks && hooks.stop ) {
n@1116 6800 hooks.stop.call( this, true );
n@1116 6801 }
n@1116 6802
n@1116 6803 // Look for any active animations, and finish them
n@1116 6804 for ( index = timers.length; index--; ) {
n@1116 6805 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
n@1116 6806 timers[ index ].anim.stop( true );
n@1116 6807 timers.splice( index, 1 );
n@1116 6808 }
n@1116 6809 }
n@1116 6810
n@1116 6811 // Look for any animations in the old queue and finish them
n@1116 6812 for ( index = 0; index < length; index++ ) {
n@1116 6813 if ( queue[ index ] && queue[ index ].finish ) {
n@1116 6814 queue[ index ].finish.call( this );
n@1116 6815 }
n@1116 6816 }
n@1116 6817
n@1116 6818 // Turn off finishing flag
n@1116 6819 delete data.finish;
n@1116 6820 });
n@1116 6821 }
n@1116 6822 });
n@1116 6823
n@1116 6824 jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
n@1116 6825 var cssFn = jQuery.fn[ name ];
n@1116 6826 jQuery.fn[ name ] = function( speed, easing, callback ) {
n@1116 6827 return speed == null || typeof speed === "boolean" ?
n@1116 6828 cssFn.apply( this, arguments ) :
n@1116 6829 this.animate( genFx( name, true ), speed, easing, callback );
n@1116 6830 };
n@1116 6831 });
n@1116 6832
n@1116 6833 // Generate shortcuts for custom animations
n@1116 6834 jQuery.each({
n@1116 6835 slideDown: genFx("show"),
n@1116 6836 slideUp: genFx("hide"),
n@1116 6837 slideToggle: genFx("toggle"),
n@1116 6838 fadeIn: { opacity: "show" },
n@1116 6839 fadeOut: { opacity: "hide" },
n@1116 6840 fadeToggle: { opacity: "toggle" }
n@1116 6841 }, function( name, props ) {
n@1116 6842 jQuery.fn[ name ] = function( speed, easing, callback ) {
n@1116 6843 return this.animate( props, speed, easing, callback );
n@1116 6844 };
n@1116 6845 });
n@1116 6846
n@1116 6847 jQuery.timers = [];
n@1116 6848 jQuery.fx.tick = function() {
n@1116 6849 var timer,
n@1116 6850 i = 0,
n@1116 6851 timers = jQuery.timers;
n@1116 6852
n@1116 6853 fxNow = jQuery.now();
n@1116 6854
n@1116 6855 for ( ; i < timers.length; i++ ) {
n@1116 6856 timer = timers[ i ];
n@1116 6857 // Checks the timer has not already been removed
n@1116 6858 if ( !timer() && timers[ i ] === timer ) {
n@1116 6859 timers.splice( i--, 1 );
n@1116 6860 }
n@1116 6861 }
n@1116 6862
n@1116 6863 if ( !timers.length ) {
n@1116 6864 jQuery.fx.stop();
n@1116 6865 }
n@1116 6866 fxNow = undefined;
n@1116 6867 };
n@1116 6868
n@1116 6869 jQuery.fx.timer = function( timer ) {
n@1116 6870 jQuery.timers.push( timer );
n@1116 6871 if ( timer() ) {
n@1116 6872 jQuery.fx.start();
n@1116 6873 } else {
n@1116 6874 jQuery.timers.pop();
n@1116 6875 }
n@1116 6876 };
n@1116 6877
n@1116 6878 jQuery.fx.interval = 13;
n@1116 6879
n@1116 6880 jQuery.fx.start = function() {
n@1116 6881 if ( !timerId ) {
n@1116 6882 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
n@1116 6883 }
n@1116 6884 };
n@1116 6885
n@1116 6886 jQuery.fx.stop = function() {
n@1116 6887 clearInterval( timerId );
n@1116 6888 timerId = null;
n@1116 6889 };
n@1116 6890
n@1116 6891 jQuery.fx.speeds = {
n@1116 6892 slow: 600,
n@1116 6893 fast: 200,
n@1116 6894 // Default speed
n@1116 6895 _default: 400
n@1116 6896 };
n@1116 6897
n@1116 6898
n@1116 6899 // Based off of the plugin by Clint Helfers, with permission.
n@1116 6900 // http://blindsignals.com/index.php/2009/07/jquery-delay/
n@1116 6901 jQuery.fn.delay = function( time, type ) {
n@1116 6902 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
n@1116 6903 type = type || "fx";
n@1116 6904
n@1116 6905 return this.queue( type, function( next, hooks ) {
n@1116 6906 var timeout = setTimeout( next, time );
n@1116 6907 hooks.stop = function() {
n@1116 6908 clearTimeout( timeout );
n@1116 6909 };
n@1116 6910 });
n@1116 6911 };
n@1116 6912
n@1116 6913
n@1116 6914 (function() {
n@1116 6915 var input = document.createElement( "input" ),
n@1116 6916 select = document.createElement( "select" ),
n@1116 6917 opt = select.appendChild( document.createElement( "option" ) );
n@1116 6918
n@1116 6919 input.type = "checkbox";
n@1116 6920
n@1116 6921 // Support: iOS<=5.1, Android<=4.2+
n@1116 6922 // Default value for a checkbox should be "on"
n@1116 6923 support.checkOn = input.value !== "";
n@1116 6924
n@1116 6925 // Support: IE<=11+
n@1116 6926 // Must access selectedIndex to make default options select
n@1116 6927 support.optSelected = opt.selected;
n@1116 6928
n@1116 6929 // Support: Android<=2.3
n@1116 6930 // Options inside disabled selects are incorrectly marked as disabled
n@1116 6931 select.disabled = true;
n@1116 6932 support.optDisabled = !opt.disabled;
n@1116 6933
n@1116 6934 // Support: IE<=11+
n@1116 6935 // An input loses its value after becoming a radio
n@1116 6936 input = document.createElement( "input" );
n@1116 6937 input.value = "t";
n@1116 6938 input.type = "radio";
n@1116 6939 support.radioValue = input.value === "t";
n@1116 6940 })();
n@1116 6941
n@1116 6942
n@1116 6943 var nodeHook, boolHook,
n@1116 6944 attrHandle = jQuery.expr.attrHandle;
n@1116 6945
n@1116 6946 jQuery.fn.extend({
n@1116 6947 attr: function( name, value ) {
n@1116 6948 return access( this, jQuery.attr, name, value, arguments.length > 1 );
n@1116 6949 },
n@1116 6950
n@1116 6951 removeAttr: function( name ) {
n@1116 6952 return this.each(function() {
n@1116 6953 jQuery.removeAttr( this, name );
n@1116 6954 });
n@1116 6955 }
n@1116 6956 });
n@1116 6957
n@1116 6958 jQuery.extend({
n@1116 6959 attr: function( elem, name, value ) {
n@1116 6960 var hooks, ret,
n@1116 6961 nType = elem.nodeType;
n@1116 6962
n@1116 6963 // don't get/set attributes on text, comment and attribute nodes
n@1116 6964 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
n@1116 6965 return;
n@1116 6966 }
n@1116 6967
n@1116 6968 // Fallback to prop when attributes are not supported
n@1116 6969 if ( typeof elem.getAttribute === strundefined ) {
n@1116 6970 return jQuery.prop( elem, name, value );
n@1116 6971 }
n@1116 6972
n@1116 6973 // All attributes are lowercase
n@1116 6974 // Grab necessary hook if one is defined
n@1116 6975 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
n@1116 6976 name = name.toLowerCase();
n@1116 6977 hooks = jQuery.attrHooks[ name ] ||
n@1116 6978 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
n@1116 6979 }
n@1116 6980
n@1116 6981 if ( value !== undefined ) {
n@1116 6982
n@1116 6983 if ( value === null ) {
n@1116 6984 jQuery.removeAttr( elem, name );
n@1116 6985
n@1116 6986 } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
n@1116 6987 return ret;
n@1116 6988
n@1116 6989 } else {
n@1116 6990 elem.setAttribute( name, value + "" );
n@1116 6991 return value;
n@1116 6992 }
n@1116 6993
n@1116 6994 } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
n@1116 6995 return ret;
n@1116 6996
n@1116 6997 } else {
n@1116 6998 ret = jQuery.find.attr( elem, name );
n@1116 6999
n@1116 7000 // Non-existent attributes return null, we normalize to undefined
n@1116 7001 return ret == null ?
n@1116 7002 undefined :
n@1116 7003 ret;
n@1116 7004 }
n@1116 7005 },
n@1116 7006
n@1116 7007 removeAttr: function( elem, value ) {
n@1116 7008 var name, propName,
n@1116 7009 i = 0,
n@1116 7010 attrNames = value && value.match( rnotwhite );
n@1116 7011
n@1116 7012 if ( attrNames && elem.nodeType === 1 ) {
n@1116 7013 while ( (name = attrNames[i++]) ) {
n@1116 7014 propName = jQuery.propFix[ name ] || name;
n@1116 7015
n@1116 7016 // Boolean attributes get special treatment (#10870)
n@1116 7017 if ( jQuery.expr.match.bool.test( name ) ) {
n@1116 7018 // Set corresponding property to false
n@1116 7019 elem[ propName ] = false;
n@1116 7020 }
n@1116 7021
n@1116 7022 elem.removeAttribute( name );
n@1116 7023 }
n@1116 7024 }
n@1116 7025 },
n@1116 7026
n@1116 7027 attrHooks: {
n@1116 7028 type: {
n@1116 7029 set: function( elem, value ) {
n@1116 7030 if ( !support.radioValue && value === "radio" &&
n@1116 7031 jQuery.nodeName( elem, "input" ) ) {
n@1116 7032 var val = elem.value;
n@1116 7033 elem.setAttribute( "type", value );
n@1116 7034 if ( val ) {
n@1116 7035 elem.value = val;
n@1116 7036 }
n@1116 7037 return value;
n@1116 7038 }
n@1116 7039 }
n@1116 7040 }
n@1116 7041 }
n@1116 7042 });
n@1116 7043
n@1116 7044 // Hooks for boolean attributes
n@1116 7045 boolHook = {
n@1116 7046 set: function( elem, value, name ) {
n@1116 7047 if ( value === false ) {
n@1116 7048 // Remove boolean attributes when set to false
n@1116 7049 jQuery.removeAttr( elem, name );
n@1116 7050 } else {
n@1116 7051 elem.setAttribute( name, name );
n@1116 7052 }
n@1116 7053 return name;
n@1116 7054 }
n@1116 7055 };
n@1116 7056 jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
n@1116 7057 var getter = attrHandle[ name ] || jQuery.find.attr;
n@1116 7058
n@1116 7059 attrHandle[ name ] = function( elem, name, isXML ) {
n@1116 7060 var ret, handle;
n@1116 7061 if ( !isXML ) {
n@1116 7062 // Avoid an infinite loop by temporarily removing this function from the getter
n@1116 7063 handle = attrHandle[ name ];
n@1116 7064 attrHandle[ name ] = ret;
n@1116 7065 ret = getter( elem, name, isXML ) != null ?
n@1116 7066 name.toLowerCase() :
n@1116 7067 null;
n@1116 7068 attrHandle[ name ] = handle;
n@1116 7069 }
n@1116 7070 return ret;
n@1116 7071 };
n@1116 7072 });
n@1116 7073
n@1116 7074
n@1116 7075
n@1116 7076
n@1116 7077 var rfocusable = /^(?:input|select|textarea|button)$/i;
n@1116 7078
n@1116 7079 jQuery.fn.extend({
n@1116 7080 prop: function( name, value ) {
n@1116 7081 return access( this, jQuery.prop, name, value, arguments.length > 1 );
n@1116 7082 },
n@1116 7083
n@1116 7084 removeProp: function( name ) {
n@1116 7085 return this.each(function() {
n@1116 7086 delete this[ jQuery.propFix[ name ] || name ];
n@1116 7087 });
n@1116 7088 }
n@1116 7089 });
n@1116 7090
n@1116 7091 jQuery.extend({
n@1116 7092 propFix: {
n@1116 7093 "for": "htmlFor",
n@1116 7094 "class": "className"
n@1116 7095 },
n@1116 7096
n@1116 7097 prop: function( elem, name, value ) {
n@1116 7098 var ret, hooks, notxml,
n@1116 7099 nType = elem.nodeType;
n@1116 7100
n@1116 7101 // Don't get/set properties on text, comment and attribute nodes
n@1116 7102 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
n@1116 7103 return;
n@1116 7104 }
n@1116 7105
n@1116 7106 notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
n@1116 7107
n@1116 7108 if ( notxml ) {
n@1116 7109 // Fix name and attach hooks
n@1116 7110 name = jQuery.propFix[ name ] || name;
n@1116 7111 hooks = jQuery.propHooks[ name ];
n@1116 7112 }
n@1116 7113
n@1116 7114 if ( value !== undefined ) {
n@1116 7115 return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
n@1116 7116 ret :
n@1116 7117 ( elem[ name ] = value );
n@1116 7118
n@1116 7119 } else {
n@1116 7120 return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
n@1116 7121 ret :
n@1116 7122 elem[ name ];
n@1116 7123 }
n@1116 7124 },
n@1116 7125
n@1116 7126 propHooks: {
n@1116 7127 tabIndex: {
n@1116 7128 get: function( elem ) {
n@1116 7129 return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
n@1116 7130 elem.tabIndex :
n@1116 7131 -1;
n@1116 7132 }
n@1116 7133 }
n@1116 7134 }
n@1116 7135 });
n@1116 7136
n@1116 7137 if ( !support.optSelected ) {
n@1116 7138 jQuery.propHooks.selected = {
n@1116 7139 get: function( elem ) {
n@1116 7140 var parent = elem.parentNode;
n@1116 7141 if ( parent && parent.parentNode ) {
n@1116 7142 parent.parentNode.selectedIndex;
n@1116 7143 }
n@1116 7144 return null;
n@1116 7145 }
n@1116 7146 };
n@1116 7147 }
n@1116 7148
n@1116 7149 jQuery.each([
n@1116 7150 "tabIndex",
n@1116 7151 "readOnly",
n@1116 7152 "maxLength",
n@1116 7153 "cellSpacing",
n@1116 7154 "cellPadding",
n@1116 7155 "rowSpan",
n@1116 7156 "colSpan",
n@1116 7157 "useMap",
n@1116 7158 "frameBorder",
n@1116 7159 "contentEditable"
n@1116 7160 ], function() {
n@1116 7161 jQuery.propFix[ this.toLowerCase() ] = this;
n@1116 7162 });
n@1116 7163
n@1116 7164
n@1116 7165
n@1116 7166
n@1116 7167 var rclass = /[\t\r\n\f]/g;
n@1116 7168
n@1116 7169 jQuery.fn.extend({
n@1116 7170 addClass: function( value ) {
n@1116 7171 var classes, elem, cur, clazz, j, finalValue,
n@1116 7172 proceed = typeof value === "string" && value,
n@1116 7173 i = 0,
n@1116 7174 len = this.length;
n@1116 7175
n@1116 7176 if ( jQuery.isFunction( value ) ) {
n@1116 7177 return this.each(function( j ) {
n@1116 7178 jQuery( this ).addClass( value.call( this, j, this.className ) );
n@1116 7179 });
n@1116 7180 }
n@1116 7181
n@1116 7182 if ( proceed ) {
n@1116 7183 // The disjunction here is for better compressibility (see removeClass)
n@1116 7184 classes = ( value || "" ).match( rnotwhite ) || [];
n@1116 7185
n@1116 7186 for ( ; i < len; i++ ) {
n@1116 7187 elem = this[ i ];
n@1116 7188 cur = elem.nodeType === 1 && ( elem.className ?
n@1116 7189 ( " " + elem.className + " " ).replace( rclass, " " ) :
n@1116 7190 " "
n@1116 7191 );
n@1116 7192
n@1116 7193 if ( cur ) {
n@1116 7194 j = 0;
n@1116 7195 while ( (clazz = classes[j++]) ) {
n@1116 7196 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
n@1116 7197 cur += clazz + " ";
n@1116 7198 }
n@1116 7199 }
n@1116 7200
n@1116 7201 // only assign if different to avoid unneeded rendering.
n@1116 7202 finalValue = jQuery.trim( cur );
n@1116 7203 if ( elem.className !== finalValue ) {
n@1116 7204 elem.className = finalValue;
n@1116 7205 }
n@1116 7206 }
n@1116 7207 }
n@1116 7208 }
n@1116 7209
n@1116 7210 return this;
n@1116 7211 },
n@1116 7212
n@1116 7213 removeClass: function( value ) {
n@1116 7214 var classes, elem, cur, clazz, j, finalValue,
n@1116 7215 proceed = arguments.length === 0 || typeof value === "string" && value,
n@1116 7216 i = 0,
n@1116 7217 len = this.length;
n@1116 7218
n@1116 7219 if ( jQuery.isFunction( value ) ) {
n@1116 7220 return this.each(function( j ) {
n@1116 7221 jQuery( this ).removeClass( value.call( this, j, this.className ) );
n@1116 7222 });
n@1116 7223 }
n@1116 7224 if ( proceed ) {
n@1116 7225 classes = ( value || "" ).match( rnotwhite ) || [];
n@1116 7226
n@1116 7227 for ( ; i < len; i++ ) {
n@1116 7228 elem = this[ i ];
n@1116 7229 // This expression is here for better compressibility (see addClass)
n@1116 7230 cur = elem.nodeType === 1 && ( elem.className ?
n@1116 7231 ( " " + elem.className + " " ).replace( rclass, " " ) :
n@1116 7232 ""
n@1116 7233 );
n@1116 7234
n@1116 7235 if ( cur ) {
n@1116 7236 j = 0;
n@1116 7237 while ( (clazz = classes[j++]) ) {
n@1116 7238 // Remove *all* instances
n@1116 7239 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
n@1116 7240 cur = cur.replace( " " + clazz + " ", " " );
n@1116 7241 }
n@1116 7242 }
n@1116 7243
n@1116 7244 // Only assign if different to avoid unneeded rendering.
n@1116 7245 finalValue = value ? jQuery.trim( cur ) : "";
n@1116 7246 if ( elem.className !== finalValue ) {
n@1116 7247 elem.className = finalValue;
n@1116 7248 }
n@1116 7249 }
n@1116 7250 }
n@1116 7251 }
n@1116 7252
n@1116 7253 return this;
n@1116 7254 },
n@1116 7255
n@1116 7256 toggleClass: function( value, stateVal ) {
n@1116 7257 var type = typeof value;
n@1116 7258
n@1116 7259 if ( typeof stateVal === "boolean" && type === "string" ) {
n@1116 7260 return stateVal ? this.addClass( value ) : this.removeClass( value );
n@1116 7261 }
n@1116 7262
n@1116 7263 if ( jQuery.isFunction( value ) ) {
n@1116 7264 return this.each(function( i ) {
n@1116 7265 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
n@1116 7266 });
n@1116 7267 }
n@1116 7268
n@1116 7269 return this.each(function() {
n@1116 7270 if ( type === "string" ) {
n@1116 7271 // Toggle individual class names
n@1116 7272 var className,
n@1116 7273 i = 0,
n@1116 7274 self = jQuery( this ),
n@1116 7275 classNames = value.match( rnotwhite ) || [];
n@1116 7276
n@1116 7277 while ( (className = classNames[ i++ ]) ) {
n@1116 7278 // Check each className given, space separated list
n@1116 7279 if ( self.hasClass( className ) ) {
n@1116 7280 self.removeClass( className );
n@1116 7281 } else {
n@1116 7282 self.addClass( className );
n@1116 7283 }
n@1116 7284 }
n@1116 7285
n@1116 7286 // Toggle whole class name
n@1116 7287 } else if ( type === strundefined || type === "boolean" ) {
n@1116 7288 if ( this.className ) {
n@1116 7289 // store className if set
n@1116 7290 data_priv.set( this, "__className__", this.className );
n@1116 7291 }
n@1116 7292
n@1116 7293 // If the element has a class name or if we're passed `false`,
n@1116 7294 // then remove the whole classname (if there was one, the above saved it).
n@1116 7295 // Otherwise bring back whatever was previously saved (if anything),
n@1116 7296 // falling back to the empty string if nothing was stored.
n@1116 7297 this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
n@1116 7298 }
n@1116 7299 });
n@1116 7300 },
n@1116 7301
n@1116 7302 hasClass: function( selector ) {
n@1116 7303 var className = " " + selector + " ",
n@1116 7304 i = 0,
n@1116 7305 l = this.length;
n@1116 7306 for ( ; i < l; i++ ) {
n@1116 7307 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
n@1116 7308 return true;
n@1116 7309 }
n@1116 7310 }
n@1116 7311
n@1116 7312 return false;
n@1116 7313 }
n@1116 7314 });
n@1116 7315
n@1116 7316
n@1116 7317
n@1116 7318
n@1116 7319 var rreturn = /\r/g;
n@1116 7320
n@1116 7321 jQuery.fn.extend({
n@1116 7322 val: function( value ) {
n@1116 7323 var hooks, ret, isFunction,
n@1116 7324 elem = this[0];
n@1116 7325
n@1116 7326 if ( !arguments.length ) {
n@1116 7327 if ( elem ) {
n@1116 7328 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
n@1116 7329
n@1116 7330 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
n@1116 7331 return ret;
n@1116 7332 }
n@1116 7333
n@1116 7334 ret = elem.value;
n@1116 7335
n@1116 7336 return typeof ret === "string" ?
n@1116 7337 // Handle most common string cases
n@1116 7338 ret.replace(rreturn, "") :
n@1116 7339 // Handle cases where value is null/undef or number
n@1116 7340 ret == null ? "" : ret;
n@1116 7341 }
n@1116 7342
n@1116 7343 return;
n@1116 7344 }
n@1116 7345
n@1116 7346 isFunction = jQuery.isFunction( value );
n@1116 7347
n@1116 7348 return this.each(function( i ) {
n@1116 7349 var val;
n@1116 7350
n@1116 7351 if ( this.nodeType !== 1 ) {
n@1116 7352 return;
n@1116 7353 }
n@1116 7354
n@1116 7355 if ( isFunction ) {
n@1116 7356 val = value.call( this, i, jQuery( this ).val() );
n@1116 7357 } else {
n@1116 7358 val = value;
n@1116 7359 }
n@1116 7360
n@1116 7361 // Treat null/undefined as ""; convert numbers to string
n@1116 7362 if ( val == null ) {
n@1116 7363 val = "";
n@1116 7364
n@1116 7365 } else if ( typeof val === "number" ) {
n@1116 7366 val += "";
n@1116 7367
n@1116 7368 } else if ( jQuery.isArray( val ) ) {
n@1116 7369 val = jQuery.map( val, function( value ) {
n@1116 7370 return value == null ? "" : value + "";
n@1116 7371 });
n@1116 7372 }
n@1116 7373
n@1116 7374 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
n@1116 7375
n@1116 7376 // If set returns undefined, fall back to normal setting
n@1116 7377 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
n@1116 7378 this.value = val;
n@1116 7379 }
n@1116 7380 });
n@1116 7381 }
n@1116 7382 });
n@1116 7383
n@1116 7384 jQuery.extend({
n@1116 7385 valHooks: {
n@1116 7386 option: {
n@1116 7387 get: function( elem ) {
n@1116 7388 var val = jQuery.find.attr( elem, "value" );
n@1116 7389 return val != null ?
n@1116 7390 val :
n@1116 7391 // Support: IE10-11+
n@1116 7392 // option.text throws exceptions (#14686, #14858)
n@1116 7393 jQuery.trim( jQuery.text( elem ) );
n@1116 7394 }
n@1116 7395 },
n@1116 7396 select: {
n@1116 7397 get: function( elem ) {
n@1116 7398 var value, option,
n@1116 7399 options = elem.options,
n@1116 7400 index = elem.selectedIndex,
n@1116 7401 one = elem.type === "select-one" || index < 0,
n@1116 7402 values = one ? null : [],
n@1116 7403 max = one ? index + 1 : options.length,
n@1116 7404 i = index < 0 ?
n@1116 7405 max :
n@1116 7406 one ? index : 0;
n@1116 7407
n@1116 7408 // Loop through all the selected options
n@1116 7409 for ( ; i < max; i++ ) {
n@1116 7410 option = options[ i ];
n@1116 7411
n@1116 7412 // IE6-9 doesn't update selected after form reset (#2551)
n@1116 7413 if ( ( option.selected || i === index ) &&
n@1116 7414 // Don't return options that are disabled or in a disabled optgroup
n@1116 7415 ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
n@1116 7416 ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
n@1116 7417
n@1116 7418 // Get the specific value for the option
n@1116 7419 value = jQuery( option ).val();
n@1116 7420
n@1116 7421 // We don't need an array for one selects
n@1116 7422 if ( one ) {
n@1116 7423 return value;
n@1116 7424 }
n@1116 7425
n@1116 7426 // Multi-Selects return an array
n@1116 7427 values.push( value );
n@1116 7428 }
n@1116 7429 }
n@1116 7430
n@1116 7431 return values;
n@1116 7432 },
n@1116 7433
n@1116 7434 set: function( elem, value ) {
n@1116 7435 var optionSet, option,
n@1116 7436 options = elem.options,
n@1116 7437 values = jQuery.makeArray( value ),
n@1116 7438 i = options.length;
n@1116 7439
n@1116 7440 while ( i-- ) {
n@1116 7441 option = options[ i ];
n@1116 7442 if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
n@1116 7443 optionSet = true;
n@1116 7444 }
n@1116 7445 }
n@1116 7446
n@1116 7447 // Force browsers to behave consistently when non-matching value is set
n@1116 7448 if ( !optionSet ) {
n@1116 7449 elem.selectedIndex = -1;
n@1116 7450 }
n@1116 7451 return values;
n@1116 7452 }
n@1116 7453 }
n@1116 7454 }
n@1116 7455 });
n@1116 7456
n@1116 7457 // Radios and checkboxes getter/setter
n@1116 7458 jQuery.each([ "radio", "checkbox" ], function() {
n@1116 7459 jQuery.valHooks[ this ] = {
n@1116 7460 set: function( elem, value ) {
n@1116 7461 if ( jQuery.isArray( value ) ) {
n@1116 7462 return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
n@1116 7463 }
n@1116 7464 }
n@1116 7465 };
n@1116 7466 if ( !support.checkOn ) {
n@1116 7467 jQuery.valHooks[ this ].get = function( elem ) {
n@1116 7468 return elem.getAttribute("value") === null ? "on" : elem.value;
n@1116 7469 };
n@1116 7470 }
n@1116 7471 });
n@1116 7472
n@1116 7473
n@1116 7474
n@1116 7475
n@1116 7476 // Return jQuery for attributes-only inclusion
n@1116 7477
n@1116 7478
n@1116 7479 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
n@1116 7480 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
n@1116 7481 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
n@1116 7482
n@1116 7483 // Handle event binding
n@1116 7484 jQuery.fn[ name ] = function( data, fn ) {
n@1116 7485 return arguments.length > 0 ?
n@1116 7486 this.on( name, null, data, fn ) :
n@1116 7487 this.trigger( name );
n@1116 7488 };
n@1116 7489 });
n@1116 7490
n@1116 7491 jQuery.fn.extend({
n@1116 7492 hover: function( fnOver, fnOut ) {
n@1116 7493 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
n@1116 7494 },
n@1116 7495
n@1116 7496 bind: function( types, data, fn ) {
n@1116 7497 return this.on( types, null, data, fn );
n@1116 7498 },
n@1116 7499 unbind: function( types, fn ) {
n@1116 7500 return this.off( types, null, fn );
n@1116 7501 },
n@1116 7502
n@1116 7503 delegate: function( selector, types, data, fn ) {
n@1116 7504 return this.on( types, selector, data, fn );
n@1116 7505 },
n@1116 7506 undelegate: function( selector, types, fn ) {
n@1116 7507 // ( namespace ) or ( selector, types [, fn] )
n@1116 7508 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
n@1116 7509 }
n@1116 7510 });
n@1116 7511
n@1116 7512
n@1116 7513 var nonce = jQuery.now();
n@1116 7514
n@1116 7515 var rquery = (/\?/);
n@1116 7516
n@1116 7517
n@1116 7518
n@1116 7519 // Support: Android 2.3
n@1116 7520 // Workaround failure to string-cast null input
n@1116 7521 jQuery.parseJSON = function( data ) {
n@1116 7522 return JSON.parse( data + "" );
n@1116 7523 };
n@1116 7524
n@1116 7525
n@1116 7526 // Cross-browser xml parsing
n@1116 7527 jQuery.parseXML = function( data ) {
n@1116 7528 var xml, tmp;
n@1116 7529 if ( !data || typeof data !== "string" ) {
n@1116 7530 return null;
n@1116 7531 }
n@1116 7532
n@1116 7533 // Support: IE9
n@1116 7534 try {
n@1116 7535 tmp = new DOMParser();
n@1116 7536 xml = tmp.parseFromString( data, "text/xml" );
n@1116 7537 } catch ( e ) {
n@1116 7538 xml = undefined;
n@1116 7539 }
n@1116 7540
n@1116 7541 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
n@1116 7542 jQuery.error( "Invalid XML: " + data );
n@1116 7543 }
n@1116 7544 return xml;
n@1116 7545 };
n@1116 7546
n@1116 7547
n@1116 7548 var
n@1116 7549 rhash = /#.*$/,
n@1116 7550 rts = /([?&])_=[^&]*/,
n@1116 7551 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
n@1116 7552 // #7653, #8125, #8152: local protocol detection
n@1116 7553 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
n@1116 7554 rnoContent = /^(?:GET|HEAD)$/,
n@1116 7555 rprotocol = /^\/\//,
n@1116 7556 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
n@1116 7557
n@1116 7558 /* Prefilters
n@1116 7559 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
n@1116 7560 * 2) These are called:
n@1116 7561 * - BEFORE asking for a transport
n@1116 7562 * - AFTER param serialization (s.data is a string if s.processData is true)
n@1116 7563 * 3) key is the dataType
n@1116 7564 * 4) the catchall symbol "*" can be used
n@1116 7565 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
n@1116 7566 */
n@1116 7567 prefilters = {},
n@1116 7568
n@1116 7569 /* Transports bindings
n@1116 7570 * 1) key is the dataType
n@1116 7571 * 2) the catchall symbol "*" can be used
n@1116 7572 * 3) selection will start with transport dataType and THEN go to "*" if needed
n@1116 7573 */
n@1116 7574 transports = {},
n@1116 7575
n@1116 7576 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
n@1116 7577 allTypes = "*/".concat( "*" ),
n@1116 7578
n@1116 7579 // Document location
n@1116 7580 ajaxLocation = window.location.href,
n@1116 7581
n@1116 7582 // Segment location into parts
n@1116 7583 ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
n@1116 7584
n@1116 7585 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
n@1116 7586 function addToPrefiltersOrTransports( structure ) {
n@1116 7587
n@1116 7588 // dataTypeExpression is optional and defaults to "*"
n@1116 7589 return function( dataTypeExpression, func ) {
n@1116 7590
n@1116 7591 if ( typeof dataTypeExpression !== "string" ) {
n@1116 7592 func = dataTypeExpression;
n@1116 7593 dataTypeExpression = "*";
n@1116 7594 }
n@1116 7595
n@1116 7596 var dataType,
n@1116 7597 i = 0,
n@1116 7598 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
n@1116 7599
n@1116 7600 if ( jQuery.isFunction( func ) ) {
n@1116 7601 // For each dataType in the dataTypeExpression
n@1116 7602 while ( (dataType = dataTypes[i++]) ) {
n@1116 7603 // Prepend if requested
n@1116 7604 if ( dataType[0] === "+" ) {
n@1116 7605 dataType = dataType.slice( 1 ) || "*";
n@1116 7606 (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
n@1116 7607
n@1116 7608 // Otherwise append
n@1116 7609 } else {
n@1116 7610 (structure[ dataType ] = structure[ dataType ] || []).push( func );
n@1116 7611 }
n@1116 7612 }
n@1116 7613 }
n@1116 7614 };
n@1116 7615 }
n@1116 7616
n@1116 7617 // Base inspection function for prefilters and transports
n@1116 7618 function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
n@1116 7619
n@1116 7620 var inspected = {},
n@1116 7621 seekingTransport = ( structure === transports );
n@1116 7622
n@1116 7623 function inspect( dataType ) {
n@1116 7624 var selected;
n@1116 7625 inspected[ dataType ] = true;
n@1116 7626 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
n@1116 7627 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
n@1116 7628 if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
n@1116 7629 options.dataTypes.unshift( dataTypeOrTransport );
n@1116 7630 inspect( dataTypeOrTransport );
n@1116 7631 return false;
n@1116 7632 } else if ( seekingTransport ) {
n@1116 7633 return !( selected = dataTypeOrTransport );
n@1116 7634 }
n@1116 7635 });
n@1116 7636 return selected;
n@1116 7637 }
n@1116 7638
n@1116 7639 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
n@1116 7640 }
n@1116 7641
n@1116 7642 // A special extend for ajax options
n@1116 7643 // that takes "flat" options (not to be deep extended)
n@1116 7644 // Fixes #9887
n@1116 7645 function ajaxExtend( target, src ) {
n@1116 7646 var key, deep,
n@1116 7647 flatOptions = jQuery.ajaxSettings.flatOptions || {};
n@1116 7648
n@1116 7649 for ( key in src ) {
n@1116 7650 if ( src[ key ] !== undefined ) {
n@1116 7651 ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
n@1116 7652 }
n@1116 7653 }
n@1116 7654 if ( deep ) {
n@1116 7655 jQuery.extend( true, target, deep );
n@1116 7656 }
n@1116 7657
n@1116 7658 return target;
n@1116 7659 }
n@1116 7660
n@1116 7661 /* Handles responses to an ajax request:
n@1116 7662 * - finds the right dataType (mediates between content-type and expected dataType)
n@1116 7663 * - returns the corresponding response
n@1116 7664 */
n@1116 7665 function ajaxHandleResponses( s, jqXHR, responses ) {
n@1116 7666
n@1116 7667 var ct, type, finalDataType, firstDataType,
n@1116 7668 contents = s.contents,
n@1116 7669 dataTypes = s.dataTypes;
n@1116 7670
n@1116 7671 // Remove auto dataType and get content-type in the process
n@1116 7672 while ( dataTypes[ 0 ] === "*" ) {
n@1116 7673 dataTypes.shift();
n@1116 7674 if ( ct === undefined ) {
n@1116 7675 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
n@1116 7676 }
n@1116 7677 }
n@1116 7678
n@1116 7679 // Check if we're dealing with a known content-type
n@1116 7680 if ( ct ) {
n@1116 7681 for ( type in contents ) {
n@1116 7682 if ( contents[ type ] && contents[ type ].test( ct ) ) {
n@1116 7683 dataTypes.unshift( type );
n@1116 7684 break;
n@1116 7685 }
n@1116 7686 }
n@1116 7687 }
n@1116 7688
n@1116 7689 // Check to see if we have a response for the expected dataType
n@1116 7690 if ( dataTypes[ 0 ] in responses ) {
n@1116 7691 finalDataType = dataTypes[ 0 ];
n@1116 7692 } else {
n@1116 7693 // Try convertible dataTypes
n@1116 7694 for ( type in responses ) {
n@1116 7695 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
n@1116 7696 finalDataType = type;
n@1116 7697 break;
n@1116 7698 }
n@1116 7699 if ( !firstDataType ) {
n@1116 7700 firstDataType = type;
n@1116 7701 }
n@1116 7702 }
n@1116 7703 // Or just use first one
n@1116 7704 finalDataType = finalDataType || firstDataType;
n@1116 7705 }
n@1116 7706
n@1116 7707 // If we found a dataType
n@1116 7708 // We add the dataType to the list if needed
n@1116 7709 // and return the corresponding response
n@1116 7710 if ( finalDataType ) {
n@1116 7711 if ( finalDataType !== dataTypes[ 0 ] ) {
n@1116 7712 dataTypes.unshift( finalDataType );
n@1116 7713 }
n@1116 7714 return responses[ finalDataType ];
n@1116 7715 }
n@1116 7716 }
n@1116 7717
n@1116 7718 /* Chain conversions given the request and the original response
n@1116 7719 * Also sets the responseXXX fields on the jqXHR instance
n@1116 7720 */
n@1116 7721 function ajaxConvert( s, response, jqXHR, isSuccess ) {
n@1116 7722 var conv2, current, conv, tmp, prev,
n@1116 7723 converters = {},
n@1116 7724 // Work with a copy of dataTypes in case we need to modify it for conversion
n@1116 7725 dataTypes = s.dataTypes.slice();
n@1116 7726
n@1116 7727 // Create converters map with lowercased keys
n@1116 7728 if ( dataTypes[ 1 ] ) {
n@1116 7729 for ( conv in s.converters ) {
n@1116 7730 converters[ conv.toLowerCase() ] = s.converters[ conv ];
n@1116 7731 }
n@1116 7732 }
n@1116 7733
n@1116 7734 current = dataTypes.shift();
n@1116 7735
n@1116 7736 // Convert to each sequential dataType
n@1116 7737 while ( current ) {
n@1116 7738
n@1116 7739 if ( s.responseFields[ current ] ) {
n@1116 7740 jqXHR[ s.responseFields[ current ] ] = response;
n@1116 7741 }
n@1116 7742
n@1116 7743 // Apply the dataFilter if provided
n@1116 7744 if ( !prev && isSuccess && s.dataFilter ) {
n@1116 7745 response = s.dataFilter( response, s.dataType );
n@1116 7746 }
n@1116 7747
n@1116 7748 prev = current;
n@1116 7749 current = dataTypes.shift();
n@1116 7750
n@1116 7751 if ( current ) {
n@1116 7752
n@1116 7753 // There's only work to do if current dataType is non-auto
n@1116 7754 if ( current === "*" ) {
n@1116 7755
n@1116 7756 current = prev;
n@1116 7757
n@1116 7758 // Convert response if prev dataType is non-auto and differs from current
n@1116 7759 } else if ( prev !== "*" && prev !== current ) {
n@1116 7760
n@1116 7761 // Seek a direct converter
n@1116 7762 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
n@1116 7763
n@1116 7764 // If none found, seek a pair
n@1116 7765 if ( !conv ) {
n@1116 7766 for ( conv2 in converters ) {
n@1116 7767
n@1116 7768 // If conv2 outputs current
n@1116 7769 tmp = conv2.split( " " );
n@1116 7770 if ( tmp[ 1 ] === current ) {
n@1116 7771
n@1116 7772 // If prev can be converted to accepted input
n@1116 7773 conv = converters[ prev + " " + tmp[ 0 ] ] ||
n@1116 7774 converters[ "* " + tmp[ 0 ] ];
n@1116 7775 if ( conv ) {
n@1116 7776 // Condense equivalence converters
n@1116 7777 if ( conv === true ) {
n@1116 7778 conv = converters[ conv2 ];
n@1116 7779
n@1116 7780 // Otherwise, insert the intermediate dataType
n@1116 7781 } else if ( converters[ conv2 ] !== true ) {
n@1116 7782 current = tmp[ 0 ];
n@1116 7783 dataTypes.unshift( tmp[ 1 ] );
n@1116 7784 }
n@1116 7785 break;
n@1116 7786 }
n@1116 7787 }
n@1116 7788 }
n@1116 7789 }
n@1116 7790
n@1116 7791 // Apply converter (if not an equivalence)
n@1116 7792 if ( conv !== true ) {
n@1116 7793
n@1116 7794 // Unless errors are allowed to bubble, catch and return them
n@1116 7795 if ( conv && s[ "throws" ] ) {
n@1116 7796 response = conv( response );
n@1116 7797 } else {
n@1116 7798 try {
n@1116 7799 response = conv( response );
n@1116 7800 } catch ( e ) {
n@1116 7801 return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
n@1116 7802 }
n@1116 7803 }
n@1116 7804 }
n@1116 7805 }
n@1116 7806 }
n@1116 7807 }
n@1116 7808
n@1116 7809 return { state: "success", data: response };
n@1116 7810 }
n@1116 7811
n@1116 7812 jQuery.extend({
n@1116 7813
n@1116 7814 // Counter for holding the number of active queries
n@1116 7815 active: 0,
n@1116 7816
n@1116 7817 // Last-Modified header cache for next request
n@1116 7818 lastModified: {},
n@1116 7819 etag: {},
n@1116 7820
n@1116 7821 ajaxSettings: {
n@1116 7822 url: ajaxLocation,
n@1116 7823 type: "GET",
n@1116 7824 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
n@1116 7825 global: true,
n@1116 7826 processData: true,
n@1116 7827 async: true,
n@1116 7828 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
n@1116 7829 /*
n@1116 7830 timeout: 0,
n@1116 7831 data: null,
n@1116 7832 dataType: null,
n@1116 7833 username: null,
n@1116 7834 password: null,
n@1116 7835 cache: null,
n@1116 7836 throws: false,
n@1116 7837 traditional: false,
n@1116 7838 headers: {},
n@1116 7839 */
n@1116 7840
n@1116 7841 accepts: {
n@1116 7842 "*": allTypes,
n@1116 7843 text: "text/plain",
n@1116 7844 html: "text/html",
n@1116 7845 xml: "application/xml, text/xml",
n@1116 7846 json: "application/json, text/javascript"
n@1116 7847 },
n@1116 7848
n@1116 7849 contents: {
n@1116 7850 xml: /xml/,
n@1116 7851 html: /html/,
n@1116 7852 json: /json/
n@1116 7853 },
n@1116 7854
n@1116 7855 responseFields: {
n@1116 7856 xml: "responseXML",
n@1116 7857 text: "responseText",
n@1116 7858 json: "responseJSON"
n@1116 7859 },
n@1116 7860
n@1116 7861 // Data converters
n@1116 7862 // Keys separate source (or catchall "*") and destination types with a single space
n@1116 7863 converters: {
n@1116 7864
n@1116 7865 // Convert anything to text
n@1116 7866 "* text": String,
n@1116 7867
n@1116 7868 // Text to html (true = no transformation)
n@1116 7869 "text html": true,
n@1116 7870
n@1116 7871 // Evaluate text as a json expression
n@1116 7872 "text json": jQuery.parseJSON,
n@1116 7873
n@1116 7874 // Parse text as xml
n@1116 7875 "text xml": jQuery.parseXML
n@1116 7876 },
n@1116 7877
n@1116 7878 // For options that shouldn't be deep extended:
n@1116 7879 // you can add your own custom options here if
n@1116 7880 // and when you create one that shouldn't be
n@1116 7881 // deep extended (see ajaxExtend)
n@1116 7882 flatOptions: {
n@1116 7883 url: true,
n@1116 7884 context: true
n@1116 7885 }
n@1116 7886 },
n@1116 7887
n@1116 7888 // Creates a full fledged settings object into target
n@1116 7889 // with both ajaxSettings and settings fields.
n@1116 7890 // If target is omitted, writes into ajaxSettings.
n@1116 7891 ajaxSetup: function( target, settings ) {
n@1116 7892 return settings ?
n@1116 7893
n@1116 7894 // Building a settings object
n@1116 7895 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
n@1116 7896
n@1116 7897 // Extending ajaxSettings
n@1116 7898 ajaxExtend( jQuery.ajaxSettings, target );
n@1116 7899 },
n@1116 7900
n@1116 7901 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
n@1116 7902 ajaxTransport: addToPrefiltersOrTransports( transports ),
n@1116 7903
n@1116 7904 // Main method
n@1116 7905 ajax: function( url, options ) {
n@1116 7906
n@1116 7907 // If url is an object, simulate pre-1.5 signature
n@1116 7908 if ( typeof url === "object" ) {
n@1116 7909 options = url;
n@1116 7910 url = undefined;
n@1116 7911 }
n@1116 7912
n@1116 7913 // Force options to be an object
n@1116 7914 options = options || {};
n@1116 7915
n@1116 7916 var transport,
n@1116 7917 // URL without anti-cache param
n@1116 7918 cacheURL,
n@1116 7919 // Response headers
n@1116 7920 responseHeadersString,
n@1116 7921 responseHeaders,
n@1116 7922 // timeout handle
n@1116 7923 timeoutTimer,
n@1116 7924 // Cross-domain detection vars
n@1116 7925 parts,
n@1116 7926 // To know if global events are to be dispatched
n@1116 7927 fireGlobals,
n@1116 7928 // Loop variable
n@1116 7929 i,
n@1116 7930 // Create the final options object
n@1116 7931 s = jQuery.ajaxSetup( {}, options ),
n@1116 7932 // Callbacks context
n@1116 7933 callbackContext = s.context || s,
n@1116 7934 // Context for global events is callbackContext if it is a DOM node or jQuery collection
n@1116 7935 globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
n@1116 7936 jQuery( callbackContext ) :
n@1116 7937 jQuery.event,
n@1116 7938 // Deferreds
n@1116 7939 deferred = jQuery.Deferred(),
n@1116 7940 completeDeferred = jQuery.Callbacks("once memory"),
n@1116 7941 // Status-dependent callbacks
n@1116 7942 statusCode = s.statusCode || {},
n@1116 7943 // Headers (they are sent all at once)
n@1116 7944 requestHeaders = {},
n@1116 7945 requestHeadersNames = {},
n@1116 7946 // The jqXHR state
n@1116 7947 state = 0,
n@1116 7948 // Default abort message
n@1116 7949 strAbort = "canceled",
n@1116 7950 // Fake xhr
n@1116 7951 jqXHR = {
n@1116 7952 readyState: 0,
n@1116 7953
n@1116 7954 // Builds headers hashtable if needed
n@1116 7955 getResponseHeader: function( key ) {
n@1116 7956 var match;
n@1116 7957 if ( state === 2 ) {
n@1116 7958 if ( !responseHeaders ) {
n@1116 7959 responseHeaders = {};
n@1116 7960 while ( (match = rheaders.exec( responseHeadersString )) ) {
n@1116 7961 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
n@1116 7962 }
n@1116 7963 }
n@1116 7964 match = responseHeaders[ key.toLowerCase() ];
n@1116 7965 }
n@1116 7966 return match == null ? null : match;
n@1116 7967 },
n@1116 7968
n@1116 7969 // Raw string
n@1116 7970 getAllResponseHeaders: function() {
n@1116 7971 return state === 2 ? responseHeadersString : null;
n@1116 7972 },
n@1116 7973
n@1116 7974 // Caches the header
n@1116 7975 setRequestHeader: function( name, value ) {
n@1116 7976 var lname = name.toLowerCase();
n@1116 7977 if ( !state ) {
n@1116 7978 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
n@1116 7979 requestHeaders[ name ] = value;
n@1116 7980 }
n@1116 7981 return this;
n@1116 7982 },
n@1116 7983
n@1116 7984 // Overrides response content-type header
n@1116 7985 overrideMimeType: function( type ) {
n@1116 7986 if ( !state ) {
n@1116 7987 s.mimeType = type;
n@1116 7988 }
n@1116 7989 return this;
n@1116 7990 },
n@1116 7991
n@1116 7992 // Status-dependent callbacks
n@1116 7993 statusCode: function( map ) {
n@1116 7994 var code;
n@1116 7995 if ( map ) {
n@1116 7996 if ( state < 2 ) {
n@1116 7997 for ( code in map ) {
n@1116 7998 // Lazy-add the new callback in a way that preserves old ones
n@1116 7999 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
n@1116 8000 }
n@1116 8001 } else {
n@1116 8002 // Execute the appropriate callbacks
n@1116 8003 jqXHR.always( map[ jqXHR.status ] );
n@1116 8004 }
n@1116 8005 }
n@1116 8006 return this;
n@1116 8007 },
n@1116 8008
n@1116 8009 // Cancel the request
n@1116 8010 abort: function( statusText ) {
n@1116 8011 var finalText = statusText || strAbort;
n@1116 8012 if ( transport ) {
n@1116 8013 transport.abort( finalText );
n@1116 8014 }
n@1116 8015 done( 0, finalText );
n@1116 8016 return this;
n@1116 8017 }
n@1116 8018 };
n@1116 8019
n@1116 8020 // Attach deferreds
n@1116 8021 deferred.promise( jqXHR ).complete = completeDeferred.add;
n@1116 8022 jqXHR.success = jqXHR.done;
n@1116 8023 jqXHR.error = jqXHR.fail;
n@1116 8024
n@1116 8025 // Remove hash character (#7531: and string promotion)
n@1116 8026 // Add protocol if not provided (prefilters might expect it)
n@1116 8027 // Handle falsy url in the settings object (#10093: consistency with old signature)
n@1116 8028 // We also use the url parameter if available
n@1116 8029 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
n@1116 8030 .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
n@1116 8031
n@1116 8032 // Alias method option to type as per ticket #12004
n@1116 8033 s.type = options.method || options.type || s.method || s.type;
n@1116 8034
n@1116 8035 // Extract dataTypes list
n@1116 8036 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
n@1116 8037
n@1116 8038 // A cross-domain request is in order when we have a protocol:host:port mismatch
n@1116 8039 if ( s.crossDomain == null ) {
n@1116 8040 parts = rurl.exec( s.url.toLowerCase() );
n@1116 8041 s.crossDomain = !!( parts &&
n@1116 8042 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
n@1116 8043 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
n@1116 8044 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
n@1116 8045 );
n@1116 8046 }
n@1116 8047
n@1116 8048 // Convert data if not already a string
n@1116 8049 if ( s.data && s.processData && typeof s.data !== "string" ) {
n@1116 8050 s.data = jQuery.param( s.data, s.traditional );
n@1116 8051 }
n@1116 8052
n@1116 8053 // Apply prefilters
n@1116 8054 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
n@1116 8055
n@1116 8056 // If request was aborted inside a prefilter, stop there
n@1116 8057 if ( state === 2 ) {
n@1116 8058 return jqXHR;
n@1116 8059 }
n@1116 8060
n@1116 8061 // We can fire global events as of now if asked to
n@1116 8062 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
n@1116 8063 fireGlobals = jQuery.event && s.global;
n@1116 8064
n@1116 8065 // Watch for a new set of requests
n@1116 8066 if ( fireGlobals && jQuery.active++ === 0 ) {
n@1116 8067 jQuery.event.trigger("ajaxStart");
n@1116 8068 }
n@1116 8069
n@1116 8070 // Uppercase the type
n@1116 8071 s.type = s.type.toUpperCase();
n@1116 8072
n@1116 8073 // Determine if request has content
n@1116 8074 s.hasContent = !rnoContent.test( s.type );
n@1116 8075
n@1116 8076 // Save the URL in case we're toying with the If-Modified-Since
n@1116 8077 // and/or If-None-Match header later on
n@1116 8078 cacheURL = s.url;
n@1116 8079
n@1116 8080 // More options handling for requests with no content
n@1116 8081 if ( !s.hasContent ) {
n@1116 8082
n@1116 8083 // If data is available, append data to url
n@1116 8084 if ( s.data ) {
n@1116 8085 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
n@1116 8086 // #9682: remove data so that it's not used in an eventual retry
n@1116 8087 delete s.data;
n@1116 8088 }
n@1116 8089
n@1116 8090 // Add anti-cache in url if needed
n@1116 8091 if ( s.cache === false ) {
n@1116 8092 s.url = rts.test( cacheURL ) ?
n@1116 8093
n@1116 8094 // If there is already a '_' parameter, set its value
n@1116 8095 cacheURL.replace( rts, "$1_=" + nonce++ ) :
n@1116 8096
n@1116 8097 // Otherwise add one to the end
n@1116 8098 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
n@1116 8099 }
n@1116 8100 }
n@1116 8101
n@1116 8102 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
n@1116 8103 if ( s.ifModified ) {
n@1116 8104 if ( jQuery.lastModified[ cacheURL ] ) {
n@1116 8105 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
n@1116 8106 }
n@1116 8107 if ( jQuery.etag[ cacheURL ] ) {
n@1116 8108 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
n@1116 8109 }
n@1116 8110 }
n@1116 8111
n@1116 8112 // Set the correct header, if data is being sent
n@1116 8113 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
n@1116 8114 jqXHR.setRequestHeader( "Content-Type", s.contentType );
n@1116 8115 }
n@1116 8116
n@1116 8117 // Set the Accepts header for the server, depending on the dataType
n@1116 8118 jqXHR.setRequestHeader(
n@1116 8119 "Accept",
n@1116 8120 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
n@1116 8121 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
n@1116 8122 s.accepts[ "*" ]
n@1116 8123 );
n@1116 8124
n@1116 8125 // Check for headers option
n@1116 8126 for ( i in s.headers ) {
n@1116 8127 jqXHR.setRequestHeader( i, s.headers[ i ] );
n@1116 8128 }
n@1116 8129
n@1116 8130 // Allow custom headers/mimetypes and early abort
n@1116 8131 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
n@1116 8132 // Abort if not done already and return
n@1116 8133 return jqXHR.abort();
n@1116 8134 }
n@1116 8135
n@1116 8136 // Aborting is no longer a cancellation
n@1116 8137 strAbort = "abort";
n@1116 8138
n@1116 8139 // Install callbacks on deferreds
n@1116 8140 for ( i in { success: 1, error: 1, complete: 1 } ) {
n@1116 8141 jqXHR[ i ]( s[ i ] );
n@1116 8142 }
n@1116 8143
n@1116 8144 // Get transport
n@1116 8145 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
n@1116 8146
n@1116 8147 // If no transport, we auto-abort
n@1116 8148 if ( !transport ) {
n@1116 8149 done( -1, "No Transport" );
n@1116 8150 } else {
n@1116 8151 jqXHR.readyState = 1;
n@1116 8152
n@1116 8153 // Send global event
n@1116 8154 if ( fireGlobals ) {
n@1116 8155 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
n@1116 8156 }
n@1116 8157 // Timeout
n@1116 8158 if ( s.async && s.timeout > 0 ) {
n@1116 8159 timeoutTimer = setTimeout(function() {
n@1116 8160 jqXHR.abort("timeout");
n@1116 8161 }, s.timeout );
n@1116 8162 }
n@1116 8163
n@1116 8164 try {
n@1116 8165 state = 1;
n@1116 8166 transport.send( requestHeaders, done );
n@1116 8167 } catch ( e ) {
n@1116 8168 // Propagate exception as error if not done
n@1116 8169 if ( state < 2 ) {
n@1116 8170 done( -1, e );
n@1116 8171 // Simply rethrow otherwise
n@1116 8172 } else {
n@1116 8173 throw e;
n@1116 8174 }
n@1116 8175 }
n@1116 8176 }
n@1116 8177
n@1116 8178 // Callback for when everything is done
n@1116 8179 function done( status, nativeStatusText, responses, headers ) {
n@1116 8180 var isSuccess, success, error, response, modified,
n@1116 8181 statusText = nativeStatusText;
n@1116 8182
n@1116 8183 // Called once
n@1116 8184 if ( state === 2 ) {
n@1116 8185 return;
n@1116 8186 }
n@1116 8187
n@1116 8188 // State is "done" now
n@1116 8189 state = 2;
n@1116 8190
n@1116 8191 // Clear timeout if it exists
n@1116 8192 if ( timeoutTimer ) {
n@1116 8193 clearTimeout( timeoutTimer );
n@1116 8194 }
n@1116 8195
n@1116 8196 // Dereference transport for early garbage collection
n@1116 8197 // (no matter how long the jqXHR object will be used)
n@1116 8198 transport = undefined;
n@1116 8199
n@1116 8200 // Cache response headers
n@1116 8201 responseHeadersString = headers || "";
n@1116 8202
n@1116 8203 // Set readyState
n@1116 8204 jqXHR.readyState = status > 0 ? 4 : 0;
n@1116 8205
n@1116 8206 // Determine if successful
n@1116 8207 isSuccess = status >= 200 && status < 300 || status === 304;
n@1116 8208
n@1116 8209 // Get response data
n@1116 8210 if ( responses ) {
n@1116 8211 response = ajaxHandleResponses( s, jqXHR, responses );
n@1116 8212 }
n@1116 8213
n@1116 8214 // Convert no matter what (that way responseXXX fields are always set)
n@1116 8215 response = ajaxConvert( s, response, jqXHR, isSuccess );
n@1116 8216
n@1116 8217 // If successful, handle type chaining
n@1116 8218 if ( isSuccess ) {
n@1116 8219
n@1116 8220 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
n@1116 8221 if ( s.ifModified ) {
n@1116 8222 modified = jqXHR.getResponseHeader("Last-Modified");
n@1116 8223 if ( modified ) {
n@1116 8224 jQuery.lastModified[ cacheURL ] = modified;
n@1116 8225 }
n@1116 8226 modified = jqXHR.getResponseHeader("etag");
n@1116 8227 if ( modified ) {
n@1116 8228 jQuery.etag[ cacheURL ] = modified;
n@1116 8229 }
n@1116 8230 }
n@1116 8231
n@1116 8232 // if no content
n@1116 8233 if ( status === 204 || s.type === "HEAD" ) {
n@1116 8234 statusText = "nocontent";
n@1116 8235
n@1116 8236 // if not modified
n@1116 8237 } else if ( status === 304 ) {
n@1116 8238 statusText = "notmodified";
n@1116 8239
n@1116 8240 // If we have data, let's convert it
n@1116 8241 } else {
n@1116 8242 statusText = response.state;
n@1116 8243 success = response.data;
n@1116 8244 error = response.error;
n@1116 8245 isSuccess = !error;
n@1116 8246 }
n@1116 8247 } else {
n@1116 8248 // Extract error from statusText and normalize for non-aborts
n@1116 8249 error = statusText;
n@1116 8250 if ( status || !statusText ) {
n@1116 8251 statusText = "error";
n@1116 8252 if ( status < 0 ) {
n@1116 8253 status = 0;
n@1116 8254 }
n@1116 8255 }
n@1116 8256 }
n@1116 8257
n@1116 8258 // Set data for the fake xhr object
n@1116 8259 jqXHR.status = status;
n@1116 8260 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
n@1116 8261
n@1116 8262 // Success/Error
n@1116 8263 if ( isSuccess ) {
n@1116 8264 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
n@1116 8265 } else {
n@1116 8266 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
n@1116 8267 }
n@1116 8268
n@1116 8269 // Status-dependent callbacks
n@1116 8270 jqXHR.statusCode( statusCode );
n@1116 8271 statusCode = undefined;
n@1116 8272
n@1116 8273 if ( fireGlobals ) {
n@1116 8274 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
n@1116 8275 [ jqXHR, s, isSuccess ? success : error ] );
n@1116 8276 }
n@1116 8277
n@1116 8278 // Complete
n@1116 8279 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
n@1116 8280
n@1116 8281 if ( fireGlobals ) {
n@1116 8282 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
n@1116 8283 // Handle the global AJAX counter
n@1116 8284 if ( !( --jQuery.active ) ) {
n@1116 8285 jQuery.event.trigger("ajaxStop");
n@1116 8286 }
n@1116 8287 }
n@1116 8288 }
n@1116 8289
n@1116 8290 return jqXHR;
n@1116 8291 },
n@1116 8292
n@1116 8293 getJSON: function( url, data, callback ) {
n@1116 8294 return jQuery.get( url, data, callback, "json" );
n@1116 8295 },
n@1116 8296
n@1116 8297 getScript: function( url, callback ) {
n@1116 8298 return jQuery.get( url, undefined, callback, "script" );
n@1116 8299 }
n@1116 8300 });
n@1116 8301
n@1116 8302 jQuery.each( [ "get", "post" ], function( i, method ) {
n@1116 8303 jQuery[ method ] = function( url, data, callback, type ) {
n@1116 8304 // Shift arguments if data argument was omitted
n@1116 8305 if ( jQuery.isFunction( data ) ) {
n@1116 8306 type = type || callback;
n@1116 8307 callback = data;
n@1116 8308 data = undefined;
n@1116 8309 }
n@1116 8310
n@1116 8311 return jQuery.ajax({
n@1116 8312 url: url,
n@1116 8313 type: method,
n@1116 8314 dataType: type,
n@1116 8315 data: data,
n@1116 8316 success: callback
n@1116 8317 });
n@1116 8318 };
n@1116 8319 });
n@1116 8320
n@1116 8321
n@1116 8322 jQuery._evalUrl = function( url ) {
n@1116 8323 return jQuery.ajax({
n@1116 8324 url: url,
n@1116 8325 type: "GET",
n@1116 8326 dataType: "script",
n@1116 8327 async: false,
n@1116 8328 global: false,
n@1116 8329 "throws": true
n@1116 8330 });
n@1116 8331 };
n@1116 8332
n@1116 8333
n@1116 8334 jQuery.fn.extend({
n@1116 8335 wrapAll: function( html ) {
n@1116 8336 var wrap;
n@1116 8337
n@1116 8338 if ( jQuery.isFunction( html ) ) {
n@1116 8339 return this.each(function( i ) {
n@1116 8340 jQuery( this ).wrapAll( html.call(this, i) );
n@1116 8341 });
n@1116 8342 }
n@1116 8343
n@1116 8344 if ( this[ 0 ] ) {
n@1116 8345
n@1116 8346 // The elements to wrap the target around
n@1116 8347 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
n@1116 8348
n@1116 8349 if ( this[ 0 ].parentNode ) {
n@1116 8350 wrap.insertBefore( this[ 0 ] );
n@1116 8351 }
n@1116 8352
n@1116 8353 wrap.map(function() {
n@1116 8354 var elem = this;
n@1116 8355
n@1116 8356 while ( elem.firstElementChild ) {
n@1116 8357 elem = elem.firstElementChild;
n@1116 8358 }
n@1116 8359
n@1116 8360 return elem;
n@1116 8361 }).append( this );
n@1116 8362 }
n@1116 8363
n@1116 8364 return this;
n@1116 8365 },
n@1116 8366
n@1116 8367 wrapInner: function( html ) {
n@1116 8368 if ( jQuery.isFunction( html ) ) {
n@1116 8369 return this.each(function( i ) {
n@1116 8370 jQuery( this ).wrapInner( html.call(this, i) );
n@1116 8371 });
n@1116 8372 }
n@1116 8373
n@1116 8374 return this.each(function() {
n@1116 8375 var self = jQuery( this ),
n@1116 8376 contents = self.contents();
n@1116 8377
n@1116 8378 if ( contents.length ) {
n@1116 8379 contents.wrapAll( html );
n@1116 8380
n@1116 8381 } else {
n@1116 8382 self.append( html );
n@1116 8383 }
n@1116 8384 });
n@1116 8385 },
n@1116 8386
n@1116 8387 wrap: function( html ) {
n@1116 8388 var isFunction = jQuery.isFunction( html );
n@1116 8389
n@1116 8390 return this.each(function( i ) {
n@1116 8391 jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
n@1116 8392 });
n@1116 8393 },
n@1116 8394
n@1116 8395 unwrap: function() {
n@1116 8396 return this.parent().each(function() {
n@1116 8397 if ( !jQuery.nodeName( this, "body" ) ) {
n@1116 8398 jQuery( this ).replaceWith( this.childNodes );
n@1116 8399 }
n@1116 8400 }).end();
n@1116 8401 }
n@1116 8402 });
n@1116 8403
n@1116 8404
n@1116 8405 jQuery.expr.filters.hidden = function( elem ) {
n@1116 8406 // Support: Opera <= 12.12
n@1116 8407 // Opera reports offsetWidths and offsetHeights less than zero on some elements
n@1116 8408 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
n@1116 8409 };
n@1116 8410 jQuery.expr.filters.visible = function( elem ) {
n@1116 8411 return !jQuery.expr.filters.hidden( elem );
n@1116 8412 };
n@1116 8413
n@1116 8414
n@1116 8415
n@1116 8416
n@1116 8417 var r20 = /%20/g,
n@1116 8418 rbracket = /\[\]$/,
n@1116 8419 rCRLF = /\r?\n/g,
n@1116 8420 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
n@1116 8421 rsubmittable = /^(?:input|select|textarea|keygen)/i;
n@1116 8422
n@1116 8423 function buildParams( prefix, obj, traditional, add ) {
n@1116 8424 var name;
n@1116 8425
n@1116 8426 if ( jQuery.isArray( obj ) ) {
n@1116 8427 // Serialize array item.
n@1116 8428 jQuery.each( obj, function( i, v ) {
n@1116 8429 if ( traditional || rbracket.test( prefix ) ) {
n@1116 8430 // Treat each array item as a scalar.
n@1116 8431 add( prefix, v );
n@1116 8432
n@1116 8433 } else {
n@1116 8434 // Item is non-scalar (array or object), encode its numeric index.
n@1116 8435 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
n@1116 8436 }
n@1116 8437 });
n@1116 8438
n@1116 8439 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
n@1116 8440 // Serialize object item.
n@1116 8441 for ( name in obj ) {
n@1116 8442 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
n@1116 8443 }
n@1116 8444
n@1116 8445 } else {
n@1116 8446 // Serialize scalar item.
n@1116 8447 add( prefix, obj );
n@1116 8448 }
n@1116 8449 }
n@1116 8450
n@1116 8451 // Serialize an array of form elements or a set of
n@1116 8452 // key/values into a query string
n@1116 8453 jQuery.param = function( a, traditional ) {
n@1116 8454 var prefix,
n@1116 8455 s = [],
n@1116 8456 add = function( key, value ) {
n@1116 8457 // If value is a function, invoke it and return its value
n@1116 8458 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
n@1116 8459 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
n@1116 8460 };
n@1116 8461
n@1116 8462 // Set traditional to true for jQuery <= 1.3.2 behavior.
n@1116 8463 if ( traditional === undefined ) {
n@1116 8464 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
n@1116 8465 }
n@1116 8466
n@1116 8467 // If an array was passed in, assume that it is an array of form elements.
n@1116 8468 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
n@1116 8469 // Serialize the form elements
n@1116 8470 jQuery.each( a, function() {
n@1116 8471 add( this.name, this.value );
n@1116 8472 });
n@1116 8473
n@1116 8474 } else {
n@1116 8475 // If traditional, encode the "old" way (the way 1.3.2 or older
n@1116 8476 // did it), otherwise encode params recursively.
n@1116 8477 for ( prefix in a ) {
n@1116 8478 buildParams( prefix, a[ prefix ], traditional, add );
n@1116 8479 }
n@1116 8480 }
n@1116 8481
n@1116 8482 // Return the resulting serialization
n@1116 8483 return s.join( "&" ).replace( r20, "+" );
n@1116 8484 };
n@1116 8485
n@1116 8486 jQuery.fn.extend({
n@1116 8487 serialize: function() {
n@1116 8488 return jQuery.param( this.serializeArray() );
n@1116 8489 },
n@1116 8490 serializeArray: function() {
n@1116 8491 return this.map(function() {
n@1116 8492 // Can add propHook for "elements" to filter or add form elements
n@1116 8493 var elements = jQuery.prop( this, "elements" );
n@1116 8494 return elements ? jQuery.makeArray( elements ) : this;
n@1116 8495 })
n@1116 8496 .filter(function() {
n@1116 8497 var type = this.type;
n@1116 8498
n@1116 8499 // Use .is( ":disabled" ) so that fieldset[disabled] works
n@1116 8500 return this.name && !jQuery( this ).is( ":disabled" ) &&
n@1116 8501 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
n@1116 8502 ( this.checked || !rcheckableType.test( type ) );
n@1116 8503 })
n@1116 8504 .map(function( i, elem ) {
n@1116 8505 var val = jQuery( this ).val();
n@1116 8506
n@1116 8507 return val == null ?
n@1116 8508 null :
n@1116 8509 jQuery.isArray( val ) ?
n@1116 8510 jQuery.map( val, function( val ) {
n@1116 8511 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
n@1116 8512 }) :
n@1116 8513 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
n@1116 8514 }).get();
n@1116 8515 }
n@1116 8516 });
n@1116 8517
n@1116 8518
n@1116 8519 jQuery.ajaxSettings.xhr = function() {
n@1116 8520 try {
n@1116 8521 return new XMLHttpRequest();
n@1116 8522 } catch( e ) {}
n@1116 8523 };
n@1116 8524
n@1116 8525 var xhrId = 0,
n@1116 8526 xhrCallbacks = {},
n@1116 8527 xhrSuccessStatus = {
n@1116 8528 // file protocol always yields status code 0, assume 200
n@1116 8529 0: 200,
n@1116 8530 // Support: IE9
n@1116 8531 // #1450: sometimes IE returns 1223 when it should be 204
n@1116 8532 1223: 204
n@1116 8533 },
n@1116 8534 xhrSupported = jQuery.ajaxSettings.xhr();
n@1116 8535
n@1116 8536 // Support: IE9
n@1116 8537 // Open requests must be manually aborted on unload (#5280)
n@1116 8538 // See https://support.microsoft.com/kb/2856746 for more info
n@1116 8539 if ( window.attachEvent ) {
n@1116 8540 window.attachEvent( "onunload", function() {
n@1116 8541 for ( var key in xhrCallbacks ) {
n@1116 8542 xhrCallbacks[ key ]();
n@1116 8543 }
n@1116 8544 });
n@1116 8545 }
n@1116 8546
n@1116 8547 support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
n@1116 8548 support.ajax = xhrSupported = !!xhrSupported;
n@1116 8549
n@1116 8550 jQuery.ajaxTransport(function( options ) {
n@1116 8551 var callback;
n@1116 8552
n@1116 8553 // Cross domain only allowed if supported through XMLHttpRequest
n@1116 8554 if ( support.cors || xhrSupported && !options.crossDomain ) {
n@1116 8555 return {
n@1116 8556 send: function( headers, complete ) {
n@1116 8557 var i,
n@1116 8558 xhr = options.xhr(),
n@1116 8559 id = ++xhrId;
n@1116 8560
n@1116 8561 xhr.open( options.type, options.url, options.async, options.username, options.password );
n@1116 8562
n@1116 8563 // Apply custom fields if provided
n@1116 8564 if ( options.xhrFields ) {
n@1116 8565 for ( i in options.xhrFields ) {
n@1116 8566 xhr[ i ] = options.xhrFields[ i ];
n@1116 8567 }
n@1116 8568 }
n@1116 8569
n@1116 8570 // Override mime type if needed
n@1116 8571 if ( options.mimeType && xhr.overrideMimeType ) {
n@1116 8572 xhr.overrideMimeType( options.mimeType );
n@1116 8573 }
n@1116 8574
n@1116 8575 // X-Requested-With header
n@1116 8576 // For cross-domain requests, seeing as conditions for a preflight are
n@1116 8577 // akin to a jigsaw puzzle, we simply never set it to be sure.
n@1116 8578 // (it can always be set on a per-request basis or even using ajaxSetup)
n@1116 8579 // For same-domain requests, won't change header if already provided.
n@1116 8580 if ( !options.crossDomain && !headers["X-Requested-With"] ) {
n@1116 8581 headers["X-Requested-With"] = "XMLHttpRequest";
n@1116 8582 }
n@1116 8583
n@1116 8584 // Set headers
n@1116 8585 for ( i in headers ) {
n@1116 8586 xhr.setRequestHeader( i, headers[ i ] );
n@1116 8587 }
n@1116 8588
n@1116 8589 // Callback
n@1116 8590 callback = function( type ) {
n@1116 8591 return function() {
n@1116 8592 if ( callback ) {
n@1116 8593 delete xhrCallbacks[ id ];
n@1116 8594 callback = xhr.onload = xhr.onerror = null;
n@1116 8595
n@1116 8596 if ( type === "abort" ) {
n@1116 8597 xhr.abort();
n@1116 8598 } else if ( type === "error" ) {
n@1116 8599 complete(
n@1116 8600 // file: protocol always yields status 0; see #8605, #14207
n@1116 8601 xhr.status,
n@1116 8602 xhr.statusText
n@1116 8603 );
n@1116 8604 } else {
n@1116 8605 complete(
n@1116 8606 xhrSuccessStatus[ xhr.status ] || xhr.status,
n@1116 8607 xhr.statusText,
n@1116 8608 // Support: IE9
n@1116 8609 // Accessing binary-data responseText throws an exception
n@1116 8610 // (#11426)
n@1116 8611 typeof xhr.responseText === "string" ? {
n@1116 8612 text: xhr.responseText
n@1116 8613 } : undefined,
n@1116 8614 xhr.getAllResponseHeaders()
n@1116 8615 );
n@1116 8616 }
n@1116 8617 }
n@1116 8618 };
n@1116 8619 };
n@1116 8620
n@1116 8621 // Listen to events
n@1116 8622 xhr.onload = callback();
n@1116 8623 xhr.onerror = callback("error");
n@1116 8624
n@1116 8625 // Create the abort callback
n@1116 8626 callback = xhrCallbacks[ id ] = callback("abort");
n@1116 8627
n@1116 8628 try {
n@1116 8629 // Do send the request (this may raise an exception)
n@1116 8630 xhr.send( options.hasContent && options.data || null );
n@1116 8631 } catch ( e ) {
n@1116 8632 // #14683: Only rethrow if this hasn't been notified as an error yet
n@1116 8633 if ( callback ) {
n@1116 8634 throw e;
n@1116 8635 }
n@1116 8636 }
n@1116 8637 },
n@1116 8638
n@1116 8639 abort: function() {
n@1116 8640 if ( callback ) {
n@1116 8641 callback();
n@1116 8642 }
n@1116 8643 }
n@1116 8644 };
n@1116 8645 }
n@1116 8646 });
n@1116 8647
n@1116 8648
n@1116 8649
n@1116 8650
n@1116 8651 // Install script dataType
n@1116 8652 jQuery.ajaxSetup({
n@1116 8653 accepts: {
n@1116 8654 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
n@1116 8655 },
n@1116 8656 contents: {
n@1116 8657 script: /(?:java|ecma)script/
n@1116 8658 },
n@1116 8659 converters: {
n@1116 8660 "text script": function( text ) {
n@1116 8661 jQuery.globalEval( text );
n@1116 8662 return text;
n@1116 8663 }
n@1116 8664 }
n@1116 8665 });
n@1116 8666
n@1116 8667 // Handle cache's special case and crossDomain
n@1116 8668 jQuery.ajaxPrefilter( "script", function( s ) {
n@1116 8669 if ( s.cache === undefined ) {
n@1116 8670 s.cache = false;
n@1116 8671 }
n@1116 8672 if ( s.crossDomain ) {
n@1116 8673 s.type = "GET";
n@1116 8674 }
n@1116 8675 });
n@1116 8676
n@1116 8677 // Bind script tag hack transport
n@1116 8678 jQuery.ajaxTransport( "script", function( s ) {
n@1116 8679 // This transport only deals with cross domain requests
n@1116 8680 if ( s.crossDomain ) {
n@1116 8681 var script, callback;
n@1116 8682 return {
n@1116 8683 send: function( _, complete ) {
n@1116 8684 script = jQuery("<script>").prop({
n@1116 8685 async: true,
n@1116 8686 charset: s.scriptCharset,
n@1116 8687 src: s.url
n@1116 8688 }).on(
n@1116 8689 "load error",
n@1116 8690 callback = function( evt ) {
n@1116 8691 script.remove();
n@1116 8692 callback = null;
n@1116 8693 if ( evt ) {
n@1116 8694 complete( evt.type === "error" ? 404 : 200, evt.type );
n@1116 8695 }
n@1116 8696 }
n@1116 8697 );
n@1116 8698 document.head.appendChild( script[ 0 ] );
n@1116 8699 },
n@1116 8700 abort: function() {
n@1116 8701 if ( callback ) {
n@1116 8702 callback();
n@1116 8703 }
n@1116 8704 }
n@1116 8705 };
n@1116 8706 }
n@1116 8707 });
n@1116 8708
n@1116 8709
n@1116 8710
n@1116 8711
n@1116 8712 var oldCallbacks = [],
n@1116 8713 rjsonp = /(=)\?(?=&|$)|\?\?/;
n@1116 8714
n@1116 8715 // Default jsonp settings
n@1116 8716 jQuery.ajaxSetup({
n@1116 8717 jsonp: "callback",
n@1116 8718 jsonpCallback: function() {
n@1116 8719 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
n@1116 8720 this[ callback ] = true;
n@1116 8721 return callback;
n@1116 8722 }
n@1116 8723 });
n@1116 8724
n@1116 8725 // Detect, normalize options and install callbacks for jsonp requests
n@1116 8726 jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
n@1116 8727
n@1116 8728 var callbackName, overwritten, responseContainer,
n@1116 8729 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
n@1116 8730 "url" :
n@1116 8731 typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
n@1116 8732 );
n@1116 8733
n@1116 8734 // Handle iff the expected data type is "jsonp" or we have a parameter to set
n@1116 8735 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
n@1116 8736
n@1116 8737 // Get callback name, remembering preexisting value associated with it
n@1116 8738 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
n@1116 8739 s.jsonpCallback() :
n@1116 8740 s.jsonpCallback;
n@1116 8741
n@1116 8742 // Insert callback into url or form data
n@1116 8743 if ( jsonProp ) {
n@1116 8744 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
n@1116 8745 } else if ( s.jsonp !== false ) {
n@1116 8746 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
n@1116 8747 }
n@1116 8748
n@1116 8749 // Use data converter to retrieve json after script execution
n@1116 8750 s.converters["script json"] = function() {
n@1116 8751 if ( !responseContainer ) {
n@1116 8752 jQuery.error( callbackName + " was not called" );
n@1116 8753 }
n@1116 8754 return responseContainer[ 0 ];
n@1116 8755 };
n@1116 8756
n@1116 8757 // force json dataType
n@1116 8758 s.dataTypes[ 0 ] = "json";
n@1116 8759
n@1116 8760 // Install callback
n@1116 8761 overwritten = window[ callbackName ];
n@1116 8762 window[ callbackName ] = function() {
n@1116 8763 responseContainer = arguments;
n@1116 8764 };
n@1116 8765
n@1116 8766 // Clean-up function (fires after converters)
n@1116 8767 jqXHR.always(function() {
n@1116 8768 // Restore preexisting value
n@1116 8769 window[ callbackName ] = overwritten;
n@1116 8770
n@1116 8771 // Save back as free
n@1116 8772 if ( s[ callbackName ] ) {
n@1116 8773 // make sure that re-using the options doesn't screw things around
n@1116 8774 s.jsonpCallback = originalSettings.jsonpCallback;
n@1116 8775
n@1116 8776 // save the callback name for future use
n@1116 8777 oldCallbacks.push( callbackName );
n@1116 8778 }
n@1116 8779
n@1116 8780 // Call if it was a function and we have a response
n@1116 8781 if ( responseContainer && jQuery.isFunction( overwritten ) ) {
n@1116 8782 overwritten( responseContainer[ 0 ] );
n@1116 8783 }
n@1116 8784
n@1116 8785 responseContainer = overwritten = undefined;
n@1116 8786 });
n@1116 8787
n@1116 8788 // Delegate to script
n@1116 8789 return "script";
n@1116 8790 }
n@1116 8791 });
n@1116 8792
n@1116 8793
n@1116 8794
n@1116 8795
n@1116 8796 // data: string of html
n@1116 8797 // context (optional): If specified, the fragment will be created in this context, defaults to document
n@1116 8798 // keepScripts (optional): If true, will include scripts passed in the html string
n@1116 8799 jQuery.parseHTML = function( data, context, keepScripts ) {
n@1116 8800 if ( !data || typeof data !== "string" ) {
n@1116 8801 return null;
n@1116 8802 }
n@1116 8803 if ( typeof context === "boolean" ) {
n@1116 8804 keepScripts = context;
n@1116 8805 context = false;
n@1116 8806 }
n@1116 8807 context = context || document;
n@1116 8808
n@1116 8809 var parsed = rsingleTag.exec( data ),
n@1116 8810 scripts = !keepScripts && [];
n@1116 8811
n@1116 8812 // Single tag
n@1116 8813 if ( parsed ) {
n@1116 8814 return [ context.createElement( parsed[1] ) ];
n@1116 8815 }
n@1116 8816
n@1116 8817 parsed = jQuery.buildFragment( [ data ], context, scripts );
n@1116 8818
n@1116 8819 if ( scripts && scripts.length ) {
n@1116 8820 jQuery( scripts ).remove();
n@1116 8821 }
n@1116 8822
n@1116 8823 return jQuery.merge( [], parsed.childNodes );
n@1116 8824 };
n@1116 8825
n@1116 8826
n@1116 8827 // Keep a copy of the old load method
n@1116 8828 var _load = jQuery.fn.load;
n@1116 8829
n@1116 8830 /**
n@1116 8831 * Load a url into a page
n@1116 8832 */
n@1116 8833 jQuery.fn.load = function( url, params, callback ) {
n@1116 8834 if ( typeof url !== "string" && _load ) {
n@1116 8835 return _load.apply( this, arguments );
n@1116 8836 }
n@1116 8837
n@1116 8838 var selector, type, response,
n@1116 8839 self = this,
n@1116 8840 off = url.indexOf(" ");
n@1116 8841
n@1116 8842 if ( off >= 0 ) {
n@1116 8843 selector = jQuery.trim( url.slice( off ) );
n@1116 8844 url = url.slice( 0, off );
n@1116 8845 }
n@1116 8846
n@1116 8847 // If it's a function
n@1116 8848 if ( jQuery.isFunction( params ) ) {
n@1116 8849
n@1116 8850 // We assume that it's the callback
n@1116 8851 callback = params;
n@1116 8852 params = undefined;
n@1116 8853
n@1116 8854 // Otherwise, build a param string
n@1116 8855 } else if ( params && typeof params === "object" ) {
n@1116 8856 type = "POST";
n@1116 8857 }
n@1116 8858
n@1116 8859 // If we have elements to modify, make the request
n@1116 8860 if ( self.length > 0 ) {
n@1116 8861 jQuery.ajax({
n@1116 8862 url: url,
n@1116 8863
n@1116 8864 // if "type" variable is undefined, then "GET" method will be used
n@1116 8865 type: type,
n@1116 8866 dataType: "html",
n@1116 8867 data: params
n@1116 8868 }).done(function( responseText ) {
n@1116 8869
n@1116 8870 // Save response for use in complete callback
n@1116 8871 response = arguments;
n@1116 8872
n@1116 8873 self.html( selector ?
n@1116 8874
n@1116 8875 // If a selector was specified, locate the right elements in a dummy div
n@1116 8876 // Exclude scripts to avoid IE 'Permission Denied' errors
n@1116 8877 jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
n@1116 8878
n@1116 8879 // Otherwise use the full result
n@1116 8880 responseText );
n@1116 8881
n@1116 8882 }).complete( callback && function( jqXHR, status ) {
n@1116 8883 self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
n@1116 8884 });
n@1116 8885 }
n@1116 8886
n@1116 8887 return this;
n@1116 8888 };
n@1116 8889
n@1116 8890
n@1116 8891
n@1116 8892
n@1116 8893 // Attach a bunch of functions for handling common AJAX events
n@1116 8894 jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
n@1116 8895 jQuery.fn[ type ] = function( fn ) {
n@1116 8896 return this.on( type, fn );
n@1116 8897 };
n@1116 8898 });
n@1116 8899
n@1116 8900
n@1116 8901
n@1116 8902
n@1116 8903 jQuery.expr.filters.animated = function( elem ) {
n@1116 8904 return jQuery.grep(jQuery.timers, function( fn ) {
n@1116 8905 return elem === fn.elem;
n@1116 8906 }).length;
n@1116 8907 };
n@1116 8908
n@1116 8909
n@1116 8910
n@1116 8911
n@1116 8912 var docElem = window.document.documentElement;
n@1116 8913
n@1116 8914 /**
n@1116 8915 * Gets a window from an element
n@1116 8916 */
n@1116 8917 function getWindow( elem ) {
n@1116 8918 return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
n@1116 8919 }
n@1116 8920
n@1116 8921 jQuery.offset = {
n@1116 8922 setOffset: function( elem, options, i ) {
n@1116 8923 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
n@1116 8924 position = jQuery.css( elem, "position" ),
n@1116 8925 curElem = jQuery( elem ),
n@1116 8926 props = {};
n@1116 8927
n@1116 8928 // Set position first, in-case top/left are set even on static elem
n@1116 8929 if ( position === "static" ) {
n@1116 8930 elem.style.position = "relative";
n@1116 8931 }
n@1116 8932
n@1116 8933 curOffset = curElem.offset();
n@1116 8934 curCSSTop = jQuery.css( elem, "top" );
n@1116 8935 curCSSLeft = jQuery.css( elem, "left" );
n@1116 8936 calculatePosition = ( position === "absolute" || position === "fixed" ) &&
n@1116 8937 ( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
n@1116 8938
n@1116 8939 // Need to be able to calculate position if either
n@1116 8940 // top or left is auto and position is either absolute or fixed
n@1116 8941 if ( calculatePosition ) {
n@1116 8942 curPosition = curElem.position();
n@1116 8943 curTop = curPosition.top;
n@1116 8944 curLeft = curPosition.left;
n@1116 8945
n@1116 8946 } else {
n@1116 8947 curTop = parseFloat( curCSSTop ) || 0;
n@1116 8948 curLeft = parseFloat( curCSSLeft ) || 0;
n@1116 8949 }
n@1116 8950
n@1116 8951 if ( jQuery.isFunction( options ) ) {
n@1116 8952 options = options.call( elem, i, curOffset );
n@1116 8953 }
n@1116 8954
n@1116 8955 if ( options.top != null ) {
n@1116 8956 props.top = ( options.top - curOffset.top ) + curTop;
n@1116 8957 }
n@1116 8958 if ( options.left != null ) {
n@1116 8959 props.left = ( options.left - curOffset.left ) + curLeft;
n@1116 8960 }
n@1116 8961
n@1116 8962 if ( "using" in options ) {
n@1116 8963 options.using.call( elem, props );
n@1116 8964
n@1116 8965 } else {
n@1116 8966 curElem.css( props );
n@1116 8967 }
n@1116 8968 }
n@1116 8969 };
n@1116 8970
n@1116 8971 jQuery.fn.extend({
n@1116 8972 offset: function( options ) {
n@1116 8973 if ( arguments.length ) {
n@1116 8974 return options === undefined ?
n@1116 8975 this :
n@1116 8976 this.each(function( i ) {
n@1116 8977 jQuery.offset.setOffset( this, options, i );
n@1116 8978 });
n@1116 8979 }
n@1116 8980
n@1116 8981 var docElem, win,
n@1116 8982 elem = this[ 0 ],
n@1116 8983 box = { top: 0, left: 0 },
n@1116 8984 doc = elem && elem.ownerDocument;
n@1116 8985
n@1116 8986 if ( !doc ) {
n@1116 8987 return;
n@1116 8988 }
n@1116 8989
n@1116 8990 docElem = doc.documentElement;
n@1116 8991
n@1116 8992 // Make sure it's not a disconnected DOM node
n@1116 8993 if ( !jQuery.contains( docElem, elem ) ) {
n@1116 8994 return box;
n@1116 8995 }
n@1116 8996
n@1116 8997 // Support: BlackBerry 5, iOS 3 (original iPhone)
n@1116 8998 // If we don't have gBCR, just use 0,0 rather than error
n@1116 8999 if ( typeof elem.getBoundingClientRect !== strundefined ) {
n@1116 9000 box = elem.getBoundingClientRect();
n@1116 9001 }
n@1116 9002 win = getWindow( doc );
n@1116 9003 return {
n@1116 9004 top: box.top + win.pageYOffset - docElem.clientTop,
n@1116 9005 left: box.left + win.pageXOffset - docElem.clientLeft
n@1116 9006 };
n@1116 9007 },
n@1116 9008
n@1116 9009 position: function() {
n@1116 9010 if ( !this[ 0 ] ) {
n@1116 9011 return;
n@1116 9012 }
n@1116 9013
n@1116 9014 var offsetParent, offset,
n@1116 9015 elem = this[ 0 ],
n@1116 9016 parentOffset = { top: 0, left: 0 };
n@1116 9017
n@1116 9018 // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
n@1116 9019 if ( jQuery.css( elem, "position" ) === "fixed" ) {
n@1116 9020 // Assume getBoundingClientRect is there when computed position is fixed
n@1116 9021 offset = elem.getBoundingClientRect();
n@1116 9022
n@1116 9023 } else {
n@1116 9024 // Get *real* offsetParent
n@1116 9025 offsetParent = this.offsetParent();
n@1116 9026
n@1116 9027 // Get correct offsets
n@1116 9028 offset = this.offset();
n@1116 9029 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
n@1116 9030 parentOffset = offsetParent.offset();
n@1116 9031 }
n@1116 9032
n@1116 9033 // Add offsetParent borders
n@1116 9034 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
n@1116 9035 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
n@1116 9036 }
n@1116 9037
n@1116 9038 // Subtract parent offsets and element margins
n@1116 9039 return {
n@1116 9040 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
n@1116 9041 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
n@1116 9042 };
n@1116 9043 },
n@1116 9044
n@1116 9045 offsetParent: function() {
n@1116 9046 return this.map(function() {
n@1116 9047 var offsetParent = this.offsetParent || docElem;
n@1116 9048
n@1116 9049 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
n@1116 9050 offsetParent = offsetParent.offsetParent;
n@1116 9051 }
n@1116 9052
n@1116 9053 return offsetParent || docElem;
n@1116 9054 });
n@1116 9055 }
n@1116 9056 });
n@1116 9057
n@1116 9058 // Create scrollLeft and scrollTop methods
n@1116 9059 jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
n@1116 9060 var top = "pageYOffset" === prop;
n@1116 9061
n@1116 9062 jQuery.fn[ method ] = function( val ) {
n@1116 9063 return access( this, function( elem, method, val ) {
n@1116 9064 var win = getWindow( elem );
n@1116 9065
n@1116 9066 if ( val === undefined ) {
n@1116 9067 return win ? win[ prop ] : elem[ method ];
n@1116 9068 }
n@1116 9069
n@1116 9070 if ( win ) {
n@1116 9071 win.scrollTo(
n@1116 9072 !top ? val : window.pageXOffset,
n@1116 9073 top ? val : window.pageYOffset
n@1116 9074 );
n@1116 9075
n@1116 9076 } else {
n@1116 9077 elem[ method ] = val;
n@1116 9078 }
n@1116 9079 }, method, val, arguments.length, null );
n@1116 9080 };
n@1116 9081 });
n@1116 9082
n@1116 9083 // Support: Safari<7+, Chrome<37+
n@1116 9084 // Add the top/left cssHooks using jQuery.fn.position
n@1116 9085 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
n@1116 9086 // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
n@1116 9087 // getComputedStyle returns percent when specified for top/left/bottom/right;
n@1116 9088 // rather than make the css module depend on the offset module, just check for it here
n@1116 9089 jQuery.each( [ "top", "left" ], function( i, prop ) {
n@1116 9090 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
n@1116 9091 function( elem, computed ) {
n@1116 9092 if ( computed ) {
n@1116 9093 computed = curCSS( elem, prop );
n@1116 9094 // If curCSS returns percentage, fallback to offset
n@1116 9095 return rnumnonpx.test( computed ) ?
n@1116 9096 jQuery( elem ).position()[ prop ] + "px" :
n@1116 9097 computed;
n@1116 9098 }
n@1116 9099 }
n@1116 9100 );
n@1116 9101 });
n@1116 9102
n@1116 9103
n@1116 9104 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
n@1116 9105 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
n@1116 9106 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
n@1116 9107 // Margin is only for outerHeight, outerWidth
n@1116 9108 jQuery.fn[ funcName ] = function( margin, value ) {
n@1116 9109 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
n@1116 9110 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
n@1116 9111
n@1116 9112 return access( this, function( elem, type, value ) {
n@1116 9113 var doc;
n@1116 9114
n@1116 9115 if ( jQuery.isWindow( elem ) ) {
n@1116 9116 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
n@1116 9117 // isn't a whole lot we can do. See pull request at this URL for discussion:
n@1116 9118 // https://github.com/jquery/jquery/pull/764
n@1116 9119 return elem.document.documentElement[ "client" + name ];
n@1116 9120 }
n@1116 9121
n@1116 9122 // Get document width or height
n@1116 9123 if ( elem.nodeType === 9 ) {
n@1116 9124 doc = elem.documentElement;
n@1116 9125
n@1116 9126 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
n@1116 9127 // whichever is greatest
n@1116 9128 return Math.max(
n@1116 9129 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
n@1116 9130 elem.body[ "offset" + name ], doc[ "offset" + name ],
n@1116 9131 doc[ "client" + name ]
n@1116 9132 );
n@1116 9133 }
n@1116 9134
n@1116 9135 return value === undefined ?
n@1116 9136 // Get width or height on the element, requesting but not forcing parseFloat
n@1116 9137 jQuery.css( elem, type, extra ) :
n@1116 9138
n@1116 9139 // Set width or height on the element
n@1116 9140 jQuery.style( elem, type, value, extra );
n@1116 9141 }, type, chainable ? margin : undefined, chainable, null );
n@1116 9142 };
n@1116 9143 });
n@1116 9144 });
n@1116 9145
n@1116 9146
n@1116 9147 // The number of elements contained in the matched element set
n@1116 9148 jQuery.fn.size = function() {
n@1116 9149 return this.length;
n@1116 9150 };
n@1116 9151
n@1116 9152 jQuery.fn.andSelf = jQuery.fn.addBack;
n@1116 9153
n@1116 9154
n@1116 9155
n@1116 9156
n@1116 9157 // Register as a named AMD module, since jQuery can be concatenated with other
n@1116 9158 // files that may use define, but not via a proper concatenation script that
n@1116 9159 // understands anonymous AMD modules. A named AMD is safest and most robust
n@1116 9160 // way to register. Lowercase jquery is used because AMD module names are
n@1116 9161 // derived from file names, and jQuery is normally delivered in a lowercase
n@1116 9162 // file name. Do this after creating the global so that if an AMD module wants
n@1116 9163 // to call noConflict to hide this version of jQuery, it will work.
n@1116 9164
n@1116 9165 // Note that for maximum portability, libraries that are not jQuery should
n@1116 9166 // declare themselves as anonymous modules, and avoid setting a global if an
n@1116 9167 // AMD loader is present. jQuery is a special case. For more information, see
n@1116 9168 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
n@1116 9169
n@1116 9170 if ( typeof define === "function" && define.amd ) {
n@1116 9171 define( "jquery", [], function() {
n@1116 9172 return jQuery;
n@1116 9173 });
n@1116 9174 }
n@1116 9175
n@1116 9176
n@1116 9177
n@1116 9178
n@1116 9179 var
n@1116 9180 // Map over jQuery in case of overwrite
n@1116 9181 _jQuery = window.jQuery,
n@1116 9182
n@1116 9183 // Map over the $ in case of overwrite
n@1116 9184 _$ = window.$;
n@1116 9185
n@1116 9186 jQuery.noConflict = function( deep ) {
n@1116 9187 if ( window.$ === jQuery ) {
n@1116 9188 window.$ = _$;
n@1116 9189 }
n@1116 9190
n@1116 9191 if ( deep && window.jQuery === jQuery ) {
n@1116 9192 window.jQuery = _jQuery;
n@1116 9193 }
n@1116 9194
n@1116 9195 return jQuery;
n@1116 9196 };
n@1116 9197
n@1116 9198 // Expose jQuery and $ identifiers, even in AMD
n@1116 9199 // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
n@1116 9200 // and CommonJS for browser emulators (#13566)
n@1116 9201 if ( typeof noGlobal === strundefined ) {
n@1116 9202 window.jQuery = window.$ = jQuery;
n@1116 9203 }
n@1116 9204
n@1116 9205
n@1116 9206
n@1116 9207
n@1116 9208 return jQuery;
n@1116 9209
n@1116 9210 }));