annotate jquery-2.1.4.js @ 749:07c996307cbd

Bug #1510 Fixed.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Mon, 21 Dec 2015 11:53:05 +0000
parents
children
rev   line source
n@749 1 /*!
n@749 2 * jQuery JavaScript Library v2.1.4
n@749 3 * http://jquery.com/
n@749 4 *
n@749 5 * Includes Sizzle.js
n@749 6 * http://sizzlejs.com/
n@749 7 *
n@749 8 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
n@749 9 * Released under the MIT license
n@749 10 * http://jquery.org/license
n@749 11 *
n@749 12 * Date: 2015-04-28T16:01Z
n@749 13 */
n@749 14
n@749 15 (function( global, factory ) {
n@749 16
n@749 17 if ( typeof module === "object" && typeof module.exports === "object" ) {
n@749 18 // For CommonJS and CommonJS-like environments where a proper `window`
n@749 19 // is present, execute the factory and get jQuery.
n@749 20 // For environments that do not have a `window` with a `document`
n@749 21 // (such as Node.js), expose a factory as module.exports.
n@749 22 // This accentuates the need for the creation of a real `window`.
n@749 23 // e.g. var jQuery = require("jquery")(window);
n@749 24 // See ticket #14549 for more info.
n@749 25 module.exports = global.document ?
n@749 26 factory( global, true ) :
n@749 27 function( w ) {
n@749 28 if ( !w.document ) {
n@749 29 throw new Error( "jQuery requires a window with a document" );
n@749 30 }
n@749 31 return factory( w );
n@749 32 };
n@749 33 } else {
n@749 34 factory( global );
n@749 35 }
n@749 36
n@749 37 // Pass this if window is not defined yet
n@749 38 }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
n@749 39
n@749 40 // Support: Firefox 18+
n@749 41 // Can't be in strict mode, several libs including ASP.NET trace
n@749 42 // the stack via arguments.caller.callee and Firefox dies if
n@749 43 // you try to trace through "use strict" call chains. (#13335)
n@749 44 //
n@749 45
n@749 46 var arr = [];
n@749 47
n@749 48 var slice = arr.slice;
n@749 49
n@749 50 var concat = arr.concat;
n@749 51
n@749 52 var push = arr.push;
n@749 53
n@749 54 var indexOf = arr.indexOf;
n@749 55
n@749 56 var class2type = {};
n@749 57
n@749 58 var toString = class2type.toString;
n@749 59
n@749 60 var hasOwn = class2type.hasOwnProperty;
n@749 61
n@749 62 var support = {};
n@749 63
n@749 64
n@749 65
n@749 66 var
n@749 67 // Use the correct document accordingly with window argument (sandbox)
n@749 68 document = window.document,
n@749 69
n@749 70 version = "2.1.4",
n@749 71
n@749 72 // Define a local copy of jQuery
n@749 73 jQuery = function( selector, context ) {
n@749 74 // The jQuery object is actually just the init constructor 'enhanced'
n@749 75 // Need init if jQuery is called (just allow error to be thrown if not included)
n@749 76 return new jQuery.fn.init( selector, context );
n@749 77 },
n@749 78
n@749 79 // Support: Android<4.1
n@749 80 // Make sure we trim BOM and NBSP
n@749 81 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
n@749 82
n@749 83 // Matches dashed string for camelizing
n@749 84 rmsPrefix = /^-ms-/,
n@749 85 rdashAlpha = /-([\da-z])/gi,
n@749 86
n@749 87 // Used by jQuery.camelCase as callback to replace()
n@749 88 fcamelCase = function( all, letter ) {
n@749 89 return letter.toUpperCase();
n@749 90 };
n@749 91
n@749 92 jQuery.fn = jQuery.prototype = {
n@749 93 // The current version of jQuery being used
n@749 94 jquery: version,
n@749 95
n@749 96 constructor: jQuery,
n@749 97
n@749 98 // Start with an empty selector
n@749 99 selector: "",
n@749 100
n@749 101 // The default length of a jQuery object is 0
n@749 102 length: 0,
n@749 103
n@749 104 toArray: function() {
n@749 105 return slice.call( this );
n@749 106 },
n@749 107
n@749 108 // Get the Nth element in the matched element set OR
n@749 109 // Get the whole matched element set as a clean array
n@749 110 get: function( num ) {
n@749 111 return num != null ?
n@749 112
n@749 113 // Return just the one element from the set
n@749 114 ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
n@749 115
n@749 116 // Return all the elements in a clean array
n@749 117 slice.call( this );
n@749 118 },
n@749 119
n@749 120 // Take an array of elements and push it onto the stack
n@749 121 // (returning the new matched element set)
n@749 122 pushStack: function( elems ) {
n@749 123
n@749 124 // Build a new jQuery matched element set
n@749 125 var ret = jQuery.merge( this.constructor(), elems );
n@749 126
n@749 127 // Add the old object onto the stack (as a reference)
n@749 128 ret.prevObject = this;
n@749 129 ret.context = this.context;
n@749 130
n@749 131 // Return the newly-formed element set
n@749 132 return ret;
n@749 133 },
n@749 134
n@749 135 // Execute a callback for every element in the matched set.
n@749 136 // (You can seed the arguments with an array of args, but this is
n@749 137 // only used internally.)
n@749 138 each: function( callback, args ) {
n@749 139 return jQuery.each( this, callback, args );
n@749 140 },
n@749 141
n@749 142 map: function( callback ) {
n@749 143 return this.pushStack( jQuery.map(this, function( elem, i ) {
n@749 144 return callback.call( elem, i, elem );
n@749 145 }));
n@749 146 },
n@749 147
n@749 148 slice: function() {
n@749 149 return this.pushStack( slice.apply( this, arguments ) );
n@749 150 },
n@749 151
n@749 152 first: function() {
n@749 153 return this.eq( 0 );
n@749 154 },
n@749 155
n@749 156 last: function() {
n@749 157 return this.eq( -1 );
n@749 158 },
n@749 159
n@749 160 eq: function( i ) {
n@749 161 var len = this.length,
n@749 162 j = +i + ( i < 0 ? len : 0 );
n@749 163 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
n@749 164 },
n@749 165
n@749 166 end: function() {
n@749 167 return this.prevObject || this.constructor(null);
n@749 168 },
n@749 169
n@749 170 // For internal use only.
n@749 171 // Behaves like an Array's method, not like a jQuery method.
n@749 172 push: push,
n@749 173 sort: arr.sort,
n@749 174 splice: arr.splice
n@749 175 };
n@749 176
n@749 177 jQuery.extend = jQuery.fn.extend = function() {
n@749 178 var options, name, src, copy, copyIsArray, clone,
n@749 179 target = arguments[0] || {},
n@749 180 i = 1,
n@749 181 length = arguments.length,
n@749 182 deep = false;
n@749 183
n@749 184 // Handle a deep copy situation
n@749 185 if ( typeof target === "boolean" ) {
n@749 186 deep = target;
n@749 187
n@749 188 // Skip the boolean and the target
n@749 189 target = arguments[ i ] || {};
n@749 190 i++;
n@749 191 }
n@749 192
n@749 193 // Handle case when target is a string or something (possible in deep copy)
n@749 194 if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
n@749 195 target = {};
n@749 196 }
n@749 197
n@749 198 // Extend jQuery itself if only one argument is passed
n@749 199 if ( i === length ) {
n@749 200 target = this;
n@749 201 i--;
n@749 202 }
n@749 203
n@749 204 for ( ; i < length; i++ ) {
n@749 205 // Only deal with non-null/undefined values
n@749 206 if ( (options = arguments[ i ]) != null ) {
n@749 207 // Extend the base object
n@749 208 for ( name in options ) {
n@749 209 src = target[ name ];
n@749 210 copy = options[ name ];
n@749 211
n@749 212 // Prevent never-ending loop
n@749 213 if ( target === copy ) {
n@749 214 continue;
n@749 215 }
n@749 216
n@749 217 // Recurse if we're merging plain objects or arrays
n@749 218 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
n@749 219 if ( copyIsArray ) {
n@749 220 copyIsArray = false;
n@749 221 clone = src && jQuery.isArray(src) ? src : [];
n@749 222
n@749 223 } else {
n@749 224 clone = src && jQuery.isPlainObject(src) ? src : {};
n@749 225 }
n@749 226
n@749 227 // Never move original objects, clone them
n@749 228 target[ name ] = jQuery.extend( deep, clone, copy );
n@749 229
n@749 230 // Don't bring in undefined values
n@749 231 } else if ( copy !== undefined ) {
n@749 232 target[ name ] = copy;
n@749 233 }
n@749 234 }
n@749 235 }
n@749 236 }
n@749 237
n@749 238 // Return the modified object
n@749 239 return target;
n@749 240 };
n@749 241
n@749 242 jQuery.extend({
n@749 243 // Unique for each copy of jQuery on the page
n@749 244 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
n@749 245
n@749 246 // Assume jQuery is ready without the ready module
n@749 247 isReady: true,
n@749 248
n@749 249 error: function( msg ) {
n@749 250 throw new Error( msg );
n@749 251 },
n@749 252
n@749 253 noop: function() {},
n@749 254
n@749 255 isFunction: function( obj ) {
n@749 256 return jQuery.type(obj) === "function";
n@749 257 },
n@749 258
n@749 259 isArray: Array.isArray,
n@749 260
n@749 261 isWindow: function( obj ) {
n@749 262 return obj != null && obj === obj.window;
n@749 263 },
n@749 264
n@749 265 isNumeric: function( obj ) {
n@749 266 // parseFloat NaNs numeric-cast false positives (null|true|false|"")
n@749 267 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
n@749 268 // subtraction forces infinities to NaN
n@749 269 // adding 1 corrects loss of precision from parseFloat (#15100)
n@749 270 return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
n@749 271 },
n@749 272
n@749 273 isPlainObject: function( obj ) {
n@749 274 // Not plain objects:
n@749 275 // - Any object or value whose internal [[Class]] property is not "[object Object]"
n@749 276 // - DOM nodes
n@749 277 // - window
n@749 278 if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
n@749 279 return false;
n@749 280 }
n@749 281
n@749 282 if ( obj.constructor &&
n@749 283 !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
n@749 284 return false;
n@749 285 }
n@749 286
n@749 287 // If the function hasn't returned already, we're confident that
n@749 288 // |obj| is a plain object, created by {} or constructed with new Object
n@749 289 return true;
n@749 290 },
n@749 291
n@749 292 isEmptyObject: function( obj ) {
n@749 293 var name;
n@749 294 for ( name in obj ) {
n@749 295 return false;
n@749 296 }
n@749 297 return true;
n@749 298 },
n@749 299
n@749 300 type: function( obj ) {
n@749 301 if ( obj == null ) {
n@749 302 return obj + "";
n@749 303 }
n@749 304 // Support: Android<4.0, iOS<6 (functionish RegExp)
n@749 305 return typeof obj === "object" || typeof obj === "function" ?
n@749 306 class2type[ toString.call(obj) ] || "object" :
n@749 307 typeof obj;
n@749 308 },
n@749 309
n@749 310 // Evaluates a script in a global context
n@749 311 globalEval: function( code ) {
n@749 312 var script,
n@749 313 indirect = eval;
n@749 314
n@749 315 code = jQuery.trim( code );
n@749 316
n@749 317 if ( code ) {
n@749 318 // If the code includes a valid, prologue position
n@749 319 // strict mode pragma, execute code by injecting a
n@749 320 // script tag into the document.
n@749 321 if ( code.indexOf("use strict") === 1 ) {
n@749 322 script = document.createElement("script");
n@749 323 script.text = code;
n@749 324 document.head.appendChild( script ).parentNode.removeChild( script );
n@749 325 } else {
n@749 326 // Otherwise, avoid the DOM node creation, insertion
n@749 327 // and removal by using an indirect global eval
n@749 328 indirect( code );
n@749 329 }
n@749 330 }
n@749 331 },
n@749 332
n@749 333 // Convert dashed to camelCase; used by the css and data modules
n@749 334 // Support: IE9-11+
n@749 335 // Microsoft forgot to hump their vendor prefix (#9572)
n@749 336 camelCase: function( string ) {
n@749 337 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
n@749 338 },
n@749 339
n@749 340 nodeName: function( elem, name ) {
n@749 341 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
n@749 342 },
n@749 343
n@749 344 // args is for internal usage only
n@749 345 each: function( obj, callback, args ) {
n@749 346 var value,
n@749 347 i = 0,
n@749 348 length = obj.length,
n@749 349 isArray = isArraylike( obj );
n@749 350
n@749 351 if ( args ) {
n@749 352 if ( isArray ) {
n@749 353 for ( ; i < length; i++ ) {
n@749 354 value = callback.apply( obj[ i ], args );
n@749 355
n@749 356 if ( value === false ) {
n@749 357 break;
n@749 358 }
n@749 359 }
n@749 360 } else {
n@749 361 for ( i in obj ) {
n@749 362 value = callback.apply( obj[ i ], args );
n@749 363
n@749 364 if ( value === false ) {
n@749 365 break;
n@749 366 }
n@749 367 }
n@749 368 }
n@749 369
n@749 370 // A special, fast, case for the most common use of each
n@749 371 } else {
n@749 372 if ( isArray ) {
n@749 373 for ( ; i < length; i++ ) {
n@749 374 value = callback.call( obj[ i ], i, obj[ i ] );
n@749 375
n@749 376 if ( value === false ) {
n@749 377 break;
n@749 378 }
n@749 379 }
n@749 380 } else {
n@749 381 for ( i in obj ) {
n@749 382 value = callback.call( obj[ i ], i, obj[ i ] );
n@749 383
n@749 384 if ( value === false ) {
n@749 385 break;
n@749 386 }
n@749 387 }
n@749 388 }
n@749 389 }
n@749 390
n@749 391 return obj;
n@749 392 },
n@749 393
n@749 394 // Support: Android<4.1
n@749 395 trim: function( text ) {
n@749 396 return text == null ?
n@749 397 "" :
n@749 398 ( text + "" ).replace( rtrim, "" );
n@749 399 },
n@749 400
n@749 401 // results is for internal usage only
n@749 402 makeArray: function( arr, results ) {
n@749 403 var ret = results || [];
n@749 404
n@749 405 if ( arr != null ) {
n@749 406 if ( isArraylike( Object(arr) ) ) {
n@749 407 jQuery.merge( ret,
n@749 408 typeof arr === "string" ?
n@749 409 [ arr ] : arr
n@749 410 );
n@749 411 } else {
n@749 412 push.call( ret, arr );
n@749 413 }
n@749 414 }
n@749 415
n@749 416 return ret;
n@749 417 },
n@749 418
n@749 419 inArray: function( elem, arr, i ) {
n@749 420 return arr == null ? -1 : indexOf.call( arr, elem, i );
n@749 421 },
n@749 422
n@749 423 merge: function( first, second ) {
n@749 424 var len = +second.length,
n@749 425 j = 0,
n@749 426 i = first.length;
n@749 427
n@749 428 for ( ; j < len; j++ ) {
n@749 429 first[ i++ ] = second[ j ];
n@749 430 }
n@749 431
n@749 432 first.length = i;
n@749 433
n@749 434 return first;
n@749 435 },
n@749 436
n@749 437 grep: function( elems, callback, invert ) {
n@749 438 var callbackInverse,
n@749 439 matches = [],
n@749 440 i = 0,
n@749 441 length = elems.length,
n@749 442 callbackExpect = !invert;
n@749 443
n@749 444 // Go through the array, only saving the items
n@749 445 // that pass the validator function
n@749 446 for ( ; i < length; i++ ) {
n@749 447 callbackInverse = !callback( elems[ i ], i );
n@749 448 if ( callbackInverse !== callbackExpect ) {
n@749 449 matches.push( elems[ i ] );
n@749 450 }
n@749 451 }
n@749 452
n@749 453 return matches;
n@749 454 },
n@749 455
n@749 456 // arg is for internal usage only
n@749 457 map: function( elems, callback, arg ) {
n@749 458 var value,
n@749 459 i = 0,
n@749 460 length = elems.length,
n@749 461 isArray = isArraylike( elems ),
n@749 462 ret = [];
n@749 463
n@749 464 // Go through the array, translating each of the items to their new values
n@749 465 if ( isArray ) {
n@749 466 for ( ; i < length; i++ ) {
n@749 467 value = callback( elems[ i ], i, arg );
n@749 468
n@749 469 if ( value != null ) {
n@749 470 ret.push( value );
n@749 471 }
n@749 472 }
n@749 473
n@749 474 // Go through every key on the object,
n@749 475 } else {
n@749 476 for ( i in elems ) {
n@749 477 value = callback( elems[ i ], i, arg );
n@749 478
n@749 479 if ( value != null ) {
n@749 480 ret.push( value );
n@749 481 }
n@749 482 }
n@749 483 }
n@749 484
n@749 485 // Flatten any nested arrays
n@749 486 return concat.apply( [], ret );
n@749 487 },
n@749 488
n@749 489 // A global GUID counter for objects
n@749 490 guid: 1,
n@749 491
n@749 492 // Bind a function to a context, optionally partially applying any
n@749 493 // arguments.
n@749 494 proxy: function( fn, context ) {
n@749 495 var tmp, args, proxy;
n@749 496
n@749 497 if ( typeof context === "string" ) {
n@749 498 tmp = fn[ context ];
n@749 499 context = fn;
n@749 500 fn = tmp;
n@749 501 }
n@749 502
n@749 503 // Quick check to determine if target is callable, in the spec
n@749 504 // this throws a TypeError, but we will just return undefined.
n@749 505 if ( !jQuery.isFunction( fn ) ) {
n@749 506 return undefined;
n@749 507 }
n@749 508
n@749 509 // Simulated bind
n@749 510 args = slice.call( arguments, 2 );
n@749 511 proxy = function() {
n@749 512 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
n@749 513 };
n@749 514
n@749 515 // Set the guid of unique handler to the same of original handler, so it can be removed
n@749 516 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
n@749 517
n@749 518 return proxy;
n@749 519 },
n@749 520
n@749 521 now: Date.now,
n@749 522
n@749 523 // jQuery.support is not used in Core but other projects attach their
n@749 524 // properties to it so it needs to exist.
n@749 525 support: support
n@749 526 });
n@749 527
n@749 528 // Populate the class2type map
n@749 529 jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
n@749 530 class2type[ "[object " + name + "]" ] = name.toLowerCase();
n@749 531 });
n@749 532
n@749 533 function isArraylike( obj ) {
n@749 534
n@749 535 // Support: iOS 8.2 (not reproducible in simulator)
n@749 536 // `in` check used to prevent JIT error (gh-2145)
n@749 537 // hasOwn isn't used here due to false negatives
n@749 538 // regarding Nodelist length in IE
n@749 539 var length = "length" in obj && obj.length,
n@749 540 type = jQuery.type( obj );
n@749 541
n@749 542 if ( type === "function" || jQuery.isWindow( obj ) ) {
n@749 543 return false;
n@749 544 }
n@749 545
n@749 546 if ( obj.nodeType === 1 && length ) {
n@749 547 return true;
n@749 548 }
n@749 549
n@749 550 return type === "array" || length === 0 ||
n@749 551 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
n@749 552 }
n@749 553 var Sizzle =
n@749 554 /*!
n@749 555 * Sizzle CSS Selector Engine v2.2.0-pre
n@749 556 * http://sizzlejs.com/
n@749 557 *
n@749 558 * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
n@749 559 * Released under the MIT license
n@749 560 * http://jquery.org/license
n@749 561 *
n@749 562 * Date: 2014-12-16
n@749 563 */
n@749 564 (function( window ) {
n@749 565
n@749 566 var i,
n@749 567 support,
n@749 568 Expr,
n@749 569 getText,
n@749 570 isXML,
n@749 571 tokenize,
n@749 572 compile,
n@749 573 select,
n@749 574 outermostContext,
n@749 575 sortInput,
n@749 576 hasDuplicate,
n@749 577
n@749 578 // Local document vars
n@749 579 setDocument,
n@749 580 document,
n@749 581 docElem,
n@749 582 documentIsHTML,
n@749 583 rbuggyQSA,
n@749 584 rbuggyMatches,
n@749 585 matches,
n@749 586 contains,
n@749 587
n@749 588 // Instance-specific data
n@749 589 expando = "sizzle" + 1 * new Date(),
n@749 590 preferredDoc = window.document,
n@749 591 dirruns = 0,
n@749 592 done = 0,
n@749 593 classCache = createCache(),
n@749 594 tokenCache = createCache(),
n@749 595 compilerCache = createCache(),
n@749 596 sortOrder = function( a, b ) {
n@749 597 if ( a === b ) {
n@749 598 hasDuplicate = true;
n@749 599 }
n@749 600 return 0;
n@749 601 },
n@749 602
n@749 603 // General-purpose constants
n@749 604 MAX_NEGATIVE = 1 << 31,
n@749 605
n@749 606 // Instance methods
n@749 607 hasOwn = ({}).hasOwnProperty,
n@749 608 arr = [],
n@749 609 pop = arr.pop,
n@749 610 push_native = arr.push,
n@749 611 push = arr.push,
n@749 612 slice = arr.slice,
n@749 613 // Use a stripped-down indexOf as it's faster than native
n@749 614 // http://jsperf.com/thor-indexof-vs-for/5
n@749 615 indexOf = function( list, elem ) {
n@749 616 var i = 0,
n@749 617 len = list.length;
n@749 618 for ( ; i < len; i++ ) {
n@749 619 if ( list[i] === elem ) {
n@749 620 return i;
n@749 621 }
n@749 622 }
n@749 623 return -1;
n@749 624 },
n@749 625
n@749 626 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
n@749 627
n@749 628 // Regular expressions
n@749 629
n@749 630 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
n@749 631 whitespace = "[\\x20\\t\\r\\n\\f]",
n@749 632 // http://www.w3.org/TR/css3-syntax/#characters
n@749 633 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
n@749 634
n@749 635 // Loosely modeled on CSS identifier characters
n@749 636 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
n@749 637 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
n@749 638 identifier = characterEncoding.replace( "w", "w#" ),
n@749 639
n@749 640 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
n@749 641 attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
n@749 642 // Operator (capture 2)
n@749 643 "*([*^$|!~]?=)" + whitespace +
n@749 644 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
n@749 645 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
n@749 646 "*\\]",
n@749 647
n@749 648 pseudos = ":(" + characterEncoding + ")(?:\\((" +
n@749 649 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
n@749 650 // 1. quoted (capture 3; capture 4 or capture 5)
n@749 651 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
n@749 652 // 2. simple (capture 6)
n@749 653 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
n@749 654 // 3. anything else (capture 2)
n@749 655 ".*" +
n@749 656 ")\\)|)",
n@749 657
n@749 658 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
n@749 659 rwhitespace = new RegExp( whitespace + "+", "g" ),
n@749 660 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
n@749 661
n@749 662 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
n@749 663 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
n@749 664
n@749 665 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
n@749 666
n@749 667 rpseudo = new RegExp( pseudos ),
n@749 668 ridentifier = new RegExp( "^" + identifier + "$" ),
n@749 669
n@749 670 matchExpr = {
n@749 671 "ID": new RegExp( "^#(" + characterEncoding + ")" ),
n@749 672 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
n@749 673 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
n@749 674 "ATTR": new RegExp( "^" + attributes ),
n@749 675 "PSEUDO": new RegExp( "^" + pseudos ),
n@749 676 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
n@749 677 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
n@749 678 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
n@749 679 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
n@749 680 // For use in libraries implementing .is()
n@749 681 // We use this for POS matching in `select`
n@749 682 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
n@749 683 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
n@749 684 },
n@749 685
n@749 686 rinputs = /^(?:input|select|textarea|button)$/i,
n@749 687 rheader = /^h\d$/i,
n@749 688
n@749 689 rnative = /^[^{]+\{\s*\[native \w/,
n@749 690
n@749 691 // Easily-parseable/retrievable ID or TAG or CLASS selectors
n@749 692 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
n@749 693
n@749 694 rsibling = /[+~]/,
n@749 695 rescape = /'|\\/g,
n@749 696
n@749 697 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
n@749 698 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
n@749 699 funescape = function( _, escaped, escapedWhitespace ) {
n@749 700 var high = "0x" + escaped - 0x10000;
n@749 701 // NaN means non-codepoint
n@749 702 // Support: Firefox<24
n@749 703 // Workaround erroneous numeric interpretation of +"0x"
n@749 704 return high !== high || escapedWhitespace ?
n@749 705 escaped :
n@749 706 high < 0 ?
n@749 707 // BMP codepoint
n@749 708 String.fromCharCode( high + 0x10000 ) :
n@749 709 // Supplemental Plane codepoint (surrogate pair)
n@749 710 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
n@749 711 },
n@749 712
n@749 713 // Used for iframes
n@749 714 // See setDocument()
n@749 715 // Removing the function wrapper causes a "Permission Denied"
n@749 716 // error in IE
n@749 717 unloadHandler = function() {
n@749 718 setDocument();
n@749 719 };
n@749 720
n@749 721 // Optimize for push.apply( _, NodeList )
n@749 722 try {
n@749 723 push.apply(
n@749 724 (arr = slice.call( preferredDoc.childNodes )),
n@749 725 preferredDoc.childNodes
n@749 726 );
n@749 727 // Support: Android<4.0
n@749 728 // Detect silently failing push.apply
n@749 729 arr[ preferredDoc.childNodes.length ].nodeType;
n@749 730 } catch ( e ) {
n@749 731 push = { apply: arr.length ?
n@749 732
n@749 733 // Leverage slice if possible
n@749 734 function( target, els ) {
n@749 735 push_native.apply( target, slice.call(els) );
n@749 736 } :
n@749 737
n@749 738 // Support: IE<9
n@749 739 // Otherwise append directly
n@749 740 function( target, els ) {
n@749 741 var j = target.length,
n@749 742 i = 0;
n@749 743 // Can't trust NodeList.length
n@749 744 while ( (target[j++] = els[i++]) ) {}
n@749 745 target.length = j - 1;
n@749 746 }
n@749 747 };
n@749 748 }
n@749 749
n@749 750 function Sizzle( selector, context, results, seed ) {
n@749 751 var match, elem, m, nodeType,
n@749 752 // QSA vars
n@749 753 i, groups, old, nid, newContext, newSelector;
n@749 754
n@749 755 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
n@749 756 setDocument( context );
n@749 757 }
n@749 758
n@749 759 context = context || document;
n@749 760 results = results || [];
n@749 761 nodeType = context.nodeType;
n@749 762
n@749 763 if ( typeof selector !== "string" || !selector ||
n@749 764 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
n@749 765
n@749 766 return results;
n@749 767 }
n@749 768
n@749 769 if ( !seed && documentIsHTML ) {
n@749 770
n@749 771 // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
n@749 772 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
n@749 773 // Speed-up: Sizzle("#ID")
n@749 774 if ( (m = match[1]) ) {
n@749 775 if ( nodeType === 9 ) {
n@749 776 elem = context.getElementById( m );
n@749 777 // Check parentNode to catch when Blackberry 4.6 returns
n@749 778 // nodes that are no longer in the document (jQuery #6963)
n@749 779 if ( elem && elem.parentNode ) {
n@749 780 // Handle the case where IE, Opera, and Webkit return items
n@749 781 // by name instead of ID
n@749 782 if ( elem.id === m ) {
n@749 783 results.push( elem );
n@749 784 return results;
n@749 785 }
n@749 786 } else {
n@749 787 return results;
n@749 788 }
n@749 789 } else {
n@749 790 // Context is not a document
n@749 791 if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
n@749 792 contains( context, elem ) && elem.id === m ) {
n@749 793 results.push( elem );
n@749 794 return results;
n@749 795 }
n@749 796 }
n@749 797
n@749 798 // Speed-up: Sizzle("TAG")
n@749 799 } else if ( match[2] ) {
n@749 800 push.apply( results, context.getElementsByTagName( selector ) );
n@749 801 return results;
n@749 802
n@749 803 // Speed-up: Sizzle(".CLASS")
n@749 804 } else if ( (m = match[3]) && support.getElementsByClassName ) {
n@749 805 push.apply( results, context.getElementsByClassName( m ) );
n@749 806 return results;
n@749 807 }
n@749 808 }
n@749 809
n@749 810 // QSA path
n@749 811 if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
n@749 812 nid = old = expando;
n@749 813 newContext = context;
n@749 814 newSelector = nodeType !== 1 && selector;
n@749 815
n@749 816 // qSA works strangely on Element-rooted queries
n@749 817 // We can work around this by specifying an extra ID on the root
n@749 818 // and working up from there (Thanks to Andrew Dupont for the technique)
n@749 819 // IE 8 doesn't work on object elements
n@749 820 if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
n@749 821 groups = tokenize( selector );
n@749 822
n@749 823 if ( (old = context.getAttribute("id")) ) {
n@749 824 nid = old.replace( rescape, "\\$&" );
n@749 825 } else {
n@749 826 context.setAttribute( "id", nid );
n@749 827 }
n@749 828 nid = "[id='" + nid + "'] ";
n@749 829
n@749 830 i = groups.length;
n@749 831 while ( i-- ) {
n@749 832 groups[i] = nid + toSelector( groups[i] );
n@749 833 }
n@749 834 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
n@749 835 newSelector = groups.join(",");
n@749 836 }
n@749 837
n@749 838 if ( newSelector ) {
n@749 839 try {
n@749 840 push.apply( results,
n@749 841 newContext.querySelectorAll( newSelector )
n@749 842 );
n@749 843 return results;
n@749 844 } catch(qsaError) {
n@749 845 } finally {
n@749 846 if ( !old ) {
n@749 847 context.removeAttribute("id");
n@749 848 }
n@749 849 }
n@749 850 }
n@749 851 }
n@749 852 }
n@749 853
n@749 854 // All others
n@749 855 return select( selector.replace( rtrim, "$1" ), context, results, seed );
n@749 856 }
n@749 857
n@749 858 /**
n@749 859 * Create key-value caches of limited size
n@749 860 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
n@749 861 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
n@749 862 * deleting the oldest entry
n@749 863 */
n@749 864 function createCache() {
n@749 865 var keys = [];
n@749 866
n@749 867 function cache( key, value ) {
n@749 868 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
n@749 869 if ( keys.push( key + " " ) > Expr.cacheLength ) {
n@749 870 // Only keep the most recent entries
n@749 871 delete cache[ keys.shift() ];
n@749 872 }
n@749 873 return (cache[ key + " " ] = value);
n@749 874 }
n@749 875 return cache;
n@749 876 }
n@749 877
n@749 878 /**
n@749 879 * Mark a function for special use by Sizzle
n@749 880 * @param {Function} fn The function to mark
n@749 881 */
n@749 882 function markFunction( fn ) {
n@749 883 fn[ expando ] = true;
n@749 884 return fn;
n@749 885 }
n@749 886
n@749 887 /**
n@749 888 * Support testing using an element
n@749 889 * @param {Function} fn Passed the created div and expects a boolean result
n@749 890 */
n@749 891 function assert( fn ) {
n@749 892 var div = document.createElement("div");
n@749 893
n@749 894 try {
n@749 895 return !!fn( div );
n@749 896 } catch (e) {
n@749 897 return false;
n@749 898 } finally {
n@749 899 // Remove from its parent by default
n@749 900 if ( div.parentNode ) {
n@749 901 div.parentNode.removeChild( div );
n@749 902 }
n@749 903 // release memory in IE
n@749 904 div = null;
n@749 905 }
n@749 906 }
n@749 907
n@749 908 /**
n@749 909 * Adds the same handler for all of the specified attrs
n@749 910 * @param {String} attrs Pipe-separated list of attributes
n@749 911 * @param {Function} handler The method that will be applied
n@749 912 */
n@749 913 function addHandle( attrs, handler ) {
n@749 914 var arr = attrs.split("|"),
n@749 915 i = attrs.length;
n@749 916
n@749 917 while ( i-- ) {
n@749 918 Expr.attrHandle[ arr[i] ] = handler;
n@749 919 }
n@749 920 }
n@749 921
n@749 922 /**
n@749 923 * Checks document order of two siblings
n@749 924 * @param {Element} a
n@749 925 * @param {Element} b
n@749 926 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
n@749 927 */
n@749 928 function siblingCheck( a, b ) {
n@749 929 var cur = b && a,
n@749 930 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
n@749 931 ( ~b.sourceIndex || MAX_NEGATIVE ) -
n@749 932 ( ~a.sourceIndex || MAX_NEGATIVE );
n@749 933
n@749 934 // Use IE sourceIndex if available on both nodes
n@749 935 if ( diff ) {
n@749 936 return diff;
n@749 937 }
n@749 938
n@749 939 // Check if b follows a
n@749 940 if ( cur ) {
n@749 941 while ( (cur = cur.nextSibling) ) {
n@749 942 if ( cur === b ) {
n@749 943 return -1;
n@749 944 }
n@749 945 }
n@749 946 }
n@749 947
n@749 948 return a ? 1 : -1;
n@749 949 }
n@749 950
n@749 951 /**
n@749 952 * Returns a function to use in pseudos for input types
n@749 953 * @param {String} type
n@749 954 */
n@749 955 function createInputPseudo( type ) {
n@749 956 return function( elem ) {
n@749 957 var name = elem.nodeName.toLowerCase();
n@749 958 return name === "input" && elem.type === type;
n@749 959 };
n@749 960 }
n@749 961
n@749 962 /**
n@749 963 * Returns a function to use in pseudos for buttons
n@749 964 * @param {String} type
n@749 965 */
n@749 966 function createButtonPseudo( type ) {
n@749 967 return function( elem ) {
n@749 968 var name = elem.nodeName.toLowerCase();
n@749 969 return (name === "input" || name === "button") && elem.type === type;
n@749 970 };
n@749 971 }
n@749 972
n@749 973 /**
n@749 974 * Returns a function to use in pseudos for positionals
n@749 975 * @param {Function} fn
n@749 976 */
n@749 977 function createPositionalPseudo( fn ) {
n@749 978 return markFunction(function( argument ) {
n@749 979 argument = +argument;
n@749 980 return markFunction(function( seed, matches ) {
n@749 981 var j,
n@749 982 matchIndexes = fn( [], seed.length, argument ),
n@749 983 i = matchIndexes.length;
n@749 984
n@749 985 // Match elements found at the specified indexes
n@749 986 while ( i-- ) {
n@749 987 if ( seed[ (j = matchIndexes[i]) ] ) {
n@749 988 seed[j] = !(matches[j] = seed[j]);
n@749 989 }
n@749 990 }
n@749 991 });
n@749 992 });
n@749 993 }
n@749 994
n@749 995 /**
n@749 996 * Checks a node for validity as a Sizzle context
n@749 997 * @param {Element|Object=} context
n@749 998 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
n@749 999 */
n@749 1000 function testContext( context ) {
n@749 1001 return context && typeof context.getElementsByTagName !== "undefined" && context;
n@749 1002 }
n@749 1003
n@749 1004 // Expose support vars for convenience
n@749 1005 support = Sizzle.support = {};
n@749 1006
n@749 1007 /**
n@749 1008 * Detects XML nodes
n@749 1009 * @param {Element|Object} elem An element or a document
n@749 1010 * @returns {Boolean} True iff elem is a non-HTML XML node
n@749 1011 */
n@749 1012 isXML = Sizzle.isXML = function( elem ) {
n@749 1013 // documentElement is verified for cases where it doesn't yet exist
n@749 1014 // (such as loading iframes in IE - #4833)
n@749 1015 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
n@749 1016 return documentElement ? documentElement.nodeName !== "HTML" : false;
n@749 1017 };
n@749 1018
n@749 1019 /**
n@749 1020 * Sets document-related variables once based on the current document
n@749 1021 * @param {Element|Object} [doc] An element or document object to use to set the document
n@749 1022 * @returns {Object} Returns the current document
n@749 1023 */
n@749 1024 setDocument = Sizzle.setDocument = function( node ) {
n@749 1025 var hasCompare, parent,
n@749 1026 doc = node ? node.ownerDocument || node : preferredDoc;
n@749 1027
n@749 1028 // If no document and documentElement is available, return
n@749 1029 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
n@749 1030 return document;
n@749 1031 }
n@749 1032
n@749 1033 // Set our document
n@749 1034 document = doc;
n@749 1035 docElem = doc.documentElement;
n@749 1036 parent = doc.defaultView;
n@749 1037
n@749 1038 // Support: IE>8
n@749 1039 // If iframe document is assigned to "document" variable and if iframe has been reloaded,
n@749 1040 // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
n@749 1041 // IE6-8 do not support the defaultView property so parent will be undefined
n@749 1042 if ( parent && parent !== parent.top ) {
n@749 1043 // IE11 does not have attachEvent, so all must suffer
n@749 1044 if ( parent.addEventListener ) {
n@749 1045 parent.addEventListener( "unload", unloadHandler, false );
n@749 1046 } else if ( parent.attachEvent ) {
n@749 1047 parent.attachEvent( "onunload", unloadHandler );
n@749 1048 }
n@749 1049 }
n@749 1050
n@749 1051 /* Support tests
n@749 1052 ---------------------------------------------------------------------- */
n@749 1053 documentIsHTML = !isXML( doc );
n@749 1054
n@749 1055 /* Attributes
n@749 1056 ---------------------------------------------------------------------- */
n@749 1057
n@749 1058 // Support: IE<8
n@749 1059 // Verify that getAttribute really returns attributes and not properties
n@749 1060 // (excepting IE8 booleans)
n@749 1061 support.attributes = assert(function( div ) {
n@749 1062 div.className = "i";
n@749 1063 return !div.getAttribute("className");
n@749 1064 });
n@749 1065
n@749 1066 /* getElement(s)By*
n@749 1067 ---------------------------------------------------------------------- */
n@749 1068
n@749 1069 // Check if getElementsByTagName("*") returns only elements
n@749 1070 support.getElementsByTagName = assert(function( div ) {
n@749 1071 div.appendChild( doc.createComment("") );
n@749 1072 return !div.getElementsByTagName("*").length;
n@749 1073 });
n@749 1074
n@749 1075 // Support: IE<9
n@749 1076 support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
n@749 1077
n@749 1078 // Support: IE<10
n@749 1079 // Check if getElementById returns elements by name
n@749 1080 // The broken getElementById methods don't pick up programatically-set names,
n@749 1081 // so use a roundabout getElementsByName test
n@749 1082 support.getById = assert(function( div ) {
n@749 1083 docElem.appendChild( div ).id = expando;
n@749 1084 return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
n@749 1085 });
n@749 1086
n@749 1087 // ID find and filter
n@749 1088 if ( support.getById ) {
n@749 1089 Expr.find["ID"] = function( id, context ) {
n@749 1090 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
n@749 1091 var m = context.getElementById( id );
n@749 1092 // Check parentNode to catch when Blackberry 4.6 returns
n@749 1093 // nodes that are no longer in the document #6963
n@749 1094 return m && m.parentNode ? [ m ] : [];
n@749 1095 }
n@749 1096 };
n@749 1097 Expr.filter["ID"] = function( id ) {
n@749 1098 var attrId = id.replace( runescape, funescape );
n@749 1099 return function( elem ) {
n@749 1100 return elem.getAttribute("id") === attrId;
n@749 1101 };
n@749 1102 };
n@749 1103 } else {
n@749 1104 // Support: IE6/7
n@749 1105 // getElementById is not reliable as a find shortcut
n@749 1106 delete Expr.find["ID"];
n@749 1107
n@749 1108 Expr.filter["ID"] = function( id ) {
n@749 1109 var attrId = id.replace( runescape, funescape );
n@749 1110 return function( elem ) {
n@749 1111 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
n@749 1112 return node && node.value === attrId;
n@749 1113 };
n@749 1114 };
n@749 1115 }
n@749 1116
n@749 1117 // Tag
n@749 1118 Expr.find["TAG"] = support.getElementsByTagName ?
n@749 1119 function( tag, context ) {
n@749 1120 if ( typeof context.getElementsByTagName !== "undefined" ) {
n@749 1121 return context.getElementsByTagName( tag );
n@749 1122
n@749 1123 // DocumentFragment nodes don't have gEBTN
n@749 1124 } else if ( support.qsa ) {
n@749 1125 return context.querySelectorAll( tag );
n@749 1126 }
n@749 1127 } :
n@749 1128
n@749 1129 function( tag, context ) {
n@749 1130 var elem,
n@749 1131 tmp = [],
n@749 1132 i = 0,
n@749 1133 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
n@749 1134 results = context.getElementsByTagName( tag );
n@749 1135
n@749 1136 // Filter out possible comments
n@749 1137 if ( tag === "*" ) {
n@749 1138 while ( (elem = results[i++]) ) {
n@749 1139 if ( elem.nodeType === 1 ) {
n@749 1140 tmp.push( elem );
n@749 1141 }
n@749 1142 }
n@749 1143
n@749 1144 return tmp;
n@749 1145 }
n@749 1146 return results;
n@749 1147 };
n@749 1148
n@749 1149 // Class
n@749 1150 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
n@749 1151 if ( documentIsHTML ) {
n@749 1152 return context.getElementsByClassName( className );
n@749 1153 }
n@749 1154 };
n@749 1155
n@749 1156 /* QSA/matchesSelector
n@749 1157 ---------------------------------------------------------------------- */
n@749 1158
n@749 1159 // QSA and matchesSelector support
n@749 1160
n@749 1161 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
n@749 1162 rbuggyMatches = [];
n@749 1163
n@749 1164 // qSa(:focus) reports false when true (Chrome 21)
n@749 1165 // We allow this because of a bug in IE8/9 that throws an error
n@749 1166 // whenever `document.activeElement` is accessed on an iframe
n@749 1167 // So, we allow :focus to pass through QSA all the time to avoid the IE error
n@749 1168 // See http://bugs.jquery.com/ticket/13378
n@749 1169 rbuggyQSA = [];
n@749 1170
n@749 1171 if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
n@749 1172 // Build QSA regex
n@749 1173 // Regex strategy adopted from Diego Perini
n@749 1174 assert(function( div ) {
n@749 1175 // Select is set to empty string on purpose
n@749 1176 // This is to test IE's treatment of not explicitly
n@749 1177 // setting a boolean content attribute,
n@749 1178 // since its presence should be enough
n@749 1179 // http://bugs.jquery.com/ticket/12359
n@749 1180 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
n@749 1181 "<select id='" + expando + "-\f]' msallowcapture=''>" +
n@749 1182 "<option selected=''></option></select>";
n@749 1183
n@749 1184 // Support: IE8, Opera 11-12.16
n@749 1185 // Nothing should be selected when empty strings follow ^= or $= or *=
n@749 1186 // The test attribute must be unknown in Opera but "safe" for WinRT
n@749 1187 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
n@749 1188 if ( div.querySelectorAll("[msallowcapture^='']").length ) {
n@749 1189 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
n@749 1190 }
n@749 1191
n@749 1192 // Support: IE8
n@749 1193 // Boolean attributes and "value" are not treated correctly
n@749 1194 if ( !div.querySelectorAll("[selected]").length ) {
n@749 1195 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
n@749 1196 }
n@749 1197
n@749 1198 // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
n@749 1199 if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
n@749 1200 rbuggyQSA.push("~=");
n@749 1201 }
n@749 1202
n@749 1203 // Webkit/Opera - :checked should return selected option elements
n@749 1204 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
n@749 1205 // IE8 throws error here and will not see later tests
n@749 1206 if ( !div.querySelectorAll(":checked").length ) {
n@749 1207 rbuggyQSA.push(":checked");
n@749 1208 }
n@749 1209
n@749 1210 // Support: Safari 8+, iOS 8+
n@749 1211 // https://bugs.webkit.org/show_bug.cgi?id=136851
n@749 1212 // In-page `selector#id sibing-combinator selector` fails
n@749 1213 if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
n@749 1214 rbuggyQSA.push(".#.+[+~]");
n@749 1215 }
n@749 1216 });
n@749 1217
n@749 1218 assert(function( div ) {
n@749 1219 // Support: Windows 8 Native Apps
n@749 1220 // The type and name attributes are restricted during .innerHTML assignment
n@749 1221 var input = doc.createElement("input");
n@749 1222 input.setAttribute( "type", "hidden" );
n@749 1223 div.appendChild( input ).setAttribute( "name", "D" );
n@749 1224
n@749 1225 // Support: IE8
n@749 1226 // Enforce case-sensitivity of name attribute
n@749 1227 if ( div.querySelectorAll("[name=d]").length ) {
n@749 1228 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
n@749 1229 }
n@749 1230
n@749 1231 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
n@749 1232 // IE8 throws error here and will not see later tests
n@749 1233 if ( !div.querySelectorAll(":enabled").length ) {
n@749 1234 rbuggyQSA.push( ":enabled", ":disabled" );
n@749 1235 }
n@749 1236
n@749 1237 // Opera 10-11 does not throw on post-comma invalid pseudos
n@749 1238 div.querySelectorAll("*,:x");
n@749 1239 rbuggyQSA.push(",.*:");
n@749 1240 });
n@749 1241 }
n@749 1242
n@749 1243 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
n@749 1244 docElem.webkitMatchesSelector ||
n@749 1245 docElem.mozMatchesSelector ||
n@749 1246 docElem.oMatchesSelector ||
n@749 1247 docElem.msMatchesSelector) )) ) {
n@749 1248
n@749 1249 assert(function( div ) {
n@749 1250 // Check to see if it's possible to do matchesSelector
n@749 1251 // on a disconnected node (IE 9)
n@749 1252 support.disconnectedMatch = matches.call( div, "div" );
n@749 1253
n@749 1254 // This should fail with an exception
n@749 1255 // Gecko does not error, returns false instead
n@749 1256 matches.call( div, "[s!='']:x" );
n@749 1257 rbuggyMatches.push( "!=", pseudos );
n@749 1258 });
n@749 1259 }
n@749 1260
n@749 1261 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
n@749 1262 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
n@749 1263
n@749 1264 /* Contains
n@749 1265 ---------------------------------------------------------------------- */
n@749 1266 hasCompare = rnative.test( docElem.compareDocumentPosition );
n@749 1267
n@749 1268 // Element contains another
n@749 1269 // Purposefully does not implement inclusive descendent
n@749 1270 // As in, an element does not contain itself
n@749 1271 contains = hasCompare || rnative.test( docElem.contains ) ?
n@749 1272 function( a, b ) {
n@749 1273 var adown = a.nodeType === 9 ? a.documentElement : a,
n@749 1274 bup = b && b.parentNode;
n@749 1275 return a === bup || !!( bup && bup.nodeType === 1 && (
n@749 1276 adown.contains ?
n@749 1277 adown.contains( bup ) :
n@749 1278 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
n@749 1279 ));
n@749 1280 } :
n@749 1281 function( a, b ) {
n@749 1282 if ( b ) {
n@749 1283 while ( (b = b.parentNode) ) {
n@749 1284 if ( b === a ) {
n@749 1285 return true;
n@749 1286 }
n@749 1287 }
n@749 1288 }
n@749 1289 return false;
n@749 1290 };
n@749 1291
n@749 1292 /* Sorting
n@749 1293 ---------------------------------------------------------------------- */
n@749 1294
n@749 1295 // Document order sorting
n@749 1296 sortOrder = hasCompare ?
n@749 1297 function( a, b ) {
n@749 1298
n@749 1299 // Flag for duplicate removal
n@749 1300 if ( a === b ) {
n@749 1301 hasDuplicate = true;
n@749 1302 return 0;
n@749 1303 }
n@749 1304
n@749 1305 // Sort on method existence if only one input has compareDocumentPosition
n@749 1306 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
n@749 1307 if ( compare ) {
n@749 1308 return compare;
n@749 1309 }
n@749 1310
n@749 1311 // Calculate position if both inputs belong to the same document
n@749 1312 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
n@749 1313 a.compareDocumentPosition( b ) :
n@749 1314
n@749 1315 // Otherwise we know they are disconnected
n@749 1316 1;
n@749 1317
n@749 1318 // Disconnected nodes
n@749 1319 if ( compare & 1 ||
n@749 1320 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
n@749 1321
n@749 1322 // Choose the first element that is related to our preferred document
n@749 1323 if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
n@749 1324 return -1;
n@749 1325 }
n@749 1326 if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
n@749 1327 return 1;
n@749 1328 }
n@749 1329
n@749 1330 // Maintain original order
n@749 1331 return sortInput ?
n@749 1332 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
n@749 1333 0;
n@749 1334 }
n@749 1335
n@749 1336 return compare & 4 ? -1 : 1;
n@749 1337 } :
n@749 1338 function( a, b ) {
n@749 1339 // Exit early if the nodes are identical
n@749 1340 if ( a === b ) {
n@749 1341 hasDuplicate = true;
n@749 1342 return 0;
n@749 1343 }
n@749 1344
n@749 1345 var cur,
n@749 1346 i = 0,
n@749 1347 aup = a.parentNode,
n@749 1348 bup = b.parentNode,
n@749 1349 ap = [ a ],
n@749 1350 bp = [ b ];
n@749 1351
n@749 1352 // Parentless nodes are either documents or disconnected
n@749 1353 if ( !aup || !bup ) {
n@749 1354 return a === doc ? -1 :
n@749 1355 b === doc ? 1 :
n@749 1356 aup ? -1 :
n@749 1357 bup ? 1 :
n@749 1358 sortInput ?
n@749 1359 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
n@749 1360 0;
n@749 1361
n@749 1362 // If the nodes are siblings, we can do a quick check
n@749 1363 } else if ( aup === bup ) {
n@749 1364 return siblingCheck( a, b );
n@749 1365 }
n@749 1366
n@749 1367 // Otherwise we need full lists of their ancestors for comparison
n@749 1368 cur = a;
n@749 1369 while ( (cur = cur.parentNode) ) {
n@749 1370 ap.unshift( cur );
n@749 1371 }
n@749 1372 cur = b;
n@749 1373 while ( (cur = cur.parentNode) ) {
n@749 1374 bp.unshift( cur );
n@749 1375 }
n@749 1376
n@749 1377 // Walk down the tree looking for a discrepancy
n@749 1378 while ( ap[i] === bp[i] ) {
n@749 1379 i++;
n@749 1380 }
n@749 1381
n@749 1382 return i ?
n@749 1383 // Do a sibling check if the nodes have a common ancestor
n@749 1384 siblingCheck( ap[i], bp[i] ) :
n@749 1385
n@749 1386 // Otherwise nodes in our document sort first
n@749 1387 ap[i] === preferredDoc ? -1 :
n@749 1388 bp[i] === preferredDoc ? 1 :
n@749 1389 0;
n@749 1390 };
n@749 1391
n@749 1392 return doc;
n@749 1393 };
n@749 1394
n@749 1395 Sizzle.matches = function( expr, elements ) {
n@749 1396 return Sizzle( expr, null, null, elements );
n@749 1397 };
n@749 1398
n@749 1399 Sizzle.matchesSelector = function( elem, expr ) {
n@749 1400 // Set document vars if needed
n@749 1401 if ( ( elem.ownerDocument || elem ) !== document ) {
n@749 1402 setDocument( elem );
n@749 1403 }
n@749 1404
n@749 1405 // Make sure that attribute selectors are quoted
n@749 1406 expr = expr.replace( rattributeQuotes, "='$1']" );
n@749 1407
n@749 1408 if ( support.matchesSelector && documentIsHTML &&
n@749 1409 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
n@749 1410 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
n@749 1411
n@749 1412 try {
n@749 1413 var ret = matches.call( elem, expr );
n@749 1414
n@749 1415 // IE 9's matchesSelector returns false on disconnected nodes
n@749 1416 if ( ret || support.disconnectedMatch ||
n@749 1417 // As well, disconnected nodes are said to be in a document
n@749 1418 // fragment in IE 9
n@749 1419 elem.document && elem.document.nodeType !== 11 ) {
n@749 1420 return ret;
n@749 1421 }
n@749 1422 } catch (e) {}
n@749 1423 }
n@749 1424
n@749 1425 return Sizzle( expr, document, null, [ elem ] ).length > 0;
n@749 1426 };
n@749 1427
n@749 1428 Sizzle.contains = function( context, elem ) {
n@749 1429 // Set document vars if needed
n@749 1430 if ( ( context.ownerDocument || context ) !== document ) {
n@749 1431 setDocument( context );
n@749 1432 }
n@749 1433 return contains( context, elem );
n@749 1434 };
n@749 1435
n@749 1436 Sizzle.attr = function( elem, name ) {
n@749 1437 // Set document vars if needed
n@749 1438 if ( ( elem.ownerDocument || elem ) !== document ) {
n@749 1439 setDocument( elem );
n@749 1440 }
n@749 1441
n@749 1442 var fn = Expr.attrHandle[ name.toLowerCase() ],
n@749 1443 // Don't get fooled by Object.prototype properties (jQuery #13807)
n@749 1444 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
n@749 1445 fn( elem, name, !documentIsHTML ) :
n@749 1446 undefined;
n@749 1447
n@749 1448 return val !== undefined ?
n@749 1449 val :
n@749 1450 support.attributes || !documentIsHTML ?
n@749 1451 elem.getAttribute( name ) :
n@749 1452 (val = elem.getAttributeNode(name)) && val.specified ?
n@749 1453 val.value :
n@749 1454 null;
n@749 1455 };
n@749 1456
n@749 1457 Sizzle.error = function( msg ) {
n@749 1458 throw new Error( "Syntax error, unrecognized expression: " + msg );
n@749 1459 };
n@749 1460
n@749 1461 /**
n@749 1462 * Document sorting and removing duplicates
n@749 1463 * @param {ArrayLike} results
n@749 1464 */
n@749 1465 Sizzle.uniqueSort = function( results ) {
n@749 1466 var elem,
n@749 1467 duplicates = [],
n@749 1468 j = 0,
n@749 1469 i = 0;
n@749 1470
n@749 1471 // Unless we *know* we can detect duplicates, assume their presence
n@749 1472 hasDuplicate = !support.detectDuplicates;
n@749 1473 sortInput = !support.sortStable && results.slice( 0 );
n@749 1474 results.sort( sortOrder );
n@749 1475
n@749 1476 if ( hasDuplicate ) {
n@749 1477 while ( (elem = results[i++]) ) {
n@749 1478 if ( elem === results[ i ] ) {
n@749 1479 j = duplicates.push( i );
n@749 1480 }
n@749 1481 }
n@749 1482 while ( j-- ) {
n@749 1483 results.splice( duplicates[ j ], 1 );
n@749 1484 }
n@749 1485 }
n@749 1486
n@749 1487 // Clear input after sorting to release objects
n@749 1488 // See https://github.com/jquery/sizzle/pull/225
n@749 1489 sortInput = null;
n@749 1490
n@749 1491 return results;
n@749 1492 };
n@749 1493
n@749 1494 /**
n@749 1495 * Utility function for retrieving the text value of an array of DOM nodes
n@749 1496 * @param {Array|Element} elem
n@749 1497 */
n@749 1498 getText = Sizzle.getText = function( elem ) {
n@749 1499 var node,
n@749 1500 ret = "",
n@749 1501 i = 0,
n@749 1502 nodeType = elem.nodeType;
n@749 1503
n@749 1504 if ( !nodeType ) {
n@749 1505 // If no nodeType, this is expected to be an array
n@749 1506 while ( (node = elem[i++]) ) {
n@749 1507 // Do not traverse comment nodes
n@749 1508 ret += getText( node );
n@749 1509 }
n@749 1510 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
n@749 1511 // Use textContent for elements
n@749 1512 // innerText usage removed for consistency of new lines (jQuery #11153)
n@749 1513 if ( typeof elem.textContent === "string" ) {
n@749 1514 return elem.textContent;
n@749 1515 } else {
n@749 1516 // Traverse its children
n@749 1517 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
n@749 1518 ret += getText( elem );
n@749 1519 }
n@749 1520 }
n@749 1521 } else if ( nodeType === 3 || nodeType === 4 ) {
n@749 1522 return elem.nodeValue;
n@749 1523 }
n@749 1524 // Do not include comment or processing instruction nodes
n@749 1525
n@749 1526 return ret;
n@749 1527 };
n@749 1528
n@749 1529 Expr = Sizzle.selectors = {
n@749 1530
n@749 1531 // Can be adjusted by the user
n@749 1532 cacheLength: 50,
n@749 1533
n@749 1534 createPseudo: markFunction,
n@749 1535
n@749 1536 match: matchExpr,
n@749 1537
n@749 1538 attrHandle: {},
n@749 1539
n@749 1540 find: {},
n@749 1541
n@749 1542 relative: {
n@749 1543 ">": { dir: "parentNode", first: true },
n@749 1544 " ": { dir: "parentNode" },
n@749 1545 "+": { dir: "previousSibling", first: true },
n@749 1546 "~": { dir: "previousSibling" }
n@749 1547 },
n@749 1548
n@749 1549 preFilter: {
n@749 1550 "ATTR": function( match ) {
n@749 1551 match[1] = match[1].replace( runescape, funescape );
n@749 1552
n@749 1553 // Move the given value to match[3] whether quoted or unquoted
n@749 1554 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
n@749 1555
n@749 1556 if ( match[2] === "~=" ) {
n@749 1557 match[3] = " " + match[3] + " ";
n@749 1558 }
n@749 1559
n@749 1560 return match.slice( 0, 4 );
n@749 1561 },
n@749 1562
n@749 1563 "CHILD": function( match ) {
n@749 1564 /* matches from matchExpr["CHILD"]
n@749 1565 1 type (only|nth|...)
n@749 1566 2 what (child|of-type)
n@749 1567 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
n@749 1568 4 xn-component of xn+y argument ([+-]?\d*n|)
n@749 1569 5 sign of xn-component
n@749 1570 6 x of xn-component
n@749 1571 7 sign of y-component
n@749 1572 8 y of y-component
n@749 1573 */
n@749 1574 match[1] = match[1].toLowerCase();
n@749 1575
n@749 1576 if ( match[1].slice( 0, 3 ) === "nth" ) {
n@749 1577 // nth-* requires argument
n@749 1578 if ( !match[3] ) {
n@749 1579 Sizzle.error( match[0] );
n@749 1580 }
n@749 1581
n@749 1582 // numeric x and y parameters for Expr.filter.CHILD
n@749 1583 // remember that false/true cast respectively to 0/1
n@749 1584 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
n@749 1585 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
n@749 1586
n@749 1587 // other types prohibit arguments
n@749 1588 } else if ( match[3] ) {
n@749 1589 Sizzle.error( match[0] );
n@749 1590 }
n@749 1591
n@749 1592 return match;
n@749 1593 },
n@749 1594
n@749 1595 "PSEUDO": function( match ) {
n@749 1596 var excess,
n@749 1597 unquoted = !match[6] && match[2];
n@749 1598
n@749 1599 if ( matchExpr["CHILD"].test( match[0] ) ) {
n@749 1600 return null;
n@749 1601 }
n@749 1602
n@749 1603 // Accept quoted arguments as-is
n@749 1604 if ( match[3] ) {
n@749 1605 match[2] = match[4] || match[5] || "";
n@749 1606
n@749 1607 // Strip excess characters from unquoted arguments
n@749 1608 } else if ( unquoted && rpseudo.test( unquoted ) &&
n@749 1609 // Get excess from tokenize (recursively)
n@749 1610 (excess = tokenize( unquoted, true )) &&
n@749 1611 // advance to the next closing parenthesis
n@749 1612 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
n@749 1613
n@749 1614 // excess is a negative index
n@749 1615 match[0] = match[0].slice( 0, excess );
n@749 1616 match[2] = unquoted.slice( 0, excess );
n@749 1617 }
n@749 1618
n@749 1619 // Return only captures needed by the pseudo filter method (type and argument)
n@749 1620 return match.slice( 0, 3 );
n@749 1621 }
n@749 1622 },
n@749 1623
n@749 1624 filter: {
n@749 1625
n@749 1626 "TAG": function( nodeNameSelector ) {
n@749 1627 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
n@749 1628 return nodeNameSelector === "*" ?
n@749 1629 function() { return true; } :
n@749 1630 function( elem ) {
n@749 1631 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
n@749 1632 };
n@749 1633 },
n@749 1634
n@749 1635 "CLASS": function( className ) {
n@749 1636 var pattern = classCache[ className + " " ];
n@749 1637
n@749 1638 return pattern ||
n@749 1639 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
n@749 1640 classCache( className, function( elem ) {
n@749 1641 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
n@749 1642 });
n@749 1643 },
n@749 1644
n@749 1645 "ATTR": function( name, operator, check ) {
n@749 1646 return function( elem ) {
n@749 1647 var result = Sizzle.attr( elem, name );
n@749 1648
n@749 1649 if ( result == null ) {
n@749 1650 return operator === "!=";
n@749 1651 }
n@749 1652 if ( !operator ) {
n@749 1653 return true;
n@749 1654 }
n@749 1655
n@749 1656 result += "";
n@749 1657
n@749 1658 return operator === "=" ? result === check :
n@749 1659 operator === "!=" ? result !== check :
n@749 1660 operator === "^=" ? check && result.indexOf( check ) === 0 :
n@749 1661 operator === "*=" ? check && result.indexOf( check ) > -1 :
n@749 1662 operator === "$=" ? check && result.slice( -check.length ) === check :
n@749 1663 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
n@749 1664 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
n@749 1665 false;
n@749 1666 };
n@749 1667 },
n@749 1668
n@749 1669 "CHILD": function( type, what, argument, first, last ) {
n@749 1670 var simple = type.slice( 0, 3 ) !== "nth",
n@749 1671 forward = type.slice( -4 ) !== "last",
n@749 1672 ofType = what === "of-type";
n@749 1673
n@749 1674 return first === 1 && last === 0 ?
n@749 1675
n@749 1676 // Shortcut for :nth-*(n)
n@749 1677 function( elem ) {
n@749 1678 return !!elem.parentNode;
n@749 1679 } :
n@749 1680
n@749 1681 function( elem, context, xml ) {
n@749 1682 var cache, outerCache, node, diff, nodeIndex, start,
n@749 1683 dir = simple !== forward ? "nextSibling" : "previousSibling",
n@749 1684 parent = elem.parentNode,
n@749 1685 name = ofType && elem.nodeName.toLowerCase(),
n@749 1686 useCache = !xml && !ofType;
n@749 1687
n@749 1688 if ( parent ) {
n@749 1689
n@749 1690 // :(first|last|only)-(child|of-type)
n@749 1691 if ( simple ) {
n@749 1692 while ( dir ) {
n@749 1693 node = elem;
n@749 1694 while ( (node = node[ dir ]) ) {
n@749 1695 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
n@749 1696 return false;
n@749 1697 }
n@749 1698 }
n@749 1699 // Reverse direction for :only-* (if we haven't yet done so)
n@749 1700 start = dir = type === "only" && !start && "nextSibling";
n@749 1701 }
n@749 1702 return true;
n@749 1703 }
n@749 1704
n@749 1705 start = [ forward ? parent.firstChild : parent.lastChild ];
n@749 1706
n@749 1707 // non-xml :nth-child(...) stores cache data on `parent`
n@749 1708 if ( forward && useCache ) {
n@749 1709 // Seek `elem` from a previously-cached index
n@749 1710 outerCache = parent[ expando ] || (parent[ expando ] = {});
n@749 1711 cache = outerCache[ type ] || [];
n@749 1712 nodeIndex = cache[0] === dirruns && cache[1];
n@749 1713 diff = cache[0] === dirruns && cache[2];
n@749 1714 node = nodeIndex && parent.childNodes[ nodeIndex ];
n@749 1715
n@749 1716 while ( (node = ++nodeIndex && node && node[ dir ] ||
n@749 1717
n@749 1718 // Fallback to seeking `elem` from the start
n@749 1719 (diff = nodeIndex = 0) || start.pop()) ) {
n@749 1720
n@749 1721 // When found, cache indexes on `parent` and break
n@749 1722 if ( node.nodeType === 1 && ++diff && node === elem ) {
n@749 1723 outerCache[ type ] = [ dirruns, nodeIndex, diff ];
n@749 1724 break;
n@749 1725 }
n@749 1726 }
n@749 1727
n@749 1728 // Use previously-cached element index if available
n@749 1729 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
n@749 1730 diff = cache[1];
n@749 1731
n@749 1732 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
n@749 1733 } else {
n@749 1734 // Use the same loop as above to seek `elem` from the start
n@749 1735 while ( (node = ++nodeIndex && node && node[ dir ] ||
n@749 1736 (diff = nodeIndex = 0) || start.pop()) ) {
n@749 1737
n@749 1738 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
n@749 1739 // Cache the index of each encountered element
n@749 1740 if ( useCache ) {
n@749 1741 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
n@749 1742 }
n@749 1743
n@749 1744 if ( node === elem ) {
n@749 1745 break;
n@749 1746 }
n@749 1747 }
n@749 1748 }
n@749 1749 }
n@749 1750
n@749 1751 // Incorporate the offset, then check against cycle size
n@749 1752 diff -= last;
n@749 1753 return diff === first || ( diff % first === 0 && diff / first >= 0 );
n@749 1754 }
n@749 1755 };
n@749 1756 },
n@749 1757
n@749 1758 "PSEUDO": function( pseudo, argument ) {
n@749 1759 // pseudo-class names are case-insensitive
n@749 1760 // http://www.w3.org/TR/selectors/#pseudo-classes
n@749 1761 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
n@749 1762 // Remember that setFilters inherits from pseudos
n@749 1763 var args,
n@749 1764 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
n@749 1765 Sizzle.error( "unsupported pseudo: " + pseudo );
n@749 1766
n@749 1767 // The user may use createPseudo to indicate that
n@749 1768 // arguments are needed to create the filter function
n@749 1769 // just as Sizzle does
n@749 1770 if ( fn[ expando ] ) {
n@749 1771 return fn( argument );
n@749 1772 }
n@749 1773
n@749 1774 // But maintain support for old signatures
n@749 1775 if ( fn.length > 1 ) {
n@749 1776 args = [ pseudo, pseudo, "", argument ];
n@749 1777 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
n@749 1778 markFunction(function( seed, matches ) {
n@749 1779 var idx,
n@749 1780 matched = fn( seed, argument ),
n@749 1781 i = matched.length;
n@749 1782 while ( i-- ) {
n@749 1783 idx = indexOf( seed, matched[i] );
n@749 1784 seed[ idx ] = !( matches[ idx ] = matched[i] );
n@749 1785 }
n@749 1786 }) :
n@749 1787 function( elem ) {
n@749 1788 return fn( elem, 0, args );
n@749 1789 };
n@749 1790 }
n@749 1791
n@749 1792 return fn;
n@749 1793 }
n@749 1794 },
n@749 1795
n@749 1796 pseudos: {
n@749 1797 // Potentially complex pseudos
n@749 1798 "not": markFunction(function( selector ) {
n@749 1799 // Trim the selector passed to compile
n@749 1800 // to avoid treating leading and trailing
n@749 1801 // spaces as combinators
n@749 1802 var input = [],
n@749 1803 results = [],
n@749 1804 matcher = compile( selector.replace( rtrim, "$1" ) );
n@749 1805
n@749 1806 return matcher[ expando ] ?
n@749 1807 markFunction(function( seed, matches, context, xml ) {
n@749 1808 var elem,
n@749 1809 unmatched = matcher( seed, null, xml, [] ),
n@749 1810 i = seed.length;
n@749 1811
n@749 1812 // Match elements unmatched by `matcher`
n@749 1813 while ( i-- ) {
n@749 1814 if ( (elem = unmatched[i]) ) {
n@749 1815 seed[i] = !(matches[i] = elem);
n@749 1816 }
n@749 1817 }
n@749 1818 }) :
n@749 1819 function( elem, context, xml ) {
n@749 1820 input[0] = elem;
n@749 1821 matcher( input, null, xml, results );
n@749 1822 // Don't keep the element (issue #299)
n@749 1823 input[0] = null;
n@749 1824 return !results.pop();
n@749 1825 };
n@749 1826 }),
n@749 1827
n@749 1828 "has": markFunction(function( selector ) {
n@749 1829 return function( elem ) {
n@749 1830 return Sizzle( selector, elem ).length > 0;
n@749 1831 };
n@749 1832 }),
n@749 1833
n@749 1834 "contains": markFunction(function( text ) {
n@749 1835 text = text.replace( runescape, funescape );
n@749 1836 return function( elem ) {
n@749 1837 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
n@749 1838 };
n@749 1839 }),
n@749 1840
n@749 1841 // "Whether an element is represented by a :lang() selector
n@749 1842 // is based solely on the element's language value
n@749 1843 // being equal to the identifier C,
n@749 1844 // or beginning with the identifier C immediately followed by "-".
n@749 1845 // The matching of C against the element's language value is performed case-insensitively.
n@749 1846 // The identifier C does not have to be a valid language name."
n@749 1847 // http://www.w3.org/TR/selectors/#lang-pseudo
n@749 1848 "lang": markFunction( function( lang ) {
n@749 1849 // lang value must be a valid identifier
n@749 1850 if ( !ridentifier.test(lang || "") ) {
n@749 1851 Sizzle.error( "unsupported lang: " + lang );
n@749 1852 }
n@749 1853 lang = lang.replace( runescape, funescape ).toLowerCase();
n@749 1854 return function( elem ) {
n@749 1855 var elemLang;
n@749 1856 do {
n@749 1857 if ( (elemLang = documentIsHTML ?
n@749 1858 elem.lang :
n@749 1859 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
n@749 1860
n@749 1861 elemLang = elemLang.toLowerCase();
n@749 1862 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
n@749 1863 }
n@749 1864 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
n@749 1865 return false;
n@749 1866 };
n@749 1867 }),
n@749 1868
n@749 1869 // Miscellaneous
n@749 1870 "target": function( elem ) {
n@749 1871 var hash = window.location && window.location.hash;
n@749 1872 return hash && hash.slice( 1 ) === elem.id;
n@749 1873 },
n@749 1874
n@749 1875 "root": function( elem ) {
n@749 1876 return elem === docElem;
n@749 1877 },
n@749 1878
n@749 1879 "focus": function( elem ) {
n@749 1880 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
n@749 1881 },
n@749 1882
n@749 1883 // Boolean properties
n@749 1884 "enabled": function( elem ) {
n@749 1885 return elem.disabled === false;
n@749 1886 },
n@749 1887
n@749 1888 "disabled": function( elem ) {
n@749 1889 return elem.disabled === true;
n@749 1890 },
n@749 1891
n@749 1892 "checked": function( elem ) {
n@749 1893 // In CSS3, :checked should return both checked and selected elements
n@749 1894 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
n@749 1895 var nodeName = elem.nodeName.toLowerCase();
n@749 1896 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
n@749 1897 },
n@749 1898
n@749 1899 "selected": function( elem ) {
n@749 1900 // Accessing this property makes selected-by-default
n@749 1901 // options in Safari work properly
n@749 1902 if ( elem.parentNode ) {
n@749 1903 elem.parentNode.selectedIndex;
n@749 1904 }
n@749 1905
n@749 1906 return elem.selected === true;
n@749 1907 },
n@749 1908
n@749 1909 // Contents
n@749 1910 "empty": function( elem ) {
n@749 1911 // http://www.w3.org/TR/selectors/#empty-pseudo
n@749 1912 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
n@749 1913 // but not by others (comment: 8; processing instruction: 7; etc.)
n@749 1914 // nodeType < 6 works because attributes (2) do not appear as children
n@749 1915 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
n@749 1916 if ( elem.nodeType < 6 ) {
n@749 1917 return false;
n@749 1918 }
n@749 1919 }
n@749 1920 return true;
n@749 1921 },
n@749 1922
n@749 1923 "parent": function( elem ) {
n@749 1924 return !Expr.pseudos["empty"]( elem );
n@749 1925 },
n@749 1926
n@749 1927 // Element/input types
n@749 1928 "header": function( elem ) {
n@749 1929 return rheader.test( elem.nodeName );
n@749 1930 },
n@749 1931
n@749 1932 "input": function( elem ) {
n@749 1933 return rinputs.test( elem.nodeName );
n@749 1934 },
n@749 1935
n@749 1936 "button": function( elem ) {
n@749 1937 var name = elem.nodeName.toLowerCase();
n@749 1938 return name === "input" && elem.type === "button" || name === "button";
n@749 1939 },
n@749 1940
n@749 1941 "text": function( elem ) {
n@749 1942 var attr;
n@749 1943 return elem.nodeName.toLowerCase() === "input" &&
n@749 1944 elem.type === "text" &&
n@749 1945
n@749 1946 // Support: IE<8
n@749 1947 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
n@749 1948 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
n@749 1949 },
n@749 1950
n@749 1951 // Position-in-collection
n@749 1952 "first": createPositionalPseudo(function() {
n@749 1953 return [ 0 ];
n@749 1954 }),
n@749 1955
n@749 1956 "last": createPositionalPseudo(function( matchIndexes, length ) {
n@749 1957 return [ length - 1 ];
n@749 1958 }),
n@749 1959
n@749 1960 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
n@749 1961 return [ argument < 0 ? argument + length : argument ];
n@749 1962 }),
n@749 1963
n@749 1964 "even": createPositionalPseudo(function( matchIndexes, length ) {
n@749 1965 var i = 0;
n@749 1966 for ( ; i < length; i += 2 ) {
n@749 1967 matchIndexes.push( i );
n@749 1968 }
n@749 1969 return matchIndexes;
n@749 1970 }),
n@749 1971
n@749 1972 "odd": createPositionalPseudo(function( matchIndexes, length ) {
n@749 1973 var i = 1;
n@749 1974 for ( ; i < length; i += 2 ) {
n@749 1975 matchIndexes.push( i );
n@749 1976 }
n@749 1977 return matchIndexes;
n@749 1978 }),
n@749 1979
n@749 1980 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
n@749 1981 var i = argument < 0 ? argument + length : argument;
n@749 1982 for ( ; --i >= 0; ) {
n@749 1983 matchIndexes.push( i );
n@749 1984 }
n@749 1985 return matchIndexes;
n@749 1986 }),
n@749 1987
n@749 1988 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
n@749 1989 var i = argument < 0 ? argument + length : argument;
n@749 1990 for ( ; ++i < length; ) {
n@749 1991 matchIndexes.push( i );
n@749 1992 }
n@749 1993 return matchIndexes;
n@749 1994 })
n@749 1995 }
n@749 1996 };
n@749 1997
n@749 1998 Expr.pseudos["nth"] = Expr.pseudos["eq"];
n@749 1999
n@749 2000 // Add button/input type pseudos
n@749 2001 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
n@749 2002 Expr.pseudos[ i ] = createInputPseudo( i );
n@749 2003 }
n@749 2004 for ( i in { submit: true, reset: true } ) {
n@749 2005 Expr.pseudos[ i ] = createButtonPseudo( i );
n@749 2006 }
n@749 2007
n@749 2008 // Easy API for creating new setFilters
n@749 2009 function setFilters() {}
n@749 2010 setFilters.prototype = Expr.filters = Expr.pseudos;
n@749 2011 Expr.setFilters = new setFilters();
n@749 2012
n@749 2013 tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
n@749 2014 var matched, match, tokens, type,
n@749 2015 soFar, groups, preFilters,
n@749 2016 cached = tokenCache[ selector + " " ];
n@749 2017
n@749 2018 if ( cached ) {
n@749 2019 return parseOnly ? 0 : cached.slice( 0 );
n@749 2020 }
n@749 2021
n@749 2022 soFar = selector;
n@749 2023 groups = [];
n@749 2024 preFilters = Expr.preFilter;
n@749 2025
n@749 2026 while ( soFar ) {
n@749 2027
n@749 2028 // Comma and first run
n@749 2029 if ( !matched || (match = rcomma.exec( soFar )) ) {
n@749 2030 if ( match ) {
n@749 2031 // Don't consume trailing commas as valid
n@749 2032 soFar = soFar.slice( match[0].length ) || soFar;
n@749 2033 }
n@749 2034 groups.push( (tokens = []) );
n@749 2035 }
n@749 2036
n@749 2037 matched = false;
n@749 2038
n@749 2039 // Combinators
n@749 2040 if ( (match = rcombinators.exec( soFar )) ) {
n@749 2041 matched = match.shift();
n@749 2042 tokens.push({
n@749 2043 value: matched,
n@749 2044 // Cast descendant combinators to space
n@749 2045 type: match[0].replace( rtrim, " " )
n@749 2046 });
n@749 2047 soFar = soFar.slice( matched.length );
n@749 2048 }
n@749 2049
n@749 2050 // Filters
n@749 2051 for ( type in Expr.filter ) {
n@749 2052 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
n@749 2053 (match = preFilters[ type ]( match ))) ) {
n@749 2054 matched = match.shift();
n@749 2055 tokens.push({
n@749 2056 value: matched,
n@749 2057 type: type,
n@749 2058 matches: match
n@749 2059 });
n@749 2060 soFar = soFar.slice( matched.length );
n@749 2061 }
n@749 2062 }
n@749 2063
n@749 2064 if ( !matched ) {
n@749 2065 break;
n@749 2066 }
n@749 2067 }
n@749 2068
n@749 2069 // Return the length of the invalid excess
n@749 2070 // if we're just parsing
n@749 2071 // Otherwise, throw an error or return tokens
n@749 2072 return parseOnly ?
n@749 2073 soFar.length :
n@749 2074 soFar ?
n@749 2075 Sizzle.error( selector ) :
n@749 2076 // Cache the tokens
n@749 2077 tokenCache( selector, groups ).slice( 0 );
n@749 2078 };
n@749 2079
n@749 2080 function toSelector( tokens ) {
n@749 2081 var i = 0,
n@749 2082 len = tokens.length,
n@749 2083 selector = "";
n@749 2084 for ( ; i < len; i++ ) {
n@749 2085 selector += tokens[i].value;
n@749 2086 }
n@749 2087 return selector;
n@749 2088 }
n@749 2089
n@749 2090 function addCombinator( matcher, combinator, base ) {
n@749 2091 var dir = combinator.dir,
n@749 2092 checkNonElements = base && dir === "parentNode",
n@749 2093 doneName = done++;
n@749 2094
n@749 2095 return combinator.first ?
n@749 2096 // Check against closest ancestor/preceding element
n@749 2097 function( elem, context, xml ) {
n@749 2098 while ( (elem = elem[ dir ]) ) {
n@749 2099 if ( elem.nodeType === 1 || checkNonElements ) {
n@749 2100 return matcher( elem, context, xml );
n@749 2101 }
n@749 2102 }
n@749 2103 } :
n@749 2104
n@749 2105 // Check against all ancestor/preceding elements
n@749 2106 function( elem, context, xml ) {
n@749 2107 var oldCache, outerCache,
n@749 2108 newCache = [ dirruns, doneName ];
n@749 2109
n@749 2110 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
n@749 2111 if ( xml ) {
n@749 2112 while ( (elem = elem[ dir ]) ) {
n@749 2113 if ( elem.nodeType === 1 || checkNonElements ) {
n@749 2114 if ( matcher( elem, context, xml ) ) {
n@749 2115 return true;
n@749 2116 }
n@749 2117 }
n@749 2118 }
n@749 2119 } else {
n@749 2120 while ( (elem = elem[ dir ]) ) {
n@749 2121 if ( elem.nodeType === 1 || checkNonElements ) {
n@749 2122 outerCache = elem[ expando ] || (elem[ expando ] = {});
n@749 2123 if ( (oldCache = outerCache[ dir ]) &&
n@749 2124 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
n@749 2125
n@749 2126 // Assign to newCache so results back-propagate to previous elements
n@749 2127 return (newCache[ 2 ] = oldCache[ 2 ]);
n@749 2128 } else {
n@749 2129 // Reuse newcache so results back-propagate to previous elements
n@749 2130 outerCache[ dir ] = newCache;
n@749 2131
n@749 2132 // A match means we're done; a fail means we have to keep checking
n@749 2133 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
n@749 2134 return true;
n@749 2135 }
n@749 2136 }
n@749 2137 }
n@749 2138 }
n@749 2139 }
n@749 2140 };
n@749 2141 }
n@749 2142
n@749 2143 function elementMatcher( matchers ) {
n@749 2144 return matchers.length > 1 ?
n@749 2145 function( elem, context, xml ) {
n@749 2146 var i = matchers.length;
n@749 2147 while ( i-- ) {
n@749 2148 if ( !matchers[i]( elem, context, xml ) ) {
n@749 2149 return false;
n@749 2150 }
n@749 2151 }
n@749 2152 return true;
n@749 2153 } :
n@749 2154 matchers[0];
n@749 2155 }
n@749 2156
n@749 2157 function multipleContexts( selector, contexts, results ) {
n@749 2158 var i = 0,
n@749 2159 len = contexts.length;
n@749 2160 for ( ; i < len; i++ ) {
n@749 2161 Sizzle( selector, contexts[i], results );
n@749 2162 }
n@749 2163 return results;
n@749 2164 }
n@749 2165
n@749 2166 function condense( unmatched, map, filter, context, xml ) {
n@749 2167 var elem,
n@749 2168 newUnmatched = [],
n@749 2169 i = 0,
n@749 2170 len = unmatched.length,
n@749 2171 mapped = map != null;
n@749 2172
n@749 2173 for ( ; i < len; i++ ) {
n@749 2174 if ( (elem = unmatched[i]) ) {
n@749 2175 if ( !filter || filter( elem, context, xml ) ) {
n@749 2176 newUnmatched.push( elem );
n@749 2177 if ( mapped ) {
n@749 2178 map.push( i );
n@749 2179 }
n@749 2180 }
n@749 2181 }
n@749 2182 }
n@749 2183
n@749 2184 return newUnmatched;
n@749 2185 }
n@749 2186
n@749 2187 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
n@749 2188 if ( postFilter && !postFilter[ expando ] ) {
n@749 2189 postFilter = setMatcher( postFilter );
n@749 2190 }
n@749 2191 if ( postFinder && !postFinder[ expando ] ) {
n@749 2192 postFinder = setMatcher( postFinder, postSelector );
n@749 2193 }
n@749 2194 return markFunction(function( seed, results, context, xml ) {
n@749 2195 var temp, i, elem,
n@749 2196 preMap = [],
n@749 2197 postMap = [],
n@749 2198 preexisting = results.length,
n@749 2199
n@749 2200 // Get initial elements from seed or context
n@749 2201 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
n@749 2202
n@749 2203 // Prefilter to get matcher input, preserving a map for seed-results synchronization
n@749 2204 matcherIn = preFilter && ( seed || !selector ) ?
n@749 2205 condense( elems, preMap, preFilter, context, xml ) :
n@749 2206 elems,
n@749 2207
n@749 2208 matcherOut = matcher ?
n@749 2209 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
n@749 2210 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
n@749 2211
n@749 2212 // ...intermediate processing is necessary
n@749 2213 [] :
n@749 2214
n@749 2215 // ...otherwise use results directly
n@749 2216 results :
n@749 2217 matcherIn;
n@749 2218
n@749 2219 // Find primary matches
n@749 2220 if ( matcher ) {
n@749 2221 matcher( matcherIn, matcherOut, context, xml );
n@749 2222 }
n@749 2223
n@749 2224 // Apply postFilter
n@749 2225 if ( postFilter ) {
n@749 2226 temp = condense( matcherOut, postMap );
n@749 2227 postFilter( temp, [], context, xml );
n@749 2228
n@749 2229 // Un-match failing elements by moving them back to matcherIn
n@749 2230 i = temp.length;
n@749 2231 while ( i-- ) {
n@749 2232 if ( (elem = temp[i]) ) {
n@749 2233 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
n@749 2234 }
n@749 2235 }
n@749 2236 }
n@749 2237
n@749 2238 if ( seed ) {
n@749 2239 if ( postFinder || preFilter ) {
n@749 2240 if ( postFinder ) {
n@749 2241 // Get the final matcherOut by condensing this intermediate into postFinder contexts
n@749 2242 temp = [];
n@749 2243 i = matcherOut.length;
n@749 2244 while ( i-- ) {
n@749 2245 if ( (elem = matcherOut[i]) ) {
n@749 2246 // Restore matcherIn since elem is not yet a final match
n@749 2247 temp.push( (matcherIn[i] = elem) );
n@749 2248 }
n@749 2249 }
n@749 2250 postFinder( null, (matcherOut = []), temp, xml );
n@749 2251 }
n@749 2252
n@749 2253 // Move matched elements from seed to results to keep them synchronized
n@749 2254 i = matcherOut.length;
n@749 2255 while ( i-- ) {
n@749 2256 if ( (elem = matcherOut[i]) &&
n@749 2257 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
n@749 2258
n@749 2259 seed[temp] = !(results[temp] = elem);
n@749 2260 }
n@749 2261 }
n@749 2262 }
n@749 2263
n@749 2264 // Add elements to results, through postFinder if defined
n@749 2265 } else {
n@749 2266 matcherOut = condense(
n@749 2267 matcherOut === results ?
n@749 2268 matcherOut.splice( preexisting, matcherOut.length ) :
n@749 2269 matcherOut
n@749 2270 );
n@749 2271 if ( postFinder ) {
n@749 2272 postFinder( null, results, matcherOut, xml );
n@749 2273 } else {
n@749 2274 push.apply( results, matcherOut );
n@749 2275 }
n@749 2276 }
n@749 2277 });
n@749 2278 }
n@749 2279
n@749 2280 function matcherFromTokens( tokens ) {
n@749 2281 var checkContext, matcher, j,
n@749 2282 len = tokens.length,
n@749 2283 leadingRelative = Expr.relative[ tokens[0].type ],
n@749 2284 implicitRelative = leadingRelative || Expr.relative[" "],
n@749 2285 i = leadingRelative ? 1 : 0,
n@749 2286
n@749 2287 // The foundational matcher ensures that elements are reachable from top-level context(s)
n@749 2288 matchContext = addCombinator( function( elem ) {
n@749 2289 return elem === checkContext;
n@749 2290 }, implicitRelative, true ),
n@749 2291 matchAnyContext = addCombinator( function( elem ) {
n@749 2292 return indexOf( checkContext, elem ) > -1;
n@749 2293 }, implicitRelative, true ),
n@749 2294 matchers = [ function( elem, context, xml ) {
n@749 2295 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
n@749 2296 (checkContext = context).nodeType ?
n@749 2297 matchContext( elem, context, xml ) :
n@749 2298 matchAnyContext( elem, context, xml ) );
n@749 2299 // Avoid hanging onto element (issue #299)
n@749 2300 checkContext = null;
n@749 2301 return ret;
n@749 2302 } ];
n@749 2303
n@749 2304 for ( ; i < len; i++ ) {
n@749 2305 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
n@749 2306 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
n@749 2307 } else {
n@749 2308 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
n@749 2309
n@749 2310 // Return special upon seeing a positional matcher
n@749 2311 if ( matcher[ expando ] ) {
n@749 2312 // Find the next relative operator (if any) for proper handling
n@749 2313 j = ++i;
n@749 2314 for ( ; j < len; j++ ) {
n@749 2315 if ( Expr.relative[ tokens[j].type ] ) {
n@749 2316 break;
n@749 2317 }
n@749 2318 }
n@749 2319 return setMatcher(
n@749 2320 i > 1 && elementMatcher( matchers ),
n@749 2321 i > 1 && toSelector(
n@749 2322 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
n@749 2323 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
n@749 2324 ).replace( rtrim, "$1" ),
n@749 2325 matcher,
n@749 2326 i < j && matcherFromTokens( tokens.slice( i, j ) ),
n@749 2327 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
n@749 2328 j < len && toSelector( tokens )
n@749 2329 );
n@749 2330 }
n@749 2331 matchers.push( matcher );
n@749 2332 }
n@749 2333 }
n@749 2334
n@749 2335 return elementMatcher( matchers );
n@749 2336 }
n@749 2337
n@749 2338 function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
n@749 2339 var bySet = setMatchers.length > 0,
n@749 2340 byElement = elementMatchers.length > 0,
n@749 2341 superMatcher = function( seed, context, xml, results, outermost ) {
n@749 2342 var elem, j, matcher,
n@749 2343 matchedCount = 0,
n@749 2344 i = "0",
n@749 2345 unmatched = seed && [],
n@749 2346 setMatched = [],
n@749 2347 contextBackup = outermostContext,
n@749 2348 // We must always have either seed elements or outermost context
n@749 2349 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
n@749 2350 // Use integer dirruns iff this is the outermost matcher
n@749 2351 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
n@749 2352 len = elems.length;
n@749 2353
n@749 2354 if ( outermost ) {
n@749 2355 outermostContext = context !== document && context;
n@749 2356 }
n@749 2357
n@749 2358 // Add elements passing elementMatchers directly to results
n@749 2359 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
n@749 2360 // Support: IE<9, Safari
n@749 2361 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
n@749 2362 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
n@749 2363 if ( byElement && elem ) {
n@749 2364 j = 0;
n@749 2365 while ( (matcher = elementMatchers[j++]) ) {
n@749 2366 if ( matcher( elem, context, xml ) ) {
n@749 2367 results.push( elem );
n@749 2368 break;
n@749 2369 }
n@749 2370 }
n@749 2371 if ( outermost ) {
n@749 2372 dirruns = dirrunsUnique;
n@749 2373 }
n@749 2374 }
n@749 2375
n@749 2376 // Track unmatched elements for set filters
n@749 2377 if ( bySet ) {
n@749 2378 // They will have gone through all possible matchers
n@749 2379 if ( (elem = !matcher && elem) ) {
n@749 2380 matchedCount--;
n@749 2381 }
n@749 2382
n@749 2383 // Lengthen the array for every element, matched or not
n@749 2384 if ( seed ) {
n@749 2385 unmatched.push( elem );
n@749 2386 }
n@749 2387 }
n@749 2388 }
n@749 2389
n@749 2390 // Apply set filters to unmatched elements
n@749 2391 matchedCount += i;
n@749 2392 if ( bySet && i !== matchedCount ) {
n@749 2393 j = 0;
n@749 2394 while ( (matcher = setMatchers[j++]) ) {
n@749 2395 matcher( unmatched, setMatched, context, xml );
n@749 2396 }
n@749 2397
n@749 2398 if ( seed ) {
n@749 2399 // Reintegrate element matches to eliminate the need for sorting
n@749 2400 if ( matchedCount > 0 ) {
n@749 2401 while ( i-- ) {
n@749 2402 if ( !(unmatched[i] || setMatched[i]) ) {
n@749 2403 setMatched[i] = pop.call( results );
n@749 2404 }
n@749 2405 }
n@749 2406 }
n@749 2407
n@749 2408 // Discard index placeholder values to get only actual matches
n@749 2409 setMatched = condense( setMatched );
n@749 2410 }
n@749 2411
n@749 2412 // Add matches to results
n@749 2413 push.apply( results, setMatched );
n@749 2414
n@749 2415 // Seedless set matches succeeding multiple successful matchers stipulate sorting
n@749 2416 if ( outermost && !seed && setMatched.length > 0 &&
n@749 2417 ( matchedCount + setMatchers.length ) > 1 ) {
n@749 2418
n@749 2419 Sizzle.uniqueSort( results );
n@749 2420 }
n@749 2421 }
n@749 2422
n@749 2423 // Override manipulation of globals by nested matchers
n@749 2424 if ( outermost ) {
n@749 2425 dirruns = dirrunsUnique;
n@749 2426 outermostContext = contextBackup;
n@749 2427 }
n@749 2428
n@749 2429 return unmatched;
n@749 2430 };
n@749 2431
n@749 2432 return bySet ?
n@749 2433 markFunction( superMatcher ) :
n@749 2434 superMatcher;
n@749 2435 }
n@749 2436
n@749 2437 compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
n@749 2438 var i,
n@749 2439 setMatchers = [],
n@749 2440 elementMatchers = [],
n@749 2441 cached = compilerCache[ selector + " " ];
n@749 2442
n@749 2443 if ( !cached ) {
n@749 2444 // Generate a function of recursive functions that can be used to check each element
n@749 2445 if ( !match ) {
n@749 2446 match = tokenize( selector );
n@749 2447 }
n@749 2448 i = match.length;
n@749 2449 while ( i-- ) {
n@749 2450 cached = matcherFromTokens( match[i] );
n@749 2451 if ( cached[ expando ] ) {
n@749 2452 setMatchers.push( cached );
n@749 2453 } else {
n@749 2454 elementMatchers.push( cached );
n@749 2455 }
n@749 2456 }
n@749 2457
n@749 2458 // Cache the compiled function
n@749 2459 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
n@749 2460
n@749 2461 // Save selector and tokenization
n@749 2462 cached.selector = selector;
n@749 2463 }
n@749 2464 return cached;
n@749 2465 };
n@749 2466
n@749 2467 /**
n@749 2468 * A low-level selection function that works with Sizzle's compiled
n@749 2469 * selector functions
n@749 2470 * @param {String|Function} selector A selector or a pre-compiled
n@749 2471 * selector function built with Sizzle.compile
n@749 2472 * @param {Element} context
n@749 2473 * @param {Array} [results]
n@749 2474 * @param {Array} [seed] A set of elements to match against
n@749 2475 */
n@749 2476 select = Sizzle.select = function( selector, context, results, seed ) {
n@749 2477 var i, tokens, token, type, find,
n@749 2478 compiled = typeof selector === "function" && selector,
n@749 2479 match = !seed && tokenize( (selector = compiled.selector || selector) );
n@749 2480
n@749 2481 results = results || [];
n@749 2482
n@749 2483 // Try to minimize operations if there is no seed and only one group
n@749 2484 if ( match.length === 1 ) {
n@749 2485
n@749 2486 // Take a shortcut and set the context if the root selector is an ID
n@749 2487 tokens = match[0] = match[0].slice( 0 );
n@749 2488 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
n@749 2489 support.getById && context.nodeType === 9 && documentIsHTML &&
n@749 2490 Expr.relative[ tokens[1].type ] ) {
n@749 2491
n@749 2492 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
n@749 2493 if ( !context ) {
n@749 2494 return results;
n@749 2495
n@749 2496 // Precompiled matchers will still verify ancestry, so step up a level
n@749 2497 } else if ( compiled ) {
n@749 2498 context = context.parentNode;
n@749 2499 }
n@749 2500
n@749 2501 selector = selector.slice( tokens.shift().value.length );
n@749 2502 }
n@749 2503
n@749 2504 // Fetch a seed set for right-to-left matching
n@749 2505 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
n@749 2506 while ( i-- ) {
n@749 2507 token = tokens[i];
n@749 2508
n@749 2509 // Abort if we hit a combinator
n@749 2510 if ( Expr.relative[ (type = token.type) ] ) {
n@749 2511 break;
n@749 2512 }
n@749 2513 if ( (find = Expr.find[ type ]) ) {
n@749 2514 // Search, expanding context for leading sibling combinators
n@749 2515 if ( (seed = find(
n@749 2516 token.matches[0].replace( runescape, funescape ),
n@749 2517 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
n@749 2518 )) ) {
n@749 2519
n@749 2520 // If seed is empty or no tokens remain, we can return early
n@749 2521 tokens.splice( i, 1 );
n@749 2522 selector = seed.length && toSelector( tokens );
n@749 2523 if ( !selector ) {
n@749 2524 push.apply( results, seed );
n@749 2525 return results;
n@749 2526 }
n@749 2527
n@749 2528 break;
n@749 2529 }
n@749 2530 }
n@749 2531 }
n@749 2532 }
n@749 2533
n@749 2534 // Compile and execute a filtering function if one is not provided
n@749 2535 // Provide `match` to avoid retokenization if we modified the selector above
n@749 2536 ( compiled || compile( selector, match ) )(
n@749 2537 seed,
n@749 2538 context,
n@749 2539 !documentIsHTML,
n@749 2540 results,
n@749 2541 rsibling.test( selector ) && testContext( context.parentNode ) || context
n@749 2542 );
n@749 2543 return results;
n@749 2544 };
n@749 2545
n@749 2546 // One-time assignments
n@749 2547
n@749 2548 // Sort stability
n@749 2549 support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
n@749 2550
n@749 2551 // Support: Chrome 14-35+
n@749 2552 // Always assume duplicates if they aren't passed to the comparison function
n@749 2553 support.detectDuplicates = !!hasDuplicate;
n@749 2554
n@749 2555 // Initialize against the default document
n@749 2556 setDocument();
n@749 2557
n@749 2558 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
n@749 2559 // Detached nodes confoundingly follow *each other*
n@749 2560 support.sortDetached = assert(function( div1 ) {
n@749 2561 // Should return 1, but returns 4 (following)
n@749 2562 return div1.compareDocumentPosition( document.createElement("div") ) & 1;
n@749 2563 });
n@749 2564
n@749 2565 // Support: IE<8
n@749 2566 // Prevent attribute/property "interpolation"
n@749 2567 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
n@749 2568 if ( !assert(function( div ) {
n@749 2569 div.innerHTML = "<a href='#'></a>";
n@749 2570 return div.firstChild.getAttribute("href") === "#" ;
n@749 2571 }) ) {
n@749 2572 addHandle( "type|href|height|width", function( elem, name, isXML ) {
n@749 2573 if ( !isXML ) {
n@749 2574 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
n@749 2575 }
n@749 2576 });
n@749 2577 }
n@749 2578
n@749 2579 // Support: IE<9
n@749 2580 // Use defaultValue in place of getAttribute("value")
n@749 2581 if ( !support.attributes || !assert(function( div ) {
n@749 2582 div.innerHTML = "<input/>";
n@749 2583 div.firstChild.setAttribute( "value", "" );
n@749 2584 return div.firstChild.getAttribute( "value" ) === "";
n@749 2585 }) ) {
n@749 2586 addHandle( "value", function( elem, name, isXML ) {
n@749 2587 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
n@749 2588 return elem.defaultValue;
n@749 2589 }
n@749 2590 });
n@749 2591 }
n@749 2592
n@749 2593 // Support: IE<9
n@749 2594 // Use getAttributeNode to fetch booleans when getAttribute lies
n@749 2595 if ( !assert(function( div ) {
n@749 2596 return div.getAttribute("disabled") == null;
n@749 2597 }) ) {
n@749 2598 addHandle( booleans, function( elem, name, isXML ) {
n@749 2599 var val;
n@749 2600 if ( !isXML ) {
n@749 2601 return elem[ name ] === true ? name.toLowerCase() :
n@749 2602 (val = elem.getAttributeNode( name )) && val.specified ?
n@749 2603 val.value :
n@749 2604 null;
n@749 2605 }
n@749 2606 });
n@749 2607 }
n@749 2608
n@749 2609 return Sizzle;
n@749 2610
n@749 2611 })( window );
n@749 2612
n@749 2613
n@749 2614
n@749 2615 jQuery.find = Sizzle;
n@749 2616 jQuery.expr = Sizzle.selectors;
n@749 2617 jQuery.expr[":"] = jQuery.expr.pseudos;
n@749 2618 jQuery.unique = Sizzle.uniqueSort;
n@749 2619 jQuery.text = Sizzle.getText;
n@749 2620 jQuery.isXMLDoc = Sizzle.isXML;
n@749 2621 jQuery.contains = Sizzle.contains;
n@749 2622
n@749 2623
n@749 2624
n@749 2625 var rneedsContext = jQuery.expr.match.needsContext;
n@749 2626
n@749 2627 var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
n@749 2628
n@749 2629
n@749 2630
n@749 2631 var risSimple = /^.[^:#\[\.,]*$/;
n@749 2632
n@749 2633 // Implement the identical functionality for filter and not
n@749 2634 function winnow( elements, qualifier, not ) {
n@749 2635 if ( jQuery.isFunction( qualifier ) ) {
n@749 2636 return jQuery.grep( elements, function( elem, i ) {
n@749 2637 /* jshint -W018 */
n@749 2638 return !!qualifier.call( elem, i, elem ) !== not;
n@749 2639 });
n@749 2640
n@749 2641 }
n@749 2642
n@749 2643 if ( qualifier.nodeType ) {
n@749 2644 return jQuery.grep( elements, function( elem ) {
n@749 2645 return ( elem === qualifier ) !== not;
n@749 2646 });
n@749 2647
n@749 2648 }
n@749 2649
n@749 2650 if ( typeof qualifier === "string" ) {
n@749 2651 if ( risSimple.test( qualifier ) ) {
n@749 2652 return jQuery.filter( qualifier, elements, not );
n@749 2653 }
n@749 2654
n@749 2655 qualifier = jQuery.filter( qualifier, elements );
n@749 2656 }
n@749 2657
n@749 2658 return jQuery.grep( elements, function( elem ) {
n@749 2659 return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
n@749 2660 });
n@749 2661 }
n@749 2662
n@749 2663 jQuery.filter = function( expr, elems, not ) {
n@749 2664 var elem = elems[ 0 ];
n@749 2665
n@749 2666 if ( not ) {
n@749 2667 expr = ":not(" + expr + ")";
n@749 2668 }
n@749 2669
n@749 2670 return elems.length === 1 && elem.nodeType === 1 ?
n@749 2671 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
n@749 2672 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
n@749 2673 return elem.nodeType === 1;
n@749 2674 }));
n@749 2675 };
n@749 2676
n@749 2677 jQuery.fn.extend({
n@749 2678 find: function( selector ) {
n@749 2679 var i,
n@749 2680 len = this.length,
n@749 2681 ret = [],
n@749 2682 self = this;
n@749 2683
n@749 2684 if ( typeof selector !== "string" ) {
n@749 2685 return this.pushStack( jQuery( selector ).filter(function() {
n@749 2686 for ( i = 0; i < len; i++ ) {
n@749 2687 if ( jQuery.contains( self[ i ], this ) ) {
n@749 2688 return true;
n@749 2689 }
n@749 2690 }
n@749 2691 }) );
n@749 2692 }
n@749 2693
n@749 2694 for ( i = 0; i < len; i++ ) {
n@749 2695 jQuery.find( selector, self[ i ], ret );
n@749 2696 }
n@749 2697
n@749 2698 // Needed because $( selector, context ) becomes $( context ).find( selector )
n@749 2699 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
n@749 2700 ret.selector = this.selector ? this.selector + " " + selector : selector;
n@749 2701 return ret;
n@749 2702 },
n@749 2703 filter: function( selector ) {
n@749 2704 return this.pushStack( winnow(this, selector || [], false) );
n@749 2705 },
n@749 2706 not: function( selector ) {
n@749 2707 return this.pushStack( winnow(this, selector || [], true) );
n@749 2708 },
n@749 2709 is: function( selector ) {
n@749 2710 return !!winnow(
n@749 2711 this,
n@749 2712
n@749 2713 // If this is a positional/relative selector, check membership in the returned set
n@749 2714 // so $("p:first").is("p:last") won't return true for a doc with two "p".
n@749 2715 typeof selector === "string" && rneedsContext.test( selector ) ?
n@749 2716 jQuery( selector ) :
n@749 2717 selector || [],
n@749 2718 false
n@749 2719 ).length;
n@749 2720 }
n@749 2721 });
n@749 2722
n@749 2723
n@749 2724 // Initialize a jQuery object
n@749 2725
n@749 2726
n@749 2727 // A central reference to the root jQuery(document)
n@749 2728 var rootjQuery,
n@749 2729
n@749 2730 // A simple way to check for HTML strings
n@749 2731 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
n@749 2732 // Strict HTML recognition (#11290: must start with <)
n@749 2733 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
n@749 2734
n@749 2735 init = jQuery.fn.init = function( selector, context ) {
n@749 2736 var match, elem;
n@749 2737
n@749 2738 // HANDLE: $(""), $(null), $(undefined), $(false)
n@749 2739 if ( !selector ) {
n@749 2740 return this;
n@749 2741 }
n@749 2742
n@749 2743 // Handle HTML strings
n@749 2744 if ( typeof selector === "string" ) {
n@749 2745 if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
n@749 2746 // Assume that strings that start and end with <> are HTML and skip the regex check
n@749 2747 match = [ null, selector, null ];
n@749 2748
n@749 2749 } else {
n@749 2750 match = rquickExpr.exec( selector );
n@749 2751 }
n@749 2752
n@749 2753 // Match html or make sure no context is specified for #id
n@749 2754 if ( match && (match[1] || !context) ) {
n@749 2755
n@749 2756 // HANDLE: $(html) -> $(array)
n@749 2757 if ( match[1] ) {
n@749 2758 context = context instanceof jQuery ? context[0] : context;
n@749 2759
n@749 2760 // Option to run scripts is true for back-compat
n@749 2761 // Intentionally let the error be thrown if parseHTML is not present
n@749 2762 jQuery.merge( this, jQuery.parseHTML(
n@749 2763 match[1],
n@749 2764 context && context.nodeType ? context.ownerDocument || context : document,
n@749 2765 true
n@749 2766 ) );
n@749 2767
n@749 2768 // HANDLE: $(html, props)
n@749 2769 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
n@749 2770 for ( match in context ) {
n@749 2771 // Properties of context are called as methods if possible
n@749 2772 if ( jQuery.isFunction( this[ match ] ) ) {
n@749 2773 this[ match ]( context[ match ] );
n@749 2774
n@749 2775 // ...and otherwise set as attributes
n@749 2776 } else {
n@749 2777 this.attr( match, context[ match ] );
n@749 2778 }
n@749 2779 }
n@749 2780 }
n@749 2781
n@749 2782 return this;
n@749 2783
n@749 2784 // HANDLE: $(#id)
n@749 2785 } else {
n@749 2786 elem = document.getElementById( match[2] );
n@749 2787
n@749 2788 // Support: Blackberry 4.6
n@749 2789 // gEBID returns nodes no longer in the document (#6963)
n@749 2790 if ( elem && elem.parentNode ) {
n@749 2791 // Inject the element directly into the jQuery object
n@749 2792 this.length = 1;
n@749 2793 this[0] = elem;
n@749 2794 }
n@749 2795
n@749 2796 this.context = document;
n@749 2797 this.selector = selector;
n@749 2798 return this;
n@749 2799 }
n@749 2800
n@749 2801 // HANDLE: $(expr, $(...))
n@749 2802 } else if ( !context || context.jquery ) {
n@749 2803 return ( context || rootjQuery ).find( selector );
n@749 2804
n@749 2805 // HANDLE: $(expr, context)
n@749 2806 // (which is just equivalent to: $(context).find(expr)
n@749 2807 } else {
n@749 2808 return this.constructor( context ).find( selector );
n@749 2809 }
n@749 2810
n@749 2811 // HANDLE: $(DOMElement)
n@749 2812 } else if ( selector.nodeType ) {
n@749 2813 this.context = this[0] = selector;
n@749 2814 this.length = 1;
n@749 2815 return this;
n@749 2816
n@749 2817 // HANDLE: $(function)
n@749 2818 // Shortcut for document ready
n@749 2819 } else if ( jQuery.isFunction( selector ) ) {
n@749 2820 return typeof rootjQuery.ready !== "undefined" ?
n@749 2821 rootjQuery.ready( selector ) :
n@749 2822 // Execute immediately if ready is not present
n@749 2823 selector( jQuery );
n@749 2824 }
n@749 2825
n@749 2826 if ( selector.selector !== undefined ) {
n@749 2827 this.selector = selector.selector;
n@749 2828 this.context = selector.context;
n@749 2829 }
n@749 2830
n@749 2831 return jQuery.makeArray( selector, this );
n@749 2832 };
n@749 2833
n@749 2834 // Give the init function the jQuery prototype for later instantiation
n@749 2835 init.prototype = jQuery.fn;
n@749 2836
n@749 2837 // Initialize central reference
n@749 2838 rootjQuery = jQuery( document );
n@749 2839
n@749 2840
n@749 2841 var rparentsprev = /^(?:parents|prev(?:Until|All))/,
n@749 2842 // Methods guaranteed to produce a unique set when starting from a unique set
n@749 2843 guaranteedUnique = {
n@749 2844 children: true,
n@749 2845 contents: true,
n@749 2846 next: true,
n@749 2847 prev: true
n@749 2848 };
n@749 2849
n@749 2850 jQuery.extend({
n@749 2851 dir: function( elem, dir, until ) {
n@749 2852 var matched = [],
n@749 2853 truncate = until !== undefined;
n@749 2854
n@749 2855 while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
n@749 2856 if ( elem.nodeType === 1 ) {
n@749 2857 if ( truncate && jQuery( elem ).is( until ) ) {
n@749 2858 break;
n@749 2859 }
n@749 2860 matched.push( elem );
n@749 2861 }
n@749 2862 }
n@749 2863 return matched;
n@749 2864 },
n@749 2865
n@749 2866 sibling: function( n, elem ) {
n@749 2867 var matched = [];
n@749 2868
n@749 2869 for ( ; n; n = n.nextSibling ) {
n@749 2870 if ( n.nodeType === 1 && n !== elem ) {
n@749 2871 matched.push( n );
n@749 2872 }
n@749 2873 }
n@749 2874
n@749 2875 return matched;
n@749 2876 }
n@749 2877 });
n@749 2878
n@749 2879 jQuery.fn.extend({
n@749 2880 has: function( target ) {
n@749 2881 var targets = jQuery( target, this ),
n@749 2882 l = targets.length;
n@749 2883
n@749 2884 return this.filter(function() {
n@749 2885 var i = 0;
n@749 2886 for ( ; i < l; i++ ) {
n@749 2887 if ( jQuery.contains( this, targets[i] ) ) {
n@749 2888 return true;
n@749 2889 }
n@749 2890 }
n@749 2891 });
n@749 2892 },
n@749 2893
n@749 2894 closest: function( selectors, context ) {
n@749 2895 var cur,
n@749 2896 i = 0,
n@749 2897 l = this.length,
n@749 2898 matched = [],
n@749 2899 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
n@749 2900 jQuery( selectors, context || this.context ) :
n@749 2901 0;
n@749 2902
n@749 2903 for ( ; i < l; i++ ) {
n@749 2904 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
n@749 2905 // Always skip document fragments
n@749 2906 if ( cur.nodeType < 11 && (pos ?
n@749 2907 pos.index(cur) > -1 :
n@749 2908
n@749 2909 // Don't pass non-elements to Sizzle
n@749 2910 cur.nodeType === 1 &&
n@749 2911 jQuery.find.matchesSelector(cur, selectors)) ) {
n@749 2912
n@749 2913 matched.push( cur );
n@749 2914 break;
n@749 2915 }
n@749 2916 }
n@749 2917 }
n@749 2918
n@749 2919 return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
n@749 2920 },
n@749 2921
n@749 2922 // Determine the position of an element within the set
n@749 2923 index: function( elem ) {
n@749 2924
n@749 2925 // No argument, return index in parent
n@749 2926 if ( !elem ) {
n@749 2927 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
n@749 2928 }
n@749 2929
n@749 2930 // Index in selector
n@749 2931 if ( typeof elem === "string" ) {
n@749 2932 return indexOf.call( jQuery( elem ), this[ 0 ] );
n@749 2933 }
n@749 2934
n@749 2935 // Locate the position of the desired element
n@749 2936 return indexOf.call( this,
n@749 2937
n@749 2938 // If it receives a jQuery object, the first element is used
n@749 2939 elem.jquery ? elem[ 0 ] : elem
n@749 2940 );
n@749 2941 },
n@749 2942
n@749 2943 add: function( selector, context ) {
n@749 2944 return this.pushStack(
n@749 2945 jQuery.unique(
n@749 2946 jQuery.merge( this.get(), jQuery( selector, context ) )
n@749 2947 )
n@749 2948 );
n@749 2949 },
n@749 2950
n@749 2951 addBack: function( selector ) {
n@749 2952 return this.add( selector == null ?
n@749 2953 this.prevObject : this.prevObject.filter(selector)
n@749 2954 );
n@749 2955 }
n@749 2956 });
n@749 2957
n@749 2958 function sibling( cur, dir ) {
n@749 2959 while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
n@749 2960 return cur;
n@749 2961 }
n@749 2962
n@749 2963 jQuery.each({
n@749 2964 parent: function( elem ) {
n@749 2965 var parent = elem.parentNode;
n@749 2966 return parent && parent.nodeType !== 11 ? parent : null;
n@749 2967 },
n@749 2968 parents: function( elem ) {
n@749 2969 return jQuery.dir( elem, "parentNode" );
n@749 2970 },
n@749 2971 parentsUntil: function( elem, i, until ) {
n@749 2972 return jQuery.dir( elem, "parentNode", until );
n@749 2973 },
n@749 2974 next: function( elem ) {
n@749 2975 return sibling( elem, "nextSibling" );
n@749 2976 },
n@749 2977 prev: function( elem ) {
n@749 2978 return sibling( elem, "previousSibling" );
n@749 2979 },
n@749 2980 nextAll: function( elem ) {
n@749 2981 return jQuery.dir( elem, "nextSibling" );
n@749 2982 },
n@749 2983 prevAll: function( elem ) {
n@749 2984 return jQuery.dir( elem, "previousSibling" );
n@749 2985 },
n@749 2986 nextUntil: function( elem, i, until ) {
n@749 2987 return jQuery.dir( elem, "nextSibling", until );
n@749 2988 },
n@749 2989 prevUntil: function( elem, i, until ) {
n@749 2990 return jQuery.dir( elem, "previousSibling", until );
n@749 2991 },
n@749 2992 siblings: function( elem ) {
n@749 2993 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
n@749 2994 },
n@749 2995 children: function( elem ) {
n@749 2996 return jQuery.sibling( elem.firstChild );
n@749 2997 },
n@749 2998 contents: function( elem ) {
n@749 2999 return elem.contentDocument || jQuery.merge( [], elem.childNodes );
n@749 3000 }
n@749 3001 }, function( name, fn ) {
n@749 3002 jQuery.fn[ name ] = function( until, selector ) {
n@749 3003 var matched = jQuery.map( this, fn, until );
n@749 3004
n@749 3005 if ( name.slice( -5 ) !== "Until" ) {
n@749 3006 selector = until;
n@749 3007 }
n@749 3008
n@749 3009 if ( selector && typeof selector === "string" ) {
n@749 3010 matched = jQuery.filter( selector, matched );
n@749 3011 }
n@749 3012
n@749 3013 if ( this.length > 1 ) {
n@749 3014 // Remove duplicates
n@749 3015 if ( !guaranteedUnique[ name ] ) {
n@749 3016 jQuery.unique( matched );
n@749 3017 }
n@749 3018
n@749 3019 // Reverse order for parents* and prev-derivatives
n@749 3020 if ( rparentsprev.test( name ) ) {
n@749 3021 matched.reverse();
n@749 3022 }
n@749 3023 }
n@749 3024
n@749 3025 return this.pushStack( matched );
n@749 3026 };
n@749 3027 });
n@749 3028 var rnotwhite = (/\S+/g);
n@749 3029
n@749 3030
n@749 3031
n@749 3032 // String to Object options format cache
n@749 3033 var optionsCache = {};
n@749 3034
n@749 3035 // Convert String-formatted options into Object-formatted ones and store in cache
n@749 3036 function createOptions( options ) {
n@749 3037 var object = optionsCache[ options ] = {};
n@749 3038 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
n@749 3039 object[ flag ] = true;
n@749 3040 });
n@749 3041 return object;
n@749 3042 }
n@749 3043
n@749 3044 /*
n@749 3045 * Create a callback list using the following parameters:
n@749 3046 *
n@749 3047 * options: an optional list of space-separated options that will change how
n@749 3048 * the callback list behaves or a more traditional option object
n@749 3049 *
n@749 3050 * By default a callback list will act like an event callback list and can be
n@749 3051 * "fired" multiple times.
n@749 3052 *
n@749 3053 * Possible options:
n@749 3054 *
n@749 3055 * once: will ensure the callback list can only be fired once (like a Deferred)
n@749 3056 *
n@749 3057 * memory: will keep track of previous values and will call any callback added
n@749 3058 * after the list has been fired right away with the latest "memorized"
n@749 3059 * values (like a Deferred)
n@749 3060 *
n@749 3061 * unique: will ensure a callback can only be added once (no duplicate in the list)
n@749 3062 *
n@749 3063 * stopOnFalse: interrupt callings when a callback returns false
n@749 3064 *
n@749 3065 */
n@749 3066 jQuery.Callbacks = function( options ) {
n@749 3067
n@749 3068 // Convert options from String-formatted to Object-formatted if needed
n@749 3069 // (we check in cache first)
n@749 3070 options = typeof options === "string" ?
n@749 3071 ( optionsCache[ options ] || createOptions( options ) ) :
n@749 3072 jQuery.extend( {}, options );
n@749 3073
n@749 3074 var // Last fire value (for non-forgettable lists)
n@749 3075 memory,
n@749 3076 // Flag to know if list was already fired
n@749 3077 fired,
n@749 3078 // Flag to know if list is currently firing
n@749 3079 firing,
n@749 3080 // First callback to fire (used internally by add and fireWith)
n@749 3081 firingStart,
n@749 3082 // End of the loop when firing
n@749 3083 firingLength,
n@749 3084 // Index of currently firing callback (modified by remove if needed)
n@749 3085 firingIndex,
n@749 3086 // Actual callback list
n@749 3087 list = [],
n@749 3088 // Stack of fire calls for repeatable lists
n@749 3089 stack = !options.once && [],
n@749 3090 // Fire callbacks
n@749 3091 fire = function( data ) {
n@749 3092 memory = options.memory && data;
n@749 3093 fired = true;
n@749 3094 firingIndex = firingStart || 0;
n@749 3095 firingStart = 0;
n@749 3096 firingLength = list.length;
n@749 3097 firing = true;
n@749 3098 for ( ; list && firingIndex < firingLength; firingIndex++ ) {
n@749 3099 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
n@749 3100 memory = false; // To prevent further calls using add
n@749 3101 break;
n@749 3102 }
n@749 3103 }
n@749 3104 firing = false;
n@749 3105 if ( list ) {
n@749 3106 if ( stack ) {
n@749 3107 if ( stack.length ) {
n@749 3108 fire( stack.shift() );
n@749 3109 }
n@749 3110 } else if ( memory ) {
n@749 3111 list = [];
n@749 3112 } else {
n@749 3113 self.disable();
n@749 3114 }
n@749 3115 }
n@749 3116 },
n@749 3117 // Actual Callbacks object
n@749 3118 self = {
n@749 3119 // Add a callback or a collection of callbacks to the list
n@749 3120 add: function() {
n@749 3121 if ( list ) {
n@749 3122 // First, we save the current length
n@749 3123 var start = list.length;
n@749 3124 (function add( args ) {
n@749 3125 jQuery.each( args, function( _, arg ) {
n@749 3126 var type = jQuery.type( arg );
n@749 3127 if ( type === "function" ) {
n@749 3128 if ( !options.unique || !self.has( arg ) ) {
n@749 3129 list.push( arg );
n@749 3130 }
n@749 3131 } else if ( arg && arg.length && type !== "string" ) {
n@749 3132 // Inspect recursively
n@749 3133 add( arg );
n@749 3134 }
n@749 3135 });
n@749 3136 })( arguments );
n@749 3137 // Do we need to add the callbacks to the
n@749 3138 // current firing batch?
n@749 3139 if ( firing ) {
n@749 3140 firingLength = list.length;
n@749 3141 // With memory, if we're not firing then
n@749 3142 // we should call right away
n@749 3143 } else if ( memory ) {
n@749 3144 firingStart = start;
n@749 3145 fire( memory );
n@749 3146 }
n@749 3147 }
n@749 3148 return this;
n@749 3149 },
n@749 3150 // Remove a callback from the list
n@749 3151 remove: function() {
n@749 3152 if ( list ) {
n@749 3153 jQuery.each( arguments, function( _, arg ) {
n@749 3154 var index;
n@749 3155 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
n@749 3156 list.splice( index, 1 );
n@749 3157 // Handle firing indexes
n@749 3158 if ( firing ) {
n@749 3159 if ( index <= firingLength ) {
n@749 3160 firingLength--;
n@749 3161 }
n@749 3162 if ( index <= firingIndex ) {
n@749 3163 firingIndex--;
n@749 3164 }
n@749 3165 }
n@749 3166 }
n@749 3167 });
n@749 3168 }
n@749 3169 return this;
n@749 3170 },
n@749 3171 // Check if a given callback is in the list.
n@749 3172 // If no argument is given, return whether or not list has callbacks attached.
n@749 3173 has: function( fn ) {
n@749 3174 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
n@749 3175 },
n@749 3176 // Remove all callbacks from the list
n@749 3177 empty: function() {
n@749 3178 list = [];
n@749 3179 firingLength = 0;
n@749 3180 return this;
n@749 3181 },
n@749 3182 // Have the list do nothing anymore
n@749 3183 disable: function() {
n@749 3184 list = stack = memory = undefined;
n@749 3185 return this;
n@749 3186 },
n@749 3187 // Is it disabled?
n@749 3188 disabled: function() {
n@749 3189 return !list;
n@749 3190 },
n@749 3191 // Lock the list in its current state
n@749 3192 lock: function() {
n@749 3193 stack = undefined;
n@749 3194 if ( !memory ) {
n@749 3195 self.disable();
n@749 3196 }
n@749 3197 return this;
n@749 3198 },
n@749 3199 // Is it locked?
n@749 3200 locked: function() {
n@749 3201 return !stack;
n@749 3202 },
n@749 3203 // Call all callbacks with the given context and arguments
n@749 3204 fireWith: function( context, args ) {
n@749 3205 if ( list && ( !fired || stack ) ) {
n@749 3206 args = args || [];
n@749 3207 args = [ context, args.slice ? args.slice() : args ];
n@749 3208 if ( firing ) {
n@749 3209 stack.push( args );
n@749 3210 } else {
n@749 3211 fire( args );
n@749 3212 }
n@749 3213 }
n@749 3214 return this;
n@749 3215 },
n@749 3216 // Call all the callbacks with the given arguments
n@749 3217 fire: function() {
n@749 3218 self.fireWith( this, arguments );
n@749 3219 return this;
n@749 3220 },
n@749 3221 // To know if the callbacks have already been called at least once
n@749 3222 fired: function() {
n@749 3223 return !!fired;
n@749 3224 }
n@749 3225 };
n@749 3226
n@749 3227 return self;
n@749 3228 };
n@749 3229
n@749 3230
n@749 3231 jQuery.extend({
n@749 3232
n@749 3233 Deferred: function( func ) {
n@749 3234 var tuples = [
n@749 3235 // action, add listener, listener list, final state
n@749 3236 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
n@749 3237 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
n@749 3238 [ "notify", "progress", jQuery.Callbacks("memory") ]
n@749 3239 ],
n@749 3240 state = "pending",
n@749 3241 promise = {
n@749 3242 state: function() {
n@749 3243 return state;
n@749 3244 },
n@749 3245 always: function() {
n@749 3246 deferred.done( arguments ).fail( arguments );
n@749 3247 return this;
n@749 3248 },
n@749 3249 then: function( /* fnDone, fnFail, fnProgress */ ) {
n@749 3250 var fns = arguments;
n@749 3251 return jQuery.Deferred(function( newDefer ) {
n@749 3252 jQuery.each( tuples, function( i, tuple ) {
n@749 3253 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
n@749 3254 // deferred[ done | fail | progress ] for forwarding actions to newDefer
n@749 3255 deferred[ tuple[1] ](function() {
n@749 3256 var returned = fn && fn.apply( this, arguments );
n@749 3257 if ( returned && jQuery.isFunction( returned.promise ) ) {
n@749 3258 returned.promise()
n@749 3259 .done( newDefer.resolve )
n@749 3260 .fail( newDefer.reject )
n@749 3261 .progress( newDefer.notify );
n@749 3262 } else {
n@749 3263 newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
n@749 3264 }
n@749 3265 });
n@749 3266 });
n@749 3267 fns = null;
n@749 3268 }).promise();
n@749 3269 },
n@749 3270 // Get a promise for this deferred
n@749 3271 // If obj is provided, the promise aspect is added to the object
n@749 3272 promise: function( obj ) {
n@749 3273 return obj != null ? jQuery.extend( obj, promise ) : promise;
n@749 3274 }
n@749 3275 },
n@749 3276 deferred = {};
n@749 3277
n@749 3278 // Keep pipe for back-compat
n@749 3279 promise.pipe = promise.then;
n@749 3280
n@749 3281 // Add list-specific methods
n@749 3282 jQuery.each( tuples, function( i, tuple ) {
n@749 3283 var list = tuple[ 2 ],
n@749 3284 stateString = tuple[ 3 ];
n@749 3285
n@749 3286 // promise[ done | fail | progress ] = list.add
n@749 3287 promise[ tuple[1] ] = list.add;
n@749 3288
n@749 3289 // Handle state
n@749 3290 if ( stateString ) {
n@749 3291 list.add(function() {
n@749 3292 // state = [ resolved | rejected ]
n@749 3293 state = stateString;
n@749 3294
n@749 3295 // [ reject_list | resolve_list ].disable; progress_list.lock
n@749 3296 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
n@749 3297 }
n@749 3298
n@749 3299 // deferred[ resolve | reject | notify ]
n@749 3300 deferred[ tuple[0] ] = function() {
n@749 3301 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
n@749 3302 return this;
n@749 3303 };
n@749 3304 deferred[ tuple[0] + "With" ] = list.fireWith;
n@749 3305 });
n@749 3306
n@749 3307 // Make the deferred a promise
n@749 3308 promise.promise( deferred );
n@749 3309
n@749 3310 // Call given func if any
n@749 3311 if ( func ) {
n@749 3312 func.call( deferred, deferred );
n@749 3313 }
n@749 3314
n@749 3315 // All done!
n@749 3316 return deferred;
n@749 3317 },
n@749 3318
n@749 3319 // Deferred helper
n@749 3320 when: function( subordinate /* , ..., subordinateN */ ) {
n@749 3321 var i = 0,
n@749 3322 resolveValues = slice.call( arguments ),
n@749 3323 length = resolveValues.length,
n@749 3324
n@749 3325 // the count of uncompleted subordinates
n@749 3326 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
n@749 3327
n@749 3328 // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
n@749 3329 deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
n@749 3330
n@749 3331 // Update function for both resolve and progress values
n@749 3332 updateFunc = function( i, contexts, values ) {
n@749 3333 return function( value ) {
n@749 3334 contexts[ i ] = this;
n@749 3335 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
n@749 3336 if ( values === progressValues ) {
n@749 3337 deferred.notifyWith( contexts, values );
n@749 3338 } else if ( !( --remaining ) ) {
n@749 3339 deferred.resolveWith( contexts, values );
n@749 3340 }
n@749 3341 };
n@749 3342 },
n@749 3343
n@749 3344 progressValues, progressContexts, resolveContexts;
n@749 3345
n@749 3346 // Add listeners to Deferred subordinates; treat others as resolved
n@749 3347 if ( length > 1 ) {
n@749 3348 progressValues = new Array( length );
n@749 3349 progressContexts = new Array( length );
n@749 3350 resolveContexts = new Array( length );
n@749 3351 for ( ; i < length; i++ ) {
n@749 3352 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
n@749 3353 resolveValues[ i ].promise()
n@749 3354 .done( updateFunc( i, resolveContexts, resolveValues ) )
n@749 3355 .fail( deferred.reject )
n@749 3356 .progress( updateFunc( i, progressContexts, progressValues ) );
n@749 3357 } else {
n@749 3358 --remaining;
n@749 3359 }
n@749 3360 }
n@749 3361 }
n@749 3362
n@749 3363 // If we're not waiting on anything, resolve the master
n@749 3364 if ( !remaining ) {
n@749 3365 deferred.resolveWith( resolveContexts, resolveValues );
n@749 3366 }
n@749 3367
n@749 3368 return deferred.promise();
n@749 3369 }
n@749 3370 });
n@749 3371
n@749 3372
n@749 3373 // The deferred used on DOM ready
n@749 3374 var readyList;
n@749 3375
n@749 3376 jQuery.fn.ready = function( fn ) {
n@749 3377 // Add the callback
n@749 3378 jQuery.ready.promise().done( fn );
n@749 3379
n@749 3380 return this;
n@749 3381 };
n@749 3382
n@749 3383 jQuery.extend({
n@749 3384 // Is the DOM ready to be used? Set to true once it occurs.
n@749 3385 isReady: false,
n@749 3386
n@749 3387 // A counter to track how many items to wait for before
n@749 3388 // the ready event fires. See #6781
n@749 3389 readyWait: 1,
n@749 3390
n@749 3391 // Hold (or release) the ready event
n@749 3392 holdReady: function( hold ) {
n@749 3393 if ( hold ) {
n@749 3394 jQuery.readyWait++;
n@749 3395 } else {
n@749 3396 jQuery.ready( true );
n@749 3397 }
n@749 3398 },
n@749 3399
n@749 3400 // Handle when the DOM is ready
n@749 3401 ready: function( wait ) {
n@749 3402
n@749 3403 // Abort if there are pending holds or we're already ready
n@749 3404 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
n@749 3405 return;
n@749 3406 }
n@749 3407
n@749 3408 // Remember that the DOM is ready
n@749 3409 jQuery.isReady = true;
n@749 3410
n@749 3411 // If a normal DOM Ready event fired, decrement, and wait if need be
n@749 3412 if ( wait !== true && --jQuery.readyWait > 0 ) {
n@749 3413 return;
n@749 3414 }
n@749 3415
n@749 3416 // If there are functions bound, to execute
n@749 3417 readyList.resolveWith( document, [ jQuery ] );
n@749 3418
n@749 3419 // Trigger any bound ready events
n@749 3420 if ( jQuery.fn.triggerHandler ) {
n@749 3421 jQuery( document ).triggerHandler( "ready" );
n@749 3422 jQuery( document ).off( "ready" );
n@749 3423 }
n@749 3424 }
n@749 3425 });
n@749 3426
n@749 3427 /**
n@749 3428 * The ready event handler and self cleanup method
n@749 3429 */
n@749 3430 function completed() {
n@749 3431 document.removeEventListener( "DOMContentLoaded", completed, false );
n@749 3432 window.removeEventListener( "load", completed, false );
n@749 3433 jQuery.ready();
n@749 3434 }
n@749 3435
n@749 3436 jQuery.ready.promise = function( obj ) {
n@749 3437 if ( !readyList ) {
n@749 3438
n@749 3439 readyList = jQuery.Deferred();
n@749 3440
n@749 3441 // Catch cases where $(document).ready() is called after the browser event has already occurred.
n@749 3442 // We once tried to use readyState "interactive" here, but it caused issues like the one
n@749 3443 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
n@749 3444 if ( document.readyState === "complete" ) {
n@749 3445 // Handle it asynchronously to allow scripts the opportunity to delay ready
n@749 3446 setTimeout( jQuery.ready );
n@749 3447
n@749 3448 } else {
n@749 3449
n@749 3450 // Use the handy event callback
n@749 3451 document.addEventListener( "DOMContentLoaded", completed, false );
n@749 3452
n@749 3453 // A fallback to window.onload, that will always work
n@749 3454 window.addEventListener( "load", completed, false );
n@749 3455 }
n@749 3456 }
n@749 3457 return readyList.promise( obj );
n@749 3458 };
n@749 3459
n@749 3460 // Kick off the DOM ready check even if the user does not
n@749 3461 jQuery.ready.promise();
n@749 3462
n@749 3463
n@749 3464
n@749 3465
n@749 3466 // Multifunctional method to get and set values of a collection
n@749 3467 // The value/s can optionally be executed if it's a function
n@749 3468 var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
n@749 3469 var i = 0,
n@749 3470 len = elems.length,
n@749 3471 bulk = key == null;
n@749 3472
n@749 3473 // Sets many values
n@749 3474 if ( jQuery.type( key ) === "object" ) {
n@749 3475 chainable = true;
n@749 3476 for ( i in key ) {
n@749 3477 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
n@749 3478 }
n@749 3479
n@749 3480 // Sets one value
n@749 3481 } else if ( value !== undefined ) {
n@749 3482 chainable = true;
n@749 3483
n@749 3484 if ( !jQuery.isFunction( value ) ) {
n@749 3485 raw = true;
n@749 3486 }
n@749 3487
n@749 3488 if ( bulk ) {
n@749 3489 // Bulk operations run against the entire set
n@749 3490 if ( raw ) {
n@749 3491 fn.call( elems, value );
n@749 3492 fn = null;
n@749 3493
n@749 3494 // ...except when executing function values
n@749 3495 } else {
n@749 3496 bulk = fn;
n@749 3497 fn = function( elem, key, value ) {
n@749 3498 return bulk.call( jQuery( elem ), value );
n@749 3499 };
n@749 3500 }
n@749 3501 }
n@749 3502
n@749 3503 if ( fn ) {
n@749 3504 for ( ; i < len; i++ ) {
n@749 3505 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
n@749 3506 }
n@749 3507 }
n@749 3508 }
n@749 3509
n@749 3510 return chainable ?
n@749 3511 elems :
n@749 3512
n@749 3513 // Gets
n@749 3514 bulk ?
n@749 3515 fn.call( elems ) :
n@749 3516 len ? fn( elems[0], key ) : emptyGet;
n@749 3517 };
n@749 3518
n@749 3519
n@749 3520 /**
n@749 3521 * Determines whether an object can have data
n@749 3522 */
n@749 3523 jQuery.acceptData = function( owner ) {
n@749 3524 // Accepts only:
n@749 3525 // - Node
n@749 3526 // - Node.ELEMENT_NODE
n@749 3527 // - Node.DOCUMENT_NODE
n@749 3528 // - Object
n@749 3529 // - Any
n@749 3530 /* jshint -W018 */
n@749 3531 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
n@749 3532 };
n@749 3533
n@749 3534
n@749 3535 function Data() {
n@749 3536 // Support: Android<4,
n@749 3537 // Old WebKit does not have Object.preventExtensions/freeze method,
n@749 3538 // return new empty object instead with no [[set]] accessor
n@749 3539 Object.defineProperty( this.cache = {}, 0, {
n@749 3540 get: function() {
n@749 3541 return {};
n@749 3542 }
n@749 3543 });
n@749 3544
n@749 3545 this.expando = jQuery.expando + Data.uid++;
n@749 3546 }
n@749 3547
n@749 3548 Data.uid = 1;
n@749 3549 Data.accepts = jQuery.acceptData;
n@749 3550
n@749 3551 Data.prototype = {
n@749 3552 key: function( owner ) {
n@749 3553 // We can accept data for non-element nodes in modern browsers,
n@749 3554 // but we should not, see #8335.
n@749 3555 // Always return the key for a frozen object.
n@749 3556 if ( !Data.accepts( owner ) ) {
n@749 3557 return 0;
n@749 3558 }
n@749 3559
n@749 3560 var descriptor = {},
n@749 3561 // Check if the owner object already has a cache key
n@749 3562 unlock = owner[ this.expando ];
n@749 3563
n@749 3564 // If not, create one
n@749 3565 if ( !unlock ) {
n@749 3566 unlock = Data.uid++;
n@749 3567
n@749 3568 // Secure it in a non-enumerable, non-writable property
n@749 3569 try {
n@749 3570 descriptor[ this.expando ] = { value: unlock };
n@749 3571 Object.defineProperties( owner, descriptor );
n@749 3572
n@749 3573 // Support: Android<4
n@749 3574 // Fallback to a less secure definition
n@749 3575 } catch ( e ) {
n@749 3576 descriptor[ this.expando ] = unlock;
n@749 3577 jQuery.extend( owner, descriptor );
n@749 3578 }
n@749 3579 }
n@749 3580
n@749 3581 // Ensure the cache object
n@749 3582 if ( !this.cache[ unlock ] ) {
n@749 3583 this.cache[ unlock ] = {};
n@749 3584 }
n@749 3585
n@749 3586 return unlock;
n@749 3587 },
n@749 3588 set: function( owner, data, value ) {
n@749 3589 var prop,
n@749 3590 // There may be an unlock assigned to this node,
n@749 3591 // if there is no entry for this "owner", create one inline
n@749 3592 // and set the unlock as though an owner entry had always existed
n@749 3593 unlock = this.key( owner ),
n@749 3594 cache = this.cache[ unlock ];
n@749 3595
n@749 3596 // Handle: [ owner, key, value ] args
n@749 3597 if ( typeof data === "string" ) {
n@749 3598 cache[ data ] = value;
n@749 3599
n@749 3600 // Handle: [ owner, { properties } ] args
n@749 3601 } else {
n@749 3602 // Fresh assignments by object are shallow copied
n@749 3603 if ( jQuery.isEmptyObject( cache ) ) {
n@749 3604 jQuery.extend( this.cache[ unlock ], data );
n@749 3605 // Otherwise, copy the properties one-by-one to the cache object
n@749 3606 } else {
n@749 3607 for ( prop in data ) {
n@749 3608 cache[ prop ] = data[ prop ];
n@749 3609 }
n@749 3610 }
n@749 3611 }
n@749 3612 return cache;
n@749 3613 },
n@749 3614 get: function( owner, key ) {
n@749 3615 // Either a valid cache is found, or will be created.
n@749 3616 // New caches will be created and the unlock returned,
n@749 3617 // allowing direct access to the newly created
n@749 3618 // empty data object. A valid owner object must be provided.
n@749 3619 var cache = this.cache[ this.key( owner ) ];
n@749 3620
n@749 3621 return key === undefined ?
n@749 3622 cache : cache[ key ];
n@749 3623 },
n@749 3624 access: function( owner, key, value ) {
n@749 3625 var stored;
n@749 3626 // In cases where either:
n@749 3627 //
n@749 3628 // 1. No key was specified
n@749 3629 // 2. A string key was specified, but no value provided
n@749 3630 //
n@749 3631 // Take the "read" path and allow the get method to determine
n@749 3632 // which value to return, respectively either:
n@749 3633 //
n@749 3634 // 1. The entire cache object
n@749 3635 // 2. The data stored at the key
n@749 3636 //
n@749 3637 if ( key === undefined ||
n@749 3638 ((key && typeof key === "string") && value === undefined) ) {
n@749 3639
n@749 3640 stored = this.get( owner, key );
n@749 3641
n@749 3642 return stored !== undefined ?
n@749 3643 stored : this.get( owner, jQuery.camelCase(key) );
n@749 3644 }
n@749 3645
n@749 3646 // [*]When the key is not a string, or both a key and value
n@749 3647 // are specified, set or extend (existing objects) with either:
n@749 3648 //
n@749 3649 // 1. An object of properties
n@749 3650 // 2. A key and value
n@749 3651 //
n@749 3652 this.set( owner, key, value );
n@749 3653
n@749 3654 // Since the "set" path can have two possible entry points
n@749 3655 // return the expected data based on which path was taken[*]
n@749 3656 return value !== undefined ? value : key;
n@749 3657 },
n@749 3658 remove: function( owner, key ) {
n@749 3659 var i, name, camel,
n@749 3660 unlock = this.key( owner ),
n@749 3661 cache = this.cache[ unlock ];
n@749 3662
n@749 3663 if ( key === undefined ) {
n@749 3664 this.cache[ unlock ] = {};
n@749 3665
n@749 3666 } else {
n@749 3667 // Support array or space separated string of keys
n@749 3668 if ( jQuery.isArray( key ) ) {
n@749 3669 // If "name" is an array of keys...
n@749 3670 // When data is initially created, via ("key", "val") signature,
n@749 3671 // keys will be converted to camelCase.
n@749 3672 // Since there is no way to tell _how_ a key was added, remove
n@749 3673 // both plain key and camelCase key. #12786
n@749 3674 // This will only penalize the array argument path.
n@749 3675 name = key.concat( key.map( jQuery.camelCase ) );
n@749 3676 } else {
n@749 3677 camel = jQuery.camelCase( key );
n@749 3678 // Try the string as a key before any manipulation
n@749 3679 if ( key in cache ) {
n@749 3680 name = [ key, camel ];
n@749 3681 } else {
n@749 3682 // If a key with the spaces exists, use it.
n@749 3683 // Otherwise, create an array by matching non-whitespace
n@749 3684 name = camel;
n@749 3685 name = name in cache ?
n@749 3686 [ name ] : ( name.match( rnotwhite ) || [] );
n@749 3687 }
n@749 3688 }
n@749 3689
n@749 3690 i = name.length;
n@749 3691 while ( i-- ) {
n@749 3692 delete cache[ name[ i ] ];
n@749 3693 }
n@749 3694 }
n@749 3695 },
n@749 3696 hasData: function( owner ) {
n@749 3697 return !jQuery.isEmptyObject(
n@749 3698 this.cache[ owner[ this.expando ] ] || {}
n@749 3699 );
n@749 3700 },
n@749 3701 discard: function( owner ) {
n@749 3702 if ( owner[ this.expando ] ) {
n@749 3703 delete this.cache[ owner[ this.expando ] ];
n@749 3704 }
n@749 3705 }
n@749 3706 };
n@749 3707 var data_priv = new Data();
n@749 3708
n@749 3709 var data_user = new Data();
n@749 3710
n@749 3711
n@749 3712
n@749 3713 // Implementation Summary
n@749 3714 //
n@749 3715 // 1. Enforce API surface and semantic compatibility with 1.9.x branch
n@749 3716 // 2. Improve the module's maintainability by reducing the storage
n@749 3717 // paths to a single mechanism.
n@749 3718 // 3. Use the same single mechanism to support "private" and "user" data.
n@749 3719 // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
n@749 3720 // 5. Avoid exposing implementation details on user objects (eg. expando properties)
n@749 3721 // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
n@749 3722
n@749 3723 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
n@749 3724 rmultiDash = /([A-Z])/g;
n@749 3725
n@749 3726 function dataAttr( elem, key, data ) {
n@749 3727 var name;
n@749 3728
n@749 3729 // If nothing was found internally, try to fetch any
n@749 3730 // data from the HTML5 data-* attribute
n@749 3731 if ( data === undefined && elem.nodeType === 1 ) {
n@749 3732 name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
n@749 3733 data = elem.getAttribute( name );
n@749 3734
n@749 3735 if ( typeof data === "string" ) {
n@749 3736 try {
n@749 3737 data = data === "true" ? true :
n@749 3738 data === "false" ? false :
n@749 3739 data === "null" ? null :
n@749 3740 // Only convert to a number if it doesn't change the string
n@749 3741 +data + "" === data ? +data :
n@749 3742 rbrace.test( data ) ? jQuery.parseJSON( data ) :
n@749 3743 data;
n@749 3744 } catch( e ) {}
n@749 3745
n@749 3746 // Make sure we set the data so it isn't changed later
n@749 3747 data_user.set( elem, key, data );
n@749 3748 } else {
n@749 3749 data = undefined;
n@749 3750 }
n@749 3751 }
n@749 3752 return data;
n@749 3753 }
n@749 3754
n@749 3755 jQuery.extend({
n@749 3756 hasData: function( elem ) {
n@749 3757 return data_user.hasData( elem ) || data_priv.hasData( elem );
n@749 3758 },
n@749 3759
n@749 3760 data: function( elem, name, data ) {
n@749 3761 return data_user.access( elem, name, data );
n@749 3762 },
n@749 3763
n@749 3764 removeData: function( elem, name ) {
n@749 3765 data_user.remove( elem, name );
n@749 3766 },
n@749 3767
n@749 3768 // TODO: Now that all calls to _data and _removeData have been replaced
n@749 3769 // with direct calls to data_priv methods, these can be deprecated.
n@749 3770 _data: function( elem, name, data ) {
n@749 3771 return data_priv.access( elem, name, data );
n@749 3772 },
n@749 3773
n@749 3774 _removeData: function( elem, name ) {
n@749 3775 data_priv.remove( elem, name );
n@749 3776 }
n@749 3777 });
n@749 3778
n@749 3779 jQuery.fn.extend({
n@749 3780 data: function( key, value ) {
n@749 3781 var i, name, data,
n@749 3782 elem = this[ 0 ],
n@749 3783 attrs = elem && elem.attributes;
n@749 3784
n@749 3785 // Gets all values
n@749 3786 if ( key === undefined ) {
n@749 3787 if ( this.length ) {
n@749 3788 data = data_user.get( elem );
n@749 3789
n@749 3790 if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
n@749 3791 i = attrs.length;
n@749 3792 while ( i-- ) {
n@749 3793
n@749 3794 // Support: IE11+
n@749 3795 // The attrs elements can be null (#14894)
n@749 3796 if ( attrs[ i ] ) {
n@749 3797 name = attrs[ i ].name;
n@749 3798 if ( name.indexOf( "data-" ) === 0 ) {
n@749 3799 name = jQuery.camelCase( name.slice(5) );
n@749 3800 dataAttr( elem, name, data[ name ] );
n@749 3801 }
n@749 3802 }
n@749 3803 }
n@749 3804 data_priv.set( elem, "hasDataAttrs", true );
n@749 3805 }
n@749 3806 }
n@749 3807
n@749 3808 return data;
n@749 3809 }
n@749 3810
n@749 3811 // Sets multiple values
n@749 3812 if ( typeof key === "object" ) {
n@749 3813 return this.each(function() {
n@749 3814 data_user.set( this, key );
n@749 3815 });
n@749 3816 }
n@749 3817
n@749 3818 return access( this, function( value ) {
n@749 3819 var data,
n@749 3820 camelKey = jQuery.camelCase( key );
n@749 3821
n@749 3822 // The calling jQuery object (element matches) is not empty
n@749 3823 // (and therefore has an element appears at this[ 0 ]) and the
n@749 3824 // `value` parameter was not undefined. An empty jQuery object
n@749 3825 // will result in `undefined` for elem = this[ 0 ] which will
n@749 3826 // throw an exception if an attempt to read a data cache is made.
n@749 3827 if ( elem && value === undefined ) {
n@749 3828 // Attempt to get data from the cache
n@749 3829 // with the key as-is
n@749 3830 data = data_user.get( elem, key );
n@749 3831 if ( data !== undefined ) {
n@749 3832 return data;
n@749 3833 }
n@749 3834
n@749 3835 // Attempt to get data from the cache
n@749 3836 // with the key camelized
n@749 3837 data = data_user.get( elem, camelKey );
n@749 3838 if ( data !== undefined ) {
n@749 3839 return data;
n@749 3840 }
n@749 3841
n@749 3842 // Attempt to "discover" the data in
n@749 3843 // HTML5 custom data-* attrs
n@749 3844 data = dataAttr( elem, camelKey, undefined );
n@749 3845 if ( data !== undefined ) {
n@749 3846 return data;
n@749 3847 }
n@749 3848
n@749 3849 // We tried really hard, but the data doesn't exist.
n@749 3850 return;
n@749 3851 }
n@749 3852
n@749 3853 // Set the data...
n@749 3854 this.each(function() {
n@749 3855 // First, attempt to store a copy or reference of any
n@749 3856 // data that might've been store with a camelCased key.
n@749 3857 var data = data_user.get( this, camelKey );
n@749 3858
n@749 3859 // For HTML5 data-* attribute interop, we have to
n@749 3860 // store property names with dashes in a camelCase form.
n@749 3861 // This might not apply to all properties...*
n@749 3862 data_user.set( this, camelKey, value );
n@749 3863
n@749 3864 // *... In the case of properties that might _actually_
n@749 3865 // have dashes, we need to also store a copy of that
n@749 3866 // unchanged property.
n@749 3867 if ( key.indexOf("-") !== -1 && data !== undefined ) {
n@749 3868 data_user.set( this, key, value );
n@749 3869 }
n@749 3870 });
n@749 3871 }, null, value, arguments.length > 1, null, true );
n@749 3872 },
n@749 3873
n@749 3874 removeData: function( key ) {
n@749 3875 return this.each(function() {
n@749 3876 data_user.remove( this, key );
n@749 3877 });
n@749 3878 }
n@749 3879 });
n@749 3880
n@749 3881
n@749 3882 jQuery.extend({
n@749 3883 queue: function( elem, type, data ) {
n@749 3884 var queue;
n@749 3885
n@749 3886 if ( elem ) {
n@749 3887 type = ( type || "fx" ) + "queue";
n@749 3888 queue = data_priv.get( elem, type );
n@749 3889
n@749 3890 // Speed up dequeue by getting out quickly if this is just a lookup
n@749 3891 if ( data ) {
n@749 3892 if ( !queue || jQuery.isArray( data ) ) {
n@749 3893 queue = data_priv.access( elem, type, jQuery.makeArray(data) );
n@749 3894 } else {
n@749 3895 queue.push( data );
n@749 3896 }
n@749 3897 }
n@749 3898 return queue || [];
n@749 3899 }
n@749 3900 },
n@749 3901
n@749 3902 dequeue: function( elem, type ) {
n@749 3903 type = type || "fx";
n@749 3904
n@749 3905 var queue = jQuery.queue( elem, type ),
n@749 3906 startLength = queue.length,
n@749 3907 fn = queue.shift(),
n@749 3908 hooks = jQuery._queueHooks( elem, type ),
n@749 3909 next = function() {
n@749 3910 jQuery.dequeue( elem, type );
n@749 3911 };
n@749 3912
n@749 3913 // If the fx queue is dequeued, always remove the progress sentinel
n@749 3914 if ( fn === "inprogress" ) {
n@749 3915 fn = queue.shift();
n@749 3916 startLength--;
n@749 3917 }
n@749 3918
n@749 3919 if ( fn ) {
n@749 3920
n@749 3921 // Add a progress sentinel to prevent the fx queue from being
n@749 3922 // automatically dequeued
n@749 3923 if ( type === "fx" ) {
n@749 3924 queue.unshift( "inprogress" );
n@749 3925 }
n@749 3926
n@749 3927 // Clear up the last queue stop function
n@749 3928 delete hooks.stop;
n@749 3929 fn.call( elem, next, hooks );
n@749 3930 }
n@749 3931
n@749 3932 if ( !startLength && hooks ) {
n@749 3933 hooks.empty.fire();
n@749 3934 }
n@749 3935 },
n@749 3936
n@749 3937 // Not public - generate a queueHooks object, or return the current one
n@749 3938 _queueHooks: function( elem, type ) {
n@749 3939 var key = type + "queueHooks";
n@749 3940 return data_priv.get( elem, key ) || data_priv.access( elem, key, {
n@749 3941 empty: jQuery.Callbacks("once memory").add(function() {
n@749 3942 data_priv.remove( elem, [ type + "queue", key ] );
n@749 3943 })
n@749 3944 });
n@749 3945 }
n@749 3946 });
n@749 3947
n@749 3948 jQuery.fn.extend({
n@749 3949 queue: function( type, data ) {
n@749 3950 var setter = 2;
n@749 3951
n@749 3952 if ( typeof type !== "string" ) {
n@749 3953 data = type;
n@749 3954 type = "fx";
n@749 3955 setter--;
n@749 3956 }
n@749 3957
n@749 3958 if ( arguments.length < setter ) {
n@749 3959 return jQuery.queue( this[0], type );
n@749 3960 }
n@749 3961
n@749 3962 return data === undefined ?
n@749 3963 this :
n@749 3964 this.each(function() {
n@749 3965 var queue = jQuery.queue( this, type, data );
n@749 3966
n@749 3967 // Ensure a hooks for this queue
n@749 3968 jQuery._queueHooks( this, type );
n@749 3969
n@749 3970 if ( type === "fx" && queue[0] !== "inprogress" ) {
n@749 3971 jQuery.dequeue( this, type );
n@749 3972 }
n@749 3973 });
n@749 3974 },
n@749 3975 dequeue: function( type ) {
n@749 3976 return this.each(function() {
n@749 3977 jQuery.dequeue( this, type );
n@749 3978 });
n@749 3979 },
n@749 3980 clearQueue: function( type ) {
n@749 3981 return this.queue( type || "fx", [] );
n@749 3982 },
n@749 3983 // Get a promise resolved when queues of a certain type
n@749 3984 // are emptied (fx is the type by default)
n@749 3985 promise: function( type, obj ) {
n@749 3986 var tmp,
n@749 3987 count = 1,
n@749 3988 defer = jQuery.Deferred(),
n@749 3989 elements = this,
n@749 3990 i = this.length,
n@749 3991 resolve = function() {
n@749 3992 if ( !( --count ) ) {
n@749 3993 defer.resolveWith( elements, [ elements ] );
n@749 3994 }
n@749 3995 };
n@749 3996
n@749 3997 if ( typeof type !== "string" ) {
n@749 3998 obj = type;
n@749 3999 type = undefined;
n@749 4000 }
n@749 4001 type = type || "fx";
n@749 4002
n@749 4003 while ( i-- ) {
n@749 4004 tmp = data_priv.get( elements[ i ], type + "queueHooks" );
n@749 4005 if ( tmp && tmp.empty ) {
n@749 4006 count++;
n@749 4007 tmp.empty.add( resolve );
n@749 4008 }
n@749 4009 }
n@749 4010 resolve();
n@749 4011 return defer.promise( obj );
n@749 4012 }
n@749 4013 });
n@749 4014 var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
n@749 4015
n@749 4016 var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
n@749 4017
n@749 4018 var isHidden = function( elem, el ) {
n@749 4019 // isHidden might be called from jQuery#filter function;
n@749 4020 // in that case, element will be second argument
n@749 4021 elem = el || elem;
n@749 4022 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
n@749 4023 };
n@749 4024
n@749 4025 var rcheckableType = (/^(?:checkbox|radio)$/i);
n@749 4026
n@749 4027
n@749 4028
n@749 4029 (function() {
n@749 4030 var fragment = document.createDocumentFragment(),
n@749 4031 div = fragment.appendChild( document.createElement( "div" ) ),
n@749 4032 input = document.createElement( "input" );
n@749 4033
n@749 4034 // Support: Safari<=5.1
n@749 4035 // Check state lost if the name is set (#11217)
n@749 4036 // Support: Windows Web Apps (WWA)
n@749 4037 // `name` and `type` must use .setAttribute for WWA (#14901)
n@749 4038 input.setAttribute( "type", "radio" );
n@749 4039 input.setAttribute( "checked", "checked" );
n@749 4040 input.setAttribute( "name", "t" );
n@749 4041
n@749 4042 div.appendChild( input );
n@749 4043
n@749 4044 // Support: Safari<=5.1, Android<4.2
n@749 4045 // Older WebKit doesn't clone checked state correctly in fragments
n@749 4046 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
n@749 4047
n@749 4048 // Support: IE<=11+
n@749 4049 // Make sure textarea (and checkbox) defaultValue is properly cloned
n@749 4050 div.innerHTML = "<textarea>x</textarea>";
n@749 4051 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
n@749 4052 })();
n@749 4053 var strundefined = typeof undefined;
n@749 4054
n@749 4055
n@749 4056
n@749 4057 support.focusinBubbles = "onfocusin" in window;
n@749 4058
n@749 4059
n@749 4060 var
n@749 4061 rkeyEvent = /^key/,
n@749 4062 rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
n@749 4063 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
n@749 4064 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
n@749 4065
n@749 4066 function returnTrue() {
n@749 4067 return true;
n@749 4068 }
n@749 4069
n@749 4070 function returnFalse() {
n@749 4071 return false;
n@749 4072 }
n@749 4073
n@749 4074 function safeActiveElement() {
n@749 4075 try {
n@749 4076 return document.activeElement;
n@749 4077 } catch ( err ) { }
n@749 4078 }
n@749 4079
n@749 4080 /*
n@749 4081 * Helper functions for managing events -- not part of the public interface.
n@749 4082 * Props to Dean Edwards' addEvent library for many of the ideas.
n@749 4083 */
n@749 4084 jQuery.event = {
n@749 4085
n@749 4086 global: {},
n@749 4087
n@749 4088 add: function( elem, types, handler, data, selector ) {
n@749 4089
n@749 4090 var handleObjIn, eventHandle, tmp,
n@749 4091 events, t, handleObj,
n@749 4092 special, handlers, type, namespaces, origType,
n@749 4093 elemData = data_priv.get( elem );
n@749 4094
n@749 4095 // Don't attach events to noData or text/comment nodes (but allow plain objects)
n@749 4096 if ( !elemData ) {
n@749 4097 return;
n@749 4098 }
n@749 4099
n@749 4100 // Caller can pass in an object of custom data in lieu of the handler
n@749 4101 if ( handler.handler ) {
n@749 4102 handleObjIn = handler;
n@749 4103 handler = handleObjIn.handler;
n@749 4104 selector = handleObjIn.selector;
n@749 4105 }
n@749 4106
n@749 4107 // Make sure that the handler has a unique ID, used to find/remove it later
n@749 4108 if ( !handler.guid ) {
n@749 4109 handler.guid = jQuery.guid++;
n@749 4110 }
n@749 4111
n@749 4112 // Init the element's event structure and main handler, if this is the first
n@749 4113 if ( !(events = elemData.events) ) {
n@749 4114 events = elemData.events = {};
n@749 4115 }
n@749 4116 if ( !(eventHandle = elemData.handle) ) {
n@749 4117 eventHandle = elemData.handle = function( e ) {
n@749 4118 // Discard the second event of a jQuery.event.trigger() and
n@749 4119 // when an event is called after a page has unloaded
n@749 4120 return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
n@749 4121 jQuery.event.dispatch.apply( elem, arguments ) : undefined;
n@749 4122 };
n@749 4123 }
n@749 4124
n@749 4125 // Handle multiple events separated by a space
n@749 4126 types = ( types || "" ).match( rnotwhite ) || [ "" ];
n@749 4127 t = types.length;
n@749 4128 while ( t-- ) {
n@749 4129 tmp = rtypenamespace.exec( types[t] ) || [];
n@749 4130 type = origType = tmp[1];
n@749 4131 namespaces = ( tmp[2] || "" ).split( "." ).sort();
n@749 4132
n@749 4133 // There *must* be a type, no attaching namespace-only handlers
n@749 4134 if ( !type ) {
n@749 4135 continue;
n@749 4136 }
n@749 4137
n@749 4138 // If event changes its type, use the special event handlers for the changed type
n@749 4139 special = jQuery.event.special[ type ] || {};
n@749 4140
n@749 4141 // If selector defined, determine special event api type, otherwise given type
n@749 4142 type = ( selector ? special.delegateType : special.bindType ) || type;
n@749 4143
n@749 4144 // Update special based on newly reset type
n@749 4145 special = jQuery.event.special[ type ] || {};
n@749 4146
n@749 4147 // handleObj is passed to all event handlers
n@749 4148 handleObj = jQuery.extend({
n@749 4149 type: type,
n@749 4150 origType: origType,
n@749 4151 data: data,
n@749 4152 handler: handler,
n@749 4153 guid: handler.guid,
n@749 4154 selector: selector,
n@749 4155 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
n@749 4156 namespace: namespaces.join(".")
n@749 4157 }, handleObjIn );
n@749 4158
n@749 4159 // Init the event handler queue if we're the first
n@749 4160 if ( !(handlers = events[ type ]) ) {
n@749 4161 handlers = events[ type ] = [];
n@749 4162 handlers.delegateCount = 0;
n@749 4163
n@749 4164 // Only use addEventListener if the special events handler returns false
n@749 4165 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
n@749 4166 if ( elem.addEventListener ) {
n@749 4167 elem.addEventListener( type, eventHandle, false );
n@749 4168 }
n@749 4169 }
n@749 4170 }
n@749 4171
n@749 4172 if ( special.add ) {
n@749 4173 special.add.call( elem, handleObj );
n@749 4174
n@749 4175 if ( !handleObj.handler.guid ) {
n@749 4176 handleObj.handler.guid = handler.guid;
n@749 4177 }
n@749 4178 }
n@749 4179
n@749 4180 // Add to the element's handler list, delegates in front
n@749 4181 if ( selector ) {
n@749 4182 handlers.splice( handlers.delegateCount++, 0, handleObj );
n@749 4183 } else {
n@749 4184 handlers.push( handleObj );
n@749 4185 }
n@749 4186
n@749 4187 // Keep track of which events have ever been used, for event optimization
n@749 4188 jQuery.event.global[ type ] = true;
n@749 4189 }
n@749 4190
n@749 4191 },
n@749 4192
n@749 4193 // Detach an event or set of events from an element
n@749 4194 remove: function( elem, types, handler, selector, mappedTypes ) {
n@749 4195
n@749 4196 var j, origCount, tmp,
n@749 4197 events, t, handleObj,
n@749 4198 special, handlers, type, namespaces, origType,
n@749 4199 elemData = data_priv.hasData( elem ) && data_priv.get( elem );
n@749 4200
n@749 4201 if ( !elemData || !(events = elemData.events) ) {
n@749 4202 return;
n@749 4203 }
n@749 4204
n@749 4205 // Once for each type.namespace in types; type may be omitted
n@749 4206 types = ( types || "" ).match( rnotwhite ) || [ "" ];
n@749 4207 t = types.length;
n@749 4208 while ( t-- ) {
n@749 4209 tmp = rtypenamespace.exec( types[t] ) || [];
n@749 4210 type = origType = tmp[1];
n@749 4211 namespaces = ( tmp[2] || "" ).split( "." ).sort();
n@749 4212
n@749 4213 // Unbind all events (on this namespace, if provided) for the element
n@749 4214 if ( !type ) {
n@749 4215 for ( type in events ) {
n@749 4216 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
n@749 4217 }
n@749 4218 continue;
n@749 4219 }
n@749 4220
n@749 4221 special = jQuery.event.special[ type ] || {};
n@749 4222 type = ( selector ? special.delegateType : special.bindType ) || type;
n@749 4223 handlers = events[ type ] || [];
n@749 4224 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
n@749 4225
n@749 4226 // Remove matching events
n@749 4227 origCount = j = handlers.length;
n@749 4228 while ( j-- ) {
n@749 4229 handleObj = handlers[ j ];
n@749 4230
n@749 4231 if ( ( mappedTypes || origType === handleObj.origType ) &&
n@749 4232 ( !handler || handler.guid === handleObj.guid ) &&
n@749 4233 ( !tmp || tmp.test( handleObj.namespace ) ) &&
n@749 4234 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
n@749 4235 handlers.splice( j, 1 );
n@749 4236
n@749 4237 if ( handleObj.selector ) {
n@749 4238 handlers.delegateCount--;
n@749 4239 }
n@749 4240 if ( special.remove ) {
n@749 4241 special.remove.call( elem, handleObj );
n@749 4242 }
n@749 4243 }
n@749 4244 }
n@749 4245
n@749 4246 // Remove generic event handler if we removed something and no more handlers exist
n@749 4247 // (avoids potential for endless recursion during removal of special event handlers)
n@749 4248 if ( origCount && !handlers.length ) {
n@749 4249 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
n@749 4250 jQuery.removeEvent( elem, type, elemData.handle );
n@749 4251 }
n@749 4252
n@749 4253 delete events[ type ];
n@749 4254 }
n@749 4255 }
n@749 4256
n@749 4257 // Remove the expando if it's no longer used
n@749 4258 if ( jQuery.isEmptyObject( events ) ) {
n@749 4259 delete elemData.handle;
n@749 4260 data_priv.remove( elem, "events" );
n@749 4261 }
n@749 4262 },
n@749 4263
n@749 4264 trigger: function( event, data, elem, onlyHandlers ) {
n@749 4265
n@749 4266 var i, cur, tmp, bubbleType, ontype, handle, special,
n@749 4267 eventPath = [ elem || document ],
n@749 4268 type = hasOwn.call( event, "type" ) ? event.type : event,
n@749 4269 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
n@749 4270
n@749 4271 cur = tmp = elem = elem || document;
n@749 4272
n@749 4273 // Don't do events on text and comment nodes
n@749 4274 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
n@749 4275 return;
n@749 4276 }
n@749 4277
n@749 4278 // focus/blur morphs to focusin/out; ensure we're not firing them right now
n@749 4279 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
n@749 4280 return;
n@749 4281 }
n@749 4282
n@749 4283 if ( type.indexOf(".") >= 0 ) {
n@749 4284 // Namespaced trigger; create a regexp to match event type in handle()
n@749 4285 namespaces = type.split(".");
n@749 4286 type = namespaces.shift();
n@749 4287 namespaces.sort();
n@749 4288 }
n@749 4289 ontype = type.indexOf(":") < 0 && "on" + type;
n@749 4290
n@749 4291 // Caller can pass in a jQuery.Event object, Object, or just an event type string
n@749 4292 event = event[ jQuery.expando ] ?
n@749 4293 event :
n@749 4294 new jQuery.Event( type, typeof event === "object" && event );
n@749 4295
n@749 4296 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
n@749 4297 event.isTrigger = onlyHandlers ? 2 : 3;
n@749 4298 event.namespace = namespaces.join(".");
n@749 4299 event.namespace_re = event.namespace ?
n@749 4300 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
n@749 4301 null;
n@749 4302
n@749 4303 // Clean up the event in case it is being reused
n@749 4304 event.result = undefined;
n@749 4305 if ( !event.target ) {
n@749 4306 event.target = elem;
n@749 4307 }
n@749 4308
n@749 4309 // Clone any incoming data and prepend the event, creating the handler arg list
n@749 4310 data = data == null ?
n@749 4311 [ event ] :
n@749 4312 jQuery.makeArray( data, [ event ] );
n@749 4313
n@749 4314 // Allow special events to draw outside the lines
n@749 4315 special = jQuery.event.special[ type ] || {};
n@749 4316 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
n@749 4317 return;
n@749 4318 }
n@749 4319
n@749 4320 // Determine event propagation path in advance, per W3C events spec (#9951)
n@749 4321 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
n@749 4322 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
n@749 4323
n@749 4324 bubbleType = special.delegateType || type;
n@749 4325 if ( !rfocusMorph.test( bubbleType + type ) ) {
n@749 4326 cur = cur.parentNode;
n@749 4327 }
n@749 4328 for ( ; cur; cur = cur.parentNode ) {
n@749 4329 eventPath.push( cur );
n@749 4330 tmp = cur;
n@749 4331 }
n@749 4332
n@749 4333 // Only add window if we got to document (e.g., not plain obj or detached DOM)
n@749 4334 if ( tmp === (elem.ownerDocument || document) ) {
n@749 4335 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
n@749 4336 }
n@749 4337 }
n@749 4338
n@749 4339 // Fire handlers on the event path
n@749 4340 i = 0;
n@749 4341 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
n@749 4342
n@749 4343 event.type = i > 1 ?
n@749 4344 bubbleType :
n@749 4345 special.bindType || type;
n@749 4346
n@749 4347 // jQuery handler
n@749 4348 handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
n@749 4349 if ( handle ) {
n@749 4350 handle.apply( cur, data );
n@749 4351 }
n@749 4352
n@749 4353 // Native handler
n@749 4354 handle = ontype && cur[ ontype ];
n@749 4355 if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
n@749 4356 event.result = handle.apply( cur, data );
n@749 4357 if ( event.result === false ) {
n@749 4358 event.preventDefault();
n@749 4359 }
n@749 4360 }
n@749 4361 }
n@749 4362 event.type = type;
n@749 4363
n@749 4364 // If nobody prevented the default action, do it now
n@749 4365 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
n@749 4366
n@749 4367 if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
n@749 4368 jQuery.acceptData( elem ) ) {
n@749 4369
n@749 4370 // Call a native DOM method on the target with the same name name as the event.
n@749 4371 // Don't do default actions on window, that's where global variables be (#6170)
n@749 4372 if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
n@749 4373
n@749 4374 // Don't re-trigger an onFOO event when we call its FOO() method
n@749 4375 tmp = elem[ ontype ];
n@749 4376
n@749 4377 if ( tmp ) {
n@749 4378 elem[ ontype ] = null;
n@749 4379 }
n@749 4380
n@749 4381 // Prevent re-triggering of the same event, since we already bubbled it above
n@749 4382 jQuery.event.triggered = type;
n@749 4383 elem[ type ]();
n@749 4384 jQuery.event.triggered = undefined;
n@749 4385
n@749 4386 if ( tmp ) {
n@749 4387 elem[ ontype ] = tmp;
n@749 4388 }
n@749 4389 }
n@749 4390 }
n@749 4391 }
n@749 4392
n@749 4393 return event.result;
n@749 4394 },
n@749 4395
n@749 4396 dispatch: function( event ) {
n@749 4397
n@749 4398 // Make a writable jQuery.Event from the native event object
n@749 4399 event = jQuery.event.fix( event );
n@749 4400
n@749 4401 var i, j, ret, matched, handleObj,
n@749 4402 handlerQueue = [],
n@749 4403 args = slice.call( arguments ),
n@749 4404 handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
n@749 4405 special = jQuery.event.special[ event.type ] || {};
n@749 4406
n@749 4407 // Use the fix-ed jQuery.Event rather than the (read-only) native event
n@749 4408 args[0] = event;
n@749 4409 event.delegateTarget = this;
n@749 4410
n@749 4411 // Call the preDispatch hook for the mapped type, and let it bail if desired
n@749 4412 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
n@749 4413 return;
n@749 4414 }
n@749 4415
n@749 4416 // Determine handlers
n@749 4417 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
n@749 4418
n@749 4419 // Run delegates first; they may want to stop propagation beneath us
n@749 4420 i = 0;
n@749 4421 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
n@749 4422 event.currentTarget = matched.elem;
n@749 4423
n@749 4424 j = 0;
n@749 4425 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
n@749 4426
n@749 4427 // Triggered event must either 1) have no namespace, or 2) have namespace(s)
n@749 4428 // a subset or equal to those in the bound event (both can have no namespace).
n@749 4429 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
n@749 4430
n@749 4431 event.handleObj = handleObj;
n@749 4432 event.data = handleObj.data;
n@749 4433
n@749 4434 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
n@749 4435 .apply( matched.elem, args );
n@749 4436
n@749 4437 if ( ret !== undefined ) {
n@749 4438 if ( (event.result = ret) === false ) {
n@749 4439 event.preventDefault();
n@749 4440 event.stopPropagation();
n@749 4441 }
n@749 4442 }
n@749 4443 }
n@749 4444 }
n@749 4445 }
n@749 4446
n@749 4447 // Call the postDispatch hook for the mapped type
n@749 4448 if ( special.postDispatch ) {
n@749 4449 special.postDispatch.call( this, event );
n@749 4450 }
n@749 4451
n@749 4452 return event.result;
n@749 4453 },
n@749 4454
n@749 4455 handlers: function( event, handlers ) {
n@749 4456 var i, matches, sel, handleObj,
n@749 4457 handlerQueue = [],
n@749 4458 delegateCount = handlers.delegateCount,
n@749 4459 cur = event.target;
n@749 4460
n@749 4461 // Find delegate handlers
n@749 4462 // Black-hole SVG <use> instance trees (#13180)
n@749 4463 // Avoid non-left-click bubbling in Firefox (#3861)
n@749 4464 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
n@749 4465
n@749 4466 for ( ; cur !== this; cur = cur.parentNode || this ) {
n@749 4467
n@749 4468 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
n@749 4469 if ( cur.disabled !== true || event.type !== "click" ) {
n@749 4470 matches = [];
n@749 4471 for ( i = 0; i < delegateCount; i++ ) {
n@749 4472 handleObj = handlers[ i ];
n@749 4473
n@749 4474 // Don't conflict with Object.prototype properties (#13203)
n@749 4475 sel = handleObj.selector + " ";
n@749 4476
n@749 4477 if ( matches[ sel ] === undefined ) {
n@749 4478 matches[ sel ] = handleObj.needsContext ?
n@749 4479 jQuery( sel, this ).index( cur ) >= 0 :
n@749 4480 jQuery.find( sel, this, null, [ cur ] ).length;
n@749 4481 }
n@749 4482 if ( matches[ sel ] ) {
n@749 4483 matches.push( handleObj );
n@749 4484 }
n@749 4485 }
n@749 4486 if ( matches.length ) {
n@749 4487 handlerQueue.push({ elem: cur, handlers: matches });
n@749 4488 }
n@749 4489 }
n@749 4490 }
n@749 4491 }
n@749 4492
n@749 4493 // Add the remaining (directly-bound) handlers
n@749 4494 if ( delegateCount < handlers.length ) {
n@749 4495 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
n@749 4496 }
n@749 4497
n@749 4498 return handlerQueue;
n@749 4499 },
n@749 4500
n@749 4501 // Includes some event props shared by KeyEvent and MouseEvent
n@749 4502 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
n@749 4503
n@749 4504 fixHooks: {},
n@749 4505
n@749 4506 keyHooks: {
n@749 4507 props: "char charCode key keyCode".split(" "),
n@749 4508 filter: function( event, original ) {
n@749 4509
n@749 4510 // Add which for key events
n@749 4511 if ( event.which == null ) {
n@749 4512 event.which = original.charCode != null ? original.charCode : original.keyCode;
n@749 4513 }
n@749 4514
n@749 4515 return event;
n@749 4516 }
n@749 4517 },
n@749 4518
n@749 4519 mouseHooks: {
n@749 4520 props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
n@749 4521 filter: function( event, original ) {
n@749 4522 var eventDoc, doc, body,
n@749 4523 button = original.button;
n@749 4524
n@749 4525 // Calculate pageX/Y if missing and clientX/Y available
n@749 4526 if ( event.pageX == null && original.clientX != null ) {
n@749 4527 eventDoc = event.target.ownerDocument || document;
n@749 4528 doc = eventDoc.documentElement;
n@749 4529 body = eventDoc.body;
n@749 4530
n@749 4531 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
n@749 4532 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
n@749 4533 }
n@749 4534
n@749 4535 // Add which for click: 1 === left; 2 === middle; 3 === right
n@749 4536 // Note: button is not normalized, so don't use it
n@749 4537 if ( !event.which && button !== undefined ) {
n@749 4538 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
n@749 4539 }
n@749 4540
n@749 4541 return event;
n@749 4542 }
n@749 4543 },
n@749 4544
n@749 4545 fix: function( event ) {
n@749 4546 if ( event[ jQuery.expando ] ) {
n@749 4547 return event;
n@749 4548 }
n@749 4549
n@749 4550 // Create a writable copy of the event object and normalize some properties
n@749 4551 var i, prop, copy,
n@749 4552 type = event.type,
n@749 4553 originalEvent = event,
n@749 4554 fixHook = this.fixHooks[ type ];
n@749 4555
n@749 4556 if ( !fixHook ) {
n@749 4557 this.fixHooks[ type ] = fixHook =
n@749 4558 rmouseEvent.test( type ) ? this.mouseHooks :
n@749 4559 rkeyEvent.test( type ) ? this.keyHooks :
n@749 4560 {};
n@749 4561 }
n@749 4562 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
n@749 4563
n@749 4564 event = new jQuery.Event( originalEvent );
n@749 4565
n@749 4566 i = copy.length;
n@749 4567 while ( i-- ) {
n@749 4568 prop = copy[ i ];
n@749 4569 event[ prop ] = originalEvent[ prop ];
n@749 4570 }
n@749 4571
n@749 4572 // Support: Cordova 2.5 (WebKit) (#13255)
n@749 4573 // All events should have a target; Cordova deviceready doesn't
n@749 4574 if ( !event.target ) {
n@749 4575 event.target = document;
n@749 4576 }
n@749 4577
n@749 4578 // Support: Safari 6.0+, Chrome<28
n@749 4579 // Target should not be a text node (#504, #13143)
n@749 4580 if ( event.target.nodeType === 3 ) {
n@749 4581 event.target = event.target.parentNode;
n@749 4582 }
n@749 4583
n@749 4584 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
n@749 4585 },
n@749 4586
n@749 4587 special: {
n@749 4588 load: {
n@749 4589 // Prevent triggered image.load events from bubbling to window.load
n@749 4590 noBubble: true
n@749 4591 },
n@749 4592 focus: {
n@749 4593 // Fire native event if possible so blur/focus sequence is correct
n@749 4594 trigger: function() {
n@749 4595 if ( this !== safeActiveElement() && this.focus ) {
n@749 4596 this.focus();
n@749 4597 return false;
n@749 4598 }
n@749 4599 },
n@749 4600 delegateType: "focusin"
n@749 4601 },
n@749 4602 blur: {
n@749 4603 trigger: function() {
n@749 4604 if ( this === safeActiveElement() && this.blur ) {
n@749 4605 this.blur();
n@749 4606 return false;
n@749 4607 }
n@749 4608 },
n@749 4609 delegateType: "focusout"
n@749 4610 },
n@749 4611 click: {
n@749 4612 // For checkbox, fire native event so checked state will be right
n@749 4613 trigger: function() {
n@749 4614 if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
n@749 4615 this.click();
n@749 4616 return false;
n@749 4617 }
n@749 4618 },
n@749 4619
n@749 4620 // For cross-browser consistency, don't fire native .click() on links
n@749 4621 _default: function( event ) {
n@749 4622 return jQuery.nodeName( event.target, "a" );
n@749 4623 }
n@749 4624 },
n@749 4625
n@749 4626 beforeunload: {
n@749 4627 postDispatch: function( event ) {
n@749 4628
n@749 4629 // Support: Firefox 20+
n@749 4630 // Firefox doesn't alert if the returnValue field is not set.
n@749 4631 if ( event.result !== undefined && event.originalEvent ) {
n@749 4632 event.originalEvent.returnValue = event.result;
n@749 4633 }
n@749 4634 }
n@749 4635 }
n@749 4636 },
n@749 4637
n@749 4638 simulate: function( type, elem, event, bubble ) {
n@749 4639 // Piggyback on a donor event to simulate a different one.
n@749 4640 // Fake originalEvent to avoid donor's stopPropagation, but if the
n@749 4641 // simulated event prevents default then we do the same on the donor.
n@749 4642 var e = jQuery.extend(
n@749 4643 new jQuery.Event(),
n@749 4644 event,
n@749 4645 {
n@749 4646 type: type,
n@749 4647 isSimulated: true,
n@749 4648 originalEvent: {}
n@749 4649 }
n@749 4650 );
n@749 4651 if ( bubble ) {
n@749 4652 jQuery.event.trigger( e, null, elem );
n@749 4653 } else {
n@749 4654 jQuery.event.dispatch.call( elem, e );
n@749 4655 }
n@749 4656 if ( e.isDefaultPrevented() ) {
n@749 4657 event.preventDefault();
n@749 4658 }
n@749 4659 }
n@749 4660 };
n@749 4661
n@749 4662 jQuery.removeEvent = function( elem, type, handle ) {
n@749 4663 if ( elem.removeEventListener ) {
n@749 4664 elem.removeEventListener( type, handle, false );
n@749 4665 }
n@749 4666 };
n@749 4667
n@749 4668 jQuery.Event = function( src, props ) {
n@749 4669 // Allow instantiation without the 'new' keyword
n@749 4670 if ( !(this instanceof jQuery.Event) ) {
n@749 4671 return new jQuery.Event( src, props );
n@749 4672 }
n@749 4673
n@749 4674 // Event object
n@749 4675 if ( src && src.type ) {
n@749 4676 this.originalEvent = src;
n@749 4677 this.type = src.type;
n@749 4678
n@749 4679 // Events bubbling up the document may have been marked as prevented
n@749 4680 // by a handler lower down the tree; reflect the correct value.
n@749 4681 this.isDefaultPrevented = src.defaultPrevented ||
n@749 4682 src.defaultPrevented === undefined &&
n@749 4683 // Support: Android<4.0
n@749 4684 src.returnValue === false ?
n@749 4685 returnTrue :
n@749 4686 returnFalse;
n@749 4687
n@749 4688 // Event type
n@749 4689 } else {
n@749 4690 this.type = src;
n@749 4691 }
n@749 4692
n@749 4693 // Put explicitly provided properties onto the event object
n@749 4694 if ( props ) {
n@749 4695 jQuery.extend( this, props );
n@749 4696 }
n@749 4697
n@749 4698 // Create a timestamp if incoming event doesn't have one
n@749 4699 this.timeStamp = src && src.timeStamp || jQuery.now();
n@749 4700
n@749 4701 // Mark it as fixed
n@749 4702 this[ jQuery.expando ] = true;
n@749 4703 };
n@749 4704
n@749 4705 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
n@749 4706 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
n@749 4707 jQuery.Event.prototype = {
n@749 4708 isDefaultPrevented: returnFalse,
n@749 4709 isPropagationStopped: returnFalse,
n@749 4710 isImmediatePropagationStopped: returnFalse,
n@749 4711
n@749 4712 preventDefault: function() {
n@749 4713 var e = this.originalEvent;
n@749 4714
n@749 4715 this.isDefaultPrevented = returnTrue;
n@749 4716
n@749 4717 if ( e && e.preventDefault ) {
n@749 4718 e.preventDefault();
n@749 4719 }
n@749 4720 },
n@749 4721 stopPropagation: function() {
n@749 4722 var e = this.originalEvent;
n@749 4723
n@749 4724 this.isPropagationStopped = returnTrue;
n@749 4725
n@749 4726 if ( e && e.stopPropagation ) {
n@749 4727 e.stopPropagation();
n@749 4728 }
n@749 4729 },
n@749 4730 stopImmediatePropagation: function() {
n@749 4731 var e = this.originalEvent;
n@749 4732
n@749 4733 this.isImmediatePropagationStopped = returnTrue;
n@749 4734
n@749 4735 if ( e && e.stopImmediatePropagation ) {
n@749 4736 e.stopImmediatePropagation();
n@749 4737 }
n@749 4738
n@749 4739 this.stopPropagation();
n@749 4740 }
n@749 4741 };
n@749 4742
n@749 4743 // Create mouseenter/leave events using mouseover/out and event-time checks
n@749 4744 // Support: Chrome 15+
n@749 4745 jQuery.each({
n@749 4746 mouseenter: "mouseover",
n@749 4747 mouseleave: "mouseout",
n@749 4748 pointerenter: "pointerover",
n@749 4749 pointerleave: "pointerout"
n@749 4750 }, function( orig, fix ) {
n@749 4751 jQuery.event.special[ orig ] = {
n@749 4752 delegateType: fix,
n@749 4753 bindType: fix,
n@749 4754
n@749 4755 handle: function( event ) {
n@749 4756 var ret,
n@749 4757 target = this,
n@749 4758 related = event.relatedTarget,
n@749 4759 handleObj = event.handleObj;
n@749 4760
n@749 4761 // For mousenter/leave call the handler if related is outside the target.
n@749 4762 // NB: No relatedTarget if the mouse left/entered the browser window
n@749 4763 if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
n@749 4764 event.type = handleObj.origType;
n@749 4765 ret = handleObj.handler.apply( this, arguments );
n@749 4766 event.type = fix;
n@749 4767 }
n@749 4768 return ret;
n@749 4769 }
n@749 4770 };
n@749 4771 });
n@749 4772
n@749 4773 // Support: Firefox, Chrome, Safari
n@749 4774 // Create "bubbling" focus and blur events
n@749 4775 if ( !support.focusinBubbles ) {
n@749 4776 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
n@749 4777
n@749 4778 // Attach a single capturing handler on the document while someone wants focusin/focusout
n@749 4779 var handler = function( event ) {
n@749 4780 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
n@749 4781 };
n@749 4782
n@749 4783 jQuery.event.special[ fix ] = {
n@749 4784 setup: function() {
n@749 4785 var doc = this.ownerDocument || this,
n@749 4786 attaches = data_priv.access( doc, fix );
n@749 4787
n@749 4788 if ( !attaches ) {
n@749 4789 doc.addEventListener( orig, handler, true );
n@749 4790 }
n@749 4791 data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
n@749 4792 },
n@749 4793 teardown: function() {
n@749 4794 var doc = this.ownerDocument || this,
n@749 4795 attaches = data_priv.access( doc, fix ) - 1;
n@749 4796
n@749 4797 if ( !attaches ) {
n@749 4798 doc.removeEventListener( orig, handler, true );
n@749 4799 data_priv.remove( doc, fix );
n@749 4800
n@749 4801 } else {
n@749 4802 data_priv.access( doc, fix, attaches );
n@749 4803 }
n@749 4804 }
n@749 4805 };
n@749 4806 });
n@749 4807 }
n@749 4808
n@749 4809 jQuery.fn.extend({
n@749 4810
n@749 4811 on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
n@749 4812 var origFn, type;
n@749 4813
n@749 4814 // Types can be a map of types/handlers
n@749 4815 if ( typeof types === "object" ) {
n@749 4816 // ( types-Object, selector, data )
n@749 4817 if ( typeof selector !== "string" ) {
n@749 4818 // ( types-Object, data )
n@749 4819 data = data || selector;
n@749 4820 selector = undefined;
n@749 4821 }
n@749 4822 for ( type in types ) {
n@749 4823 this.on( type, selector, data, types[ type ], one );
n@749 4824 }
n@749 4825 return this;
n@749 4826 }
n@749 4827
n@749 4828 if ( data == null && fn == null ) {
n@749 4829 // ( types, fn )
n@749 4830 fn = selector;
n@749 4831 data = selector = undefined;
n@749 4832 } else if ( fn == null ) {
n@749 4833 if ( typeof selector === "string" ) {
n@749 4834 // ( types, selector, fn )
n@749 4835 fn = data;
n@749 4836 data = undefined;
n@749 4837 } else {
n@749 4838 // ( types, data, fn )
n@749 4839 fn = data;
n@749 4840 data = selector;
n@749 4841 selector = undefined;
n@749 4842 }
n@749 4843 }
n@749 4844 if ( fn === false ) {
n@749 4845 fn = returnFalse;
n@749 4846 } else if ( !fn ) {
n@749 4847 return this;
n@749 4848 }
n@749 4849
n@749 4850 if ( one === 1 ) {
n@749 4851 origFn = fn;
n@749 4852 fn = function( event ) {
n@749 4853 // Can use an empty set, since event contains the info
n@749 4854 jQuery().off( event );
n@749 4855 return origFn.apply( this, arguments );
n@749 4856 };
n@749 4857 // Use same guid so caller can remove using origFn
n@749 4858 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
n@749 4859 }
n@749 4860 return this.each( function() {
n@749 4861 jQuery.event.add( this, types, fn, data, selector );
n@749 4862 });
n@749 4863 },
n@749 4864 one: function( types, selector, data, fn ) {
n@749 4865 return this.on( types, selector, data, fn, 1 );
n@749 4866 },
n@749 4867 off: function( types, selector, fn ) {
n@749 4868 var handleObj, type;
n@749 4869 if ( types && types.preventDefault && types.handleObj ) {
n@749 4870 // ( event ) dispatched jQuery.Event
n@749 4871 handleObj = types.handleObj;
n@749 4872 jQuery( types.delegateTarget ).off(
n@749 4873 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
n@749 4874 handleObj.selector,
n@749 4875 handleObj.handler
n@749 4876 );
n@749 4877 return this;
n@749 4878 }
n@749 4879 if ( typeof types === "object" ) {
n@749 4880 // ( types-object [, selector] )
n@749 4881 for ( type in types ) {
n@749 4882 this.off( type, selector, types[ type ] );
n@749 4883 }
n@749 4884 return this;
n@749 4885 }
n@749 4886 if ( selector === false || typeof selector === "function" ) {
n@749 4887 // ( types [, fn] )
n@749 4888 fn = selector;
n@749 4889 selector = undefined;
n@749 4890 }
n@749 4891 if ( fn === false ) {
n@749 4892 fn = returnFalse;
n@749 4893 }
n@749 4894 return this.each(function() {
n@749 4895 jQuery.event.remove( this, types, fn, selector );
n@749 4896 });
n@749 4897 },
n@749 4898
n@749 4899 trigger: function( type, data ) {
n@749 4900 return this.each(function() {
n@749 4901 jQuery.event.trigger( type, data, this );
n@749 4902 });
n@749 4903 },
n@749 4904 triggerHandler: function( type, data ) {
n@749 4905 var elem = this[0];
n@749 4906 if ( elem ) {
n@749 4907 return jQuery.event.trigger( type, data, elem, true );
n@749 4908 }
n@749 4909 }
n@749 4910 });
n@749 4911
n@749 4912
n@749 4913 var
n@749 4914 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
n@749 4915 rtagName = /<([\w:]+)/,
n@749 4916 rhtml = /<|&#?\w+;/,
n@749 4917 rnoInnerhtml = /<(?:script|style|link)/i,
n@749 4918 // checked="checked" or checked
n@749 4919 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
n@749 4920 rscriptType = /^$|\/(?:java|ecma)script/i,
n@749 4921 rscriptTypeMasked = /^true\/(.*)/,
n@749 4922 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
n@749 4923
n@749 4924 // We have to close these tags to support XHTML (#13200)
n@749 4925 wrapMap = {
n@749 4926
n@749 4927 // Support: IE9
n@749 4928 option: [ 1, "<select multiple='multiple'>", "</select>" ],
n@749 4929
n@749 4930 thead: [ 1, "<table>", "</table>" ],
n@749 4931 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
n@749 4932 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
n@749 4933 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
n@749 4934
n@749 4935 _default: [ 0, "", "" ]
n@749 4936 };
n@749 4937
n@749 4938 // Support: IE9
n@749 4939 wrapMap.optgroup = wrapMap.option;
n@749 4940
n@749 4941 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
n@749 4942 wrapMap.th = wrapMap.td;
n@749 4943
n@749 4944 // Support: 1.x compatibility
n@749 4945 // Manipulating tables requires a tbody
n@749 4946 function manipulationTarget( elem, content ) {
n@749 4947 return jQuery.nodeName( elem, "table" ) &&
n@749 4948 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
n@749 4949
n@749 4950 elem.getElementsByTagName("tbody")[0] ||
n@749 4951 elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
n@749 4952 elem;
n@749 4953 }
n@749 4954
n@749 4955 // Replace/restore the type attribute of script elements for safe DOM manipulation
n@749 4956 function disableScript( elem ) {
n@749 4957 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
n@749 4958 return elem;
n@749 4959 }
n@749 4960 function restoreScript( elem ) {
n@749 4961 var match = rscriptTypeMasked.exec( elem.type );
n@749 4962
n@749 4963 if ( match ) {
n@749 4964 elem.type = match[ 1 ];
n@749 4965 } else {
n@749 4966 elem.removeAttribute("type");
n@749 4967 }
n@749 4968
n@749 4969 return elem;
n@749 4970 }
n@749 4971
n@749 4972 // Mark scripts as having already been evaluated
n@749 4973 function setGlobalEval( elems, refElements ) {
n@749 4974 var i = 0,
n@749 4975 l = elems.length;
n@749 4976
n@749 4977 for ( ; i < l; i++ ) {
n@749 4978 data_priv.set(
n@749 4979 elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
n@749 4980 );
n@749 4981 }
n@749 4982 }
n@749 4983
n@749 4984 function cloneCopyEvent( src, dest ) {
n@749 4985 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
n@749 4986
n@749 4987 if ( dest.nodeType !== 1 ) {
n@749 4988 return;
n@749 4989 }
n@749 4990
n@749 4991 // 1. Copy private data: events, handlers, etc.
n@749 4992 if ( data_priv.hasData( src ) ) {
n@749 4993 pdataOld = data_priv.access( src );
n@749 4994 pdataCur = data_priv.set( dest, pdataOld );
n@749 4995 events = pdataOld.events;
n@749 4996
n@749 4997 if ( events ) {
n@749 4998 delete pdataCur.handle;
n@749 4999 pdataCur.events = {};
n@749 5000
n@749 5001 for ( type in events ) {
n@749 5002 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
n@749 5003 jQuery.event.add( dest, type, events[ type ][ i ] );
n@749 5004 }
n@749 5005 }
n@749 5006 }
n@749 5007 }
n@749 5008
n@749 5009 // 2. Copy user data
n@749 5010 if ( data_user.hasData( src ) ) {
n@749 5011 udataOld = data_user.access( src );
n@749 5012 udataCur = jQuery.extend( {}, udataOld );
n@749 5013
n@749 5014 data_user.set( dest, udataCur );
n@749 5015 }
n@749 5016 }
n@749 5017
n@749 5018 function getAll( context, tag ) {
n@749 5019 var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
n@749 5020 context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
n@749 5021 [];
n@749 5022
n@749 5023 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
n@749 5024 jQuery.merge( [ context ], ret ) :
n@749 5025 ret;
n@749 5026 }
n@749 5027
n@749 5028 // Fix IE bugs, see support tests
n@749 5029 function fixInput( src, dest ) {
n@749 5030 var nodeName = dest.nodeName.toLowerCase();
n@749 5031
n@749 5032 // Fails to persist the checked state of a cloned checkbox or radio button.
n@749 5033 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
n@749 5034 dest.checked = src.checked;
n@749 5035
n@749 5036 // Fails to return the selected option to the default selected state when cloning options
n@749 5037 } else if ( nodeName === "input" || nodeName === "textarea" ) {
n@749 5038 dest.defaultValue = src.defaultValue;
n@749 5039 }
n@749 5040 }
n@749 5041
n@749 5042 jQuery.extend({
n@749 5043 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
n@749 5044 var i, l, srcElements, destElements,
n@749 5045 clone = elem.cloneNode( true ),
n@749 5046 inPage = jQuery.contains( elem.ownerDocument, elem );
n@749 5047
n@749 5048 // Fix IE cloning issues
n@749 5049 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
n@749 5050 !jQuery.isXMLDoc( elem ) ) {
n@749 5051
n@749 5052 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
n@749 5053 destElements = getAll( clone );
n@749 5054 srcElements = getAll( elem );
n@749 5055
n@749 5056 for ( i = 0, l = srcElements.length; i < l; i++ ) {
n@749 5057 fixInput( srcElements[ i ], destElements[ i ] );
n@749 5058 }
n@749 5059 }
n@749 5060
n@749 5061 // Copy the events from the original to the clone
n@749 5062 if ( dataAndEvents ) {
n@749 5063 if ( deepDataAndEvents ) {
n@749 5064 srcElements = srcElements || getAll( elem );
n@749 5065 destElements = destElements || getAll( clone );
n@749 5066
n@749 5067 for ( i = 0, l = srcElements.length; i < l; i++ ) {
n@749 5068 cloneCopyEvent( srcElements[ i ], destElements[ i ] );
n@749 5069 }
n@749 5070 } else {
n@749 5071 cloneCopyEvent( elem, clone );
n@749 5072 }
n@749 5073 }
n@749 5074
n@749 5075 // Preserve script evaluation history
n@749 5076 destElements = getAll( clone, "script" );
n@749 5077 if ( destElements.length > 0 ) {
n@749 5078 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
n@749 5079 }
n@749 5080
n@749 5081 // Return the cloned set
n@749 5082 return clone;
n@749 5083 },
n@749 5084
n@749 5085 buildFragment: function( elems, context, scripts, selection ) {
n@749 5086 var elem, tmp, tag, wrap, contains, j,
n@749 5087 fragment = context.createDocumentFragment(),
n@749 5088 nodes = [],
n@749 5089 i = 0,
n@749 5090 l = elems.length;
n@749 5091
n@749 5092 for ( ; i < l; i++ ) {
n@749 5093 elem = elems[ i ];
n@749 5094
n@749 5095 if ( elem || elem === 0 ) {
n@749 5096
n@749 5097 // Add nodes directly
n@749 5098 if ( jQuery.type( elem ) === "object" ) {
n@749 5099 // Support: QtWebKit, PhantomJS
n@749 5100 // push.apply(_, arraylike) throws on ancient WebKit
n@749 5101 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
n@749 5102
n@749 5103 // Convert non-html into a text node
n@749 5104 } else if ( !rhtml.test( elem ) ) {
n@749 5105 nodes.push( context.createTextNode( elem ) );
n@749 5106
n@749 5107 // Convert html into DOM nodes
n@749 5108 } else {
n@749 5109 tmp = tmp || fragment.appendChild( context.createElement("div") );
n@749 5110
n@749 5111 // Deserialize a standard representation
n@749 5112 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
n@749 5113 wrap = wrapMap[ tag ] || wrapMap._default;
n@749 5114 tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
n@749 5115
n@749 5116 // Descend through wrappers to the right content
n@749 5117 j = wrap[ 0 ];
n@749 5118 while ( j-- ) {
n@749 5119 tmp = tmp.lastChild;
n@749 5120 }
n@749 5121
n@749 5122 // Support: QtWebKit, PhantomJS
n@749 5123 // push.apply(_, arraylike) throws on ancient WebKit
n@749 5124 jQuery.merge( nodes, tmp.childNodes );
n@749 5125
n@749 5126 // Remember the top-level container
n@749 5127 tmp = fragment.firstChild;
n@749 5128
n@749 5129 // Ensure the created nodes are orphaned (#12392)
n@749 5130 tmp.textContent = "";
n@749 5131 }
n@749 5132 }
n@749 5133 }
n@749 5134
n@749 5135 // Remove wrapper from fragment
n@749 5136 fragment.textContent = "";
n@749 5137
n@749 5138 i = 0;
n@749 5139 while ( (elem = nodes[ i++ ]) ) {
n@749 5140
n@749 5141 // #4087 - If origin and destination elements are the same, and this is
n@749 5142 // that element, do not do anything
n@749 5143 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
n@749 5144 continue;
n@749 5145 }
n@749 5146
n@749 5147 contains = jQuery.contains( elem.ownerDocument, elem );
n@749 5148
n@749 5149 // Append to fragment
n@749 5150 tmp = getAll( fragment.appendChild( elem ), "script" );
n@749 5151
n@749 5152 // Preserve script evaluation history
n@749 5153 if ( contains ) {
n@749 5154 setGlobalEval( tmp );
n@749 5155 }
n@749 5156
n@749 5157 // Capture executables
n@749 5158 if ( scripts ) {
n@749 5159 j = 0;
n@749 5160 while ( (elem = tmp[ j++ ]) ) {
n@749 5161 if ( rscriptType.test( elem.type || "" ) ) {
n@749 5162 scripts.push( elem );
n@749 5163 }
n@749 5164 }
n@749 5165 }
n@749 5166 }
n@749 5167
n@749 5168 return fragment;
n@749 5169 },
n@749 5170
n@749 5171 cleanData: function( elems ) {
n@749 5172 var data, elem, type, key,
n@749 5173 special = jQuery.event.special,
n@749 5174 i = 0;
n@749 5175
n@749 5176 for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
n@749 5177 if ( jQuery.acceptData( elem ) ) {
n@749 5178 key = elem[ data_priv.expando ];
n@749 5179
n@749 5180 if ( key && (data = data_priv.cache[ key ]) ) {
n@749 5181 if ( data.events ) {
n@749 5182 for ( type in data.events ) {
n@749 5183 if ( special[ type ] ) {
n@749 5184 jQuery.event.remove( elem, type );
n@749 5185
n@749 5186 // This is a shortcut to avoid jQuery.event.remove's overhead
n@749 5187 } else {
n@749 5188 jQuery.removeEvent( elem, type, data.handle );
n@749 5189 }
n@749 5190 }
n@749 5191 }
n@749 5192 if ( data_priv.cache[ key ] ) {
n@749 5193 // Discard any remaining `private` data
n@749 5194 delete data_priv.cache[ key ];
n@749 5195 }
n@749 5196 }
n@749 5197 }
n@749 5198 // Discard any remaining `user` data
n@749 5199 delete data_user.cache[ elem[ data_user.expando ] ];
n@749 5200 }
n@749 5201 }
n@749 5202 });
n@749 5203
n@749 5204 jQuery.fn.extend({
n@749 5205 text: function( value ) {
n@749 5206 return access( this, function( value ) {
n@749 5207 return value === undefined ?
n@749 5208 jQuery.text( this ) :
n@749 5209 this.empty().each(function() {
n@749 5210 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
n@749 5211 this.textContent = value;
n@749 5212 }
n@749 5213 });
n@749 5214 }, null, value, arguments.length );
n@749 5215 },
n@749 5216
n@749 5217 append: function() {
n@749 5218 return this.domManip( arguments, function( elem ) {
n@749 5219 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
n@749 5220 var target = manipulationTarget( this, elem );
n@749 5221 target.appendChild( elem );
n@749 5222 }
n@749 5223 });
n@749 5224 },
n@749 5225
n@749 5226 prepend: function() {
n@749 5227 return this.domManip( arguments, function( elem ) {
n@749 5228 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
n@749 5229 var target = manipulationTarget( this, elem );
n@749 5230 target.insertBefore( elem, target.firstChild );
n@749 5231 }
n@749 5232 });
n@749 5233 },
n@749 5234
n@749 5235 before: function() {
n@749 5236 return this.domManip( arguments, function( elem ) {
n@749 5237 if ( this.parentNode ) {
n@749 5238 this.parentNode.insertBefore( elem, this );
n@749 5239 }
n@749 5240 });
n@749 5241 },
n@749 5242
n@749 5243 after: function() {
n@749 5244 return this.domManip( arguments, function( elem ) {
n@749 5245 if ( this.parentNode ) {
n@749 5246 this.parentNode.insertBefore( elem, this.nextSibling );
n@749 5247 }
n@749 5248 });
n@749 5249 },
n@749 5250
n@749 5251 remove: function( selector, keepData /* Internal Use Only */ ) {
n@749 5252 var elem,
n@749 5253 elems = selector ? jQuery.filter( selector, this ) : this,
n@749 5254 i = 0;
n@749 5255
n@749 5256 for ( ; (elem = elems[i]) != null; i++ ) {
n@749 5257 if ( !keepData && elem.nodeType === 1 ) {
n@749 5258 jQuery.cleanData( getAll( elem ) );
n@749 5259 }
n@749 5260
n@749 5261 if ( elem.parentNode ) {
n@749 5262 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
n@749 5263 setGlobalEval( getAll( elem, "script" ) );
n@749 5264 }
n@749 5265 elem.parentNode.removeChild( elem );
n@749 5266 }
n@749 5267 }
n@749 5268
n@749 5269 return this;
n@749 5270 },
n@749 5271
n@749 5272 empty: function() {
n@749 5273 var elem,
n@749 5274 i = 0;
n@749 5275
n@749 5276 for ( ; (elem = this[i]) != null; i++ ) {
n@749 5277 if ( elem.nodeType === 1 ) {
n@749 5278
n@749 5279 // Prevent memory leaks
n@749 5280 jQuery.cleanData( getAll( elem, false ) );
n@749 5281
n@749 5282 // Remove any remaining nodes
n@749 5283 elem.textContent = "";
n@749 5284 }
n@749 5285 }
n@749 5286
n@749 5287 return this;
n@749 5288 },
n@749 5289
n@749 5290 clone: function( dataAndEvents, deepDataAndEvents ) {
n@749 5291 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
n@749 5292 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
n@749 5293
n@749 5294 return this.map(function() {
n@749 5295 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
n@749 5296 });
n@749 5297 },
n@749 5298
n@749 5299 html: function( value ) {
n@749 5300 return access( this, function( value ) {
n@749 5301 var elem = this[ 0 ] || {},
n@749 5302 i = 0,
n@749 5303 l = this.length;
n@749 5304
n@749 5305 if ( value === undefined && elem.nodeType === 1 ) {
n@749 5306 return elem.innerHTML;
n@749 5307 }
n@749 5308
n@749 5309 // See if we can take a shortcut and just use innerHTML
n@749 5310 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
n@749 5311 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
n@749 5312
n@749 5313 value = value.replace( rxhtmlTag, "<$1></$2>" );
n@749 5314
n@749 5315 try {
n@749 5316 for ( ; i < l; i++ ) {
n@749 5317 elem = this[ i ] || {};
n@749 5318
n@749 5319 // Remove element nodes and prevent memory leaks
n@749 5320 if ( elem.nodeType === 1 ) {
n@749 5321 jQuery.cleanData( getAll( elem, false ) );
n@749 5322 elem.innerHTML = value;
n@749 5323 }
n@749 5324 }
n@749 5325
n@749 5326 elem = 0;
n@749 5327
n@749 5328 // If using innerHTML throws an exception, use the fallback method
n@749 5329 } catch( e ) {}
n@749 5330 }
n@749 5331
n@749 5332 if ( elem ) {
n@749 5333 this.empty().append( value );
n@749 5334 }
n@749 5335 }, null, value, arguments.length );
n@749 5336 },
n@749 5337
n@749 5338 replaceWith: function() {
n@749 5339 var arg = arguments[ 0 ];
n@749 5340
n@749 5341 // Make the changes, replacing each context element with the new content
n@749 5342 this.domManip( arguments, function( elem ) {
n@749 5343 arg = this.parentNode;
n@749 5344
n@749 5345 jQuery.cleanData( getAll( this ) );
n@749 5346
n@749 5347 if ( arg ) {
n@749 5348 arg.replaceChild( elem, this );
n@749 5349 }
n@749 5350 });
n@749 5351
n@749 5352 // Force removal if there was no new content (e.g., from empty arguments)
n@749 5353 return arg && (arg.length || arg.nodeType) ? this : this.remove();
n@749 5354 },
n@749 5355
n@749 5356 detach: function( selector ) {
n@749 5357 return this.remove( selector, true );
n@749 5358 },
n@749 5359
n@749 5360 domManip: function( args, callback ) {
n@749 5361
n@749 5362 // Flatten any nested arrays
n@749 5363 args = concat.apply( [], args );
n@749 5364
n@749 5365 var fragment, first, scripts, hasScripts, node, doc,
n@749 5366 i = 0,
n@749 5367 l = this.length,
n@749 5368 set = this,
n@749 5369 iNoClone = l - 1,
n@749 5370 value = args[ 0 ],
n@749 5371 isFunction = jQuery.isFunction( value );
n@749 5372
n@749 5373 // We can't cloneNode fragments that contain checked, in WebKit
n@749 5374 if ( isFunction ||
n@749 5375 ( l > 1 && typeof value === "string" &&
n@749 5376 !support.checkClone && rchecked.test( value ) ) ) {
n@749 5377 return this.each(function( index ) {
n@749 5378 var self = set.eq( index );
n@749 5379 if ( isFunction ) {
n@749 5380 args[ 0 ] = value.call( this, index, self.html() );
n@749 5381 }
n@749 5382 self.domManip( args, callback );
n@749 5383 });
n@749 5384 }
n@749 5385
n@749 5386 if ( l ) {
n@749 5387 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
n@749 5388 first = fragment.firstChild;
n@749 5389
n@749 5390 if ( fragment.childNodes.length === 1 ) {
n@749 5391 fragment = first;
n@749 5392 }
n@749 5393
n@749 5394 if ( first ) {
n@749 5395 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
n@749 5396 hasScripts = scripts.length;
n@749 5397
n@749 5398 // Use the original fragment for the last item instead of the first because it can end up
n@749 5399 // being emptied incorrectly in certain situations (#8070).
n@749 5400 for ( ; i < l; i++ ) {
n@749 5401 node = fragment;
n@749 5402
n@749 5403 if ( i !== iNoClone ) {
n@749 5404 node = jQuery.clone( node, true, true );
n@749 5405
n@749 5406 // Keep references to cloned scripts for later restoration
n@749 5407 if ( hasScripts ) {
n@749 5408 // Support: QtWebKit
n@749 5409 // jQuery.merge because push.apply(_, arraylike) throws
n@749 5410 jQuery.merge( scripts, getAll( node, "script" ) );
n@749 5411 }
n@749 5412 }
n@749 5413
n@749 5414 callback.call( this[ i ], node, i );
n@749 5415 }
n@749 5416
n@749 5417 if ( hasScripts ) {
n@749 5418 doc = scripts[ scripts.length - 1 ].ownerDocument;
n@749 5419
n@749 5420 // Reenable scripts
n@749 5421 jQuery.map( scripts, restoreScript );
n@749 5422
n@749 5423 // Evaluate executable scripts on first document insertion
n@749 5424 for ( i = 0; i < hasScripts; i++ ) {
n@749 5425 node = scripts[ i ];
n@749 5426 if ( rscriptType.test( node.type || "" ) &&
n@749 5427 !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
n@749 5428
n@749 5429 if ( node.src ) {
n@749 5430 // Optional AJAX dependency, but won't run scripts if not present
n@749 5431 if ( jQuery._evalUrl ) {
n@749 5432 jQuery._evalUrl( node.src );
n@749 5433 }
n@749 5434 } else {
n@749 5435 jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
n@749 5436 }
n@749 5437 }
n@749 5438 }
n@749 5439 }
n@749 5440 }
n@749 5441 }
n@749 5442
n@749 5443 return this;
n@749 5444 }
n@749 5445 });
n@749 5446
n@749 5447 jQuery.each({
n@749 5448 appendTo: "append",
n@749 5449 prependTo: "prepend",
n@749 5450 insertBefore: "before",
n@749 5451 insertAfter: "after",
n@749 5452 replaceAll: "replaceWith"
n@749 5453 }, function( name, original ) {
n@749 5454 jQuery.fn[ name ] = function( selector ) {
n@749 5455 var elems,
n@749 5456 ret = [],
n@749 5457 insert = jQuery( selector ),
n@749 5458 last = insert.length - 1,
n@749 5459 i = 0;
n@749 5460
n@749 5461 for ( ; i <= last; i++ ) {
n@749 5462 elems = i === last ? this : this.clone( true );
n@749 5463 jQuery( insert[ i ] )[ original ]( elems );
n@749 5464
n@749 5465 // Support: QtWebKit
n@749 5466 // .get() because push.apply(_, arraylike) throws
n@749 5467 push.apply( ret, elems.get() );
n@749 5468 }
n@749 5469
n@749 5470 return this.pushStack( ret );
n@749 5471 };
n@749 5472 });
n@749 5473
n@749 5474
n@749 5475 var iframe,
n@749 5476 elemdisplay = {};
n@749 5477
n@749 5478 /**
n@749 5479 * Retrieve the actual display of a element
n@749 5480 * @param {String} name nodeName of the element
n@749 5481 * @param {Object} doc Document object
n@749 5482 */
n@749 5483 // Called only from within defaultDisplay
n@749 5484 function actualDisplay( name, doc ) {
n@749 5485 var style,
n@749 5486 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
n@749 5487
n@749 5488 // getDefaultComputedStyle might be reliably used only on attached element
n@749 5489 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
n@749 5490
n@749 5491 // Use of this method is a temporary fix (more like optimization) until something better comes along,
n@749 5492 // since it was removed from specification and supported only in FF
n@749 5493 style.display : jQuery.css( elem[ 0 ], "display" );
n@749 5494
n@749 5495 // We don't have any data stored on the element,
n@749 5496 // so use "detach" method as fast way to get rid of the element
n@749 5497 elem.detach();
n@749 5498
n@749 5499 return display;
n@749 5500 }
n@749 5501
n@749 5502 /**
n@749 5503 * Try to determine the default display value of an element
n@749 5504 * @param {String} nodeName
n@749 5505 */
n@749 5506 function defaultDisplay( nodeName ) {
n@749 5507 var doc = document,
n@749 5508 display = elemdisplay[ nodeName ];
n@749 5509
n@749 5510 if ( !display ) {
n@749 5511 display = actualDisplay( nodeName, doc );
n@749 5512
n@749 5513 // If the simple way fails, read from inside an iframe
n@749 5514 if ( display === "none" || !display ) {
n@749 5515
n@749 5516 // Use the already-created iframe if possible
n@749 5517 iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
n@749 5518
n@749 5519 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
n@749 5520 doc = iframe[ 0 ].contentDocument;
n@749 5521
n@749 5522 // Support: IE
n@749 5523 doc.write();
n@749 5524 doc.close();
n@749 5525
n@749 5526 display = actualDisplay( nodeName, doc );
n@749 5527 iframe.detach();
n@749 5528 }
n@749 5529
n@749 5530 // Store the correct default display
n@749 5531 elemdisplay[ nodeName ] = display;
n@749 5532 }
n@749 5533
n@749 5534 return display;
n@749 5535 }
n@749 5536 var rmargin = (/^margin/);
n@749 5537
n@749 5538 var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
n@749 5539
n@749 5540 var getStyles = function( elem ) {
n@749 5541 // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
n@749 5542 // IE throws on elements created in popups
n@749 5543 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
n@749 5544 if ( elem.ownerDocument.defaultView.opener ) {
n@749 5545 return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
n@749 5546 }
n@749 5547
n@749 5548 return window.getComputedStyle( elem, null );
n@749 5549 };
n@749 5550
n@749 5551
n@749 5552
n@749 5553 function curCSS( elem, name, computed ) {
n@749 5554 var width, minWidth, maxWidth, ret,
n@749 5555 style = elem.style;
n@749 5556
n@749 5557 computed = computed || getStyles( elem );
n@749 5558
n@749 5559 // Support: IE9
n@749 5560 // getPropertyValue is only needed for .css('filter') (#12537)
n@749 5561 if ( computed ) {
n@749 5562 ret = computed.getPropertyValue( name ) || computed[ name ];
n@749 5563 }
n@749 5564
n@749 5565 if ( computed ) {
n@749 5566
n@749 5567 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
n@749 5568 ret = jQuery.style( elem, name );
n@749 5569 }
n@749 5570
n@749 5571 // Support: iOS < 6
n@749 5572 // A tribute to the "awesome hack by Dean Edwards"
n@749 5573 // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
n@749 5574 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
n@749 5575 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
n@749 5576
n@749 5577 // Remember the original values
n@749 5578 width = style.width;
n@749 5579 minWidth = style.minWidth;
n@749 5580 maxWidth = style.maxWidth;
n@749 5581
n@749 5582 // Put in the new values to get a computed value out
n@749 5583 style.minWidth = style.maxWidth = style.width = ret;
n@749 5584 ret = computed.width;
n@749 5585
n@749 5586 // Revert the changed values
n@749 5587 style.width = width;
n@749 5588 style.minWidth = minWidth;
n@749 5589 style.maxWidth = maxWidth;
n@749 5590 }
n@749 5591 }
n@749 5592
n@749 5593 return ret !== undefined ?
n@749 5594 // Support: IE
n@749 5595 // IE returns zIndex value as an integer.
n@749 5596 ret + "" :
n@749 5597 ret;
n@749 5598 }
n@749 5599
n@749 5600
n@749 5601 function addGetHookIf( conditionFn, hookFn ) {
n@749 5602 // Define the hook, we'll check on the first run if it's really needed.
n@749 5603 return {
n@749 5604 get: function() {
n@749 5605 if ( conditionFn() ) {
n@749 5606 // Hook not needed (or it's not possible to use it due
n@749 5607 // to missing dependency), remove it.
n@749 5608 delete this.get;
n@749 5609 return;
n@749 5610 }
n@749 5611
n@749 5612 // Hook needed; redefine it so that the support test is not executed again.
n@749 5613 return (this.get = hookFn).apply( this, arguments );
n@749 5614 }
n@749 5615 };
n@749 5616 }
n@749 5617
n@749 5618
n@749 5619 (function() {
n@749 5620 var pixelPositionVal, boxSizingReliableVal,
n@749 5621 docElem = document.documentElement,
n@749 5622 container = document.createElement( "div" ),
n@749 5623 div = document.createElement( "div" );
n@749 5624
n@749 5625 if ( !div.style ) {
n@749 5626 return;
n@749 5627 }
n@749 5628
n@749 5629 // Support: IE9-11+
n@749 5630 // Style of cloned element affects source element cloned (#8908)
n@749 5631 div.style.backgroundClip = "content-box";
n@749 5632 div.cloneNode( true ).style.backgroundClip = "";
n@749 5633 support.clearCloneStyle = div.style.backgroundClip === "content-box";
n@749 5634
n@749 5635 container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
n@749 5636 "position:absolute";
n@749 5637 container.appendChild( div );
n@749 5638
n@749 5639 // Executing both pixelPosition & boxSizingReliable tests require only one layout
n@749 5640 // so they're executed at the same time to save the second computation.
n@749 5641 function computePixelPositionAndBoxSizingReliable() {
n@749 5642 div.style.cssText =
n@749 5643 // Support: Firefox<29, Android 2.3
n@749 5644 // Vendor-prefix box-sizing
n@749 5645 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
n@749 5646 "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
n@749 5647 "border:1px;padding:1px;width:4px;position:absolute";
n@749 5648 div.innerHTML = "";
n@749 5649 docElem.appendChild( container );
n@749 5650
n@749 5651 var divStyle = window.getComputedStyle( div, null );
n@749 5652 pixelPositionVal = divStyle.top !== "1%";
n@749 5653 boxSizingReliableVal = divStyle.width === "4px";
n@749 5654
n@749 5655 docElem.removeChild( container );
n@749 5656 }
n@749 5657
n@749 5658 // Support: node.js jsdom
n@749 5659 // Don't assume that getComputedStyle is a property of the global object
n@749 5660 if ( window.getComputedStyle ) {
n@749 5661 jQuery.extend( support, {
n@749 5662 pixelPosition: function() {
n@749 5663
n@749 5664 // This test is executed only once but we still do memoizing
n@749 5665 // since we can use the boxSizingReliable pre-computing.
n@749 5666 // No need to check if the test was already performed, though.
n@749 5667 computePixelPositionAndBoxSizingReliable();
n@749 5668 return pixelPositionVal;
n@749 5669 },
n@749 5670 boxSizingReliable: function() {
n@749 5671 if ( boxSizingReliableVal == null ) {
n@749 5672 computePixelPositionAndBoxSizingReliable();
n@749 5673 }
n@749 5674 return boxSizingReliableVal;
n@749 5675 },
n@749 5676 reliableMarginRight: function() {
n@749 5677
n@749 5678 // Support: Android 2.3
n@749 5679 // Check if div with explicit width and no margin-right incorrectly
n@749 5680 // gets computed margin-right based on width of container. (#3333)
n@749 5681 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
n@749 5682 // This support function is only executed once so no memoizing is needed.
n@749 5683 var ret,
n@749 5684 marginDiv = div.appendChild( document.createElement( "div" ) );
n@749 5685
n@749 5686 // Reset CSS: box-sizing; display; margin; border; padding
n@749 5687 marginDiv.style.cssText = div.style.cssText =
n@749 5688 // Support: Firefox<29, Android 2.3
n@749 5689 // Vendor-prefix box-sizing
n@749 5690 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
n@749 5691 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
n@749 5692 marginDiv.style.marginRight = marginDiv.style.width = "0";
n@749 5693 div.style.width = "1px";
n@749 5694 docElem.appendChild( container );
n@749 5695
n@749 5696 ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
n@749 5697
n@749 5698 docElem.removeChild( container );
n@749 5699 div.removeChild( marginDiv );
n@749 5700
n@749 5701 return ret;
n@749 5702 }
n@749 5703 });
n@749 5704 }
n@749 5705 })();
n@749 5706
n@749 5707
n@749 5708 // A method for quickly swapping in/out CSS properties to get correct calculations.
n@749 5709 jQuery.swap = function( elem, options, callback, args ) {
n@749 5710 var ret, name,
n@749 5711 old = {};
n@749 5712
n@749 5713 // Remember the old values, and insert the new ones
n@749 5714 for ( name in options ) {
n@749 5715 old[ name ] = elem.style[ name ];
n@749 5716 elem.style[ name ] = options[ name ];
n@749 5717 }
n@749 5718
n@749 5719 ret = callback.apply( elem, args || [] );
n@749 5720
n@749 5721 // Revert the old values
n@749 5722 for ( name in options ) {
n@749 5723 elem.style[ name ] = old[ name ];
n@749 5724 }
n@749 5725
n@749 5726 return ret;
n@749 5727 };
n@749 5728
n@749 5729
n@749 5730 var
n@749 5731 // Swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
n@749 5732 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
n@749 5733 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
n@749 5734 rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
n@749 5735 rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
n@749 5736
n@749 5737 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
n@749 5738 cssNormalTransform = {
n@749 5739 letterSpacing: "0",
n@749 5740 fontWeight: "400"
n@749 5741 },
n@749 5742
n@749 5743 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
n@749 5744
n@749 5745 // Return a css property mapped to a potentially vendor prefixed property
n@749 5746 function vendorPropName( style, name ) {
n@749 5747
n@749 5748 // Shortcut for names that are not vendor prefixed
n@749 5749 if ( name in style ) {
n@749 5750 return name;
n@749 5751 }
n@749 5752
n@749 5753 // Check for vendor prefixed names
n@749 5754 var capName = name[0].toUpperCase() + name.slice(1),
n@749 5755 origName = name,
n@749 5756 i = cssPrefixes.length;
n@749 5757
n@749 5758 while ( i-- ) {
n@749 5759 name = cssPrefixes[ i ] + capName;
n@749 5760 if ( name in style ) {
n@749 5761 return name;
n@749 5762 }
n@749 5763 }
n@749 5764
n@749 5765 return origName;
n@749 5766 }
n@749 5767
n@749 5768 function setPositiveNumber( elem, value, subtract ) {
n@749 5769 var matches = rnumsplit.exec( value );
n@749 5770 return matches ?
n@749 5771 // Guard against undefined "subtract", e.g., when used as in cssHooks
n@749 5772 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
n@749 5773 value;
n@749 5774 }
n@749 5775
n@749 5776 function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
n@749 5777 var i = extra === ( isBorderBox ? "border" : "content" ) ?
n@749 5778 // If we already have the right measurement, avoid augmentation
n@749 5779 4 :
n@749 5780 // Otherwise initialize for horizontal or vertical properties
n@749 5781 name === "width" ? 1 : 0,
n@749 5782
n@749 5783 val = 0;
n@749 5784
n@749 5785 for ( ; i < 4; i += 2 ) {
n@749 5786 // Both box models exclude margin, so add it if we want it
n@749 5787 if ( extra === "margin" ) {
n@749 5788 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
n@749 5789 }
n@749 5790
n@749 5791 if ( isBorderBox ) {
n@749 5792 // border-box includes padding, so remove it if we want content
n@749 5793 if ( extra === "content" ) {
n@749 5794 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
n@749 5795 }
n@749 5796
n@749 5797 // At this point, extra isn't border nor margin, so remove border
n@749 5798 if ( extra !== "margin" ) {
n@749 5799 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
n@749 5800 }
n@749 5801 } else {
n@749 5802 // At this point, extra isn't content, so add padding
n@749 5803 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
n@749 5804
n@749 5805 // At this point, extra isn't content nor padding, so add border
n@749 5806 if ( extra !== "padding" ) {
n@749 5807 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
n@749 5808 }
n@749 5809 }
n@749 5810 }
n@749 5811
n@749 5812 return val;
n@749 5813 }
n@749 5814
n@749 5815 function getWidthOrHeight( elem, name, extra ) {
n@749 5816
n@749 5817 // Start with offset property, which is equivalent to the border-box value
n@749 5818 var valueIsBorderBox = true,
n@749 5819 val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
n@749 5820 styles = getStyles( elem ),
n@749 5821 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
n@749 5822
n@749 5823 // Some non-html elements return undefined for offsetWidth, so check for null/undefined
n@749 5824 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
n@749 5825 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
n@749 5826 if ( val <= 0 || val == null ) {
n@749 5827 // Fall back to computed then uncomputed css if necessary
n@749 5828 val = curCSS( elem, name, styles );
n@749 5829 if ( val < 0 || val == null ) {
n@749 5830 val = elem.style[ name ];
n@749 5831 }
n@749 5832
n@749 5833 // Computed unit is not pixels. Stop here and return.
n@749 5834 if ( rnumnonpx.test(val) ) {
n@749 5835 return val;
n@749 5836 }
n@749 5837
n@749 5838 // Check for style in case a browser which returns unreliable values
n@749 5839 // for getComputedStyle silently falls back to the reliable elem.style
n@749 5840 valueIsBorderBox = isBorderBox &&
n@749 5841 ( support.boxSizingReliable() || val === elem.style[ name ] );
n@749 5842
n@749 5843 // Normalize "", auto, and prepare for extra
n@749 5844 val = parseFloat( val ) || 0;
n@749 5845 }
n@749 5846
n@749 5847 // Use the active box-sizing model to add/subtract irrelevant styles
n@749 5848 return ( val +
n@749 5849 augmentWidthOrHeight(
n@749 5850 elem,
n@749 5851 name,
n@749 5852 extra || ( isBorderBox ? "border" : "content" ),
n@749 5853 valueIsBorderBox,
n@749 5854 styles
n@749 5855 )
n@749 5856 ) + "px";
n@749 5857 }
n@749 5858
n@749 5859 function showHide( elements, show ) {
n@749 5860 var display, elem, hidden,
n@749 5861 values = [],
n@749 5862 index = 0,
n@749 5863 length = elements.length;
n@749 5864
n@749 5865 for ( ; index < length; index++ ) {
n@749 5866 elem = elements[ index ];
n@749 5867 if ( !elem.style ) {
n@749 5868 continue;
n@749 5869 }
n@749 5870
n@749 5871 values[ index ] = data_priv.get( elem, "olddisplay" );
n@749 5872 display = elem.style.display;
n@749 5873 if ( show ) {
n@749 5874 // Reset the inline display of this element to learn if it is
n@749 5875 // being hidden by cascaded rules or not
n@749 5876 if ( !values[ index ] && display === "none" ) {
n@749 5877 elem.style.display = "";
n@749 5878 }
n@749 5879
n@749 5880 // Set elements which have been overridden with display: none
n@749 5881 // in a stylesheet to whatever the default browser style is
n@749 5882 // for such an element
n@749 5883 if ( elem.style.display === "" && isHidden( elem ) ) {
n@749 5884 values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
n@749 5885 }
n@749 5886 } else {
n@749 5887 hidden = isHidden( elem );
n@749 5888
n@749 5889 if ( display !== "none" || !hidden ) {
n@749 5890 data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
n@749 5891 }
n@749 5892 }
n@749 5893 }
n@749 5894
n@749 5895 // Set the display of most of the elements in a second loop
n@749 5896 // to avoid the constant reflow
n@749 5897 for ( index = 0; index < length; index++ ) {
n@749 5898 elem = elements[ index ];
n@749 5899 if ( !elem.style ) {
n@749 5900 continue;
n@749 5901 }
n@749 5902 if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
n@749 5903 elem.style.display = show ? values[ index ] || "" : "none";
n@749 5904 }
n@749 5905 }
n@749 5906
n@749 5907 return elements;
n@749 5908 }
n@749 5909
n@749 5910 jQuery.extend({
n@749 5911
n@749 5912 // Add in style property hooks for overriding the default
n@749 5913 // behavior of getting and setting a style property
n@749 5914 cssHooks: {
n@749 5915 opacity: {
n@749 5916 get: function( elem, computed ) {
n@749 5917 if ( computed ) {
n@749 5918
n@749 5919 // We should always get a number back from opacity
n@749 5920 var ret = curCSS( elem, "opacity" );
n@749 5921 return ret === "" ? "1" : ret;
n@749 5922 }
n@749 5923 }
n@749 5924 }
n@749 5925 },
n@749 5926
n@749 5927 // Don't automatically add "px" to these possibly-unitless properties
n@749 5928 cssNumber: {
n@749 5929 "columnCount": true,
n@749 5930 "fillOpacity": true,
n@749 5931 "flexGrow": true,
n@749 5932 "flexShrink": true,
n@749 5933 "fontWeight": true,
n@749 5934 "lineHeight": true,
n@749 5935 "opacity": true,
n@749 5936 "order": true,
n@749 5937 "orphans": true,
n@749 5938 "widows": true,
n@749 5939 "zIndex": true,
n@749 5940 "zoom": true
n@749 5941 },
n@749 5942
n@749 5943 // Add in properties whose names you wish to fix before
n@749 5944 // setting or getting the value
n@749 5945 cssProps: {
n@749 5946 "float": "cssFloat"
n@749 5947 },
n@749 5948
n@749 5949 // Get and set the style property on a DOM Node
n@749 5950 style: function( elem, name, value, extra ) {
n@749 5951
n@749 5952 // Don't set styles on text and comment nodes
n@749 5953 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
n@749 5954 return;
n@749 5955 }
n@749 5956
n@749 5957 // Make sure that we're working with the right name
n@749 5958 var ret, type, hooks,
n@749 5959 origName = jQuery.camelCase( name ),
n@749 5960 style = elem.style;
n@749 5961
n@749 5962 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
n@749 5963
n@749 5964 // Gets hook for the prefixed version, then unprefixed version
n@749 5965 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
n@749 5966
n@749 5967 // Check if we're setting a value
n@749 5968 if ( value !== undefined ) {
n@749 5969 type = typeof value;
n@749 5970
n@749 5971 // Convert "+=" or "-=" to relative numbers (#7345)
n@749 5972 if ( type === "string" && (ret = rrelNum.exec( value )) ) {
n@749 5973 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
n@749 5974 // Fixes bug #9237
n@749 5975 type = "number";
n@749 5976 }
n@749 5977
n@749 5978 // Make sure that null and NaN values aren't set (#7116)
n@749 5979 if ( value == null || value !== value ) {
n@749 5980 return;
n@749 5981 }
n@749 5982
n@749 5983 // If a number, add 'px' to the (except for certain CSS properties)
n@749 5984 if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
n@749 5985 value += "px";
n@749 5986 }
n@749 5987
n@749 5988 // Support: IE9-11+
n@749 5989 // background-* props affect original clone's values
n@749 5990 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
n@749 5991 style[ name ] = "inherit";
n@749 5992 }
n@749 5993
n@749 5994 // If a hook was provided, use that value, otherwise just set the specified value
n@749 5995 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
n@749 5996 style[ name ] = value;
n@749 5997 }
n@749 5998
n@749 5999 } else {
n@749 6000 // If a hook was provided get the non-computed value from there
n@749 6001 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
n@749 6002 return ret;
n@749 6003 }
n@749 6004
n@749 6005 // Otherwise just get the value from the style object
n@749 6006 return style[ name ];
n@749 6007 }
n@749 6008 },
n@749 6009
n@749 6010 css: function( elem, name, extra, styles ) {
n@749 6011 var val, num, hooks,
n@749 6012 origName = jQuery.camelCase( name );
n@749 6013
n@749 6014 // Make sure that we're working with the right name
n@749 6015 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
n@749 6016
n@749 6017 // Try prefixed name followed by the unprefixed name
n@749 6018 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
n@749 6019
n@749 6020 // If a hook was provided get the computed value from there
n@749 6021 if ( hooks && "get" in hooks ) {
n@749 6022 val = hooks.get( elem, true, extra );
n@749 6023 }
n@749 6024
n@749 6025 // Otherwise, if a way to get the computed value exists, use that
n@749 6026 if ( val === undefined ) {
n@749 6027 val = curCSS( elem, name, styles );
n@749 6028 }
n@749 6029
n@749 6030 // Convert "normal" to computed value
n@749 6031 if ( val === "normal" && name in cssNormalTransform ) {
n@749 6032 val = cssNormalTransform[ name ];
n@749 6033 }
n@749 6034
n@749 6035 // Make numeric if forced or a qualifier was provided and val looks numeric
n@749 6036 if ( extra === "" || extra ) {
n@749 6037 num = parseFloat( val );
n@749 6038 return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
n@749 6039 }
n@749 6040 return val;
n@749 6041 }
n@749 6042 });
n@749 6043
n@749 6044 jQuery.each([ "height", "width" ], function( i, name ) {
n@749 6045 jQuery.cssHooks[ name ] = {
n@749 6046 get: function( elem, computed, extra ) {
n@749 6047 if ( computed ) {
n@749 6048
n@749 6049 // Certain elements can have dimension info if we invisibly show them
n@749 6050 // but it must have a current display style that would benefit
n@749 6051 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
n@749 6052 jQuery.swap( elem, cssShow, function() {
n@749 6053 return getWidthOrHeight( elem, name, extra );
n@749 6054 }) :
n@749 6055 getWidthOrHeight( elem, name, extra );
n@749 6056 }
n@749 6057 },
n@749 6058
n@749 6059 set: function( elem, value, extra ) {
n@749 6060 var styles = extra && getStyles( elem );
n@749 6061 return setPositiveNumber( elem, value, extra ?
n@749 6062 augmentWidthOrHeight(
n@749 6063 elem,
n@749 6064 name,
n@749 6065 extra,
n@749 6066 jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
n@749 6067 styles
n@749 6068 ) : 0
n@749 6069 );
n@749 6070 }
n@749 6071 };
n@749 6072 });
n@749 6073
n@749 6074 // Support: Android 2.3
n@749 6075 jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
n@749 6076 function( elem, computed ) {
n@749 6077 if ( computed ) {
n@749 6078 return jQuery.swap( elem, { "display": "inline-block" },
n@749 6079 curCSS, [ elem, "marginRight" ] );
n@749 6080 }
n@749 6081 }
n@749 6082 );
n@749 6083
n@749 6084 // These hooks are used by animate to expand properties
n@749 6085 jQuery.each({
n@749 6086 margin: "",
n@749 6087 padding: "",
n@749 6088 border: "Width"
n@749 6089 }, function( prefix, suffix ) {
n@749 6090 jQuery.cssHooks[ prefix + suffix ] = {
n@749 6091 expand: function( value ) {
n@749 6092 var i = 0,
n@749 6093 expanded = {},
n@749 6094
n@749 6095 // Assumes a single number if not a string
n@749 6096 parts = typeof value === "string" ? value.split(" ") : [ value ];
n@749 6097
n@749 6098 for ( ; i < 4; i++ ) {
n@749 6099 expanded[ prefix + cssExpand[ i ] + suffix ] =
n@749 6100 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
n@749 6101 }
n@749 6102
n@749 6103 return expanded;
n@749 6104 }
n@749 6105 };
n@749 6106
n@749 6107 if ( !rmargin.test( prefix ) ) {
n@749 6108 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
n@749 6109 }
n@749 6110 });
n@749 6111
n@749 6112 jQuery.fn.extend({
n@749 6113 css: function( name, value ) {
n@749 6114 return access( this, function( elem, name, value ) {
n@749 6115 var styles, len,
n@749 6116 map = {},
n@749 6117 i = 0;
n@749 6118
n@749 6119 if ( jQuery.isArray( name ) ) {
n@749 6120 styles = getStyles( elem );
n@749 6121 len = name.length;
n@749 6122
n@749 6123 for ( ; i < len; i++ ) {
n@749 6124 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
n@749 6125 }
n@749 6126
n@749 6127 return map;
n@749 6128 }
n@749 6129
n@749 6130 return value !== undefined ?
n@749 6131 jQuery.style( elem, name, value ) :
n@749 6132 jQuery.css( elem, name );
n@749 6133 }, name, value, arguments.length > 1 );
n@749 6134 },
n@749 6135 show: function() {
n@749 6136 return showHide( this, true );
n@749 6137 },
n@749 6138 hide: function() {
n@749 6139 return showHide( this );
n@749 6140 },
n@749 6141 toggle: function( state ) {
n@749 6142 if ( typeof state === "boolean" ) {
n@749 6143 return state ? this.show() : this.hide();
n@749 6144 }
n@749 6145
n@749 6146 return this.each(function() {
n@749 6147 if ( isHidden( this ) ) {
n@749 6148 jQuery( this ).show();
n@749 6149 } else {
n@749 6150 jQuery( this ).hide();
n@749 6151 }
n@749 6152 });
n@749 6153 }
n@749 6154 });
n@749 6155
n@749 6156
n@749 6157 function Tween( elem, options, prop, end, easing ) {
n@749 6158 return new Tween.prototype.init( elem, options, prop, end, easing );
n@749 6159 }
n@749 6160 jQuery.Tween = Tween;
n@749 6161
n@749 6162 Tween.prototype = {
n@749 6163 constructor: Tween,
n@749 6164 init: function( elem, options, prop, end, easing, unit ) {
n@749 6165 this.elem = elem;
n@749 6166 this.prop = prop;
n@749 6167 this.easing = easing || "swing";
n@749 6168 this.options = options;
n@749 6169 this.start = this.now = this.cur();
n@749 6170 this.end = end;
n@749 6171 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
n@749 6172 },
n@749 6173 cur: function() {
n@749 6174 var hooks = Tween.propHooks[ this.prop ];
n@749 6175
n@749 6176 return hooks && hooks.get ?
n@749 6177 hooks.get( this ) :
n@749 6178 Tween.propHooks._default.get( this );
n@749 6179 },
n@749 6180 run: function( percent ) {
n@749 6181 var eased,
n@749 6182 hooks = Tween.propHooks[ this.prop ];
n@749 6183
n@749 6184 if ( this.options.duration ) {
n@749 6185 this.pos = eased = jQuery.easing[ this.easing ](
n@749 6186 percent, this.options.duration * percent, 0, 1, this.options.duration
n@749 6187 );
n@749 6188 } else {
n@749 6189 this.pos = eased = percent;
n@749 6190 }
n@749 6191 this.now = ( this.end - this.start ) * eased + this.start;
n@749 6192
n@749 6193 if ( this.options.step ) {
n@749 6194 this.options.step.call( this.elem, this.now, this );
n@749 6195 }
n@749 6196
n@749 6197 if ( hooks && hooks.set ) {
n@749 6198 hooks.set( this );
n@749 6199 } else {
n@749 6200 Tween.propHooks._default.set( this );
n@749 6201 }
n@749 6202 return this;
n@749 6203 }
n@749 6204 };
n@749 6205
n@749 6206 Tween.prototype.init.prototype = Tween.prototype;
n@749 6207
n@749 6208 Tween.propHooks = {
n@749 6209 _default: {
n@749 6210 get: function( tween ) {
n@749 6211 var result;
n@749 6212
n@749 6213 if ( tween.elem[ tween.prop ] != null &&
n@749 6214 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
n@749 6215 return tween.elem[ tween.prop ];
n@749 6216 }
n@749 6217
n@749 6218 // Passing an empty string as a 3rd parameter to .css will automatically
n@749 6219 // attempt a parseFloat and fallback to a string if the parse fails.
n@749 6220 // Simple values such as "10px" are parsed to Float;
n@749 6221 // complex values such as "rotate(1rad)" are returned as-is.
n@749 6222 result = jQuery.css( tween.elem, tween.prop, "" );
n@749 6223 // Empty strings, null, undefined and "auto" are converted to 0.
n@749 6224 return !result || result === "auto" ? 0 : result;
n@749 6225 },
n@749 6226 set: function( tween ) {
n@749 6227 // Use step hook for back compat.
n@749 6228 // Use cssHook if its there.
n@749 6229 // Use .style if available and use plain properties where available.
n@749 6230 if ( jQuery.fx.step[ tween.prop ] ) {
n@749 6231 jQuery.fx.step[ tween.prop ]( tween );
n@749 6232 } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
n@749 6233 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
n@749 6234 } else {
n@749 6235 tween.elem[ tween.prop ] = tween.now;
n@749 6236 }
n@749 6237 }
n@749 6238 }
n@749 6239 };
n@749 6240
n@749 6241 // Support: IE9
n@749 6242 // Panic based approach to setting things on disconnected nodes
n@749 6243 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
n@749 6244 set: function( tween ) {
n@749 6245 if ( tween.elem.nodeType && tween.elem.parentNode ) {
n@749 6246 tween.elem[ tween.prop ] = tween.now;
n@749 6247 }
n@749 6248 }
n@749 6249 };
n@749 6250
n@749 6251 jQuery.easing = {
n@749 6252 linear: function( p ) {
n@749 6253 return p;
n@749 6254 },
n@749 6255 swing: function( p ) {
n@749 6256 return 0.5 - Math.cos( p * Math.PI ) / 2;
n@749 6257 }
n@749 6258 };
n@749 6259
n@749 6260 jQuery.fx = Tween.prototype.init;
n@749 6261
n@749 6262 // Back Compat <1.8 extension point
n@749 6263 jQuery.fx.step = {};
n@749 6264
n@749 6265
n@749 6266
n@749 6267
n@749 6268 var
n@749 6269 fxNow, timerId,
n@749 6270 rfxtypes = /^(?:toggle|show|hide)$/,
n@749 6271 rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
n@749 6272 rrun = /queueHooks$/,
n@749 6273 animationPrefilters = [ defaultPrefilter ],
n@749 6274 tweeners = {
n@749 6275 "*": [ function( prop, value ) {
n@749 6276 var tween = this.createTween( prop, value ),
n@749 6277 target = tween.cur(),
n@749 6278 parts = rfxnum.exec( value ),
n@749 6279 unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
n@749 6280
n@749 6281 // Starting value computation is required for potential unit mismatches
n@749 6282 start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
n@749 6283 rfxnum.exec( jQuery.css( tween.elem, prop ) ),
n@749 6284 scale = 1,
n@749 6285 maxIterations = 20;
n@749 6286
n@749 6287 if ( start && start[ 3 ] !== unit ) {
n@749 6288 // Trust units reported by jQuery.css
n@749 6289 unit = unit || start[ 3 ];
n@749 6290
n@749 6291 // Make sure we update the tween properties later on
n@749 6292 parts = parts || [];
n@749 6293
n@749 6294 // Iteratively approximate from a nonzero starting point
n@749 6295 start = +target || 1;
n@749 6296
n@749 6297 do {
n@749 6298 // If previous iteration zeroed out, double until we get *something*.
n@749 6299 // Use string for doubling so we don't accidentally see scale as unchanged below
n@749 6300 scale = scale || ".5";
n@749 6301
n@749 6302 // Adjust and apply
n@749 6303 start = start / scale;
n@749 6304 jQuery.style( tween.elem, prop, start + unit );
n@749 6305
n@749 6306 // Update scale, tolerating zero or NaN from tween.cur(),
n@749 6307 // break the loop if scale is unchanged or perfect, or if we've just had enough
n@749 6308 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
n@749 6309 }
n@749 6310
n@749 6311 // Update tween properties
n@749 6312 if ( parts ) {
n@749 6313 start = tween.start = +start || +target || 0;
n@749 6314 tween.unit = unit;
n@749 6315 // If a +=/-= token was provided, we're doing a relative animation
n@749 6316 tween.end = parts[ 1 ] ?
n@749 6317 start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
n@749 6318 +parts[ 2 ];
n@749 6319 }
n@749 6320
n@749 6321 return tween;
n@749 6322 } ]
n@749 6323 };
n@749 6324
n@749 6325 // Animations created synchronously will run synchronously
n@749 6326 function createFxNow() {
n@749 6327 setTimeout(function() {
n@749 6328 fxNow = undefined;
n@749 6329 });
n@749 6330 return ( fxNow = jQuery.now() );
n@749 6331 }
n@749 6332
n@749 6333 // Generate parameters to create a standard animation
n@749 6334 function genFx( type, includeWidth ) {
n@749 6335 var which,
n@749 6336 i = 0,
n@749 6337 attrs = { height: type };
n@749 6338
n@749 6339 // If we include width, step value is 1 to do all cssExpand values,
n@749 6340 // otherwise step value is 2 to skip over Left and Right
n@749 6341 includeWidth = includeWidth ? 1 : 0;
n@749 6342 for ( ; i < 4 ; i += 2 - includeWidth ) {
n@749 6343 which = cssExpand[ i ];
n@749 6344 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
n@749 6345 }
n@749 6346
n@749 6347 if ( includeWidth ) {
n@749 6348 attrs.opacity = attrs.width = type;
n@749 6349 }
n@749 6350
n@749 6351 return attrs;
n@749 6352 }
n@749 6353
n@749 6354 function createTween( value, prop, animation ) {
n@749 6355 var tween,
n@749 6356 collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
n@749 6357 index = 0,
n@749 6358 length = collection.length;
n@749 6359 for ( ; index < length; index++ ) {
n@749 6360 if ( (tween = collection[ index ].call( animation, prop, value )) ) {
n@749 6361
n@749 6362 // We're done with this property
n@749 6363 return tween;
n@749 6364 }
n@749 6365 }
n@749 6366 }
n@749 6367
n@749 6368 function defaultPrefilter( elem, props, opts ) {
n@749 6369 /* jshint validthis: true */
n@749 6370 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
n@749 6371 anim = this,
n@749 6372 orig = {},
n@749 6373 style = elem.style,
n@749 6374 hidden = elem.nodeType && isHidden( elem ),
n@749 6375 dataShow = data_priv.get( elem, "fxshow" );
n@749 6376
n@749 6377 // Handle queue: false promises
n@749 6378 if ( !opts.queue ) {
n@749 6379 hooks = jQuery._queueHooks( elem, "fx" );
n@749 6380 if ( hooks.unqueued == null ) {
n@749 6381 hooks.unqueued = 0;
n@749 6382 oldfire = hooks.empty.fire;
n@749 6383 hooks.empty.fire = function() {
n@749 6384 if ( !hooks.unqueued ) {
n@749 6385 oldfire();
n@749 6386 }
n@749 6387 };
n@749 6388 }
n@749 6389 hooks.unqueued++;
n@749 6390
n@749 6391 anim.always(function() {
n@749 6392 // Ensure the complete handler is called before this completes
n@749 6393 anim.always(function() {
n@749 6394 hooks.unqueued--;
n@749 6395 if ( !jQuery.queue( elem, "fx" ).length ) {
n@749 6396 hooks.empty.fire();
n@749 6397 }
n@749 6398 });
n@749 6399 });
n@749 6400 }
n@749 6401
n@749 6402 // Height/width overflow pass
n@749 6403 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
n@749 6404 // Make sure that nothing sneaks out
n@749 6405 // Record all 3 overflow attributes because IE9-10 do not
n@749 6406 // change the overflow attribute when overflowX and
n@749 6407 // overflowY are set to the same value
n@749 6408 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
n@749 6409
n@749 6410 // Set display property to inline-block for height/width
n@749 6411 // animations on inline elements that are having width/height animated
n@749 6412 display = jQuery.css( elem, "display" );
n@749 6413
n@749 6414 // Test default display if display is currently "none"
n@749 6415 checkDisplay = display === "none" ?
n@749 6416 data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
n@749 6417
n@749 6418 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
n@749 6419 style.display = "inline-block";
n@749 6420 }
n@749 6421 }
n@749 6422
n@749 6423 if ( opts.overflow ) {
n@749 6424 style.overflow = "hidden";
n@749 6425 anim.always(function() {
n@749 6426 style.overflow = opts.overflow[ 0 ];
n@749 6427 style.overflowX = opts.overflow[ 1 ];
n@749 6428 style.overflowY = opts.overflow[ 2 ];
n@749 6429 });
n@749 6430 }
n@749 6431
n@749 6432 // show/hide pass
n@749 6433 for ( prop in props ) {
n@749 6434 value = props[ prop ];
n@749 6435 if ( rfxtypes.exec( value ) ) {
n@749 6436 delete props[ prop ];
n@749 6437 toggle = toggle || value === "toggle";
n@749 6438 if ( value === ( hidden ? "hide" : "show" ) ) {
n@749 6439
n@749 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@749 6441 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
n@749 6442 hidden = true;
n@749 6443 } else {
n@749 6444 continue;
n@749 6445 }
n@749 6446 }
n@749 6447 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
n@749 6448
n@749 6449 // Any non-fx value stops us from restoring the original display value
n@749 6450 } else {
n@749 6451 display = undefined;
n@749 6452 }
n@749 6453 }
n@749 6454
n@749 6455 if ( !jQuery.isEmptyObject( orig ) ) {
n@749 6456 if ( dataShow ) {
n@749 6457 if ( "hidden" in dataShow ) {
n@749 6458 hidden = dataShow.hidden;
n@749 6459 }
n@749 6460 } else {
n@749 6461 dataShow = data_priv.access( elem, "fxshow", {} );
n@749 6462 }
n@749 6463
n@749 6464 // Store state if its toggle - enables .stop().toggle() to "reverse"
n@749 6465 if ( toggle ) {
n@749 6466 dataShow.hidden = !hidden;
n@749 6467 }
n@749 6468 if ( hidden ) {
n@749 6469 jQuery( elem ).show();
n@749 6470 } else {
n@749 6471 anim.done(function() {
n@749 6472 jQuery( elem ).hide();
n@749 6473 });
n@749 6474 }
n@749 6475 anim.done(function() {
n@749 6476 var prop;
n@749 6477
n@749 6478 data_priv.remove( elem, "fxshow" );
n@749 6479 for ( prop in orig ) {
n@749 6480 jQuery.style( elem, prop, orig[ prop ] );
n@749 6481 }
n@749 6482 });
n@749 6483 for ( prop in orig ) {
n@749 6484 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
n@749 6485
n@749 6486 if ( !( prop in dataShow ) ) {
n@749 6487 dataShow[ prop ] = tween.start;
n@749 6488 if ( hidden ) {
n@749 6489 tween.end = tween.start;
n@749 6490 tween.start = prop === "width" || prop === "height" ? 1 : 0;
n@749 6491 }
n@749 6492 }
n@749 6493 }
n@749 6494
n@749 6495 // If this is a noop like .hide().hide(), restore an overwritten display value
n@749 6496 } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
n@749 6497 style.display = display;
n@749 6498 }
n@749 6499 }
n@749 6500
n@749 6501 function propFilter( props, specialEasing ) {
n@749 6502 var index, name, easing, value, hooks;
n@749 6503
n@749 6504 // camelCase, specialEasing and expand cssHook pass
n@749 6505 for ( index in props ) {
n@749 6506 name = jQuery.camelCase( index );
n@749 6507 easing = specialEasing[ name ];
n@749 6508 value = props[ index ];
n@749 6509 if ( jQuery.isArray( value ) ) {
n@749 6510 easing = value[ 1 ];
n@749 6511 value = props[ index ] = value[ 0 ];
n@749 6512 }
n@749 6513
n@749 6514 if ( index !== name ) {
n@749 6515 props[ name ] = value;
n@749 6516 delete props[ index ];
n@749 6517 }
n@749 6518
n@749 6519 hooks = jQuery.cssHooks[ name ];
n@749 6520 if ( hooks && "expand" in hooks ) {
n@749 6521 value = hooks.expand( value );
n@749 6522 delete props[ name ];
n@749 6523
n@749 6524 // Not quite $.extend, this won't overwrite existing keys.
n@749 6525 // Reusing 'index' because we have the correct "name"
n@749 6526 for ( index in value ) {
n@749 6527 if ( !( index in props ) ) {
n@749 6528 props[ index ] = value[ index ];
n@749 6529 specialEasing[ index ] = easing;
n@749 6530 }
n@749 6531 }
n@749 6532 } else {
n@749 6533 specialEasing[ name ] = easing;
n@749 6534 }
n@749 6535 }
n@749 6536 }
n@749 6537
n@749 6538 function Animation( elem, properties, options ) {
n@749 6539 var result,
n@749 6540 stopped,
n@749 6541 index = 0,
n@749 6542 length = animationPrefilters.length,
n@749 6543 deferred = jQuery.Deferred().always( function() {
n@749 6544 // Don't match elem in the :animated selector
n@749 6545 delete tick.elem;
n@749 6546 }),
n@749 6547 tick = function() {
n@749 6548 if ( stopped ) {
n@749 6549 return false;
n@749 6550 }
n@749 6551 var currentTime = fxNow || createFxNow(),
n@749 6552 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
n@749 6553 // Support: Android 2.3
n@749 6554 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
n@749 6555 temp = remaining / animation.duration || 0,
n@749 6556 percent = 1 - temp,
n@749 6557 index = 0,
n@749 6558 length = animation.tweens.length;
n@749 6559
n@749 6560 for ( ; index < length ; index++ ) {
n@749 6561 animation.tweens[ index ].run( percent );
n@749 6562 }
n@749 6563
n@749 6564 deferred.notifyWith( elem, [ animation, percent, remaining ]);
n@749 6565
n@749 6566 if ( percent < 1 && length ) {
n@749 6567 return remaining;
n@749 6568 } else {
n@749 6569 deferred.resolveWith( elem, [ animation ] );
n@749 6570 return false;
n@749 6571 }
n@749 6572 },
n@749 6573 animation = deferred.promise({
n@749 6574 elem: elem,
n@749 6575 props: jQuery.extend( {}, properties ),
n@749 6576 opts: jQuery.extend( true, { specialEasing: {} }, options ),
n@749 6577 originalProperties: properties,
n@749 6578 originalOptions: options,
n@749 6579 startTime: fxNow || createFxNow(),
n@749 6580 duration: options.duration,
n@749 6581 tweens: [],
n@749 6582 createTween: function( prop, end ) {
n@749 6583 var tween = jQuery.Tween( elem, animation.opts, prop, end,
n@749 6584 animation.opts.specialEasing[ prop ] || animation.opts.easing );
n@749 6585 animation.tweens.push( tween );
n@749 6586 return tween;
n@749 6587 },
n@749 6588 stop: function( gotoEnd ) {
n@749 6589 var index = 0,
n@749 6590 // If we are going to the end, we want to run all the tweens
n@749 6591 // otherwise we skip this part
n@749 6592 length = gotoEnd ? animation.tweens.length : 0;
n@749 6593 if ( stopped ) {
n@749 6594 return this;
n@749 6595 }
n@749 6596 stopped = true;
n@749 6597 for ( ; index < length ; index++ ) {
n@749 6598 animation.tweens[ index ].run( 1 );
n@749 6599 }
n@749 6600
n@749 6601 // Resolve when we played the last frame; otherwise, reject
n@749 6602 if ( gotoEnd ) {
n@749 6603 deferred.resolveWith( elem, [ animation, gotoEnd ] );
n@749 6604 } else {
n@749 6605 deferred.rejectWith( elem, [ animation, gotoEnd ] );
n@749 6606 }
n@749 6607 return this;
n@749 6608 }
n@749 6609 }),
n@749 6610 props = animation.props;
n@749 6611
n@749 6612 propFilter( props, animation.opts.specialEasing );
n@749 6613
n@749 6614 for ( ; index < length ; index++ ) {
n@749 6615 result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
n@749 6616 if ( result ) {
n@749 6617 return result;
n@749 6618 }
n@749 6619 }
n@749 6620
n@749 6621 jQuery.map( props, createTween, animation );
n@749 6622
n@749 6623 if ( jQuery.isFunction( animation.opts.start ) ) {
n@749 6624 animation.opts.start.call( elem, animation );
n@749 6625 }
n@749 6626
n@749 6627 jQuery.fx.timer(
n@749 6628 jQuery.extend( tick, {
n@749 6629 elem: elem,
n@749 6630 anim: animation,
n@749 6631 queue: animation.opts.queue
n@749 6632 })
n@749 6633 );
n@749 6634
n@749 6635 // attach callbacks from options
n@749 6636 return animation.progress( animation.opts.progress )
n@749 6637 .done( animation.opts.done, animation.opts.complete )
n@749 6638 .fail( animation.opts.fail )
n@749 6639 .always( animation.opts.always );
n@749 6640 }
n@749 6641
n@749 6642 jQuery.Animation = jQuery.extend( Animation, {
n@749 6643
n@749 6644 tweener: function( props, callback ) {
n@749 6645 if ( jQuery.isFunction( props ) ) {
n@749 6646 callback = props;
n@749 6647 props = [ "*" ];
n@749 6648 } else {
n@749 6649 props = props.split(" ");
n@749 6650 }
n@749 6651
n@749 6652 var prop,
n@749 6653 index = 0,
n@749 6654 length = props.length;
n@749 6655
n@749 6656 for ( ; index < length ; index++ ) {
n@749 6657 prop = props[ index ];
n@749 6658 tweeners[ prop ] = tweeners[ prop ] || [];
n@749 6659 tweeners[ prop ].unshift( callback );
n@749 6660 }
n@749 6661 },
n@749 6662
n@749 6663 prefilter: function( callback, prepend ) {
n@749 6664 if ( prepend ) {
n@749 6665 animationPrefilters.unshift( callback );
n@749 6666 } else {
n@749 6667 animationPrefilters.push( callback );
n@749 6668 }
n@749 6669 }
n@749 6670 });
n@749 6671
n@749 6672 jQuery.speed = function( speed, easing, fn ) {
n@749 6673 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
n@749 6674 complete: fn || !fn && easing ||
n@749 6675 jQuery.isFunction( speed ) && speed,
n@749 6676 duration: speed,
n@749 6677 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
n@749 6678 };
n@749 6679
n@749 6680 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
n@749 6681 opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
n@749 6682
n@749 6683 // Normalize opt.queue - true/undefined/null -> "fx"
n@749 6684 if ( opt.queue == null || opt.queue === true ) {
n@749 6685 opt.queue = "fx";
n@749 6686 }
n@749 6687
n@749 6688 // Queueing
n@749 6689 opt.old = opt.complete;
n@749 6690
n@749 6691 opt.complete = function() {
n@749 6692 if ( jQuery.isFunction( opt.old ) ) {
n@749 6693 opt.old.call( this );
n@749 6694 }
n@749 6695
n@749 6696 if ( opt.queue ) {
n@749 6697 jQuery.dequeue( this, opt.queue );
n@749 6698 }
n@749 6699 };
n@749 6700
n@749 6701 return opt;
n@749 6702 };
n@749 6703
n@749 6704 jQuery.fn.extend({
n@749 6705 fadeTo: function( speed, to, easing, callback ) {
n@749 6706
n@749 6707 // Show any hidden elements after setting opacity to 0
n@749 6708 return this.filter( isHidden ).css( "opacity", 0 ).show()
n@749 6709
n@749 6710 // Animate to the value specified
n@749 6711 .end().animate({ opacity: to }, speed, easing, callback );
n@749 6712 },
n@749 6713 animate: function( prop, speed, easing, callback ) {
n@749 6714 var empty = jQuery.isEmptyObject( prop ),
n@749 6715 optall = jQuery.speed( speed, easing, callback ),
n@749 6716 doAnimation = function() {
n@749 6717 // Operate on a copy of prop so per-property easing won't be lost
n@749 6718 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
n@749 6719
n@749 6720 // Empty animations, or finishing resolves immediately
n@749 6721 if ( empty || data_priv.get( this, "finish" ) ) {
n@749 6722 anim.stop( true );
n@749 6723 }
n@749 6724 };
n@749 6725 doAnimation.finish = doAnimation;
n@749 6726
n@749 6727 return empty || optall.queue === false ?
n@749 6728 this.each( doAnimation ) :
n@749 6729 this.queue( optall.queue, doAnimation );
n@749 6730 },
n@749 6731 stop: function( type, clearQueue, gotoEnd ) {
n@749 6732 var stopQueue = function( hooks ) {
n@749 6733 var stop = hooks.stop;
n@749 6734 delete hooks.stop;
n@749 6735 stop( gotoEnd );
n@749 6736 };
n@749 6737
n@749 6738 if ( typeof type !== "string" ) {
n@749 6739 gotoEnd = clearQueue;
n@749 6740 clearQueue = type;
n@749 6741 type = undefined;
n@749 6742 }
n@749 6743 if ( clearQueue && type !== false ) {
n@749 6744 this.queue( type || "fx", [] );
n@749 6745 }
n@749 6746
n@749 6747 return this.each(function() {
n@749 6748 var dequeue = true,
n@749 6749 index = type != null && type + "queueHooks",
n@749 6750 timers = jQuery.timers,
n@749 6751 data = data_priv.get( this );
n@749 6752
n@749 6753 if ( index ) {
n@749 6754 if ( data[ index ] && data[ index ].stop ) {
n@749 6755 stopQueue( data[ index ] );
n@749 6756 }
n@749 6757 } else {
n@749 6758 for ( index in data ) {
n@749 6759 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
n@749 6760 stopQueue( data[ index ] );
n@749 6761 }
n@749 6762 }
n@749 6763 }
n@749 6764
n@749 6765 for ( index = timers.length; index--; ) {
n@749 6766 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
n@749 6767 timers[ index ].anim.stop( gotoEnd );
n@749 6768 dequeue = false;
n@749 6769 timers.splice( index, 1 );
n@749 6770 }
n@749 6771 }
n@749 6772
n@749 6773 // Start the next in the queue if the last step wasn't forced.
n@749 6774 // Timers currently will call their complete callbacks, which
n@749 6775 // will dequeue but only if they were gotoEnd.
n@749 6776 if ( dequeue || !gotoEnd ) {
n@749 6777 jQuery.dequeue( this, type );
n@749 6778 }
n@749 6779 });
n@749 6780 },
n@749 6781 finish: function( type ) {
n@749 6782 if ( type !== false ) {
n@749 6783 type = type || "fx";
n@749 6784 }
n@749 6785 return this.each(function() {
n@749 6786 var index,
n@749 6787 data = data_priv.get( this ),
n@749 6788 queue = data[ type + "queue" ],
n@749 6789 hooks = data[ type + "queueHooks" ],
n@749 6790 timers = jQuery.timers,
n@749 6791 length = queue ? queue.length : 0;
n@749 6792
n@749 6793 // Enable finishing flag on private data
n@749 6794 data.finish = true;
n@749 6795
n@749 6796 // Empty the queue first
n@749 6797 jQuery.queue( this, type, [] );
n@749 6798
n@749 6799 if ( hooks && hooks.stop ) {
n@749 6800 hooks.stop.call( this, true );
n@749 6801 }
n@749 6802
n@749 6803 // Look for any active animations, and finish them
n@749 6804 for ( index = timers.length; index--; ) {
n@749 6805 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
n@749 6806 timers[ index ].anim.stop( true );
n@749 6807 timers.splice( index, 1 );
n@749 6808 }
n@749 6809 }
n@749 6810
n@749 6811 // Look for any animations in the old queue and finish them
n@749 6812 for ( index = 0; index < length; index++ ) {
n@749 6813 if ( queue[ index ] && queue[ index ].finish ) {
n@749 6814 queue[ index ].finish.call( this );
n@749 6815 }
n@749 6816 }
n@749 6817
n@749 6818 // Turn off finishing flag
n@749 6819 delete data.finish;
n@749 6820 });
n@749 6821 }
n@749 6822 });
n@749 6823
n@749 6824 jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
n@749 6825 var cssFn = jQuery.fn[ name ];
n@749 6826 jQuery.fn[ name ] = function( speed, easing, callback ) {
n@749 6827 return speed == null || typeof speed === "boolean" ?
n@749 6828 cssFn.apply( this, arguments ) :
n@749 6829 this.animate( genFx( name, true ), speed, easing, callback );
n@749 6830 };
n@749 6831 });
n@749 6832
n@749 6833 // Generate shortcuts for custom animations
n@749 6834 jQuery.each({
n@749 6835 slideDown: genFx("show"),
n@749 6836 slideUp: genFx("hide"),
n@749 6837 slideToggle: genFx("toggle"),
n@749 6838 fadeIn: { opacity: "show" },
n@749 6839 fadeOut: { opacity: "hide" },
n@749 6840 fadeToggle: { opacity: "toggle" }
n@749 6841 }, function( name, props ) {
n@749 6842 jQuery.fn[ name ] = function( speed, easing, callback ) {
n@749 6843 return this.animate( props, speed, easing, callback );
n@749 6844 };
n@749 6845 });
n@749 6846
n@749 6847 jQuery.timers = [];
n@749 6848 jQuery.fx.tick = function() {
n@749 6849 var timer,
n@749 6850 i = 0,
n@749 6851 timers = jQuery.timers;
n@749 6852
n@749 6853 fxNow = jQuery.now();
n@749 6854
n@749 6855 for ( ; i < timers.length; i++ ) {
n@749 6856 timer = timers[ i ];
n@749 6857 // Checks the timer has not already been removed
n@749 6858 if ( !timer() && timers[ i ] === timer ) {
n@749 6859 timers.splice( i--, 1 );
n@749 6860 }
n@749 6861 }
n@749 6862
n@749 6863 if ( !timers.length ) {
n@749 6864 jQuery.fx.stop();
n@749 6865 }
n@749 6866 fxNow = undefined;
n@749 6867 };
n@749 6868
n@749 6869 jQuery.fx.timer = function( timer ) {
n@749 6870 jQuery.timers.push( timer );
n@749 6871 if ( timer() ) {
n@749 6872 jQuery.fx.start();
n@749 6873 } else {
n@749 6874 jQuery.timers.pop();
n@749 6875 }
n@749 6876 };
n@749 6877
n@749 6878 jQuery.fx.interval = 13;
n@749 6879
n@749 6880 jQuery.fx.start = function() {
n@749 6881 if ( !timerId ) {
n@749 6882 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
n@749 6883 }
n@749 6884 };
n@749 6885
n@749 6886 jQuery.fx.stop = function() {
n@749 6887 clearInterval( timerId );
n@749 6888 timerId = null;
n@749 6889 };
n@749 6890
n@749 6891 jQuery.fx.speeds = {
n@749 6892 slow: 600,
n@749 6893 fast: 200,
n@749 6894 // Default speed
n@749 6895 _default: 400
n@749 6896 };
n@749 6897
n@749 6898
n@749 6899 // Based off of the plugin by Clint Helfers, with permission.
n@749 6900 // http://blindsignals.com/index.php/2009/07/jquery-delay/
n@749 6901 jQuery.fn.delay = function( time, type ) {
n@749 6902 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
n@749 6903 type = type || "fx";
n@749 6904
n@749 6905 return this.queue( type, function( next, hooks ) {
n@749 6906 var timeout = setTimeout( next, time );
n@749 6907 hooks.stop = function() {
n@749 6908 clearTimeout( timeout );
n@749 6909 };
n@749 6910 });
n@749 6911 };
n@749 6912
n@749 6913
n@749 6914 (function() {
n@749 6915 var input = document.createElement( "input" ),
n@749 6916 select = document.createElement( "select" ),
n@749 6917 opt = select.appendChild( document.createElement( "option" ) );
n@749 6918
n@749 6919 input.type = "checkbox";
n@749 6920
n@749 6921 // Support: iOS<=5.1, Android<=4.2+
n@749 6922 // Default value for a checkbox should be "on"
n@749 6923 support.checkOn = input.value !== "";
n@749 6924
n@749 6925 // Support: IE<=11+
n@749 6926 // Must access selectedIndex to make default options select
n@749 6927 support.optSelected = opt.selected;
n@749 6928
n@749 6929 // Support: Android<=2.3
n@749 6930 // Options inside disabled selects are incorrectly marked as disabled
n@749 6931 select.disabled = true;
n@749 6932 support.optDisabled = !opt.disabled;
n@749 6933
n@749 6934 // Support: IE<=11+
n@749 6935 // An input loses its value after becoming a radio
n@749 6936 input = document.createElement( "input" );
n@749 6937 input.value = "t";
n@749 6938 input.type = "radio";
n@749 6939 support.radioValue = input.value === "t";
n@749 6940 })();
n@749 6941
n@749 6942
n@749 6943 var nodeHook, boolHook,
n@749 6944 attrHandle = jQuery.expr.attrHandle;
n@749 6945
n@749 6946 jQuery.fn.extend({
n@749 6947 attr: function( name, value ) {
n@749 6948 return access( this, jQuery.attr, name, value, arguments.length > 1 );
n@749 6949 },
n@749 6950
n@749 6951 removeAttr: function( name ) {
n@749 6952 return this.each(function() {
n@749 6953 jQuery.removeAttr( this, name );
n@749 6954 });
n@749 6955 }
n@749 6956 });
n@749 6957
n@749 6958 jQuery.extend({
n@749 6959 attr: function( elem, name, value ) {
n@749 6960 var hooks, ret,
n@749 6961 nType = elem.nodeType;
n@749 6962
n@749 6963 // don't get/set attributes on text, comment and attribute nodes
n@749 6964 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
n@749 6965 return;
n@749 6966 }
n@749 6967
n@749 6968 // Fallback to prop when attributes are not supported
n@749 6969 if ( typeof elem.getAttribute === strundefined ) {
n@749 6970 return jQuery.prop( elem, name, value );
n@749 6971 }
n@749 6972
n@749 6973 // All attributes are lowercase
n@749 6974 // Grab necessary hook if one is defined
n@749 6975 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
n@749 6976 name = name.toLowerCase();
n@749 6977 hooks = jQuery.attrHooks[ name ] ||
n@749 6978 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
n@749 6979 }
n@749 6980
n@749 6981 if ( value !== undefined ) {
n@749 6982
n@749 6983 if ( value === null ) {
n@749 6984 jQuery.removeAttr( elem, name );
n@749 6985
n@749 6986 } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
n@749 6987 return ret;
n@749 6988
n@749 6989 } else {
n@749 6990 elem.setAttribute( name, value + "" );
n@749 6991 return value;
n@749 6992 }
n@749 6993
n@749 6994 } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
n@749 6995 return ret;
n@749 6996
n@749 6997 } else {
n@749 6998 ret = jQuery.find.attr( elem, name );
n@749 6999
n@749 7000 // Non-existent attributes return null, we normalize to undefined
n@749 7001 return ret == null ?
n@749 7002 undefined :
n@749 7003 ret;
n@749 7004 }
n@749 7005 },
n@749 7006
n@749 7007 removeAttr: function( elem, value ) {
n@749 7008 var name, propName,
n@749 7009 i = 0,
n@749 7010 attrNames = value && value.match( rnotwhite );
n@749 7011
n@749 7012 if ( attrNames && elem.nodeType === 1 ) {
n@749 7013 while ( (name = attrNames[i++]) ) {
n@749 7014 propName = jQuery.propFix[ name ] || name;
n@749 7015
n@749 7016 // Boolean attributes get special treatment (#10870)
n@749 7017 if ( jQuery.expr.match.bool.test( name ) ) {
n@749 7018 // Set corresponding property to false
n@749 7019 elem[ propName ] = false;
n@749 7020 }
n@749 7021
n@749 7022 elem.removeAttribute( name );
n@749 7023 }
n@749 7024 }
n@749 7025 },
n@749 7026
n@749 7027 attrHooks: {
n@749 7028 type: {
n@749 7029 set: function( elem, value ) {
n@749 7030 if ( !support.radioValue && value === "radio" &&
n@749 7031 jQuery.nodeName( elem, "input" ) ) {
n@749 7032 var val = elem.value;
n@749 7033 elem.setAttribute( "type", value );
n@749 7034 if ( val ) {
n@749 7035 elem.value = val;
n@749 7036 }
n@749 7037 return value;
n@749 7038 }
n@749 7039 }
n@749 7040 }
n@749 7041 }
n@749 7042 });
n@749 7043
n@749 7044 // Hooks for boolean attributes
n@749 7045 boolHook = {
n@749 7046 set: function( elem, value, name ) {
n@749 7047 if ( value === false ) {
n@749 7048 // Remove boolean attributes when set to false
n@749 7049 jQuery.removeAttr( elem, name );
n@749 7050 } else {
n@749 7051 elem.setAttribute( name, name );
n@749 7052 }
n@749 7053 return name;
n@749 7054 }
n@749 7055 };
n@749 7056 jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
n@749 7057 var getter = attrHandle[ name ] || jQuery.find.attr;
n@749 7058
n@749 7059 attrHandle[ name ] = function( elem, name, isXML ) {
n@749 7060 var ret, handle;
n@749 7061 if ( !isXML ) {
n@749 7062 // Avoid an infinite loop by temporarily removing this function from the getter
n@749 7063 handle = attrHandle[ name ];
n@749 7064 attrHandle[ name ] = ret;
n@749 7065 ret = getter( elem, name, isXML ) != null ?
n@749 7066 name.toLowerCase() :
n@749 7067 null;
n@749 7068 attrHandle[ name ] = handle;
n@749 7069 }
n@749 7070 return ret;
n@749 7071 };
n@749 7072 });
n@749 7073
n@749 7074
n@749 7075
n@749 7076
n@749 7077 var rfocusable = /^(?:input|select|textarea|button)$/i;
n@749 7078
n@749 7079 jQuery.fn.extend({
n@749 7080 prop: function( name, value ) {
n@749 7081 return access( this, jQuery.prop, name, value, arguments.length > 1 );
n@749 7082 },
n@749 7083
n@749 7084 removeProp: function( name ) {
n@749 7085 return this.each(function() {
n@749 7086 delete this[ jQuery.propFix[ name ] || name ];
n@749 7087 });
n@749 7088 }
n@749 7089 });
n@749 7090
n@749 7091 jQuery.extend({
n@749 7092 propFix: {
n@749 7093 "for": "htmlFor",
n@749 7094 "class": "className"
n@749 7095 },
n@749 7096
n@749 7097 prop: function( elem, name, value ) {
n@749 7098 var ret, hooks, notxml,
n@749 7099 nType = elem.nodeType;
n@749 7100
n@749 7101 // Don't get/set properties on text, comment and attribute nodes
n@749 7102 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
n@749 7103 return;
n@749 7104 }
n@749 7105
n@749 7106 notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
n@749 7107
n@749 7108 if ( notxml ) {
n@749 7109 // Fix name and attach hooks
n@749 7110 name = jQuery.propFix[ name ] || name;
n@749 7111 hooks = jQuery.propHooks[ name ];
n@749 7112 }
n@749 7113
n@749 7114 if ( value !== undefined ) {
n@749 7115 return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
n@749 7116 ret :
n@749 7117 ( elem[ name ] = value );
n@749 7118
n@749 7119 } else {
n@749 7120 return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
n@749 7121 ret :
n@749 7122 elem[ name ];
n@749 7123 }
n@749 7124 },
n@749 7125
n@749 7126 propHooks: {
n@749 7127 tabIndex: {
n@749 7128 get: function( elem ) {
n@749 7129 return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
n@749 7130 elem.tabIndex :
n@749 7131 -1;
n@749 7132 }
n@749 7133 }
n@749 7134 }
n@749 7135 });
n@749 7136
n@749 7137 if ( !support.optSelected ) {
n@749 7138 jQuery.propHooks.selected = {
n@749 7139 get: function( elem ) {
n@749 7140 var parent = elem.parentNode;
n@749 7141 if ( parent && parent.parentNode ) {
n@749 7142 parent.parentNode.selectedIndex;
n@749 7143 }
n@749 7144 return null;
n@749 7145 }
n@749 7146 };
n@749 7147 }
n@749 7148
n@749 7149 jQuery.each([
n@749 7150 "tabIndex",
n@749 7151 "readOnly",
n@749 7152 "maxLength",
n@749 7153 "cellSpacing",
n@749 7154 "cellPadding",
n@749 7155 "rowSpan",
n@749 7156 "colSpan",
n@749 7157 "useMap",
n@749 7158 "frameBorder",
n@749 7159 "contentEditable"
n@749 7160 ], function() {
n@749 7161 jQuery.propFix[ this.toLowerCase() ] = this;
n@749 7162 });
n@749 7163
n@749 7164
n@749 7165
n@749 7166
n@749 7167 var rclass = /[\t\r\n\f]/g;
n@749 7168
n@749 7169 jQuery.fn.extend({
n@749 7170 addClass: function( value ) {
n@749 7171 var classes, elem, cur, clazz, j, finalValue,
n@749 7172 proceed = typeof value === "string" && value,
n@749 7173 i = 0,
n@749 7174 len = this.length;
n@749 7175
n@749 7176 if ( jQuery.isFunction( value ) ) {
n@749 7177 return this.each(function( j ) {
n@749 7178 jQuery( this ).addClass( value.call( this, j, this.className ) );
n@749 7179 });
n@749 7180 }
n@749 7181
n@749 7182 if ( proceed ) {
n@749 7183 // The disjunction here is for better compressibility (see removeClass)
n@749 7184 classes = ( value || "" ).match( rnotwhite ) || [];
n@749 7185
n@749 7186 for ( ; i < len; i++ ) {
n@749 7187 elem = this[ i ];
n@749 7188 cur = elem.nodeType === 1 && ( elem.className ?
n@749 7189 ( " " + elem.className + " " ).replace( rclass, " " ) :
n@749 7190 " "
n@749 7191 );
n@749 7192
n@749 7193 if ( cur ) {
n@749 7194 j = 0;
n@749 7195 while ( (clazz = classes[j++]) ) {
n@749 7196 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
n@749 7197 cur += clazz + " ";
n@749 7198 }
n@749 7199 }
n@749 7200
n@749 7201 // only assign if different to avoid unneeded rendering.
n@749 7202 finalValue = jQuery.trim( cur );
n@749 7203 if ( elem.className !== finalValue ) {
n@749 7204 elem.className = finalValue;
n@749 7205 }
n@749 7206 }
n@749 7207 }
n@749 7208 }
n@749 7209
n@749 7210 return this;
n@749 7211 },
n@749 7212
n@749 7213 removeClass: function( value ) {
n@749 7214 var classes, elem, cur, clazz, j, finalValue,
n@749 7215 proceed = arguments.length === 0 || typeof value === "string" && value,
n@749 7216 i = 0,
n@749 7217 len = this.length;
n@749 7218
n@749 7219 if ( jQuery.isFunction( value ) ) {
n@749 7220 return this.each(function( j ) {
n@749 7221 jQuery( this ).removeClass( value.call( this, j, this.className ) );
n@749 7222 });
n@749 7223 }
n@749 7224 if ( proceed ) {
n@749 7225 classes = ( value || "" ).match( rnotwhite ) || [];
n@749 7226
n@749 7227 for ( ; i < len; i++ ) {
n@749 7228 elem = this[ i ];
n@749 7229 // This expression is here for better compressibility (see addClass)
n@749 7230 cur = elem.nodeType === 1 && ( elem.className ?
n@749 7231 ( " " + elem.className + " " ).replace( rclass, " " ) :
n@749 7232 ""
n@749 7233 );
n@749 7234
n@749 7235 if ( cur ) {
n@749 7236 j = 0;
n@749 7237 while ( (clazz = classes[j++]) ) {
n@749 7238 // Remove *all* instances
n@749 7239 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
n@749 7240 cur = cur.replace( " " + clazz + " ", " " );
n@749 7241 }
n@749 7242 }
n@749 7243
n@749 7244 // Only assign if different to avoid unneeded rendering.
n@749 7245 finalValue = value ? jQuery.trim( cur ) : "";
n@749 7246 if ( elem.className !== finalValue ) {
n@749 7247 elem.className = finalValue;
n@749 7248 }
n@749 7249 }
n@749 7250 }
n@749 7251 }
n@749 7252
n@749 7253 return this;
n@749 7254 },
n@749 7255
n@749 7256 toggleClass: function( value, stateVal ) {
n@749 7257 var type = typeof value;
n@749 7258
n@749 7259 if ( typeof stateVal === "boolean" && type === "string" ) {
n@749 7260 return stateVal ? this.addClass( value ) : this.removeClass( value );
n@749 7261 }
n@749 7262
n@749 7263 if ( jQuery.isFunction( value ) ) {
n@749 7264 return this.each(function( i ) {
n@749 7265 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
n@749 7266 });
n@749 7267 }
n@749 7268
n@749 7269 return this.each(function() {
n@749 7270 if ( type === "string" ) {
n@749 7271 // Toggle individual class names
n@749 7272 var className,
n@749 7273 i = 0,
n@749 7274 self = jQuery( this ),
n@749 7275 classNames = value.match( rnotwhite ) || [];
n@749 7276
n@749 7277 while ( (className = classNames[ i++ ]) ) {
n@749 7278 // Check each className given, space separated list
n@749 7279 if ( self.hasClass( className ) ) {
n@749 7280 self.removeClass( className );
n@749 7281 } else {
n@749 7282 self.addClass( className );
n@749 7283 }
n@749 7284 }
n@749 7285
n@749 7286 // Toggle whole class name
n@749 7287 } else if ( type === strundefined || type === "boolean" ) {
n@749 7288 if ( this.className ) {
n@749 7289 // store className if set
n@749 7290 data_priv.set( this, "__className__", this.className );
n@749 7291 }
n@749 7292
n@749 7293 // If the element has a class name or if we're passed `false`,
n@749 7294 // then remove the whole classname (if there was one, the above saved it).
n@749 7295 // Otherwise bring back whatever was previously saved (if anything),
n@749 7296 // falling back to the empty string if nothing was stored.
n@749 7297 this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
n@749 7298 }
n@749 7299 });
n@749 7300 },
n@749 7301
n@749 7302 hasClass: function( selector ) {
n@749 7303 var className = " " + selector + " ",
n@749 7304 i = 0,
n@749 7305 l = this.length;
n@749 7306 for ( ; i < l; i++ ) {
n@749 7307 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
n@749 7308 return true;
n@749 7309 }
n@749 7310 }
n@749 7311
n@749 7312 return false;
n@749 7313 }
n@749 7314 });
n@749 7315
n@749 7316
n@749 7317
n@749 7318
n@749 7319 var rreturn = /\r/g;
n@749 7320
n@749 7321 jQuery.fn.extend({
n@749 7322 val: function( value ) {
n@749 7323 var hooks, ret, isFunction,
n@749 7324 elem = this[0];
n@749 7325
n@749 7326 if ( !arguments.length ) {
n@749 7327 if ( elem ) {
n@749 7328 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
n@749 7329
n@749 7330 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
n@749 7331 return ret;
n@749 7332 }
n@749 7333
n@749 7334 ret = elem.value;
n@749 7335
n@749 7336 return typeof ret === "string" ?
n@749 7337 // Handle most common string cases
n@749 7338 ret.replace(rreturn, "") :
n@749 7339 // Handle cases where value is null/undef or number
n@749 7340 ret == null ? "" : ret;
n@749 7341 }
n@749 7342
n@749 7343 return;
n@749 7344 }
n@749 7345
n@749 7346 isFunction = jQuery.isFunction( value );
n@749 7347
n@749 7348 return this.each(function( i ) {
n@749 7349 var val;
n@749 7350
n@749 7351 if ( this.nodeType !== 1 ) {
n@749 7352 return;
n@749 7353 }
n@749 7354
n@749 7355 if ( isFunction ) {
n@749 7356 val = value.call( this, i, jQuery( this ).val() );
n@749 7357 } else {
n@749 7358 val = value;
n@749 7359 }
n@749 7360
n@749 7361 // Treat null/undefined as ""; convert numbers to string
n@749 7362 if ( val == null ) {
n@749 7363 val = "";
n@749 7364
n@749 7365 } else if ( typeof val === "number" ) {
n@749 7366 val += "";
n@749 7367
n@749 7368 } else if ( jQuery.isArray( val ) ) {
n@749 7369 val = jQuery.map( val, function( value ) {
n@749 7370 return value == null ? "" : value + "";
n@749 7371 });
n@749 7372 }
n@749 7373
n@749 7374 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
n@749 7375
n@749 7376 // If set returns undefined, fall back to normal setting
n@749 7377 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
n@749 7378 this.value = val;
n@749 7379 }
n@749 7380 });
n@749 7381 }
n@749 7382 });
n@749 7383
n@749 7384 jQuery.extend({
n@749 7385 valHooks: {
n@749 7386 option: {
n@749 7387 get: function( elem ) {
n@749 7388 var val = jQuery.find.attr( elem, "value" );
n@749 7389 return val != null ?
n@749 7390 val :
n@749 7391 // Support: IE10-11+
n@749 7392 // option.text throws exceptions (#14686, #14858)
n@749 7393 jQuery.trim( jQuery.text( elem ) );
n@749 7394 }
n@749 7395 },
n@749 7396 select: {
n@749 7397 get: function( elem ) {
n@749 7398 var value, option,
n@749 7399 options = elem.options,
n@749 7400 index = elem.selectedIndex,
n@749 7401 one = elem.type === "select-one" || index < 0,
n@749 7402 values = one ? null : [],
n@749 7403 max = one ? index + 1 : options.length,
n@749 7404 i = index < 0 ?
n@749 7405 max :
n@749 7406 one ? index : 0;
n@749 7407
n@749 7408 // Loop through all the selected options
n@749 7409 for ( ; i < max; i++ ) {
n@749 7410 option = options[ i ];
n@749 7411
n@749 7412 // IE6-9 doesn't update selected after form reset (#2551)
n@749 7413 if ( ( option.selected || i === index ) &&
n@749 7414 // Don't return options that are disabled or in a disabled optgroup
n@749 7415 ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
n@749 7416 ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
n@749 7417
n@749 7418 // Get the specific value for the option
n@749 7419 value = jQuery( option ).val();
n@749 7420
n@749 7421 // We don't need an array for one selects
n@749 7422 if ( one ) {
n@749 7423 return value;
n@749 7424 }
n@749 7425
n@749 7426 // Multi-Selects return an array
n@749 7427 values.push( value );
n@749 7428 }
n@749 7429 }
n@749 7430
n@749 7431 return values;
n@749 7432 },
n@749 7433
n@749 7434 set: function( elem, value ) {
n@749 7435 var optionSet, option,
n@749 7436 options = elem.options,
n@749 7437 values = jQuery.makeArray( value ),
n@749 7438 i = options.length;
n@749 7439
n@749 7440 while ( i-- ) {
n@749 7441 option = options[ i ];
n@749 7442 if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
n@749 7443 optionSet = true;
n@749 7444 }
n@749 7445 }
n@749 7446
n@749 7447 // Force browsers to behave consistently when non-matching value is set
n@749 7448 if ( !optionSet ) {
n@749 7449 elem.selectedIndex = -1;
n@749 7450 }
n@749 7451 return values;
n@749 7452 }
n@749 7453 }
n@749 7454 }
n@749 7455 });
n@749 7456
n@749 7457 // Radios and checkboxes getter/setter
n@749 7458 jQuery.each([ "radio", "checkbox" ], function() {
n@749 7459 jQuery.valHooks[ this ] = {
n@749 7460 set: function( elem, value ) {
n@749 7461 if ( jQuery.isArray( value ) ) {
n@749 7462 return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
n@749 7463 }
n@749 7464 }
n@749 7465 };
n@749 7466 if ( !support.checkOn ) {
n@749 7467 jQuery.valHooks[ this ].get = function( elem ) {
n@749 7468 return elem.getAttribute("value") === null ? "on" : elem.value;
n@749 7469 };
n@749 7470 }
n@749 7471 });
n@749 7472
n@749 7473
n@749 7474
n@749 7475
n@749 7476 // Return jQuery for attributes-only inclusion
n@749 7477
n@749 7478
n@749 7479 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
n@749 7480 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
n@749 7481 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
n@749 7482
n@749 7483 // Handle event binding
n@749 7484 jQuery.fn[ name ] = function( data, fn ) {
n@749 7485 return arguments.length > 0 ?
n@749 7486 this.on( name, null, data, fn ) :
n@749 7487 this.trigger( name );
n@749 7488 };
n@749 7489 });
n@749 7490
n@749 7491 jQuery.fn.extend({
n@749 7492 hover: function( fnOver, fnOut ) {
n@749 7493 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
n@749 7494 },
n@749 7495
n@749 7496 bind: function( types, data, fn ) {
n@749 7497 return this.on( types, null, data, fn );
n@749 7498 },
n@749 7499 unbind: function( types, fn ) {
n@749 7500 return this.off( types, null, fn );
n@749 7501 },
n@749 7502
n@749 7503 delegate: function( selector, types, data, fn ) {
n@749 7504 return this.on( types, selector, data, fn );
n@749 7505 },
n@749 7506 undelegate: function( selector, types, fn ) {
n@749 7507 // ( namespace ) or ( selector, types [, fn] )
n@749 7508 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
n@749 7509 }
n@749 7510 });
n@749 7511
n@749 7512
n@749 7513 var nonce = jQuery.now();
n@749 7514
n@749 7515 var rquery = (/\?/);
n@749 7516
n@749 7517
n@749 7518
n@749 7519 // Support: Android 2.3
n@749 7520 // Workaround failure to string-cast null input
n@749 7521 jQuery.parseJSON = function( data ) {
n@749 7522 return JSON.parse( data + "" );
n@749 7523 };
n@749 7524
n@749 7525
n@749 7526 // Cross-browser xml parsing
n@749 7527 jQuery.parseXML = function( data ) {
n@749 7528 var xml, tmp;
n@749 7529 if ( !data || typeof data !== "string" ) {
n@749 7530 return null;
n@749 7531 }
n@749 7532
n@749 7533 // Support: IE9
n@749 7534 try {
n@749 7535 tmp = new DOMParser();
n@749 7536 xml = tmp.parseFromString( data, "text/xml" );
n@749 7537 } catch ( e ) {
n@749 7538 xml = undefined;
n@749 7539 }
n@749 7540
n@749 7541 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
n@749 7542 jQuery.error( "Invalid XML: " + data );
n@749 7543 }
n@749 7544 return xml;
n@749 7545 };
n@749 7546
n@749 7547
n@749 7548 var
n@749 7549 rhash = /#.*$/,
n@749 7550 rts = /([?&])_=[^&]*/,
n@749 7551 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
n@749 7552 // #7653, #8125, #8152: local protocol detection
n@749 7553 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
n@749 7554 rnoContent = /^(?:GET|HEAD)$/,
n@749 7555 rprotocol = /^\/\//,
n@749 7556 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
n@749 7557
n@749 7558 /* Prefilters
n@749 7559 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
n@749 7560 * 2) These are called:
n@749 7561 * - BEFORE asking for a transport
n@749 7562 * - AFTER param serialization (s.data is a string if s.processData is true)
n@749 7563 * 3) key is the dataType
n@749 7564 * 4) the catchall symbol "*" can be used
n@749 7565 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
n@749 7566 */
n@749 7567 prefilters = {},
n@749 7568
n@749 7569 /* Transports bindings
n@749 7570 * 1) key is the dataType
n@749 7571 * 2) the catchall symbol "*" can be used
n@749 7572 * 3) selection will start with transport dataType and THEN go to "*" if needed
n@749 7573 */
n@749 7574 transports = {},
n@749 7575
n@749 7576 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
n@749 7577 allTypes = "*/".concat( "*" ),
n@749 7578
n@749 7579 // Document location
n@749 7580 ajaxLocation = window.location.href,
n@749 7581
n@749 7582 // Segment location into parts
n@749 7583 ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
n@749 7584
n@749 7585 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
n@749 7586 function addToPrefiltersOrTransports( structure ) {
n@749 7587
n@749 7588 // dataTypeExpression is optional and defaults to "*"
n@749 7589 return function( dataTypeExpression, func ) {
n@749 7590
n@749 7591 if ( typeof dataTypeExpression !== "string" ) {
n@749 7592 func = dataTypeExpression;
n@749 7593 dataTypeExpression = "*";
n@749 7594 }
n@749 7595
n@749 7596 var dataType,
n@749 7597 i = 0,
n@749 7598 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
n@749 7599
n@749 7600 if ( jQuery.isFunction( func ) ) {
n@749 7601 // For each dataType in the dataTypeExpression
n@749 7602 while ( (dataType = dataTypes[i++]) ) {
n@749 7603 // Prepend if requested
n@749 7604 if ( dataType[0] === "+" ) {
n@749 7605 dataType = dataType.slice( 1 ) || "*";
n@749 7606 (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
n@749 7607
n@749 7608 // Otherwise append
n@749 7609 } else {
n@749 7610 (structure[ dataType ] = structure[ dataType ] || []).push( func );
n@749 7611 }
n@749 7612 }
n@749 7613 }
n@749 7614 };
n@749 7615 }
n@749 7616
n@749 7617 // Base inspection function for prefilters and transports
n@749 7618 function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
n@749 7619
n@749 7620 var inspected = {},
n@749 7621 seekingTransport = ( structure === transports );
n@749 7622
n@749 7623 function inspect( dataType ) {
n@749 7624 var selected;
n@749 7625 inspected[ dataType ] = true;
n@749 7626 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
n@749 7627 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
n@749 7628 if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
n@749 7629 options.dataTypes.unshift( dataTypeOrTransport );
n@749 7630 inspect( dataTypeOrTransport );
n@749 7631 return false;
n@749 7632 } else if ( seekingTransport ) {
n@749 7633 return !( selected = dataTypeOrTransport );
n@749 7634 }
n@749 7635 });
n@749 7636 return selected;
n@749 7637 }
n@749 7638
n@749 7639 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
n@749 7640 }
n@749 7641
n@749 7642 // A special extend for ajax options
n@749 7643 // that takes "flat" options (not to be deep extended)
n@749 7644 // Fixes #9887
n@749 7645 function ajaxExtend( target, src ) {
n@749 7646 var key, deep,
n@749 7647 flatOptions = jQuery.ajaxSettings.flatOptions || {};
n@749 7648
n@749 7649 for ( key in src ) {
n@749 7650 if ( src[ key ] !== undefined ) {
n@749 7651 ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
n@749 7652 }
n@749 7653 }
n@749 7654 if ( deep ) {
n@749 7655 jQuery.extend( true, target, deep );
n@749 7656 }
n@749 7657
n@749 7658 return target;
n@749 7659 }
n@749 7660
n@749 7661 /* Handles responses to an ajax request:
n@749 7662 * - finds the right dataType (mediates between content-type and expected dataType)
n@749 7663 * - returns the corresponding response
n@749 7664 */
n@749 7665 function ajaxHandleResponses( s, jqXHR, responses ) {
n@749 7666
n@749 7667 var ct, type, finalDataType, firstDataType,
n@749 7668 contents = s.contents,
n@749 7669 dataTypes = s.dataTypes;
n@749 7670
n@749 7671 // Remove auto dataType and get content-type in the process
n@749 7672 while ( dataTypes[ 0 ] === "*" ) {
n@749 7673 dataTypes.shift();
n@749 7674 if ( ct === undefined ) {
n@749 7675 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
n@749 7676 }
n@749 7677 }
n@749 7678
n@749 7679 // Check if we're dealing with a known content-type
n@749 7680 if ( ct ) {
n@749 7681 for ( type in contents ) {
n@749 7682 if ( contents[ type ] && contents[ type ].test( ct ) ) {
n@749 7683 dataTypes.unshift( type );
n@749 7684 break;
n@749 7685 }
n@749 7686 }
n@749 7687 }
n@749 7688
n@749 7689 // Check to see if we have a response for the expected dataType
n@749 7690 if ( dataTypes[ 0 ] in responses ) {
n@749 7691 finalDataType = dataTypes[ 0 ];
n@749 7692 } else {
n@749 7693 // Try convertible dataTypes
n@749 7694 for ( type in responses ) {
n@749 7695 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
n@749 7696 finalDataType = type;
n@749 7697 break;
n@749 7698 }
n@749 7699 if ( !firstDataType ) {
n@749 7700 firstDataType = type;
n@749 7701 }
n@749 7702 }
n@749 7703 // Or just use first one
n@749 7704 finalDataType = finalDataType || firstDataType;
n@749 7705 }
n@749 7706
n@749 7707 // If we found a dataType
n@749 7708 // We add the dataType to the list if needed
n@749 7709 // and return the corresponding response
n@749 7710 if ( finalDataType ) {
n@749 7711 if ( finalDataType !== dataTypes[ 0 ] ) {
n@749 7712 dataTypes.unshift( finalDataType );
n@749 7713 }
n@749 7714 return responses[ finalDataType ];
n@749 7715 }
n@749 7716 }
n@749 7717
n@749 7718 /* Chain conversions given the request and the original response
n@749 7719 * Also sets the responseXXX fields on the jqXHR instance
n@749 7720 */
n@749 7721 function ajaxConvert( s, response, jqXHR, isSuccess ) {
n@749 7722 var conv2, current, conv, tmp, prev,
n@749 7723 converters = {},
n@749 7724 // Work with a copy of dataTypes in case we need to modify it for conversion
n@749 7725 dataTypes = s.dataTypes.slice();
n@749 7726
n@749 7727 // Create converters map with lowercased keys
n@749 7728 if ( dataTypes[ 1 ] ) {
n@749 7729 for ( conv in s.converters ) {
n@749 7730 converters[ conv.toLowerCase() ] = s.converters[ conv ];
n@749 7731 }
n@749 7732 }
n@749 7733
n@749 7734 current = dataTypes.shift();
n@749 7735
n@749 7736 // Convert to each sequential dataType
n@749 7737 while ( current ) {
n@749 7738
n@749 7739 if ( s.responseFields[ current ] ) {
n@749 7740 jqXHR[ s.responseFields[ current ] ] = response;
n@749 7741 }
n@749 7742
n@749 7743 // Apply the dataFilter if provided
n@749 7744 if ( !prev && isSuccess && s.dataFilter ) {
n@749 7745 response = s.dataFilter( response, s.dataType );
n@749 7746 }
n@749 7747
n@749 7748 prev = current;
n@749 7749 current = dataTypes.shift();
n@749 7750
n@749 7751 if ( current ) {
n@749 7752
n@749 7753 // There's only work to do if current dataType is non-auto
n@749 7754 if ( current === "*" ) {
n@749 7755
n@749 7756 current = prev;
n@749 7757
n@749 7758 // Convert response if prev dataType is non-auto and differs from current
n@749 7759 } else if ( prev !== "*" && prev !== current ) {
n@749 7760
n@749 7761 // Seek a direct converter
n@749 7762 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
n@749 7763
n@749 7764 // If none found, seek a pair
n@749 7765 if ( !conv ) {
n@749 7766 for ( conv2 in converters ) {
n@749 7767
n@749 7768 // If conv2 outputs current
n@749 7769 tmp = conv2.split( " " );
n@749 7770 if ( tmp[ 1 ] === current ) {
n@749 7771
n@749 7772 // If prev can be converted to accepted input
n@749 7773 conv = converters[ prev + " " + tmp[ 0 ] ] ||
n@749 7774 converters[ "* " + tmp[ 0 ] ];
n@749 7775 if ( conv ) {
n@749 7776 // Condense equivalence converters
n@749 7777 if ( conv === true ) {
n@749 7778 conv = converters[ conv2 ];
n@749 7779
n@749 7780 // Otherwise, insert the intermediate dataType
n@749 7781 } else if ( converters[ conv2 ] !== true ) {
n@749 7782 current = tmp[ 0 ];
n@749 7783 dataTypes.unshift( tmp[ 1 ] );
n@749 7784 }
n@749 7785 break;
n@749 7786 }
n@749 7787 }
n@749 7788 }
n@749 7789 }
n@749 7790
n@749 7791 // Apply converter (if not an equivalence)
n@749 7792 if ( conv !== true ) {
n@749 7793
n@749 7794 // Unless errors are allowed to bubble, catch and return them
n@749 7795 if ( conv && s[ "throws" ] ) {
n@749 7796 response = conv( response );
n@749 7797 } else {
n@749 7798 try {
n@749 7799 response = conv( response );
n@749 7800 } catch ( e ) {
n@749 7801 return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
n@749 7802 }
n@749 7803 }
n@749 7804 }
n@749 7805 }
n@749 7806 }
n@749 7807 }
n@749 7808
n@749 7809 return { state: "success", data: response };
n@749 7810 }
n@749 7811
n@749 7812 jQuery.extend({
n@749 7813
n@749 7814 // Counter for holding the number of active queries
n@749 7815 active: 0,
n@749 7816
n@749 7817 // Last-Modified header cache for next request
n@749 7818 lastModified: {},
n@749 7819 etag: {},
n@749 7820
n@749 7821 ajaxSettings: {
n@749 7822 url: ajaxLocation,
n@749 7823 type: "GET",
n@749 7824 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
n@749 7825 global: true,
n@749 7826 processData: true,
n@749 7827 async: true,
n@749 7828 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
n@749 7829 /*
n@749 7830 timeout: 0,
n@749 7831 data: null,
n@749 7832 dataType: null,
n@749 7833 username: null,
n@749 7834 password: null,
n@749 7835 cache: null,
n@749 7836 throws: false,
n@749 7837 traditional: false,
n@749 7838 headers: {},
n@749 7839 */
n@749 7840
n@749 7841 accepts: {
n@749 7842 "*": allTypes,
n@749 7843 text: "text/plain",
n@749 7844 html: "text/html",
n@749 7845 xml: "application/xml, text/xml",
n@749 7846 json: "application/json, text/javascript"
n@749 7847 },
n@749 7848
n@749 7849 contents: {
n@749 7850 xml: /xml/,
n@749 7851 html: /html/,
n@749 7852 json: /json/
n@749 7853 },
n@749 7854
n@749 7855 responseFields: {
n@749 7856 xml: "responseXML",
n@749 7857 text: "responseText",
n@749 7858 json: "responseJSON"
n@749 7859 },
n@749 7860
n@749 7861 // Data converters
n@749 7862 // Keys separate source (or catchall "*") and destination types with a single space
n@749 7863 converters: {
n@749 7864
n@749 7865 // Convert anything to text
n@749 7866 "* text": String,
n@749 7867
n@749 7868 // Text to html (true = no transformation)
n@749 7869 "text html": true,
n@749 7870
n@749 7871 // Evaluate text as a json expression
n@749 7872 "text json": jQuery.parseJSON,
n@749 7873
n@749 7874 // Parse text as xml
n@749 7875 "text xml": jQuery.parseXML
n@749 7876 },
n@749 7877
n@749 7878 // For options that shouldn't be deep extended:
n@749 7879 // you can add your own custom options here if
n@749 7880 // and when you create one that shouldn't be
n@749 7881 // deep extended (see ajaxExtend)
n@749 7882 flatOptions: {
n@749 7883 url: true,
n@749 7884 context: true
n@749 7885 }
n@749 7886 },
n@749 7887
n@749 7888 // Creates a full fledged settings object into target
n@749 7889 // with both ajaxSettings and settings fields.
n@749 7890 // If target is omitted, writes into ajaxSettings.
n@749 7891 ajaxSetup: function( target, settings ) {
n@749 7892 return settings ?
n@749 7893
n@749 7894 // Building a settings object
n@749 7895 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
n@749 7896
n@749 7897 // Extending ajaxSettings
n@749 7898 ajaxExtend( jQuery.ajaxSettings, target );
n@749 7899 },
n@749 7900
n@749 7901 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
n@749 7902 ajaxTransport: addToPrefiltersOrTransports( transports ),
n@749 7903
n@749 7904 // Main method
n@749 7905 ajax: function( url, options ) {
n@749 7906
n@749 7907 // If url is an object, simulate pre-1.5 signature
n@749 7908 if ( typeof url === "object" ) {
n@749 7909 options = url;
n@749 7910 url = undefined;
n@749 7911 }
n@749 7912
n@749 7913 // Force options to be an object
n@749 7914 options = options || {};
n@749 7915
n@749 7916 var transport,
n@749 7917 // URL without anti-cache param
n@749 7918 cacheURL,
n@749 7919 // Response headers
n@749 7920 responseHeadersString,
n@749 7921 responseHeaders,
n@749 7922 // timeout handle
n@749 7923 timeoutTimer,
n@749 7924 // Cross-domain detection vars
n@749 7925 parts,
n@749 7926 // To know if global events are to be dispatched
n@749 7927 fireGlobals,
n@749 7928 // Loop variable
n@749 7929 i,
n@749 7930 // Create the final options object
n@749 7931 s = jQuery.ajaxSetup( {}, options ),
n@749 7932 // Callbacks context
n@749 7933 callbackContext = s.context || s,
n@749 7934 // Context for global events is callbackContext if it is a DOM node or jQuery collection
n@749 7935 globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
n@749 7936 jQuery( callbackContext ) :
n@749 7937 jQuery.event,
n@749 7938 // Deferreds
n@749 7939 deferred = jQuery.Deferred(),
n@749 7940 completeDeferred = jQuery.Callbacks("once memory"),
n@749 7941 // Status-dependent callbacks
n@749 7942 statusCode = s.statusCode || {},
n@749 7943 // Headers (they are sent all at once)
n@749 7944 requestHeaders = {},
n@749 7945 requestHeadersNames = {},
n@749 7946 // The jqXHR state
n@749 7947 state = 0,
n@749 7948 // Default abort message
n@749 7949 strAbort = "canceled",
n@749 7950 // Fake xhr
n@749 7951 jqXHR = {
n@749 7952 readyState: 0,
n@749 7953
n@749 7954 // Builds headers hashtable if needed
n@749 7955 getResponseHeader: function( key ) {
n@749 7956 var match;
n@749 7957 if ( state === 2 ) {
n@749 7958 if ( !responseHeaders ) {
n@749 7959 responseHeaders = {};
n@749 7960 while ( (match = rheaders.exec( responseHeadersString )) ) {
n@749 7961 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
n@749 7962 }
n@749 7963 }
n@749 7964 match = responseHeaders[ key.toLowerCase() ];
n@749 7965 }
n@749 7966 return match == null ? null : match;
n@749 7967 },
n@749 7968
n@749 7969 // Raw string
n@749 7970 getAllResponseHeaders: function() {
n@749 7971 return state === 2 ? responseHeadersString : null;
n@749 7972 },
n@749 7973
n@749 7974 // Caches the header
n@749 7975 setRequestHeader: function( name, value ) {
n@749 7976 var lname = name.toLowerCase();
n@749 7977 if ( !state ) {
n@749 7978 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
n@749 7979 requestHeaders[ name ] = value;
n@749 7980 }
n@749 7981 return this;
n@749 7982 },
n@749 7983
n@749 7984 // Overrides response content-type header
n@749 7985 overrideMimeType: function( type ) {
n@749 7986 if ( !state ) {
n@749 7987 s.mimeType = type;
n@749 7988 }
n@749 7989 return this;
n@749 7990 },
n@749 7991
n@749 7992 // Status-dependent callbacks
n@749 7993 statusCode: function( map ) {
n@749 7994 var code;
n@749 7995 if ( map ) {
n@749 7996 if ( state < 2 ) {
n@749 7997 for ( code in map ) {
n@749 7998 // Lazy-add the new callback in a way that preserves old ones
n@749 7999 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
n@749 8000 }
n@749 8001 } else {
n@749 8002 // Execute the appropriate callbacks
n@749 8003 jqXHR.always( map[ jqXHR.status ] );
n@749 8004 }
n@749 8005 }
n@749 8006 return this;
n@749 8007 },
n@749 8008
n@749 8009 // Cancel the request
n@749 8010 abort: function( statusText ) {
n@749 8011 var finalText = statusText || strAbort;
n@749 8012 if ( transport ) {
n@749 8013 transport.abort( finalText );
n@749 8014 }
n@749 8015 done( 0, finalText );
n@749 8016 return this;
n@749 8017 }
n@749 8018 };
n@749 8019
n@749 8020 // Attach deferreds
n@749 8021 deferred.promise( jqXHR ).complete = completeDeferred.add;
n@749 8022 jqXHR.success = jqXHR.done;
n@749 8023 jqXHR.error = jqXHR.fail;
n@749 8024
n@749 8025 // Remove hash character (#7531: and string promotion)
n@749 8026 // Add protocol if not provided (prefilters might expect it)
n@749 8027 // Handle falsy url in the settings object (#10093: consistency with old signature)
n@749 8028 // We also use the url parameter if available
n@749 8029 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
n@749 8030 .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
n@749 8031
n@749 8032 // Alias method option to type as per ticket #12004
n@749 8033 s.type = options.method || options.type || s.method || s.type;
n@749 8034
n@749 8035 // Extract dataTypes list
n@749 8036 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
n@749 8037
n@749 8038 // A cross-domain request is in order when we have a protocol:host:port mismatch
n@749 8039 if ( s.crossDomain == null ) {
n@749 8040 parts = rurl.exec( s.url.toLowerCase() );
n@749 8041 s.crossDomain = !!( parts &&
n@749 8042 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
n@749 8043 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
n@749 8044 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
n@749 8045 );
n@749 8046 }
n@749 8047
n@749 8048 // Convert data if not already a string
n@749 8049 if ( s.data && s.processData && typeof s.data !== "string" ) {
n@749 8050 s.data = jQuery.param( s.data, s.traditional );
n@749 8051 }
n@749 8052
n@749 8053 // Apply prefilters
n@749 8054 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
n@749 8055
n@749 8056 // If request was aborted inside a prefilter, stop there
n@749 8057 if ( state === 2 ) {
n@749 8058 return jqXHR;
n@749 8059 }
n@749 8060
n@749 8061 // We can fire global events as of now if asked to
n@749 8062 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
n@749 8063 fireGlobals = jQuery.event && s.global;
n@749 8064
n@749 8065 // Watch for a new set of requests
n@749 8066 if ( fireGlobals && jQuery.active++ === 0 ) {
n@749 8067 jQuery.event.trigger("ajaxStart");
n@749 8068 }
n@749 8069
n@749 8070 // Uppercase the type
n@749 8071 s.type = s.type.toUpperCase();
n@749 8072
n@749 8073 // Determine if request has content
n@749 8074 s.hasContent = !rnoContent.test( s.type );
n@749 8075
n@749 8076 // Save the URL in case we're toying with the If-Modified-Since
n@749 8077 // and/or If-None-Match header later on
n@749 8078 cacheURL = s.url;
n@749 8079
n@749 8080 // More options handling for requests with no content
n@749 8081 if ( !s.hasContent ) {
n@749 8082
n@749 8083 // If data is available, append data to url
n@749 8084 if ( s.data ) {
n@749 8085 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
n@749 8086 // #9682: remove data so that it's not used in an eventual retry
n@749 8087 delete s.data;
n@749 8088 }
n@749 8089
n@749 8090 // Add anti-cache in url if needed
n@749 8091 if ( s.cache === false ) {
n@749 8092 s.url = rts.test( cacheURL ) ?
n@749 8093
n@749 8094 // If there is already a '_' parameter, set its value
n@749 8095 cacheURL.replace( rts, "$1_=" + nonce++ ) :
n@749 8096
n@749 8097 // Otherwise add one to the end
n@749 8098 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
n@749 8099 }
n@749 8100 }
n@749 8101
n@749 8102 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
n@749 8103 if ( s.ifModified ) {
n@749 8104 if ( jQuery.lastModified[ cacheURL ] ) {
n@749 8105 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
n@749 8106 }
n@749 8107 if ( jQuery.etag[ cacheURL ] ) {
n@749 8108 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
n@749 8109 }
n@749 8110 }
n@749 8111
n@749 8112 // Set the correct header, if data is being sent
n@749 8113 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
n@749 8114 jqXHR.setRequestHeader( "Content-Type", s.contentType );
n@749 8115 }
n@749 8116
n@749 8117 // Set the Accepts header for the server, depending on the dataType
n@749 8118 jqXHR.setRequestHeader(
n@749 8119 "Accept",
n@749 8120 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
n@749 8121 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
n@749 8122 s.accepts[ "*" ]
n@749 8123 );
n@749 8124
n@749 8125 // Check for headers option
n@749 8126 for ( i in s.headers ) {
n@749 8127 jqXHR.setRequestHeader( i, s.headers[ i ] );
n@749 8128 }
n@749 8129
n@749 8130 // Allow custom headers/mimetypes and early abort
n@749 8131 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
n@749 8132 // Abort if not done already and return
n@749 8133 return jqXHR.abort();
n@749 8134 }
n@749 8135
n@749 8136 // Aborting is no longer a cancellation
n@749 8137 strAbort = "abort";
n@749 8138
n@749 8139 // Install callbacks on deferreds
n@749 8140 for ( i in { success: 1, error: 1, complete: 1 } ) {
n@749 8141 jqXHR[ i ]( s[ i ] );
n@749 8142 }
n@749 8143
n@749 8144 // Get transport
n@749 8145 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
n@749 8146
n@749 8147 // If no transport, we auto-abort
n@749 8148 if ( !transport ) {
n@749 8149 done( -1, "No Transport" );
n@749 8150 } else {
n@749 8151 jqXHR.readyState = 1;
n@749 8152
n@749 8153 // Send global event
n@749 8154 if ( fireGlobals ) {
n@749 8155 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
n@749 8156 }
n@749 8157 // Timeout
n@749 8158 if ( s.async && s.timeout > 0 ) {
n@749 8159 timeoutTimer = setTimeout(function() {
n@749 8160 jqXHR.abort("timeout");
n@749 8161 }, s.timeout );
n@749 8162 }
n@749 8163
n@749 8164 try {
n@749 8165 state = 1;
n@749 8166 transport.send( requestHeaders, done );
n@749 8167 } catch ( e ) {
n@749 8168 // Propagate exception as error if not done
n@749 8169 if ( state < 2 ) {
n@749 8170 done( -1, e );
n@749 8171 // Simply rethrow otherwise
n@749 8172 } else {
n@749 8173 throw e;
n@749 8174 }
n@749 8175 }
n@749 8176 }
n@749 8177
n@749 8178 // Callback for when everything is done
n@749 8179 function done( status, nativeStatusText, responses, headers ) {
n@749 8180 var isSuccess, success, error, response, modified,
n@749 8181 statusText = nativeStatusText;
n@749 8182
n@749 8183 // Called once
n@749 8184 if ( state === 2 ) {
n@749 8185 return;
n@749 8186 }
n@749 8187
n@749 8188 // State is "done" now
n@749 8189 state = 2;
n@749 8190
n@749 8191 // Clear timeout if it exists
n@749 8192 if ( timeoutTimer ) {
n@749 8193 clearTimeout( timeoutTimer );
n@749 8194 }
n@749 8195
n@749 8196 // Dereference transport for early garbage collection
n@749 8197 // (no matter how long the jqXHR object will be used)
n@749 8198 transport = undefined;
n@749 8199
n@749 8200 // Cache response headers
n@749 8201 responseHeadersString = headers || "";
n@749 8202
n@749 8203 // Set readyState
n@749 8204 jqXHR.readyState = status > 0 ? 4 : 0;
n@749 8205
n@749 8206 // Determine if successful
n@749 8207 isSuccess = status >= 200 && status < 300 || status === 304;
n@749 8208
n@749 8209 // Get response data
n@749 8210 if ( responses ) {
n@749 8211 response = ajaxHandleResponses( s, jqXHR, responses );
n@749 8212 }
n@749 8213
n@749 8214 // Convert no matter what (that way responseXXX fields are always set)
n@749 8215 response = ajaxConvert( s, response, jqXHR, isSuccess );
n@749 8216
n@749 8217 // If successful, handle type chaining
n@749 8218 if ( isSuccess ) {
n@749 8219
n@749 8220 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
n@749 8221 if ( s.ifModified ) {
n@749 8222 modified = jqXHR.getResponseHeader("Last-Modified");
n@749 8223 if ( modified ) {
n@749 8224 jQuery.lastModified[ cacheURL ] = modified;
n@749 8225 }
n@749 8226 modified = jqXHR.getResponseHeader("etag");
n@749 8227 if ( modified ) {
n@749 8228 jQuery.etag[ cacheURL ] = modified;
n@749 8229 }
n@749 8230 }
n@749 8231
n@749 8232 // if no content
n@749 8233 if ( status === 204 || s.type === "HEAD" ) {
n@749 8234 statusText = "nocontent";
n@749 8235
n@749 8236 // if not modified
n@749 8237 } else if ( status === 304 ) {
n@749 8238 statusText = "notmodified";
n@749 8239
n@749 8240 // If we have data, let's convert it
n@749 8241 } else {
n@749 8242 statusText = response.state;
n@749 8243 success = response.data;
n@749 8244 error = response.error;
n@749 8245 isSuccess = !error;
n@749 8246 }
n@749 8247 } else {
n@749 8248 // Extract error from statusText and normalize for non-aborts
n@749 8249 error = statusText;
n@749 8250 if ( status || !statusText ) {
n@749 8251 statusText = "error";
n@749 8252 if ( status < 0 ) {
n@749 8253 status = 0;
n@749 8254 }
n@749 8255 }
n@749 8256 }
n@749 8257
n@749 8258 // Set data for the fake xhr object
n@749 8259 jqXHR.status = status;
n@749 8260 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
n@749 8261
n@749 8262 // Success/Error
n@749 8263 if ( isSuccess ) {
n@749 8264 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
n@749 8265 } else {
n@749 8266 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
n@749 8267 }
n@749 8268
n@749 8269 // Status-dependent callbacks
n@749 8270 jqXHR.statusCode( statusCode );
n@749 8271 statusCode = undefined;
n@749 8272
n@749 8273 if ( fireGlobals ) {
n@749 8274 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
n@749 8275 [ jqXHR, s, isSuccess ? success : error ] );
n@749 8276 }
n@749 8277
n@749 8278 // Complete
n@749 8279 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
n@749 8280
n@749 8281 if ( fireGlobals ) {
n@749 8282 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
n@749 8283 // Handle the global AJAX counter
n@749 8284 if ( !( --jQuery.active ) ) {
n@749 8285 jQuery.event.trigger("ajaxStop");
n@749 8286 }
n@749 8287 }
n@749 8288 }
n@749 8289
n@749 8290 return jqXHR;
n@749 8291 },
n@749 8292
n@749 8293 getJSON: function( url, data, callback ) {
n@749 8294 return jQuery.get( url, data, callback, "json" );
n@749 8295 },
n@749 8296
n@749 8297 getScript: function( url, callback ) {
n@749 8298 return jQuery.get( url, undefined, callback, "script" );
n@749 8299 }
n@749 8300 });
n@749 8301
n@749 8302 jQuery.each( [ "get", "post" ], function( i, method ) {
n@749 8303 jQuery[ method ] = function( url, data, callback, type ) {
n@749 8304 // Shift arguments if data argument was omitted
n@749 8305 if ( jQuery.isFunction( data ) ) {
n@749 8306 type = type || callback;
n@749 8307 callback = data;
n@749 8308 data = undefined;
n@749 8309 }
n@749 8310
n@749 8311 return jQuery.ajax({
n@749 8312 url: url,
n@749 8313 type: method,
n@749 8314 dataType: type,
n@749 8315 data: data,
n@749 8316 success: callback
n@749 8317 });
n@749 8318 };
n@749 8319 });
n@749 8320
n@749 8321
n@749 8322 jQuery._evalUrl = function( url ) {
n@749 8323 return jQuery.ajax({
n@749 8324 url: url,
n@749 8325 type: "GET",
n@749 8326 dataType: "script",
n@749 8327 async: false,
n@749 8328 global: false,
n@749 8329 "throws": true
n@749 8330 });
n@749 8331 };
n@749 8332
n@749 8333
n@749 8334 jQuery.fn.extend({
n@749 8335 wrapAll: function( html ) {
n@749 8336 var wrap;
n@749 8337
n@749 8338 if ( jQuery.isFunction( html ) ) {
n@749 8339 return this.each(function( i ) {
n@749 8340 jQuery( this ).wrapAll( html.call(this, i) );
n@749 8341 });
n@749 8342 }
n@749 8343
n@749 8344 if ( this[ 0 ] ) {
n@749 8345
n@749 8346 // The elements to wrap the target around
n@749 8347 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
n@749 8348
n@749 8349 if ( this[ 0 ].parentNode ) {
n@749 8350 wrap.insertBefore( this[ 0 ] );
n@749 8351 }
n@749 8352
n@749 8353 wrap.map(function() {
n@749 8354 var elem = this;
n@749 8355
n@749 8356 while ( elem.firstElementChild ) {
n@749 8357 elem = elem.firstElementChild;
n@749 8358 }
n@749 8359
n@749 8360 return elem;
n@749 8361 }).append( this );
n@749 8362 }
n@749 8363
n@749 8364 return this;
n@749 8365 },
n@749 8366
n@749 8367 wrapInner: function( html ) {
n@749 8368 if ( jQuery.isFunction( html ) ) {
n@749 8369 return this.each(function( i ) {
n@749 8370 jQuery( this ).wrapInner( html.call(this, i) );
n@749 8371 });
n@749 8372 }
n@749 8373
n@749 8374 return this.each(function() {
n@749 8375 var self = jQuery( this ),
n@749 8376 contents = self.contents();
n@749 8377
n@749 8378 if ( contents.length ) {
n@749 8379 contents.wrapAll( html );
n@749 8380
n@749 8381 } else {
n@749 8382 self.append( html );
n@749 8383 }
n@749 8384 });
n@749 8385 },
n@749 8386
n@749 8387 wrap: function( html ) {
n@749 8388 var isFunction = jQuery.isFunction( html );
n@749 8389
n@749 8390 return this.each(function( i ) {
n@749 8391 jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
n@749 8392 });
n@749 8393 },
n@749 8394
n@749 8395 unwrap: function() {
n@749 8396 return this.parent().each(function() {
n@749 8397 if ( !jQuery.nodeName( this, "body" ) ) {
n@749 8398 jQuery( this ).replaceWith( this.childNodes );
n@749 8399 }
n@749 8400 }).end();
n@749 8401 }
n@749 8402 });
n@749 8403
n@749 8404
n@749 8405 jQuery.expr.filters.hidden = function( elem ) {
n@749 8406 // Support: Opera <= 12.12
n@749 8407 // Opera reports offsetWidths and offsetHeights less than zero on some elements
n@749 8408 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
n@749 8409 };
n@749 8410 jQuery.expr.filters.visible = function( elem ) {
n@749 8411 return !jQuery.expr.filters.hidden( elem );
n@749 8412 };
n@749 8413
n@749 8414
n@749 8415
n@749 8416
n@749 8417 var r20 = /%20/g,
n@749 8418 rbracket = /\[\]$/,
n@749 8419 rCRLF = /\r?\n/g,
n@749 8420 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
n@749 8421 rsubmittable = /^(?:input|select|textarea|keygen)/i;
n@749 8422
n@749 8423 function buildParams( prefix, obj, traditional, add ) {
n@749 8424 var name;
n@749 8425
n@749 8426 if ( jQuery.isArray( obj ) ) {
n@749 8427 // Serialize array item.
n@749 8428 jQuery.each( obj, function( i, v ) {
n@749 8429 if ( traditional || rbracket.test( prefix ) ) {
n@749 8430 // Treat each array item as a scalar.
n@749 8431 add( prefix, v );
n@749 8432
n@749 8433 } else {
n@749 8434 // Item is non-scalar (array or object), encode its numeric index.
n@749 8435 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
n@749 8436 }
n@749 8437 });
n@749 8438
n@749 8439 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
n@749 8440 // Serialize object item.
n@749 8441 for ( name in obj ) {
n@749 8442 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
n@749 8443 }
n@749 8444
n@749 8445 } else {
n@749 8446 // Serialize scalar item.
n@749 8447 add( prefix, obj );
n@749 8448 }
n@749 8449 }
n@749 8450
n@749 8451 // Serialize an array of form elements or a set of
n@749 8452 // key/values into a query string
n@749 8453 jQuery.param = function( a, traditional ) {
n@749 8454 var prefix,
n@749 8455 s = [],
n@749 8456 add = function( key, value ) {
n@749 8457 // If value is a function, invoke it and return its value
n@749 8458 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
n@749 8459 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
n@749 8460 };
n@749 8461
n@749 8462 // Set traditional to true for jQuery <= 1.3.2 behavior.
n@749 8463 if ( traditional === undefined ) {
n@749 8464 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
n@749 8465 }
n@749 8466
n@749 8467 // If an array was passed in, assume that it is an array of form elements.
n@749 8468 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
n@749 8469 // Serialize the form elements
n@749 8470 jQuery.each( a, function() {
n@749 8471 add( this.name, this.value );
n@749 8472 });
n@749 8473
n@749 8474 } else {
n@749 8475 // If traditional, encode the "old" way (the way 1.3.2 or older
n@749 8476 // did it), otherwise encode params recursively.
n@749 8477 for ( prefix in a ) {
n@749 8478 buildParams( prefix, a[ prefix ], traditional, add );
n@749 8479 }
n@749 8480 }
n@749 8481
n@749 8482 // Return the resulting serialization
n@749 8483 return s.join( "&" ).replace( r20, "+" );
n@749 8484 };
n@749 8485
n@749 8486 jQuery.fn.extend({
n@749 8487 serialize: function() {
n@749 8488 return jQuery.param( this.serializeArray() );
n@749 8489 },
n@749 8490 serializeArray: function() {
n@749 8491 return this.map(function() {
n@749 8492 // Can add propHook for "elements" to filter or add form elements
n@749 8493 var elements = jQuery.prop( this, "elements" );
n@749 8494 return elements ? jQuery.makeArray( elements ) : this;
n@749 8495 })
n@749 8496 .filter(function() {
n@749 8497 var type = this.type;
n@749 8498
n@749 8499 // Use .is( ":disabled" ) so that fieldset[disabled] works
n@749 8500 return this.name && !jQuery( this ).is( ":disabled" ) &&
n@749 8501 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
n@749 8502 ( this.checked || !rcheckableType.test( type ) );
n@749 8503 })
n@749 8504 .map(function( i, elem ) {
n@749 8505 var val = jQuery( this ).val();
n@749 8506
n@749 8507 return val == null ?
n@749 8508 null :
n@749 8509 jQuery.isArray( val ) ?
n@749 8510 jQuery.map( val, function( val ) {
n@749 8511 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
n@749 8512 }) :
n@749 8513 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
n@749 8514 }).get();
n@749 8515 }
n@749 8516 });
n@749 8517
n@749 8518
n@749 8519 jQuery.ajaxSettings.xhr = function() {
n@749 8520 try {
n@749 8521 return new XMLHttpRequest();
n@749 8522 } catch( e ) {}
n@749 8523 };
n@749 8524
n@749 8525 var xhrId = 0,
n@749 8526 xhrCallbacks = {},
n@749 8527 xhrSuccessStatus = {
n@749 8528 // file protocol always yields status code 0, assume 200
n@749 8529 0: 200,
n@749 8530 // Support: IE9
n@749 8531 // #1450: sometimes IE returns 1223 when it should be 204
n@749 8532 1223: 204
n@749 8533 },
n@749 8534 xhrSupported = jQuery.ajaxSettings.xhr();
n@749 8535
n@749 8536 // Support: IE9
n@749 8537 // Open requests must be manually aborted on unload (#5280)
n@749 8538 // See https://support.microsoft.com/kb/2856746 for more info
n@749 8539 if ( window.attachEvent ) {
n@749 8540 window.attachEvent( "onunload", function() {
n@749 8541 for ( var key in xhrCallbacks ) {
n@749 8542 xhrCallbacks[ key ]();
n@749 8543 }
n@749 8544 });
n@749 8545 }
n@749 8546
n@749 8547 support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
n@749 8548 support.ajax = xhrSupported = !!xhrSupported;
n@749 8549
n@749 8550 jQuery.ajaxTransport(function( options ) {
n@749 8551 var callback;
n@749 8552
n@749 8553 // Cross domain only allowed if supported through XMLHttpRequest
n@749 8554 if ( support.cors || xhrSupported && !options.crossDomain ) {
n@749 8555 return {
n@749 8556 send: function( headers, complete ) {
n@749 8557 var i,
n@749 8558 xhr = options.xhr(),
n@749 8559 id = ++xhrId;
n@749 8560
n@749 8561 xhr.open( options.type, options.url, options.async, options.username, options.password );
n@749 8562
n@749 8563 // Apply custom fields if provided
n@749 8564 if ( options.xhrFields ) {
n@749 8565 for ( i in options.xhrFields ) {
n@749 8566 xhr[ i ] = options.xhrFields[ i ];
n@749 8567 }
n@749 8568 }
n@749 8569
n@749 8570 // Override mime type if needed
n@749 8571 if ( options.mimeType && xhr.overrideMimeType ) {
n@749 8572 xhr.overrideMimeType( options.mimeType );
n@749 8573 }
n@749 8574
n@749 8575 // X-Requested-With header
n@749 8576 // For cross-domain requests, seeing as conditions for a preflight are
n@749 8577 // akin to a jigsaw puzzle, we simply never set it to be sure.
n@749 8578 // (it can always be set on a per-request basis or even using ajaxSetup)
n@749 8579 // For same-domain requests, won't change header if already provided.
n@749 8580 if ( !options.crossDomain && !headers["X-Requested-With"] ) {
n@749 8581 headers["X-Requested-With"] = "XMLHttpRequest";
n@749 8582 }
n@749 8583
n@749 8584 // Set headers
n@749 8585 for ( i in headers ) {
n@749 8586 xhr.setRequestHeader( i, headers[ i ] );
n@749 8587 }
n@749 8588
n@749 8589 // Callback
n@749 8590 callback = function( type ) {
n@749 8591 return function() {
n@749 8592 if ( callback ) {
n@749 8593 delete xhrCallbacks[ id ];
n@749 8594 callback = xhr.onload = xhr.onerror = null;
n@749 8595
n@749 8596 if ( type === "abort" ) {
n@749 8597 xhr.abort();
n@749 8598 } else if ( type === "error" ) {
n@749 8599 complete(
n@749 8600 // file: protocol always yields status 0; see #8605, #14207
n@749 8601 xhr.status,
n@749 8602 xhr.statusText
n@749 8603 );
n@749 8604 } else {
n@749 8605 complete(
n@749 8606 xhrSuccessStatus[ xhr.status ] || xhr.status,
n@749 8607 xhr.statusText,
n@749 8608 // Support: IE9
n@749 8609 // Accessing binary-data responseText throws an exception
n@749 8610 // (#11426)
n@749 8611 typeof xhr.responseText === "string" ? {
n@749 8612 text: xhr.responseText
n@749 8613 } : undefined,
n@749 8614 xhr.getAllResponseHeaders()
n@749 8615 );
n@749 8616 }
n@749 8617 }
n@749 8618 };
n@749 8619 };
n@749 8620
n@749 8621 // Listen to events
n@749 8622 xhr.onload = callback();
n@749 8623 xhr.onerror = callback("error");
n@749 8624
n@749 8625 // Create the abort callback
n@749 8626 callback = xhrCallbacks[ id ] = callback("abort");
n@749 8627
n@749 8628 try {
n@749 8629 // Do send the request (this may raise an exception)
n@749 8630 xhr.send( options.hasContent && options.data || null );
n@749 8631 } catch ( e ) {
n@749 8632 // #14683: Only rethrow if this hasn't been notified as an error yet
n@749 8633 if ( callback ) {
n@749 8634 throw e;
n@749 8635 }
n@749 8636 }
n@749 8637 },
n@749 8638
n@749 8639 abort: function() {
n@749 8640 if ( callback ) {
n@749 8641 callback();
n@749 8642 }
n@749 8643 }
n@749 8644 };
n@749 8645 }
n@749 8646 });
n@749 8647
n@749 8648
n@749 8649
n@749 8650
n@749 8651 // Install script dataType
n@749 8652 jQuery.ajaxSetup({
n@749 8653 accepts: {
n@749 8654 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
n@749 8655 },
n@749 8656 contents: {
n@749 8657 script: /(?:java|ecma)script/
n@749 8658 },
n@749 8659 converters: {
n@749 8660 "text script": function( text ) {
n@749 8661 jQuery.globalEval( text );
n@749 8662 return text;
n@749 8663 }
n@749 8664 }
n@749 8665 });
n@749 8666
n@749 8667 // Handle cache's special case and crossDomain
n@749 8668 jQuery.ajaxPrefilter( "script", function( s ) {
n@749 8669 if ( s.cache === undefined ) {
n@749 8670 s.cache = false;
n@749 8671 }
n@749 8672 if ( s.crossDomain ) {
n@749 8673 s.type = "GET";
n@749 8674 }
n@749 8675 });
n@749 8676
n@749 8677 // Bind script tag hack transport
n@749 8678 jQuery.ajaxTransport( "script", function( s ) {
n@749 8679 // This transport only deals with cross domain requests
n@749 8680 if ( s.crossDomain ) {
n@749 8681 var script, callback;
n@749 8682 return {
n@749 8683 send: function( _, complete ) {
n@749 8684 script = jQuery("<script>").prop({
n@749 8685 async: true,
n@749 8686 charset: s.scriptCharset,
n@749 8687 src: s.url
n@749 8688 }).on(
n@749 8689 "load error",
n@749 8690 callback = function( evt ) {
n@749 8691 script.remove();
n@749 8692 callback = null;
n@749 8693 if ( evt ) {
n@749 8694 complete( evt.type === "error" ? 404 : 200, evt.type );
n@749 8695 }
n@749 8696 }
n@749 8697 );
n@749 8698 document.head.appendChild( script[ 0 ] );
n@749 8699 },
n@749 8700 abort: function() {
n@749 8701 if ( callback ) {
n@749 8702 callback();
n@749 8703 }
n@749 8704 }
n@749 8705 };
n@749 8706 }
n@749 8707 });
n@749 8708
n@749 8709
n@749 8710
n@749 8711
n@749 8712 var oldCallbacks = [],
n@749 8713 rjsonp = /(=)\?(?=&|$)|\?\?/;
n@749 8714
n@749 8715 // Default jsonp settings
n@749 8716 jQuery.ajaxSetup({
n@749 8717 jsonp: "callback",
n@749 8718 jsonpCallback: function() {
n@749 8719 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
n@749 8720 this[ callback ] = true;
n@749 8721 return callback;
n@749 8722 }
n@749 8723 });
n@749 8724
n@749 8725 // Detect, normalize options and install callbacks for jsonp requests
n@749 8726 jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
n@749 8727
n@749 8728 var callbackName, overwritten, responseContainer,
n@749 8729 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
n@749 8730 "url" :
n@749 8731 typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
n@749 8732 );
n@749 8733
n@749 8734 // Handle iff the expected data type is "jsonp" or we have a parameter to set
n@749 8735 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
n@749 8736
n@749 8737 // Get callback name, remembering preexisting value associated with it
n@749 8738 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
n@749 8739 s.jsonpCallback() :
n@749 8740 s.jsonpCallback;
n@749 8741
n@749 8742 // Insert callback into url or form data
n@749 8743 if ( jsonProp ) {
n@749 8744 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
n@749 8745 } else if ( s.jsonp !== false ) {
n@749 8746 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
n@749 8747 }
n@749 8748
n@749 8749 // Use data converter to retrieve json after script execution
n@749 8750 s.converters["script json"] = function() {
n@749 8751 if ( !responseContainer ) {
n@749 8752 jQuery.error( callbackName + " was not called" );
n@749 8753 }
n@749 8754 return responseContainer[ 0 ];
n@749 8755 };
n@749 8756
n@749 8757 // force json dataType
n@749 8758 s.dataTypes[ 0 ] = "json";
n@749 8759
n@749 8760 // Install callback
n@749 8761 overwritten = window[ callbackName ];
n@749 8762 window[ callbackName ] = function() {
n@749 8763 responseContainer = arguments;
n@749 8764 };
n@749 8765
n@749 8766 // Clean-up function (fires after converters)
n@749 8767 jqXHR.always(function() {
n@749 8768 // Restore preexisting value
n@749 8769 window[ callbackName ] = overwritten;
n@749 8770
n@749 8771 // Save back as free
n@749 8772 if ( s[ callbackName ] ) {
n@749 8773 // make sure that re-using the options doesn't screw things around
n@749 8774 s.jsonpCallback = originalSettings.jsonpCallback;
n@749 8775
n@749 8776 // save the callback name for future use
n@749 8777 oldCallbacks.push( callbackName );
n@749 8778 }
n@749 8779
n@749 8780 // Call if it was a function and we have a response
n@749 8781 if ( responseContainer && jQuery.isFunction( overwritten ) ) {
n@749 8782 overwritten( responseContainer[ 0 ] );
n@749 8783 }
n@749 8784
n@749 8785 responseContainer = overwritten = undefined;
n@749 8786 });
n@749 8787
n@749 8788 // Delegate to script
n@749 8789 return "script";
n@749 8790 }
n@749 8791 });
n@749 8792
n@749 8793
n@749 8794
n@749 8795
n@749 8796 // data: string of html
n@749 8797 // context (optional): If specified, the fragment will be created in this context, defaults to document
n@749 8798 // keepScripts (optional): If true, will include scripts passed in the html string
n@749 8799 jQuery.parseHTML = function( data, context, keepScripts ) {
n@749 8800 if ( !data || typeof data !== "string" ) {
n@749 8801 return null;
n@749 8802 }
n@749 8803 if ( typeof context === "boolean" ) {
n@749 8804 keepScripts = context;
n@749 8805 context = false;
n@749 8806 }
n@749 8807 context = context || document;
n@749 8808
n@749 8809 var parsed = rsingleTag.exec( data ),
n@749 8810 scripts = !keepScripts && [];
n@749 8811
n@749 8812 // Single tag
n@749 8813 if ( parsed ) {
n@749 8814 return [ context.createElement( parsed[1] ) ];
n@749 8815 }
n@749 8816
n@749 8817 parsed = jQuery.buildFragment( [ data ], context, scripts );
n@749 8818
n@749 8819 if ( scripts && scripts.length ) {
n@749 8820 jQuery( scripts ).remove();
n@749 8821 }
n@749 8822
n@749 8823 return jQuery.merge( [], parsed.childNodes );
n@749 8824 };
n@749 8825
n@749 8826
n@749 8827 // Keep a copy of the old load method
n@749 8828 var _load = jQuery.fn.load;
n@749 8829
n@749 8830 /**
n@749 8831 * Load a url into a page
n@749 8832 */
n@749 8833 jQuery.fn.load = function( url, params, callback ) {
n@749 8834 if ( typeof url !== "string" && _load ) {
n@749 8835 return _load.apply( this, arguments );
n@749 8836 }
n@749 8837
n@749 8838 var selector, type, response,
n@749 8839 self = this,
n@749 8840 off = url.indexOf(" ");
n@749 8841
n@749 8842 if ( off >= 0 ) {
n@749 8843 selector = jQuery.trim( url.slice( off ) );
n@749 8844 url = url.slice( 0, off );
n@749 8845 }
n@749 8846
n@749 8847 // If it's a function
n@749 8848 if ( jQuery.isFunction( params ) ) {
n@749 8849
n@749 8850 // We assume that it's the callback
n@749 8851 callback = params;
n@749 8852 params = undefined;
n@749 8853
n@749 8854 // Otherwise, build a param string
n@749 8855 } else if ( params && typeof params === "object" ) {
n@749 8856 type = "POST";
n@749 8857 }
n@749 8858
n@749 8859 // If we have elements to modify, make the request
n@749 8860 if ( self.length > 0 ) {
n@749 8861 jQuery.ajax({
n@749 8862 url: url,
n@749 8863
n@749 8864 // if "type" variable is undefined, then "GET" method will be used
n@749 8865 type: type,
n@749 8866 dataType: "html",
n@749 8867 data: params
n@749 8868 }).done(function( responseText ) {
n@749 8869
n@749 8870 // Save response for use in complete callback
n@749 8871 response = arguments;
n@749 8872
n@749 8873 self.html( selector ?
n@749 8874
n@749 8875 // If a selector was specified, locate the right elements in a dummy div
n@749 8876 // Exclude scripts to avoid IE 'Permission Denied' errors
n@749 8877 jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
n@749 8878
n@749 8879 // Otherwise use the full result
n@749 8880 responseText );
n@749 8881
n@749 8882 }).complete( callback && function( jqXHR, status ) {
n@749 8883 self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
n@749 8884 });
n@749 8885 }
n@749 8886
n@749 8887 return this;
n@749 8888 };
n@749 8889
n@749 8890
n@749 8891
n@749 8892
n@749 8893 // Attach a bunch of functions for handling common AJAX events
n@749 8894 jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
n@749 8895 jQuery.fn[ type ] = function( fn ) {
n@749 8896 return this.on( type, fn );
n@749 8897 };
n@749 8898 });
n@749 8899
n@749 8900
n@749 8901
n@749 8902
n@749 8903 jQuery.expr.filters.animated = function( elem ) {
n@749 8904 return jQuery.grep(jQuery.timers, function( fn ) {
n@749 8905 return elem === fn.elem;
n@749 8906 }).length;
n@749 8907 };
n@749 8908
n@749 8909
n@749 8910
n@749 8911
n@749 8912 var docElem = window.document.documentElement;
n@749 8913
n@749 8914 /**
n@749 8915 * Gets a window from an element
n@749 8916 */
n@749 8917 function getWindow( elem ) {
n@749 8918 return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
n@749 8919 }
n@749 8920
n@749 8921 jQuery.offset = {
n@749 8922 setOffset: function( elem, options, i ) {
n@749 8923 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
n@749 8924 position = jQuery.css( elem, "position" ),
n@749 8925 curElem = jQuery( elem ),
n@749 8926 props = {};
n@749 8927
n@749 8928 // Set position first, in-case top/left are set even on static elem
n@749 8929 if ( position === "static" ) {
n@749 8930 elem.style.position = "relative";
n@749 8931 }
n@749 8932
n@749 8933 curOffset = curElem.offset();
n@749 8934 curCSSTop = jQuery.css( elem, "top" );
n@749 8935 curCSSLeft = jQuery.css( elem, "left" );
n@749 8936 calculatePosition = ( position === "absolute" || position === "fixed" ) &&
n@749 8937 ( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
n@749 8938
n@749 8939 // Need to be able to calculate position if either
n@749 8940 // top or left is auto and position is either absolute or fixed
n@749 8941 if ( calculatePosition ) {
n@749 8942 curPosition = curElem.position();
n@749 8943 curTop = curPosition.top;
n@749 8944 curLeft = curPosition.left;
n@749 8945
n@749 8946 } else {
n@749 8947 curTop = parseFloat( curCSSTop ) || 0;
n@749 8948 curLeft = parseFloat( curCSSLeft ) || 0;
n@749 8949 }
n@749 8950
n@749 8951 if ( jQuery.isFunction( options ) ) {
n@749 8952 options = options.call( elem, i, curOffset );
n@749 8953 }
n@749 8954
n@749 8955 if ( options.top != null ) {
n@749 8956 props.top = ( options.top - curOffset.top ) + curTop;
n@749 8957 }
n@749 8958 if ( options.left != null ) {
n@749 8959 props.left = ( options.left - curOffset.left ) + curLeft;
n@749 8960 }
n@749 8961
n@749 8962 if ( "using" in options ) {
n@749 8963 options.using.call( elem, props );
n@749 8964
n@749 8965 } else {
n@749 8966 curElem.css( props );
n@749 8967 }
n@749 8968 }
n@749 8969 };
n@749 8970
n@749 8971 jQuery.fn.extend({
n@749 8972 offset: function( options ) {
n@749 8973 if ( arguments.length ) {
n@749 8974 return options === undefined ?
n@749 8975 this :
n@749 8976 this.each(function( i ) {
n@749 8977 jQuery.offset.setOffset( this, options, i );
n@749 8978 });
n@749 8979 }
n@749 8980
n@749 8981 var docElem, win,
n@749 8982 elem = this[ 0 ],
n@749 8983 box = { top: 0, left: 0 },
n@749 8984 doc = elem && elem.ownerDocument;
n@749 8985
n@749 8986 if ( !doc ) {
n@749 8987 return;
n@749 8988 }
n@749 8989
n@749 8990 docElem = doc.documentElement;
n@749 8991
n@749 8992 // Make sure it's not a disconnected DOM node
n@749 8993 if ( !jQuery.contains( docElem, elem ) ) {
n@749 8994 return box;
n@749 8995 }
n@749 8996
n@749 8997 // Support: BlackBerry 5, iOS 3 (original iPhone)
n@749 8998 // If we don't have gBCR, just use 0,0 rather than error
n@749 8999 if ( typeof elem.getBoundingClientRect !== strundefined ) {
n@749 9000 box = elem.getBoundingClientRect();
n@749 9001 }
n@749 9002 win = getWindow( doc );
n@749 9003 return {
n@749 9004 top: box.top + win.pageYOffset - docElem.clientTop,
n@749 9005 left: box.left + win.pageXOffset - docElem.clientLeft
n@749 9006 };
n@749 9007 },
n@749 9008
n@749 9009 position: function() {
n@749 9010 if ( !this[ 0 ] ) {
n@749 9011 return;
n@749 9012 }
n@749 9013
n@749 9014 var offsetParent, offset,
n@749 9015 elem = this[ 0 ],
n@749 9016 parentOffset = { top: 0, left: 0 };
n@749 9017
n@749 9018 // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
n@749 9019 if ( jQuery.css( elem, "position" ) === "fixed" ) {
n@749 9020 // Assume getBoundingClientRect is there when computed position is fixed
n@749 9021 offset = elem.getBoundingClientRect();
n@749 9022
n@749 9023 } else {
n@749 9024 // Get *real* offsetParent
n@749 9025 offsetParent = this.offsetParent();
n@749 9026
n@749 9027 // Get correct offsets
n@749 9028 offset = this.offset();
n@749 9029 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
n@749 9030 parentOffset = offsetParent.offset();
n@749 9031 }
n@749 9032
n@749 9033 // Add offsetParent borders
n@749 9034 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
n@749 9035 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
n@749 9036 }
n@749 9037
n@749 9038 // Subtract parent offsets and element margins
n@749 9039 return {
n@749 9040 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
n@749 9041 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
n@749 9042 };
n@749 9043 },
n@749 9044
n@749 9045 offsetParent: function() {
n@749 9046 return this.map(function() {
n@749 9047 var offsetParent = this.offsetParent || docElem;
n@749 9048
n@749 9049 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
n@749 9050 offsetParent = offsetParent.offsetParent;
n@749 9051 }
n@749 9052
n@749 9053 return offsetParent || docElem;
n@749 9054 });
n@749 9055 }
n@749 9056 });
n@749 9057
n@749 9058 // Create scrollLeft and scrollTop methods
n@749 9059 jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
n@749 9060 var top = "pageYOffset" === prop;
n@749 9061
n@749 9062 jQuery.fn[ method ] = function( val ) {
n@749 9063 return access( this, function( elem, method, val ) {
n@749 9064 var win = getWindow( elem );
n@749 9065
n@749 9066 if ( val === undefined ) {
n@749 9067 return win ? win[ prop ] : elem[ method ];
n@749 9068 }
n@749 9069
n@749 9070 if ( win ) {
n@749 9071 win.scrollTo(
n@749 9072 !top ? val : window.pageXOffset,
n@749 9073 top ? val : window.pageYOffset
n@749 9074 );
n@749 9075
n@749 9076 } else {
n@749 9077 elem[ method ] = val;
n@749 9078 }
n@749 9079 }, method, val, arguments.length, null );
n@749 9080 };
n@749 9081 });
n@749 9082
n@749 9083 // Support: Safari<7+, Chrome<37+
n@749 9084 // Add the top/left cssHooks using jQuery.fn.position
n@749 9085 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
n@749 9086 // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
n@749 9087 // getComputedStyle returns percent when specified for top/left/bottom/right;
n@749 9088 // rather than make the css module depend on the offset module, just check for it here
n@749 9089 jQuery.each( [ "top", "left" ], function( i, prop ) {
n@749 9090 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
n@749 9091 function( elem, computed ) {
n@749 9092 if ( computed ) {
n@749 9093 computed = curCSS( elem, prop );
n@749 9094 // If curCSS returns percentage, fallback to offset
n@749 9095 return rnumnonpx.test( computed ) ?
n@749 9096 jQuery( elem ).position()[ prop ] + "px" :
n@749 9097 computed;
n@749 9098 }
n@749 9099 }
n@749 9100 );
n@749 9101 });
n@749 9102
n@749 9103
n@749 9104 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
n@749 9105 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
n@749 9106 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
n@749 9107 // Margin is only for outerHeight, outerWidth
n@749 9108 jQuery.fn[ funcName ] = function( margin, value ) {
n@749 9109 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
n@749 9110 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
n@749 9111
n@749 9112 return access( this, function( elem, type, value ) {
n@749 9113 var doc;
n@749 9114
n@749 9115 if ( jQuery.isWindow( elem ) ) {
n@749 9116 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
n@749 9117 // isn't a whole lot we can do. See pull request at this URL for discussion:
n@749 9118 // https://github.com/jquery/jquery/pull/764
n@749 9119 return elem.document.documentElement[ "client" + name ];
n@749 9120 }
n@749 9121
n@749 9122 // Get document width or height
n@749 9123 if ( elem.nodeType === 9 ) {
n@749 9124 doc = elem.documentElement;
n@749 9125
n@749 9126 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
n@749 9127 // whichever is greatest
n@749 9128 return Math.max(
n@749 9129 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
n@749 9130 elem.body[ "offset" + name ], doc[ "offset" + name ],
n@749 9131 doc[ "client" + name ]
n@749 9132 );
n@749 9133 }
n@749 9134
n@749 9135 return value === undefined ?
n@749 9136 // Get width or height on the element, requesting but not forcing parseFloat
n@749 9137 jQuery.css( elem, type, extra ) :
n@749 9138
n@749 9139 // Set width or height on the element
n@749 9140 jQuery.style( elem, type, value, extra );
n@749 9141 }, type, chainable ? margin : undefined, chainable, null );
n@749 9142 };
n@749 9143 });
n@749 9144 });
n@749 9145
n@749 9146
n@749 9147 // The number of elements contained in the matched element set
n@749 9148 jQuery.fn.size = function() {
n@749 9149 return this.length;
n@749 9150 };
n@749 9151
n@749 9152 jQuery.fn.andSelf = jQuery.fn.addBack;
n@749 9153
n@749 9154
n@749 9155
n@749 9156
n@749 9157 // Register as a named AMD module, since jQuery can be concatenated with other
n@749 9158 // files that may use define, but not via a proper concatenation script that
n@749 9159 // understands anonymous AMD modules. A named AMD is safest and most robust
n@749 9160 // way to register. Lowercase jquery is used because AMD module names are
n@749 9161 // derived from file names, and jQuery is normally delivered in a lowercase
n@749 9162 // file name. Do this after creating the global so that if an AMD module wants
n@749 9163 // to call noConflict to hide this version of jQuery, it will work.
n@749 9164
n@749 9165 // Note that for maximum portability, libraries that are not jQuery should
n@749 9166 // declare themselves as anonymous modules, and avoid setting a global if an
n@749 9167 // AMD loader is present. jQuery is a special case. For more information, see
n@749 9168 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
n@749 9169
n@749 9170 if ( typeof define === "function" && define.amd ) {
n@749 9171 define( "jquery", [], function() {
n@749 9172 return jQuery;
n@749 9173 });
n@749 9174 }
n@749 9175
n@749 9176
n@749 9177
n@749 9178
n@749 9179 var
n@749 9180 // Map over jQuery in case of overwrite
n@749 9181 _jQuery = window.jQuery,
n@749 9182
n@749 9183 // Map over the $ in case of overwrite
n@749 9184 _$ = window.$;
n@749 9185
n@749 9186 jQuery.noConflict = function( deep ) {
n@749 9187 if ( window.$ === jQuery ) {
n@749 9188 window.$ = _$;
n@749 9189 }
n@749 9190
n@749 9191 if ( deep && window.jQuery === jQuery ) {
n@749 9192 window.jQuery = _jQuery;
n@749 9193 }
n@749 9194
n@749 9195 return jQuery;
n@749 9196 };
n@749 9197
n@749 9198 // Expose jQuery and $ identifiers, even in AMD
n@749 9199 // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
n@749 9200 // and CommonJS for browser emulators (#13566)
n@749 9201 if ( typeof noGlobal === strundefined ) {
n@749 9202 window.jQuery = window.$ = jQuery;
n@749 9203 }
n@749 9204
n@749 9205
n@749 9206
n@749 9207
n@749 9208 return jQuery;
n@749 9209
n@749 9210 }));