annotate jquery-2.1.4.js @ 1105:d2afd2ee8684

Added score_parse.php separators for CSV
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Tue, 23 Feb 2016 17:11:28 +0000
parents
children
rev   line source
n@1105 1 /*!
n@1105 2 * jQuery JavaScript Library v2.1.4
n@1105 3 * http://jquery.com/
n@1105 4 *
n@1105 5 * Includes Sizzle.js
n@1105 6 * http://sizzlejs.com/
n@1105 7 *
n@1105 8 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
n@1105 9 * Released under the MIT license
n@1105 10 * http://jquery.org/license
n@1105 11 *
n@1105 12 * Date: 2015-04-28T16:01Z
n@1105 13 */
n@1105 14
n@1105 15 (function( global, factory ) {
n@1105 16
n@1105 17 if ( typeof module === "object" && typeof module.exports === "object" ) {
n@1105 18 // For CommonJS and CommonJS-like environments where a proper `window`
n@1105 19 // is present, execute the factory and get jQuery.
n@1105 20 // For environments that do not have a `window` with a `document`
n@1105 21 // (such as Node.js), expose a factory as module.exports.
n@1105 22 // This accentuates the need for the creation of a real `window`.
n@1105 23 // e.g. var jQuery = require("jquery")(window);
n@1105 24 // See ticket #14549 for more info.
n@1105 25 module.exports = global.document ?
n@1105 26 factory( global, true ) :
n@1105 27 function( w ) {
n@1105 28 if ( !w.document ) {
n@1105 29 throw new Error( "jQuery requires a window with a document" );
n@1105 30 }
n@1105 31 return factory( w );
n@1105 32 };
n@1105 33 } else {
n@1105 34 factory( global );
n@1105 35 }
n@1105 36
n@1105 37 // Pass this if window is not defined yet
n@1105 38 }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
n@1105 39
n@1105 40 // Support: Firefox 18+
n@1105 41 // Can't be in strict mode, several libs including ASP.NET trace
n@1105 42 // the stack via arguments.caller.callee and Firefox dies if
n@1105 43 // you try to trace through "use strict" call chains. (#13335)
n@1105 44 //
n@1105 45
n@1105 46 var arr = [];
n@1105 47
n@1105 48 var slice = arr.slice;
n@1105 49
n@1105 50 var concat = arr.concat;
n@1105 51
n@1105 52 var push = arr.push;
n@1105 53
n@1105 54 var indexOf = arr.indexOf;
n@1105 55
n@1105 56 var class2type = {};
n@1105 57
n@1105 58 var toString = class2type.toString;
n@1105 59
n@1105 60 var hasOwn = class2type.hasOwnProperty;
n@1105 61
n@1105 62 var support = {};
n@1105 63
n@1105 64
n@1105 65
n@1105 66 var
n@1105 67 // Use the correct document accordingly with window argument (sandbox)
n@1105 68 document = window.document,
n@1105 69
n@1105 70 version = "2.1.4",
n@1105 71
n@1105 72 // Define a local copy of jQuery
n@1105 73 jQuery = function( selector, context ) {
n@1105 74 // The jQuery object is actually just the init constructor 'enhanced'
n@1105 75 // Need init if jQuery is called (just allow error to be thrown if not included)
n@1105 76 return new jQuery.fn.init( selector, context );
n@1105 77 },
n@1105 78
n@1105 79 // Support: Android<4.1
n@1105 80 // Make sure we trim BOM and NBSP
n@1105 81 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
n@1105 82
n@1105 83 // Matches dashed string for camelizing
n@1105 84 rmsPrefix = /^-ms-/,
n@1105 85 rdashAlpha = /-([\da-z])/gi,
n@1105 86
n@1105 87 // Used by jQuery.camelCase as callback to replace()
n@1105 88 fcamelCase = function( all, letter ) {
n@1105 89 return letter.toUpperCase();
n@1105 90 };
n@1105 91
n@1105 92 jQuery.fn = jQuery.prototype = {
n@1105 93 // The current version of jQuery being used
n@1105 94 jquery: version,
n@1105 95
n@1105 96 constructor: jQuery,
n@1105 97
n@1105 98 // Start with an empty selector
n@1105 99 selector: "",
n@1105 100
n@1105 101 // The default length of a jQuery object is 0
n@1105 102 length: 0,
n@1105 103
n@1105 104 toArray: function() {
n@1105 105 return slice.call( this );
n@1105 106 },
n@1105 107
n@1105 108 // Get the Nth element in the matched element set OR
n@1105 109 // Get the whole matched element set as a clean array
n@1105 110 get: function( num ) {
n@1105 111 return num != null ?
n@1105 112
n@1105 113 // Return just the one element from the set
n@1105 114 ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
n@1105 115
n@1105 116 // Return all the elements in a clean array
n@1105 117 slice.call( this );
n@1105 118 },
n@1105 119
n@1105 120 // Take an array of elements and push it onto the stack
n@1105 121 // (returning the new matched element set)
n@1105 122 pushStack: function( elems ) {
n@1105 123
n@1105 124 // Build a new jQuery matched element set
n@1105 125 var ret = jQuery.merge( this.constructor(), elems );
n@1105 126
n@1105 127 // Add the old object onto the stack (as a reference)
n@1105 128 ret.prevObject = this;
n@1105 129 ret.context = this.context;
n@1105 130
n@1105 131 // Return the newly-formed element set
n@1105 132 return ret;
n@1105 133 },
n@1105 134
n@1105 135 // Execute a callback for every element in the matched set.
n@1105 136 // (You can seed the arguments with an array of args, but this is
n@1105 137 // only used internally.)
n@1105 138 each: function( callback, args ) {
n@1105 139 return jQuery.each( this, callback, args );
n@1105 140 },
n@1105 141
n@1105 142 map: function( callback ) {
n@1105 143 return this.pushStack( jQuery.map(this, function( elem, i ) {
n@1105 144 return callback.call( elem, i, elem );
n@1105 145 }));
n@1105 146 },
n@1105 147
n@1105 148 slice: function() {
n@1105 149 return this.pushStack( slice.apply( this, arguments ) );
n@1105 150 },
n@1105 151
n@1105 152 first: function() {
n@1105 153 return this.eq( 0 );
n@1105 154 },
n@1105 155
n@1105 156 last: function() {
n@1105 157 return this.eq( -1 );
n@1105 158 },
n@1105 159
n@1105 160 eq: function( i ) {
n@1105 161 var len = this.length,
n@1105 162 j = +i + ( i < 0 ? len : 0 );
n@1105 163 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
n@1105 164 },
n@1105 165
n@1105 166 end: function() {
n@1105 167 return this.prevObject || this.constructor(null);
n@1105 168 },
n@1105 169
n@1105 170 // For internal use only.
n@1105 171 // Behaves like an Array's method, not like a jQuery method.
n@1105 172 push: push,
n@1105 173 sort: arr.sort,
n@1105 174 splice: arr.splice
n@1105 175 };
n@1105 176
n@1105 177 jQuery.extend = jQuery.fn.extend = function() {
n@1105 178 var options, name, src, copy, copyIsArray, clone,
n@1105 179 target = arguments[0] || {},
n@1105 180 i = 1,
n@1105 181 length = arguments.length,
n@1105 182 deep = false;
n@1105 183
n@1105 184 // Handle a deep copy situation
n@1105 185 if ( typeof target === "boolean" ) {
n@1105 186 deep = target;
n@1105 187
n@1105 188 // Skip the boolean and the target
n@1105 189 target = arguments[ i ] || {};
n@1105 190 i++;
n@1105 191 }
n@1105 192
n@1105 193 // Handle case when target is a string or something (possible in deep copy)
n@1105 194 if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
n@1105 195 target = {};
n@1105 196 }
n@1105 197
n@1105 198 // Extend jQuery itself if only one argument is passed
n@1105 199 if ( i === length ) {
n@1105 200 target = this;
n@1105 201 i--;
n@1105 202 }
n@1105 203
n@1105 204 for ( ; i < length; i++ ) {
n@1105 205 // Only deal with non-null/undefined values
n@1105 206 if ( (options = arguments[ i ]) != null ) {
n@1105 207 // Extend the base object
n@1105 208 for ( name in options ) {
n@1105 209 src = target[ name ];
n@1105 210 copy = options[ name ];
n@1105 211
n@1105 212 // Prevent never-ending loop
n@1105 213 if ( target === copy ) {
n@1105 214 continue;
n@1105 215 }
n@1105 216
n@1105 217 // Recurse if we're merging plain objects or arrays
n@1105 218 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
n@1105 219 if ( copyIsArray ) {
n@1105 220 copyIsArray = false;
n@1105 221 clone = src && jQuery.isArray(src) ? src : [];
n@1105 222
n@1105 223 } else {
n@1105 224 clone = src && jQuery.isPlainObject(src) ? src : {};
n@1105 225 }
n@1105 226
n@1105 227 // Never move original objects, clone them
n@1105 228 target[ name ] = jQuery.extend( deep, clone, copy );
n@1105 229
n@1105 230 // Don't bring in undefined values
n@1105 231 } else if ( copy !== undefined ) {
n@1105 232 target[ name ] = copy;
n@1105 233 }
n@1105 234 }
n@1105 235 }
n@1105 236 }
n@1105 237
n@1105 238 // Return the modified object
n@1105 239 return target;
n@1105 240 };
n@1105 241
n@1105 242 jQuery.extend({
n@1105 243 // Unique for each copy of jQuery on the page
n@1105 244 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
n@1105 245
n@1105 246 // Assume jQuery is ready without the ready module
n@1105 247 isReady: true,
n@1105 248
n@1105 249 error: function( msg ) {
n@1105 250 throw new Error( msg );
n@1105 251 },
n@1105 252
n@1105 253 noop: function() {},
n@1105 254
n@1105 255 isFunction: function( obj ) {
n@1105 256 return jQuery.type(obj) === "function";
n@1105 257 },
n@1105 258
n@1105 259 isArray: Array.isArray,
n@1105 260
n@1105 261 isWindow: function( obj ) {
n@1105 262 return obj != null && obj === obj.window;
n@1105 263 },
n@1105 264
n@1105 265 isNumeric: function( obj ) {
n@1105 266 // parseFloat NaNs numeric-cast false positives (null|true|false|"")
n@1105 267 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
n@1105 268 // subtraction forces infinities to NaN
n@1105 269 // adding 1 corrects loss of precision from parseFloat (#15100)
n@1105 270 return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
n@1105 271 },
n@1105 272
n@1105 273 isPlainObject: function( obj ) {
n@1105 274 // Not plain objects:
n@1105 275 // - Any object or value whose internal [[Class]] property is not "[object Object]"
n@1105 276 // - DOM nodes
n@1105 277 // - window
n@1105 278 if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
n@1105 279 return false;
n@1105 280 }
n@1105 281
n@1105 282 if ( obj.constructor &&
n@1105 283 !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
n@1105 284 return false;
n@1105 285 }
n@1105 286
n@1105 287 // If the function hasn't returned already, we're confident that
n@1105 288 // |obj| is a plain object, created by {} or constructed with new Object
n@1105 289 return true;
n@1105 290 },
n@1105 291
n@1105 292 isEmptyObject: function( obj ) {
n@1105 293 var name;
n@1105 294 for ( name in obj ) {
n@1105 295 return false;
n@1105 296 }
n@1105 297 return true;
n@1105 298 },
n@1105 299
n@1105 300 type: function( obj ) {
n@1105 301 if ( obj == null ) {
n@1105 302 return obj + "";
n@1105 303 }
n@1105 304 // Support: Android<4.0, iOS<6 (functionish RegExp)
n@1105 305 return typeof obj === "object" || typeof obj === "function" ?
n@1105 306 class2type[ toString.call(obj) ] || "object" :
n@1105 307 typeof obj;
n@1105 308 },
n@1105 309
n@1105 310 // Evaluates a script in a global context
n@1105 311 globalEval: function( code ) {
n@1105 312 var script,
n@1105 313 indirect = eval;
n@1105 314
n@1105 315 code = jQuery.trim( code );
n@1105 316
n@1105 317 if ( code ) {
n@1105 318 // If the code includes a valid, prologue position
n@1105 319 // strict mode pragma, execute code by injecting a
n@1105 320 // script tag into the document.
n@1105 321 if ( code.indexOf("use strict") === 1 ) {
n@1105 322 script = document.createElement("script");
n@1105 323 script.text = code;
n@1105 324 document.head.appendChild( script ).parentNode.removeChild( script );
n@1105 325 } else {
n@1105 326 // Otherwise, avoid the DOM node creation, insertion
n@1105 327 // and removal by using an indirect global eval
n@1105 328 indirect( code );
n@1105 329 }
n@1105 330 }
n@1105 331 },
n@1105 332
n@1105 333 // Convert dashed to camelCase; used by the css and data modules
n@1105 334 // Support: IE9-11+
n@1105 335 // Microsoft forgot to hump their vendor prefix (#9572)
n@1105 336 camelCase: function( string ) {
n@1105 337 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
n@1105 338 },
n@1105 339
n@1105 340 nodeName: function( elem, name ) {
n@1105 341 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
n@1105 342 },
n@1105 343
n@1105 344 // args is for internal usage only
n@1105 345 each: function( obj, callback, args ) {
n@1105 346 var value,
n@1105 347 i = 0,
n@1105 348 length = obj.length,
n@1105 349 isArray = isArraylike( obj );
n@1105 350
n@1105 351 if ( args ) {
n@1105 352 if ( isArray ) {
n@1105 353 for ( ; i < length; i++ ) {
n@1105 354 value = callback.apply( obj[ i ], args );
n@1105 355
n@1105 356 if ( value === false ) {
n@1105 357 break;
n@1105 358 }
n@1105 359 }
n@1105 360 } else {
n@1105 361 for ( i in obj ) {
n@1105 362 value = callback.apply( obj[ i ], args );
n@1105 363
n@1105 364 if ( value === false ) {
n@1105 365 break;
n@1105 366 }
n@1105 367 }
n@1105 368 }
n@1105 369
n@1105 370 // A special, fast, case for the most common use of each
n@1105 371 } else {
n@1105 372 if ( isArray ) {
n@1105 373 for ( ; i < length; i++ ) {
n@1105 374 value = callback.call( obj[ i ], i, obj[ i ] );
n@1105 375
n@1105 376 if ( value === false ) {
n@1105 377 break;
n@1105 378 }
n@1105 379 }
n@1105 380 } else {
n@1105 381 for ( i in obj ) {
n@1105 382 value = callback.call( obj[ i ], i, obj[ i ] );
n@1105 383
n@1105 384 if ( value === false ) {
n@1105 385 break;
n@1105 386 }
n@1105 387 }
n@1105 388 }
n@1105 389 }
n@1105 390
n@1105 391 return obj;
n@1105 392 },
n@1105 393
n@1105 394 // Support: Android<4.1
n@1105 395 trim: function( text ) {
n@1105 396 return text == null ?
n@1105 397 "" :
n@1105 398 ( text + "" ).replace( rtrim, "" );
n@1105 399 },
n@1105 400
n@1105 401 // results is for internal usage only
n@1105 402 makeArray: function( arr, results ) {
n@1105 403 var ret = results || [];
n@1105 404
n@1105 405 if ( arr != null ) {
n@1105 406 if ( isArraylike( Object(arr) ) ) {
n@1105 407 jQuery.merge( ret,
n@1105 408 typeof arr === "string" ?
n@1105 409 [ arr ] : arr
n@1105 410 );
n@1105 411 } else {
n@1105 412 push.call( ret, arr );
n@1105 413 }
n@1105 414 }
n@1105 415
n@1105 416 return ret;
n@1105 417 },
n@1105 418
n@1105 419 inArray: function( elem, arr, i ) {
n@1105 420 return arr == null ? -1 : indexOf.call( arr, elem, i );
n@1105 421 },
n@1105 422
n@1105 423 merge: function( first, second ) {
n@1105 424 var len = +second.length,
n@1105 425 j = 0,
n@1105 426 i = first.length;
n@1105 427
n@1105 428 for ( ; j < len; j++ ) {
n@1105 429 first[ i++ ] = second[ j ];
n@1105 430 }
n@1105 431
n@1105 432 first.length = i;
n@1105 433
n@1105 434 return first;
n@1105 435 },
n@1105 436
n@1105 437 grep: function( elems, callback, invert ) {
n@1105 438 var callbackInverse,
n@1105 439 matches = [],
n@1105 440 i = 0,
n@1105 441 length = elems.length,
n@1105 442 callbackExpect = !invert;
n@1105 443
n@1105 444 // Go through the array, only saving the items
n@1105 445 // that pass the validator function
n@1105 446 for ( ; i < length; i++ ) {
n@1105 447 callbackInverse = !callback( elems[ i ], i );
n@1105 448 if ( callbackInverse !== callbackExpect ) {
n@1105 449 matches.push( elems[ i ] );
n@1105 450 }
n@1105 451 }
n@1105 452
n@1105 453 return matches;
n@1105 454 },
n@1105 455
n@1105 456 // arg is for internal usage only
n@1105 457 map: function( elems, callback, arg ) {
n@1105 458 var value,
n@1105 459 i = 0,
n@1105 460 length = elems.length,
n@1105 461 isArray = isArraylike( elems ),
n@1105 462 ret = [];
n@1105 463
n@1105 464 // Go through the array, translating each of the items to their new values
n@1105 465 if ( isArray ) {
n@1105 466 for ( ; i < length; i++ ) {
n@1105 467 value = callback( elems[ i ], i, arg );
n@1105 468
n@1105 469 if ( value != null ) {
n@1105 470 ret.push( value );
n@1105 471 }
n@1105 472 }
n@1105 473
n@1105 474 // Go through every key on the object,
n@1105 475 } else {
n@1105 476 for ( i in elems ) {
n@1105 477 value = callback( elems[ i ], i, arg );
n@1105 478
n@1105 479 if ( value != null ) {
n@1105 480 ret.push( value );
n@1105 481 }
n@1105 482 }
n@1105 483 }
n@1105 484
n@1105 485 // Flatten any nested arrays
n@1105 486 return concat.apply( [], ret );
n@1105 487 },
n@1105 488
n@1105 489 // A global GUID counter for objects
n@1105 490 guid: 1,
n@1105 491
n@1105 492 // Bind a function to a context, optionally partially applying any
n@1105 493 // arguments.
n@1105 494 proxy: function( fn, context ) {
n@1105 495 var tmp, args, proxy;
n@1105 496
n@1105 497 if ( typeof context === "string" ) {
n@1105 498 tmp = fn[ context ];
n@1105 499 context = fn;
n@1105 500 fn = tmp;
n@1105 501 }
n@1105 502
n@1105 503 // Quick check to determine if target is callable, in the spec
n@1105 504 // this throws a TypeError, but we will just return undefined.
n@1105 505 if ( !jQuery.isFunction( fn ) ) {
n@1105 506 return undefined;
n@1105 507 }
n@1105 508
n@1105 509 // Simulated bind
n@1105 510 args = slice.call( arguments, 2 );
n@1105 511 proxy = function() {
n@1105 512 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
n@1105 513 };
n@1105 514
n@1105 515 // Set the guid of unique handler to the same of original handler, so it can be removed
n@1105 516 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
n@1105 517
n@1105 518 return proxy;
n@1105 519 },
n@1105 520
n@1105 521 now: Date.now,
n@1105 522
n@1105 523 // jQuery.support is not used in Core but other projects attach their
n@1105 524 // properties to it so it needs to exist.
n@1105 525 support: support
n@1105 526 });
n@1105 527
n@1105 528 // Populate the class2type map
n@1105 529 jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
n@1105 530 class2type[ "[object " + name + "]" ] = name.toLowerCase();
n@1105 531 });
n@1105 532
n@1105 533 function isArraylike( obj ) {
n@1105 534
n@1105 535 // Support: iOS 8.2 (not reproducible in simulator)
n@1105 536 // `in` check used to prevent JIT error (gh-2145)
n@1105 537 // hasOwn isn't used here due to false negatives
n@1105 538 // regarding Nodelist length in IE
n@1105 539 var length = "length" in obj && obj.length,
n@1105 540 type = jQuery.type( obj );
n@1105 541
n@1105 542 if ( type === "function" || jQuery.isWindow( obj ) ) {
n@1105 543 return false;
n@1105 544 }
n@1105 545
n@1105 546 if ( obj.nodeType === 1 && length ) {
n@1105 547 return true;
n@1105 548 }
n@1105 549
n@1105 550 return type === "array" || length === 0 ||
n@1105 551 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
n@1105 552 }
n@1105 553 var Sizzle =
n@1105 554 /*!
n@1105 555 * Sizzle CSS Selector Engine v2.2.0-pre
n@1105 556 * http://sizzlejs.com/
n@1105 557 *
n@1105 558 * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
n@1105 559 * Released under the MIT license
n@1105 560 * http://jquery.org/license
n@1105 561 *
n@1105 562 * Date: 2014-12-16
n@1105 563 */
n@1105 564 (function( window ) {
n@1105 565
n@1105 566 var i,
n@1105 567 support,
n@1105 568 Expr,
n@1105 569 getText,
n@1105 570 isXML,
n@1105 571 tokenize,
n@1105 572 compile,
n@1105 573 select,
n@1105 574 outermostContext,
n@1105 575 sortInput,
n@1105 576 hasDuplicate,
n@1105 577
n@1105 578 // Local document vars
n@1105 579 setDocument,
n@1105 580 document,
n@1105 581 docElem,
n@1105 582 documentIsHTML,
n@1105 583 rbuggyQSA,
n@1105 584 rbuggyMatches,
n@1105 585 matches,
n@1105 586 contains,
n@1105 587
n@1105 588 // Instance-specific data
n@1105 589 expando = "sizzle" + 1 * new Date(),
n@1105 590 preferredDoc = window.document,
n@1105 591 dirruns = 0,
n@1105 592 done = 0,
n@1105 593 classCache = createCache(),
n@1105 594 tokenCache = createCache(),
n@1105 595 compilerCache = createCache(),
n@1105 596 sortOrder = function( a, b ) {
n@1105 597 if ( a === b ) {
n@1105 598 hasDuplicate = true;
n@1105 599 }
n@1105 600 return 0;
n@1105 601 },
n@1105 602
n@1105 603 // General-purpose constants
n@1105 604 MAX_NEGATIVE = 1 << 31,
n@1105 605
n@1105 606 // Instance methods
n@1105 607 hasOwn = ({}).hasOwnProperty,
n@1105 608 arr = [],
n@1105 609 pop = arr.pop,
n@1105 610 push_native = arr.push,
n@1105 611 push = arr.push,
n@1105 612 slice = arr.slice,
n@1105 613 // Use a stripped-down indexOf as it's faster than native
n@1105 614 // http://jsperf.com/thor-indexof-vs-for/5
n@1105 615 indexOf = function( list, elem ) {
n@1105 616 var i = 0,
n@1105 617 len = list.length;
n@1105 618 for ( ; i < len; i++ ) {
n@1105 619 if ( list[i] === elem ) {
n@1105 620 return i;
n@1105 621 }
n@1105 622 }
n@1105 623 return -1;
n@1105 624 },
n@1105 625
n@1105 626 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
n@1105 627
n@1105 628 // Regular expressions
n@1105 629
n@1105 630 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
n@1105 631 whitespace = "[\\x20\\t\\r\\n\\f]",
n@1105 632 // http://www.w3.org/TR/css3-syntax/#characters
n@1105 633 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
n@1105 634
n@1105 635 // Loosely modeled on CSS identifier characters
n@1105 636 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
n@1105 637 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
n@1105 638 identifier = characterEncoding.replace( "w", "w#" ),
n@1105 639
n@1105 640 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
n@1105 641 attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
n@1105 642 // Operator (capture 2)
n@1105 643 "*([*^$|!~]?=)" + whitespace +
n@1105 644 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
n@1105 645 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
n@1105 646 "*\\]",
n@1105 647
n@1105 648 pseudos = ":(" + characterEncoding + ")(?:\\((" +
n@1105 649 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
n@1105 650 // 1. quoted (capture 3; capture 4 or capture 5)
n@1105 651 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
n@1105 652 // 2. simple (capture 6)
n@1105 653 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
n@1105 654 // 3. anything else (capture 2)
n@1105 655 ".*" +
n@1105 656 ")\\)|)",
n@1105 657
n@1105 658 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
n@1105 659 rwhitespace = new RegExp( whitespace + "+", "g" ),
n@1105 660 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
n@1105 661
n@1105 662 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
n@1105 663 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
n@1105 664
n@1105 665 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
n@1105 666
n@1105 667 rpseudo = new RegExp( pseudos ),
n@1105 668 ridentifier = new RegExp( "^" + identifier + "$" ),
n@1105 669
n@1105 670 matchExpr = {
n@1105 671 "ID": new RegExp( "^#(" + characterEncoding + ")" ),
n@1105 672 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
n@1105 673 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
n@1105 674 "ATTR": new RegExp( "^" + attributes ),
n@1105 675 "PSEUDO": new RegExp( "^" + pseudos ),
n@1105 676 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
n@1105 677 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
n@1105 678 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
n@1105 679 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
n@1105 680 // For use in libraries implementing .is()
n@1105 681 // We use this for POS matching in `select`
n@1105 682 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
n@1105 683 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
n@1105 684 },
n@1105 685
n@1105 686 rinputs = /^(?:input|select|textarea|button)$/i,
n@1105 687 rheader = /^h\d$/i,
n@1105 688
n@1105 689 rnative = /^[^{]+\{\s*\[native \w/,
n@1105 690
n@1105 691 // Easily-parseable/retrievable ID or TAG or CLASS selectors
n@1105 692 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
n@1105 693
n@1105 694 rsibling = /[+~]/,
n@1105 695 rescape = /'|\\/g,
n@1105 696
n@1105 697 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
n@1105 698 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
n@1105 699 funescape = function( _, escaped, escapedWhitespace ) {
n@1105 700 var high = "0x" + escaped - 0x10000;
n@1105 701 // NaN means non-codepoint
n@1105 702 // Support: Firefox<24
n@1105 703 // Workaround erroneous numeric interpretation of +"0x"
n@1105 704 return high !== high || escapedWhitespace ?
n@1105 705 escaped :
n@1105 706 high < 0 ?
n@1105 707 // BMP codepoint
n@1105 708 String.fromCharCode( high + 0x10000 ) :
n@1105 709 // Supplemental Plane codepoint (surrogate pair)
n@1105 710 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
n@1105 711 },
n@1105 712
n@1105 713 // Used for iframes
n@1105 714 // See setDocument()
n@1105 715 // Removing the function wrapper causes a "Permission Denied"
n@1105 716 // error in IE
n@1105 717 unloadHandler = function() {
n@1105 718 setDocument();
n@1105 719 };
n@1105 720
n@1105 721 // Optimize for push.apply( _, NodeList )
n@1105 722 try {
n@1105 723 push.apply(
n@1105 724 (arr = slice.call( preferredDoc.childNodes )),
n@1105 725 preferredDoc.childNodes
n@1105 726 );
n@1105 727 // Support: Android<4.0
n@1105 728 // Detect silently failing push.apply
n@1105 729 arr[ preferredDoc.childNodes.length ].nodeType;
n@1105 730 } catch ( e ) {
n@1105 731 push = { apply: arr.length ?
n@1105 732
n@1105 733 // Leverage slice if possible
n@1105 734 function( target, els ) {
n@1105 735 push_native.apply( target, slice.call(els) );
n@1105 736 } :
n@1105 737
n@1105 738 // Support: IE<9
n@1105 739 // Otherwise append directly
n@1105 740 function( target, els ) {
n@1105 741 var j = target.length,
n@1105 742 i = 0;
n@1105 743 // Can't trust NodeList.length
n@1105 744 while ( (target[j++] = els[i++]) ) {}
n@1105 745 target.length = j - 1;
n@1105 746 }
n@1105 747 };
n@1105 748 }
n@1105 749
n@1105 750 function Sizzle( selector, context, results, seed ) {
n@1105 751 var match, elem, m, nodeType,
n@1105 752 // QSA vars
n@1105 753 i, groups, old, nid, newContext, newSelector;
n@1105 754
n@1105 755 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
n@1105 756 setDocument( context );
n@1105 757 }
n@1105 758
n@1105 759 context = context || document;
n@1105 760 results = results || [];
n@1105 761 nodeType = context.nodeType;
n@1105 762
n@1105 763 if ( typeof selector !== "string" || !selector ||
n@1105 764 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
n@1105 765
n@1105 766 return results;
n@1105 767 }
n@1105 768
n@1105 769 if ( !seed && documentIsHTML ) {
n@1105 770
n@1105 771 // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
n@1105 772 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
n@1105 773 // Speed-up: Sizzle("#ID")
n@1105 774 if ( (m = match[1]) ) {
n@1105 775 if ( nodeType === 9 ) {
n@1105 776 elem = context.getElementById( m );
n@1105 777 // Check parentNode to catch when Blackberry 4.6 returns
n@1105 778 // nodes that are no longer in the document (jQuery #6963)
n@1105 779 if ( elem && elem.parentNode ) {
n@1105 780 // Handle the case where IE, Opera, and Webkit return items
n@1105 781 // by name instead of ID
n@1105 782 if ( elem.id === m ) {
n@1105 783 results.push( elem );
n@1105 784 return results;
n@1105 785 }
n@1105 786 } else {
n@1105 787 return results;
n@1105 788 }
n@1105 789 } else {
n@1105 790 // Context is not a document
n@1105 791 if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
n@1105 792 contains( context, elem ) && elem.id === m ) {
n@1105 793 results.push( elem );
n@1105 794 return results;
n@1105 795 }
n@1105 796 }
n@1105 797
n@1105 798 // Speed-up: Sizzle("TAG")
n@1105 799 } else if ( match[2] ) {
n@1105 800 push.apply( results, context.getElementsByTagName( selector ) );
n@1105 801 return results;
n@1105 802
n@1105 803 // Speed-up: Sizzle(".CLASS")
n@1105 804 } else if ( (m = match[3]) && support.getElementsByClassName ) {
n@1105 805 push.apply( results, context.getElementsByClassName( m ) );
n@1105 806 return results;
n@1105 807 }
n@1105 808 }
n@1105 809
n@1105 810 // QSA path
n@1105 811 if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
n@1105 812 nid = old = expando;
n@1105 813 newContext = context;
n@1105 814 newSelector = nodeType !== 1 && selector;
n@1105 815
n@1105 816 // qSA works strangely on Element-rooted queries
n@1105 817 // We can work around this by specifying an extra ID on the root
n@1105 818 // and working up from there (Thanks to Andrew Dupont for the technique)
n@1105 819 // IE 8 doesn't work on object elements
n@1105 820 if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
n@1105 821 groups = tokenize( selector );
n@1105 822
n@1105 823 if ( (old = context.getAttribute("id")) ) {
n@1105 824 nid = old.replace( rescape, "\\$&" );
n@1105 825 } else {
n@1105 826 context.setAttribute( "id", nid );
n@1105 827 }
n@1105 828 nid = "[id='" + nid + "'] ";
n@1105 829
n@1105 830 i = groups.length;
n@1105 831 while ( i-- ) {
n@1105 832 groups[i] = nid + toSelector( groups[i] );
n@1105 833 }
n@1105 834 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
n@1105 835 newSelector = groups.join(",");
n@1105 836 }
n@1105 837
n@1105 838 if ( newSelector ) {
n@1105 839 try {
n@1105 840 push.apply( results,
n@1105 841 newContext.querySelectorAll( newSelector )
n@1105 842 );
n@1105 843 return results;
n@1105 844 } catch(qsaError) {
n@1105 845 } finally {
n@1105 846 if ( !old ) {
n@1105 847 context.removeAttribute("id");
n@1105 848 }
n@1105 849 }
n@1105 850 }
n@1105 851 }
n@1105 852 }
n@1105 853
n@1105 854 // All others
n@1105 855 return select( selector.replace( rtrim, "$1" ), context, results, seed );
n@1105 856 }
n@1105 857
n@1105 858 /**
n@1105 859 * Create key-value caches of limited size
n@1105 860 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
n@1105 861 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
n@1105 862 * deleting the oldest entry
n@1105 863 */
n@1105 864 function createCache() {
n@1105 865 var keys = [];
n@1105 866
n@1105 867 function cache( key, value ) {
n@1105 868 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
n@1105 869 if ( keys.push( key + " " ) > Expr.cacheLength ) {
n@1105 870 // Only keep the most recent entries
n@1105 871 delete cache[ keys.shift() ];
n@1105 872 }
n@1105 873 return (cache[ key + " " ] = value);
n@1105 874 }
n@1105 875 return cache;
n@1105 876 }
n@1105 877
n@1105 878 /**
n@1105 879 * Mark a function for special use by Sizzle
n@1105 880 * @param {Function} fn The function to mark
n@1105 881 */
n@1105 882 function markFunction( fn ) {
n@1105 883 fn[ expando ] = true;
n@1105 884 return fn;
n@1105 885 }
n@1105 886
n@1105 887 /**
n@1105 888 * Support testing using an element
n@1105 889 * @param {Function} fn Passed the created div and expects a boolean result
n@1105 890 */
n@1105 891 function assert( fn ) {
n@1105 892 var div = document.createElement("div");
n@1105 893
n@1105 894 try {
n@1105 895 return !!fn( div );
n@1105 896 } catch (e) {
n@1105 897 return false;
n@1105 898 } finally {
n@1105 899 // Remove from its parent by default
n@1105 900 if ( div.parentNode ) {
n@1105 901 div.parentNode.removeChild( div );
n@1105 902 }
n@1105 903 // release memory in IE
n@1105 904 div = null;
n@1105 905 }
n@1105 906 }
n@1105 907
n@1105 908 /**
n@1105 909 * Adds the same handler for all of the specified attrs
n@1105 910 * @param {String} attrs Pipe-separated list of attributes
n@1105 911 * @param {Function} handler The method that will be applied
n@1105 912 */
n@1105 913 function addHandle( attrs, handler ) {
n@1105 914 var arr = attrs.split("|"),
n@1105 915 i = attrs.length;
n@1105 916
n@1105 917 while ( i-- ) {
n@1105 918 Expr.attrHandle[ arr[i] ] = handler;
n@1105 919 }
n@1105 920 }
n@1105 921
n@1105 922 /**
n@1105 923 * Checks document order of two siblings
n@1105 924 * @param {Element} a
n@1105 925 * @param {Element} b
n@1105 926 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
n@1105 927 */
n@1105 928 function siblingCheck( a, b ) {
n@1105 929 var cur = b && a,
n@1105 930 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
n@1105 931 ( ~b.sourceIndex || MAX_NEGATIVE ) -
n@1105 932 ( ~a.sourceIndex || MAX_NEGATIVE );
n@1105 933
n@1105 934 // Use IE sourceIndex if available on both nodes
n@1105 935 if ( diff ) {
n@1105 936 return diff;
n@1105 937 }
n@1105 938
n@1105 939 // Check if b follows a
n@1105 940 if ( cur ) {
n@1105 941 while ( (cur = cur.nextSibling) ) {
n@1105 942 if ( cur === b ) {
n@1105 943 return -1;
n@1105 944 }
n@1105 945 }
n@1105 946 }
n@1105 947
n@1105 948 return a ? 1 : -1;
n@1105 949 }
n@1105 950
n@1105 951 /**
n@1105 952 * Returns a function to use in pseudos for input types
n@1105 953 * @param {String} type
n@1105 954 */
n@1105 955 function createInputPseudo( type ) {
n@1105 956 return function( elem ) {
n@1105 957 var name = elem.nodeName.toLowerCase();
n@1105 958 return name === "input" && elem.type === type;
n@1105 959 };
n@1105 960 }
n@1105 961
n@1105 962 /**
n@1105 963 * Returns a function to use in pseudos for buttons
n@1105 964 * @param {String} type
n@1105 965 */
n@1105 966 function createButtonPseudo( type ) {
n@1105 967 return function( elem ) {
n@1105 968 var name = elem.nodeName.toLowerCase();
n@1105 969 return (name === "input" || name === "button") && elem.type === type;
n@1105 970 };
n@1105 971 }
n@1105 972
n@1105 973 /**
n@1105 974 * Returns a function to use in pseudos for positionals
n@1105 975 * @param {Function} fn
n@1105 976 */
n@1105 977 function createPositionalPseudo( fn ) {
n@1105 978 return markFunction(function( argument ) {
n@1105 979 argument = +argument;
n@1105 980 return markFunction(function( seed, matches ) {
n@1105 981 var j,
n@1105 982 matchIndexes = fn( [], seed.length, argument ),
n@1105 983 i = matchIndexes.length;
n@1105 984
n@1105 985 // Match elements found at the specified indexes
n@1105 986 while ( i-- ) {
n@1105 987 if ( seed[ (j = matchIndexes[i]) ] ) {
n@1105 988 seed[j] = !(matches[j] = seed[j]);
n@1105 989 }
n@1105 990 }
n@1105 991 });
n@1105 992 });
n@1105 993 }
n@1105 994
n@1105 995 /**
n@1105 996 * Checks a node for validity as a Sizzle context
n@1105 997 * @param {Element|Object=} context
n@1105 998 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
n@1105 999 */
n@1105 1000 function testContext( context ) {
n@1105 1001 return context && typeof context.getElementsByTagName !== "undefined" && context;
n@1105 1002 }
n@1105 1003
n@1105 1004 // Expose support vars for convenience
n@1105 1005 support = Sizzle.support = {};
n@1105 1006
n@1105 1007 /**
n@1105 1008 * Detects XML nodes
n@1105 1009 * @param {Element|Object} elem An element or a document
n@1105 1010 * @returns {Boolean} True iff elem is a non-HTML XML node
n@1105 1011 */
n@1105 1012 isXML = Sizzle.isXML = function( elem ) {
n@1105 1013 // documentElement is verified for cases where it doesn't yet exist
n@1105 1014 // (such as loading iframes in IE - #4833)
n@1105 1015 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
n@1105 1016 return documentElement ? documentElement.nodeName !== "HTML" : false;
n@1105 1017 };
n@1105 1018
n@1105 1019 /**
n@1105 1020 * Sets document-related variables once based on the current document
n@1105 1021 * @param {Element|Object} [doc] An element or document object to use to set the document
n@1105 1022 * @returns {Object} Returns the current document
n@1105 1023 */
n@1105 1024 setDocument = Sizzle.setDocument = function( node ) {
n@1105 1025 var hasCompare, parent,
n@1105 1026 doc = node ? node.ownerDocument || node : preferredDoc;
n@1105 1027
n@1105 1028 // If no document and documentElement is available, return
n@1105 1029 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
n@1105 1030 return document;
n@1105 1031 }
n@1105 1032
n@1105 1033 // Set our document
n@1105 1034 document = doc;
n@1105 1035 docElem = doc.documentElement;
n@1105 1036 parent = doc.defaultView;
n@1105 1037
n@1105 1038 // Support: IE>8
n@1105 1039 // If iframe document is assigned to "document" variable and if iframe has been reloaded,
n@1105 1040 // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
n@1105 1041 // IE6-8 do not support the defaultView property so parent will be undefined
n@1105 1042 if ( parent && parent !== parent.top ) {
n@1105 1043 // IE11 does not have attachEvent, so all must suffer
n@1105 1044 if ( parent.addEventListener ) {
n@1105 1045 parent.addEventListener( "unload", unloadHandler, false );
n@1105 1046 } else if ( parent.attachEvent ) {
n@1105 1047 parent.attachEvent( "onunload", unloadHandler );
n@1105 1048 }
n@1105 1049 }
n@1105 1050
n@1105 1051 /* Support tests
n@1105 1052 ---------------------------------------------------------------------- */
n@1105 1053 documentIsHTML = !isXML( doc );
n@1105 1054
n@1105 1055 /* Attributes
n@1105 1056 ---------------------------------------------------------------------- */
n@1105 1057
n@1105 1058 // Support: IE<8
n@1105 1059 // Verify that getAttribute really returns attributes and not properties
n@1105 1060 // (excepting IE8 booleans)
n@1105 1061 support.attributes = assert(function( div ) {
n@1105 1062 div.className = "i";
n@1105 1063 return !div.getAttribute("className");
n@1105 1064 });
n@1105 1065
n@1105 1066 /* getElement(s)By*
n@1105 1067 ---------------------------------------------------------------------- */
n@1105 1068
n@1105 1069 // Check if getElementsByTagName("*") returns only elements
n@1105 1070 support.getElementsByTagName = assert(function( div ) {
n@1105 1071 div.appendChild( doc.createComment("") );
n@1105 1072 return !div.getElementsByTagName("*").length;
n@1105 1073 });
n@1105 1074
n@1105 1075 // Support: IE<9
n@1105 1076 support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
n@1105 1077
n@1105 1078 // Support: IE<10
n@1105 1079 // Check if getElementById returns elements by name
n@1105 1080 // The broken getElementById methods don't pick up programatically-set names,
n@1105 1081 // so use a roundabout getElementsByName test
n@1105 1082 support.getById = assert(function( div ) {
n@1105 1083 docElem.appendChild( div ).id = expando;
n@1105 1084 return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
n@1105 1085 });
n@1105 1086
n@1105 1087 // ID find and filter
n@1105 1088 if ( support.getById ) {
n@1105 1089 Expr.find["ID"] = function( id, context ) {
n@1105 1090 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
n@1105 1091 var m = context.getElementById( id );
n@1105 1092 // Check parentNode to catch when Blackberry 4.6 returns
n@1105 1093 // nodes that are no longer in the document #6963
n@1105 1094 return m && m.parentNode ? [ m ] : [];
n@1105 1095 }
n@1105 1096 };
n@1105 1097 Expr.filter["ID"] = function( id ) {
n@1105 1098 var attrId = id.replace( runescape, funescape );
n@1105 1099 return function( elem ) {
n@1105 1100 return elem.getAttribute("id") === attrId;
n@1105 1101 };
n@1105 1102 };
n@1105 1103 } else {
n@1105 1104 // Support: IE6/7
n@1105 1105 // getElementById is not reliable as a find shortcut
n@1105 1106 delete Expr.find["ID"];
n@1105 1107
n@1105 1108 Expr.filter["ID"] = function( id ) {
n@1105 1109 var attrId = id.replace( runescape, funescape );
n@1105 1110 return function( elem ) {
n@1105 1111 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
n@1105 1112 return node && node.value === attrId;
n@1105 1113 };
n@1105 1114 };
n@1105 1115 }
n@1105 1116
n@1105 1117 // Tag
n@1105 1118 Expr.find["TAG"] = support.getElementsByTagName ?
n@1105 1119 function( tag, context ) {
n@1105 1120 if ( typeof context.getElementsByTagName !== "undefined" ) {
n@1105 1121 return context.getElementsByTagName( tag );
n@1105 1122
n@1105 1123 // DocumentFragment nodes don't have gEBTN
n@1105 1124 } else if ( support.qsa ) {
n@1105 1125 return context.querySelectorAll( tag );
n@1105 1126 }
n@1105 1127 } :
n@1105 1128
n@1105 1129 function( tag, context ) {
n@1105 1130 var elem,
n@1105 1131 tmp = [],
n@1105 1132 i = 0,
n@1105 1133 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
n@1105 1134 results = context.getElementsByTagName( tag );
n@1105 1135
n@1105 1136 // Filter out possible comments
n@1105 1137 if ( tag === "*" ) {
n@1105 1138 while ( (elem = results[i++]) ) {
n@1105 1139 if ( elem.nodeType === 1 ) {
n@1105 1140 tmp.push( elem );
n@1105 1141 }
n@1105 1142 }
n@1105 1143
n@1105 1144 return tmp;
n@1105 1145 }
n@1105 1146 return results;
n@1105 1147 };
n@1105 1148
n@1105 1149 // Class
n@1105 1150 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
n@1105 1151 if ( documentIsHTML ) {
n@1105 1152 return context.getElementsByClassName( className );
n@1105 1153 }
n@1105 1154 };
n@1105 1155
n@1105 1156 /* QSA/matchesSelector
n@1105 1157 ---------------------------------------------------------------------- */
n@1105 1158
n@1105 1159 // QSA and matchesSelector support
n@1105 1160
n@1105 1161 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
n@1105 1162 rbuggyMatches = [];
n@1105 1163
n@1105 1164 // qSa(:focus) reports false when true (Chrome 21)
n@1105 1165 // We allow this because of a bug in IE8/9 that throws an error
n@1105 1166 // whenever `document.activeElement` is accessed on an iframe
n@1105 1167 // So, we allow :focus to pass through QSA all the time to avoid the IE error
n@1105 1168 // See http://bugs.jquery.com/ticket/13378
n@1105 1169 rbuggyQSA = [];
n@1105 1170
n@1105 1171 if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
n@1105 1172 // Build QSA regex
n@1105 1173 // Regex strategy adopted from Diego Perini
n@1105 1174 assert(function( div ) {
n@1105 1175 // Select is set to empty string on purpose
n@1105 1176 // This is to test IE's treatment of not explicitly
n@1105 1177 // setting a boolean content attribute,
n@1105 1178 // since its presence should be enough
n@1105 1179 // http://bugs.jquery.com/ticket/12359
n@1105 1180 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
n@1105 1181 "<select id='" + expando + "-\f]' msallowcapture=''>" +
n@1105 1182 "<option selected=''></option></select>";
n@1105 1183
n@1105 1184 // Support: IE8, Opera 11-12.16
n@1105 1185 // Nothing should be selected when empty strings follow ^= or $= or *=
n@1105 1186 // The test attribute must be unknown in Opera but "safe" for WinRT
n@1105 1187 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
n@1105 1188 if ( div.querySelectorAll("[msallowcapture^='']").length ) {
n@1105 1189 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
n@1105 1190 }
n@1105 1191
n@1105 1192 // Support: IE8
n@1105 1193 // Boolean attributes and "value" are not treated correctly
n@1105 1194 if ( !div.querySelectorAll("[selected]").length ) {
n@1105 1195 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
n@1105 1196 }
n@1105 1197
n@1105 1198 // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
n@1105 1199 if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
n@1105 1200 rbuggyQSA.push("~=");
n@1105 1201 }
n@1105 1202
n@1105 1203 // Webkit/Opera - :checked should return selected option elements
n@1105 1204 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
n@1105 1205 // IE8 throws error here and will not see later tests
n@1105 1206 if ( !div.querySelectorAll(":checked").length ) {
n@1105 1207 rbuggyQSA.push(":checked");
n@1105 1208 }
n@1105 1209
n@1105 1210 // Support: Safari 8+, iOS 8+
n@1105 1211 // https://bugs.webkit.org/show_bug.cgi?id=136851
n@1105 1212 // In-page `selector#id sibing-combinator selector` fails
n@1105 1213 if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
n@1105 1214 rbuggyQSA.push(".#.+[+~]");
n@1105 1215 }
n@1105 1216 });
n@1105 1217
n@1105 1218 assert(function( div ) {
n@1105 1219 // Support: Windows 8 Native Apps
n@1105 1220 // The type and name attributes are restricted during .innerHTML assignment
n@1105 1221 var input = doc.createElement("input");
n@1105 1222 input.setAttribute( "type", "hidden" );
n@1105 1223 div.appendChild( input ).setAttribute( "name", "D" );
n@1105 1224
n@1105 1225 // Support: IE8
n@1105 1226 // Enforce case-sensitivity of name attribute
n@1105 1227 if ( div.querySelectorAll("[name=d]").length ) {
n@1105 1228 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
n@1105 1229 }
n@1105 1230
n@1105 1231 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
n@1105 1232 // IE8 throws error here and will not see later tests
n@1105 1233 if ( !div.querySelectorAll(":enabled").length ) {
n@1105 1234 rbuggyQSA.push( ":enabled", ":disabled" );
n@1105 1235 }
n@1105 1236
n@1105 1237 // Opera 10-11 does not throw on post-comma invalid pseudos
n@1105 1238 div.querySelectorAll("*,:x");
n@1105 1239 rbuggyQSA.push(",.*:");
n@1105 1240 });
n@1105 1241 }
n@1105 1242
n@1105 1243 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
n@1105 1244 docElem.webkitMatchesSelector ||
n@1105 1245 docElem.mozMatchesSelector ||
n@1105 1246 docElem.oMatchesSelector ||
n@1105 1247 docElem.msMatchesSelector) )) ) {
n@1105 1248
n@1105 1249 assert(function( div ) {
n@1105 1250 // Check to see if it's possible to do matchesSelector
n@1105 1251 // on a disconnected node (IE 9)
n@1105 1252 support.disconnectedMatch = matches.call( div, "div" );
n@1105 1253
n@1105 1254 // This should fail with an exception
n@1105 1255 // Gecko does not error, returns false instead
n@1105 1256 matches.call( div, "[s!='']:x" );
n@1105 1257 rbuggyMatches.push( "!=", pseudos );
n@1105 1258 });
n@1105 1259 }
n@1105 1260
n@1105 1261 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
n@1105 1262 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
n@1105 1263
n@1105 1264 /* Contains
n@1105 1265 ---------------------------------------------------------------------- */
n@1105 1266 hasCompare = rnative.test( docElem.compareDocumentPosition );
n@1105 1267
n@1105 1268 // Element contains another
n@1105 1269 // Purposefully does not implement inclusive descendent
n@1105 1270 // As in, an element does not contain itself
n@1105 1271 contains = hasCompare || rnative.test( docElem.contains ) ?
n@1105 1272 function( a, b ) {
n@1105 1273 var adown = a.nodeType === 9 ? a.documentElement : a,
n@1105 1274 bup = b && b.parentNode;
n@1105 1275 return a === bup || !!( bup && bup.nodeType === 1 && (
n@1105 1276 adown.contains ?
n@1105 1277 adown.contains( bup ) :
n@1105 1278 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
n@1105 1279 ));
n@1105 1280 } :
n@1105 1281 function( a, b ) {
n@1105 1282 if ( b ) {
n@1105 1283 while ( (b = b.parentNode) ) {
n@1105 1284 if ( b === a ) {
n@1105 1285 return true;
n@1105 1286 }
n@1105 1287 }
n@1105 1288 }
n@1105 1289 return false;
n@1105 1290 };
n@1105 1291
n@1105 1292 /* Sorting
n@1105 1293 ---------------------------------------------------------------------- */
n@1105 1294
n@1105 1295 // Document order sorting
n@1105 1296 sortOrder = hasCompare ?
n@1105 1297 function( a, b ) {
n@1105 1298
n@1105 1299 // Flag for duplicate removal
n@1105 1300 if ( a === b ) {
n@1105 1301 hasDuplicate = true;
n@1105 1302 return 0;
n@1105 1303 }
n@1105 1304
n@1105 1305 // Sort on method existence if only one input has compareDocumentPosition
n@1105 1306 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
n@1105 1307 if ( compare ) {
n@1105 1308 return compare;
n@1105 1309 }
n@1105 1310
n@1105 1311 // Calculate position if both inputs belong to the same document
n@1105 1312 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
n@1105 1313 a.compareDocumentPosition( b ) :
n@1105 1314
n@1105 1315 // Otherwise we know they are disconnected
n@1105 1316 1;
n@1105 1317
n@1105 1318 // Disconnected nodes
n@1105 1319 if ( compare & 1 ||
n@1105 1320 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
n@1105 1321
n@1105 1322 // Choose the first element that is related to our preferred document
n@1105 1323 if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
n@1105 1324 return -1;
n@1105 1325 }
n@1105 1326 if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
n@1105 1327 return 1;
n@1105 1328 }
n@1105 1329
n@1105 1330 // Maintain original order
n@1105 1331 return sortInput ?
n@1105 1332 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
n@1105 1333 0;
n@1105 1334 }
n@1105 1335
n@1105 1336 return compare & 4 ? -1 : 1;
n@1105 1337 } :
n@1105 1338 function( a, b ) {
n@1105 1339 // Exit early if the nodes are identical
n@1105 1340 if ( a === b ) {
n@1105 1341 hasDuplicate = true;
n@1105 1342 return 0;
n@1105 1343 }
n@1105 1344
n@1105 1345 var cur,
n@1105 1346 i = 0,
n@1105 1347 aup = a.parentNode,
n@1105 1348 bup = b.parentNode,
n@1105 1349 ap = [ a ],
n@1105 1350 bp = [ b ];
n@1105 1351
n@1105 1352 // Parentless nodes are either documents or disconnected
n@1105 1353 if ( !aup || !bup ) {
n@1105 1354 return a === doc ? -1 :
n@1105 1355 b === doc ? 1 :
n@1105 1356 aup ? -1 :
n@1105 1357 bup ? 1 :
n@1105 1358 sortInput ?
n@1105 1359 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
n@1105 1360 0;
n@1105 1361
n@1105 1362 // If the nodes are siblings, we can do a quick check
n@1105 1363 } else if ( aup === bup ) {
n@1105 1364 return siblingCheck( a, b );
n@1105 1365 }
n@1105 1366
n@1105 1367 // Otherwise we need full lists of their ancestors for comparison
n@1105 1368 cur = a;
n@1105 1369 while ( (cur = cur.parentNode) ) {
n@1105 1370 ap.unshift( cur );
n@1105 1371 }
n@1105 1372 cur = b;
n@1105 1373 while ( (cur = cur.parentNode) ) {
n@1105 1374 bp.unshift( cur );
n@1105 1375 }
n@1105 1376
n@1105 1377 // Walk down the tree looking for a discrepancy
n@1105 1378 while ( ap[i] === bp[i] ) {
n@1105 1379 i++;
n@1105 1380 }
n@1105 1381
n@1105 1382 return i ?
n@1105 1383 // Do a sibling check if the nodes have a common ancestor
n@1105 1384 siblingCheck( ap[i], bp[i] ) :
n@1105 1385
n@1105 1386 // Otherwise nodes in our document sort first
n@1105 1387 ap[i] === preferredDoc ? -1 :
n@1105 1388 bp[i] === preferredDoc ? 1 :
n@1105 1389 0;
n@1105 1390 };
n@1105 1391
n@1105 1392 return doc;
n@1105 1393 };
n@1105 1394
n@1105 1395 Sizzle.matches = function( expr, elements ) {
n@1105 1396 return Sizzle( expr, null, null, elements );
n@1105 1397 };
n@1105 1398
n@1105 1399 Sizzle.matchesSelector = function( elem, expr ) {
n@1105 1400 // Set document vars if needed
n@1105 1401 if ( ( elem.ownerDocument || elem ) !== document ) {
n@1105 1402 setDocument( elem );
n@1105 1403 }
n@1105 1404
n@1105 1405 // Make sure that attribute selectors are quoted
n@1105 1406 expr = expr.replace( rattributeQuotes, "='$1']" );
n@1105 1407
n@1105 1408 if ( support.matchesSelector && documentIsHTML &&
n@1105 1409 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
n@1105 1410 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
n@1105 1411
n@1105 1412 try {
n@1105 1413 var ret = matches.call( elem, expr );
n@1105 1414
n@1105 1415 // IE 9's matchesSelector returns false on disconnected nodes
n@1105 1416 if ( ret || support.disconnectedMatch ||
n@1105 1417 // As well, disconnected nodes are said to be in a document
n@1105 1418 // fragment in IE 9
n@1105 1419 elem.document && elem.document.nodeType !== 11 ) {
n@1105 1420 return ret;
n@1105 1421 }
n@1105 1422 } catch (e) {}
n@1105 1423 }
n@1105 1424
n@1105 1425 return Sizzle( expr, document, null, [ elem ] ).length > 0;
n@1105 1426 };
n@1105 1427
n@1105 1428 Sizzle.contains = function( context, elem ) {
n@1105 1429 // Set document vars if needed
n@1105 1430 if ( ( context.ownerDocument || context ) !== document ) {
n@1105 1431 setDocument( context );
n@1105 1432 }
n@1105 1433 return contains( context, elem );
n@1105 1434 };
n@1105 1435
n@1105 1436 Sizzle.attr = function( elem, name ) {
n@1105 1437 // Set document vars if needed
n@1105 1438 if ( ( elem.ownerDocument || elem ) !== document ) {
n@1105 1439 setDocument( elem );
n@1105 1440 }
n@1105 1441
n@1105 1442 var fn = Expr.attrHandle[ name.toLowerCase() ],
n@1105 1443 // Don't get fooled by Object.prototype properties (jQuery #13807)
n@1105 1444 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
n@1105 1445 fn( elem, name, !documentIsHTML ) :
n@1105 1446 undefined;
n@1105 1447
n@1105 1448 return val !== undefined ?
n@1105 1449 val :
n@1105 1450 support.attributes || !documentIsHTML ?
n@1105 1451 elem.getAttribute( name ) :
n@1105 1452 (val = elem.getAttributeNode(name)) && val.specified ?
n@1105 1453 val.value :
n@1105 1454 null;
n@1105 1455 };
n@1105 1456
n@1105 1457 Sizzle.error = function( msg ) {
n@1105 1458 throw new Error( "Syntax error, unrecognized expression: " + msg );
n@1105 1459 };
n@1105 1460
n@1105 1461 /**
n@1105 1462 * Document sorting and removing duplicates
n@1105 1463 * @param {ArrayLike} results
n@1105 1464 */
n@1105 1465 Sizzle.uniqueSort = function( results ) {
n@1105 1466 var elem,
n@1105 1467 duplicates = [],
n@1105 1468 j = 0,
n@1105 1469 i = 0;
n@1105 1470
n@1105 1471 // Unless we *know* we can detect duplicates, assume their presence
n@1105 1472 hasDuplicate = !support.detectDuplicates;
n@1105 1473 sortInput = !support.sortStable && results.slice( 0 );
n@1105 1474 results.sort( sortOrder );
n@1105 1475
n@1105 1476 if ( hasDuplicate ) {
n@1105 1477 while ( (elem = results[i++]) ) {
n@1105 1478 if ( elem === results[ i ] ) {
n@1105 1479 j = duplicates.push( i );
n@1105 1480 }
n@1105 1481 }
n@1105 1482 while ( j-- ) {
n@1105 1483 results.splice( duplicates[ j ], 1 );
n@1105 1484 }
n@1105 1485 }
n@1105 1486
n@1105 1487 // Clear input after sorting to release objects
n@1105 1488 // See https://github.com/jquery/sizzle/pull/225
n@1105 1489 sortInput = null;
n@1105 1490
n@1105 1491 return results;
n@1105 1492 };
n@1105 1493
n@1105 1494 /**
n@1105 1495 * Utility function for retrieving the text value of an array of DOM nodes
n@1105 1496 * @param {Array|Element} elem
n@1105 1497 */
n@1105 1498 getText = Sizzle.getText = function( elem ) {
n@1105 1499 var node,
n@1105 1500 ret = "",
n@1105 1501 i = 0,
n@1105 1502 nodeType = elem.nodeType;
n@1105 1503
n@1105 1504 if ( !nodeType ) {
n@1105 1505 // If no nodeType, this is expected to be an array
n@1105 1506 while ( (node = elem[i++]) ) {
n@1105 1507 // Do not traverse comment nodes
n@1105 1508 ret += getText( node );
n@1105 1509 }
n@1105 1510 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
n@1105 1511 // Use textContent for elements
n@1105 1512 // innerText usage removed for consistency of new lines (jQuery #11153)
n@1105 1513 if ( typeof elem.textContent === "string" ) {
n@1105 1514 return elem.textContent;
n@1105 1515 } else {
n@1105 1516 // Traverse its children
n@1105 1517 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
n@1105 1518 ret += getText( elem );
n@1105 1519 }
n@1105 1520 }
n@1105 1521 } else if ( nodeType === 3 || nodeType === 4 ) {
n@1105 1522 return elem.nodeValue;
n@1105 1523 }
n@1105 1524 // Do not include comment or processing instruction nodes
n@1105 1525
n@1105 1526 return ret;
n@1105 1527 };
n@1105 1528
n@1105 1529 Expr = Sizzle.selectors = {
n@1105 1530
n@1105 1531 // Can be adjusted by the user
n@1105 1532 cacheLength: 50,
n@1105 1533
n@1105 1534 createPseudo: markFunction,
n@1105 1535
n@1105 1536 match: matchExpr,
n@1105 1537
n@1105 1538 attrHandle: {},
n@1105 1539
n@1105 1540 find: {},
n@1105 1541
n@1105 1542 relative: {
n@1105 1543 ">": { dir: "parentNode", first: true },
n@1105 1544 " ": { dir: "parentNode" },
n@1105 1545 "+": { dir: "previousSibling", first: true },
n@1105 1546 "~": { dir: "previousSibling" }
n@1105 1547 },
n@1105 1548
n@1105 1549 preFilter: {
n@1105 1550 "ATTR": function( match ) {
n@1105 1551 match[1] = match[1].replace( runescape, funescape );
n@1105 1552
n@1105 1553 // Move the given value to match[3] whether quoted or unquoted
n@1105 1554 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
n@1105 1555
n@1105 1556 if ( match[2] === "~=" ) {
n@1105 1557 match[3] = " " + match[3] + " ";
n@1105 1558 }
n@1105 1559
n@1105 1560 return match.slice( 0, 4 );
n@1105 1561 },
n@1105 1562
n@1105 1563 "CHILD": function( match ) {
n@1105 1564 /* matches from matchExpr["CHILD"]
n@1105 1565 1 type (only|nth|...)
n@1105 1566 2 what (child|of-type)
n@1105 1567 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
n@1105 1568 4 xn-component of xn+y argument ([+-]?\d*n|)
n@1105 1569 5 sign of xn-component
n@1105 1570 6 x of xn-component
n@1105 1571 7 sign of y-component
n@1105 1572 8 y of y-component
n@1105 1573 */
n@1105 1574 match[1] = match[1].toLowerCase();
n@1105 1575
n@1105 1576 if ( match[1].slice( 0, 3 ) === "nth" ) {
n@1105 1577 // nth-* requires argument
n@1105 1578 if ( !match[3] ) {
n@1105 1579 Sizzle.error( match[0] );
n@1105 1580 }
n@1105 1581
n@1105 1582 // numeric x and y parameters for Expr.filter.CHILD
n@1105 1583 // remember that false/true cast respectively to 0/1
n@1105 1584 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
n@1105 1585 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
n@1105 1586
n@1105 1587 // other types prohibit arguments
n@1105 1588 } else if ( match[3] ) {
n@1105 1589 Sizzle.error( match[0] );
n@1105 1590 }
n@1105 1591
n@1105 1592 return match;
n@1105 1593 },
n@1105 1594
n@1105 1595 "PSEUDO": function( match ) {
n@1105 1596 var excess,
n@1105 1597 unquoted = !match[6] && match[2];
n@1105 1598
n@1105 1599 if ( matchExpr["CHILD"].test( match[0] ) ) {
n@1105 1600 return null;
n@1105 1601 }
n@1105 1602
n@1105 1603 // Accept quoted arguments as-is
n@1105 1604 if ( match[3] ) {
n@1105 1605 match[2] = match[4] || match[5] || "";
n@1105 1606
n@1105 1607 // Strip excess characters from unquoted arguments
n@1105 1608 } else if ( unquoted && rpseudo.test( unquoted ) &&
n@1105 1609 // Get excess from tokenize (recursively)
n@1105 1610 (excess = tokenize( unquoted, true )) &&
n@1105 1611 // advance to the next closing parenthesis
n@1105 1612 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
n@1105 1613
n@1105 1614 // excess is a negative index
n@1105 1615 match[0] = match[0].slice( 0, excess );
n@1105 1616 match[2] = unquoted.slice( 0, excess );
n@1105 1617 }
n@1105 1618
n@1105 1619 // Return only captures needed by the pseudo filter method (type and argument)
n@1105 1620 return match.slice( 0, 3 );
n@1105 1621 }
n@1105 1622 },
n@1105 1623
n@1105 1624 filter: {
n@1105 1625
n@1105 1626 "TAG": function( nodeNameSelector ) {
n@1105 1627 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
n@1105 1628 return nodeNameSelector === "*" ?
n@1105 1629 function() { return true; } :
n@1105 1630 function( elem ) {
n@1105 1631 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
n@1105 1632 };
n@1105 1633 },
n@1105 1634
n@1105 1635 "CLASS": function( className ) {
n@1105 1636 var pattern = classCache[ className + " " ];
n@1105 1637
n@1105 1638 return pattern ||
n@1105 1639 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
n@1105 1640 classCache( className, function( elem ) {
n@1105 1641 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
n@1105 1642 });
n@1105 1643 },
n@1105 1644
n@1105 1645 "ATTR": function( name, operator, check ) {
n@1105 1646 return function( elem ) {
n@1105 1647 var result = Sizzle.attr( elem, name );
n@1105 1648
n@1105 1649 if ( result == null ) {
n@1105 1650 return operator === "!=";
n@1105 1651 }
n@1105 1652 if ( !operator ) {
n@1105 1653 return true;
n@1105 1654 }
n@1105 1655
n@1105 1656 result += "";
n@1105 1657
n@1105 1658 return operator === "=" ? result === check :
n@1105 1659 operator === "!=" ? result !== check :
n@1105 1660 operator === "^=" ? check && result.indexOf( check ) === 0 :
n@1105 1661 operator === "*=" ? check && result.indexOf( check ) > -1 :
n@1105 1662 operator === "$=" ? check && result.slice( -check.length ) === check :
n@1105 1663 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
n@1105 1664 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
n@1105 1665 false;
n@1105 1666 };
n@1105 1667 },
n@1105 1668
n@1105 1669 "CHILD": function( type, what, argument, first, last ) {
n@1105 1670 var simple = type.slice( 0, 3 ) !== "nth",
n@1105 1671 forward = type.slice( -4 ) !== "last",
n@1105 1672 ofType = what === "of-type";
n@1105 1673
n@1105 1674 return first === 1 && last === 0 ?
n@1105 1675
n@1105 1676 // Shortcut for :nth-*(n)
n@1105 1677 function( elem ) {
n@1105 1678 return !!elem.parentNode;
n@1105 1679 } :
n@1105 1680
n@1105 1681 function( elem, context, xml ) {
n@1105 1682 var cache, outerCache, node, diff, nodeIndex, start,
n@1105 1683 dir = simple !== forward ? "nextSibling" : "previousSibling",
n@1105 1684 parent = elem.parentNode,
n@1105 1685 name = ofType && elem.nodeName.toLowerCase(),
n@1105 1686 useCache = !xml && !ofType;
n@1105 1687
n@1105 1688 if ( parent ) {
n@1105 1689
n@1105 1690 // :(first|last|only)-(child|of-type)
n@1105 1691 if ( simple ) {
n@1105 1692 while ( dir ) {
n@1105 1693 node = elem;
n@1105 1694 while ( (node = node[ dir ]) ) {
n@1105 1695 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
n@1105 1696 return false;
n@1105 1697 }
n@1105 1698 }
n@1105 1699 // Reverse direction for :only-* (if we haven't yet done so)
n@1105 1700 start = dir = type === "only" && !start && "nextSibling";
n@1105 1701 }
n@1105 1702 return true;
n@1105 1703 }
n@1105 1704
n@1105 1705 start = [ forward ? parent.firstChild : parent.lastChild ];
n@1105 1706
n@1105 1707 // non-xml :nth-child(...) stores cache data on `parent`
n@1105 1708 if ( forward && useCache ) {
n@1105 1709 // Seek `elem` from a previously-cached index
n@1105 1710 outerCache = parent[ expando ] || (parent[ expando ] = {});
n@1105 1711 cache = outerCache[ type ] || [];
n@1105 1712 nodeIndex = cache[0] === dirruns && cache[1];
n@1105 1713 diff = cache[0] === dirruns && cache[2];
n@1105 1714 node = nodeIndex && parent.childNodes[ nodeIndex ];
n@1105 1715
n@1105 1716 while ( (node = ++nodeIndex && node && node[ dir ] ||
n@1105 1717
n@1105 1718 // Fallback to seeking `elem` from the start
n@1105 1719 (diff = nodeIndex = 0) || start.pop()) ) {
n@1105 1720
n@1105 1721 // When found, cache indexes on `parent` and break
n@1105 1722 if ( node.nodeType === 1 && ++diff && node === elem ) {
n@1105 1723 outerCache[ type ] = [ dirruns, nodeIndex, diff ];
n@1105 1724 break;
n@1105 1725 }
n@1105 1726 }
n@1105 1727
n@1105 1728 // Use previously-cached element index if available
n@1105 1729 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
n@1105 1730 diff = cache[1];
n@1105 1731
n@1105 1732 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
n@1105 1733 } else {
n@1105 1734 // Use the same loop as above to seek `elem` from the start
n@1105 1735 while ( (node = ++nodeIndex && node && node[ dir ] ||
n@1105 1736 (diff = nodeIndex = 0) || start.pop()) ) {
n@1105 1737
n@1105 1738 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
n@1105 1739 // Cache the index of each encountered element
n@1105 1740 if ( useCache ) {
n@1105 1741 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
n@1105 1742 }
n@1105 1743
n@1105 1744 if ( node === elem ) {
n@1105 1745 break;
n@1105 1746 }
n@1105 1747 }
n@1105 1748 }
n@1105 1749 }
n@1105 1750
n@1105 1751 // Incorporate the offset, then check against cycle size
n@1105 1752 diff -= last;
n@1105 1753 return diff === first || ( diff % first === 0 && diff / first >= 0 );
n@1105 1754 }
n@1105 1755 };
n@1105 1756 },
n@1105 1757
n@1105 1758 "PSEUDO": function( pseudo, argument ) {
n@1105 1759 // pseudo-class names are case-insensitive
n@1105 1760 // http://www.w3.org/TR/selectors/#pseudo-classes
n@1105 1761 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
n@1105 1762 // Remember that setFilters inherits from pseudos
n@1105 1763 var args,
n@1105 1764 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
n@1105 1765 Sizzle.error( "unsupported pseudo: " + pseudo );
n@1105 1766
n@1105 1767 // The user may use createPseudo to indicate that
n@1105 1768 // arguments are needed to create the filter function
n@1105 1769 // just as Sizzle does
n@1105 1770 if ( fn[ expando ] ) {
n@1105 1771 return fn( argument );
n@1105 1772 }
n@1105 1773
n@1105 1774 // But maintain support for old signatures
n@1105 1775 if ( fn.length > 1 ) {
n@1105 1776 args = [ pseudo, pseudo, "", argument ];
n@1105 1777 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
n@1105 1778 markFunction(function( seed, matches ) {
n@1105 1779 var idx,
n@1105 1780 matched = fn( seed, argument ),
n@1105 1781 i = matched.length;
n@1105 1782 while ( i-- ) {
n@1105 1783 idx = indexOf( seed, matched[i] );
n@1105 1784 seed[ idx ] = !( matches[ idx ] = matched[i] );
n@1105 1785 }
n@1105 1786 }) :
n@1105 1787 function( elem ) {
n@1105 1788 return fn( elem, 0, args );
n@1105 1789 };
n@1105 1790 }
n@1105 1791
n@1105 1792 return fn;
n@1105 1793 }
n@1105 1794 },
n@1105 1795
n@1105 1796 pseudos: {
n@1105 1797 // Potentially complex pseudos
n@1105 1798 "not": markFunction(function( selector ) {
n@1105 1799 // Trim the selector passed to compile
n@1105 1800 // to avoid treating leading and trailing
n@1105 1801 // spaces as combinators
n@1105 1802 var input = [],
n@1105 1803 results = [],
n@1105 1804 matcher = compile( selector.replace( rtrim, "$1" ) );
n@1105 1805
n@1105 1806 return matcher[ expando ] ?
n@1105 1807 markFunction(function( seed, matches, context, xml ) {
n@1105 1808 var elem,
n@1105 1809 unmatched = matcher( seed, null, xml, [] ),
n@1105 1810 i = seed.length;
n@1105 1811
n@1105 1812 // Match elements unmatched by `matcher`
n@1105 1813 while ( i-- ) {
n@1105 1814 if ( (elem = unmatched[i]) ) {
n@1105 1815 seed[i] = !(matches[i] = elem);
n@1105 1816 }
n@1105 1817 }
n@1105 1818 }) :
n@1105 1819 function( elem, context, xml ) {
n@1105 1820 input[0] = elem;
n@1105 1821 matcher( input, null, xml, results );
n@1105 1822 // Don't keep the element (issue #299)
n@1105 1823 input[0] = null;
n@1105 1824 return !results.pop();
n@1105 1825 };
n@1105 1826 }),
n@1105 1827
n@1105 1828 "has": markFunction(function( selector ) {
n@1105 1829 return function( elem ) {
n@1105 1830 return Sizzle( selector, elem ).length > 0;
n@1105 1831 };
n@1105 1832 }),
n@1105 1833
n@1105 1834 "contains": markFunction(function( text ) {
n@1105 1835 text = text.replace( runescape, funescape );
n@1105 1836 return function( elem ) {
n@1105 1837 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
n@1105 1838 };
n@1105 1839 }),
n@1105 1840
n@1105 1841 // "Whether an element is represented by a :lang() selector
n@1105 1842 // is based solely on the element's language value
n@1105 1843 // being equal to the identifier C,
n@1105 1844 // or beginning with the identifier C immediately followed by "-".
n@1105 1845 // The matching of C against the element's language value is performed case-insensitively.
n@1105 1846 // The identifier C does not have to be a valid language name."
n@1105 1847 // http://www.w3.org/TR/selectors/#lang-pseudo
n@1105 1848 "lang": markFunction( function( lang ) {
n@1105 1849 // lang value must be a valid identifier
n@1105 1850 if ( !ridentifier.test(lang || "") ) {
n@1105 1851 Sizzle.error( "unsupported lang: " + lang );
n@1105 1852 }
n@1105 1853 lang = lang.replace( runescape, funescape ).toLowerCase();
n@1105 1854 return function( elem ) {
n@1105 1855 var elemLang;
n@1105 1856 do {
n@1105 1857 if ( (elemLang = documentIsHTML ?
n@1105 1858 elem.lang :
n@1105 1859 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
n@1105 1860
n@1105 1861 elemLang = elemLang.toLowerCase();
n@1105 1862 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
n@1105 1863 }
n@1105 1864 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
n@1105 1865 return false;
n@1105 1866 };
n@1105 1867 }),
n@1105 1868
n@1105 1869 // Miscellaneous
n@1105 1870 "target": function( elem ) {
n@1105 1871 var hash = window.location && window.location.hash;
n@1105 1872 return hash && hash.slice( 1 ) === elem.id;
n@1105 1873 },
n@1105 1874
n@1105 1875 "root": function( elem ) {
n@1105 1876 return elem === docElem;
n@1105 1877 },
n@1105 1878
n@1105 1879 "focus": function( elem ) {
n@1105 1880 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
n@1105 1881 },
n@1105 1882
n@1105 1883 // Boolean properties
n@1105 1884 "enabled": function( elem ) {
n@1105 1885 return elem.disabled === false;
n@1105 1886 },
n@1105 1887
n@1105 1888 "disabled": function( elem ) {
n@1105 1889 return elem.disabled === true;
n@1105 1890 },
n@1105 1891
n@1105 1892 "checked": function( elem ) {
n@1105 1893 // In CSS3, :checked should return both checked and selected elements
n@1105 1894 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
n@1105 1895 var nodeName = elem.nodeName.toLowerCase();
n@1105 1896 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
n@1105 1897 },
n@1105 1898
n@1105 1899 "selected": function( elem ) {
n@1105 1900 // Accessing this property makes selected-by-default
n@1105 1901 // options in Safari work properly
n@1105 1902 if ( elem.parentNode ) {
n@1105 1903 elem.parentNode.selectedIndex;
n@1105 1904 }
n@1105 1905
n@1105 1906 return elem.selected === true;
n@1105 1907 },
n@1105 1908
n@1105 1909 // Contents
n@1105 1910 "empty": function( elem ) {
n@1105 1911 // http://www.w3.org/TR/selectors/#empty-pseudo
n@1105 1912 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
n@1105 1913 // but not by others (comment: 8; processing instruction: 7; etc.)
n@1105 1914 // nodeType < 6 works because attributes (2) do not appear as children
n@1105 1915 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
n@1105 1916 if ( elem.nodeType < 6 ) {
n@1105 1917 return false;
n@1105 1918 }
n@1105 1919 }
n@1105 1920 return true;
n@1105 1921 },
n@1105 1922
n@1105 1923 "parent": function( elem ) {
n@1105 1924 return !Expr.pseudos["empty"]( elem );
n@1105 1925 },
n@1105 1926
n@1105 1927 // Element/input types
n@1105 1928 "header": function( elem ) {
n@1105 1929 return rheader.test( elem.nodeName );
n@1105 1930 },
n@1105 1931
n@1105 1932 "input": function( elem ) {
n@1105 1933 return rinputs.test( elem.nodeName );
n@1105 1934 },
n@1105 1935
n@1105 1936 "button": function( elem ) {
n@1105 1937 var name = elem.nodeName.toLowerCase();
n@1105 1938 return name === "input" && elem.type === "button" || name === "button";
n@1105 1939 },
n@1105 1940
n@1105 1941 "text": function( elem ) {
n@1105 1942 var attr;
n@1105 1943 return elem.nodeName.toLowerCase() === "input" &&
n@1105 1944 elem.type === "text" &&
n@1105 1945
n@1105 1946 // Support: IE<8
n@1105 1947 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
n@1105 1948 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
n@1105 1949 },
n@1105 1950
n@1105 1951 // Position-in-collection
n@1105 1952 "first": createPositionalPseudo(function() {
n@1105 1953 return [ 0 ];
n@1105 1954 }),
n@1105 1955
n@1105 1956 "last": createPositionalPseudo(function( matchIndexes, length ) {
n@1105 1957 return [ length - 1 ];
n@1105 1958 }),
n@1105 1959
n@1105 1960 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
n@1105 1961 return [ argument < 0 ? argument + length : argument ];
n@1105 1962 }),
n@1105 1963
n@1105 1964 "even": createPositionalPseudo(function( matchIndexes, length ) {
n@1105 1965 var i = 0;
n@1105 1966 for ( ; i < length; i += 2 ) {
n@1105 1967 matchIndexes.push( i );
n@1105 1968 }
n@1105 1969 return matchIndexes;
n@1105 1970 }),
n@1105 1971
n@1105 1972 "odd": createPositionalPseudo(function( matchIndexes, length ) {
n@1105 1973 var i = 1;
n@1105 1974 for ( ; i < length; i += 2 ) {
n@1105 1975 matchIndexes.push( i );
n@1105 1976 }
n@1105 1977 return matchIndexes;
n@1105 1978 }),
n@1105 1979
n@1105 1980 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
n@1105 1981 var i = argument < 0 ? argument + length : argument;
n@1105 1982 for ( ; --i >= 0; ) {
n@1105 1983 matchIndexes.push( i );
n@1105 1984 }
n@1105 1985 return matchIndexes;
n@1105 1986 }),
n@1105 1987
n@1105 1988 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
n@1105 1989 var i = argument < 0 ? argument + length : argument;
n@1105 1990 for ( ; ++i < length; ) {
n@1105 1991 matchIndexes.push( i );
n@1105 1992 }
n@1105 1993 return matchIndexes;
n@1105 1994 })
n@1105 1995 }
n@1105 1996 };
n@1105 1997
n@1105 1998 Expr.pseudos["nth"] = Expr.pseudos["eq"];
n@1105 1999
n@1105 2000 // Add button/input type pseudos
n@1105 2001 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
n@1105 2002 Expr.pseudos[ i ] = createInputPseudo( i );
n@1105 2003 }
n@1105 2004 for ( i in { submit: true, reset: true } ) {
n@1105 2005 Expr.pseudos[ i ] = createButtonPseudo( i );
n@1105 2006 }
n@1105 2007
n@1105 2008 // Easy API for creating new setFilters
n@1105 2009 function setFilters() {}
n@1105 2010 setFilters.prototype = Expr.filters = Expr.pseudos;
n@1105 2011 Expr.setFilters = new setFilters();
n@1105 2012
n@1105 2013 tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
n@1105 2014 var matched, match, tokens, type,
n@1105 2015 soFar, groups, preFilters,
n@1105 2016 cached = tokenCache[ selector + " " ];
n@1105 2017
n@1105 2018 if ( cached ) {
n@1105 2019 return parseOnly ? 0 : cached.slice( 0 );
n@1105 2020 }
n@1105 2021
n@1105 2022 soFar = selector;
n@1105 2023 groups = [];
n@1105 2024 preFilters = Expr.preFilter;
n@1105 2025
n@1105 2026 while ( soFar ) {
n@1105 2027
n@1105 2028 // Comma and first run
n@1105 2029 if ( !matched || (match = rcomma.exec( soFar )) ) {
n@1105 2030 if ( match ) {
n@1105 2031 // Don't consume trailing commas as valid
n@1105 2032 soFar = soFar.slice( match[0].length ) || soFar;
n@1105 2033 }
n@1105 2034 groups.push( (tokens = []) );
n@1105 2035 }
n@1105 2036
n@1105 2037 matched = false;
n@1105 2038
n@1105 2039 // Combinators
n@1105 2040 if ( (match = rcombinators.exec( soFar )) ) {
n@1105 2041 matched = match.shift();
n@1105 2042 tokens.push({
n@1105 2043 value: matched,
n@1105 2044 // Cast descendant combinators to space
n@1105 2045 type: match[0].replace( rtrim, " " )
n@1105 2046 });
n@1105 2047 soFar = soFar.slice( matched.length );
n@1105 2048 }
n@1105 2049
n@1105 2050 // Filters
n@1105 2051 for ( type in Expr.filter ) {
n@1105 2052 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
n@1105 2053 (match = preFilters[ type ]( match ))) ) {
n@1105 2054 matched = match.shift();
n@1105 2055 tokens.push({
n@1105 2056 value: matched,
n@1105 2057 type: type,
n@1105 2058 matches: match
n@1105 2059 });
n@1105 2060 soFar = soFar.slice( matched.length );
n@1105 2061 }
n@1105 2062 }
n@1105 2063
n@1105 2064 if ( !matched ) {
n@1105 2065 break;
n@1105 2066 }
n@1105 2067 }
n@1105 2068
n@1105 2069 // Return the length of the invalid excess
n@1105 2070 // if we're just parsing
n@1105 2071 // Otherwise, throw an error or return tokens
n@1105 2072 return parseOnly ?
n@1105 2073 soFar.length :
n@1105 2074 soFar ?
n@1105 2075 Sizzle.error( selector ) :
n@1105 2076 // Cache the tokens
n@1105 2077 tokenCache( selector, groups ).slice( 0 );
n@1105 2078 };
n@1105 2079
n@1105 2080 function toSelector( tokens ) {
n@1105 2081 var i = 0,
n@1105 2082 len = tokens.length,
n@1105 2083 selector = "";
n@1105 2084 for ( ; i < len; i++ ) {
n@1105 2085 selector += tokens[i].value;
n@1105 2086 }
n@1105 2087 return selector;
n@1105 2088 }
n@1105 2089
n@1105 2090 function addCombinator( matcher, combinator, base ) {
n@1105 2091 var dir = combinator.dir,
n@1105 2092 checkNonElements = base && dir === "parentNode",
n@1105 2093 doneName = done++;
n@1105 2094
n@1105 2095 return combinator.first ?
n@1105 2096 // Check against closest ancestor/preceding element
n@1105 2097 function( elem, context, xml ) {
n@1105 2098 while ( (elem = elem[ dir ]) ) {
n@1105 2099 if ( elem.nodeType === 1 || checkNonElements ) {
n@1105 2100 return matcher( elem, context, xml );
n@1105 2101 }
n@1105 2102 }
n@1105 2103 } :
n@1105 2104
n@1105 2105 // Check against all ancestor/preceding elements
n@1105 2106 function( elem, context, xml ) {
n@1105 2107 var oldCache, outerCache,
n@1105 2108 newCache = [ dirruns, doneName ];
n@1105 2109
n@1105 2110 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
n@1105 2111 if ( xml ) {
n@1105 2112 while ( (elem = elem[ dir ]) ) {
n@1105 2113 if ( elem.nodeType === 1 || checkNonElements ) {
n@1105 2114 if ( matcher( elem, context, xml ) ) {
n@1105 2115 return true;
n@1105 2116 }
n@1105 2117 }
n@1105 2118 }
n@1105 2119 } else {
n@1105 2120 while ( (elem = elem[ dir ]) ) {
n@1105 2121 if ( elem.nodeType === 1 || checkNonElements ) {
n@1105 2122 outerCache = elem[ expando ] || (elem[ expando ] = {});
n@1105 2123 if ( (oldCache = outerCache[ dir ]) &&
n@1105 2124 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
n@1105 2125
n@1105 2126 // Assign to newCache so results back-propagate to previous elements
n@1105 2127 return (newCache[ 2 ] = oldCache[ 2 ]);
n@1105 2128 } else {
n@1105 2129 // Reuse newcache so results back-propagate to previous elements
n@1105 2130 outerCache[ dir ] = newCache;
n@1105 2131
n@1105 2132 // A match means we're done; a fail means we have to keep checking
n@1105 2133 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
n@1105 2134 return true;
n@1105 2135 }
n@1105 2136 }
n@1105 2137 }
n@1105 2138 }
n@1105 2139 }
n@1105 2140 };
n@1105 2141 }
n@1105 2142
n@1105 2143 function elementMatcher( matchers ) {
n@1105 2144 return matchers.length > 1 ?
n@1105 2145 function( elem, context, xml ) {
n@1105 2146 var i = matchers.length;
n@1105 2147 while ( i-- ) {
n@1105 2148 if ( !matchers[i]( elem, context, xml ) ) {
n@1105 2149 return false;
n@1105 2150 }
n@1105 2151 }
n@1105 2152 return true;
n@1105 2153 } :
n@1105 2154 matchers[0];
n@1105 2155 }
n@1105 2156
n@1105 2157 function multipleContexts( selector, contexts, results ) {
n@1105 2158 var i = 0,
n@1105 2159 len = contexts.length;
n@1105 2160 for ( ; i < len; i++ ) {
n@1105 2161 Sizzle( selector, contexts[i], results );
n@1105 2162 }
n@1105 2163 return results;
n@1105 2164 }
n@1105 2165
n@1105 2166 function condense( unmatched, map, filter, context, xml ) {
n@1105 2167 var elem,
n@1105 2168 newUnmatched = [],
n@1105 2169 i = 0,
n@1105 2170 len = unmatched.length,
n@1105 2171 mapped = map != null;
n@1105 2172
n@1105 2173 for ( ; i < len; i++ ) {
n@1105 2174 if ( (elem = unmatched[i]) ) {
n@1105 2175 if ( !filter || filter( elem, context, xml ) ) {
n@1105 2176 newUnmatched.push( elem );
n@1105 2177 if ( mapped ) {
n@1105 2178 map.push( i );
n@1105 2179 }
n@1105 2180 }
n@1105 2181 }
n@1105 2182 }
n@1105 2183
n@1105 2184 return newUnmatched;
n@1105 2185 }
n@1105 2186
n@1105 2187 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
n@1105 2188 if ( postFilter && !postFilter[ expando ] ) {
n@1105 2189 postFilter = setMatcher( postFilter );
n@1105 2190 }
n@1105 2191 if ( postFinder && !postFinder[ expando ] ) {
n@1105 2192 postFinder = setMatcher( postFinder, postSelector );
n@1105 2193 }
n@1105 2194 return markFunction(function( seed, results, context, xml ) {
n@1105 2195 var temp, i, elem,
n@1105 2196 preMap = [],
n@1105 2197 postMap = [],
n@1105 2198 preexisting = results.length,
n@1105 2199
n@1105 2200 // Get initial elements from seed or context
n@1105 2201 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
n@1105 2202
n@1105 2203 // Prefilter to get matcher input, preserving a map for seed-results synchronization
n@1105 2204 matcherIn = preFilter && ( seed || !selector ) ?
n@1105 2205 condense( elems, preMap, preFilter, context, xml ) :
n@1105 2206 elems,
n@1105 2207
n@1105 2208 matcherOut = matcher ?
n@1105 2209 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
n@1105 2210 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
n@1105 2211
n@1105 2212 // ...intermediate processing is necessary
n@1105 2213 [] :
n@1105 2214
n@1105 2215 // ...otherwise use results directly
n@1105 2216 results :
n@1105 2217 matcherIn;
n@1105 2218
n@1105 2219 // Find primary matches
n@1105 2220 if ( matcher ) {
n@1105 2221 matcher( matcherIn, matcherOut, context, xml );
n@1105 2222 }
n@1105 2223
n@1105 2224 // Apply postFilter
n@1105 2225 if ( postFilter ) {
n@1105 2226 temp = condense( matcherOut, postMap );
n@1105 2227 postFilter( temp, [], context, xml );
n@1105 2228
n@1105 2229 // Un-match failing elements by moving them back to matcherIn
n@1105 2230 i = temp.length;
n@1105 2231 while ( i-- ) {
n@1105 2232 if ( (elem = temp[i]) ) {
n@1105 2233 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
n@1105 2234 }
n@1105 2235 }
n@1105 2236 }
n@1105 2237
n@1105 2238 if ( seed ) {
n@1105 2239 if ( postFinder || preFilter ) {
n@1105 2240 if ( postFinder ) {
n@1105 2241 // Get the final matcherOut by condensing this intermediate into postFinder contexts
n@1105 2242 temp = [];
n@1105 2243 i = matcherOut.length;
n@1105 2244 while ( i-- ) {
n@1105 2245 if ( (elem = matcherOut[i]) ) {
n@1105 2246 // Restore matcherIn since elem is not yet a final match
n@1105 2247 temp.push( (matcherIn[i] = elem) );
n@1105 2248 }
n@1105 2249 }
n@1105 2250 postFinder( null, (matcherOut = []), temp, xml );
n@1105 2251 }
n@1105 2252
n@1105 2253 // Move matched elements from seed to results to keep them synchronized
n@1105 2254 i = matcherOut.length;
n@1105 2255 while ( i-- ) {
n@1105 2256 if ( (elem = matcherOut[i]) &&
n@1105 2257 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
n@1105 2258
n@1105 2259 seed[temp] = !(results[temp] = elem);
n@1105 2260 }
n@1105 2261 }
n@1105 2262 }
n@1105 2263
n@1105 2264 // Add elements to results, through postFinder if defined
n@1105 2265 } else {
n@1105 2266 matcherOut = condense(
n@1105 2267 matcherOut === results ?
n@1105 2268 matcherOut.splice( preexisting, matcherOut.length ) :
n@1105 2269 matcherOut
n@1105 2270 );
n@1105 2271 if ( postFinder ) {
n@1105 2272 postFinder( null, results, matcherOut, xml );
n@1105 2273 } else {
n@1105 2274 push.apply( results, matcherOut );
n@1105 2275 }
n@1105 2276 }
n@1105 2277 });
n@1105 2278 }
n@1105 2279
n@1105 2280 function matcherFromTokens( tokens ) {
n@1105 2281 var checkContext, matcher, j,
n@1105 2282 len = tokens.length,
n@1105 2283 leadingRelative = Expr.relative[ tokens[0].type ],
n@1105 2284 implicitRelative = leadingRelative || Expr.relative[" "],
n@1105 2285 i = leadingRelative ? 1 : 0,
n@1105 2286
n@1105 2287 // The foundational matcher ensures that elements are reachable from top-level context(s)
n@1105 2288 matchContext = addCombinator( function( elem ) {
n@1105 2289 return elem === checkContext;
n@1105 2290 }, implicitRelative, true ),
n@1105 2291 matchAnyContext = addCombinator( function( elem ) {
n@1105 2292 return indexOf( checkContext, elem ) > -1;
n@1105 2293 }, implicitRelative, true ),
n@1105 2294 matchers = [ function( elem, context, xml ) {
n@1105 2295 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
n@1105 2296 (checkContext = context).nodeType ?
n@1105 2297 matchContext( elem, context, xml ) :
n@1105 2298 matchAnyContext( elem, context, xml ) );
n@1105 2299 // Avoid hanging onto element (issue #299)
n@1105 2300 checkContext = null;
n@1105 2301 return ret;
n@1105 2302 } ];
n@1105 2303
n@1105 2304 for ( ; i < len; i++ ) {
n@1105 2305 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
n@1105 2306 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
n@1105 2307 } else {
n@1105 2308 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
n@1105 2309
n@1105 2310 // Return special upon seeing a positional matcher
n@1105 2311 if ( matcher[ expando ] ) {
n@1105 2312 // Find the next relative operator (if any) for proper handling
n@1105 2313 j = ++i;
n@1105 2314 for ( ; j < len; j++ ) {
n@1105 2315 if ( Expr.relative[ tokens[j].type ] ) {
n@1105 2316 break;
n@1105 2317 }
n@1105 2318 }
n@1105 2319 return setMatcher(
n@1105 2320 i > 1 && elementMatcher( matchers ),
n@1105 2321 i > 1 && toSelector(
n@1105 2322 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
n@1105 2323 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
n@1105 2324 ).replace( rtrim, "$1" ),
n@1105 2325 matcher,
n@1105 2326 i < j && matcherFromTokens( tokens.slice( i, j ) ),
n@1105 2327 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
n@1105 2328 j < len && toSelector( tokens )
n@1105 2329 );
n@1105 2330 }
n@1105 2331 matchers.push( matcher );
n@1105 2332 }
n@1105 2333 }
n@1105 2334
n@1105 2335 return elementMatcher( matchers );
n@1105 2336 }
n@1105 2337
n@1105 2338 function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
n@1105 2339 var bySet = setMatchers.length > 0,
n@1105 2340 byElement = elementMatchers.length > 0,
n@1105 2341 superMatcher = function( seed, context, xml, results, outermost ) {
n@1105 2342 var elem, j, matcher,
n@1105 2343 matchedCount = 0,
n@1105 2344 i = "0",
n@1105 2345 unmatched = seed && [],
n@1105 2346 setMatched = [],
n@1105 2347 contextBackup = outermostContext,
n@1105 2348 // We must always have either seed elements or outermost context
n@1105 2349 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
n@1105 2350 // Use integer dirruns iff this is the outermost matcher
n@1105 2351 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
n@1105 2352 len = elems.length;
n@1105 2353
n@1105 2354 if ( outermost ) {
n@1105 2355 outermostContext = context !== document && context;
n@1105 2356 }
n@1105 2357
n@1105 2358 // Add elements passing elementMatchers directly to results
n@1105 2359 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
n@1105 2360 // Support: IE<9, Safari
n@1105 2361 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
n@1105 2362 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
n@1105 2363 if ( byElement && elem ) {
n@1105 2364 j = 0;
n@1105 2365 while ( (matcher = elementMatchers[j++]) ) {
n@1105 2366 if ( matcher( elem, context, xml ) ) {
n@1105 2367 results.push( elem );
n@1105 2368 break;
n@1105 2369 }
n@1105 2370 }
n@1105 2371 if ( outermost ) {
n@1105 2372 dirruns = dirrunsUnique;
n@1105 2373 }
n@1105 2374 }
n@1105 2375
n@1105 2376 // Track unmatched elements for set filters
n@1105 2377 if ( bySet ) {
n@1105 2378 // They will have gone through all possible matchers
n@1105 2379 if ( (elem = !matcher && elem) ) {
n@1105 2380 matchedCount--;
n@1105 2381 }
n@1105 2382
n@1105 2383 // Lengthen the array for every element, matched or not
n@1105 2384 if ( seed ) {
n@1105 2385 unmatched.push( elem );
n@1105 2386 }
n@1105 2387 }
n@1105 2388 }
n@1105 2389
n@1105 2390 // Apply set filters to unmatched elements
n@1105 2391 matchedCount += i;
n@1105 2392 if ( bySet && i !== matchedCount ) {
n@1105 2393 j = 0;
n@1105 2394 while ( (matcher = setMatchers[j++]) ) {
n@1105 2395 matcher( unmatched, setMatched, context, xml );
n@1105 2396 }
n@1105 2397
n@1105 2398 if ( seed ) {
n@1105 2399 // Reintegrate element matches to eliminate the need for sorting
n@1105 2400 if ( matchedCount > 0 ) {
n@1105 2401 while ( i-- ) {
n@1105 2402 if ( !(unmatched[i] || setMatched[i]) ) {
n@1105 2403 setMatched[i] = pop.call( results );
n@1105 2404 }
n@1105 2405 }
n@1105 2406 }
n@1105 2407
n@1105 2408 // Discard index placeholder values to get only actual matches
n@1105 2409 setMatched = condense( setMatched );
n@1105 2410 }
n@1105 2411
n@1105 2412 // Add matches to results
n@1105 2413 push.apply( results, setMatched );
n@1105 2414
n@1105 2415 // Seedless set matches succeeding multiple successful matchers stipulate sorting
n@1105 2416 if ( outermost && !seed && setMatched.length > 0 &&
n@1105 2417 ( matchedCount + setMatchers.length ) > 1 ) {
n@1105 2418
n@1105 2419 Sizzle.uniqueSort( results );
n@1105 2420 }
n@1105 2421 }
n@1105 2422
n@1105 2423 // Override manipulation of globals by nested matchers
n@1105 2424 if ( outermost ) {
n@1105 2425 dirruns = dirrunsUnique;
n@1105 2426 outermostContext = contextBackup;
n@1105 2427 }
n@1105 2428
n@1105 2429 return unmatched;
n@1105 2430 };
n@1105 2431
n@1105 2432 return bySet ?
n@1105 2433 markFunction( superMatcher ) :
n@1105 2434 superMatcher;
n@1105 2435 }
n@1105 2436
n@1105 2437 compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
n@1105 2438 var i,
n@1105 2439 setMatchers = [],
n@1105 2440 elementMatchers = [],
n@1105 2441 cached = compilerCache[ selector + " " ];
n@1105 2442
n@1105 2443 if ( !cached ) {
n@1105 2444 // Generate a function of recursive functions that can be used to check each element
n@1105 2445 if ( !match ) {
n@1105 2446 match = tokenize( selector );
n@1105 2447 }
n@1105 2448 i = match.length;
n@1105 2449 while ( i-- ) {
n@1105 2450 cached = matcherFromTokens( match[i] );
n@1105 2451 if ( cached[ expando ] ) {
n@1105 2452 setMatchers.push( cached );
n@1105 2453 } else {
n@1105 2454 elementMatchers.push( cached );
n@1105 2455 }
n@1105 2456 }
n@1105 2457
n@1105 2458 // Cache the compiled function
n@1105 2459 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
n@1105 2460
n@1105 2461 // Save selector and tokenization
n@1105 2462 cached.selector = selector;
n@1105 2463 }
n@1105 2464 return cached;
n@1105 2465 };
n@1105 2466
n@1105 2467 /**
n@1105 2468 * A low-level selection function that works with Sizzle's compiled
n@1105 2469 * selector functions
n@1105 2470 * @param {String|Function} selector A selector or a pre-compiled
n@1105 2471 * selector function built with Sizzle.compile
n@1105 2472 * @param {Element} context
n@1105 2473 * @param {Array} [results]
n@1105 2474 * @param {Array} [seed] A set of elements to match against
n@1105 2475 */
n@1105 2476 select = Sizzle.select = function( selector, context, results, seed ) {
n@1105 2477 var i, tokens, token, type, find,
n@1105 2478 compiled = typeof selector === "function" && selector,
n@1105 2479 match = !seed && tokenize( (selector = compiled.selector || selector) );
n@1105 2480
n@1105 2481 results = results || [];
n@1105 2482
n@1105 2483 // Try to minimize operations if there is no seed and only one group
n@1105 2484 if ( match.length === 1 ) {
n@1105 2485
n@1105 2486 // Take a shortcut and set the context if the root selector is an ID
n@1105 2487 tokens = match[0] = match[0].slice( 0 );
n@1105 2488 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
n@1105 2489 support.getById && context.nodeType === 9 && documentIsHTML &&
n@1105 2490 Expr.relative[ tokens[1].type ] ) {
n@1105 2491
n@1105 2492 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
n@1105 2493 if ( !context ) {
n@1105 2494 return results;
n@1105 2495
n@1105 2496 // Precompiled matchers will still verify ancestry, so step up a level
n@1105 2497 } else if ( compiled ) {
n@1105 2498 context = context.parentNode;
n@1105 2499 }
n@1105 2500
n@1105 2501 selector = selector.slice( tokens.shift().value.length );
n@1105 2502 }
n@1105 2503
n@1105 2504 // Fetch a seed set for right-to-left matching
n@1105 2505 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
n@1105 2506 while ( i-- ) {
n@1105 2507 token = tokens[i];
n@1105 2508
n@1105 2509 // Abort if we hit a combinator
n@1105 2510 if ( Expr.relative[ (type = token.type) ] ) {
n@1105 2511 break;
n@1105 2512 }
n@1105 2513 if ( (find = Expr.find[ type ]) ) {
n@1105 2514 // Search, expanding context for leading sibling combinators
n@1105 2515 if ( (seed = find(
n@1105 2516 token.matches[0].replace( runescape, funescape ),
n@1105 2517 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
n@1105 2518 )) ) {
n@1105 2519
n@1105 2520 // If seed is empty or no tokens remain, we can return early
n@1105 2521 tokens.splice( i, 1 );
n@1105 2522 selector = seed.length && toSelector( tokens );
n@1105 2523 if ( !selector ) {
n@1105 2524 push.apply( results, seed );
n@1105 2525 return results;
n@1105 2526 }
n@1105 2527
n@1105 2528 break;
n@1105 2529 }
n@1105 2530 }
n@1105 2531 }
n@1105 2532 }
n@1105 2533
n@1105 2534 // Compile and execute a filtering function if one is not provided
n@1105 2535 // Provide `match` to avoid retokenization if we modified the selector above
n@1105 2536 ( compiled || compile( selector, match ) )(
n@1105 2537 seed,
n@1105 2538 context,
n@1105 2539 !documentIsHTML,
n@1105 2540 results,
n@1105 2541 rsibling.test( selector ) && testContext( context.parentNode ) || context
n@1105 2542 );
n@1105 2543 return results;
n@1105 2544 };
n@1105 2545
n@1105 2546 // One-time assignments
n@1105 2547
n@1105 2548 // Sort stability
n@1105 2549 support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
n@1105 2550
n@1105 2551 // Support: Chrome 14-35+
n@1105 2552 // Always assume duplicates if they aren't passed to the comparison function
n@1105 2553 support.detectDuplicates = !!hasDuplicate;
n@1105 2554
n@1105 2555 // Initialize against the default document
n@1105 2556 setDocument();
n@1105 2557
n@1105 2558 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
n@1105 2559 // Detached nodes confoundingly follow *each other*
n@1105 2560 support.sortDetached = assert(function( div1 ) {
n@1105 2561 // Should return 1, but returns 4 (following)
n@1105 2562 return div1.compareDocumentPosition( document.createElement("div") ) & 1;
n@1105 2563 });
n@1105 2564
n@1105 2565 // Support: IE<8
n@1105 2566 // Prevent attribute/property "interpolation"
n@1105 2567 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
n@1105 2568 if ( !assert(function( div ) {
n@1105 2569 div.innerHTML = "<a href='#'></a>";
n@1105 2570 return div.firstChild.getAttribute("href") === "#" ;
n@1105 2571 }) ) {
n@1105 2572 addHandle( "type|href|height|width", function( elem, name, isXML ) {
n@1105 2573 if ( !isXML ) {
n@1105 2574 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
n@1105 2575 }
n@1105 2576 });
n@1105 2577 }
n@1105 2578
n@1105 2579 // Support: IE<9
n@1105 2580 // Use defaultValue in place of getAttribute("value")
n@1105 2581 if ( !support.attributes || !assert(function( div ) {
n@1105 2582 div.innerHTML = "<input/>";
n@1105 2583 div.firstChild.setAttribute( "value", "" );
n@1105 2584 return div.firstChild.getAttribute( "value" ) === "";
n@1105 2585 }) ) {
n@1105 2586 addHandle( "value", function( elem, name, isXML ) {
n@1105 2587 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
n@1105 2588 return elem.defaultValue;
n@1105 2589 }
n@1105 2590 });
n@1105 2591 }
n@1105 2592
n@1105 2593 // Support: IE<9
n@1105 2594 // Use getAttributeNode to fetch booleans when getAttribute lies
n@1105 2595 if ( !assert(function( div ) {
n@1105 2596 return div.getAttribute("disabled") == null;
n@1105 2597 }) ) {
n@1105 2598 addHandle( booleans, function( elem, name, isXML ) {
n@1105 2599 var val;
n@1105 2600 if ( !isXML ) {
n@1105 2601 return elem[ name ] === true ? name.toLowerCase() :
n@1105 2602 (val = elem.getAttributeNode( name )) && val.specified ?
n@1105 2603 val.value :
n@1105 2604 null;
n@1105 2605 }
n@1105 2606 });
n@1105 2607 }
n@1105 2608
n@1105 2609 return Sizzle;
n@1105 2610
n@1105 2611 })( window );
n@1105 2612
n@1105 2613
n@1105 2614
n@1105 2615 jQuery.find = Sizzle;
n@1105 2616 jQuery.expr = Sizzle.selectors;
n@1105 2617 jQuery.expr[":"] = jQuery.expr.pseudos;
n@1105 2618 jQuery.unique = Sizzle.uniqueSort;
n@1105 2619 jQuery.text = Sizzle.getText;
n@1105 2620 jQuery.isXMLDoc = Sizzle.isXML;
n@1105 2621 jQuery.contains = Sizzle.contains;
n@1105 2622
n@1105 2623
n@1105 2624
n@1105 2625 var rneedsContext = jQuery.expr.match.needsContext;
n@1105 2626
n@1105 2627 var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
n@1105 2628
n@1105 2629
n@1105 2630
n@1105 2631 var risSimple = /^.[^:#\[\.,]*$/;
n@1105 2632
n@1105 2633 // Implement the identical functionality for filter and not
n@1105 2634 function winnow( elements, qualifier, not ) {
n@1105 2635 if ( jQuery.isFunction( qualifier ) ) {
n@1105 2636 return jQuery.grep( elements, function( elem, i ) {
n@1105 2637 /* jshint -W018 */
n@1105 2638 return !!qualifier.call( elem, i, elem ) !== not;
n@1105 2639 });
n@1105 2640
n@1105 2641 }
n@1105 2642
n@1105 2643 if ( qualifier.nodeType ) {
n@1105 2644 return jQuery.grep( elements, function( elem ) {
n@1105 2645 return ( elem === qualifier ) !== not;
n@1105 2646 });
n@1105 2647
n@1105 2648 }
n@1105 2649
n@1105 2650 if ( typeof qualifier === "string" ) {
n@1105 2651 if ( risSimple.test( qualifier ) ) {
n@1105 2652 return jQuery.filter( qualifier, elements, not );
n@1105 2653 }
n@1105 2654
n@1105 2655 qualifier = jQuery.filter( qualifier, elements );
n@1105 2656 }
n@1105 2657
n@1105 2658 return jQuery.grep( elements, function( elem ) {
n@1105 2659 return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
n@1105 2660 });
n@1105 2661 }
n@1105 2662
n@1105 2663 jQuery.filter = function( expr, elems, not ) {
n@1105 2664 var elem = elems[ 0 ];
n@1105 2665
n@1105 2666 if ( not ) {
n@1105 2667 expr = ":not(" + expr + ")";
n@1105 2668 }
n@1105 2669
n@1105 2670 return elems.length === 1 && elem.nodeType === 1 ?
n@1105 2671 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
n@1105 2672 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
n@1105 2673 return elem.nodeType === 1;
n@1105 2674 }));
n@1105 2675 };
n@1105 2676
n@1105 2677 jQuery.fn.extend({
n@1105 2678 find: function( selector ) {
n@1105 2679 var i,
n@1105 2680 len = this.length,
n@1105 2681 ret = [],
n@1105 2682 self = this;
n@1105 2683
n@1105 2684 if ( typeof selector !== "string" ) {
n@1105 2685 return this.pushStack( jQuery( selector ).filter(function() {
n@1105 2686 for ( i = 0; i < len; i++ ) {
n@1105 2687 if ( jQuery.contains( self[ i ], this ) ) {
n@1105 2688 return true;
n@1105 2689 }
n@1105 2690 }
n@1105 2691 }) );
n@1105 2692 }
n@1105 2693
n@1105 2694 for ( i = 0; i < len; i++ ) {
n@1105 2695 jQuery.find( selector, self[ i ], ret );
n@1105 2696 }
n@1105 2697
n@1105 2698 // Needed because $( selector, context ) becomes $( context ).find( selector )
n@1105 2699 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
n@1105 2700 ret.selector = this.selector ? this.selector + " " + selector : selector;
n@1105 2701 return ret;
n@1105 2702 },
n@1105 2703 filter: function( selector ) {
n@1105 2704 return this.pushStack( winnow(this, selector || [], false) );
n@1105 2705 },
n@1105 2706 not: function( selector ) {
n@1105 2707 return this.pushStack( winnow(this, selector || [], true) );
n@1105 2708 },
n@1105 2709 is: function( selector ) {
n@1105 2710 return !!winnow(
n@1105 2711 this,
n@1105 2712
n@1105 2713 // If this is a positional/relative selector, check membership in the returned set
n@1105 2714 // so $("p:first").is("p:last") won't return true for a doc with two "p".
n@1105 2715 typeof selector === "string" && rneedsContext.test( selector ) ?
n@1105 2716 jQuery( selector ) :
n@1105 2717 selector || [],
n@1105 2718 false
n@1105 2719 ).length;
n@1105 2720 }
n@1105 2721 });
n@1105 2722
n@1105 2723
n@1105 2724 // Initialize a jQuery object
n@1105 2725
n@1105 2726
n@1105 2727 // A central reference to the root jQuery(document)
n@1105 2728 var rootjQuery,
n@1105 2729
n@1105 2730 // A simple way to check for HTML strings
n@1105 2731 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
n@1105 2732 // Strict HTML recognition (#11290: must start with <)
n@1105 2733 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
n@1105 2734
n@1105 2735 init = jQuery.fn.init = function( selector, context ) {
n@1105 2736 var match, elem;
n@1105 2737
n@1105 2738 // HANDLE: $(""), $(null), $(undefined), $(false)
n@1105 2739 if ( !selector ) {
n@1105 2740 return this;
n@1105 2741 }
n@1105 2742
n@1105 2743 // Handle HTML strings
n@1105 2744 if ( typeof selector === "string" ) {
n@1105 2745 if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
n@1105 2746 // Assume that strings that start and end with <> are HTML and skip the regex check
n@1105 2747 match = [ null, selector, null ];
n@1105 2748
n@1105 2749 } else {
n@1105 2750 match = rquickExpr.exec( selector );
n@1105 2751 }
n@1105 2752
n@1105 2753 // Match html or make sure no context is specified for #id
n@1105 2754 if ( match && (match[1] || !context) ) {
n@1105 2755
n@1105 2756 // HANDLE: $(html) -> $(array)
n@1105 2757 if ( match[1] ) {
n@1105 2758 context = context instanceof jQuery ? context[0] : context;
n@1105 2759
n@1105 2760 // Option to run scripts is true for back-compat
n@1105 2761 // Intentionally let the error be thrown if parseHTML is not present
n@1105 2762 jQuery.merge( this, jQuery.parseHTML(
n@1105 2763 match[1],
n@1105 2764 context && context.nodeType ? context.ownerDocument || context : document,
n@1105 2765 true
n@1105 2766 ) );
n@1105 2767
n@1105 2768 // HANDLE: $(html, props)
n@1105 2769 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
n@1105 2770 for ( match in context ) {
n@1105 2771 // Properties of context are called as methods if possible
n@1105 2772 if ( jQuery.isFunction( this[ match ] ) ) {
n@1105 2773 this[ match ]( context[ match ] );
n@1105 2774
n@1105 2775 // ...and otherwise set as attributes
n@1105 2776 } else {
n@1105 2777 this.attr( match, context[ match ] );
n@1105 2778 }
n@1105 2779 }
n@1105 2780 }
n@1105 2781
n@1105 2782 return this;
n@1105 2783
n@1105 2784 // HANDLE: $(#id)
n@1105 2785 } else {
n@1105 2786 elem = document.getElementById( match[2] );
n@1105 2787
n@1105 2788 // Support: Blackberry 4.6
n@1105 2789 // gEBID returns nodes no longer in the document (#6963)
n@1105 2790 if ( elem && elem.parentNode ) {
n@1105 2791 // Inject the element directly into the jQuery object
n@1105 2792 this.length = 1;
n@1105 2793 this[0] = elem;
n@1105 2794 }
n@1105 2795
n@1105 2796 this.context = document;
n@1105 2797 this.selector = selector;
n@1105 2798 return this;
n@1105 2799 }
n@1105 2800
n@1105 2801 // HANDLE: $(expr, $(...))
n@1105 2802 } else if ( !context || context.jquery ) {
n@1105 2803 return ( context || rootjQuery ).find( selector );
n@1105 2804
n@1105 2805 // HANDLE: $(expr, context)
n@1105 2806 // (which is just equivalent to: $(context).find(expr)
n@1105 2807 } else {
n@1105 2808 return this.constructor( context ).find( selector );
n@1105 2809 }
n@1105 2810
n@1105 2811 // HANDLE: $(DOMElement)
n@1105 2812 } else if ( selector.nodeType ) {
n@1105 2813 this.context = this[0] = selector;
n@1105 2814 this.length = 1;
n@1105 2815 return this;
n@1105 2816
n@1105 2817 // HANDLE: $(function)
n@1105 2818 // Shortcut for document ready
n@1105 2819 } else if ( jQuery.isFunction( selector ) ) {
n@1105 2820 return typeof rootjQuery.ready !== "undefined" ?
n@1105 2821 rootjQuery.ready( selector ) :
n@1105 2822 // Execute immediately if ready is not present
n@1105 2823 selector( jQuery );
n@1105 2824 }
n@1105 2825
n@1105 2826 if ( selector.selector !== undefined ) {
n@1105 2827 this.selector = selector.selector;
n@1105 2828 this.context = selector.context;
n@1105 2829 }
n@1105 2830
n@1105 2831 return jQuery.makeArray( selector, this );
n@1105 2832 };
n@1105 2833
n@1105 2834 // Give the init function the jQuery prototype for later instantiation
n@1105 2835 init.prototype = jQuery.fn;
n@1105 2836
n@1105 2837 // Initialize central reference
n@1105 2838 rootjQuery = jQuery( document );
n@1105 2839
n@1105 2840
n@1105 2841 var rparentsprev = /^(?:parents|prev(?:Until|All))/,
n@1105 2842 // Methods guaranteed to produce a unique set when starting from a unique set
n@1105 2843 guaranteedUnique = {
n@1105 2844 children: true,
n@1105 2845 contents: true,
n@1105 2846 next: true,
n@1105 2847 prev: true
n@1105 2848 };
n@1105 2849
n@1105 2850 jQuery.extend({
n@1105 2851 dir: function( elem, dir, until ) {
n@1105 2852 var matched = [],
n@1105 2853 truncate = until !== undefined;
n@1105 2854
n@1105 2855 while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
n@1105 2856 if ( elem.nodeType === 1 ) {
n@1105 2857 if ( truncate && jQuery( elem ).is( until ) ) {
n@1105 2858 break;
n@1105 2859 }
n@1105 2860 matched.push( elem );
n@1105 2861 }
n@1105 2862 }
n@1105 2863 return matched;
n@1105 2864 },
n@1105 2865
n@1105 2866 sibling: function( n, elem ) {
n@1105 2867 var matched = [];
n@1105 2868
n@1105 2869 for ( ; n; n = n.nextSibling ) {
n@1105 2870 if ( n.nodeType === 1 && n !== elem ) {
n@1105 2871 matched.push( n );
n@1105 2872 }
n@1105 2873 }
n@1105 2874
n@1105 2875 return matched;
n@1105 2876 }
n@1105 2877 });
n@1105 2878
n@1105 2879 jQuery.fn.extend({
n@1105 2880 has: function( target ) {
n@1105 2881 var targets = jQuery( target, this ),
n@1105 2882 l = targets.length;
n@1105 2883
n@1105 2884 return this.filter(function() {
n@1105 2885 var i = 0;
n@1105 2886 for ( ; i < l; i++ ) {
n@1105 2887 if ( jQuery.contains( this, targets[i] ) ) {
n@1105 2888 return true;
n@1105 2889 }
n@1105 2890 }
n@1105 2891 });
n@1105 2892 },
n@1105 2893
n@1105 2894 closest: function( selectors, context ) {
n@1105 2895 var cur,
n@1105 2896 i = 0,
n@1105 2897 l = this.length,
n@1105 2898 matched = [],
n@1105 2899 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
n@1105 2900 jQuery( selectors, context || this.context ) :
n@1105 2901 0;
n@1105 2902
n@1105 2903 for ( ; i < l; i++ ) {
n@1105 2904 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
n@1105 2905 // Always skip document fragments
n@1105 2906 if ( cur.nodeType < 11 && (pos ?
n@1105 2907 pos.index(cur) > -1 :
n@1105 2908
n@1105 2909 // Don't pass non-elements to Sizzle
n@1105 2910 cur.nodeType === 1 &&
n@1105 2911 jQuery.find.matchesSelector(cur, selectors)) ) {
n@1105 2912
n@1105 2913 matched.push( cur );
n@1105 2914 break;
n@1105 2915 }
n@1105 2916 }
n@1105 2917 }
n@1105 2918
n@1105 2919 return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
n@1105 2920 },
n@1105 2921
n@1105 2922 // Determine the position of an element within the set
n@1105 2923 index: function( elem ) {
n@1105 2924
n@1105 2925 // No argument, return index in parent
n@1105 2926 if ( !elem ) {
n@1105 2927 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
n@1105 2928 }
n@1105 2929
n@1105 2930 // Index in selector
n@1105 2931 if ( typeof elem === "string" ) {
n@1105 2932 return indexOf.call( jQuery( elem ), this[ 0 ] );
n@1105 2933 }
n@1105 2934
n@1105 2935 // Locate the position of the desired element
n@1105 2936 return indexOf.call( this,
n@1105 2937
n@1105 2938 // If it receives a jQuery object, the first element is used
n@1105 2939 elem.jquery ? elem[ 0 ] : elem
n@1105 2940 );
n@1105 2941 },
n@1105 2942
n@1105 2943 add: function( selector, context ) {
n@1105 2944 return this.pushStack(
n@1105 2945 jQuery.unique(
n@1105 2946 jQuery.merge( this.get(), jQuery( selector, context ) )
n@1105 2947 )
n@1105 2948 );
n@1105 2949 },
n@1105 2950
n@1105 2951 addBack: function( selector ) {
n@1105 2952 return this.add( selector == null ?
n@1105 2953 this.prevObject : this.prevObject.filter(selector)
n@1105 2954 );
n@1105 2955 }
n@1105 2956 });
n@1105 2957
n@1105 2958 function sibling( cur, dir ) {
n@1105 2959 while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
n@1105 2960 return cur;
n@1105 2961 }
n@1105 2962
n@1105 2963 jQuery.each({
n@1105 2964 parent: function( elem ) {
n@1105 2965 var parent = elem.parentNode;
n@1105 2966 return parent && parent.nodeType !== 11 ? parent : null;
n@1105 2967 },
n@1105 2968 parents: function( elem ) {
n@1105 2969 return jQuery.dir( elem, "parentNode" );
n@1105 2970 },
n@1105 2971 parentsUntil: function( elem, i, until ) {
n@1105 2972 return jQuery.dir( elem, "parentNode", until );
n@1105 2973 },
n@1105 2974 next: function( elem ) {
n@1105 2975 return sibling( elem, "nextSibling" );
n@1105 2976 },
n@1105 2977 prev: function( elem ) {
n@1105 2978 return sibling( elem, "previousSibling" );
n@1105 2979 },
n@1105 2980 nextAll: function( elem ) {
n@1105 2981 return jQuery.dir( elem, "nextSibling" );
n@1105 2982 },
n@1105 2983 prevAll: function( elem ) {
n@1105 2984 return jQuery.dir( elem, "previousSibling" );
n@1105 2985 },
n@1105 2986 nextUntil: function( elem, i, until ) {
n@1105 2987 return jQuery.dir( elem, "nextSibling", until );
n@1105 2988 },
n@1105 2989 prevUntil: function( elem, i, until ) {
n@1105 2990 return jQuery.dir( elem, "previousSibling", until );
n@1105 2991 },
n@1105 2992 siblings: function( elem ) {
n@1105 2993 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
n@1105 2994 },
n@1105 2995 children: function( elem ) {
n@1105 2996 return jQuery.sibling( elem.firstChild );
n@1105 2997 },
n@1105 2998 contents: function( elem ) {
n@1105 2999 return elem.contentDocument || jQuery.merge( [], elem.childNodes );
n@1105 3000 }
n@1105 3001 }, function( name, fn ) {
n@1105 3002 jQuery.fn[ name ] = function( until, selector ) {
n@1105 3003 var matched = jQuery.map( this, fn, until );
n@1105 3004
n@1105 3005 if ( name.slice( -5 ) !== "Until" ) {
n@1105 3006 selector = until;
n@1105 3007 }
n@1105 3008
n@1105 3009 if ( selector && typeof selector === "string" ) {
n@1105 3010 matched = jQuery.filter( selector, matched );
n@1105 3011 }
n@1105 3012
n@1105 3013 if ( this.length > 1 ) {
n@1105 3014 // Remove duplicates
n@1105 3015 if ( !guaranteedUnique[ name ] ) {
n@1105 3016 jQuery.unique( matched );
n@1105 3017 }
n@1105 3018
n@1105 3019 // Reverse order for parents* and prev-derivatives
n@1105 3020 if ( rparentsprev.test( name ) ) {
n@1105 3021 matched.reverse();
n@1105 3022 }
n@1105 3023 }
n@1105 3024
n@1105 3025 return this.pushStack( matched );
n@1105 3026 };
n@1105 3027 });
n@1105 3028 var rnotwhite = (/\S+/g);
n@1105 3029
n@1105 3030
n@1105 3031
n@1105 3032 // String to Object options format cache
n@1105 3033 var optionsCache = {};
n@1105 3034
n@1105 3035 // Convert String-formatted options into Object-formatted ones and store in cache
n@1105 3036 function createOptions( options ) {
n@1105 3037 var object = optionsCache[ options ] = {};
n@1105 3038 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
n@1105 3039 object[ flag ] = true;
n@1105 3040 });
n@1105 3041 return object;
n@1105 3042 }
n@1105 3043
n@1105 3044 /*
n@1105 3045 * Create a callback list using the following parameters:
n@1105 3046 *
n@1105 3047 * options: an optional list of space-separated options that will change how
n@1105 3048 * the callback list behaves or a more traditional option object
n@1105 3049 *
n@1105 3050 * By default a callback list will act like an event callback list and can be
n@1105 3051 * "fired" multiple times.
n@1105 3052 *
n@1105 3053 * Possible options:
n@1105 3054 *
n@1105 3055 * once: will ensure the callback list can only be fired once (like a Deferred)
n@1105 3056 *
n@1105 3057 * memory: will keep track of previous values and will call any callback added
n@1105 3058 * after the list has been fired right away with the latest "memorized"
n@1105 3059 * values (like a Deferred)
n@1105 3060 *
n@1105 3061 * unique: will ensure a callback can only be added once (no duplicate in the list)
n@1105 3062 *
n@1105 3063 * stopOnFalse: interrupt callings when a callback returns false
n@1105 3064 *
n@1105 3065 */
n@1105 3066 jQuery.Callbacks = function( options ) {
n@1105 3067
n@1105 3068 // Convert options from String-formatted to Object-formatted if needed
n@1105 3069 // (we check in cache first)
n@1105 3070 options = typeof options === "string" ?
n@1105 3071 ( optionsCache[ options ] || createOptions( options ) ) :
n@1105 3072 jQuery.extend( {}, options );
n@1105 3073
n@1105 3074 var // Last fire value (for non-forgettable lists)
n@1105 3075 memory,
n@1105 3076 // Flag to know if list was already fired
n@1105 3077 fired,
n@1105 3078 // Flag to know if list is currently firing
n@1105 3079 firing,
n@1105 3080 // First callback to fire (used internally by add and fireWith)
n@1105 3081 firingStart,
n@1105 3082 // End of the loop when firing
n@1105 3083 firingLength,
n@1105 3084 // Index of currently firing callback (modified by remove if needed)
n@1105 3085 firingIndex,
n@1105 3086 // Actual callback list
n@1105 3087 list = [],
n@1105 3088 // Stack of fire calls for repeatable lists
n@1105 3089 stack = !options.once && [],
n@1105 3090 // Fire callbacks
n@1105 3091 fire = function( data ) {
n@1105 3092 memory = options.memory && data;
n@1105 3093 fired = true;
n@1105 3094 firingIndex = firingStart || 0;
n@1105 3095 firingStart = 0;
n@1105 3096 firingLength = list.length;
n@1105 3097 firing = true;
n@1105 3098 for ( ; list && firingIndex < firingLength; firingIndex++ ) {
n@1105 3099 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
n@1105 3100 memory = false; // To prevent further calls using add
n@1105 3101 break;
n@1105 3102 }
n@1105 3103 }
n@1105 3104 firing = false;
n@1105 3105 if ( list ) {
n@1105 3106 if ( stack ) {
n@1105 3107 if ( stack.length ) {
n@1105 3108 fire( stack.shift() );
n@1105 3109 }
n@1105 3110 } else if ( memory ) {
n@1105 3111 list = [];
n@1105 3112 } else {
n@1105 3113 self.disable();
n@1105 3114 }
n@1105 3115 }
n@1105 3116 },
n@1105 3117 // Actual Callbacks object
n@1105 3118 self = {
n@1105 3119 // Add a callback or a collection of callbacks to the list
n@1105 3120 add: function() {
n@1105 3121 if ( list ) {
n@1105 3122 // First, we save the current length
n@1105 3123 var start = list.length;
n@1105 3124 (function add( args ) {
n@1105 3125 jQuery.each( args, function( _, arg ) {
n@1105 3126 var type = jQuery.type( arg );
n@1105 3127 if ( type === "function" ) {
n@1105 3128 if ( !options.unique || !self.has( arg ) ) {
n@1105 3129 list.push( arg );
n@1105 3130 }
n@1105 3131 } else if ( arg && arg.length && type !== "string" ) {
n@1105 3132 // Inspect recursively
n@1105 3133 add( arg );
n@1105 3134 }
n@1105 3135 });
n@1105 3136 })( arguments );
n@1105 3137 // Do we need to add the callbacks to the
n@1105 3138 // current firing batch?
n@1105 3139 if ( firing ) {
n@1105 3140 firingLength = list.length;
n@1105 3141 // With memory, if we're not firing then
n@1105 3142 // we should call right away
n@1105 3143 } else if ( memory ) {
n@1105 3144 firingStart = start;
n@1105 3145 fire( memory );
n@1105 3146 }
n@1105 3147 }
n@1105 3148 return this;
n@1105 3149 },
n@1105 3150 // Remove a callback from the list
n@1105 3151 remove: function() {
n@1105 3152 if ( list ) {
n@1105 3153 jQuery.each( arguments, function( _, arg ) {
n@1105 3154 var index;
n@1105 3155 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
n@1105 3156 list.splice( index, 1 );
n@1105 3157 // Handle firing indexes
n@1105 3158 if ( firing ) {
n@1105 3159 if ( index <= firingLength ) {
n@1105 3160 firingLength--;
n@1105 3161 }
n@1105 3162 if ( index <= firingIndex ) {
n@1105 3163 firingIndex--;
n@1105 3164 }
n@1105 3165 }
n@1105 3166 }
n@1105 3167 });
n@1105 3168 }
n@1105 3169 return this;
n@1105 3170 },
n@1105 3171 // Check if a given callback is in the list.
n@1105 3172 // If no argument is given, return whether or not list has callbacks attached.
n@1105 3173 has: function( fn ) {
n@1105 3174 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
n@1105 3175 },
n@1105 3176 // Remove all callbacks from the list
n@1105 3177 empty: function() {
n@1105 3178 list = [];
n@1105 3179 firingLength = 0;
n@1105 3180 return this;
n@1105 3181 },
n@1105 3182 // Have the list do nothing anymore
n@1105 3183 disable: function() {
n@1105 3184 list = stack = memory = undefined;
n@1105 3185 return this;
n@1105 3186 },
n@1105 3187 // Is it disabled?
n@1105 3188 disabled: function() {
n@1105 3189 return !list;
n@1105 3190 },
n@1105 3191 // Lock the list in its current state
n@1105 3192 lock: function() {
n@1105 3193 stack = undefined;
n@1105 3194 if ( !memory ) {
n@1105 3195 self.disable();
n@1105 3196 }
n@1105 3197 return this;
n@1105 3198 },
n@1105 3199 // Is it locked?
n@1105 3200 locked: function() {
n@1105 3201 return !stack;
n@1105 3202 },
n@1105 3203 // Call all callbacks with the given context and arguments
n@1105 3204 fireWith: function( context, args ) {
n@1105 3205 if ( list && ( !fired || stack ) ) {
n@1105 3206 args = args || [];
n@1105 3207 args = [ context, args.slice ? args.slice() : args ];
n@1105 3208 if ( firing ) {
n@1105 3209 stack.push( args );
n@1105 3210 } else {
n@1105 3211 fire( args );
n@1105 3212 }
n@1105 3213 }
n@1105 3214 return this;
n@1105 3215 },
n@1105 3216 // Call all the callbacks with the given arguments
n@1105 3217 fire: function() {
n@1105 3218 self.fireWith( this, arguments );
n@1105 3219 return this;
n@1105 3220 },
n@1105 3221 // To know if the callbacks have already been called at least once
n@1105 3222 fired: function() {
n@1105 3223 return !!fired;
n@1105 3224 }
n@1105 3225 };
n@1105 3226
n@1105 3227 return self;
n@1105 3228 };
n@1105 3229
n@1105 3230
n@1105 3231 jQuery.extend({
n@1105 3232
n@1105 3233 Deferred: function( func ) {
n@1105 3234 var tuples = [
n@1105 3235 // action, add listener, listener list, final state
n@1105 3236 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
n@1105 3237 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
n@1105 3238 [ "notify", "progress", jQuery.Callbacks("memory") ]
n@1105 3239 ],
n@1105 3240 state = "pending",
n@1105 3241 promise = {
n@1105 3242 state: function() {
n@1105 3243 return state;
n@1105 3244 },
n@1105 3245 always: function() {
n@1105 3246 deferred.done( arguments ).fail( arguments );
n@1105 3247 return this;
n@1105 3248 },
n@1105 3249 then: function( /* fnDone, fnFail, fnProgress */ ) {
n@1105 3250 var fns = arguments;
n@1105 3251 return jQuery.Deferred(function( newDefer ) {
n@1105 3252 jQuery.each( tuples, function( i, tuple ) {
n@1105 3253 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
n@1105 3254 // deferred[ done | fail | progress ] for forwarding actions to newDefer
n@1105 3255 deferred[ tuple[1] ](function() {
n@1105 3256 var returned = fn && fn.apply( this, arguments );
n@1105 3257 if ( returned && jQuery.isFunction( returned.promise ) ) {
n@1105 3258 returned.promise()
n@1105 3259 .done( newDefer.resolve )
n@1105 3260 .fail( newDefer.reject )
n@1105 3261 .progress( newDefer.notify );
n@1105 3262 } else {
n@1105 3263 newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
n@1105 3264 }
n@1105 3265 });
n@1105 3266 });
n@1105 3267 fns = null;
n@1105 3268 }).promise();
n@1105 3269 },
n@1105 3270 // Get a promise for this deferred
n@1105 3271 // If obj is provided, the promise aspect is added to the object
n@1105 3272 promise: function( obj ) {
n@1105 3273 return obj != null ? jQuery.extend( obj, promise ) : promise;
n@1105 3274 }
n@1105 3275 },
n@1105 3276 deferred = {};
n@1105 3277
n@1105 3278 // Keep pipe for back-compat
n@1105 3279 promise.pipe = promise.then;
n@1105 3280
n@1105 3281 // Add list-specific methods
n@1105 3282 jQuery.each( tuples, function( i, tuple ) {
n@1105 3283 var list = tuple[ 2 ],
n@1105 3284 stateString = tuple[ 3 ];
n@1105 3285
n@1105 3286 // promise[ done | fail | progress ] = list.add
n@1105 3287 promise[ tuple[1] ] = list.add;
n@1105 3288
n@1105 3289 // Handle state
n@1105 3290 if ( stateString ) {
n@1105 3291 list.add(function() {
n@1105 3292 // state = [ resolved | rejected ]
n@1105 3293 state = stateString;
n@1105 3294
n@1105 3295 // [ reject_list | resolve_list ].disable; progress_list.lock
n@1105 3296 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
n@1105 3297 }
n@1105 3298
n@1105 3299 // deferred[ resolve | reject | notify ]
n@1105 3300 deferred[ tuple[0] ] = function() {
n@1105 3301 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
n@1105 3302 return this;
n@1105 3303 };
n@1105 3304 deferred[ tuple[0] + "With" ] = list.fireWith;
n@1105 3305 });
n@1105 3306
n@1105 3307 // Make the deferred a promise
n@1105 3308 promise.promise( deferred );
n@1105 3309
n@1105 3310 // Call given func if any
n@1105 3311 if ( func ) {
n@1105 3312 func.call( deferred, deferred );
n@1105 3313 }
n@1105 3314
n@1105 3315 // All done!
n@1105 3316 return deferred;
n@1105 3317 },
n@1105 3318
n@1105 3319 // Deferred helper
n@1105 3320 when: function( subordinate /* , ..., subordinateN */ ) {
n@1105 3321 var i = 0,
n@1105 3322 resolveValues = slice.call( arguments ),
n@1105 3323 length = resolveValues.length,
n@1105 3324
n@1105 3325 // the count of uncompleted subordinates
n@1105 3326 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
n@1105 3327
n@1105 3328 // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
n@1105 3329 deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
n@1105 3330
n@1105 3331 // Update function for both resolve and progress values
n@1105 3332 updateFunc = function( i, contexts, values ) {
n@1105 3333 return function( value ) {
n@1105 3334 contexts[ i ] = this;
n@1105 3335 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
n@1105 3336 if ( values === progressValues ) {
n@1105 3337 deferred.notifyWith( contexts, values );
n@1105 3338 } else if ( !( --remaining ) ) {
n@1105 3339 deferred.resolveWith( contexts, values );
n@1105 3340 }
n@1105 3341 };
n@1105 3342 },
n@1105 3343
n@1105 3344 progressValues, progressContexts, resolveContexts;
n@1105 3345
n@1105 3346 // Add listeners to Deferred subordinates; treat others as resolved
n@1105 3347 if ( length > 1 ) {
n@1105 3348 progressValues = new Array( length );
n@1105 3349 progressContexts = new Array( length );
n@1105 3350 resolveContexts = new Array( length );
n@1105 3351 for ( ; i < length; i++ ) {
n@1105 3352 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
n@1105 3353 resolveValues[ i ].promise()
n@1105 3354 .done( updateFunc( i, resolveContexts, resolveValues ) )
n@1105 3355 .fail( deferred.reject )
n@1105 3356 .progress( updateFunc( i, progressContexts, progressValues ) );
n@1105 3357 } else {
n@1105 3358 --remaining;
n@1105 3359 }
n@1105 3360 }
n@1105 3361 }
n@1105 3362
n@1105 3363 // If we're not waiting on anything, resolve the master
n@1105 3364 if ( !remaining ) {
n@1105 3365 deferred.resolveWith( resolveContexts, resolveValues );
n@1105 3366 }
n@1105 3367
n@1105 3368 return deferred.promise();
n@1105 3369 }
n@1105 3370 });
n@1105 3371
n@1105 3372
n@1105 3373 // The deferred used on DOM ready
n@1105 3374 var readyList;
n@1105 3375
n@1105 3376 jQuery.fn.ready = function( fn ) {
n@1105 3377 // Add the callback
n@1105 3378 jQuery.ready.promise().done( fn );
n@1105 3379
n@1105 3380 return this;
n@1105 3381 };
n@1105 3382
n@1105 3383 jQuery.extend({
n@1105 3384 // Is the DOM ready to be used? Set to true once it occurs.
n@1105 3385 isReady: false,
n@1105 3386
n@1105 3387 // A counter to track how many items to wait for before
n@1105 3388 // the ready event fires. See #6781
n@1105 3389 readyWait: 1,
n@1105 3390
n@1105 3391 // Hold (or release) the ready event
n@1105 3392 holdReady: function( hold ) {
n@1105 3393 if ( hold ) {
n@1105 3394 jQuery.readyWait++;
n@1105 3395 } else {
n@1105 3396 jQuery.ready( true );
n@1105 3397 }
n@1105 3398 },
n@1105 3399
n@1105 3400 // Handle when the DOM is ready
n@1105 3401 ready: function( wait ) {
n@1105 3402
n@1105 3403 // Abort if there are pending holds or we're already ready
n@1105 3404 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
n@1105 3405 return;
n@1105 3406 }
n@1105 3407
n@1105 3408 // Remember that the DOM is ready
n@1105 3409 jQuery.isReady = true;
n@1105 3410
n@1105 3411 // If a normal DOM Ready event fired, decrement, and wait if need be
n@1105 3412 if ( wait !== true && --jQuery.readyWait > 0 ) {
n@1105 3413 return;
n@1105 3414 }
n@1105 3415
n@1105 3416 // If there are functions bound, to execute
n@1105 3417 readyList.resolveWith( document, [ jQuery ] );
n@1105 3418
n@1105 3419 // Trigger any bound ready events
n@1105 3420 if ( jQuery.fn.triggerHandler ) {
n@1105 3421 jQuery( document ).triggerHandler( "ready" );
n@1105 3422 jQuery( document ).off( "ready" );
n@1105 3423 }
n@1105 3424 }
n@1105 3425 });
n@1105 3426
n@1105 3427 /**
n@1105 3428 * The ready event handler and self cleanup method
n@1105 3429 */
n@1105 3430 function completed() {
n@1105 3431 document.removeEventListener( "DOMContentLoaded", completed, false );
n@1105 3432 window.removeEventListener( "load", completed, false );
n@1105 3433 jQuery.ready();
n@1105 3434 }
n@1105 3435
n@1105 3436 jQuery.ready.promise = function( obj ) {
n@1105 3437 if ( !readyList ) {
n@1105 3438
n@1105 3439 readyList = jQuery.Deferred();
n@1105 3440
n@1105 3441 // Catch cases where $(document).ready() is called after the browser event has already occurred.
n@1105 3442 // We once tried to use readyState "interactive" here, but it caused issues like the one
n@1105 3443 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
n@1105 3444 if ( document.readyState === "complete" ) {
n@1105 3445 // Handle it asynchronously to allow scripts the opportunity to delay ready
n@1105 3446 setTimeout( jQuery.ready );
n@1105 3447
n@1105 3448 } else {
n@1105 3449
n@1105 3450 // Use the handy event callback
n@1105 3451 document.addEventListener( "DOMContentLoaded", completed, false );
n@1105 3452
n@1105 3453 // A fallback to window.onload, that will always work
n@1105 3454 window.addEventListener( "load", completed, false );
n@1105 3455 }
n@1105 3456 }
n@1105 3457 return readyList.promise( obj );
n@1105 3458 };
n@1105 3459
n@1105 3460 // Kick off the DOM ready check even if the user does not
n@1105 3461 jQuery.ready.promise();
n@1105 3462
n@1105 3463
n@1105 3464
n@1105 3465
n@1105 3466 // Multifunctional method to get and set values of a collection
n@1105 3467 // The value/s can optionally be executed if it's a function
n@1105 3468 var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
n@1105 3469 var i = 0,
n@1105 3470 len = elems.length,
n@1105 3471 bulk = key == null;
n@1105 3472
n@1105 3473 // Sets many values
n@1105 3474 if ( jQuery.type( key ) === "object" ) {
n@1105 3475 chainable = true;
n@1105 3476 for ( i in key ) {
n@1105 3477 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
n@1105 3478 }
n@1105 3479
n@1105 3480 // Sets one value
n@1105 3481 } else if ( value !== undefined ) {
n@1105 3482 chainable = true;
n@1105 3483
n@1105 3484 if ( !jQuery.isFunction( value ) ) {
n@1105 3485 raw = true;
n@1105 3486 }
n@1105 3487
n@1105 3488 if ( bulk ) {
n@1105 3489 // Bulk operations run against the entire set
n@1105 3490 if ( raw ) {
n@1105 3491 fn.call( elems, value );
n@1105 3492 fn = null;
n@1105 3493
n@1105 3494 // ...except when executing function values
n@1105 3495 } else {
n@1105 3496 bulk = fn;
n@1105 3497 fn = function( elem, key, value ) {
n@1105 3498 return bulk.call( jQuery( elem ), value );
n@1105 3499 };
n@1105 3500 }
n@1105 3501 }
n@1105 3502
n@1105 3503 if ( fn ) {
n@1105 3504 for ( ; i < len; i++ ) {
n@1105 3505 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
n@1105 3506 }
n@1105 3507 }
n@1105 3508 }
n@1105 3509
n@1105 3510 return chainable ?
n@1105 3511 elems :
n@1105 3512
n@1105 3513 // Gets
n@1105 3514 bulk ?
n@1105 3515 fn.call( elems ) :
n@1105 3516 len ? fn( elems[0], key ) : emptyGet;
n@1105 3517 };
n@1105 3518
n@1105 3519
n@1105 3520 /**
n@1105 3521 * Determines whether an object can have data
n@1105 3522 */
n@1105 3523 jQuery.acceptData = function( owner ) {
n@1105 3524 // Accepts only:
n@1105 3525 // - Node
n@1105 3526 // - Node.ELEMENT_NODE
n@1105 3527 // - Node.DOCUMENT_NODE
n@1105 3528 // - Object
n@1105 3529 // - Any
n@1105 3530 /* jshint -W018 */
n@1105 3531 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
n@1105 3532 };
n@1105 3533
n@1105 3534
n@1105 3535 function Data() {
n@1105 3536 // Support: Android<4,
n@1105 3537 // Old WebKit does not have Object.preventExtensions/freeze method,
n@1105 3538 // return new empty object instead with no [[set]] accessor
n@1105 3539 Object.defineProperty( this.cache = {}, 0, {
n@1105 3540 get: function() {
n@1105 3541 return {};
n@1105 3542 }
n@1105 3543 });
n@1105 3544
n@1105 3545 this.expando = jQuery.expando + Data.uid++;
n@1105 3546 }
n@1105 3547
n@1105 3548 Data.uid = 1;
n@1105 3549 Data.accepts = jQuery.acceptData;
n@1105 3550
n@1105 3551 Data.prototype = {
n@1105 3552 key: function( owner ) {
n@1105 3553 // We can accept data for non-element nodes in modern browsers,
n@1105 3554 // but we should not, see #8335.
n@1105 3555 // Always return the key for a frozen object.
n@1105 3556 if ( !Data.accepts( owner ) ) {
n@1105 3557 return 0;
n@1105 3558 }
n@1105 3559
n@1105 3560 var descriptor = {},
n@1105 3561 // Check if the owner object already has a cache key
n@1105 3562 unlock = owner[ this.expando ];
n@1105 3563
n@1105 3564 // If not, create one
n@1105 3565 if ( !unlock ) {
n@1105 3566 unlock = Data.uid++;
n@1105 3567
n@1105 3568 // Secure it in a non-enumerable, non-writable property
n@1105 3569 try {
n@1105 3570 descriptor[ this.expando ] = { value: unlock };
n@1105 3571 Object.defineProperties( owner, descriptor );
n@1105 3572
n@1105 3573 // Support: Android<4
n@1105 3574 // Fallback to a less secure definition
n@1105 3575 } catch ( e ) {
n@1105 3576 descriptor[ this.expando ] = unlock;
n@1105 3577 jQuery.extend( owner, descriptor );
n@1105 3578 }
n@1105 3579 }
n@1105 3580
n@1105 3581 // Ensure the cache object
n@1105 3582 if ( !this.cache[ unlock ] ) {
n@1105 3583 this.cache[ unlock ] = {};
n@1105 3584 }
n@1105 3585
n@1105 3586 return unlock;
n@1105 3587 },
n@1105 3588 set: function( owner, data, value ) {
n@1105 3589 var prop,
n@1105 3590 // There may be an unlock assigned to this node,
n@1105 3591 // if there is no entry for this "owner", create one inline
n@1105 3592 // and set the unlock as though an owner entry had always existed
n@1105 3593 unlock = this.key( owner ),
n@1105 3594 cache = this.cache[ unlock ];
n@1105 3595
n@1105 3596 // Handle: [ owner, key, value ] args
n@1105 3597 if ( typeof data === "string" ) {
n@1105 3598 cache[ data ] = value;
n@1105 3599
n@1105 3600 // Handle: [ owner, { properties } ] args
n@1105 3601 } else {
n@1105 3602 // Fresh assignments by object are shallow copied
n@1105 3603 if ( jQuery.isEmptyObject( cache ) ) {
n@1105 3604 jQuery.extend( this.cache[ unlock ], data );
n@1105 3605 // Otherwise, copy the properties one-by-one to the cache object
n@1105 3606 } else {
n@1105 3607 for ( prop in data ) {
n@1105 3608 cache[ prop ] = data[ prop ];
n@1105 3609 }
n@1105 3610 }
n@1105 3611 }
n@1105 3612 return cache;
n@1105 3613 },
n@1105 3614 get: function( owner, key ) {
n@1105 3615 // Either a valid cache is found, or will be created.
n@1105 3616 // New caches will be created and the unlock returned,
n@1105 3617 // allowing direct access to the newly created
n@1105 3618 // empty data object. A valid owner object must be provided.
n@1105 3619 var cache = this.cache[ this.key( owner ) ];
n@1105 3620
n@1105 3621 return key === undefined ?
n@1105 3622 cache : cache[ key ];
n@1105 3623 },
n@1105 3624 access: function( owner, key, value ) {
n@1105 3625 var stored;
n@1105 3626 // In cases where either:
n@1105 3627 //
n@1105 3628 // 1. No key was specified
n@1105 3629 // 2. A string key was specified, but no value provided
n@1105 3630 //
n@1105 3631 // Take the "read" path and allow the get method to determine
n@1105 3632 // which value to return, respectively either:
n@1105 3633 //
n@1105 3634 // 1. The entire cache object
n@1105 3635 // 2. The data stored at the key
n@1105 3636 //
n@1105 3637 if ( key === undefined ||
n@1105 3638 ((key && typeof key === "string") && value === undefined) ) {
n@1105 3639
n@1105 3640 stored = this.get( owner, key );
n@1105 3641
n@1105 3642 return stored !== undefined ?
n@1105 3643 stored : this.get( owner, jQuery.camelCase(key) );
n@1105 3644 }
n@1105 3645
n@1105 3646 // [*]When the key is not a string, or both a key and value
n@1105 3647 // are specified, set or extend (existing objects) with either:
n@1105 3648 //
n@1105 3649 // 1. An object of properties
n@1105 3650 // 2. A key and value
n@1105 3651 //
n@1105 3652 this.set( owner, key, value );
n@1105 3653
n@1105 3654 // Since the "set" path can have two possible entry points
n@1105 3655 // return the expected data based on which path was taken[*]
n@1105 3656 return value !== undefined ? value : key;
n@1105 3657 },
n@1105 3658 remove: function( owner, key ) {
n@1105 3659 var i, name, camel,
n@1105 3660 unlock = this.key( owner ),
n@1105 3661 cache = this.cache[ unlock ];
n@1105 3662
n@1105 3663 if ( key === undefined ) {
n@1105 3664 this.cache[ unlock ] = {};
n@1105 3665
n@1105 3666 } else {
n@1105 3667 // Support array or space separated string of keys
n@1105 3668 if ( jQuery.isArray( key ) ) {
n@1105 3669 // If "name" is an array of keys...
n@1105 3670 // When data is initially created, via ("key", "val") signature,
n@1105 3671 // keys will be converted to camelCase.
n@1105 3672 // Since there is no way to tell _how_ a key was added, remove
n@1105 3673 // both plain key and camelCase key. #12786
n@1105 3674 // This will only penalize the array argument path.
n@1105 3675 name = key.concat( key.map( jQuery.camelCase ) );
n@1105 3676 } else {
n@1105 3677 camel = jQuery.camelCase( key );
n@1105 3678 // Try the string as a key before any manipulation
n@1105 3679 if ( key in cache ) {
n@1105 3680 name = [ key, camel ];
n@1105 3681 } else {
n@1105 3682 // If a key with the spaces exists, use it.
n@1105 3683 // Otherwise, create an array by matching non-whitespace
n@1105 3684 name = camel;
n@1105 3685 name = name in cache ?
n@1105 3686 [ name ] : ( name.match( rnotwhite ) || [] );
n@1105 3687 }
n@1105 3688 }
n@1105 3689
n@1105 3690 i = name.length;
n@1105 3691 while ( i-- ) {
n@1105 3692 delete cache[ name[ i ] ];
n@1105 3693 }
n@1105 3694 }
n@1105 3695 },
n@1105 3696 hasData: function( owner ) {
n@1105 3697 return !jQuery.isEmptyObject(
n@1105 3698 this.cache[ owner[ this.expando ] ] || {}
n@1105 3699 );
n@1105 3700 },
n@1105 3701 discard: function( owner ) {
n@1105 3702 if ( owner[ this.expando ] ) {
n@1105 3703 delete this.cache[ owner[ this.expando ] ];
n@1105 3704 }
n@1105 3705 }
n@1105 3706 };
n@1105 3707 var data_priv = new Data();
n@1105 3708
n@1105 3709 var data_user = new Data();
n@1105 3710
n@1105 3711
n@1105 3712
n@1105 3713 // Implementation Summary
n@1105 3714 //
n@1105 3715 // 1. Enforce API surface and semantic compatibility with 1.9.x branch
n@1105 3716 // 2. Improve the module's maintainability by reducing the storage
n@1105 3717 // paths to a single mechanism.
n@1105 3718 // 3. Use the same single mechanism to support "private" and "user" data.
n@1105 3719 // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
n@1105 3720 // 5. Avoid exposing implementation details on user objects (eg. expando properties)
n@1105 3721 // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
n@1105 3722
n@1105 3723 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
n@1105 3724 rmultiDash = /([A-Z])/g;
n@1105 3725
n@1105 3726 function dataAttr( elem, key, data ) {
n@1105 3727 var name;
n@1105 3728
n@1105 3729 // If nothing was found internally, try to fetch any
n@1105 3730 // data from the HTML5 data-* attribute
n@1105 3731 if ( data === undefined && elem.nodeType === 1 ) {
n@1105 3732 name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
n@1105 3733 data = elem.getAttribute( name );
n@1105 3734
n@1105 3735 if ( typeof data === "string" ) {
n@1105 3736 try {
n@1105 3737 data = data === "true" ? true :
n@1105 3738 data === "false" ? false :
n@1105 3739 data === "null" ? null :
n@1105 3740 // Only convert to a number if it doesn't change the string
n@1105 3741 +data + "" === data ? +data :
n@1105 3742 rbrace.test( data ) ? jQuery.parseJSON( data ) :
n@1105 3743 data;
n@1105 3744 } catch( e ) {}
n@1105 3745
n@1105 3746 // Make sure we set the data so it isn't changed later
n@1105 3747 data_user.set( elem, key, data );
n@1105 3748 } else {
n@1105 3749 data = undefined;
n@1105 3750 }
n@1105 3751 }
n@1105 3752 return data;
n@1105 3753 }
n@1105 3754
n@1105 3755 jQuery.extend({
n@1105 3756 hasData: function( elem ) {
n@1105 3757 return data_user.hasData( elem ) || data_priv.hasData( elem );
n@1105 3758 },
n@1105 3759
n@1105 3760 data: function( elem, name, data ) {
n@1105 3761 return data_user.access( elem, name, data );
n@1105 3762 },
n@1105 3763
n@1105 3764 removeData: function( elem, name ) {
n@1105 3765 data_user.remove( elem, name );
n@1105 3766 },
n@1105 3767
n@1105 3768 // TODO: Now that all calls to _data and _removeData have been replaced
n@1105 3769 // with direct calls to data_priv methods, these can be deprecated.
n@1105 3770 _data: function( elem, name, data ) {
n@1105 3771 return data_priv.access( elem, name, data );
n@1105 3772 },
n@1105 3773
n@1105 3774 _removeData: function( elem, name ) {
n@1105 3775 data_priv.remove( elem, name );
n@1105 3776 }
n@1105 3777 });
n@1105 3778
n@1105 3779 jQuery.fn.extend({
n@1105 3780 data: function( key, value ) {
n@1105 3781 var i, name, data,
n@1105 3782 elem = this[ 0 ],
n@1105 3783 attrs = elem && elem.attributes;
n@1105 3784
n@1105 3785 // Gets all values
n@1105 3786 if ( key === undefined ) {
n@1105 3787 if ( this.length ) {
n@1105 3788 data = data_user.get( elem );
n@1105 3789
n@1105 3790 if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
n@1105 3791 i = attrs.length;
n@1105 3792 while ( i-- ) {
n@1105 3793
n@1105 3794 // Support: IE11+
n@1105 3795 // The attrs elements can be null (#14894)
n@1105 3796 if ( attrs[ i ] ) {
n@1105 3797 name = attrs[ i ].name;
n@1105 3798 if ( name.indexOf( "data-" ) === 0 ) {
n@1105 3799 name = jQuery.camelCase( name.slice(5) );
n@1105 3800 dataAttr( elem, name, data[ name ] );
n@1105 3801 }
n@1105 3802 }
n@1105 3803 }
n@1105 3804 data_priv.set( elem, "hasDataAttrs", true );
n@1105 3805 }
n@1105 3806 }
n@1105 3807
n@1105 3808 return data;
n@1105 3809 }
n@1105 3810
n@1105 3811 // Sets multiple values
n@1105 3812 if ( typeof key === "object" ) {
n@1105 3813 return this.each(function() {
n@1105 3814 data_user.set( this, key );
n@1105 3815 });
n@1105 3816 }
n@1105 3817
n@1105 3818 return access( this, function( value ) {
n@1105 3819 var data,
n@1105 3820 camelKey = jQuery.camelCase( key );
n@1105 3821
n@1105 3822 // The calling jQuery object (element matches) is not empty
n@1105 3823 // (and therefore has an element appears at this[ 0 ]) and the
n@1105 3824 // `value` parameter was not undefined. An empty jQuery object
n@1105 3825 // will result in `undefined` for elem = this[ 0 ] which will
n@1105 3826 // throw an exception if an attempt to read a data cache is made.
n@1105 3827 if ( elem && value === undefined ) {
n@1105 3828 // Attempt to get data from the cache
n@1105 3829 // with the key as-is
n@1105 3830 data = data_user.get( elem, key );
n@1105 3831 if ( data !== undefined ) {
n@1105 3832 return data;
n@1105 3833 }
n@1105 3834
n@1105 3835 // Attempt to get data from the cache
n@1105 3836 // with the key camelized
n@1105 3837 data = data_user.get( elem, camelKey );
n@1105 3838 if ( data !== undefined ) {
n@1105 3839 return data;
n@1105 3840 }
n@1105 3841
n@1105 3842 // Attempt to "discover" the data in
n@1105 3843 // HTML5 custom data-* attrs
n@1105 3844 data = dataAttr( elem, camelKey, undefined );
n@1105 3845 if ( data !== undefined ) {
n@1105 3846 return data;
n@1105 3847 }
n@1105 3848
n@1105 3849 // We tried really hard, but the data doesn't exist.
n@1105 3850 return;
n@1105 3851 }
n@1105 3852
n@1105 3853 // Set the data...
n@1105 3854 this.each(function() {
n@1105 3855 // First, attempt to store a copy or reference of any
n@1105 3856 // data that might've been store with a camelCased key.
n@1105 3857 var data = data_user.get( this, camelKey );
n@1105 3858
n@1105 3859 // For HTML5 data-* attribute interop, we have to
n@1105 3860 // store property names with dashes in a camelCase form.
n@1105 3861 // This might not apply to all properties...*
n@1105 3862 data_user.set( this, camelKey, value );
n@1105 3863
n@1105 3864 // *... In the case of properties that might _actually_
n@1105 3865 // have dashes, we need to also store a copy of that
n@1105 3866 // unchanged property.
n@1105 3867 if ( key.indexOf("-") !== -1 && data !== undefined ) {
n@1105 3868 data_user.set( this, key, value );
n@1105 3869 }
n@1105 3870 });
n@1105 3871 }, null, value, arguments.length > 1, null, true );
n@1105 3872 },
n@1105 3873
n@1105 3874 removeData: function( key ) {
n@1105 3875 return this.each(function() {
n@1105 3876 data_user.remove( this, key );
n@1105 3877 });
n@1105 3878 }
n@1105 3879 });
n@1105 3880
n@1105 3881
n@1105 3882 jQuery.extend({
n@1105 3883 queue: function( elem, type, data ) {
n@1105 3884 var queue;
n@1105 3885
n@1105 3886 if ( elem ) {
n@1105 3887 type = ( type || "fx" ) + "queue";
n@1105 3888 queue = data_priv.get( elem, type );
n@1105 3889
n@1105 3890 // Speed up dequeue by getting out quickly if this is just a lookup
n@1105 3891 if ( data ) {
n@1105 3892 if ( !queue || jQuery.isArray( data ) ) {
n@1105 3893 queue = data_priv.access( elem, type, jQuery.makeArray(data) );
n@1105 3894 } else {
n@1105 3895 queue.push( data );
n@1105 3896 }
n@1105 3897 }
n@1105 3898 return queue || [];
n@1105 3899 }
n@1105 3900 },
n@1105 3901
n@1105 3902 dequeue: function( elem, type ) {
n@1105 3903 type = type || "fx";
n@1105 3904
n@1105 3905 var queue = jQuery.queue( elem, type ),
n@1105 3906 startLength = queue.length,
n@1105 3907 fn = queue.shift(),
n@1105 3908 hooks = jQuery._queueHooks( elem, type ),
n@1105 3909 next = function() {
n@1105 3910 jQuery.dequeue( elem, type );
n@1105 3911 };
n@1105 3912
n@1105 3913 // If the fx queue is dequeued, always remove the progress sentinel
n@1105 3914 if ( fn === "inprogress" ) {
n@1105 3915 fn = queue.shift();
n@1105 3916 startLength--;
n@1105 3917 }
n@1105 3918
n@1105 3919 if ( fn ) {
n@1105 3920
n@1105 3921 // Add a progress sentinel to prevent the fx queue from being
n@1105 3922 // automatically dequeued
n@1105 3923 if ( type === "fx" ) {
n@1105 3924 queue.unshift( "inprogress" );
n@1105 3925 }
n@1105 3926
n@1105 3927 // Clear up the last queue stop function
n@1105 3928 delete hooks.stop;
n@1105 3929 fn.call( elem, next, hooks );
n@1105 3930 }
n@1105 3931
n@1105 3932 if ( !startLength && hooks ) {
n@1105 3933 hooks.empty.fire();
n@1105 3934 }
n@1105 3935 },
n@1105 3936
n@1105 3937 // Not public - generate a queueHooks object, or return the current one
n@1105 3938 _queueHooks: function( elem, type ) {
n@1105 3939 var key = type + "queueHooks";
n@1105 3940 return data_priv.get( elem, key ) || data_priv.access( elem, key, {
n@1105 3941 empty: jQuery.Callbacks("once memory").add(function() {
n@1105 3942 data_priv.remove( elem, [ type + "queue", key ] );
n@1105 3943 })
n@1105 3944 });
n@1105 3945 }
n@1105 3946 });
n@1105 3947
n@1105 3948 jQuery.fn.extend({
n@1105 3949 queue: function( type, data ) {
n@1105 3950 var setter = 2;
n@1105 3951
n@1105 3952 if ( typeof type !== "string" ) {
n@1105 3953 data = type;
n@1105 3954 type = "fx";
n@1105 3955 setter--;
n@1105 3956 }
n@1105 3957
n@1105 3958 if ( arguments.length < setter ) {
n@1105 3959 return jQuery.queue( this[0], type );
n@1105 3960 }
n@1105 3961
n@1105 3962 return data === undefined ?
n@1105 3963 this :
n@1105 3964 this.each(function() {
n@1105 3965 var queue = jQuery.queue( this, type, data );
n@1105 3966
n@1105 3967 // Ensure a hooks for this queue
n@1105 3968 jQuery._queueHooks( this, type );
n@1105 3969
n@1105 3970 if ( type === "fx" && queue[0] !== "inprogress" ) {
n@1105 3971 jQuery.dequeue( this, type );
n@1105 3972 }
n@1105 3973 });
n@1105 3974 },
n@1105 3975 dequeue: function( type ) {
n@1105 3976 return this.each(function() {
n@1105 3977 jQuery.dequeue( this, type );
n@1105 3978 });
n@1105 3979 },
n@1105 3980 clearQueue: function( type ) {
n@1105 3981 return this.queue( type || "fx", [] );
n@1105 3982 },
n@1105 3983 // Get a promise resolved when queues of a certain type
n@1105 3984 // are emptied (fx is the type by default)
n@1105 3985 promise: function( type, obj ) {
n@1105 3986 var tmp,
n@1105 3987 count = 1,
n@1105 3988 defer = jQuery.Deferred(),
n@1105 3989 elements = this,
n@1105 3990 i = this.length,
n@1105 3991 resolve = function() {
n@1105 3992 if ( !( --count ) ) {
n@1105 3993 defer.resolveWith( elements, [ elements ] );
n@1105 3994 }
n@1105 3995 };
n@1105 3996
n@1105 3997 if ( typeof type !== "string" ) {
n@1105 3998 obj = type;
n@1105 3999 type = undefined;
n@1105 4000 }
n@1105 4001 type = type || "fx";
n@1105 4002
n@1105 4003 while ( i-- ) {
n@1105 4004 tmp = data_priv.get( elements[ i ], type + "queueHooks" );
n@1105 4005 if ( tmp && tmp.empty ) {
n@1105 4006 count++;
n@1105 4007 tmp.empty.add( resolve );
n@1105 4008 }
n@1105 4009 }
n@1105 4010 resolve();
n@1105 4011 return defer.promise( obj );
n@1105 4012 }
n@1105 4013 });
n@1105 4014 var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
n@1105 4015
n@1105 4016 var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
n@1105 4017
n@1105 4018 var isHidden = function( elem, el ) {
n@1105 4019 // isHidden might be called from jQuery#filter function;
n@1105 4020 // in that case, element will be second argument
n@1105 4021 elem = el || elem;
n@1105 4022 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
n@1105 4023 };
n@1105 4024
n@1105 4025 var rcheckableType = (/^(?:checkbox|radio)$/i);
n@1105 4026
n@1105 4027
n@1105 4028
n@1105 4029 (function() {
n@1105 4030 var fragment = document.createDocumentFragment(),
n@1105 4031 div = fragment.appendChild( document.createElement( "div" ) ),
n@1105 4032 input = document.createElement( "input" );
n@1105 4033
n@1105 4034 // Support: Safari<=5.1
n@1105 4035 // Check state lost if the name is set (#11217)
n@1105 4036 // Support: Windows Web Apps (WWA)
n@1105 4037 // `name` and `type` must use .setAttribute for WWA (#14901)
n@1105 4038 input.setAttribute( "type", "radio" );
n@1105 4039 input.setAttribute( "checked", "checked" );
n@1105 4040 input.setAttribute( "name", "t" );
n@1105 4041
n@1105 4042 div.appendChild( input );
n@1105 4043
n@1105 4044 // Support: Safari<=5.1, Android<4.2
n@1105 4045 // Older WebKit doesn't clone checked state correctly in fragments
n@1105 4046 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
n@1105 4047
n@1105 4048 // Support: IE<=11+
n@1105 4049 // Make sure textarea (and checkbox) defaultValue is properly cloned
n@1105 4050 div.innerHTML = "<textarea>x</textarea>";
n@1105 4051 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
n@1105 4052 })();
n@1105 4053 var strundefined = typeof undefined;
n@1105 4054
n@1105 4055
n@1105 4056
n@1105 4057 support.focusinBubbles = "onfocusin" in window;
n@1105 4058
n@1105 4059
n@1105 4060 var
n@1105 4061 rkeyEvent = /^key/,
n@1105 4062 rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
n@1105 4063 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
n@1105 4064 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
n@1105 4065
n@1105 4066 function returnTrue() {
n@1105 4067 return true;
n@1105 4068 }
n@1105 4069
n@1105 4070 function returnFalse() {
n@1105 4071 return false;
n@1105 4072 }
n@1105 4073
n@1105 4074 function safeActiveElement() {
n@1105 4075 try {
n@1105 4076 return document.activeElement;
n@1105 4077 } catch ( err ) { }
n@1105 4078 }
n@1105 4079
n@1105 4080 /*
n@1105 4081 * Helper functions for managing events -- not part of the public interface.
n@1105 4082 * Props to Dean Edwards' addEvent library for many of the ideas.
n@1105 4083 */
n@1105 4084 jQuery.event = {
n@1105 4085
n@1105 4086 global: {},
n@1105 4087
n@1105 4088 add: function( elem, types, handler, data, selector ) {
n@1105 4089
n@1105 4090 var handleObjIn, eventHandle, tmp,
n@1105 4091 events, t, handleObj,
n@1105 4092 special, handlers, type, namespaces, origType,
n@1105 4093 elemData = data_priv.get( elem );
n@1105 4094
n@1105 4095 // Don't attach events to noData or text/comment nodes (but allow plain objects)
n@1105 4096 if ( !elemData ) {
n@1105 4097 return;
n@1105 4098 }
n@1105 4099
n@1105 4100 // Caller can pass in an object of custom data in lieu of the handler
n@1105 4101 if ( handler.handler ) {
n@1105 4102 handleObjIn = handler;
n@1105 4103 handler = handleObjIn.handler;
n@1105 4104 selector = handleObjIn.selector;
n@1105 4105 }
n@1105 4106
n@1105 4107 // Make sure that the handler has a unique ID, used to find/remove it later
n@1105 4108 if ( !handler.guid ) {
n@1105 4109 handler.guid = jQuery.guid++;
n@1105 4110 }
n@1105 4111
n@1105 4112 // Init the element's event structure and main handler, if this is the first
n@1105 4113 if ( !(events = elemData.events) ) {
n@1105 4114 events = elemData.events = {};
n@1105 4115 }
n@1105 4116 if ( !(eventHandle = elemData.handle) ) {
n@1105 4117 eventHandle = elemData.handle = function( e ) {
n@1105 4118 // Discard the second event of a jQuery.event.trigger() and
n@1105 4119 // when an event is called after a page has unloaded
n@1105 4120 return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
n@1105 4121 jQuery.event.dispatch.apply( elem, arguments ) : undefined;
n@1105 4122 };
n@1105 4123 }
n@1105 4124
n@1105 4125 // Handle multiple events separated by a space
n@1105 4126 types = ( types || "" ).match( rnotwhite ) || [ "" ];
n@1105 4127 t = types.length;
n@1105 4128 while ( t-- ) {
n@1105 4129 tmp = rtypenamespace.exec( types[t] ) || [];
n@1105 4130 type = origType = tmp[1];
n@1105 4131 namespaces = ( tmp[2] || "" ).split( "." ).sort();
n@1105 4132
n@1105 4133 // There *must* be a type, no attaching namespace-only handlers
n@1105 4134 if ( !type ) {
n@1105 4135 continue;
n@1105 4136 }
n@1105 4137
n@1105 4138 // If event changes its type, use the special event handlers for the changed type
n@1105 4139 special = jQuery.event.special[ type ] || {};
n@1105 4140
n@1105 4141 // If selector defined, determine special event api type, otherwise given type
n@1105 4142 type = ( selector ? special.delegateType : special.bindType ) || type;
n@1105 4143
n@1105 4144 // Update special based on newly reset type
n@1105 4145 special = jQuery.event.special[ type ] || {};
n@1105 4146
n@1105 4147 // handleObj is passed to all event handlers
n@1105 4148 handleObj = jQuery.extend({
n@1105 4149 type: type,
n@1105 4150 origType: origType,
n@1105 4151 data: data,
n@1105 4152 handler: handler,
n@1105 4153 guid: handler.guid,
n@1105 4154 selector: selector,
n@1105 4155 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
n@1105 4156 namespace: namespaces.join(".")
n@1105 4157 }, handleObjIn );
n@1105 4158
n@1105 4159 // Init the event handler queue if we're the first
n@1105 4160 if ( !(handlers = events[ type ]) ) {
n@1105 4161 handlers = events[ type ] = [];
n@1105 4162 handlers.delegateCount = 0;
n@1105 4163
n@1105 4164 // Only use addEventListener if the special events handler returns false
n@1105 4165 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
n@1105 4166 if ( elem.addEventListener ) {
n@1105 4167 elem.addEventListener( type, eventHandle, false );
n@1105 4168 }
n@1105 4169 }
n@1105 4170 }
n@1105 4171
n@1105 4172 if ( special.add ) {
n@1105 4173 special.add.call( elem, handleObj );
n@1105 4174
n@1105 4175 if ( !handleObj.handler.guid ) {
n@1105 4176 handleObj.handler.guid = handler.guid;
n@1105 4177 }
n@1105 4178 }
n@1105 4179
n@1105 4180 // Add to the element's handler list, delegates in front
n@1105 4181 if ( selector ) {
n@1105 4182 handlers.splice( handlers.delegateCount++, 0, handleObj );
n@1105 4183 } else {
n@1105 4184 handlers.push( handleObj );
n@1105 4185 }
n@1105 4186
n@1105 4187 // Keep track of which events have ever been used, for event optimization
n@1105 4188 jQuery.event.global[ type ] = true;
n@1105 4189 }
n@1105 4190
n@1105 4191 },
n@1105 4192
n@1105 4193 // Detach an event or set of events from an element
n@1105 4194 remove: function( elem, types, handler, selector, mappedTypes ) {
n@1105 4195
n@1105 4196 var j, origCount, tmp,
n@1105 4197 events, t, handleObj,
n@1105 4198 special, handlers, type, namespaces, origType,
n@1105 4199 elemData = data_priv.hasData( elem ) && data_priv.get( elem );
n@1105 4200
n@1105 4201 if ( !elemData || !(events = elemData.events) ) {
n@1105 4202 return;
n@1105 4203 }
n@1105 4204
n@1105 4205 // Once for each type.namespace in types; type may be omitted
n@1105 4206 types = ( types || "" ).match( rnotwhite ) || [ "" ];
n@1105 4207 t = types.length;
n@1105 4208 while ( t-- ) {
n@1105 4209 tmp = rtypenamespace.exec( types[t] ) || [];
n@1105 4210 type = origType = tmp[1];
n@1105 4211 namespaces = ( tmp[2] || "" ).split( "." ).sort();
n@1105 4212
n@1105 4213 // Unbind all events (on this namespace, if provided) for the element
n@1105 4214 if ( !type ) {
n@1105 4215 for ( type in events ) {
n@1105 4216 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
n@1105 4217 }
n@1105 4218 continue;
n@1105 4219 }
n@1105 4220
n@1105 4221 special = jQuery.event.special[ type ] || {};
n@1105 4222 type = ( selector ? special.delegateType : special.bindType ) || type;
n@1105 4223 handlers = events[ type ] || [];
n@1105 4224 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
n@1105 4225
n@1105 4226 // Remove matching events
n@1105 4227 origCount = j = handlers.length;
n@1105 4228 while ( j-- ) {
n@1105 4229 handleObj = handlers[ j ];
n@1105 4230
n@1105 4231 if ( ( mappedTypes || origType === handleObj.origType ) &&
n@1105 4232 ( !handler || handler.guid === handleObj.guid ) &&
n@1105 4233 ( !tmp || tmp.test( handleObj.namespace ) ) &&
n@1105 4234 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
n@1105 4235 handlers.splice( j, 1 );
n@1105 4236
n@1105 4237 if ( handleObj.selector ) {
n@1105 4238 handlers.delegateCount--;
n@1105 4239 }
n@1105 4240 if ( special.remove ) {
n@1105 4241 special.remove.call( elem, handleObj );
n@1105 4242 }
n@1105 4243 }
n@1105 4244 }
n@1105 4245
n@1105 4246 // Remove generic event handler if we removed something and no more handlers exist
n@1105 4247 // (avoids potential for endless recursion during removal of special event handlers)
n@1105 4248 if ( origCount && !handlers.length ) {
n@1105 4249 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
n@1105 4250 jQuery.removeEvent( elem, type, elemData.handle );
n@1105 4251 }
n@1105 4252
n@1105 4253 delete events[ type ];
n@1105 4254 }
n@1105 4255 }
n@1105 4256
n@1105 4257 // Remove the expando if it's no longer used
n@1105 4258 if ( jQuery.isEmptyObject( events ) ) {
n@1105 4259 delete elemData.handle;
n@1105 4260 data_priv.remove( elem, "events" );
n@1105 4261 }
n@1105 4262 },
n@1105 4263
n@1105 4264 trigger: function( event, data, elem, onlyHandlers ) {
n@1105 4265
n@1105 4266 var i, cur, tmp, bubbleType, ontype, handle, special,
n@1105 4267 eventPath = [ elem || document ],
n@1105 4268 type = hasOwn.call( event, "type" ) ? event.type : event,
n@1105 4269 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
n@1105 4270
n@1105 4271 cur = tmp = elem = elem || document;
n@1105 4272
n@1105 4273 // Don't do events on text and comment nodes
n@1105 4274 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
n@1105 4275 return;
n@1105 4276 }
n@1105 4277
n@1105 4278 // focus/blur morphs to focusin/out; ensure we're not firing them right now
n@1105 4279 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
n@1105 4280 return;
n@1105 4281 }
n@1105 4282
n@1105 4283 if ( type.indexOf(".") >= 0 ) {
n@1105 4284 // Namespaced trigger; create a regexp to match event type in handle()
n@1105 4285 namespaces = type.split(".");
n@1105 4286 type = namespaces.shift();
n@1105 4287 namespaces.sort();
n@1105 4288 }
n@1105 4289 ontype = type.indexOf(":") < 0 && "on" + type;
n@1105 4290
n@1105 4291 // Caller can pass in a jQuery.Event object, Object, or just an event type string
n@1105 4292 event = event[ jQuery.expando ] ?
n@1105 4293 event :
n@1105 4294 new jQuery.Event( type, typeof event === "object" && event );
n@1105 4295
n@1105 4296 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
n@1105 4297 event.isTrigger = onlyHandlers ? 2 : 3;
n@1105 4298 event.namespace = namespaces.join(".");
n@1105 4299 event.namespace_re = event.namespace ?
n@1105 4300 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
n@1105 4301 null;
n@1105 4302
n@1105 4303 // Clean up the event in case it is being reused
n@1105 4304 event.result = undefined;
n@1105 4305 if ( !event.target ) {
n@1105 4306 event.target = elem;
n@1105 4307 }
n@1105 4308
n@1105 4309 // Clone any incoming data and prepend the event, creating the handler arg list
n@1105 4310 data = data == null ?
n@1105 4311 [ event ] :
n@1105 4312 jQuery.makeArray( data, [ event ] );
n@1105 4313
n@1105 4314 // Allow special events to draw outside the lines
n@1105 4315 special = jQuery.event.special[ type ] || {};
n@1105 4316 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
n@1105 4317 return;
n@1105 4318 }
n@1105 4319
n@1105 4320 // Determine event propagation path in advance, per W3C events spec (#9951)
n@1105 4321 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
n@1105 4322 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
n@1105 4323
n@1105 4324 bubbleType = special.delegateType || type;
n@1105 4325 if ( !rfocusMorph.test( bubbleType + type ) ) {
n@1105 4326 cur = cur.parentNode;
n@1105 4327 }
n@1105 4328 for ( ; cur; cur = cur.parentNode ) {
n@1105 4329 eventPath.push( cur );
n@1105 4330 tmp = cur;
n@1105 4331 }
n@1105 4332
n@1105 4333 // Only add window if we got to document (e.g., not plain obj or detached DOM)
n@1105 4334 if ( tmp === (elem.ownerDocument || document) ) {
n@1105 4335 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
n@1105 4336 }
n@1105 4337 }
n@1105 4338
n@1105 4339 // Fire handlers on the event path
n@1105 4340 i = 0;
n@1105 4341 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
n@1105 4342
n@1105 4343 event.type = i > 1 ?
n@1105 4344 bubbleType :
n@1105 4345 special.bindType || type;
n@1105 4346
n@1105 4347 // jQuery handler
n@1105 4348 handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
n@1105 4349 if ( handle ) {
n@1105 4350 handle.apply( cur, data );
n@1105 4351 }
n@1105 4352
n@1105 4353 // Native handler
n@1105 4354 handle = ontype && cur[ ontype ];
n@1105 4355 if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
n@1105 4356 event.result = handle.apply( cur, data );
n@1105 4357 if ( event.result === false ) {
n@1105 4358 event.preventDefault();
n@1105 4359 }
n@1105 4360 }
n@1105 4361 }
n@1105 4362 event.type = type;
n@1105 4363
n@1105 4364 // If nobody prevented the default action, do it now
n@1105 4365 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
n@1105 4366
n@1105 4367 if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
n@1105 4368 jQuery.acceptData( elem ) ) {
n@1105 4369
n@1105 4370 // Call a native DOM method on the target with the same name name as the event.
n@1105 4371 // Don't do default actions on window, that's where global variables be (#6170)
n@1105 4372 if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
n@1105 4373
n@1105 4374 // Don't re-trigger an onFOO event when we call its FOO() method
n@1105 4375 tmp = elem[ ontype ];
n@1105 4376
n@1105 4377 if ( tmp ) {
n@1105 4378 elem[ ontype ] = null;
n@1105 4379 }
n@1105 4380
n@1105 4381 // Prevent re-triggering of the same event, since we already bubbled it above
n@1105 4382 jQuery.event.triggered = type;
n@1105 4383 elem[ type ]();
n@1105 4384 jQuery.event.triggered = undefined;
n@1105 4385
n@1105 4386 if ( tmp ) {
n@1105 4387 elem[ ontype ] = tmp;
n@1105 4388 }
n@1105 4389 }
n@1105 4390 }
n@1105 4391 }
n@1105 4392
n@1105 4393 return event.result;
n@1105 4394 },
n@1105 4395
n@1105 4396 dispatch: function( event ) {
n@1105 4397
n@1105 4398 // Make a writable jQuery.Event from the native event object
n@1105 4399 event = jQuery.event.fix( event );
n@1105 4400
n@1105 4401 var i, j, ret, matched, handleObj,
n@1105 4402 handlerQueue = [],
n@1105 4403 args = slice.call( arguments ),
n@1105 4404 handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
n@1105 4405 special = jQuery.event.special[ event.type ] || {};
n@1105 4406
n@1105 4407 // Use the fix-ed jQuery.Event rather than the (read-only) native event
n@1105 4408 args[0] = event;
n@1105 4409 event.delegateTarget = this;
n@1105 4410
n@1105 4411 // Call the preDispatch hook for the mapped type, and let it bail if desired
n@1105 4412 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
n@1105 4413 return;
n@1105 4414 }
n@1105 4415
n@1105 4416 // Determine handlers
n@1105 4417 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
n@1105 4418
n@1105 4419 // Run delegates first; they may want to stop propagation beneath us
n@1105 4420 i = 0;
n@1105 4421 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
n@1105 4422 event.currentTarget = matched.elem;
n@1105 4423
n@1105 4424 j = 0;
n@1105 4425 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
n@1105 4426
n@1105 4427 // Triggered event must either 1) have no namespace, or 2) have namespace(s)
n@1105 4428 // a subset or equal to those in the bound event (both can have no namespace).
n@1105 4429 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
n@1105 4430
n@1105 4431 event.handleObj = handleObj;
n@1105 4432 event.data = handleObj.data;
n@1105 4433
n@1105 4434 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
n@1105 4435 .apply( matched.elem, args );
n@1105 4436
n@1105 4437 if ( ret !== undefined ) {
n@1105 4438 if ( (event.result = ret) === false ) {
n@1105 4439 event.preventDefault();
n@1105 4440 event.stopPropagation();
n@1105 4441 }
n@1105 4442 }
n@1105 4443 }
n@1105 4444 }
n@1105 4445 }
n@1105 4446
n@1105 4447 // Call the postDispatch hook for the mapped type
n@1105 4448 if ( special.postDispatch ) {
n@1105 4449 special.postDispatch.call( this, event );
n@1105 4450 }
n@1105 4451
n@1105 4452 return event.result;
n@1105 4453 },
n@1105 4454
n@1105 4455 handlers: function( event, handlers ) {
n@1105 4456 var i, matches, sel, handleObj,
n@1105 4457 handlerQueue = [],
n@1105 4458 delegateCount = handlers.delegateCount,
n@1105 4459 cur = event.target;
n@1105 4460
n@1105 4461 // Find delegate handlers
n@1105 4462 // Black-hole SVG <use> instance trees (#13180)
n@1105 4463 // Avoid non-left-click bubbling in Firefox (#3861)
n@1105 4464 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
n@1105 4465
n@1105 4466 for ( ; cur !== this; cur = cur.parentNode || this ) {
n@1105 4467
n@1105 4468 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
n@1105 4469 if ( cur.disabled !== true || event.type !== "click" ) {
n@1105 4470 matches = [];
n@1105 4471 for ( i = 0; i < delegateCount; i++ ) {
n@1105 4472 handleObj = handlers[ i ];
n@1105 4473
n@1105 4474 // Don't conflict with Object.prototype properties (#13203)
n@1105 4475 sel = handleObj.selector + " ";
n@1105 4476
n@1105 4477 if ( matches[ sel ] === undefined ) {
n@1105 4478 matches[ sel ] = handleObj.needsContext ?
n@1105 4479 jQuery( sel, this ).index( cur ) >= 0 :
n@1105 4480 jQuery.find( sel, this, null, [ cur ] ).length;
n@1105 4481 }
n@1105 4482 if ( matches[ sel ] ) {
n@1105 4483 matches.push( handleObj );
n@1105 4484 }
n@1105 4485 }
n@1105 4486 if ( matches.length ) {
n@1105 4487 handlerQueue.push({ elem: cur, handlers: matches });
n@1105 4488 }
n@1105 4489 }
n@1105 4490 }
n@1105 4491 }
n@1105 4492
n@1105 4493 // Add the remaining (directly-bound) handlers
n@1105 4494 if ( delegateCount < handlers.length ) {
n@1105 4495 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
n@1105 4496 }
n@1105 4497
n@1105 4498 return handlerQueue;
n@1105 4499 },
n@1105 4500
n@1105 4501 // Includes some event props shared by KeyEvent and MouseEvent
n@1105 4502 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
n@1105 4503
n@1105 4504 fixHooks: {},
n@1105 4505
n@1105 4506 keyHooks: {
n@1105 4507 props: "char charCode key keyCode".split(" "),
n@1105 4508 filter: function( event, original ) {
n@1105 4509
n@1105 4510 // Add which for key events
n@1105 4511 if ( event.which == null ) {
n@1105 4512 event.which = original.charCode != null ? original.charCode : original.keyCode;
n@1105 4513 }
n@1105 4514
n@1105 4515 return event;
n@1105 4516 }
n@1105 4517 },
n@1105 4518
n@1105 4519 mouseHooks: {
n@1105 4520 props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
n@1105 4521 filter: function( event, original ) {
n@1105 4522 var eventDoc, doc, body,
n@1105 4523 button = original.button;
n@1105 4524
n@1105 4525 // Calculate pageX/Y if missing and clientX/Y available
n@1105 4526 if ( event.pageX == null && original.clientX != null ) {
n@1105 4527 eventDoc = event.target.ownerDocument || document;
n@1105 4528 doc = eventDoc.documentElement;
n@1105 4529 body = eventDoc.body;
n@1105 4530
n@1105 4531 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
n@1105 4532 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
n@1105 4533 }
n@1105 4534
n@1105 4535 // Add which for click: 1 === left; 2 === middle; 3 === right
n@1105 4536 // Note: button is not normalized, so don't use it
n@1105 4537 if ( !event.which && button !== undefined ) {
n@1105 4538 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
n@1105 4539 }
n@1105 4540
n@1105 4541 return event;
n@1105 4542 }
n@1105 4543 },
n@1105 4544
n@1105 4545 fix: function( event ) {
n@1105 4546 if ( event[ jQuery.expando ] ) {
n@1105 4547 return event;
n@1105 4548 }
n@1105 4549
n@1105 4550 // Create a writable copy of the event object and normalize some properties
n@1105 4551 var i, prop, copy,
n@1105 4552 type = event.type,
n@1105 4553 originalEvent = event,
n@1105 4554 fixHook = this.fixHooks[ type ];
n@1105 4555
n@1105 4556 if ( !fixHook ) {
n@1105 4557 this.fixHooks[ type ] = fixHook =
n@1105 4558 rmouseEvent.test( type ) ? this.mouseHooks :
n@1105 4559 rkeyEvent.test( type ) ? this.keyHooks :
n@1105 4560 {};
n@1105 4561 }
n@1105 4562 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
n@1105 4563
n@1105 4564 event = new jQuery.Event( originalEvent );
n@1105 4565
n@1105 4566 i = copy.length;
n@1105 4567 while ( i-- ) {
n@1105 4568 prop = copy[ i ];
n@1105 4569 event[ prop ] = originalEvent[ prop ];
n@1105 4570 }
n@1105 4571
n@1105 4572 // Support: Cordova 2.5 (WebKit) (#13255)
n@1105 4573 // All events should have a target; Cordova deviceready doesn't
n@1105 4574 if ( !event.target ) {
n@1105 4575 event.target = document;
n@1105 4576 }
n@1105 4577
n@1105 4578 // Support: Safari 6.0+, Chrome<28
n@1105 4579 // Target should not be a text node (#504, #13143)
n@1105 4580 if ( event.target.nodeType === 3 ) {
n@1105 4581 event.target = event.target.parentNode;
n@1105 4582 }
n@1105 4583
n@1105 4584 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
n@1105 4585 },
n@1105 4586
n@1105 4587 special: {
n@1105 4588 load: {
n@1105 4589 // Prevent triggered image.load events from bubbling to window.load
n@1105 4590 noBubble: true
n@1105 4591 },
n@1105 4592 focus: {
n@1105 4593 // Fire native event if possible so blur/focus sequence is correct
n@1105 4594 trigger: function() {
n@1105 4595 if ( this !== safeActiveElement() && this.focus ) {
n@1105 4596 this.focus();
n@1105 4597 return false;
n@1105 4598 }
n@1105 4599 },
n@1105 4600 delegateType: "focusin"
n@1105 4601 },
n@1105 4602 blur: {
n@1105 4603 trigger: function() {
n@1105 4604 if ( this === safeActiveElement() && this.blur ) {
n@1105 4605 this.blur();
n@1105 4606 return false;
n@1105 4607 }
n@1105 4608 },
n@1105 4609 delegateType: "focusout"
n@1105 4610 },
n@1105 4611 click: {
n@1105 4612 // For checkbox, fire native event so checked state will be right
n@1105 4613 trigger: function() {
n@1105 4614 if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
n@1105 4615 this.click();
n@1105 4616 return false;
n@1105 4617 }
n@1105 4618 },
n@1105 4619
n@1105 4620 // For cross-browser consistency, don't fire native .click() on links
n@1105 4621 _default: function( event ) {
n@1105 4622 return jQuery.nodeName( event.target, "a" );
n@1105 4623 }
n@1105 4624 },
n@1105 4625
n@1105 4626 beforeunload: {
n@1105 4627 postDispatch: function( event ) {
n@1105 4628
n@1105 4629 // Support: Firefox 20+
n@1105 4630 // Firefox doesn't alert if the returnValue field is not set.
n@1105 4631 if ( event.result !== undefined && event.originalEvent ) {
n@1105 4632 event.originalEvent.returnValue = event.result;
n@1105 4633 }
n@1105 4634 }
n@1105 4635 }
n@1105 4636 },
n@1105 4637
n@1105 4638 simulate: function( type, elem, event, bubble ) {
n@1105 4639 // Piggyback on a donor event to simulate a different one.
n@1105 4640 // Fake originalEvent to avoid donor's stopPropagation, but if the
n@1105 4641 // simulated event prevents default then we do the same on the donor.
n@1105 4642 var e = jQuery.extend(
n@1105 4643 new jQuery.Event(),
n@1105 4644 event,
n@1105 4645 {
n@1105 4646 type: type,
n@1105 4647 isSimulated: true,
n@1105 4648 originalEvent: {}
n@1105 4649 }
n@1105 4650 );
n@1105 4651 if ( bubble ) {
n@1105 4652 jQuery.event.trigger( e, null, elem );
n@1105 4653 } else {
n@1105 4654 jQuery.event.dispatch.call( elem, e );
n@1105 4655 }
n@1105 4656 if ( e.isDefaultPrevented() ) {
n@1105 4657 event.preventDefault();
n@1105 4658 }
n@1105 4659 }
n@1105 4660 };
n@1105 4661
n@1105 4662 jQuery.removeEvent = function( elem, type, handle ) {
n@1105 4663 if ( elem.removeEventListener ) {
n@1105 4664 elem.removeEventListener( type, handle, false );
n@1105 4665 }
n@1105 4666 };
n@1105 4667
n@1105 4668 jQuery.Event = function( src, props ) {
n@1105 4669 // Allow instantiation without the 'new' keyword
n@1105 4670 if ( !(this instanceof jQuery.Event) ) {
n@1105 4671 return new jQuery.Event( src, props );
n@1105 4672 }
n@1105 4673
n@1105 4674 // Event object
n@1105 4675 if ( src && src.type ) {
n@1105 4676 this.originalEvent = src;
n@1105 4677 this.type = src.type;
n@1105 4678
n@1105 4679 // Events bubbling up the document may have been marked as prevented
n@1105 4680 // by a handler lower down the tree; reflect the correct value.
n@1105 4681 this.isDefaultPrevented = src.defaultPrevented ||
n@1105 4682 src.defaultPrevented === undefined &&
n@1105 4683 // Support: Android<4.0
n@1105 4684 src.returnValue === false ?
n@1105 4685 returnTrue :
n@1105 4686 returnFalse;
n@1105 4687
n@1105 4688 // Event type
n@1105 4689 } else {
n@1105 4690 this.type = src;
n@1105 4691 }
n@1105 4692
n@1105 4693 // Put explicitly provided properties onto the event object
n@1105 4694 if ( props ) {
n@1105 4695 jQuery.extend( this, props );
n@1105 4696 }
n@1105 4697
n@1105 4698 // Create a timestamp if incoming event doesn't have one
n@1105 4699 this.timeStamp = src && src.timeStamp || jQuery.now();
n@1105 4700
n@1105 4701 // Mark it as fixed
n@1105 4702 this[ jQuery.expando ] = true;
n@1105 4703 };
n@1105 4704
n@1105 4705 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
n@1105 4706 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
n@1105 4707 jQuery.Event.prototype = {
n@1105 4708 isDefaultPrevented: returnFalse,
n@1105 4709 isPropagationStopped: returnFalse,
n@1105 4710 isImmediatePropagationStopped: returnFalse,
n@1105 4711
n@1105 4712 preventDefault: function() {
n@1105 4713 var e = this.originalEvent;
n@1105 4714
n@1105 4715 this.isDefaultPrevented = returnTrue;
n@1105 4716
n@1105 4717 if ( e && e.preventDefault ) {
n@1105 4718 e.preventDefault();
n@1105 4719 }
n@1105 4720 },
n@1105 4721 stopPropagation: function() {
n@1105 4722 var e = this.originalEvent;
n@1105 4723
n@1105 4724 this.isPropagationStopped = returnTrue;
n@1105 4725
n@1105 4726 if ( e && e.stopPropagation ) {
n@1105 4727 e.stopPropagation();
n@1105 4728 }
n@1105 4729 },
n@1105 4730 stopImmediatePropagation: function() {
n@1105 4731 var e = this.originalEvent;
n@1105 4732
n@1105 4733 this.isImmediatePropagationStopped = returnTrue;
n@1105 4734
n@1105 4735 if ( e && e.stopImmediatePropagation ) {
n@1105 4736 e.stopImmediatePropagation();
n@1105 4737 }
n@1105 4738
n@1105 4739 this.stopPropagation();
n@1105 4740 }
n@1105 4741 };
n@1105 4742
n@1105 4743 // Create mouseenter/leave events using mouseover/out and event-time checks
n@1105 4744 // Support: Chrome 15+
n@1105 4745 jQuery.each({
n@1105 4746 mouseenter: "mouseover",
n@1105 4747 mouseleave: "mouseout",
n@1105 4748 pointerenter: "pointerover",
n@1105 4749 pointerleave: "pointerout"
n@1105 4750 }, function( orig, fix ) {
n@1105 4751 jQuery.event.special[ orig ] = {
n@1105 4752 delegateType: fix,
n@1105 4753 bindType: fix,
n@1105 4754
n@1105 4755 handle: function( event ) {
n@1105 4756 var ret,
n@1105 4757 target = this,
n@1105 4758 related = event.relatedTarget,
n@1105 4759 handleObj = event.handleObj;
n@1105 4760
n@1105 4761 // For mousenter/leave call the handler if related is outside the target.
n@1105 4762 // NB: No relatedTarget if the mouse left/entered the browser window
n@1105 4763 if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
n@1105 4764 event.type = handleObj.origType;
n@1105 4765 ret = handleObj.handler.apply( this, arguments );
n@1105 4766 event.type = fix;
n@1105 4767 }
n@1105 4768 return ret;
n@1105 4769 }
n@1105 4770 };
n@1105 4771 });
n@1105 4772
n@1105 4773 // Support: Firefox, Chrome, Safari
n@1105 4774 // Create "bubbling" focus and blur events
n@1105 4775 if ( !support.focusinBubbles ) {
n@1105 4776 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
n@1105 4777
n@1105 4778 // Attach a single capturing handler on the document while someone wants focusin/focusout
n@1105 4779 var handler = function( event ) {
n@1105 4780 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
n@1105 4781 };
n@1105 4782
n@1105 4783 jQuery.event.special[ fix ] = {
n@1105 4784 setup: function() {
n@1105 4785 var doc = this.ownerDocument || this,
n@1105 4786 attaches = data_priv.access( doc, fix );
n@1105 4787
n@1105 4788 if ( !attaches ) {
n@1105 4789 doc.addEventListener( orig, handler, true );
n@1105 4790 }
n@1105 4791 data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
n@1105 4792 },
n@1105 4793 teardown: function() {
n@1105 4794 var doc = this.ownerDocument || this,
n@1105 4795 attaches = data_priv.access( doc, fix ) - 1;
n@1105 4796
n@1105 4797 if ( !attaches ) {
n@1105 4798 doc.removeEventListener( orig, handler, true );
n@1105 4799 data_priv.remove( doc, fix );
n@1105 4800
n@1105 4801 } else {
n@1105 4802 data_priv.access( doc, fix, attaches );
n@1105 4803 }
n@1105 4804 }
n@1105 4805 };
n@1105 4806 });
n@1105 4807 }
n@1105 4808
n@1105 4809 jQuery.fn.extend({
n@1105 4810
n@1105 4811 on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
n@1105 4812 var origFn, type;
n@1105 4813
n@1105 4814 // Types can be a map of types/handlers
n@1105 4815 if ( typeof types === "object" ) {
n@1105 4816 // ( types-Object, selector, data )
n@1105 4817 if ( typeof selector !== "string" ) {
n@1105 4818 // ( types-Object, data )
n@1105 4819 data = data || selector;
n@1105 4820 selector = undefined;
n@1105 4821 }
n@1105 4822 for ( type in types ) {
n@1105 4823 this.on( type, selector, data, types[ type ], one );
n@1105 4824 }
n@1105 4825 return this;
n@1105 4826 }
n@1105 4827
n@1105 4828 if ( data == null && fn == null ) {
n@1105 4829 // ( types, fn )
n@1105 4830 fn = selector;
n@1105 4831 data = selector = undefined;
n@1105 4832 } else if ( fn == null ) {
n@1105 4833 if ( typeof selector === "string" ) {
n@1105 4834 // ( types, selector, fn )
n@1105 4835 fn = data;
n@1105 4836 data = undefined;
n@1105 4837 } else {
n@1105 4838 // ( types, data, fn )
n@1105 4839 fn = data;
n@1105 4840 data = selector;
n@1105 4841 selector = undefined;
n@1105 4842 }
n@1105 4843 }
n@1105 4844 if ( fn === false ) {
n@1105 4845 fn = returnFalse;
n@1105 4846 } else if ( !fn ) {
n@1105 4847 return this;
n@1105 4848 }
n@1105 4849
n@1105 4850 if ( one === 1 ) {
n@1105 4851 origFn = fn;
n@1105 4852 fn = function( event ) {
n@1105 4853 // Can use an empty set, since event contains the info
n@1105 4854 jQuery().off( event );
n@1105 4855 return origFn.apply( this, arguments );
n@1105 4856 };
n@1105 4857 // Use same guid so caller can remove using origFn
n@1105 4858 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
n@1105 4859 }
n@1105 4860 return this.each( function() {
n@1105 4861 jQuery.event.add( this, types, fn, data, selector );
n@1105 4862 });
n@1105 4863 },
n@1105 4864 one: function( types, selector, data, fn ) {
n@1105 4865 return this.on( types, selector, data, fn, 1 );
n@1105 4866 },
n@1105 4867 off: function( types, selector, fn ) {
n@1105 4868 var handleObj, type;
n@1105 4869 if ( types && types.preventDefault && types.handleObj ) {
n@1105 4870 // ( event ) dispatched jQuery.Event
n@1105 4871 handleObj = types.handleObj;
n@1105 4872 jQuery( types.delegateTarget ).off(
n@1105 4873 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
n@1105 4874 handleObj.selector,
n@1105 4875 handleObj.handler
n@1105 4876 );
n@1105 4877 return this;
n@1105 4878 }
n@1105 4879 if ( typeof types === "object" ) {
n@1105 4880 // ( types-object [, selector] )
n@1105 4881 for ( type in types ) {
n@1105 4882 this.off( type, selector, types[ type ] );
n@1105 4883 }
n@1105 4884 return this;
n@1105 4885 }
n@1105 4886 if ( selector === false || typeof selector === "function" ) {
n@1105 4887 // ( types [, fn] )
n@1105 4888 fn = selector;
n@1105 4889 selector = undefined;
n@1105 4890 }
n@1105 4891 if ( fn === false ) {
n@1105 4892 fn = returnFalse;
n@1105 4893 }
n@1105 4894 return this.each(function() {
n@1105 4895 jQuery.event.remove( this, types, fn, selector );
n@1105 4896 });
n@1105 4897 },
n@1105 4898
n@1105 4899 trigger: function( type, data ) {
n@1105 4900 return this.each(function() {
n@1105 4901 jQuery.event.trigger( type, data, this );
n@1105 4902 });
n@1105 4903 },
n@1105 4904 triggerHandler: function( type, data ) {
n@1105 4905 var elem = this[0];
n@1105 4906 if ( elem ) {
n@1105 4907 return jQuery.event.trigger( type, data, elem, true );
n@1105 4908 }
n@1105 4909 }
n@1105 4910 });
n@1105 4911
n@1105 4912
n@1105 4913 var
n@1105 4914 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
n@1105 4915 rtagName = /<([\w:]+)/,
n@1105 4916 rhtml = /<|&#?\w+;/,
n@1105 4917 rnoInnerhtml = /<(?:script|style|link)/i,
n@1105 4918 // checked="checked" or checked
n@1105 4919 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
n@1105 4920 rscriptType = /^$|\/(?:java|ecma)script/i,
n@1105 4921 rscriptTypeMasked = /^true\/(.*)/,
n@1105 4922 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
n@1105 4923
n@1105 4924 // We have to close these tags to support XHTML (#13200)
n@1105 4925 wrapMap = {
n@1105 4926
n@1105 4927 // Support: IE9
n@1105 4928 option: [ 1, "<select multiple='multiple'>", "</select>" ],
n@1105 4929
n@1105 4930 thead: [ 1, "<table>", "</table>" ],
n@1105 4931 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
n@1105 4932 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
n@1105 4933 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
n@1105 4934
n@1105 4935 _default: [ 0, "", "" ]
n@1105 4936 };
n@1105 4937
n@1105 4938 // Support: IE9
n@1105 4939 wrapMap.optgroup = wrapMap.option;
n@1105 4940
n@1105 4941 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
n@1105 4942 wrapMap.th = wrapMap.td;
n@1105 4943
n@1105 4944 // Support: 1.x compatibility
n@1105 4945 // Manipulating tables requires a tbody
n@1105 4946 function manipulationTarget( elem, content ) {
n@1105 4947 return jQuery.nodeName( elem, "table" ) &&
n@1105 4948 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
n@1105 4949
n@1105 4950 elem.getElementsByTagName("tbody")[0] ||
n@1105 4951 elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
n@1105 4952 elem;
n@1105 4953 }
n@1105 4954
n@1105 4955 // Replace/restore the type attribute of script elements for safe DOM manipulation
n@1105 4956 function disableScript( elem ) {
n@1105 4957 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
n@1105 4958 return elem;
n@1105 4959 }
n@1105 4960 function restoreScript( elem ) {
n@1105 4961 var match = rscriptTypeMasked.exec( elem.type );
n@1105 4962
n@1105 4963 if ( match ) {
n@1105 4964 elem.type = match[ 1 ];
n@1105 4965 } else {
n@1105 4966 elem.removeAttribute("type");
n@1105 4967 }
n@1105 4968
n@1105 4969 return elem;
n@1105 4970 }
n@1105 4971
n@1105 4972 // Mark scripts as having already been evaluated
n@1105 4973 function setGlobalEval( elems, refElements ) {
n@1105 4974 var i = 0,
n@1105 4975 l = elems.length;
n@1105 4976
n@1105 4977 for ( ; i < l; i++ ) {
n@1105 4978 data_priv.set(
n@1105 4979 elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
n@1105 4980 );
n@1105 4981 }
n@1105 4982 }
n@1105 4983
n@1105 4984 function cloneCopyEvent( src, dest ) {
n@1105 4985 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
n@1105 4986
n@1105 4987 if ( dest.nodeType !== 1 ) {
n@1105 4988 return;
n@1105 4989 }
n@1105 4990
n@1105 4991 // 1. Copy private data: events, handlers, etc.
n@1105 4992 if ( data_priv.hasData( src ) ) {
n@1105 4993 pdataOld = data_priv.access( src );
n@1105 4994 pdataCur = data_priv.set( dest, pdataOld );
n@1105 4995 events = pdataOld.events;
n@1105 4996
n@1105 4997 if ( events ) {
n@1105 4998 delete pdataCur.handle;
n@1105 4999 pdataCur.events = {};
n@1105 5000
n@1105 5001 for ( type in events ) {
n@1105 5002 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
n@1105 5003 jQuery.event.add( dest, type, events[ type ][ i ] );
n@1105 5004 }
n@1105 5005 }
n@1105 5006 }
n@1105 5007 }
n@1105 5008
n@1105 5009 // 2. Copy user data
n@1105 5010 if ( data_user.hasData( src ) ) {
n@1105 5011 udataOld = data_user.access( src );
n@1105 5012 udataCur = jQuery.extend( {}, udataOld );
n@1105 5013
n@1105 5014 data_user.set( dest, udataCur );
n@1105 5015 }
n@1105 5016 }
n@1105 5017
n@1105 5018 function getAll( context, tag ) {
n@1105 5019 var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
n@1105 5020 context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
n@1105 5021 [];
n@1105 5022
n@1105 5023 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
n@1105 5024 jQuery.merge( [ context ], ret ) :
n@1105 5025 ret;
n@1105 5026 }
n@1105 5027
n@1105 5028 // Fix IE bugs, see support tests
n@1105 5029 function fixInput( src, dest ) {
n@1105 5030 var nodeName = dest.nodeName.toLowerCase();
n@1105 5031
n@1105 5032 // Fails to persist the checked state of a cloned checkbox or radio button.
n@1105 5033 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
n@1105 5034 dest.checked = src.checked;
n@1105 5035
n@1105 5036 // Fails to return the selected option to the default selected state when cloning options
n@1105 5037 } else if ( nodeName === "input" || nodeName === "textarea" ) {
n@1105 5038 dest.defaultValue = src.defaultValue;
n@1105 5039 }
n@1105 5040 }
n@1105 5041
n@1105 5042 jQuery.extend({
n@1105 5043 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
n@1105 5044 var i, l, srcElements, destElements,
n@1105 5045 clone = elem.cloneNode( true ),
n@1105 5046 inPage = jQuery.contains( elem.ownerDocument, elem );
n@1105 5047
n@1105 5048 // Fix IE cloning issues
n@1105 5049 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
n@1105 5050 !jQuery.isXMLDoc( elem ) ) {
n@1105 5051
n@1105 5052 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
n@1105 5053 destElements = getAll( clone );
n@1105 5054 srcElements = getAll( elem );
n@1105 5055
n@1105 5056 for ( i = 0, l = srcElements.length; i < l; i++ ) {
n@1105 5057 fixInput( srcElements[ i ], destElements[ i ] );
n@1105 5058 }
n@1105 5059 }
n@1105 5060
n@1105 5061 // Copy the events from the original to the clone
n@1105 5062 if ( dataAndEvents ) {
n@1105 5063 if ( deepDataAndEvents ) {
n@1105 5064 srcElements = srcElements || getAll( elem );
n@1105 5065 destElements = destElements || getAll( clone );
n@1105 5066
n@1105 5067 for ( i = 0, l = srcElements.length; i < l; i++ ) {
n@1105 5068 cloneCopyEvent( srcElements[ i ], destElements[ i ] );
n@1105 5069 }
n@1105 5070 } else {
n@1105 5071 cloneCopyEvent( elem, clone );
n@1105 5072 }
n@1105 5073 }
n@1105 5074
n@1105 5075 // Preserve script evaluation history
n@1105 5076 destElements = getAll( clone, "script" );
n@1105 5077 if ( destElements.length > 0 ) {
n@1105 5078 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
n@1105 5079 }
n@1105 5080
n@1105 5081 // Return the cloned set
n@1105 5082 return clone;
n@1105 5083 },
n@1105 5084
n@1105 5085 buildFragment: function( elems, context, scripts, selection ) {
n@1105 5086 var elem, tmp, tag, wrap, contains, j,
n@1105 5087 fragment = context.createDocumentFragment(),
n@1105 5088 nodes = [],
n@1105 5089 i = 0,
n@1105 5090 l = elems.length;
n@1105 5091
n@1105 5092 for ( ; i < l; i++ ) {
n@1105 5093 elem = elems[ i ];
n@1105 5094
n@1105 5095 if ( elem || elem === 0 ) {
n@1105 5096
n@1105 5097 // Add nodes directly
n@1105 5098 if ( jQuery.type( elem ) === "object" ) {
n@1105 5099 // Support: QtWebKit, PhantomJS
n@1105 5100 // push.apply(_, arraylike) throws on ancient WebKit
n@1105 5101 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
n@1105 5102
n@1105 5103 // Convert non-html into a text node
n@1105 5104 } else if ( !rhtml.test( elem ) ) {
n@1105 5105 nodes.push( context.createTextNode( elem ) );
n@1105 5106
n@1105 5107 // Convert html into DOM nodes
n@1105 5108 } else {
n@1105 5109 tmp = tmp || fragment.appendChild( context.createElement("div") );
n@1105 5110
n@1105 5111 // Deserialize a standard representation
n@1105 5112 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
n@1105 5113 wrap = wrapMap[ tag ] || wrapMap._default;
n@1105 5114 tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
n@1105 5115
n@1105 5116 // Descend through wrappers to the right content
n@1105 5117 j = wrap[ 0 ];
n@1105 5118 while ( j-- ) {
n@1105 5119 tmp = tmp.lastChild;
n@1105 5120 }
n@1105 5121
n@1105 5122 // Support: QtWebKit, PhantomJS
n@1105 5123 // push.apply(_, arraylike) throws on ancient WebKit
n@1105 5124 jQuery.merge( nodes, tmp.childNodes );
n@1105 5125
n@1105 5126 // Remember the top-level container
n@1105 5127 tmp = fragment.firstChild;
n@1105 5128
n@1105 5129 // Ensure the created nodes are orphaned (#12392)
n@1105 5130 tmp.textContent = "";
n@1105 5131 }
n@1105 5132 }
n@1105 5133 }
n@1105 5134
n@1105 5135 // Remove wrapper from fragment
n@1105 5136 fragment.textContent = "";
n@1105 5137
n@1105 5138 i = 0;
n@1105 5139 while ( (elem = nodes[ i++ ]) ) {
n@1105 5140
n@1105 5141 // #4087 - If origin and destination elements are the same, and this is
n@1105 5142 // that element, do not do anything
n@1105 5143 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
n@1105 5144 continue;
n@1105 5145 }
n@1105 5146
n@1105 5147 contains = jQuery.contains( elem.ownerDocument, elem );
n@1105 5148
n@1105 5149 // Append to fragment
n@1105 5150 tmp = getAll( fragment.appendChild( elem ), "script" );
n@1105 5151
n@1105 5152 // Preserve script evaluation history
n@1105 5153 if ( contains ) {
n@1105 5154 setGlobalEval( tmp );
n@1105 5155 }
n@1105 5156
n@1105 5157 // Capture executables
n@1105 5158 if ( scripts ) {
n@1105 5159 j = 0;
n@1105 5160 while ( (elem = tmp[ j++ ]) ) {
n@1105 5161 if ( rscriptType.test( elem.type || "" ) ) {
n@1105 5162 scripts.push( elem );
n@1105 5163 }
n@1105 5164 }
n@1105 5165 }
n@1105 5166 }
n@1105 5167
n@1105 5168 return fragment;
n@1105 5169 },
n@1105 5170
n@1105 5171 cleanData: function( elems ) {
n@1105 5172 var data, elem, type, key,
n@1105 5173 special = jQuery.event.special,
n@1105 5174 i = 0;
n@1105 5175
n@1105 5176 for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
n@1105 5177 if ( jQuery.acceptData( elem ) ) {
n@1105 5178 key = elem[ data_priv.expando ];
n@1105 5179
n@1105 5180 if ( key && (data = data_priv.cache[ key ]) ) {
n@1105 5181 if ( data.events ) {
n@1105 5182 for ( type in data.events ) {
n@1105 5183 if ( special[ type ] ) {
n@1105 5184 jQuery.event.remove( elem, type );
n@1105 5185
n@1105 5186 // This is a shortcut to avoid jQuery.event.remove's overhead
n@1105 5187 } else {
n@1105 5188 jQuery.removeEvent( elem, type, data.handle );
n@1105 5189 }
n@1105 5190 }
n@1105 5191 }
n@1105 5192 if ( data_priv.cache[ key ] ) {
n@1105 5193 // Discard any remaining `private` data
n@1105 5194 delete data_priv.cache[ key ];
n@1105 5195 }
n@1105 5196 }
n@1105 5197 }
n@1105 5198 // Discard any remaining `user` data
n@1105 5199 delete data_user.cache[ elem[ data_user.expando ] ];
n@1105 5200 }
n@1105 5201 }
n@1105 5202 });
n@1105 5203
n@1105 5204 jQuery.fn.extend({
n@1105 5205 text: function( value ) {
n@1105 5206 return access( this, function( value ) {
n@1105 5207 return value === undefined ?
n@1105 5208 jQuery.text( this ) :
n@1105 5209 this.empty().each(function() {
n@1105 5210 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
n@1105 5211 this.textContent = value;
n@1105 5212 }
n@1105 5213 });
n@1105 5214 }, null, value, arguments.length );
n@1105 5215 },
n@1105 5216
n@1105 5217 append: function() {
n@1105 5218 return this.domManip( arguments, function( elem ) {
n@1105 5219 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
n@1105 5220 var target = manipulationTarget( this, elem );
n@1105 5221 target.appendChild( elem );
n@1105 5222 }
n@1105 5223 });
n@1105 5224 },
n@1105 5225
n@1105 5226 prepend: function() {
n@1105 5227 return this.domManip( arguments, function( elem ) {
n@1105 5228 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
n@1105 5229 var target = manipulationTarget( this, elem );
n@1105 5230 target.insertBefore( elem, target.firstChild );
n@1105 5231 }
n@1105 5232 });
n@1105 5233 },
n@1105 5234
n@1105 5235 before: function() {
n@1105 5236 return this.domManip( arguments, function( elem ) {
n@1105 5237 if ( this.parentNode ) {
n@1105 5238 this.parentNode.insertBefore( elem, this );
n@1105 5239 }
n@1105 5240 });
n@1105 5241 },
n@1105 5242
n@1105 5243 after: function() {
n@1105 5244 return this.domManip( arguments, function( elem ) {
n@1105 5245 if ( this.parentNode ) {
n@1105 5246 this.parentNode.insertBefore( elem, this.nextSibling );
n@1105 5247 }
n@1105 5248 });
n@1105 5249 },
n@1105 5250
n@1105 5251 remove: function( selector, keepData /* Internal Use Only */ ) {
n@1105 5252 var elem,
n@1105 5253 elems = selector ? jQuery.filter( selector, this ) : this,
n@1105 5254 i = 0;
n@1105 5255
n@1105 5256 for ( ; (elem = elems[i]) != null; i++ ) {
n@1105 5257 if ( !keepData && elem.nodeType === 1 ) {
n@1105 5258 jQuery.cleanData( getAll( elem ) );
n@1105 5259 }
n@1105 5260
n@1105 5261 if ( elem.parentNode ) {
n@1105 5262 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
n@1105 5263 setGlobalEval( getAll( elem, "script" ) );
n@1105 5264 }
n@1105 5265 elem.parentNode.removeChild( elem );
n@1105 5266 }
n@1105 5267 }
n@1105 5268
n@1105 5269 return this;
n@1105 5270 },
n@1105 5271
n@1105 5272 empty: function() {
n@1105 5273 var elem,
n@1105 5274 i = 0;
n@1105 5275
n@1105 5276 for ( ; (elem = this[i]) != null; i++ ) {
n@1105 5277 if ( elem.nodeType === 1 ) {
n@1105 5278
n@1105 5279 // Prevent memory leaks
n@1105 5280 jQuery.cleanData( getAll( elem, false ) );
n@1105 5281
n@1105 5282 // Remove any remaining nodes
n@1105 5283 elem.textContent = "";
n@1105 5284 }
n@1105 5285 }
n@1105 5286
n@1105 5287 return this;
n@1105 5288 },
n@1105 5289
n@1105 5290 clone: function( dataAndEvents, deepDataAndEvents ) {
n@1105 5291 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
n@1105 5292 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
n@1105 5293
n@1105 5294 return this.map(function() {
n@1105 5295 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
n@1105 5296 });
n@1105 5297 },
n@1105 5298
n@1105 5299 html: function( value ) {
n@1105 5300 return access( this, function( value ) {
n@1105 5301 var elem = this[ 0 ] || {},
n@1105 5302 i = 0,
n@1105 5303 l = this.length;
n@1105 5304
n@1105 5305 if ( value === undefined && elem.nodeType === 1 ) {
n@1105 5306 return elem.innerHTML;
n@1105 5307 }
n@1105 5308
n@1105 5309 // See if we can take a shortcut and just use innerHTML
n@1105 5310 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
n@1105 5311 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
n@1105 5312
n@1105 5313 value = value.replace( rxhtmlTag, "<$1></$2>" );
n@1105 5314
n@1105 5315 try {
n@1105 5316 for ( ; i < l; i++ ) {
n@1105 5317 elem = this[ i ] || {};
n@1105 5318
n@1105 5319 // Remove element nodes and prevent memory leaks
n@1105 5320 if ( elem.nodeType === 1 ) {
n@1105 5321 jQuery.cleanData( getAll( elem, false ) );
n@1105 5322 elem.innerHTML = value;
n@1105 5323 }
n@1105 5324 }
n@1105 5325
n@1105 5326 elem = 0;
n@1105 5327
n@1105 5328 // If using innerHTML throws an exception, use the fallback method
n@1105 5329 } catch( e ) {}
n@1105 5330 }
n@1105 5331
n@1105 5332 if ( elem ) {
n@1105 5333 this.empty().append( value );
n@1105 5334 }
n@1105 5335 }, null, value, arguments.length );
n@1105 5336 },
n@1105 5337
n@1105 5338 replaceWith: function() {
n@1105 5339 var arg = arguments[ 0 ];
n@1105 5340
n@1105 5341 // Make the changes, replacing each context element with the new content
n@1105 5342 this.domManip( arguments, function( elem ) {
n@1105 5343 arg = this.parentNode;
n@1105 5344
n@1105 5345 jQuery.cleanData( getAll( this ) );
n@1105 5346
n@1105 5347 if ( arg ) {
n@1105 5348 arg.replaceChild( elem, this );
n@1105 5349 }
n@1105 5350 });
n@1105 5351
n@1105 5352 // Force removal if there was no new content (e.g., from empty arguments)
n@1105 5353 return arg && (arg.length || arg.nodeType) ? this : this.remove();
n@1105 5354 },
n@1105 5355
n@1105 5356 detach: function( selector ) {
n@1105 5357 return this.remove( selector, true );
n@1105 5358 },
n@1105 5359
n@1105 5360 domManip: function( args, callback ) {
n@1105 5361
n@1105 5362 // Flatten any nested arrays
n@1105 5363 args = concat.apply( [], args );
n@1105 5364
n@1105 5365 var fragment, first, scripts, hasScripts, node, doc,
n@1105 5366 i = 0,
n@1105 5367 l = this.length,
n@1105 5368 set = this,
n@1105 5369 iNoClone = l - 1,
n@1105 5370 value = args[ 0 ],
n@1105 5371 isFunction = jQuery.isFunction( value );
n@1105 5372
n@1105 5373 // We can't cloneNode fragments that contain checked, in WebKit
n@1105 5374 if ( isFunction ||
n@1105 5375 ( l > 1 && typeof value === "string" &&
n@1105 5376 !support.checkClone && rchecked.test( value ) ) ) {
n@1105 5377 return this.each(function( index ) {
n@1105 5378 var self = set.eq( index );
n@1105 5379 if ( isFunction ) {
n@1105 5380 args[ 0 ] = value.call( this, index, self.html() );
n@1105 5381 }
n@1105 5382 self.domManip( args, callback );
n@1105 5383 });
n@1105 5384 }
n@1105 5385
n@1105 5386 if ( l ) {
n@1105 5387 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
n@1105 5388 first = fragment.firstChild;
n@1105 5389
n@1105 5390 if ( fragment.childNodes.length === 1 ) {
n@1105 5391 fragment = first;
n@1105 5392 }
n@1105 5393
n@1105 5394 if ( first ) {
n@1105 5395 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
n@1105 5396 hasScripts = scripts.length;
n@1105 5397
n@1105 5398 // Use the original fragment for the last item instead of the first because it can end up
n@1105 5399 // being emptied incorrectly in certain situations (#8070).
n@1105 5400 for ( ; i < l; i++ ) {
n@1105 5401 node = fragment;
n@1105 5402
n@1105 5403 if ( i !== iNoClone ) {
n@1105 5404 node = jQuery.clone( node, true, true );
n@1105 5405
n@1105 5406 // Keep references to cloned scripts for later restoration
n@1105 5407 if ( hasScripts ) {
n@1105 5408 // Support: QtWebKit
n@1105 5409 // jQuery.merge because push.apply(_, arraylike) throws
n@1105 5410 jQuery.merge( scripts, getAll( node, "script" ) );
n@1105 5411 }
n@1105 5412 }
n@1105 5413
n@1105 5414 callback.call( this[ i ], node, i );
n@1105 5415 }
n@1105 5416
n@1105 5417 if ( hasScripts ) {
n@1105 5418 doc = scripts[ scripts.length - 1 ].ownerDocument;
n@1105 5419
n@1105 5420 // Reenable scripts
n@1105 5421 jQuery.map( scripts, restoreScript );
n@1105 5422
n@1105 5423 // Evaluate executable scripts on first document insertion
n@1105 5424 for ( i = 0; i < hasScripts; i++ ) {
n@1105 5425 node = scripts[ i ];
n@1105 5426 if ( rscriptType.test( node.type || "" ) &&
n@1105 5427 !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
n@1105 5428
n@1105 5429 if ( node.src ) {
n@1105 5430 // Optional AJAX dependency, but won't run scripts if not present
n@1105 5431 if ( jQuery._evalUrl ) {
n@1105 5432 jQuery._evalUrl( node.src );
n@1105 5433 }
n@1105 5434 } else {
n@1105 5435 jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
n@1105 5436 }
n@1105 5437 }
n@1105 5438 }
n@1105 5439 }
n@1105 5440 }
n@1105 5441 }
n@1105 5442
n@1105 5443 return this;
n@1105 5444 }
n@1105 5445 });
n@1105 5446
n@1105 5447 jQuery.each({
n@1105 5448 appendTo: "append",
n@1105 5449 prependTo: "prepend",
n@1105 5450 insertBefore: "before",
n@1105 5451 insertAfter: "after",
n@1105 5452 replaceAll: "replaceWith"
n@1105 5453 }, function( name, original ) {
n@1105 5454 jQuery.fn[ name ] = function( selector ) {
n@1105 5455 var elems,
n@1105 5456 ret = [],
n@1105 5457 insert = jQuery( selector ),
n@1105 5458 last = insert.length - 1,
n@1105 5459 i = 0;
n@1105 5460
n@1105 5461 for ( ; i <= last; i++ ) {
n@1105 5462 elems = i === last ? this : this.clone( true );
n@1105 5463 jQuery( insert[ i ] )[ original ]( elems );
n@1105 5464
n@1105 5465 // Support: QtWebKit
n@1105 5466 // .get() because push.apply(_, arraylike) throws
n@1105 5467 push.apply( ret, elems.get() );
n@1105 5468 }
n@1105 5469
n@1105 5470 return this.pushStack( ret );
n@1105 5471 };
n@1105 5472 });
n@1105 5473
n@1105 5474
n@1105 5475 var iframe,
n@1105 5476 elemdisplay = {};
n@1105 5477
n@1105 5478 /**
n@1105 5479 * Retrieve the actual display of a element
n@1105 5480 * @param {String} name nodeName of the element
n@1105 5481 * @param {Object} doc Document object
n@1105 5482 */
n@1105 5483 // Called only from within defaultDisplay
n@1105 5484 function actualDisplay( name, doc ) {
n@1105 5485 var style,
n@1105 5486 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
n@1105 5487
n@1105 5488 // getDefaultComputedStyle might be reliably used only on attached element
n@1105 5489 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
n@1105 5490
n@1105 5491 // Use of this method is a temporary fix (more like optimization) until something better comes along,
n@1105 5492 // since it was removed from specification and supported only in FF
n@1105 5493 style.display : jQuery.css( elem[ 0 ], "display" );
n@1105 5494
n@1105 5495 // We don't have any data stored on the element,
n@1105 5496 // so use "detach" method as fast way to get rid of the element
n@1105 5497 elem.detach();
n@1105 5498
n@1105 5499 return display;
n@1105 5500 }
n@1105 5501
n@1105 5502 /**
n@1105 5503 * Try to determine the default display value of an element
n@1105 5504 * @param {String} nodeName
n@1105 5505 */
n@1105 5506 function defaultDisplay( nodeName ) {
n@1105 5507 var doc = document,
n@1105 5508 display = elemdisplay[ nodeName ];
n@1105 5509
n@1105 5510 if ( !display ) {
n@1105 5511 display = actualDisplay( nodeName, doc );
n@1105 5512
n@1105 5513 // If the simple way fails, read from inside an iframe
n@1105 5514 if ( display === "none" || !display ) {
n@1105 5515
n@1105 5516 // Use the already-created iframe if possible
n@1105 5517 iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
n@1105 5518
n@1105 5519 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
n@1105 5520 doc = iframe[ 0 ].contentDocument;
n@1105 5521
n@1105 5522 // Support: IE
n@1105 5523 doc.write();
n@1105 5524 doc.close();
n@1105 5525
n@1105 5526 display = actualDisplay( nodeName, doc );
n@1105 5527 iframe.detach();
n@1105 5528 }
n@1105 5529
n@1105 5530 // Store the correct default display
n@1105 5531 elemdisplay[ nodeName ] = display;
n@1105 5532 }
n@1105 5533
n@1105 5534 return display;
n@1105 5535 }
n@1105 5536 var rmargin = (/^margin/);
n@1105 5537
n@1105 5538 var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
n@1105 5539
n@1105 5540 var getStyles = function( elem ) {
n@1105 5541 // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
n@1105 5542 // IE throws on elements created in popups
n@1105 5543 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
n@1105 5544 if ( elem.ownerDocument.defaultView.opener ) {
n@1105 5545 return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
n@1105 5546 }
n@1105 5547
n@1105 5548 return window.getComputedStyle( elem, null );
n@1105 5549 };
n@1105 5550
n@1105 5551
n@1105 5552
n@1105 5553 function curCSS( elem, name, computed ) {
n@1105 5554 var width, minWidth, maxWidth, ret,
n@1105 5555 style = elem.style;
n@1105 5556
n@1105 5557 computed = computed || getStyles( elem );
n@1105 5558
n@1105 5559 // Support: IE9
n@1105 5560 // getPropertyValue is only needed for .css('filter') (#12537)
n@1105 5561 if ( computed ) {
n@1105 5562 ret = computed.getPropertyValue( name ) || computed[ name ];
n@1105 5563 }
n@1105 5564
n@1105 5565 if ( computed ) {
n@1105 5566
n@1105 5567 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
n@1105 5568 ret = jQuery.style( elem, name );
n@1105 5569 }
n@1105 5570
n@1105 5571 // Support: iOS < 6
n@1105 5572 // A tribute to the "awesome hack by Dean Edwards"
n@1105 5573 // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
n@1105 5574 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
n@1105 5575 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
n@1105 5576
n@1105 5577 // Remember the original values
n@1105 5578 width = style.width;
n@1105 5579 minWidth = style.minWidth;
n@1105 5580 maxWidth = style.maxWidth;
n@1105 5581
n@1105 5582 // Put in the new values to get a computed value out
n@1105 5583 style.minWidth = style.maxWidth = style.width = ret;
n@1105 5584 ret = computed.width;
n@1105 5585
n@1105 5586 // Revert the changed values
n@1105 5587 style.width = width;
n@1105 5588 style.minWidth = minWidth;
n@1105 5589 style.maxWidth = maxWidth;
n@1105 5590 }
n@1105 5591 }
n@1105 5592
n@1105 5593 return ret !== undefined ?
n@1105 5594 // Support: IE
n@1105 5595 // IE returns zIndex value as an integer.
n@1105 5596 ret + "" :
n@1105 5597 ret;
n@1105 5598 }
n@1105 5599
n@1105 5600
n@1105 5601 function addGetHookIf( conditionFn, hookFn ) {
n@1105 5602 // Define the hook, we'll check on the first run if it's really needed.
n@1105 5603 return {
n@1105 5604 get: function() {
n@1105 5605 if ( conditionFn() ) {
n@1105 5606 // Hook not needed (or it's not possible to use it due
n@1105 5607 // to missing dependency), remove it.
n@1105 5608 delete this.get;
n@1105 5609 return;
n@1105 5610 }
n@1105 5611
n@1105 5612 // Hook needed; redefine it so that the support test is not executed again.
n@1105 5613 return (this.get = hookFn).apply( this, arguments );
n@1105 5614 }
n@1105 5615 };
n@1105 5616 }
n@1105 5617
n@1105 5618
n@1105 5619 (function() {
n@1105 5620 var pixelPositionVal, boxSizingReliableVal,
n@1105 5621 docElem = document.documentElement,
n@1105 5622 container = document.createElement( "div" ),
n@1105 5623 div = document.createElement( "div" );
n@1105 5624
n@1105 5625 if ( !div.style ) {
n@1105 5626 return;
n@1105 5627 }
n@1105 5628
n@1105 5629 // Support: IE9-11+
n@1105 5630 // Style of cloned element affects source element cloned (#8908)
n@1105 5631 div.style.backgroundClip = "content-box";
n@1105 5632 div.cloneNode( true ).style.backgroundClip = "";
n@1105 5633 support.clearCloneStyle = div.style.backgroundClip === "content-box";
n@1105 5634
n@1105 5635 container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
n@1105 5636 "position:absolute";
n@1105 5637 container.appendChild( div );
n@1105 5638
n@1105 5639 // Executing both pixelPosition & boxSizingReliable tests require only one layout
n@1105 5640 // so they're executed at the same time to save the second computation.
n@1105 5641 function computePixelPositionAndBoxSizingReliable() {
n@1105 5642 div.style.cssText =
n@1105 5643 // Support: Firefox<29, Android 2.3
n@1105 5644 // Vendor-prefix box-sizing
n@1105 5645 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
n@1105 5646 "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
n@1105 5647 "border:1px;padding:1px;width:4px;position:absolute";
n@1105 5648 div.innerHTML = "";
n@1105 5649 docElem.appendChild( container );
n@1105 5650
n@1105 5651 var divStyle = window.getComputedStyle( div, null );
n@1105 5652 pixelPositionVal = divStyle.top !== "1%";
n@1105 5653 boxSizingReliableVal = divStyle.width === "4px";
n@1105 5654
n@1105 5655 docElem.removeChild( container );
n@1105 5656 }
n@1105 5657
n@1105 5658 // Support: node.js jsdom
n@1105 5659 // Don't assume that getComputedStyle is a property of the global object
n@1105 5660 if ( window.getComputedStyle ) {
n@1105 5661 jQuery.extend( support, {
n@1105 5662 pixelPosition: function() {
n@1105 5663
n@1105 5664 // This test is executed only once but we still do memoizing
n@1105 5665 // since we can use the boxSizingReliable pre-computing.
n@1105 5666 // No need to check if the test was already performed, though.
n@1105 5667 computePixelPositionAndBoxSizingReliable();
n@1105 5668 return pixelPositionVal;
n@1105 5669 },
n@1105 5670 boxSizingReliable: function() {
n@1105 5671 if ( boxSizingReliableVal == null ) {
n@1105 5672 computePixelPositionAndBoxSizingReliable();
n@1105 5673 }
n@1105 5674 return boxSizingReliableVal;
n@1105 5675 },
n@1105 5676 reliableMarginRight: function() {
n@1105 5677
n@1105 5678 // Support: Android 2.3
n@1105 5679 // Check if div with explicit width and no margin-right incorrectly
n@1105 5680 // gets computed margin-right based on width of container. (#3333)
n@1105 5681 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
n@1105 5682 // This support function is only executed once so no memoizing is needed.
n@1105 5683 var ret,
n@1105 5684 marginDiv = div.appendChild( document.createElement( "div" ) );
n@1105 5685
n@1105 5686 // Reset CSS: box-sizing; display; margin; border; padding
n@1105 5687 marginDiv.style.cssText = div.style.cssText =
n@1105 5688 // Support: Firefox<29, Android 2.3
n@1105 5689 // Vendor-prefix box-sizing
n@1105 5690 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
n@1105 5691 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
n@1105 5692 marginDiv.style.marginRight = marginDiv.style.width = "0";
n@1105 5693 div.style.width = "1px";
n@1105 5694 docElem.appendChild( container );
n@1105 5695
n@1105 5696 ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
n@1105 5697
n@1105 5698 docElem.removeChild( container );
n@1105 5699 div.removeChild( marginDiv );
n@1105 5700
n@1105 5701 return ret;
n@1105 5702 }
n@1105 5703 });
n@1105 5704 }
n@1105 5705 })();
n@1105 5706
n@1105 5707
n@1105 5708 // A method for quickly swapping in/out CSS properties to get correct calculations.
n@1105 5709 jQuery.swap = function( elem, options, callback, args ) {
n@1105 5710 var ret, name,
n@1105 5711 old = {};
n@1105 5712
n@1105 5713 // Remember the old values, and insert the new ones
n@1105 5714 for ( name in options ) {
n@1105 5715 old[ name ] = elem.style[ name ];
n@1105 5716 elem.style[ name ] = options[ name ];
n@1105 5717 }
n@1105 5718
n@1105 5719 ret = callback.apply( elem, args || [] );
n@1105 5720
n@1105 5721 // Revert the old values
n@1105 5722 for ( name in options ) {
n@1105 5723 elem.style[ name ] = old[ name ];
n@1105 5724 }
n@1105 5725
n@1105 5726 return ret;
n@1105 5727 };
n@1105 5728
n@1105 5729
n@1105 5730 var
n@1105 5731 // Swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
n@1105 5732 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
n@1105 5733 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
n@1105 5734 rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
n@1105 5735 rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
n@1105 5736
n@1105 5737 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
n@1105 5738 cssNormalTransform = {
n@1105 5739 letterSpacing: "0",
n@1105 5740 fontWeight: "400"
n@1105 5741 },
n@1105 5742
n@1105 5743 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
n@1105 5744
n@1105 5745 // Return a css property mapped to a potentially vendor prefixed property
n@1105 5746 function vendorPropName( style, name ) {
n@1105 5747
n@1105 5748 // Shortcut for names that are not vendor prefixed
n@1105 5749 if ( name in style ) {
n@1105 5750 return name;
n@1105 5751 }
n@1105 5752
n@1105 5753 // Check for vendor prefixed names
n@1105 5754 var capName = name[0].toUpperCase() + name.slice(1),
n@1105 5755 origName = name,
n@1105 5756 i = cssPrefixes.length;
n@1105 5757
n@1105 5758 while ( i-- ) {
n@1105 5759 name = cssPrefixes[ i ] + capName;
n@1105 5760 if ( name in style ) {
n@1105 5761 return name;
n@1105 5762 }
n@1105 5763 }
n@1105 5764
n@1105 5765 return origName;
n@1105 5766 }
n@1105 5767
n@1105 5768 function setPositiveNumber( elem, value, subtract ) {
n@1105 5769 var matches = rnumsplit.exec( value );
n@1105 5770 return matches ?
n@1105 5771 // Guard against undefined "subtract", e.g., when used as in cssHooks
n@1105 5772 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
n@1105 5773 value;
n@1105 5774 }
n@1105 5775
n@1105 5776 function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
n@1105 5777 var i = extra === ( isBorderBox ? "border" : "content" ) ?
n@1105 5778 // If we already have the right measurement, avoid augmentation
n@1105 5779 4 :
n@1105 5780 // Otherwise initialize for horizontal or vertical properties
n@1105 5781 name === "width" ? 1 : 0,
n@1105 5782
n@1105 5783 val = 0;
n@1105 5784
n@1105 5785 for ( ; i < 4; i += 2 ) {
n@1105 5786 // Both box models exclude margin, so add it if we want it
n@1105 5787 if ( extra === "margin" ) {
n@1105 5788 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
n@1105 5789 }
n@1105 5790
n@1105 5791 if ( isBorderBox ) {
n@1105 5792 // border-box includes padding, so remove it if we want content
n@1105 5793 if ( extra === "content" ) {
n@1105 5794 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
n@1105 5795 }
n@1105 5796
n@1105 5797 // At this point, extra isn't border nor margin, so remove border
n@1105 5798 if ( extra !== "margin" ) {
n@1105 5799 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
n@1105 5800 }
n@1105 5801 } else {
n@1105 5802 // At this point, extra isn't content, so add padding
n@1105 5803 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
n@1105 5804
n@1105 5805 // At this point, extra isn't content nor padding, so add border
n@1105 5806 if ( extra !== "padding" ) {
n@1105 5807 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
n@1105 5808 }
n@1105 5809 }
n@1105 5810 }
n@1105 5811
n@1105 5812 return val;
n@1105 5813 }
n@1105 5814
n@1105 5815 function getWidthOrHeight( elem, name, extra ) {
n@1105 5816
n@1105 5817 // Start with offset property, which is equivalent to the border-box value
n@1105 5818 var valueIsBorderBox = true,
n@1105 5819 val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
n@1105 5820 styles = getStyles( elem ),
n@1105 5821 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
n@1105 5822
n@1105 5823 // Some non-html elements return undefined for offsetWidth, so check for null/undefined
n@1105 5824 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
n@1105 5825 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
n@1105 5826 if ( val <= 0 || val == null ) {
n@1105 5827 // Fall back to computed then uncomputed css if necessary
n@1105 5828 val = curCSS( elem, name, styles );
n@1105 5829 if ( val < 0 || val == null ) {
n@1105 5830 val = elem.style[ name ];
n@1105 5831 }
n@1105 5832
n@1105 5833 // Computed unit is not pixels. Stop here and return.
n@1105 5834 if ( rnumnonpx.test(val) ) {
n@1105 5835 return val;
n@1105 5836 }
n@1105 5837
n@1105 5838 // Check for style in case a browser which returns unreliable values
n@1105 5839 // for getComputedStyle silently falls back to the reliable elem.style
n@1105 5840 valueIsBorderBox = isBorderBox &&
n@1105 5841 ( support.boxSizingReliable() || val === elem.style[ name ] );
n@1105 5842
n@1105 5843 // Normalize "", auto, and prepare for extra
n@1105 5844 val = parseFloat( val ) || 0;
n@1105 5845 }
n@1105 5846
n@1105 5847 // Use the active box-sizing model to add/subtract irrelevant styles
n@1105 5848 return ( val +
n@1105 5849 augmentWidthOrHeight(
n@1105 5850 elem,
n@1105 5851 name,
n@1105 5852 extra || ( isBorderBox ? "border" : "content" ),
n@1105 5853 valueIsBorderBox,
n@1105 5854 styles
n@1105 5855 )
n@1105 5856 ) + "px";
n@1105 5857 }
n@1105 5858
n@1105 5859 function showHide( elements, show ) {
n@1105 5860 var display, elem, hidden,
n@1105 5861 values = [],
n@1105 5862 index = 0,
n@1105 5863 length = elements.length;
n@1105 5864
n@1105 5865 for ( ; index < length; index++ ) {
n@1105 5866 elem = elements[ index ];
n@1105 5867 if ( !elem.style ) {
n@1105 5868 continue;
n@1105 5869 }
n@1105 5870
n@1105 5871 values[ index ] = data_priv.get( elem, "olddisplay" );
n@1105 5872 display = elem.style.display;
n@1105 5873 if ( show ) {
n@1105 5874 // Reset the inline display of this element to learn if it is
n@1105 5875 // being hidden by cascaded rules or not
n@1105 5876 if ( !values[ index ] && display === "none" ) {
n@1105 5877 elem.style.display = "";
n@1105 5878 }
n@1105 5879
n@1105 5880 // Set elements which have been overridden with display: none
n@1105 5881 // in a stylesheet to whatever the default browser style is
n@1105 5882 // for such an element
n@1105 5883 if ( elem.style.display === "" && isHidden( elem ) ) {
n@1105 5884 values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
n@1105 5885 }
n@1105 5886 } else {
n@1105 5887 hidden = isHidden( elem );
n@1105 5888
n@1105 5889 if ( display !== "none" || !hidden ) {
n@1105 5890 data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
n@1105 5891 }
n@1105 5892 }
n@1105 5893 }
n@1105 5894
n@1105 5895 // Set the display of most of the elements in a second loop
n@1105 5896 // to avoid the constant reflow
n@1105 5897 for ( index = 0; index < length; index++ ) {
n@1105 5898 elem = elements[ index ];
n@1105 5899 if ( !elem.style ) {
n@1105 5900 continue;
n@1105 5901 }
n@1105 5902 if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
n@1105 5903 elem.style.display = show ? values[ index ] || "" : "none";
n@1105 5904 }
n@1105 5905 }
n@1105 5906
n@1105 5907 return elements;
n@1105 5908 }
n@1105 5909
n@1105 5910 jQuery.extend({
n@1105 5911
n@1105 5912 // Add in style property hooks for overriding the default
n@1105 5913 // behavior of getting and setting a style property
n@1105 5914 cssHooks: {
n@1105 5915 opacity: {
n@1105 5916 get: function( elem, computed ) {
n@1105 5917 if ( computed ) {
n@1105 5918
n@1105 5919 // We should always get a number back from opacity
n@1105 5920 var ret = curCSS( elem, "opacity" );
n@1105 5921 return ret === "" ? "1" : ret;
n@1105 5922 }
n@1105 5923 }
n@1105 5924 }
n@1105 5925 },
n@1105 5926
n@1105 5927 // Don't automatically add "px" to these possibly-unitless properties
n@1105 5928 cssNumber: {
n@1105 5929 "columnCount": true,
n@1105 5930 "fillOpacity": true,
n@1105 5931 "flexGrow": true,
n@1105 5932 "flexShrink": true,
n@1105 5933 "fontWeight": true,
n@1105 5934 "lineHeight": true,
n@1105 5935 "opacity": true,
n@1105 5936 "order": true,
n@1105 5937 "orphans": true,
n@1105 5938 "widows": true,
n@1105 5939 "zIndex": true,
n@1105 5940 "zoom": true
n@1105 5941 },
n@1105 5942
n@1105 5943 // Add in properties whose names you wish to fix before
n@1105 5944 // setting or getting the value
n@1105 5945 cssProps: {
n@1105 5946 "float": "cssFloat"
n@1105 5947 },
n@1105 5948
n@1105 5949 // Get and set the style property on a DOM Node
n@1105 5950 style: function( elem, name, value, extra ) {
n@1105 5951
n@1105 5952 // Don't set styles on text and comment nodes
n@1105 5953 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
n@1105 5954 return;
n@1105 5955 }
n@1105 5956
n@1105 5957 // Make sure that we're working with the right name
n@1105 5958 var ret, type, hooks,
n@1105 5959 origName = jQuery.camelCase( name ),
n@1105 5960 style = elem.style;
n@1105 5961
n@1105 5962 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
n@1105 5963
n@1105 5964 // Gets hook for the prefixed version, then unprefixed version
n@1105 5965 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
n@1105 5966
n@1105 5967 // Check if we're setting a value
n@1105 5968 if ( value !== undefined ) {
n@1105 5969 type = typeof value;
n@1105 5970
n@1105 5971 // Convert "+=" or "-=" to relative numbers (#7345)
n@1105 5972 if ( type === "string" && (ret = rrelNum.exec( value )) ) {
n@1105 5973 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
n@1105 5974 // Fixes bug #9237
n@1105 5975 type = "number";
n@1105 5976 }
n@1105 5977
n@1105 5978 // Make sure that null and NaN values aren't set (#7116)
n@1105 5979 if ( value == null || value !== value ) {
n@1105 5980 return;
n@1105 5981 }
n@1105 5982
n@1105 5983 // If a number, add 'px' to the (except for certain CSS properties)
n@1105 5984 if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
n@1105 5985 value += "px";
n@1105 5986 }
n@1105 5987
n@1105 5988 // Support: IE9-11+
n@1105 5989 // background-* props affect original clone's values
n@1105 5990 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
n@1105 5991 style[ name ] = "inherit";
n@1105 5992 }
n@1105 5993
n@1105 5994 // If a hook was provided, use that value, otherwise just set the specified value
n@1105 5995 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
n@1105 5996 style[ name ] = value;
n@1105 5997 }
n@1105 5998
n@1105 5999 } else {
n@1105 6000 // If a hook was provided get the non-computed value from there
n@1105 6001 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
n@1105 6002 return ret;
n@1105 6003 }
n@1105 6004
n@1105 6005 // Otherwise just get the value from the style object
n@1105 6006 return style[ name ];
n@1105 6007 }
n@1105 6008 },
n@1105 6009
n@1105 6010 css: function( elem, name, extra, styles ) {
n@1105 6011 var val, num, hooks,
n@1105 6012 origName = jQuery.camelCase( name );
n@1105 6013
n@1105 6014 // Make sure that we're working with the right name
n@1105 6015 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
n@1105 6016
n@1105 6017 // Try prefixed name followed by the unprefixed name
n@1105 6018 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
n@1105 6019
n@1105 6020 // If a hook was provided get the computed value from there
n@1105 6021 if ( hooks && "get" in hooks ) {
n@1105 6022 val = hooks.get( elem, true, extra );
n@1105 6023 }
n@1105 6024
n@1105 6025 // Otherwise, if a way to get the computed value exists, use that
n@1105 6026 if ( val === undefined ) {
n@1105 6027 val = curCSS( elem, name, styles );
n@1105 6028 }
n@1105 6029
n@1105 6030 // Convert "normal" to computed value
n@1105 6031 if ( val === "normal" && name in cssNormalTransform ) {
n@1105 6032 val = cssNormalTransform[ name ];
n@1105 6033 }
n@1105 6034
n@1105 6035 // Make numeric if forced or a qualifier was provided and val looks numeric
n@1105 6036 if ( extra === "" || extra ) {
n@1105 6037 num = parseFloat( val );
n@1105 6038 return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
n@1105 6039 }
n@1105 6040 return val;
n@1105 6041 }
n@1105 6042 });
n@1105 6043
n@1105 6044 jQuery.each([ "height", "width" ], function( i, name ) {
n@1105 6045 jQuery.cssHooks[ name ] = {
n@1105 6046 get: function( elem, computed, extra ) {
n@1105 6047 if ( computed ) {
n@1105 6048
n@1105 6049 // Certain elements can have dimension info if we invisibly show them
n@1105 6050 // but it must have a current display style that would benefit
n@1105 6051 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
n@1105 6052 jQuery.swap( elem, cssShow, function() {
n@1105 6053 return getWidthOrHeight( elem, name, extra );
n@1105 6054 }) :
n@1105 6055 getWidthOrHeight( elem, name, extra );
n@1105 6056 }
n@1105 6057 },
n@1105 6058
n@1105 6059 set: function( elem, value, extra ) {
n@1105 6060 var styles = extra && getStyles( elem );
n@1105 6061 return setPositiveNumber( elem, value, extra ?
n@1105 6062 augmentWidthOrHeight(
n@1105 6063 elem,
n@1105 6064 name,
n@1105 6065 extra,
n@1105 6066 jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
n@1105 6067 styles
n@1105 6068 ) : 0
n@1105 6069 );
n@1105 6070 }
n@1105 6071 };
n@1105 6072 });
n@1105 6073
n@1105 6074 // Support: Android 2.3
n@1105 6075 jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
n@1105 6076 function( elem, computed ) {
n@1105 6077 if ( computed ) {
n@1105 6078 return jQuery.swap( elem, { "display": "inline-block" },
n@1105 6079 curCSS, [ elem, "marginRight" ] );
n@1105 6080 }
n@1105 6081 }
n@1105 6082 );
n@1105 6083
n@1105 6084 // These hooks are used by animate to expand properties
n@1105 6085 jQuery.each({
n@1105 6086 margin: "",
n@1105 6087 padding: "",
n@1105 6088 border: "Width"
n@1105 6089 }, function( prefix, suffix ) {
n@1105 6090 jQuery.cssHooks[ prefix + suffix ] = {
n@1105 6091 expand: function( value ) {
n@1105 6092 var i = 0,
n@1105 6093 expanded = {},
n@1105 6094
n@1105 6095 // Assumes a single number if not a string
n@1105 6096 parts = typeof value === "string" ? value.split(" ") : [ value ];
n@1105 6097
n@1105 6098 for ( ; i < 4; i++ ) {
n@1105 6099 expanded[ prefix + cssExpand[ i ] + suffix ] =
n@1105 6100 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
n@1105 6101 }
n@1105 6102
n@1105 6103 return expanded;
n@1105 6104 }
n@1105 6105 };
n@1105 6106
n@1105 6107 if ( !rmargin.test( prefix ) ) {
n@1105 6108 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
n@1105 6109 }
n@1105 6110 });
n@1105 6111
n@1105 6112 jQuery.fn.extend({
n@1105 6113 css: function( name, value ) {
n@1105 6114 return access( this, function( elem, name, value ) {
n@1105 6115 var styles, len,
n@1105 6116 map = {},
n@1105 6117 i = 0;
n@1105 6118
n@1105 6119 if ( jQuery.isArray( name ) ) {
n@1105 6120 styles = getStyles( elem );
n@1105 6121 len = name.length;
n@1105 6122
n@1105 6123 for ( ; i < len; i++ ) {
n@1105 6124 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
n@1105 6125 }
n@1105 6126
n@1105 6127 return map;
n@1105 6128 }
n@1105 6129
n@1105 6130 return value !== undefined ?
n@1105 6131 jQuery.style( elem, name, value ) :
n@1105 6132 jQuery.css( elem, name );
n@1105 6133 }, name, value, arguments.length > 1 );
n@1105 6134 },
n@1105 6135 show: function() {
n@1105 6136 return showHide( this, true );
n@1105 6137 },
n@1105 6138 hide: function() {
n@1105 6139 return showHide( this );
n@1105 6140 },
n@1105 6141 toggle: function( state ) {
n@1105 6142 if ( typeof state === "boolean" ) {
n@1105 6143 return state ? this.show() : this.hide();
n@1105 6144 }
n@1105 6145
n@1105 6146 return this.each(function() {
n@1105 6147 if ( isHidden( this ) ) {
n@1105 6148 jQuery( this ).show();
n@1105 6149 } else {
n@1105 6150 jQuery( this ).hide();
n@1105 6151 }
n@1105 6152 });
n@1105 6153 }
n@1105 6154 });
n@1105 6155
n@1105 6156
n@1105 6157 function Tween( elem, options, prop, end, easing ) {
n@1105 6158 return new Tween.prototype.init( elem, options, prop, end, easing );
n@1105 6159 }
n@1105 6160 jQuery.Tween = Tween;
n@1105 6161
n@1105 6162 Tween.prototype = {
n@1105 6163 constructor: Tween,
n@1105 6164 init: function( elem, options, prop, end, easing, unit ) {
n@1105 6165 this.elem = elem;
n@1105 6166 this.prop = prop;
n@1105 6167 this.easing = easing || "swing";
n@1105 6168 this.options = options;
n@1105 6169 this.start = this.now = this.cur();
n@1105 6170 this.end = end;
n@1105 6171 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
n@1105 6172 },
n@1105 6173 cur: function() {
n@1105 6174 var hooks = Tween.propHooks[ this.prop ];
n@1105 6175
n@1105 6176 return hooks && hooks.get ?
n@1105 6177 hooks.get( this ) :
n@1105 6178 Tween.propHooks._default.get( this );
n@1105 6179 },
n@1105 6180 run: function( percent ) {
n@1105 6181 var eased,
n@1105 6182 hooks = Tween.propHooks[ this.prop ];
n@1105 6183
n@1105 6184 if ( this.options.duration ) {
n@1105 6185 this.pos = eased = jQuery.easing[ this.easing ](
n@1105 6186 percent, this.options.duration * percent, 0, 1, this.options.duration
n@1105 6187 );
n@1105 6188 } else {
n@1105 6189 this.pos = eased = percent;
n@1105 6190 }
n@1105 6191 this.now = ( this.end - this.start ) * eased + this.start;
n@1105 6192
n@1105 6193 if ( this.options.step ) {
n@1105 6194 this.options.step.call( this.elem, this.now, this );
n@1105 6195 }
n@1105 6196
n@1105 6197 if ( hooks && hooks.set ) {
n@1105 6198 hooks.set( this );
n@1105 6199 } else {
n@1105 6200 Tween.propHooks._default.set( this );
n@1105 6201 }
n@1105 6202 return this;
n@1105 6203 }
n@1105 6204 };
n@1105 6205
n@1105 6206 Tween.prototype.init.prototype = Tween.prototype;
n@1105 6207
n@1105 6208 Tween.propHooks = {
n@1105 6209 _default: {
n@1105 6210 get: function( tween ) {
n@1105 6211 var result;
n@1105 6212
n@1105 6213 if ( tween.elem[ tween.prop ] != null &&
n@1105 6214 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
n@1105 6215 return tween.elem[ tween.prop ];
n@1105 6216 }
n@1105 6217
n@1105 6218 // Passing an empty string as a 3rd parameter to .css will automatically
n@1105 6219 // attempt a parseFloat and fallback to a string if the parse fails.
n@1105 6220 // Simple values such as "10px" are parsed to Float;
n@1105 6221 // complex values such as "rotate(1rad)" are returned as-is.
n@1105 6222 result = jQuery.css( tween.elem, tween.prop, "" );
n@1105 6223 // Empty strings, null, undefined and "auto" are converted to 0.
n@1105 6224 return !result || result === "auto" ? 0 : result;
n@1105 6225 },
n@1105 6226 set: function( tween ) {
n@1105 6227 // Use step hook for back compat.
n@1105 6228 // Use cssHook if its there.
n@1105 6229 // Use .style if available and use plain properties where available.
n@1105 6230 if ( jQuery.fx.step[ tween.prop ] ) {
n@1105 6231 jQuery.fx.step[ tween.prop ]( tween );
n@1105 6232 } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
n@1105 6233 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
n@1105 6234 } else {
n@1105 6235 tween.elem[ tween.prop ] = tween.now;
n@1105 6236 }
n@1105 6237 }
n@1105 6238 }
n@1105 6239 };
n@1105 6240
n@1105 6241 // Support: IE9
n@1105 6242 // Panic based approach to setting things on disconnected nodes
n@1105 6243 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
n@1105 6244 set: function( tween ) {
n@1105 6245 if ( tween.elem.nodeType && tween.elem.parentNode ) {
n@1105 6246 tween.elem[ tween.prop ] = tween.now;
n@1105 6247 }
n@1105 6248 }
n@1105 6249 };
n@1105 6250
n@1105 6251 jQuery.easing = {
n@1105 6252 linear: function( p ) {
n@1105 6253 return p;
n@1105 6254 },
n@1105 6255 swing: function( p ) {
n@1105 6256 return 0.5 - Math.cos( p * Math.PI ) / 2;
n@1105 6257 }
n@1105 6258 };
n@1105 6259
n@1105 6260 jQuery.fx = Tween.prototype.init;
n@1105 6261
n@1105 6262 // Back Compat <1.8 extension point
n@1105 6263 jQuery.fx.step = {};
n@1105 6264
n@1105 6265
n@1105 6266
n@1105 6267
n@1105 6268 var
n@1105 6269 fxNow, timerId,
n@1105 6270 rfxtypes = /^(?:toggle|show|hide)$/,
n@1105 6271 rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
n@1105 6272 rrun = /queueHooks$/,
n@1105 6273 animationPrefilters = [ defaultPrefilter ],
n@1105 6274 tweeners = {
n@1105 6275 "*": [ function( prop, value ) {
n@1105 6276 var tween = this.createTween( prop, value ),
n@1105 6277 target = tween.cur(),
n@1105 6278 parts = rfxnum.exec( value ),
n@1105 6279 unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
n@1105 6280
n@1105 6281 // Starting value computation is required for potential unit mismatches
n@1105 6282 start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
n@1105 6283 rfxnum.exec( jQuery.css( tween.elem, prop ) ),
n@1105 6284 scale = 1,
n@1105 6285 maxIterations = 20;
n@1105 6286
n@1105 6287 if ( start && start[ 3 ] !== unit ) {
n@1105 6288 // Trust units reported by jQuery.css
n@1105 6289 unit = unit || start[ 3 ];
n@1105 6290
n@1105 6291 // Make sure we update the tween properties later on
n@1105 6292 parts = parts || [];
n@1105 6293
n@1105 6294 // Iteratively approximate from a nonzero starting point
n@1105 6295 start = +target || 1;
n@1105 6296
n@1105 6297 do {
n@1105 6298 // If previous iteration zeroed out, double until we get *something*.
n@1105 6299 // Use string for doubling so we don't accidentally see scale as unchanged below
n@1105 6300 scale = scale || ".5";
n@1105 6301
n@1105 6302 // Adjust and apply
n@1105 6303 start = start / scale;
n@1105 6304 jQuery.style( tween.elem, prop, start + unit );
n@1105 6305
n@1105 6306 // Update scale, tolerating zero or NaN from tween.cur(),
n@1105 6307 // break the loop if scale is unchanged or perfect, or if we've just had enough
n@1105 6308 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
n@1105 6309 }
n@1105 6310
n@1105 6311 // Update tween properties
n@1105 6312 if ( parts ) {
n@1105 6313 start = tween.start = +start || +target || 0;
n@1105 6314 tween.unit = unit;
n@1105 6315 // If a +=/-= token was provided, we're doing a relative animation
n@1105 6316 tween.end = parts[ 1 ] ?
n@1105 6317 start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
n@1105 6318 +parts[ 2 ];
n@1105 6319 }
n@1105 6320
n@1105 6321 return tween;
n@1105 6322 } ]
n@1105 6323 };
n@1105 6324
n@1105 6325 // Animations created synchronously will run synchronously
n@1105 6326 function createFxNow() {
n@1105 6327 setTimeout(function() {
n@1105 6328 fxNow = undefined;
n@1105 6329 });
n@1105 6330 return ( fxNow = jQuery.now() );
n@1105 6331 }
n@1105 6332
n@1105 6333 // Generate parameters to create a standard animation
n@1105 6334 function genFx( type, includeWidth ) {
n@1105 6335 var which,
n@1105 6336 i = 0,
n@1105 6337 attrs = { height: type };
n@1105 6338
n@1105 6339 // If we include width, step value is 1 to do all cssExpand values,
n@1105 6340 // otherwise step value is 2 to skip over Left and Right
n@1105 6341 includeWidth = includeWidth ? 1 : 0;
n@1105 6342 for ( ; i < 4 ; i += 2 - includeWidth ) {
n@1105 6343 which = cssExpand[ i ];
n@1105 6344 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
n@1105 6345 }
n@1105 6346
n@1105 6347 if ( includeWidth ) {
n@1105 6348 attrs.opacity = attrs.width = type;
n@1105 6349 }
n@1105 6350
n@1105 6351 return attrs;
n@1105 6352 }
n@1105 6353
n@1105 6354 function createTween( value, prop, animation ) {
n@1105 6355 var tween,
n@1105 6356 collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
n@1105 6357 index = 0,
n@1105 6358 length = collection.length;
n@1105 6359 for ( ; index < length; index++ ) {
n@1105 6360 if ( (tween = collection[ index ].call( animation, prop, value )) ) {
n@1105 6361
n@1105 6362 // We're done with this property
n@1105 6363 return tween;
n@1105 6364 }
n@1105 6365 }
n@1105 6366 }
n@1105 6367
n@1105 6368 function defaultPrefilter( elem, props, opts ) {
n@1105 6369 /* jshint validthis: true */
n@1105 6370 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
n@1105 6371 anim = this,
n@1105 6372 orig = {},
n@1105 6373 style = elem.style,
n@1105 6374 hidden = elem.nodeType && isHidden( elem ),
n@1105 6375 dataShow = data_priv.get( elem, "fxshow" );
n@1105 6376
n@1105 6377 // Handle queue: false promises
n@1105 6378 if ( !opts.queue ) {
n@1105 6379 hooks = jQuery._queueHooks( elem, "fx" );
n@1105 6380 if ( hooks.unqueued == null ) {
n@1105 6381 hooks.unqueued = 0;
n@1105 6382 oldfire = hooks.empty.fire;
n@1105 6383 hooks.empty.fire = function() {
n@1105 6384 if ( !hooks.unqueued ) {
n@1105 6385 oldfire();
n@1105 6386 }
n@1105 6387 };
n@1105 6388 }
n@1105 6389 hooks.unqueued++;
n@1105 6390
n@1105 6391 anim.always(function() {
n@1105 6392 // Ensure the complete handler is called before this completes
n@1105 6393 anim.always(function() {
n@1105 6394 hooks.unqueued--;
n@1105 6395 if ( !jQuery.queue( elem, "fx" ).length ) {
n@1105 6396 hooks.empty.fire();
n@1105 6397 }
n@1105 6398 });
n@1105 6399 });
n@1105 6400 }
n@1105 6401
n@1105 6402 // Height/width overflow pass
n@1105 6403 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
n@1105 6404 // Make sure that nothing sneaks out
n@1105 6405 // Record all 3 overflow attributes because IE9-10 do not
n@1105 6406 // change the overflow attribute when overflowX and
n@1105 6407 // overflowY are set to the same value
n@1105 6408 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
n@1105 6409
n@1105 6410 // Set display property to inline-block for height/width
n@1105 6411 // animations on inline elements that are having width/height animated
n@1105 6412 display = jQuery.css( elem, "display" );
n@1105 6413
n@1105 6414 // Test default display if display is currently "none"
n@1105 6415 checkDisplay = display === "none" ?
n@1105 6416 data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
n@1105 6417
n@1105 6418 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
n@1105 6419 style.display = "inline-block";
n@1105 6420 }
n@1105 6421 }
n@1105 6422
n@1105 6423 if ( opts.overflow ) {
n@1105 6424 style.overflow = "hidden";
n@1105 6425 anim.always(function() {
n@1105 6426 style.overflow = opts.overflow[ 0 ];
n@1105 6427 style.overflowX = opts.overflow[ 1 ];
n@1105 6428 style.overflowY = opts.overflow[ 2 ];
n@1105 6429 });
n@1105 6430 }
n@1105 6431
n@1105 6432 // show/hide pass
n@1105 6433 for ( prop in props ) {
n@1105 6434 value = props[ prop ];
n@1105 6435 if ( rfxtypes.exec( value ) ) {
n@1105 6436 delete props[ prop ];
n@1105 6437 toggle = toggle || value === "toggle";
n@1105 6438 if ( value === ( hidden ? "hide" : "show" ) ) {
n@1105 6439
n@1105 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@1105 6441 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
n@1105 6442 hidden = true;
n@1105 6443 } else {
n@1105 6444 continue;
n@1105 6445 }
n@1105 6446 }
n@1105 6447 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
n@1105 6448
n@1105 6449 // Any non-fx value stops us from restoring the original display value
n@1105 6450 } else {
n@1105 6451 display = undefined;
n@1105 6452 }
n@1105 6453 }
n@1105 6454
n@1105 6455 if ( !jQuery.isEmptyObject( orig ) ) {
n@1105 6456 if ( dataShow ) {
n@1105 6457 if ( "hidden" in dataShow ) {
n@1105 6458 hidden = dataShow.hidden;
n@1105 6459 }
n@1105 6460 } else {
n@1105 6461 dataShow = data_priv.access( elem, "fxshow", {} );
n@1105 6462 }
n@1105 6463
n@1105 6464 // Store state if its toggle - enables .stop().toggle() to "reverse"
n@1105 6465 if ( toggle ) {
n@1105 6466 dataShow.hidden = !hidden;
n@1105 6467 }
n@1105 6468 if ( hidden ) {
n@1105 6469 jQuery( elem ).show();
n@1105 6470 } else {
n@1105 6471 anim.done(function() {
n@1105 6472 jQuery( elem ).hide();
n@1105 6473 });
n@1105 6474 }
n@1105 6475 anim.done(function() {
n@1105 6476 var prop;
n@1105 6477
n@1105 6478 data_priv.remove( elem, "fxshow" );
n@1105 6479 for ( prop in orig ) {
n@1105 6480 jQuery.style( elem, prop, orig[ prop ] );
n@1105 6481 }
n@1105 6482 });
n@1105 6483 for ( prop in orig ) {
n@1105 6484 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
n@1105 6485
n@1105 6486 if ( !( prop in dataShow ) ) {
n@1105 6487 dataShow[ prop ] = tween.start;
n@1105 6488 if ( hidden ) {
n@1105 6489 tween.end = tween.start;
n@1105 6490 tween.start = prop === "width" || prop === "height" ? 1 : 0;
n@1105 6491 }
n@1105 6492 }
n@1105 6493 }
n@1105 6494
n@1105 6495 // If this is a noop like .hide().hide(), restore an overwritten display value
n@1105 6496 } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
n@1105 6497 style.display = display;
n@1105 6498 }
n@1105 6499 }
n@1105 6500
n@1105 6501 function propFilter( props, specialEasing ) {
n@1105 6502 var index, name, easing, value, hooks;
n@1105 6503
n@1105 6504 // camelCase, specialEasing and expand cssHook pass
n@1105 6505 for ( index in props ) {
n@1105 6506 name = jQuery.camelCase( index );
n@1105 6507 easing = specialEasing[ name ];
n@1105 6508 value = props[ index ];
n@1105 6509 if ( jQuery.isArray( value ) ) {
n@1105 6510 easing = value[ 1 ];
n@1105 6511 value = props[ index ] = value[ 0 ];
n@1105 6512 }
n@1105 6513
n@1105 6514 if ( index !== name ) {
n@1105 6515 props[ name ] = value;
n@1105 6516 delete props[ index ];
n@1105 6517 }
n@1105 6518
n@1105 6519 hooks = jQuery.cssHooks[ name ];
n@1105 6520 if ( hooks && "expand" in hooks ) {
n@1105 6521 value = hooks.expand( value );
n@1105 6522 delete props[ name ];
n@1105 6523
n@1105 6524 // Not quite $.extend, this won't overwrite existing keys.
n@1105 6525 // Reusing 'index' because we have the correct "name"
n@1105 6526 for ( index in value ) {
n@1105 6527 if ( !( index in props ) ) {
n@1105 6528 props[ index ] = value[ index ];
n@1105 6529 specialEasing[ index ] = easing;
n@1105 6530 }
n@1105 6531 }
n@1105 6532 } else {
n@1105 6533 specialEasing[ name ] = easing;
n@1105 6534 }
n@1105 6535 }
n@1105 6536 }
n@1105 6537
n@1105 6538 function Animation( elem, properties, options ) {
n@1105 6539 var result,
n@1105 6540 stopped,
n@1105 6541 index = 0,
n@1105 6542 length = animationPrefilters.length,
n@1105 6543 deferred = jQuery.Deferred().always( function() {
n@1105 6544 // Don't match elem in the :animated selector
n@1105 6545 delete tick.elem;
n@1105 6546 }),
n@1105 6547 tick = function() {
n@1105 6548 if ( stopped ) {
n@1105 6549 return false;
n@1105 6550 }
n@1105 6551 var currentTime = fxNow || createFxNow(),
n@1105 6552 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
n@1105 6553 // Support: Android 2.3
n@1105 6554 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
n@1105 6555 temp = remaining / animation.duration || 0,
n@1105 6556 percent = 1 - temp,
n@1105 6557 index = 0,
n@1105 6558 length = animation.tweens.length;
n@1105 6559
n@1105 6560 for ( ; index < length ; index++ ) {
n@1105 6561 animation.tweens[ index ].run( percent );
n@1105 6562 }
n@1105 6563
n@1105 6564 deferred.notifyWith( elem, [ animation, percent, remaining ]);
n@1105 6565
n@1105 6566 if ( percent < 1 && length ) {
n@1105 6567 return remaining;
n@1105 6568 } else {
n@1105 6569 deferred.resolveWith( elem, [ animation ] );
n@1105 6570 return false;
n@1105 6571 }
n@1105 6572 },
n@1105 6573 animation = deferred.promise({
n@1105 6574 elem: elem,
n@1105 6575 props: jQuery.extend( {}, properties ),
n@1105 6576 opts: jQuery.extend( true, { specialEasing: {} }, options ),
n@1105 6577 originalProperties: properties,
n@1105 6578 originalOptions: options,
n@1105 6579 startTime: fxNow || createFxNow(),
n@1105 6580 duration: options.duration,
n@1105 6581 tweens: [],
n@1105 6582 createTween: function( prop, end ) {
n@1105 6583 var tween = jQuery.Tween( elem, animation.opts, prop, end,
n@1105 6584 animation.opts.specialEasing[ prop ] || animation.opts.easing );
n@1105 6585 animation.tweens.push( tween );
n@1105 6586 return tween;
n@1105 6587 },
n@1105 6588 stop: function( gotoEnd ) {
n@1105 6589 var index = 0,
n@1105 6590 // If we are going to the end, we want to run all the tweens
n@1105 6591 // otherwise we skip this part
n@1105 6592 length = gotoEnd ? animation.tweens.length : 0;
n@1105 6593 if ( stopped ) {
n@1105 6594 return this;
n@1105 6595 }
n@1105 6596 stopped = true;
n@1105 6597 for ( ; index < length ; index++ ) {
n@1105 6598 animation.tweens[ index ].run( 1 );
n@1105 6599 }
n@1105 6600
n@1105 6601 // Resolve when we played the last frame; otherwise, reject
n@1105 6602 if ( gotoEnd ) {
n@1105 6603 deferred.resolveWith( elem, [ animation, gotoEnd ] );
n@1105 6604 } else {
n@1105 6605 deferred.rejectWith( elem, [ animation, gotoEnd ] );
n@1105 6606 }
n@1105 6607 return this;
n@1105 6608 }
n@1105 6609 }),
n@1105 6610 props = animation.props;
n@1105 6611
n@1105 6612 propFilter( props, animation.opts.specialEasing );
n@1105 6613
n@1105 6614 for ( ; index < length ; index++ ) {
n@1105 6615 result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
n@1105 6616 if ( result ) {
n@1105 6617 return result;
n@1105 6618 }
n@1105 6619 }
n@1105 6620
n@1105 6621 jQuery.map( props, createTween, animation );
n@1105 6622
n@1105 6623 if ( jQuery.isFunction( animation.opts.start ) ) {
n@1105 6624 animation.opts.start.call( elem, animation );
n@1105 6625 }
n@1105 6626
n@1105 6627 jQuery.fx.timer(
n@1105 6628 jQuery.extend( tick, {
n@1105 6629 elem: elem,
n@1105 6630 anim: animation,
n@1105 6631 queue: animation.opts.queue
n@1105 6632 })
n@1105 6633 );
n@1105 6634
n@1105 6635 // attach callbacks from options
n@1105 6636 return animation.progress( animation.opts.progress )
n@1105 6637 .done( animation.opts.done, animation.opts.complete )
n@1105 6638 .fail( animation.opts.fail )
n@1105 6639 .always( animation.opts.always );
n@1105 6640 }
n@1105 6641
n@1105 6642 jQuery.Animation = jQuery.extend( Animation, {
n@1105 6643
n@1105 6644 tweener: function( props, callback ) {
n@1105 6645 if ( jQuery.isFunction( props ) ) {
n@1105 6646 callback = props;
n@1105 6647 props = [ "*" ];
n@1105 6648 } else {
n@1105 6649 props = props.split(" ");
n@1105 6650 }
n@1105 6651
n@1105 6652 var prop,
n@1105 6653 index = 0,
n@1105 6654 length = props.length;
n@1105 6655
n@1105 6656 for ( ; index < length ; index++ ) {
n@1105 6657 prop = props[ index ];
n@1105 6658 tweeners[ prop ] = tweeners[ prop ] || [];
n@1105 6659 tweeners[ prop ].unshift( callback );
n@1105 6660 }
n@1105 6661 },
n@1105 6662
n@1105 6663 prefilter: function( callback, prepend ) {
n@1105 6664 if ( prepend ) {
n@1105 6665 animationPrefilters.unshift( callback );
n@1105 6666 } else {
n@1105 6667 animationPrefilters.push( callback );
n@1105 6668 }
n@1105 6669 }
n@1105 6670 });
n@1105 6671
n@1105 6672 jQuery.speed = function( speed, easing, fn ) {
n@1105 6673 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
n@1105 6674 complete: fn || !fn && easing ||
n@1105 6675 jQuery.isFunction( speed ) && speed,
n@1105 6676 duration: speed,
n@1105 6677 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
n@1105 6678 };
n@1105 6679
n@1105 6680 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
n@1105 6681 opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
n@1105 6682
n@1105 6683 // Normalize opt.queue - true/undefined/null -> "fx"
n@1105 6684 if ( opt.queue == null || opt.queue === true ) {
n@1105 6685 opt.queue = "fx";
n@1105 6686 }
n@1105 6687
n@1105 6688 // Queueing
n@1105 6689 opt.old = opt.complete;
n@1105 6690
n@1105 6691 opt.complete = function() {
n@1105 6692 if ( jQuery.isFunction( opt.old ) ) {
n@1105 6693 opt.old.call( this );
n@1105 6694 }
n@1105 6695
n@1105 6696 if ( opt.queue ) {
n@1105 6697 jQuery.dequeue( this, opt.queue );
n@1105 6698 }
n@1105 6699 };
n@1105 6700
n@1105 6701 return opt;
n@1105 6702 };
n@1105 6703
n@1105 6704 jQuery.fn.extend({
n@1105 6705 fadeTo: function( speed, to, easing, callback ) {
n@1105 6706
n@1105 6707 // Show any hidden elements after setting opacity to 0
n@1105 6708 return this.filter( isHidden ).css( "opacity", 0 ).show()
n@1105 6709
n@1105 6710 // Animate to the value specified
n@1105 6711 .end().animate({ opacity: to }, speed, easing, callback );
n@1105 6712 },
n@1105 6713 animate: function( prop, speed, easing, callback ) {
n@1105 6714 var empty = jQuery.isEmptyObject( prop ),
n@1105 6715 optall = jQuery.speed( speed, easing, callback ),
n@1105 6716 doAnimation = function() {
n@1105 6717 // Operate on a copy of prop so per-property easing won't be lost
n@1105 6718 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
n@1105 6719
n@1105 6720 // Empty animations, or finishing resolves immediately
n@1105 6721 if ( empty || data_priv.get( this, "finish" ) ) {
n@1105 6722 anim.stop( true );
n@1105 6723 }
n@1105 6724 };
n@1105 6725 doAnimation.finish = doAnimation;
n@1105 6726
n@1105 6727 return empty || optall.queue === false ?
n@1105 6728 this.each( doAnimation ) :
n@1105 6729 this.queue( optall.queue, doAnimation );
n@1105 6730 },
n@1105 6731 stop: function( type, clearQueue, gotoEnd ) {
n@1105 6732 var stopQueue = function( hooks ) {
n@1105 6733 var stop = hooks.stop;
n@1105 6734 delete hooks.stop;
n@1105 6735 stop( gotoEnd );
n@1105 6736 };
n@1105 6737
n@1105 6738 if ( typeof type !== "string" ) {
n@1105 6739 gotoEnd = clearQueue;
n@1105 6740 clearQueue = type;
n@1105 6741 type = undefined;
n@1105 6742 }
n@1105 6743 if ( clearQueue && type !== false ) {
n@1105 6744 this.queue( type || "fx", [] );
n@1105 6745 }
n@1105 6746
n@1105 6747 return this.each(function() {
n@1105 6748 var dequeue = true,
n@1105 6749 index = type != null && type + "queueHooks",
n@1105 6750 timers = jQuery.timers,
n@1105 6751 data = data_priv.get( this );
n@1105 6752
n@1105 6753 if ( index ) {
n@1105 6754 if ( data[ index ] && data[ index ].stop ) {
n@1105 6755 stopQueue( data[ index ] );
n@1105 6756 }
n@1105 6757 } else {
n@1105 6758 for ( index in data ) {
n@1105 6759 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
n@1105 6760 stopQueue( data[ index ] );
n@1105 6761 }
n@1105 6762 }
n@1105 6763 }
n@1105 6764
n@1105 6765 for ( index = timers.length; index--; ) {
n@1105 6766 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
n@1105 6767 timers[ index ].anim.stop( gotoEnd );
n@1105 6768 dequeue = false;
n@1105 6769 timers.splice( index, 1 );
n@1105 6770 }
n@1105 6771 }
n@1105 6772
n@1105 6773 // Start the next in the queue if the last step wasn't forced.
n@1105 6774 // Timers currently will call their complete callbacks, which
n@1105 6775 // will dequeue but only if they were gotoEnd.
n@1105 6776 if ( dequeue || !gotoEnd ) {
n@1105 6777 jQuery.dequeue( this, type );
n@1105 6778 }
n@1105 6779 });
n@1105 6780 },
n@1105 6781 finish: function( type ) {
n@1105 6782 if ( type !== false ) {
n@1105 6783 type = type || "fx";
n@1105 6784 }
n@1105 6785 return this.each(function() {
n@1105 6786 var index,
n@1105 6787 data = data_priv.get( this ),
n@1105 6788 queue = data[ type + "queue" ],
n@1105 6789 hooks = data[ type + "queueHooks" ],
n@1105 6790 timers = jQuery.timers,
n@1105 6791 length = queue ? queue.length : 0;
n@1105 6792
n@1105 6793 // Enable finishing flag on private data
n@1105 6794 data.finish = true;
n@1105 6795
n@1105 6796 // Empty the queue first
n@1105 6797 jQuery.queue( this, type, [] );
n@1105 6798
n@1105 6799 if ( hooks && hooks.stop ) {
n@1105 6800 hooks.stop.call( this, true );
n@1105 6801 }
n@1105 6802
n@1105 6803 // Look for any active animations, and finish them
n@1105 6804 for ( index = timers.length; index--; ) {
n@1105 6805 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
n@1105 6806 timers[ index ].anim.stop( true );
n@1105 6807 timers.splice( index, 1 );
n@1105 6808 }
n@1105 6809 }
n@1105 6810
n@1105 6811 // Look for any animations in the old queue and finish them
n@1105 6812 for ( index = 0; index < length; index++ ) {
n@1105 6813 if ( queue[ index ] && queue[ index ].finish ) {
n@1105 6814 queue[ index ].finish.call( this );
n@1105 6815 }
n@1105 6816 }
n@1105 6817
n@1105 6818 // Turn off finishing flag
n@1105 6819 delete data.finish;
n@1105 6820 });
n@1105 6821 }
n@1105 6822 });
n@1105 6823
n@1105 6824 jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
n@1105 6825 var cssFn = jQuery.fn[ name ];
n@1105 6826 jQuery.fn[ name ] = function( speed, easing, callback ) {
n@1105 6827 return speed == null || typeof speed === "boolean" ?
n@1105 6828 cssFn.apply( this, arguments ) :
n@1105 6829 this.animate( genFx( name, true ), speed, easing, callback );
n@1105 6830 };
n@1105 6831 });
n@1105 6832
n@1105 6833 // Generate shortcuts for custom animations
n@1105 6834 jQuery.each({
n@1105 6835 slideDown: genFx("show"),
n@1105 6836 slideUp: genFx("hide"),
n@1105 6837 slideToggle: genFx("toggle"),
n@1105 6838 fadeIn: { opacity: "show" },
n@1105 6839 fadeOut: { opacity: "hide" },
n@1105 6840 fadeToggle: { opacity: "toggle" }
n@1105 6841 }, function( name, props ) {
n@1105 6842 jQuery.fn[ name ] = function( speed, easing, callback ) {
n@1105 6843 return this.animate( props, speed, easing, callback );
n@1105 6844 };
n@1105 6845 });
n@1105 6846
n@1105 6847 jQuery.timers = [];
n@1105 6848 jQuery.fx.tick = function() {
n@1105 6849 var timer,
n@1105 6850 i = 0,
n@1105 6851 timers = jQuery.timers;
n@1105 6852
n@1105 6853 fxNow = jQuery.now();
n@1105 6854
n@1105 6855 for ( ; i < timers.length; i++ ) {
n@1105 6856 timer = timers[ i ];
n@1105 6857 // Checks the timer has not already been removed
n@1105 6858 if ( !timer() && timers[ i ] === timer ) {
n@1105 6859 timers.splice( i--, 1 );
n@1105 6860 }
n@1105 6861 }
n@1105 6862
n@1105 6863 if ( !timers.length ) {
n@1105 6864 jQuery.fx.stop();
n@1105 6865 }
n@1105 6866 fxNow = undefined;
n@1105 6867 };
n@1105 6868
n@1105 6869 jQuery.fx.timer = function( timer ) {
n@1105 6870 jQuery.timers.push( timer );
n@1105 6871 if ( timer() ) {
n@1105 6872 jQuery.fx.start();
n@1105 6873 } else {
n@1105 6874 jQuery.timers.pop();
n@1105 6875 }
n@1105 6876 };
n@1105 6877
n@1105 6878 jQuery.fx.interval = 13;
n@1105 6879
n@1105 6880 jQuery.fx.start = function() {
n@1105 6881 if ( !timerId ) {
n@1105 6882 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
n@1105 6883 }
n@1105 6884 };
n@1105 6885
n@1105 6886 jQuery.fx.stop = function() {
n@1105 6887 clearInterval( timerId );
n@1105 6888 timerId = null;
n@1105 6889 };
n@1105 6890
n@1105 6891 jQuery.fx.speeds = {
n@1105 6892 slow: 600,
n@1105 6893 fast: 200,
n@1105 6894 // Default speed
n@1105 6895 _default: 400
n@1105 6896 };
n@1105 6897
n@1105 6898
n@1105 6899 // Based off of the plugin by Clint Helfers, with permission.
n@1105 6900 // http://blindsignals.com/index.php/2009/07/jquery-delay/
n@1105 6901 jQuery.fn.delay = function( time, type ) {
n@1105 6902 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
n@1105 6903 type = type || "fx";
n@1105 6904
n@1105 6905 return this.queue( type, function( next, hooks ) {
n@1105 6906 var timeout = setTimeout( next, time );
n@1105 6907 hooks.stop = function() {
n@1105 6908 clearTimeout( timeout );
n@1105 6909 };
n@1105 6910 });
n@1105 6911 };
n@1105 6912
n@1105 6913
n@1105 6914 (function() {
n@1105 6915 var input = document.createElement( "input" ),
n@1105 6916 select = document.createElement( "select" ),
n@1105 6917 opt = select.appendChild( document.createElement( "option" ) );
n@1105 6918
n@1105 6919 input.type = "checkbox";
n@1105 6920
n@1105 6921 // Support: iOS<=5.1, Android<=4.2+
n@1105 6922 // Default value for a checkbox should be "on"
n@1105 6923 support.checkOn = input.value !== "";
n@1105 6924
n@1105 6925 // Support: IE<=11+
n@1105 6926 // Must access selectedIndex to make default options select
n@1105 6927 support.optSelected = opt.selected;
n@1105 6928
n@1105 6929 // Support: Android<=2.3
n@1105 6930 // Options inside disabled selects are incorrectly marked as disabled
n@1105 6931 select.disabled = true;
n@1105 6932 support.optDisabled = !opt.disabled;
n@1105 6933
n@1105 6934 // Support: IE<=11+
n@1105 6935 // An input loses its value after becoming a radio
n@1105 6936 input = document.createElement( "input" );
n@1105 6937 input.value = "t";
n@1105 6938 input.type = "radio";
n@1105 6939 support.radioValue = input.value === "t";
n@1105 6940 })();
n@1105 6941
n@1105 6942
n@1105 6943 var nodeHook, boolHook,
n@1105 6944 attrHandle = jQuery.expr.attrHandle;
n@1105 6945
n@1105 6946 jQuery.fn.extend({
n@1105 6947 attr: function( name, value ) {
n@1105 6948 return access( this, jQuery.attr, name, value, arguments.length > 1 );
n@1105 6949 },
n@1105 6950
n@1105 6951 removeAttr: function( name ) {
n@1105 6952 return this.each(function() {
n@1105 6953 jQuery.removeAttr( this, name );
n@1105 6954 });
n@1105 6955 }
n@1105 6956 });
n@1105 6957
n@1105 6958 jQuery.extend({
n@1105 6959 attr: function( elem, name, value ) {
n@1105 6960 var hooks, ret,
n@1105 6961 nType = elem.nodeType;
n@1105 6962
n@1105 6963 // don't get/set attributes on text, comment and attribute nodes
n@1105 6964 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
n@1105 6965 return;
n@1105 6966 }
n@1105 6967
n@1105 6968 // Fallback to prop when attributes are not supported
n@1105 6969 if ( typeof elem.getAttribute === strundefined ) {
n@1105 6970 return jQuery.prop( elem, name, value );
n@1105 6971 }
n@1105 6972
n@1105 6973 // All attributes are lowercase
n@1105 6974 // Grab necessary hook if one is defined
n@1105 6975 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
n@1105 6976 name = name.toLowerCase();
n@1105 6977 hooks = jQuery.attrHooks[ name ] ||
n@1105 6978 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
n@1105 6979 }
n@1105 6980
n@1105 6981 if ( value !== undefined ) {
n@1105 6982
n@1105 6983 if ( value === null ) {
n@1105 6984 jQuery.removeAttr( elem, name );
n@1105 6985
n@1105 6986 } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
n@1105 6987 return ret;
n@1105 6988
n@1105 6989 } else {
n@1105 6990 elem.setAttribute( name, value + "" );
n@1105 6991 return value;
n@1105 6992 }
n@1105 6993
n@1105 6994 } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
n@1105 6995 return ret;
n@1105 6996
n@1105 6997 } else {
n@1105 6998 ret = jQuery.find.attr( elem, name );
n@1105 6999
n@1105 7000 // Non-existent attributes return null, we normalize to undefined
n@1105 7001 return ret == null ?
n@1105 7002 undefined :
n@1105 7003 ret;
n@1105 7004 }
n@1105 7005 },
n@1105 7006
n@1105 7007 removeAttr: function( elem, value ) {
n@1105 7008 var name, propName,
n@1105 7009 i = 0,
n@1105 7010 attrNames = value && value.match( rnotwhite );
n@1105 7011
n@1105 7012 if ( attrNames && elem.nodeType === 1 ) {
n@1105 7013 while ( (name = attrNames[i++]) ) {
n@1105 7014 propName = jQuery.propFix[ name ] || name;
n@1105 7015
n@1105 7016 // Boolean attributes get special treatment (#10870)
n@1105 7017 if ( jQuery.expr.match.bool.test( name ) ) {
n@1105 7018 // Set corresponding property to false
n@1105 7019 elem[ propName ] = false;
n@1105 7020 }
n@1105 7021
n@1105 7022 elem.removeAttribute( name );
n@1105 7023 }
n@1105 7024 }
n@1105 7025 },
n@1105 7026
n@1105 7027 attrHooks: {
n@1105 7028 type: {
n@1105 7029 set: function( elem, value ) {
n@1105 7030 if ( !support.radioValue && value === "radio" &&
n@1105 7031 jQuery.nodeName( elem, "input" ) ) {
n@1105 7032 var val = elem.value;
n@1105 7033 elem.setAttribute( "type", value );
n@1105 7034 if ( val ) {
n@1105 7035 elem.value = val;
n@1105 7036 }
n@1105 7037 return value;
n@1105 7038 }
n@1105 7039 }
n@1105 7040 }
n@1105 7041 }
n@1105 7042 });
n@1105 7043
n@1105 7044 // Hooks for boolean attributes
n@1105 7045 boolHook = {
n@1105 7046 set: function( elem, value, name ) {
n@1105 7047 if ( value === false ) {
n@1105 7048 // Remove boolean attributes when set to false
n@1105 7049 jQuery.removeAttr( elem, name );
n@1105 7050 } else {
n@1105 7051 elem.setAttribute( name, name );
n@1105 7052 }
n@1105 7053 return name;
n@1105 7054 }
n@1105 7055 };
n@1105 7056 jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
n@1105 7057 var getter = attrHandle[ name ] || jQuery.find.attr;
n@1105 7058
n@1105 7059 attrHandle[ name ] = function( elem, name, isXML ) {
n@1105 7060 var ret, handle;
n@1105 7061 if ( !isXML ) {
n@1105 7062 // Avoid an infinite loop by temporarily removing this function from the getter
n@1105 7063 handle = attrHandle[ name ];
n@1105 7064 attrHandle[ name ] = ret;
n@1105 7065 ret = getter( elem, name, isXML ) != null ?
n@1105 7066 name.toLowerCase() :
n@1105 7067 null;
n@1105 7068 attrHandle[ name ] = handle;
n@1105 7069 }
n@1105 7070 return ret;
n@1105 7071 };
n@1105 7072 });
n@1105 7073
n@1105 7074
n@1105 7075
n@1105 7076
n@1105 7077 var rfocusable = /^(?:input|select|textarea|button)$/i;
n@1105 7078
n@1105 7079 jQuery.fn.extend({
n@1105 7080 prop: function( name, value ) {
n@1105 7081 return access( this, jQuery.prop, name, value, arguments.length > 1 );
n@1105 7082 },
n@1105 7083
n@1105 7084 removeProp: function( name ) {
n@1105 7085 return this.each(function() {
n@1105 7086 delete this[ jQuery.propFix[ name ] || name ];
n@1105 7087 });
n@1105 7088 }
n@1105 7089 });
n@1105 7090
n@1105 7091 jQuery.extend({
n@1105 7092 propFix: {
n@1105 7093 "for": "htmlFor",
n@1105 7094 "class": "className"
n@1105 7095 },
n@1105 7096
n@1105 7097 prop: function( elem, name, value ) {
n@1105 7098 var ret, hooks, notxml,
n@1105 7099 nType = elem.nodeType;
n@1105 7100
n@1105 7101 // Don't get/set properties on text, comment and attribute nodes
n@1105 7102 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
n@1105 7103 return;
n@1105 7104 }
n@1105 7105
n@1105 7106 notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
n@1105 7107
n@1105 7108 if ( notxml ) {
n@1105 7109 // Fix name and attach hooks
n@1105 7110 name = jQuery.propFix[ name ] || name;
n@1105 7111 hooks = jQuery.propHooks[ name ];
n@1105 7112 }
n@1105 7113
n@1105 7114 if ( value !== undefined ) {
n@1105 7115 return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
n@1105 7116 ret :
n@1105 7117 ( elem[ name ] = value );
n@1105 7118
n@1105 7119 } else {
n@1105 7120 return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
n@1105 7121 ret :
n@1105 7122 elem[ name ];
n@1105 7123 }
n@1105 7124 },
n@1105 7125
n@1105 7126 propHooks: {
n@1105 7127 tabIndex: {
n@1105 7128 get: function( elem ) {
n@1105 7129 return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
n@1105 7130 elem.tabIndex :
n@1105 7131 -1;
n@1105 7132 }
n@1105 7133 }
n@1105 7134 }
n@1105 7135 });
n@1105 7136
n@1105 7137 if ( !support.optSelected ) {
n@1105 7138 jQuery.propHooks.selected = {
n@1105 7139 get: function( elem ) {
n@1105 7140 var parent = elem.parentNode;
n@1105 7141 if ( parent && parent.parentNode ) {
n@1105 7142 parent.parentNode.selectedIndex;
n@1105 7143 }
n@1105 7144 return null;
n@1105 7145 }
n@1105 7146 };
n@1105 7147 }
n@1105 7148
n@1105 7149 jQuery.each([
n@1105 7150 "tabIndex",
n@1105 7151 "readOnly",
n@1105 7152 "maxLength",
n@1105 7153 "cellSpacing",
n@1105 7154 "cellPadding",
n@1105 7155 "rowSpan",
n@1105 7156 "colSpan",
n@1105 7157 "useMap",
n@1105 7158 "frameBorder",
n@1105 7159 "contentEditable"
n@1105 7160 ], function() {
n@1105 7161 jQuery.propFix[ this.toLowerCase() ] = this;
n@1105 7162 });
n@1105 7163
n@1105 7164
n@1105 7165
n@1105 7166
n@1105 7167 var rclass = /[\t\r\n\f]/g;
n@1105 7168
n@1105 7169 jQuery.fn.extend({
n@1105 7170 addClass: function( value ) {
n@1105 7171 var classes, elem, cur, clazz, j, finalValue,
n@1105 7172 proceed = typeof value === "string" && value,
n@1105 7173 i = 0,
n@1105 7174 len = this.length;
n@1105 7175
n@1105 7176 if ( jQuery.isFunction( value ) ) {
n@1105 7177 return this.each(function( j ) {
n@1105 7178 jQuery( this ).addClass( value.call( this, j, this.className ) );
n@1105 7179 });
n@1105 7180 }
n@1105 7181
n@1105 7182 if ( proceed ) {
n@1105 7183 // The disjunction here is for better compressibility (see removeClass)
n@1105 7184 classes = ( value || "" ).match( rnotwhite ) || [];
n@1105 7185
n@1105 7186 for ( ; i < len; i++ ) {
n@1105 7187 elem = this[ i ];
n@1105 7188 cur = elem.nodeType === 1 && ( elem.className ?
n@1105 7189 ( " " + elem.className + " " ).replace( rclass, " " ) :
n@1105 7190 " "
n@1105 7191 );
n@1105 7192
n@1105 7193 if ( cur ) {
n@1105 7194 j = 0;
n@1105 7195 while ( (clazz = classes[j++]) ) {
n@1105 7196 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
n@1105 7197 cur += clazz + " ";
n@1105 7198 }
n@1105 7199 }
n@1105 7200
n@1105 7201 // only assign if different to avoid unneeded rendering.
n@1105 7202 finalValue = jQuery.trim( cur );
n@1105 7203 if ( elem.className !== finalValue ) {
n@1105 7204 elem.className = finalValue;
n@1105 7205 }
n@1105 7206 }
n@1105 7207 }
n@1105 7208 }
n@1105 7209
n@1105 7210 return this;
n@1105 7211 },
n@1105 7212
n@1105 7213 removeClass: function( value ) {
n@1105 7214 var classes, elem, cur, clazz, j, finalValue,
n@1105 7215 proceed = arguments.length === 0 || typeof value === "string" && value,
n@1105 7216 i = 0,
n@1105 7217 len = this.length;
n@1105 7218
n@1105 7219 if ( jQuery.isFunction( value ) ) {
n@1105 7220 return this.each(function( j ) {
n@1105 7221 jQuery( this ).removeClass( value.call( this, j, this.className ) );
n@1105 7222 });
n@1105 7223 }
n@1105 7224 if ( proceed ) {
n@1105 7225 classes = ( value || "" ).match( rnotwhite ) || [];
n@1105 7226
n@1105 7227 for ( ; i < len; i++ ) {
n@1105 7228 elem = this[ i ];
n@1105 7229 // This expression is here for better compressibility (see addClass)
n@1105 7230 cur = elem.nodeType === 1 && ( elem.className ?
n@1105 7231 ( " " + elem.className + " " ).replace( rclass, " " ) :
n@1105 7232 ""
n@1105 7233 );
n@1105 7234
n@1105 7235 if ( cur ) {
n@1105 7236 j = 0;
n@1105 7237 while ( (clazz = classes[j++]) ) {
n@1105 7238 // Remove *all* instances
n@1105 7239 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
n@1105 7240 cur = cur.replace( " " + clazz + " ", " " );
n@1105 7241 }
n@1105 7242 }
n@1105 7243
n@1105 7244 // Only assign if different to avoid unneeded rendering.
n@1105 7245 finalValue = value ? jQuery.trim( cur ) : "";
n@1105 7246 if ( elem.className !== finalValue ) {
n@1105 7247 elem.className = finalValue;
n@1105 7248 }
n@1105 7249 }
n@1105 7250 }
n@1105 7251 }
n@1105 7252
n@1105 7253 return this;
n@1105 7254 },
n@1105 7255
n@1105 7256 toggleClass: function( value, stateVal ) {
n@1105 7257 var type = typeof value;
n@1105 7258
n@1105 7259 if ( typeof stateVal === "boolean" && type === "string" ) {
n@1105 7260 return stateVal ? this.addClass( value ) : this.removeClass( value );
n@1105 7261 }
n@1105 7262
n@1105 7263 if ( jQuery.isFunction( value ) ) {
n@1105 7264 return this.each(function( i ) {
n@1105 7265 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
n@1105 7266 });
n@1105 7267 }
n@1105 7268
n@1105 7269 return this.each(function() {
n@1105 7270 if ( type === "string" ) {
n@1105 7271 // Toggle individual class names
n@1105 7272 var className,
n@1105 7273 i = 0,
n@1105 7274 self = jQuery( this ),
n@1105 7275 classNames = value.match( rnotwhite ) || [];
n@1105 7276
n@1105 7277 while ( (className = classNames[ i++ ]) ) {
n@1105 7278 // Check each className given, space separated list
n@1105 7279 if ( self.hasClass( className ) ) {
n@1105 7280 self.removeClass( className );
n@1105 7281 } else {
n@1105 7282 self.addClass( className );
n@1105 7283 }
n@1105 7284 }
n@1105 7285
n@1105 7286 // Toggle whole class name
n@1105 7287 } else if ( type === strundefined || type === "boolean" ) {
n@1105 7288 if ( this.className ) {
n@1105 7289 // store className if set
n@1105 7290 data_priv.set( this, "__className__", this.className );
n@1105 7291 }
n@1105 7292
n@1105 7293 // If the element has a class name or if we're passed `false`,
n@1105 7294 // then remove the whole classname (if there was one, the above saved it).
n@1105 7295 // Otherwise bring back whatever was previously saved (if anything),
n@1105 7296 // falling back to the empty string if nothing was stored.
n@1105 7297 this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
n@1105 7298 }
n@1105 7299 });
n@1105 7300 },
n@1105 7301
n@1105 7302 hasClass: function( selector ) {
n@1105 7303 var className = " " + selector + " ",
n@1105 7304 i = 0,
n@1105 7305 l = this.length;
n@1105 7306 for ( ; i < l; i++ ) {
n@1105 7307 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
n@1105 7308 return true;
n@1105 7309 }
n@1105 7310 }
n@1105 7311
n@1105 7312 return false;
n@1105 7313 }
n@1105 7314 });
n@1105 7315
n@1105 7316
n@1105 7317
n@1105 7318
n@1105 7319 var rreturn = /\r/g;
n@1105 7320
n@1105 7321 jQuery.fn.extend({
n@1105 7322 val: function( value ) {
n@1105 7323 var hooks, ret, isFunction,
n@1105 7324 elem = this[0];
n@1105 7325
n@1105 7326 if ( !arguments.length ) {
n@1105 7327 if ( elem ) {
n@1105 7328 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
n@1105 7329
n@1105 7330 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
n@1105 7331 return ret;
n@1105 7332 }
n@1105 7333
n@1105 7334 ret = elem.value;
n@1105 7335
n@1105 7336 return typeof ret === "string" ?
n@1105 7337 // Handle most common string cases
n@1105 7338 ret.replace(rreturn, "") :
n@1105 7339 // Handle cases where value is null/undef or number
n@1105 7340 ret == null ? "" : ret;
n@1105 7341 }
n@1105 7342
n@1105 7343 return;
n@1105 7344 }
n@1105 7345
n@1105 7346 isFunction = jQuery.isFunction( value );
n@1105 7347
n@1105 7348 return this.each(function( i ) {
n@1105 7349 var val;
n@1105 7350
n@1105 7351 if ( this.nodeType !== 1 ) {
n@1105 7352 return;
n@1105 7353 }
n@1105 7354
n@1105 7355 if ( isFunction ) {
n@1105 7356 val = value.call( this, i, jQuery( this ).val() );
n@1105 7357 } else {
n@1105 7358 val = value;
n@1105 7359 }
n@1105 7360
n@1105 7361 // Treat null/undefined as ""; convert numbers to string
n@1105 7362 if ( val == null ) {
n@1105 7363 val = "";
n@1105 7364
n@1105 7365 } else if ( typeof val === "number" ) {
n@1105 7366 val += "";
n@1105 7367
n@1105 7368 } else if ( jQuery.isArray( val ) ) {
n@1105 7369 val = jQuery.map( val, function( value ) {
n@1105 7370 return value == null ? "" : value + "";
n@1105 7371 });
n@1105 7372 }
n@1105 7373
n@1105 7374 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
n@1105 7375
n@1105 7376 // If set returns undefined, fall back to normal setting
n@1105 7377 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
n@1105 7378 this.value = val;
n@1105 7379 }
n@1105 7380 });
n@1105 7381 }
n@1105 7382 });
n@1105 7383
n@1105 7384 jQuery.extend({
n@1105 7385 valHooks: {
n@1105 7386 option: {
n@1105 7387 get: function( elem ) {
n@1105 7388 var val = jQuery.find.attr( elem, "value" );
n@1105 7389 return val != null ?
n@1105 7390 val :
n@1105 7391 // Support: IE10-11+
n@1105 7392 // option.text throws exceptions (#14686, #14858)
n@1105 7393 jQuery.trim( jQuery.text( elem ) );
n@1105 7394 }
n@1105 7395 },
n@1105 7396 select: {
n@1105 7397 get: function( elem ) {
n@1105 7398 var value, option,
n@1105 7399 options = elem.options,
n@1105 7400 index = elem.selectedIndex,
n@1105 7401 one = elem.type === "select-one" || index < 0,
n@1105 7402 values = one ? null : [],
n@1105 7403 max = one ? index + 1 : options.length,
n@1105 7404 i = index < 0 ?
n@1105 7405 max :
n@1105 7406 one ? index : 0;
n@1105 7407
n@1105 7408 // Loop through all the selected options
n@1105 7409 for ( ; i < max; i++ ) {
n@1105 7410 option = options[ i ];
n@1105 7411
n@1105 7412 // IE6-9 doesn't update selected after form reset (#2551)
n@1105 7413 if ( ( option.selected || i === index ) &&
n@1105 7414 // Don't return options that are disabled or in a disabled optgroup
n@1105 7415 ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
n@1105 7416 ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
n@1105 7417
n@1105 7418 // Get the specific value for the option
n@1105 7419 value = jQuery( option ).val();
n@1105 7420
n@1105 7421 // We don't need an array for one selects
n@1105 7422 if ( one ) {
n@1105 7423 return value;
n@1105 7424 }
n@1105 7425
n@1105 7426 // Multi-Selects return an array
n@1105 7427 values.push( value );
n@1105 7428 }
n@1105 7429 }
n@1105 7430
n@1105 7431 return values;
n@1105 7432 },
n@1105 7433
n@1105 7434 set: function( elem, value ) {
n@1105 7435 var optionSet, option,
n@1105 7436 options = elem.options,
n@1105 7437 values = jQuery.makeArray( value ),
n@1105 7438 i = options.length;
n@1105 7439
n@1105 7440 while ( i-- ) {
n@1105 7441 option = options[ i ];
n@1105 7442 if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
n@1105 7443 optionSet = true;
n@1105 7444 }
n@1105 7445 }
n@1105 7446
n@1105 7447 // Force browsers to behave consistently when non-matching value is set
n@1105 7448 if ( !optionSet ) {
n@1105 7449 elem.selectedIndex = -1;
n@1105 7450 }
n@1105 7451 return values;
n@1105 7452 }
n@1105 7453 }
n@1105 7454 }
n@1105 7455 });
n@1105 7456
n@1105 7457 // Radios and checkboxes getter/setter
n@1105 7458 jQuery.each([ "radio", "checkbox" ], function() {
n@1105 7459 jQuery.valHooks[ this ] = {
n@1105 7460 set: function( elem, value ) {
n@1105 7461 if ( jQuery.isArray( value ) ) {
n@1105 7462 return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
n@1105 7463 }
n@1105 7464 }
n@1105 7465 };
n@1105 7466 if ( !support.checkOn ) {
n@1105 7467 jQuery.valHooks[ this ].get = function( elem ) {
n@1105 7468 return elem.getAttribute("value") === null ? "on" : elem.value;
n@1105 7469 };
n@1105 7470 }
n@1105 7471 });
n@1105 7472
n@1105 7473
n@1105 7474
n@1105 7475
n@1105 7476 // Return jQuery for attributes-only inclusion
n@1105 7477
n@1105 7478
n@1105 7479 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
n@1105 7480 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
n@1105 7481 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
n@1105 7482
n@1105 7483 // Handle event binding
n@1105 7484 jQuery.fn[ name ] = function( data, fn ) {
n@1105 7485 return arguments.length > 0 ?
n@1105 7486 this.on( name, null, data, fn ) :
n@1105 7487 this.trigger( name );
n@1105 7488 };
n@1105 7489 });
n@1105 7490
n@1105 7491 jQuery.fn.extend({
n@1105 7492 hover: function( fnOver, fnOut ) {
n@1105 7493 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
n@1105 7494 },
n@1105 7495
n@1105 7496 bind: function( types, data, fn ) {
n@1105 7497 return this.on( types, null, data, fn );
n@1105 7498 },
n@1105 7499 unbind: function( types, fn ) {
n@1105 7500 return this.off( types, null, fn );
n@1105 7501 },
n@1105 7502
n@1105 7503 delegate: function( selector, types, data, fn ) {
n@1105 7504 return this.on( types, selector, data, fn );
n@1105 7505 },
n@1105 7506 undelegate: function( selector, types, fn ) {
n@1105 7507 // ( namespace ) or ( selector, types [, fn] )
n@1105 7508 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
n@1105 7509 }
n@1105 7510 });
n@1105 7511
n@1105 7512
n@1105 7513 var nonce = jQuery.now();
n@1105 7514
n@1105 7515 var rquery = (/\?/);
n@1105 7516
n@1105 7517
n@1105 7518
n@1105 7519 // Support: Android 2.3
n@1105 7520 // Workaround failure to string-cast null input
n@1105 7521 jQuery.parseJSON = function( data ) {
n@1105 7522 return JSON.parse( data + "" );
n@1105 7523 };
n@1105 7524
n@1105 7525
n@1105 7526 // Cross-browser xml parsing
n@1105 7527 jQuery.parseXML = function( data ) {
n@1105 7528 var xml, tmp;
n@1105 7529 if ( !data || typeof data !== "string" ) {
n@1105 7530 return null;
n@1105 7531 }
n@1105 7532
n@1105 7533 // Support: IE9
n@1105 7534 try {
n@1105 7535 tmp = new DOMParser();
n@1105 7536 xml = tmp.parseFromString( data, "text/xml" );
n@1105 7537 } catch ( e ) {
n@1105 7538 xml = undefined;
n@1105 7539 }
n@1105 7540
n@1105 7541 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
n@1105 7542 jQuery.error( "Invalid XML: " + data );
n@1105 7543 }
n@1105 7544 return xml;
n@1105 7545 };
n@1105 7546
n@1105 7547
n@1105 7548 var
n@1105 7549 rhash = /#.*$/,
n@1105 7550 rts = /([?&])_=[^&]*/,
n@1105 7551 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
n@1105 7552 // #7653, #8125, #8152: local protocol detection
n@1105 7553 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
n@1105 7554 rnoContent = /^(?:GET|HEAD)$/,
n@1105 7555 rprotocol = /^\/\//,
n@1105 7556 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
n@1105 7557
n@1105 7558 /* Prefilters
n@1105 7559 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
n@1105 7560 * 2) These are called:
n@1105 7561 * - BEFORE asking for a transport
n@1105 7562 * - AFTER param serialization (s.data is a string if s.processData is true)
n@1105 7563 * 3) key is the dataType
n@1105 7564 * 4) the catchall symbol "*" can be used
n@1105 7565 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
n@1105 7566 */
n@1105 7567 prefilters = {},
n@1105 7568
n@1105 7569 /* Transports bindings
n@1105 7570 * 1) key is the dataType
n@1105 7571 * 2) the catchall symbol "*" can be used
n@1105 7572 * 3) selection will start with transport dataType and THEN go to "*" if needed
n@1105 7573 */
n@1105 7574 transports = {},
n@1105 7575
n@1105 7576 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
n@1105 7577 allTypes = "*/".concat( "*" ),
n@1105 7578
n@1105 7579 // Document location
n@1105 7580 ajaxLocation = window.location.href,
n@1105 7581
n@1105 7582 // Segment location into parts
n@1105 7583 ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
n@1105 7584
n@1105 7585 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
n@1105 7586 function addToPrefiltersOrTransports( structure ) {
n@1105 7587
n@1105 7588 // dataTypeExpression is optional and defaults to "*"
n@1105 7589 return function( dataTypeExpression, func ) {
n@1105 7590
n@1105 7591 if ( typeof dataTypeExpression !== "string" ) {
n@1105 7592 func = dataTypeExpression;
n@1105 7593 dataTypeExpression = "*";
n@1105 7594 }
n@1105 7595
n@1105 7596 var dataType,
n@1105 7597 i = 0,
n@1105 7598 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
n@1105 7599
n@1105 7600 if ( jQuery.isFunction( func ) ) {
n@1105 7601 // For each dataType in the dataTypeExpression
n@1105 7602 while ( (dataType = dataTypes[i++]) ) {
n@1105 7603 // Prepend if requested
n@1105 7604 if ( dataType[0] === "+" ) {
n@1105 7605 dataType = dataType.slice( 1 ) || "*";
n@1105 7606 (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
n@1105 7607
n@1105 7608 // Otherwise append
n@1105 7609 } else {
n@1105 7610 (structure[ dataType ] = structure[ dataType ] || []).push( func );
n@1105 7611 }
n@1105 7612 }
n@1105 7613 }
n@1105 7614 };
n@1105 7615 }
n@1105 7616
n@1105 7617 // Base inspection function for prefilters and transports
n@1105 7618 function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
n@1105 7619
n@1105 7620 var inspected = {},
n@1105 7621 seekingTransport = ( structure === transports );
n@1105 7622
n@1105 7623 function inspect( dataType ) {
n@1105 7624 var selected;
n@1105 7625 inspected[ dataType ] = true;
n@1105 7626 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
n@1105 7627 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
n@1105 7628 if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
n@1105 7629 options.dataTypes.unshift( dataTypeOrTransport );
n@1105 7630 inspect( dataTypeOrTransport );
n@1105 7631 return false;
n@1105 7632 } else if ( seekingTransport ) {
n@1105 7633 return !( selected = dataTypeOrTransport );
n@1105 7634 }
n@1105 7635 });
n@1105 7636 return selected;
n@1105 7637 }
n@1105 7638
n@1105 7639 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
n@1105 7640 }
n@1105 7641
n@1105 7642 // A special extend for ajax options
n@1105 7643 // that takes "flat" options (not to be deep extended)
n@1105 7644 // Fixes #9887
n@1105 7645 function ajaxExtend( target, src ) {
n@1105 7646 var key, deep,
n@1105 7647 flatOptions = jQuery.ajaxSettings.flatOptions || {};
n@1105 7648
n@1105 7649 for ( key in src ) {
n@1105 7650 if ( src[ key ] !== undefined ) {
n@1105 7651 ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
n@1105 7652 }
n@1105 7653 }
n@1105 7654 if ( deep ) {
n@1105 7655 jQuery.extend( true, target, deep );
n@1105 7656 }
n@1105 7657
n@1105 7658 return target;
n@1105 7659 }
n@1105 7660
n@1105 7661 /* Handles responses to an ajax request:
n@1105 7662 * - finds the right dataType (mediates between content-type and expected dataType)
n@1105 7663 * - returns the corresponding response
n@1105 7664 */
n@1105 7665 function ajaxHandleResponses( s, jqXHR, responses ) {
n@1105 7666
n@1105 7667 var ct, type, finalDataType, firstDataType,
n@1105 7668 contents = s.contents,
n@1105 7669 dataTypes = s.dataTypes;
n@1105 7670
n@1105 7671 // Remove auto dataType and get content-type in the process
n@1105 7672 while ( dataTypes[ 0 ] === "*" ) {
n@1105 7673 dataTypes.shift();
n@1105 7674 if ( ct === undefined ) {
n@1105 7675 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
n@1105 7676 }
n@1105 7677 }
n@1105 7678
n@1105 7679 // Check if we're dealing with a known content-type
n@1105 7680 if ( ct ) {
n@1105 7681 for ( type in contents ) {
n@1105 7682 if ( contents[ type ] && contents[ type ].test( ct ) ) {
n@1105 7683 dataTypes.unshift( type );
n@1105 7684 break;
n@1105 7685 }
n@1105 7686 }
n@1105 7687 }
n@1105 7688
n@1105 7689 // Check to see if we have a response for the expected dataType
n@1105 7690 if ( dataTypes[ 0 ] in responses ) {
n@1105 7691 finalDataType = dataTypes[ 0 ];
n@1105 7692 } else {
n@1105 7693 // Try convertible dataTypes
n@1105 7694 for ( type in responses ) {
n@1105 7695 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
n@1105 7696 finalDataType = type;
n@1105 7697 break;
n@1105 7698 }
n@1105 7699 if ( !firstDataType ) {
n@1105 7700 firstDataType = type;
n@1105 7701 }
n@1105 7702 }
n@1105 7703 // Or just use first one
n@1105 7704 finalDataType = finalDataType || firstDataType;
n@1105 7705 }
n@1105 7706
n@1105 7707 // If we found a dataType
n@1105 7708 // We add the dataType to the list if needed
n@1105 7709 // and return the corresponding response
n@1105 7710 if ( finalDataType ) {
n@1105 7711 if ( finalDataType !== dataTypes[ 0 ] ) {
n@1105 7712 dataTypes.unshift( finalDataType );
n@1105 7713 }
n@1105 7714 return responses[ finalDataType ];
n@1105 7715 }
n@1105 7716 }
n@1105 7717
n@1105 7718 /* Chain conversions given the request and the original response
n@1105 7719 * Also sets the responseXXX fields on the jqXHR instance
n@1105 7720 */
n@1105 7721 function ajaxConvert( s, response, jqXHR, isSuccess ) {
n@1105 7722 var conv2, current, conv, tmp, prev,
n@1105 7723 converters = {},
n@1105 7724 // Work with a copy of dataTypes in case we need to modify it for conversion
n@1105 7725 dataTypes = s.dataTypes.slice();
n@1105 7726
n@1105 7727 // Create converters map with lowercased keys
n@1105 7728 if ( dataTypes[ 1 ] ) {
n@1105 7729 for ( conv in s.converters ) {
n@1105 7730 converters[ conv.toLowerCase() ] = s.converters[ conv ];
n@1105 7731 }
n@1105 7732 }
n@1105 7733
n@1105 7734 current = dataTypes.shift();
n@1105 7735
n@1105 7736 // Convert to each sequential dataType
n@1105 7737 while ( current ) {
n@1105 7738
n@1105 7739 if ( s.responseFields[ current ] ) {
n@1105 7740 jqXHR[ s.responseFields[ current ] ] = response;
n@1105 7741 }
n@1105 7742
n@1105 7743 // Apply the dataFilter if provided
n@1105 7744 if ( !prev && isSuccess && s.dataFilter ) {
n@1105 7745 response = s.dataFilter( response, s.dataType );
n@1105 7746 }
n@1105 7747
n@1105 7748 prev = current;
n@1105 7749 current = dataTypes.shift();
n@1105 7750
n@1105 7751 if ( current ) {
n@1105 7752
n@1105 7753 // There's only work to do if current dataType is non-auto
n@1105 7754 if ( current === "*" ) {
n@1105 7755
n@1105 7756 current = prev;
n@1105 7757
n@1105 7758 // Convert response if prev dataType is non-auto and differs from current
n@1105 7759 } else if ( prev !== "*" && prev !== current ) {
n@1105 7760
n@1105 7761 // Seek a direct converter
n@1105 7762 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
n@1105 7763
n@1105 7764 // If none found, seek a pair
n@1105 7765 if ( !conv ) {
n@1105 7766 for ( conv2 in converters ) {
n@1105 7767
n@1105 7768 // If conv2 outputs current
n@1105 7769 tmp = conv2.split( " " );
n@1105 7770 if ( tmp[ 1 ] === current ) {
n@1105 7771
n@1105 7772 // If prev can be converted to accepted input
n@1105 7773 conv = converters[ prev + " " + tmp[ 0 ] ] ||
n@1105 7774 converters[ "* " + tmp[ 0 ] ];
n@1105 7775 if ( conv ) {
n@1105 7776 // Condense equivalence converters
n@1105 7777 if ( conv === true ) {
n@1105 7778 conv = converters[ conv2 ];
n@1105 7779
n@1105 7780 // Otherwise, insert the intermediate dataType
n@1105 7781 } else if ( converters[ conv2 ] !== true ) {
n@1105 7782 current = tmp[ 0 ];
n@1105 7783 dataTypes.unshift( tmp[ 1 ] );
n@1105 7784 }
n@1105 7785 break;
n@1105 7786 }
n@1105 7787 }
n@1105 7788 }
n@1105 7789 }
n@1105 7790
n@1105 7791 // Apply converter (if not an equivalence)
n@1105 7792 if ( conv !== true ) {
n@1105 7793
n@1105 7794 // Unless errors are allowed to bubble, catch and return them
n@1105 7795 if ( conv && s[ "throws" ] ) {
n@1105 7796 response = conv( response );
n@1105 7797 } else {
n@1105 7798 try {
n@1105 7799 response = conv( response );
n@1105 7800 } catch ( e ) {
n@1105 7801 return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
n@1105 7802 }
n@1105 7803 }
n@1105 7804 }
n@1105 7805 }
n@1105 7806 }
n@1105 7807 }
n@1105 7808
n@1105 7809 return { state: "success", data: response };
n@1105 7810 }
n@1105 7811
n@1105 7812 jQuery.extend({
n@1105 7813
n@1105 7814 // Counter for holding the number of active queries
n@1105 7815 active: 0,
n@1105 7816
n@1105 7817 // Last-Modified header cache for next request
n@1105 7818 lastModified: {},
n@1105 7819 etag: {},
n@1105 7820
n@1105 7821 ajaxSettings: {
n@1105 7822 url: ajaxLocation,
n@1105 7823 type: "GET",
n@1105 7824 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
n@1105 7825 global: true,
n@1105 7826 processData: true,
n@1105 7827 async: true,
n@1105 7828 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
n@1105 7829 /*
n@1105 7830 timeout: 0,
n@1105 7831 data: null,
n@1105 7832 dataType: null,
n@1105 7833 username: null,
n@1105 7834 password: null,
n@1105 7835 cache: null,
n@1105 7836 throws: false,
n@1105 7837 traditional: false,
n@1105 7838 headers: {},
n@1105 7839 */
n@1105 7840
n@1105 7841 accepts: {
n@1105 7842 "*": allTypes,
n@1105 7843 text: "text/plain",
n@1105 7844 html: "text/html",
n@1105 7845 xml: "application/xml, text/xml",
n@1105 7846 json: "application/json, text/javascript"
n@1105 7847 },
n@1105 7848
n@1105 7849 contents: {
n@1105 7850 xml: /xml/,
n@1105 7851 html: /html/,
n@1105 7852 json: /json/
n@1105 7853 },
n@1105 7854
n@1105 7855 responseFields: {
n@1105 7856 xml: "responseXML",
n@1105 7857 text: "responseText",
n@1105 7858 json: "responseJSON"
n@1105 7859 },
n@1105 7860
n@1105 7861 // Data converters
n@1105 7862 // Keys separate source (or catchall "*") and destination types with a single space
n@1105 7863 converters: {
n@1105 7864
n@1105 7865 // Convert anything to text
n@1105 7866 "* text": String,
n@1105 7867
n@1105 7868 // Text to html (true = no transformation)
n@1105 7869 "text html": true,
n@1105 7870
n@1105 7871 // Evaluate text as a json expression
n@1105 7872 "text json": jQuery.parseJSON,
n@1105 7873
n@1105 7874 // Parse text as xml
n@1105 7875 "text xml": jQuery.parseXML
n@1105 7876 },
n@1105 7877
n@1105 7878 // For options that shouldn't be deep extended:
n@1105 7879 // you can add your own custom options here if
n@1105 7880 // and when you create one that shouldn't be
n@1105 7881 // deep extended (see ajaxExtend)
n@1105 7882 flatOptions: {
n@1105 7883 url: true,
n@1105 7884 context: true
n@1105 7885 }
n@1105 7886 },
n@1105 7887
n@1105 7888 // Creates a full fledged settings object into target
n@1105 7889 // with both ajaxSettings and settings fields.
n@1105 7890 // If target is omitted, writes into ajaxSettings.
n@1105 7891 ajaxSetup: function( target, settings ) {
n@1105 7892 return settings ?
n@1105 7893
n@1105 7894 // Building a settings object
n@1105 7895 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
n@1105 7896
n@1105 7897 // Extending ajaxSettings
n@1105 7898 ajaxExtend( jQuery.ajaxSettings, target );
n@1105 7899 },
n@1105 7900
n@1105 7901 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
n@1105 7902 ajaxTransport: addToPrefiltersOrTransports( transports ),
n@1105 7903
n@1105 7904 // Main method
n@1105 7905 ajax: function( url, options ) {
n@1105 7906
n@1105 7907 // If url is an object, simulate pre-1.5 signature
n@1105 7908 if ( typeof url === "object" ) {
n@1105 7909 options = url;
n@1105 7910 url = undefined;
n@1105 7911 }
n@1105 7912
n@1105 7913 // Force options to be an object
n@1105 7914 options = options || {};
n@1105 7915
n@1105 7916 var transport,
n@1105 7917 // URL without anti-cache param
n@1105 7918 cacheURL,
n@1105 7919 // Response headers
n@1105 7920 responseHeadersString,
n@1105 7921 responseHeaders,
n@1105 7922 // timeout handle
n@1105 7923 timeoutTimer,
n@1105 7924 // Cross-domain detection vars
n@1105 7925 parts,
n@1105 7926 // To know if global events are to be dispatched
n@1105 7927 fireGlobals,
n@1105 7928 // Loop variable
n@1105 7929 i,
n@1105 7930 // Create the final options object
n@1105 7931 s = jQuery.ajaxSetup( {}, options ),
n@1105 7932 // Callbacks context
n@1105 7933 callbackContext = s.context || s,
n@1105 7934 // Context for global events is callbackContext if it is a DOM node or jQuery collection
n@1105 7935 globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
n@1105 7936 jQuery( callbackContext ) :
n@1105 7937 jQuery.event,
n@1105 7938 // Deferreds
n@1105 7939 deferred = jQuery.Deferred(),
n@1105 7940 completeDeferred = jQuery.Callbacks("once memory"),
n@1105 7941 // Status-dependent callbacks
n@1105 7942 statusCode = s.statusCode || {},
n@1105 7943 // Headers (they are sent all at once)
n@1105 7944 requestHeaders = {},
n@1105 7945 requestHeadersNames = {},
n@1105 7946 // The jqXHR state
n@1105 7947 state = 0,
n@1105 7948 // Default abort message
n@1105 7949 strAbort = "canceled",
n@1105 7950 // Fake xhr
n@1105 7951 jqXHR = {
n@1105 7952 readyState: 0,
n@1105 7953
n@1105 7954 // Builds headers hashtable if needed
n@1105 7955 getResponseHeader: function( key ) {
n@1105 7956 var match;
n@1105 7957 if ( state === 2 ) {
n@1105 7958 if ( !responseHeaders ) {
n@1105 7959 responseHeaders = {};
n@1105 7960 while ( (match = rheaders.exec( responseHeadersString )) ) {
n@1105 7961 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
n@1105 7962 }
n@1105 7963 }
n@1105 7964 match = responseHeaders[ key.toLowerCase() ];
n@1105 7965 }
n@1105 7966 return match == null ? null : match;
n@1105 7967 },
n@1105 7968
n@1105 7969 // Raw string
n@1105 7970 getAllResponseHeaders: function() {
n@1105 7971 return state === 2 ? responseHeadersString : null;
n@1105 7972 },
n@1105 7973
n@1105 7974 // Caches the header
n@1105 7975 setRequestHeader: function( name, value ) {
n@1105 7976 var lname = name.toLowerCase();
n@1105 7977 if ( !state ) {
n@1105 7978 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
n@1105 7979 requestHeaders[ name ] = value;
n@1105 7980 }
n@1105 7981 return this;
n@1105 7982 },
n@1105 7983
n@1105 7984 // Overrides response content-type header
n@1105 7985 overrideMimeType: function( type ) {
n@1105 7986 if ( !state ) {
n@1105 7987 s.mimeType = type;
n@1105 7988 }
n@1105 7989 return this;
n@1105 7990 },
n@1105 7991
n@1105 7992 // Status-dependent callbacks
n@1105 7993 statusCode: function( map ) {
n@1105 7994 var code;
n@1105 7995 if ( map ) {
n@1105 7996 if ( state < 2 ) {
n@1105 7997 for ( code in map ) {
n@1105 7998 // Lazy-add the new callback in a way that preserves old ones
n@1105 7999 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
n@1105 8000 }
n@1105 8001 } else {
n@1105 8002 // Execute the appropriate callbacks
n@1105 8003 jqXHR.always( map[ jqXHR.status ] );
n@1105 8004 }
n@1105 8005 }
n@1105 8006 return this;
n@1105 8007 },
n@1105 8008
n@1105 8009 // Cancel the request
n@1105 8010 abort: function( statusText ) {
n@1105 8011 var finalText = statusText || strAbort;
n@1105 8012 if ( transport ) {
n@1105 8013 transport.abort( finalText );
n@1105 8014 }
n@1105 8015 done( 0, finalText );
n@1105 8016 return this;
n@1105 8017 }
n@1105 8018 };
n@1105 8019
n@1105 8020 // Attach deferreds
n@1105 8021 deferred.promise( jqXHR ).complete = completeDeferred.add;
n@1105 8022 jqXHR.success = jqXHR.done;
n@1105 8023 jqXHR.error = jqXHR.fail;
n@1105 8024
n@1105 8025 // Remove hash character (#7531: and string promotion)
n@1105 8026 // Add protocol if not provided (prefilters might expect it)
n@1105 8027 // Handle falsy url in the settings object (#10093: consistency with old signature)
n@1105 8028 // We also use the url parameter if available
n@1105 8029 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
n@1105 8030 .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
n@1105 8031
n@1105 8032 // Alias method option to type as per ticket #12004
n@1105 8033 s.type = options.method || options.type || s.method || s.type;
n@1105 8034
n@1105 8035 // Extract dataTypes list
n@1105 8036 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
n@1105 8037
n@1105 8038 // A cross-domain request is in order when we have a protocol:host:port mismatch
n@1105 8039 if ( s.crossDomain == null ) {
n@1105 8040 parts = rurl.exec( s.url.toLowerCase() );
n@1105 8041 s.crossDomain = !!( parts &&
n@1105 8042 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
n@1105 8043 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
n@1105 8044 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
n@1105 8045 );
n@1105 8046 }
n@1105 8047
n@1105 8048 // Convert data if not already a string
n@1105 8049 if ( s.data && s.processData && typeof s.data !== "string" ) {
n@1105 8050 s.data = jQuery.param( s.data, s.traditional );
n@1105 8051 }
n@1105 8052
n@1105 8053 // Apply prefilters
n@1105 8054 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
n@1105 8055
n@1105 8056 // If request was aborted inside a prefilter, stop there
n@1105 8057 if ( state === 2 ) {
n@1105 8058 return jqXHR;
n@1105 8059 }
n@1105 8060
n@1105 8061 // We can fire global events as of now if asked to
n@1105 8062 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
n@1105 8063 fireGlobals = jQuery.event && s.global;
n@1105 8064
n@1105 8065 // Watch for a new set of requests
n@1105 8066 if ( fireGlobals && jQuery.active++ === 0 ) {
n@1105 8067 jQuery.event.trigger("ajaxStart");
n@1105 8068 }
n@1105 8069
n@1105 8070 // Uppercase the type
n@1105 8071 s.type = s.type.toUpperCase();
n@1105 8072
n@1105 8073 // Determine if request has content
n@1105 8074 s.hasContent = !rnoContent.test( s.type );
n@1105 8075
n@1105 8076 // Save the URL in case we're toying with the If-Modified-Since
n@1105 8077 // and/or If-None-Match header later on
n@1105 8078 cacheURL = s.url;
n@1105 8079
n@1105 8080 // More options handling for requests with no content
n@1105 8081 if ( !s.hasContent ) {
n@1105 8082
n@1105 8083 // If data is available, append data to url
n@1105 8084 if ( s.data ) {
n@1105 8085 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
n@1105 8086 // #9682: remove data so that it's not used in an eventual retry
n@1105 8087 delete s.data;
n@1105 8088 }
n@1105 8089
n@1105 8090 // Add anti-cache in url if needed
n@1105 8091 if ( s.cache === false ) {
n@1105 8092 s.url = rts.test( cacheURL ) ?
n@1105 8093
n@1105 8094 // If there is already a '_' parameter, set its value
n@1105 8095 cacheURL.replace( rts, "$1_=" + nonce++ ) :
n@1105 8096
n@1105 8097 // Otherwise add one to the end
n@1105 8098 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
n@1105 8099 }
n@1105 8100 }
n@1105 8101
n@1105 8102 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
n@1105 8103 if ( s.ifModified ) {
n@1105 8104 if ( jQuery.lastModified[ cacheURL ] ) {
n@1105 8105 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
n@1105 8106 }
n@1105 8107 if ( jQuery.etag[ cacheURL ] ) {
n@1105 8108 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
n@1105 8109 }
n@1105 8110 }
n@1105 8111
n@1105 8112 // Set the correct header, if data is being sent
n@1105 8113 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
n@1105 8114 jqXHR.setRequestHeader( "Content-Type", s.contentType );
n@1105 8115 }
n@1105 8116
n@1105 8117 // Set the Accepts header for the server, depending on the dataType
n@1105 8118 jqXHR.setRequestHeader(
n@1105 8119 "Accept",
n@1105 8120 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
n@1105 8121 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
n@1105 8122 s.accepts[ "*" ]
n@1105 8123 );
n@1105 8124
n@1105 8125 // Check for headers option
n@1105 8126 for ( i in s.headers ) {
n@1105 8127 jqXHR.setRequestHeader( i, s.headers[ i ] );
n@1105 8128 }
n@1105 8129
n@1105 8130 // Allow custom headers/mimetypes and early abort
n@1105 8131 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
n@1105 8132 // Abort if not done already and return
n@1105 8133 return jqXHR.abort();
n@1105 8134 }
n@1105 8135
n@1105 8136 // Aborting is no longer a cancellation
n@1105 8137 strAbort = "abort";
n@1105 8138
n@1105 8139 // Install callbacks on deferreds
n@1105 8140 for ( i in { success: 1, error: 1, complete: 1 } ) {
n@1105 8141 jqXHR[ i ]( s[ i ] );
n@1105 8142 }
n@1105 8143
n@1105 8144 // Get transport
n@1105 8145 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
n@1105 8146
n@1105 8147 // If no transport, we auto-abort
n@1105 8148 if ( !transport ) {
n@1105 8149 done( -1, "No Transport" );
n@1105 8150 } else {
n@1105 8151 jqXHR.readyState = 1;
n@1105 8152
n@1105 8153 // Send global event
n@1105 8154 if ( fireGlobals ) {
n@1105 8155 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
n@1105 8156 }
n@1105 8157 // Timeout
n@1105 8158 if ( s.async && s.timeout > 0 ) {
n@1105 8159 timeoutTimer = setTimeout(function() {
n@1105 8160 jqXHR.abort("timeout");
n@1105 8161 }, s.timeout );
n@1105 8162 }
n@1105 8163
n@1105 8164 try {
n@1105 8165 state = 1;
n@1105 8166 transport.send( requestHeaders, done );
n@1105 8167 } catch ( e ) {
n@1105 8168 // Propagate exception as error if not done
n@1105 8169 if ( state < 2 ) {
n@1105 8170 done( -1, e );
n@1105 8171 // Simply rethrow otherwise
n@1105 8172 } else {
n@1105 8173 throw e;
n@1105 8174 }
n@1105 8175 }
n@1105 8176 }
n@1105 8177
n@1105 8178 // Callback for when everything is done
n@1105 8179 function done( status, nativeStatusText, responses, headers ) {
n@1105 8180 var isSuccess, success, error, response, modified,
n@1105 8181 statusText = nativeStatusText;
n@1105 8182
n@1105 8183 // Called once
n@1105 8184 if ( state === 2 ) {
n@1105 8185 return;
n@1105 8186 }
n@1105 8187
n@1105 8188 // State is "done" now
n@1105 8189 state = 2;
n@1105 8190
n@1105 8191 // Clear timeout if it exists
n@1105 8192 if ( timeoutTimer ) {
n@1105 8193 clearTimeout( timeoutTimer );
n@1105 8194 }
n@1105 8195
n@1105 8196 // Dereference transport for early garbage collection
n@1105 8197 // (no matter how long the jqXHR object will be used)
n@1105 8198 transport = undefined;
n@1105 8199
n@1105 8200 // Cache response headers
n@1105 8201 responseHeadersString = headers || "";
n@1105 8202
n@1105 8203 // Set readyState
n@1105 8204 jqXHR.readyState = status > 0 ? 4 : 0;
n@1105 8205
n@1105 8206 // Determine if successful
n@1105 8207 isSuccess = status >= 200 && status < 300 || status === 304;
n@1105 8208
n@1105 8209 // Get response data
n@1105 8210 if ( responses ) {
n@1105 8211 response = ajaxHandleResponses( s, jqXHR, responses );
n@1105 8212 }
n@1105 8213
n@1105 8214 // Convert no matter what (that way responseXXX fields are always set)
n@1105 8215 response = ajaxConvert( s, response, jqXHR, isSuccess );
n@1105 8216
n@1105 8217 // If successful, handle type chaining
n@1105 8218 if ( isSuccess ) {
n@1105 8219
n@1105 8220 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
n@1105 8221 if ( s.ifModified ) {
n@1105 8222 modified = jqXHR.getResponseHeader("Last-Modified");
n@1105 8223 if ( modified ) {
n@1105 8224 jQuery.lastModified[ cacheURL ] = modified;
n@1105 8225 }
n@1105 8226 modified = jqXHR.getResponseHeader("etag");
n@1105 8227 if ( modified ) {
n@1105 8228 jQuery.etag[ cacheURL ] = modified;
n@1105 8229 }
n@1105 8230 }
n@1105 8231
n@1105 8232 // if no content
n@1105 8233 if ( status === 204 || s.type === "HEAD" ) {
n@1105 8234 statusText = "nocontent";
n@1105 8235
n@1105 8236 // if not modified
n@1105 8237 } else if ( status === 304 ) {
n@1105 8238 statusText = "notmodified";
n@1105 8239
n@1105 8240 // If we have data, let's convert it
n@1105 8241 } else {
n@1105 8242 statusText = response.state;
n@1105 8243 success = response.data;
n@1105 8244 error = response.error;
n@1105 8245 isSuccess = !error;
n@1105 8246 }
n@1105 8247 } else {
n@1105 8248 // Extract error from statusText and normalize for non-aborts
n@1105 8249 error = statusText;
n@1105 8250 if ( status || !statusText ) {
n@1105 8251 statusText = "error";
n@1105 8252 if ( status < 0 ) {
n@1105 8253 status = 0;
n@1105 8254 }
n@1105 8255 }
n@1105 8256 }
n@1105 8257
n@1105 8258 // Set data for the fake xhr object
n@1105 8259 jqXHR.status = status;
n@1105 8260 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
n@1105 8261
n@1105 8262 // Success/Error
n@1105 8263 if ( isSuccess ) {
n@1105 8264 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
n@1105 8265 } else {
n@1105 8266 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
n@1105 8267 }
n@1105 8268
n@1105 8269 // Status-dependent callbacks
n@1105 8270 jqXHR.statusCode( statusCode );
n@1105 8271 statusCode = undefined;
n@1105 8272
n@1105 8273 if ( fireGlobals ) {
n@1105 8274 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
n@1105 8275 [ jqXHR, s, isSuccess ? success : error ] );
n@1105 8276 }
n@1105 8277
n@1105 8278 // Complete
n@1105 8279 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
n@1105 8280
n@1105 8281 if ( fireGlobals ) {
n@1105 8282 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
n@1105 8283 // Handle the global AJAX counter
n@1105 8284 if ( !( --jQuery.active ) ) {
n@1105 8285 jQuery.event.trigger("ajaxStop");
n@1105 8286 }
n@1105 8287 }
n@1105 8288 }
n@1105 8289
n@1105 8290 return jqXHR;
n@1105 8291 },
n@1105 8292
n@1105 8293 getJSON: function( url, data, callback ) {
n@1105 8294 return jQuery.get( url, data, callback, "json" );
n@1105 8295 },
n@1105 8296
n@1105 8297 getScript: function( url, callback ) {
n@1105 8298 return jQuery.get( url, undefined, callback, "script" );
n@1105 8299 }
n@1105 8300 });
n@1105 8301
n@1105 8302 jQuery.each( [ "get", "post" ], function( i, method ) {
n@1105 8303 jQuery[ method ] = function( url, data, callback, type ) {
n@1105 8304 // Shift arguments if data argument was omitted
n@1105 8305 if ( jQuery.isFunction( data ) ) {
n@1105 8306 type = type || callback;
n@1105 8307 callback = data;
n@1105 8308 data = undefined;
n@1105 8309 }
n@1105 8310
n@1105 8311 return jQuery.ajax({
n@1105 8312 url: url,
n@1105 8313 type: method,
n@1105 8314 dataType: type,
n@1105 8315 data: data,
n@1105 8316 success: callback
n@1105 8317 });
n@1105 8318 };
n@1105 8319 });
n@1105 8320
n@1105 8321
n@1105 8322 jQuery._evalUrl = function( url ) {
n@1105 8323 return jQuery.ajax({
n@1105 8324 url: url,
n@1105 8325 type: "GET",
n@1105 8326 dataType: "script",
n@1105 8327 async: false,
n@1105 8328 global: false,
n@1105 8329 "throws": true
n@1105 8330 });
n@1105 8331 };
n@1105 8332
n@1105 8333
n@1105 8334 jQuery.fn.extend({
n@1105 8335 wrapAll: function( html ) {
n@1105 8336 var wrap;
n@1105 8337
n@1105 8338 if ( jQuery.isFunction( html ) ) {
n@1105 8339 return this.each(function( i ) {
n@1105 8340 jQuery( this ).wrapAll( html.call(this, i) );
n@1105 8341 });
n@1105 8342 }
n@1105 8343
n@1105 8344 if ( this[ 0 ] ) {
n@1105 8345
n@1105 8346 // The elements to wrap the target around
n@1105 8347 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
n@1105 8348
n@1105 8349 if ( this[ 0 ].parentNode ) {
n@1105 8350 wrap.insertBefore( this[ 0 ] );
n@1105 8351 }
n@1105 8352
n@1105 8353 wrap.map(function() {
n@1105 8354 var elem = this;
n@1105 8355
n@1105 8356 while ( elem.firstElementChild ) {
n@1105 8357 elem = elem.firstElementChild;
n@1105 8358 }
n@1105 8359
n@1105 8360 return elem;
n@1105 8361 }).append( this );
n@1105 8362 }
n@1105 8363
n@1105 8364 return this;
n@1105 8365 },
n@1105 8366
n@1105 8367 wrapInner: function( html ) {
n@1105 8368 if ( jQuery.isFunction( html ) ) {
n@1105 8369 return this.each(function( i ) {
n@1105 8370 jQuery( this ).wrapInner( html.call(this, i) );
n@1105 8371 });
n@1105 8372 }
n@1105 8373
n@1105 8374 return this.each(function() {
n@1105 8375 var self = jQuery( this ),
n@1105 8376 contents = self.contents();
n@1105 8377
n@1105 8378 if ( contents.length ) {
n@1105 8379 contents.wrapAll( html );
n@1105 8380
n@1105 8381 } else {
n@1105 8382 self.append( html );
n@1105 8383 }
n@1105 8384 });
n@1105 8385 },
n@1105 8386
n@1105 8387 wrap: function( html ) {
n@1105 8388 var isFunction = jQuery.isFunction( html );
n@1105 8389
n@1105 8390 return this.each(function( i ) {
n@1105 8391 jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
n@1105 8392 });
n@1105 8393 },
n@1105 8394
n@1105 8395 unwrap: function() {
n@1105 8396 return this.parent().each(function() {
n@1105 8397 if ( !jQuery.nodeName( this, "body" ) ) {
n@1105 8398 jQuery( this ).replaceWith( this.childNodes );
n@1105 8399 }
n@1105 8400 }).end();
n@1105 8401 }
n@1105 8402 });
n@1105 8403
n@1105 8404
n@1105 8405 jQuery.expr.filters.hidden = function( elem ) {
n@1105 8406 // Support: Opera <= 12.12
n@1105 8407 // Opera reports offsetWidths and offsetHeights less than zero on some elements
n@1105 8408 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
n@1105 8409 };
n@1105 8410 jQuery.expr.filters.visible = function( elem ) {
n@1105 8411 return !jQuery.expr.filters.hidden( elem );
n@1105 8412 };
n@1105 8413
n@1105 8414
n@1105 8415
n@1105 8416
n@1105 8417 var r20 = /%20/g,
n@1105 8418 rbracket = /\[\]$/,
n@1105 8419 rCRLF = /\r?\n/g,
n@1105 8420 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
n@1105 8421 rsubmittable = /^(?:input|select|textarea|keygen)/i;
n@1105 8422
n@1105 8423 function buildParams( prefix, obj, traditional, add ) {
n@1105 8424 var name;
n@1105 8425
n@1105 8426 if ( jQuery.isArray( obj ) ) {
n@1105 8427 // Serialize array item.
n@1105 8428 jQuery.each( obj, function( i, v ) {
n@1105 8429 if ( traditional || rbracket.test( prefix ) ) {
n@1105 8430 // Treat each array item as a scalar.
n@1105 8431 add( prefix, v );
n@1105 8432
n@1105 8433 } else {
n@1105 8434 // Item is non-scalar (array or object), encode its numeric index.
n@1105 8435 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
n@1105 8436 }
n@1105 8437 });
n@1105 8438
n@1105 8439 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
n@1105 8440 // Serialize object item.
n@1105 8441 for ( name in obj ) {
n@1105 8442 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
n@1105 8443 }
n@1105 8444
n@1105 8445 } else {
n@1105 8446 // Serialize scalar item.
n@1105 8447 add( prefix, obj );
n@1105 8448 }
n@1105 8449 }
n@1105 8450
n@1105 8451 // Serialize an array of form elements or a set of
n@1105 8452 // key/values into a query string
n@1105 8453 jQuery.param = function( a, traditional ) {
n@1105 8454 var prefix,
n@1105 8455 s = [],
n@1105 8456 add = function( key, value ) {
n@1105 8457 // If value is a function, invoke it and return its value
n@1105 8458 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
n@1105 8459 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
n@1105 8460 };
n@1105 8461
n@1105 8462 // Set traditional to true for jQuery <= 1.3.2 behavior.
n@1105 8463 if ( traditional === undefined ) {
n@1105 8464 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
n@1105 8465 }
n@1105 8466
n@1105 8467 // If an array was passed in, assume that it is an array of form elements.
n@1105 8468 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
n@1105 8469 // Serialize the form elements
n@1105 8470 jQuery.each( a, function() {
n@1105 8471 add( this.name, this.value );
n@1105 8472 });
n@1105 8473
n@1105 8474 } else {
n@1105 8475 // If traditional, encode the "old" way (the way 1.3.2 or older
n@1105 8476 // did it), otherwise encode params recursively.
n@1105 8477 for ( prefix in a ) {
n@1105 8478 buildParams( prefix, a[ prefix ], traditional, add );
n@1105 8479 }
n@1105 8480 }
n@1105 8481
n@1105 8482 // Return the resulting serialization
n@1105 8483 return s.join( "&" ).replace( r20, "+" );
n@1105 8484 };
n@1105 8485
n@1105 8486 jQuery.fn.extend({
n@1105 8487 serialize: function() {
n@1105 8488 return jQuery.param( this.serializeArray() );
n@1105 8489 },
n@1105 8490 serializeArray: function() {
n@1105 8491 return this.map(function() {
n@1105 8492 // Can add propHook for "elements" to filter or add form elements
n@1105 8493 var elements = jQuery.prop( this, "elements" );
n@1105 8494 return elements ? jQuery.makeArray( elements ) : this;
n@1105 8495 })
n@1105 8496 .filter(function() {
n@1105 8497 var type = this.type;
n@1105 8498
n@1105 8499 // Use .is( ":disabled" ) so that fieldset[disabled] works
n@1105 8500 return this.name && !jQuery( this ).is( ":disabled" ) &&
n@1105 8501 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
n@1105 8502 ( this.checked || !rcheckableType.test( type ) );
n@1105 8503 })
n@1105 8504 .map(function( i, elem ) {
n@1105 8505 var val = jQuery( this ).val();
n@1105 8506
n@1105 8507 return val == null ?
n@1105 8508 null :
n@1105 8509 jQuery.isArray( val ) ?
n@1105 8510 jQuery.map( val, function( val ) {
n@1105 8511 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
n@1105 8512 }) :
n@1105 8513 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
n@1105 8514 }).get();
n@1105 8515 }
n@1105 8516 });
n@1105 8517
n@1105 8518
n@1105 8519 jQuery.ajaxSettings.xhr = function() {
n@1105 8520 try {
n@1105 8521 return new XMLHttpRequest();
n@1105 8522 } catch( e ) {}
n@1105 8523 };
n@1105 8524
n@1105 8525 var xhrId = 0,
n@1105 8526 xhrCallbacks = {},
n@1105 8527 xhrSuccessStatus = {
n@1105 8528 // file protocol always yields status code 0, assume 200
n@1105 8529 0: 200,
n@1105 8530 // Support: IE9
n@1105 8531 // #1450: sometimes IE returns 1223 when it should be 204
n@1105 8532 1223: 204
n@1105 8533 },
n@1105 8534 xhrSupported = jQuery.ajaxSettings.xhr();
n@1105 8535
n@1105 8536 // Support: IE9
n@1105 8537 // Open requests must be manually aborted on unload (#5280)
n@1105 8538 // See https://support.microsoft.com/kb/2856746 for more info
n@1105 8539 if ( window.attachEvent ) {
n@1105 8540 window.attachEvent( "onunload", function() {
n@1105 8541 for ( var key in xhrCallbacks ) {
n@1105 8542 xhrCallbacks[ key ]();
n@1105 8543 }
n@1105 8544 });
n@1105 8545 }
n@1105 8546
n@1105 8547 support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
n@1105 8548 support.ajax = xhrSupported = !!xhrSupported;
n@1105 8549
n@1105 8550 jQuery.ajaxTransport(function( options ) {
n@1105 8551 var callback;
n@1105 8552
n@1105 8553 // Cross domain only allowed if supported through XMLHttpRequest
n@1105 8554 if ( support.cors || xhrSupported && !options.crossDomain ) {
n@1105 8555 return {
n@1105 8556 send: function( headers, complete ) {
n@1105 8557 var i,
n@1105 8558 xhr = options.xhr(),
n@1105 8559 id = ++xhrId;
n@1105 8560
n@1105 8561 xhr.open( options.type, options.url, options.async, options.username, options.password );
n@1105 8562
n@1105 8563 // Apply custom fields if provided
n@1105 8564 if ( options.xhrFields ) {
n@1105 8565 for ( i in options.xhrFields ) {
n@1105 8566 xhr[ i ] = options.xhrFields[ i ];
n@1105 8567 }
n@1105 8568 }
n@1105 8569
n@1105 8570 // Override mime type if needed
n@1105 8571 if ( options.mimeType && xhr.overrideMimeType ) {
n@1105 8572 xhr.overrideMimeType( options.mimeType );
n@1105 8573 }
n@1105 8574
n@1105 8575 // X-Requested-With header
n@1105 8576 // For cross-domain requests, seeing as conditions for a preflight are
n@1105 8577 // akin to a jigsaw puzzle, we simply never set it to be sure.
n@1105 8578 // (it can always be set on a per-request basis or even using ajaxSetup)
n@1105 8579 // For same-domain requests, won't change header if already provided.
n@1105 8580 if ( !options.crossDomain && !headers["X-Requested-With"] ) {
n@1105 8581 headers["X-Requested-With"] = "XMLHttpRequest";
n@1105 8582 }
n@1105 8583
n@1105 8584 // Set headers
n@1105 8585 for ( i in headers ) {
n@1105 8586 xhr.setRequestHeader( i, headers[ i ] );
n@1105 8587 }
n@1105 8588
n@1105 8589 // Callback
n@1105 8590 callback = function( type ) {
n@1105 8591 return function() {
n@1105 8592 if ( callback ) {
n@1105 8593 delete xhrCallbacks[ id ];
n@1105 8594 callback = xhr.onload = xhr.onerror = null;
n@1105 8595
n@1105 8596 if ( type === "abort" ) {
n@1105 8597 xhr.abort();
n@1105 8598 } else if ( type === "error" ) {
n@1105 8599 complete(
n@1105 8600 // file: protocol always yields status 0; see #8605, #14207
n@1105 8601 xhr.status,
n@1105 8602 xhr.statusText
n@1105 8603 );
n@1105 8604 } else {
n@1105 8605 complete(
n@1105 8606 xhrSuccessStatus[ xhr.status ] || xhr.status,
n@1105 8607 xhr.statusText,
n@1105 8608 // Support: IE9
n@1105 8609 // Accessing binary-data responseText throws an exception
n@1105 8610 // (#11426)
n@1105 8611 typeof xhr.responseText === "string" ? {
n@1105 8612 text: xhr.responseText
n@1105 8613 } : undefined,
n@1105 8614 xhr.getAllResponseHeaders()
n@1105 8615 );
n@1105 8616 }
n@1105 8617 }
n@1105 8618 };
n@1105 8619 };
n@1105 8620
n@1105 8621 // Listen to events
n@1105 8622 xhr.onload = callback();
n@1105 8623 xhr.onerror = callback("error");
n@1105 8624
n@1105 8625 // Create the abort callback
n@1105 8626 callback = xhrCallbacks[ id ] = callback("abort");
n@1105 8627
n@1105 8628 try {
n@1105 8629 // Do send the request (this may raise an exception)
n@1105 8630 xhr.send( options.hasContent && options.data || null );
n@1105 8631 } catch ( e ) {
n@1105 8632 // #14683: Only rethrow if this hasn't been notified as an error yet
n@1105 8633 if ( callback ) {
n@1105 8634 throw e;
n@1105 8635 }
n@1105 8636 }
n@1105 8637 },
n@1105 8638
n@1105 8639 abort: function() {
n@1105 8640 if ( callback ) {
n@1105 8641 callback();
n@1105 8642 }
n@1105 8643 }
n@1105 8644 };
n@1105 8645 }
n@1105 8646 });
n@1105 8647
n@1105 8648
n@1105 8649
n@1105 8650
n@1105 8651 // Install script dataType
n@1105 8652 jQuery.ajaxSetup({
n@1105 8653 accepts: {
n@1105 8654 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
n@1105 8655 },
n@1105 8656 contents: {
n@1105 8657 script: /(?:java|ecma)script/
n@1105 8658 },
n@1105 8659 converters: {
n@1105 8660 "text script": function( text ) {
n@1105 8661 jQuery.globalEval( text );
n@1105 8662 return text;
n@1105 8663 }
n@1105 8664 }
n@1105 8665 });
n@1105 8666
n@1105 8667 // Handle cache's special case and crossDomain
n@1105 8668 jQuery.ajaxPrefilter( "script", function( s ) {
n@1105 8669 if ( s.cache === undefined ) {
n@1105 8670 s.cache = false;
n@1105 8671 }
n@1105 8672 if ( s.crossDomain ) {
n@1105 8673 s.type = "GET";
n@1105 8674 }
n@1105 8675 });
n@1105 8676
n@1105 8677 // Bind script tag hack transport
n@1105 8678 jQuery.ajaxTransport( "script", function( s ) {
n@1105 8679 // This transport only deals with cross domain requests
n@1105 8680 if ( s.crossDomain ) {
n@1105 8681 var script, callback;
n@1105 8682 return {
n@1105 8683 send: function( _, complete ) {
n@1105 8684 script = jQuery("<script>").prop({
n@1105 8685 async: true,
n@1105 8686 charset: s.scriptCharset,
n@1105 8687 src: s.url
n@1105 8688 }).on(
n@1105 8689 "load error",
n@1105 8690 callback = function( evt ) {
n@1105 8691 script.remove();
n@1105 8692 callback = null;
n@1105 8693 if ( evt ) {
n@1105 8694 complete( evt.type === "error" ? 404 : 200, evt.type );
n@1105 8695 }
n@1105 8696 }
n@1105 8697 );
n@1105 8698 document.head.appendChild( script[ 0 ] );
n@1105 8699 },
n@1105 8700 abort: function() {
n@1105 8701 if ( callback ) {
n@1105 8702 callback();
n@1105 8703 }
n@1105 8704 }
n@1105 8705 };
n@1105 8706 }
n@1105 8707 });
n@1105 8708
n@1105 8709
n@1105 8710
n@1105 8711
n@1105 8712 var oldCallbacks = [],
n@1105 8713 rjsonp = /(=)\?(?=&|$)|\?\?/;
n@1105 8714
n@1105 8715 // Default jsonp settings
n@1105 8716 jQuery.ajaxSetup({
n@1105 8717 jsonp: "callback",
n@1105 8718 jsonpCallback: function() {
n@1105 8719 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
n@1105 8720 this[ callback ] = true;
n@1105 8721 return callback;
n@1105 8722 }
n@1105 8723 });
n@1105 8724
n@1105 8725 // Detect, normalize options and install callbacks for jsonp requests
n@1105 8726 jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
n@1105 8727
n@1105 8728 var callbackName, overwritten, responseContainer,
n@1105 8729 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
n@1105 8730 "url" :
n@1105 8731 typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
n@1105 8732 );
n@1105 8733
n@1105 8734 // Handle iff the expected data type is "jsonp" or we have a parameter to set
n@1105 8735 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
n@1105 8736
n@1105 8737 // Get callback name, remembering preexisting value associated with it
n@1105 8738 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
n@1105 8739 s.jsonpCallback() :
n@1105 8740 s.jsonpCallback;
n@1105 8741
n@1105 8742 // Insert callback into url or form data
n@1105 8743 if ( jsonProp ) {
n@1105 8744 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
n@1105 8745 } else if ( s.jsonp !== false ) {
n@1105 8746 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
n@1105 8747 }
n@1105 8748
n@1105 8749 // Use data converter to retrieve json after script execution
n@1105 8750 s.converters["script json"] = function() {
n@1105 8751 if ( !responseContainer ) {
n@1105 8752 jQuery.error( callbackName + " was not called" );
n@1105 8753 }
n@1105 8754 return responseContainer[ 0 ];
n@1105 8755 };
n@1105 8756
n@1105 8757 // force json dataType
n@1105 8758 s.dataTypes[ 0 ] = "json";
n@1105 8759
n@1105 8760 // Install callback
n@1105 8761 overwritten = window[ callbackName ];
n@1105 8762 window[ callbackName ] = function() {
n@1105 8763 responseContainer = arguments;
n@1105 8764 };
n@1105 8765
n@1105 8766 // Clean-up function (fires after converters)
n@1105 8767 jqXHR.always(function() {
n@1105 8768 // Restore preexisting value
n@1105 8769 window[ callbackName ] = overwritten;
n@1105 8770
n@1105 8771 // Save back as free
n@1105 8772 if ( s[ callbackName ] ) {
n@1105 8773 // make sure that re-using the options doesn't screw things around
n@1105 8774 s.jsonpCallback = originalSettings.jsonpCallback;
n@1105 8775
n@1105 8776 // save the callback name for future use
n@1105 8777 oldCallbacks.push( callbackName );
n@1105 8778 }
n@1105 8779
n@1105 8780 // Call if it was a function and we have a response
n@1105 8781 if ( responseContainer && jQuery.isFunction( overwritten ) ) {
n@1105 8782 overwritten( responseContainer[ 0 ] );
n@1105 8783 }
n@1105 8784
n@1105 8785 responseContainer = overwritten = undefined;
n@1105 8786 });
n@1105 8787
n@1105 8788 // Delegate to script
n@1105 8789 return "script";
n@1105 8790 }
n@1105 8791 });
n@1105 8792
n@1105 8793
n@1105 8794
n@1105 8795
n@1105 8796 // data: string of html
n@1105 8797 // context (optional): If specified, the fragment will be created in this context, defaults to document
n@1105 8798 // keepScripts (optional): If true, will include scripts passed in the html string
n@1105 8799 jQuery.parseHTML = function( data, context, keepScripts ) {
n@1105 8800 if ( !data || typeof data !== "string" ) {
n@1105 8801 return null;
n@1105 8802 }
n@1105 8803 if ( typeof context === "boolean" ) {
n@1105 8804 keepScripts = context;
n@1105 8805 context = false;
n@1105 8806 }
n@1105 8807 context = context || document;
n@1105 8808
n@1105 8809 var parsed = rsingleTag.exec( data ),
n@1105 8810 scripts = !keepScripts && [];
n@1105 8811
n@1105 8812 // Single tag
n@1105 8813 if ( parsed ) {
n@1105 8814 return [ context.createElement( parsed[1] ) ];
n@1105 8815 }
n@1105 8816
n@1105 8817 parsed = jQuery.buildFragment( [ data ], context, scripts );
n@1105 8818
n@1105 8819 if ( scripts && scripts.length ) {
n@1105 8820 jQuery( scripts ).remove();
n@1105 8821 }
n@1105 8822
n@1105 8823 return jQuery.merge( [], parsed.childNodes );
n@1105 8824 };
n@1105 8825
n@1105 8826
n@1105 8827 // Keep a copy of the old load method
n@1105 8828 var _load = jQuery.fn.load;
n@1105 8829
n@1105 8830 /**
n@1105 8831 * Load a url into a page
n@1105 8832 */
n@1105 8833 jQuery.fn.load = function( url, params, callback ) {
n@1105 8834 if ( typeof url !== "string" && _load ) {
n@1105 8835 return _load.apply( this, arguments );
n@1105 8836 }
n@1105 8837
n@1105 8838 var selector, type, response,
n@1105 8839 self = this,
n@1105 8840 off = url.indexOf(" ");
n@1105 8841
n@1105 8842 if ( off >= 0 ) {
n@1105 8843 selector = jQuery.trim( url.slice( off ) );
n@1105 8844 url = url.slice( 0, off );
n@1105 8845 }
n@1105 8846
n@1105 8847 // If it's a function
n@1105 8848 if ( jQuery.isFunction( params ) ) {
n@1105 8849
n@1105 8850 // We assume that it's the callback
n@1105 8851 callback = params;
n@1105 8852 params = undefined;
n@1105 8853
n@1105 8854 // Otherwise, build a param string
n@1105 8855 } else if ( params && typeof params === "object" ) {
n@1105 8856 type = "POST";
n@1105 8857 }
n@1105 8858
n@1105 8859 // If we have elements to modify, make the request
n@1105 8860 if ( self.length > 0 ) {
n@1105 8861 jQuery.ajax({
n@1105 8862 url: url,
n@1105 8863
n@1105 8864 // if "type" variable is undefined, then "GET" method will be used
n@1105 8865 type: type,
n@1105 8866 dataType: "html",
n@1105 8867 data: params
n@1105 8868 }).done(function( responseText ) {
n@1105 8869
n@1105 8870 // Save response for use in complete callback
n@1105 8871 response = arguments;
n@1105 8872
n@1105 8873 self.html( selector ?
n@1105 8874
n@1105 8875 // If a selector was specified, locate the right elements in a dummy div
n@1105 8876 // Exclude scripts to avoid IE 'Permission Denied' errors
n@1105 8877 jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
n@1105 8878
n@1105 8879 // Otherwise use the full result
n@1105 8880 responseText );
n@1105 8881
n@1105 8882 }).complete( callback && function( jqXHR, status ) {
n@1105 8883 self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
n@1105 8884 });
n@1105 8885 }
n@1105 8886
n@1105 8887 return this;
n@1105 8888 };
n@1105 8889
n@1105 8890
n@1105 8891
n@1105 8892
n@1105 8893 // Attach a bunch of functions for handling common AJAX events
n@1105 8894 jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
n@1105 8895 jQuery.fn[ type ] = function( fn ) {
n@1105 8896 return this.on( type, fn );
n@1105 8897 };
n@1105 8898 });
n@1105 8899
n@1105 8900
n@1105 8901
n@1105 8902
n@1105 8903 jQuery.expr.filters.animated = function( elem ) {
n@1105 8904 return jQuery.grep(jQuery.timers, function( fn ) {
n@1105 8905 return elem === fn.elem;
n@1105 8906 }).length;
n@1105 8907 };
n@1105 8908
n@1105 8909
n@1105 8910
n@1105 8911
n@1105 8912 var docElem = window.document.documentElement;
n@1105 8913
n@1105 8914 /**
n@1105 8915 * Gets a window from an element
n@1105 8916 */
n@1105 8917 function getWindow( elem ) {
n@1105 8918 return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
n@1105 8919 }
n@1105 8920
n@1105 8921 jQuery.offset = {
n@1105 8922 setOffset: function( elem, options, i ) {
n@1105 8923 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
n@1105 8924 position = jQuery.css( elem, "position" ),
n@1105 8925 curElem = jQuery( elem ),
n@1105 8926 props = {};
n@1105 8927
n@1105 8928 // Set position first, in-case top/left are set even on static elem
n@1105 8929 if ( position === "static" ) {
n@1105 8930 elem.style.position = "relative";
n@1105 8931 }
n@1105 8932
n@1105 8933 curOffset = curElem.offset();
n@1105 8934 curCSSTop = jQuery.css( elem, "top" );
n@1105 8935 curCSSLeft = jQuery.css( elem, "left" );
n@1105 8936 calculatePosition = ( position === "absolute" || position === "fixed" ) &&
n@1105 8937 ( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
n@1105 8938
n@1105 8939 // Need to be able to calculate position if either
n@1105 8940 // top or left is auto and position is either absolute or fixed
n@1105 8941 if ( calculatePosition ) {
n@1105 8942 curPosition = curElem.position();
n@1105 8943 curTop = curPosition.top;
n@1105 8944 curLeft = curPosition.left;
n@1105 8945
n@1105 8946 } else {
n@1105 8947 curTop = parseFloat( curCSSTop ) || 0;
n@1105 8948 curLeft = parseFloat( curCSSLeft ) || 0;
n@1105 8949 }
n@1105 8950
n@1105 8951 if ( jQuery.isFunction( options ) ) {
n@1105 8952 options = options.call( elem, i, curOffset );
n@1105 8953 }
n@1105 8954
n@1105 8955 if ( options.top != null ) {
n@1105 8956 props.top = ( options.top - curOffset.top ) + curTop;
n@1105 8957 }
n@1105 8958 if ( options.left != null ) {
n@1105 8959 props.left = ( options.left - curOffset.left ) + curLeft;
n@1105 8960 }
n@1105 8961
n@1105 8962 if ( "using" in options ) {
n@1105 8963 options.using.call( elem, props );
n@1105 8964
n@1105 8965 } else {
n@1105 8966 curElem.css( props );
n@1105 8967 }
n@1105 8968 }
n@1105 8969 };
n@1105 8970
n@1105 8971 jQuery.fn.extend({
n@1105 8972 offset: function( options ) {
n@1105 8973 if ( arguments.length ) {
n@1105 8974 return options === undefined ?
n@1105 8975 this :
n@1105 8976 this.each(function( i ) {
n@1105 8977 jQuery.offset.setOffset( this, options, i );
n@1105 8978 });
n@1105 8979 }
n@1105 8980
n@1105 8981 var docElem, win,
n@1105 8982 elem = this[ 0 ],
n@1105 8983 box = { top: 0, left: 0 },
n@1105 8984 doc = elem && elem.ownerDocument;
n@1105 8985
n@1105 8986 if ( !doc ) {
n@1105 8987 return;
n@1105 8988 }
n@1105 8989
n@1105 8990 docElem = doc.documentElement;
n@1105 8991
n@1105 8992 // Make sure it's not a disconnected DOM node
n@1105 8993 if ( !jQuery.contains( docElem, elem ) ) {
n@1105 8994 return box;
n@1105 8995 }
n@1105 8996
n@1105 8997 // Support: BlackBerry 5, iOS 3 (original iPhone)
n@1105 8998 // If we don't have gBCR, just use 0,0 rather than error
n@1105 8999 if ( typeof elem.getBoundingClientRect !== strundefined ) {
n@1105 9000 box = elem.getBoundingClientRect();
n@1105 9001 }
n@1105 9002 win = getWindow( doc );
n@1105 9003 return {
n@1105 9004 top: box.top + win.pageYOffset - docElem.clientTop,
n@1105 9005 left: box.left + win.pageXOffset - docElem.clientLeft
n@1105 9006 };
n@1105 9007 },
n@1105 9008
n@1105 9009 position: function() {
n@1105 9010 if ( !this[ 0 ] ) {
n@1105 9011 return;
n@1105 9012 }
n@1105 9013
n@1105 9014 var offsetParent, offset,
n@1105 9015 elem = this[ 0 ],
n@1105 9016 parentOffset = { top: 0, left: 0 };
n@1105 9017
n@1105 9018 // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
n@1105 9019 if ( jQuery.css( elem, "position" ) === "fixed" ) {
n@1105 9020 // Assume getBoundingClientRect is there when computed position is fixed
n@1105 9021 offset = elem.getBoundingClientRect();
n@1105 9022
n@1105 9023 } else {
n@1105 9024 // Get *real* offsetParent
n@1105 9025 offsetParent = this.offsetParent();
n@1105 9026
n@1105 9027 // Get correct offsets
n@1105 9028 offset = this.offset();
n@1105 9029 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
n@1105 9030 parentOffset = offsetParent.offset();
n@1105 9031 }
n@1105 9032
n@1105 9033 // Add offsetParent borders
n@1105 9034 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
n@1105 9035 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
n@1105 9036 }
n@1105 9037
n@1105 9038 // Subtract parent offsets and element margins
n@1105 9039 return {
n@1105 9040 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
n@1105 9041 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
n@1105 9042 };
n@1105 9043 },
n@1105 9044
n@1105 9045 offsetParent: function() {
n@1105 9046 return this.map(function() {
n@1105 9047 var offsetParent = this.offsetParent || docElem;
n@1105 9048
n@1105 9049 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
n@1105 9050 offsetParent = offsetParent.offsetParent;
n@1105 9051 }
n@1105 9052
n@1105 9053 return offsetParent || docElem;
n@1105 9054 });
n@1105 9055 }
n@1105 9056 });
n@1105 9057
n@1105 9058 // Create scrollLeft and scrollTop methods
n@1105 9059 jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
n@1105 9060 var top = "pageYOffset" === prop;
n@1105 9061
n@1105 9062 jQuery.fn[ method ] = function( val ) {
n@1105 9063 return access( this, function( elem, method, val ) {
n@1105 9064 var win = getWindow( elem );
n@1105 9065
n@1105 9066 if ( val === undefined ) {
n@1105 9067 return win ? win[ prop ] : elem[ method ];
n@1105 9068 }
n@1105 9069
n@1105 9070 if ( win ) {
n@1105 9071 win.scrollTo(
n@1105 9072 !top ? val : window.pageXOffset,
n@1105 9073 top ? val : window.pageYOffset
n@1105 9074 );
n@1105 9075
n@1105 9076 } else {
n@1105 9077 elem[ method ] = val;
n@1105 9078 }
n@1105 9079 }, method, val, arguments.length, null );
n@1105 9080 };
n@1105 9081 });
n@1105 9082
n@1105 9083 // Support: Safari<7+, Chrome<37+
n@1105 9084 // Add the top/left cssHooks using jQuery.fn.position
n@1105 9085 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
n@1105 9086 // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
n@1105 9087 // getComputedStyle returns percent when specified for top/left/bottom/right;
n@1105 9088 // rather than make the css module depend on the offset module, just check for it here
n@1105 9089 jQuery.each( [ "top", "left" ], function( i, prop ) {
n@1105 9090 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
n@1105 9091 function( elem, computed ) {
n@1105 9092 if ( computed ) {
n@1105 9093 computed = curCSS( elem, prop );
n@1105 9094 // If curCSS returns percentage, fallback to offset
n@1105 9095 return rnumnonpx.test( computed ) ?
n@1105 9096 jQuery( elem ).position()[ prop ] + "px" :
n@1105 9097 computed;
n@1105 9098 }
n@1105 9099 }
n@1105 9100 );
n@1105 9101 });
n@1105 9102
n@1105 9103
n@1105 9104 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
n@1105 9105 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
n@1105 9106 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
n@1105 9107 // Margin is only for outerHeight, outerWidth
n@1105 9108 jQuery.fn[ funcName ] = function( margin, value ) {
n@1105 9109 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
n@1105 9110 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
n@1105 9111
n@1105 9112 return access( this, function( elem, type, value ) {
n@1105 9113 var doc;
n@1105 9114
n@1105 9115 if ( jQuery.isWindow( elem ) ) {
n@1105 9116 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
n@1105 9117 // isn't a whole lot we can do. See pull request at this URL for discussion:
n@1105 9118 // https://github.com/jquery/jquery/pull/764
n@1105 9119 return elem.document.documentElement[ "client" + name ];
n@1105 9120 }
n@1105 9121
n@1105 9122 // Get document width or height
n@1105 9123 if ( elem.nodeType === 9 ) {
n@1105 9124 doc = elem.documentElement;
n@1105 9125
n@1105 9126 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
n@1105 9127 // whichever is greatest
n@1105 9128 return Math.max(
n@1105 9129 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
n@1105 9130 elem.body[ "offset" + name ], doc[ "offset" + name ],
n@1105 9131 doc[ "client" + name ]
n@1105 9132 );
n@1105 9133 }
n@1105 9134
n@1105 9135 return value === undefined ?
n@1105 9136 // Get width or height on the element, requesting but not forcing parseFloat
n@1105 9137 jQuery.css( elem, type, extra ) :
n@1105 9138
n@1105 9139 // Set width or height on the element
n@1105 9140 jQuery.style( elem, type, value, extra );
n@1105 9141 }, type, chainable ? margin : undefined, chainable, null );
n@1105 9142 };
n@1105 9143 });
n@1105 9144 });
n@1105 9145
n@1105 9146
n@1105 9147 // The number of elements contained in the matched element set
n@1105 9148 jQuery.fn.size = function() {
n@1105 9149 return this.length;
n@1105 9150 };
n@1105 9151
n@1105 9152 jQuery.fn.andSelf = jQuery.fn.addBack;
n@1105 9153
n@1105 9154
n@1105 9155
n@1105 9156
n@1105 9157 // Register as a named AMD module, since jQuery can be concatenated with other
n@1105 9158 // files that may use define, but not via a proper concatenation script that
n@1105 9159 // understands anonymous AMD modules. A named AMD is safest and most robust
n@1105 9160 // way to register. Lowercase jquery is used because AMD module names are
n@1105 9161 // derived from file names, and jQuery is normally delivered in a lowercase
n@1105 9162 // file name. Do this after creating the global so that if an AMD module wants
n@1105 9163 // to call noConflict to hide this version of jQuery, it will work.
n@1105 9164
n@1105 9165 // Note that for maximum portability, libraries that are not jQuery should
n@1105 9166 // declare themselves as anonymous modules, and avoid setting a global if an
n@1105 9167 // AMD loader is present. jQuery is a special case. For more information, see
n@1105 9168 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
n@1105 9169
n@1105 9170 if ( typeof define === "function" && define.amd ) {
n@1105 9171 define( "jquery", [], function() {
n@1105 9172 return jQuery;
n@1105 9173 });
n@1105 9174 }
n@1105 9175
n@1105 9176
n@1105 9177
n@1105 9178
n@1105 9179 var
n@1105 9180 // Map over jQuery in case of overwrite
n@1105 9181 _jQuery = window.jQuery,
n@1105 9182
n@1105 9183 // Map over the $ in case of overwrite
n@1105 9184 _$ = window.$;
n@1105 9185
n@1105 9186 jQuery.noConflict = function( deep ) {
n@1105 9187 if ( window.$ === jQuery ) {
n@1105 9188 window.$ = _$;
n@1105 9189 }
n@1105 9190
n@1105 9191 if ( deep && window.jQuery === jQuery ) {
n@1105 9192 window.jQuery = _jQuery;
n@1105 9193 }
n@1105 9194
n@1105 9195 return jQuery;
n@1105 9196 };
n@1105 9197
n@1105 9198 // Expose jQuery and $ identifiers, even in AMD
n@1105 9199 // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
n@1105 9200 // and CommonJS for browser emulators (#13566)
n@1105 9201 if ( typeof noGlobal === strundefined ) {
n@1105 9202 window.jQuery = window.$ = jQuery;
n@1105 9203 }
n@1105 9204
n@1105 9205
n@1105 9206
n@1105 9207
n@1105 9208 return jQuery;
n@1105 9209
n@1105 9210 }));