1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/jquery.js Thu Dec 15 18:10:20 2016 +0300
1.3 @@ -0,0 +1,10351 @@
1.4 +/*!
1.5 + * jQuery JavaScript Library v1.11.3
1.6 + * http://jquery.com/
1.7 + *
1.8 + * Includes Sizzle.js
1.9 + * http://sizzlejs.com/
1.10 + *
1.11 + * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
1.12 + * Released under the MIT license
1.13 + * http://jquery.org/license
1.14 + *
1.15 + * Date: 2015-04-28T16:19Z
1.16 + */
1.17 +
1.18 +(function( global, factory ) {
1.19 +
1.20 + if ( typeof module === "object" && typeof module.exports === "object" ) {
1.21 + // For CommonJS and CommonJS-like environments where a proper window is present,
1.22 + // execute the factory and get jQuery
1.23 + // For environments that do not inherently posses a window with a document
1.24 + // (such as Node.js), expose a jQuery-making factory as module.exports
1.25 + // This accentuates the need for the creation of a real window
1.26 + // e.g. var jQuery = require("jquery")(window);
1.27 + // See ticket #14549 for more info
1.28 + module.exports = global.document ?
1.29 + factory( global, true ) :
1.30 + function( w ) {
1.31 + if ( !w.document ) {
1.32 + throw new Error( "jQuery requires a window with a document" );
1.33 + }
1.34 + return factory( w );
1.35 + };
1.36 + } else {
1.37 + factory( global );
1.38 + }
1.39 +
1.40 +// Pass this if window is not defined yet
1.41 +}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
1.42 +
1.43 +// Can't do this because several apps including ASP.NET trace
1.44 +// the stack via arguments.caller.callee and Firefox dies if
1.45 +// you try to trace through "use strict" call chains. (#13335)
1.46 +// Support: Firefox 18+
1.47 +//
1.48 +
1.49 +var deletedIds = [];
1.50 +
1.51 +var slice = deletedIds.slice;
1.52 +
1.53 +var concat = deletedIds.concat;
1.54 +
1.55 +var push = deletedIds.push;
1.56 +
1.57 +var indexOf = deletedIds.indexOf;
1.58 +
1.59 +var class2type = {};
1.60 +
1.61 +var toString = class2type.toString;
1.62 +
1.63 +var hasOwn = class2type.hasOwnProperty;
1.64 +
1.65 +var support = {};
1.66 +
1.67 +
1.68 +
1.69 +var
1.70 + version = "1.11.3",
1.71 +
1.72 + // Define a local copy of jQuery
1.73 + jQuery = function( selector, context ) {
1.74 + // The jQuery object is actually just the init constructor 'enhanced'
1.75 + // Need init if jQuery is called (just allow error to be thrown if not included)
1.76 + return new jQuery.fn.init( selector, context );
1.77 + },
1.78 +
1.79 + // Support: Android<4.1, IE<9
1.80 + // Make sure we trim BOM and NBSP
1.81 + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
1.82 +
1.83 + // Matches dashed string for camelizing
1.84 + rmsPrefix = /^-ms-/,
1.85 + rdashAlpha = /-([\da-z])/gi,
1.86 +
1.87 + // Used by jQuery.camelCase as callback to replace()
1.88 + fcamelCase = function( all, letter ) {
1.89 + return letter.toUpperCase();
1.90 + };
1.91 +
1.92 +jQuery.fn = jQuery.prototype = {
1.93 + // The current version of jQuery being used
1.94 + jquery: version,
1.95 +
1.96 + constructor: jQuery,
1.97 +
1.98 + // Start with an empty selector
1.99 + selector: "",
1.100 +
1.101 + // The default length of a jQuery object is 0
1.102 + length: 0,
1.103 +
1.104 + toArray: function() {
1.105 + return slice.call( this );
1.106 + },
1.107 +
1.108 + // Get the Nth element in the matched element set OR
1.109 + // Get the whole matched element set as a clean array
1.110 + get: function( num ) {
1.111 + return num != null ?
1.112 +
1.113 + // Return just the one element from the set
1.114 + ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
1.115 +
1.116 + // Return all the elements in a clean array
1.117 + slice.call( this );
1.118 + },
1.119 +
1.120 + // Take an array of elements and push it onto the stack
1.121 + // (returning the new matched element set)
1.122 + pushStack: function( elems ) {
1.123 +
1.124 + // Build a new jQuery matched element set
1.125 + var ret = jQuery.merge( this.constructor(), elems );
1.126 +
1.127 + // Add the old object onto the stack (as a reference)
1.128 + ret.prevObject = this;
1.129 + ret.context = this.context;
1.130 +
1.131 + // Return the newly-formed element set
1.132 + return ret;
1.133 + },
1.134 +
1.135 + // Execute a callback for every element in the matched set.
1.136 + // (You can seed the arguments with an array of args, but this is
1.137 + // only used internally.)
1.138 + each: function( callback, args ) {
1.139 + return jQuery.each( this, callback, args );
1.140 + },
1.141 +
1.142 + map: function( callback ) {
1.143 + return this.pushStack( jQuery.map(this, function( elem, i ) {
1.144 + return callback.call( elem, i, elem );
1.145 + }));
1.146 + },
1.147 +
1.148 + slice: function() {
1.149 + return this.pushStack( slice.apply( this, arguments ) );
1.150 + },
1.151 +
1.152 + first: function() {
1.153 + return this.eq( 0 );
1.154 + },
1.155 +
1.156 + last: function() {
1.157 + return this.eq( -1 );
1.158 + },
1.159 +
1.160 + eq: function( i ) {
1.161 + var len = this.length,
1.162 + j = +i + ( i < 0 ? len : 0 );
1.163 + return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
1.164 + },
1.165 +
1.166 + end: function() {
1.167 + return this.prevObject || this.constructor(null);
1.168 + },
1.169 +
1.170 + // For internal use only.
1.171 + // Behaves like an Array's method, not like a jQuery method.
1.172 + push: push,
1.173 + sort: deletedIds.sort,
1.174 + splice: deletedIds.splice
1.175 +};
1.176 +
1.177 +jQuery.extend = jQuery.fn.extend = function() {
1.178 + var src, copyIsArray, copy, name, options, clone,
1.179 + target = arguments[0] || {},
1.180 + i = 1,
1.181 + length = arguments.length,
1.182 + deep = false;
1.183 +
1.184 + // Handle a deep copy situation
1.185 + if ( typeof target === "boolean" ) {
1.186 + deep = target;
1.187 +
1.188 + // skip the boolean and the target
1.189 + target = arguments[ i ] || {};
1.190 + i++;
1.191 + }
1.192 +
1.193 + // Handle case when target is a string or something (possible in deep copy)
1.194 + if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
1.195 + target = {};
1.196 + }
1.197 +
1.198 + // extend jQuery itself if only one argument is passed
1.199 + if ( i === length ) {
1.200 + target = this;
1.201 + i--;
1.202 + }
1.203 +
1.204 + for ( ; i < length; i++ ) {
1.205 + // Only deal with non-null/undefined values
1.206 + if ( (options = arguments[ i ]) != null ) {
1.207 + // Extend the base object
1.208 + for ( name in options ) {
1.209 + src = target[ name ];
1.210 + copy = options[ name ];
1.211 +
1.212 + // Prevent never-ending loop
1.213 + if ( target === copy ) {
1.214 + continue;
1.215 + }
1.216 +
1.217 + // Recurse if we're merging plain objects or arrays
1.218 + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
1.219 + if ( copyIsArray ) {
1.220 + copyIsArray = false;
1.221 + clone = src && jQuery.isArray(src) ? src : [];
1.222 +
1.223 + } else {
1.224 + clone = src && jQuery.isPlainObject(src) ? src : {};
1.225 + }
1.226 +
1.227 + // Never move original objects, clone them
1.228 + target[ name ] = jQuery.extend( deep, clone, copy );
1.229 +
1.230 + // Don't bring in undefined values
1.231 + } else if ( copy !== undefined ) {
1.232 + target[ name ] = copy;
1.233 + }
1.234 + }
1.235 + }
1.236 + }
1.237 +
1.238 + // Return the modified object
1.239 + return target;
1.240 +};
1.241 +
1.242 +jQuery.extend({
1.243 + // Unique for each copy of jQuery on the page
1.244 + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
1.245 +
1.246 + // Assume jQuery is ready without the ready module
1.247 + isReady: true,
1.248 +
1.249 + error: function( msg ) {
1.250 + throw new Error( msg );
1.251 + },
1.252 +
1.253 + noop: function() {},
1.254 +
1.255 + // See test/unit/core.js for details concerning isFunction.
1.256 + // Since version 1.3, DOM methods and functions like alert
1.257 + // aren't supported. They return false on IE (#2968).
1.258 + isFunction: function( obj ) {
1.259 + return jQuery.type(obj) === "function";
1.260 + },
1.261 +
1.262 + isArray: Array.isArray || function( obj ) {
1.263 + return jQuery.type(obj) === "array";
1.264 + },
1.265 +
1.266 + isWindow: function( obj ) {
1.267 + /* jshint eqeqeq: false */
1.268 + return obj != null && obj == obj.window;
1.269 + },
1.270 +
1.271 + isNumeric: function( obj ) {
1.272 + // parseFloat NaNs numeric-cast false positives (null|true|false|"")
1.273 + // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
1.274 + // subtraction forces infinities to NaN
1.275 + // adding 1 corrects loss of precision from parseFloat (#15100)
1.276 + return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
1.277 + },
1.278 +
1.279 + isEmptyObject: function( obj ) {
1.280 + var name;
1.281 + for ( name in obj ) {
1.282 + return false;
1.283 + }
1.284 + return true;
1.285 + },
1.286 +
1.287 + isPlainObject: function( obj ) {
1.288 + var key;
1.289 +
1.290 + // Must be an Object.
1.291 + // Because of IE, we also have to check the presence of the constructor property.
1.292 + // Make sure that DOM nodes and window objects don't pass through, as well
1.293 + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
1.294 + return false;
1.295 + }
1.296 +
1.297 + try {
1.298 + // Not own constructor property must be Object
1.299 + if ( obj.constructor &&
1.300 + !hasOwn.call(obj, "constructor") &&
1.301 + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
1.302 + return false;
1.303 + }
1.304 + } catch ( e ) {
1.305 + // IE8,9 Will throw exceptions on certain host objects #9897
1.306 + return false;
1.307 + }
1.308 +
1.309 + // Support: IE<9
1.310 + // Handle iteration over inherited properties before own properties.
1.311 + if ( support.ownLast ) {
1.312 + for ( key in obj ) {
1.313 + return hasOwn.call( obj, key );
1.314 + }
1.315 + }
1.316 +
1.317 + // Own properties are enumerated firstly, so to speed up,
1.318 + // if last one is own, then all properties are own.
1.319 + for ( key in obj ) {}
1.320 +
1.321 + return key === undefined || hasOwn.call( obj, key );
1.322 + },
1.323 +
1.324 + type: function( obj ) {
1.325 + if ( obj == null ) {
1.326 + return obj + "";
1.327 + }
1.328 + return typeof obj === "object" || typeof obj === "function" ?
1.329 + class2type[ toString.call(obj) ] || "object" :
1.330 + typeof obj;
1.331 + },
1.332 +
1.333 + // Evaluates a script in a global context
1.334 + // Workarounds based on findings by Jim Driscoll
1.335 + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
1.336 + globalEval: function( data ) {
1.337 + if ( data && jQuery.trim( data ) ) {
1.338 + // We use execScript on Internet Explorer
1.339 + // We use an anonymous function so that context is window
1.340 + // rather than jQuery in Firefox
1.341 + ( window.execScript || function( data ) {
1.342 + window[ "eval" ].call( window, data );
1.343 + } )( data );
1.344 + }
1.345 + },
1.346 +
1.347 + // Convert dashed to camelCase; used by the css and data modules
1.348 + // Microsoft forgot to hump their vendor prefix (#9572)
1.349 + camelCase: function( string ) {
1.350 + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
1.351 + },
1.352 +
1.353 + nodeName: function( elem, name ) {
1.354 + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
1.355 + },
1.356 +
1.357 + // args is for internal usage only
1.358 + each: function( obj, callback, args ) {
1.359 + var value,
1.360 + i = 0,
1.361 + length = obj.length,
1.362 + isArray = isArraylike( obj );
1.363 +
1.364 + if ( args ) {
1.365 + if ( isArray ) {
1.366 + for ( ; i < length; i++ ) {
1.367 + value = callback.apply( obj[ i ], args );
1.368 +
1.369 + if ( value === false ) {
1.370 + break;
1.371 + }
1.372 + }
1.373 + } else {
1.374 + for ( i in obj ) {
1.375 + value = callback.apply( obj[ i ], args );
1.376 +
1.377 + if ( value === false ) {
1.378 + break;
1.379 + }
1.380 + }
1.381 + }
1.382 +
1.383 + // A special, fast, case for the most common use of each
1.384 + } else {
1.385 + if ( isArray ) {
1.386 + for ( ; i < length; i++ ) {
1.387 + value = callback.call( obj[ i ], i, obj[ i ] );
1.388 +
1.389 + if ( value === false ) {
1.390 + break;
1.391 + }
1.392 + }
1.393 + } else {
1.394 + for ( i in obj ) {
1.395 + value = callback.call( obj[ i ], i, obj[ i ] );
1.396 +
1.397 + if ( value === false ) {
1.398 + break;
1.399 + }
1.400 + }
1.401 + }
1.402 + }
1.403 +
1.404 + return obj;
1.405 + },
1.406 +
1.407 + // Support: Android<4.1, IE<9
1.408 + trim: function( text ) {
1.409 + return text == null ?
1.410 + "" :
1.411 + ( text + "" ).replace( rtrim, "" );
1.412 + },
1.413 +
1.414 + // results is for internal usage only
1.415 + makeArray: function( arr, results ) {
1.416 + var ret = results || [];
1.417 +
1.418 + if ( arr != null ) {
1.419 + if ( isArraylike( Object(arr) ) ) {
1.420 + jQuery.merge( ret,
1.421 + typeof arr === "string" ?
1.422 + [ arr ] : arr
1.423 + );
1.424 + } else {
1.425 + push.call( ret, arr );
1.426 + }
1.427 + }
1.428 +
1.429 + return ret;
1.430 + },
1.431 +
1.432 + inArray: function( elem, arr, i ) {
1.433 + var len;
1.434 +
1.435 + if ( arr ) {
1.436 + if ( indexOf ) {
1.437 + return indexOf.call( arr, elem, i );
1.438 + }
1.439 +
1.440 + len = arr.length;
1.441 + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
1.442 +
1.443 + for ( ; i < len; i++ ) {
1.444 + // Skip accessing in sparse arrays
1.445 + if ( i in arr && arr[ i ] === elem ) {
1.446 + return i;
1.447 + }
1.448 + }
1.449 + }
1.450 +
1.451 + return -1;
1.452 + },
1.453 +
1.454 + merge: function( first, second ) {
1.455 + var len = +second.length,
1.456 + j = 0,
1.457 + i = first.length;
1.458 +
1.459 + while ( j < len ) {
1.460 + first[ i++ ] = second[ j++ ];
1.461 + }
1.462 +
1.463 + // Support: IE<9
1.464 + // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
1.465 + if ( len !== len ) {
1.466 + while ( second[j] !== undefined ) {
1.467 + first[ i++ ] = second[ j++ ];
1.468 + }
1.469 + }
1.470 +
1.471 + first.length = i;
1.472 +
1.473 + return first;
1.474 + },
1.475 +
1.476 + grep: function( elems, callback, invert ) {
1.477 + var callbackInverse,
1.478 + matches = [],
1.479 + i = 0,
1.480 + length = elems.length,
1.481 + callbackExpect = !invert;
1.482 +
1.483 + // Go through the array, only saving the items
1.484 + // that pass the validator function
1.485 + for ( ; i < length; i++ ) {
1.486 + callbackInverse = !callback( elems[ i ], i );
1.487 + if ( callbackInverse !== callbackExpect ) {
1.488 + matches.push( elems[ i ] );
1.489 + }
1.490 + }
1.491 +
1.492 + return matches;
1.493 + },
1.494 +
1.495 + // arg is for internal usage only
1.496 + map: function( elems, callback, arg ) {
1.497 + var value,
1.498 + i = 0,
1.499 + length = elems.length,
1.500 + isArray = isArraylike( elems ),
1.501 + ret = [];
1.502 +
1.503 + // Go through the array, translating each of the items to their new values
1.504 + if ( isArray ) {
1.505 + for ( ; i < length; i++ ) {
1.506 + value = callback( elems[ i ], i, arg );
1.507 +
1.508 + if ( value != null ) {
1.509 + ret.push( value );
1.510 + }
1.511 + }
1.512 +
1.513 + // Go through every key on the object,
1.514 + } else {
1.515 + for ( i in elems ) {
1.516 + value = callback( elems[ i ], i, arg );
1.517 +
1.518 + if ( value != null ) {
1.519 + ret.push( value );
1.520 + }
1.521 + }
1.522 + }
1.523 +
1.524 + // Flatten any nested arrays
1.525 + return concat.apply( [], ret );
1.526 + },
1.527 +
1.528 + // A global GUID counter for objects
1.529 + guid: 1,
1.530 +
1.531 + // Bind a function to a context, optionally partially applying any
1.532 + // arguments.
1.533 + proxy: function( fn, context ) {
1.534 + var args, proxy, tmp;
1.535 +
1.536 + if ( typeof context === "string" ) {
1.537 + tmp = fn[ context ];
1.538 + context = fn;
1.539 + fn = tmp;
1.540 + }
1.541 +
1.542 + // Quick check to determine if target is callable, in the spec
1.543 + // this throws a TypeError, but we will just return undefined.
1.544 + if ( !jQuery.isFunction( fn ) ) {
1.545 + return undefined;
1.546 + }
1.547 +
1.548 + // Simulated bind
1.549 + args = slice.call( arguments, 2 );
1.550 + proxy = function() {
1.551 + return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
1.552 + };
1.553 +
1.554 + // Set the guid of unique handler to the same of original handler, so it can be removed
1.555 + proxy.guid = fn.guid = fn.guid || jQuery.guid++;
1.556 +
1.557 + return proxy;
1.558 + },
1.559 +
1.560 + now: function() {
1.561 + return +( new Date() );
1.562 + },
1.563 +
1.564 + // jQuery.support is not used in Core but other projects attach their
1.565 + // properties to it so it needs to exist.
1.566 + support: support
1.567 +});
1.568 +
1.569 +// Populate the class2type map
1.570 +jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
1.571 + class2type[ "[object " + name + "]" ] = name.toLowerCase();
1.572 +});
1.573 +
1.574 +function isArraylike( obj ) {
1.575 +
1.576 + // Support: iOS 8.2 (not reproducible in simulator)
1.577 + // `in` check used to prevent JIT error (gh-2145)
1.578 + // hasOwn isn't used here due to false negatives
1.579 + // regarding Nodelist length in IE
1.580 + var length = "length" in obj && obj.length,
1.581 + type = jQuery.type( obj );
1.582 +
1.583 + if ( type === "function" || jQuery.isWindow( obj ) ) {
1.584 + return false;
1.585 + }
1.586 +
1.587 + if ( obj.nodeType === 1 && length ) {
1.588 + return true;
1.589 + }
1.590 +
1.591 + return type === "array" || length === 0 ||
1.592 + typeof length === "number" && length > 0 && ( length - 1 ) in obj;
1.593 +}
1.594 +var Sizzle =
1.595 +/*!
1.596 + * Sizzle CSS Selector Engine v2.2.0-pre
1.597 + * http://sizzlejs.com/
1.598 + *
1.599 + * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
1.600 + * Released under the MIT license
1.601 + * http://jquery.org/license
1.602 + *
1.603 + * Date: 2014-12-16
1.604 + */
1.605 +(function( window ) {
1.606 +
1.607 +var i,
1.608 + support,
1.609 + Expr,
1.610 + getText,
1.611 + isXML,
1.612 + tokenize,
1.613 + compile,
1.614 + select,
1.615 + outermostContext,
1.616 + sortInput,
1.617 + hasDuplicate,
1.618 +
1.619 + // Local document vars
1.620 + setDocument,
1.621 + document,
1.622 + docElem,
1.623 + documentIsHTML,
1.624 + rbuggyQSA,
1.625 + rbuggyMatches,
1.626 + matches,
1.627 + contains,
1.628 +
1.629 + // Instance-specific data
1.630 + expando = "sizzle" + 1 * new Date(),
1.631 + preferredDoc = window.document,
1.632 + dirruns = 0,
1.633 + done = 0,
1.634 + classCache = createCache(),
1.635 + tokenCache = createCache(),
1.636 + compilerCache = createCache(),
1.637 + sortOrder = function( a, b ) {
1.638 + if ( a === b ) {
1.639 + hasDuplicate = true;
1.640 + }
1.641 + return 0;
1.642 + },
1.643 +
1.644 + // General-purpose constants
1.645 + MAX_NEGATIVE = 1 << 31,
1.646 +
1.647 + // Instance methods
1.648 + hasOwn = ({}).hasOwnProperty,
1.649 + arr = [],
1.650 + pop = arr.pop,
1.651 + push_native = arr.push,
1.652 + push = arr.push,
1.653 + slice = arr.slice,
1.654 + // Use a stripped-down indexOf as it's faster than native
1.655 + // http://jsperf.com/thor-indexof-vs-for/5
1.656 + indexOf = function( list, elem ) {
1.657 + var i = 0,
1.658 + len = list.length;
1.659 + for ( ; i < len; i++ ) {
1.660 + if ( list[i] === elem ) {
1.661 + return i;
1.662 + }
1.663 + }
1.664 + return -1;
1.665 + },
1.666 +
1.667 + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
1.668 +
1.669 + // Regular expressions
1.670 +
1.671 + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
1.672 + whitespace = "[\\x20\\t\\r\\n\\f]",
1.673 + // http://www.w3.org/TR/css3-syntax/#characters
1.674 + characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
1.675 +
1.676 + // Loosely modeled on CSS identifier characters
1.677 + // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
1.678 + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
1.679 + identifier = characterEncoding.replace( "w", "w#" ),
1.680 +
1.681 + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
1.682 + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
1.683 + // Operator (capture 2)
1.684 + "*([*^$|!~]?=)" + whitespace +
1.685 + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
1.686 + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
1.687 + "*\\]",
1.688 +
1.689 + pseudos = ":(" + characterEncoding + ")(?:\\((" +
1.690 + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
1.691 + // 1. quoted (capture 3; capture 4 or capture 5)
1.692 + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
1.693 + // 2. simple (capture 6)
1.694 + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
1.695 + // 3. anything else (capture 2)
1.696 + ".*" +
1.697 + ")\\)|)",
1.698 +
1.699 + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
1.700 + rwhitespace = new RegExp( whitespace + "+", "g" ),
1.701 + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
1.702 +
1.703 + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
1.704 + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
1.705 +
1.706 + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
1.707 +
1.708 + rpseudo = new RegExp( pseudos ),
1.709 + ridentifier = new RegExp( "^" + identifier + "$" ),
1.710 +
1.711 + matchExpr = {
1.712 + "ID": new RegExp( "^#(" + characterEncoding + ")" ),
1.713 + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
1.714 + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
1.715 + "ATTR": new RegExp( "^" + attributes ),
1.716 + "PSEUDO": new RegExp( "^" + pseudos ),
1.717 + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
1.718 + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
1.719 + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
1.720 + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
1.721 + // For use in libraries implementing .is()
1.722 + // We use this for POS matching in `select`
1.723 + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
1.724 + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
1.725 + },
1.726 +
1.727 + rinputs = /^(?:input|select|textarea|button)$/i,
1.728 + rheader = /^h\d$/i,
1.729 +
1.730 + rnative = /^[^{]+\{\s*\[native \w/,
1.731 +
1.732 + // Easily-parseable/retrievable ID or TAG or CLASS selectors
1.733 + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
1.734 +
1.735 + rsibling = /[+~]/,
1.736 + rescape = /'|\\/g,
1.737 +
1.738 + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
1.739 + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
1.740 + funescape = function( _, escaped, escapedWhitespace ) {
1.741 + var high = "0x" + escaped - 0x10000;
1.742 + // NaN means non-codepoint
1.743 + // Support: Firefox<24
1.744 + // Workaround erroneous numeric interpretation of +"0x"
1.745 + return high !== high || escapedWhitespace ?
1.746 + escaped :
1.747 + high < 0 ?
1.748 + // BMP codepoint
1.749 + String.fromCharCode( high + 0x10000 ) :
1.750 + // Supplemental Plane codepoint (surrogate pair)
1.751 + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
1.752 + },
1.753 +
1.754 + // Used for iframes
1.755 + // See setDocument()
1.756 + // Removing the function wrapper causes a "Permission Denied"
1.757 + // error in IE
1.758 + unloadHandler = function() {
1.759 + setDocument();
1.760 + };
1.761 +
1.762 +// Optimize for push.apply( _, NodeList )
1.763 +try {
1.764 + push.apply(
1.765 + (arr = slice.call( preferredDoc.childNodes )),
1.766 + preferredDoc.childNodes
1.767 + );
1.768 + // Support: Android<4.0
1.769 + // Detect silently failing push.apply
1.770 + arr[ preferredDoc.childNodes.length ].nodeType;
1.771 +} catch ( e ) {
1.772 + push = { apply: arr.length ?
1.773 +
1.774 + // Leverage slice if possible
1.775 + function( target, els ) {
1.776 + push_native.apply( target, slice.call(els) );
1.777 + } :
1.778 +
1.779 + // Support: IE<9
1.780 + // Otherwise append directly
1.781 + function( target, els ) {
1.782 + var j = target.length,
1.783 + i = 0;
1.784 + // Can't trust NodeList.length
1.785 + while ( (target[j++] = els[i++]) ) {}
1.786 + target.length = j - 1;
1.787 + }
1.788 + };
1.789 +}
1.790 +
1.791 +function Sizzle( selector, context, results, seed ) {
1.792 + var match, elem, m, nodeType,
1.793 + // QSA vars
1.794 + i, groups, old, nid, newContext, newSelector;
1.795 +
1.796 + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
1.797 + setDocument( context );
1.798 + }
1.799 +
1.800 + context = context || document;
1.801 + results = results || [];
1.802 + nodeType = context.nodeType;
1.803 +
1.804 + if ( typeof selector !== "string" || !selector ||
1.805 + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
1.806 +
1.807 + return results;
1.808 + }
1.809 +
1.810 + if ( !seed && documentIsHTML ) {
1.811 +
1.812 + // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
1.813 + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
1.814 + // Speed-up: Sizzle("#ID")
1.815 + if ( (m = match[1]) ) {
1.816 + if ( nodeType === 9 ) {
1.817 + elem = context.getElementById( m );
1.818 + // Check parentNode to catch when Blackberry 4.6 returns
1.819 + // nodes that are no longer in the document (jQuery #6963)
1.820 + if ( elem && elem.parentNode ) {
1.821 + // Handle the case where IE, Opera, and Webkit return items
1.822 + // by name instead of ID
1.823 + if ( elem.id === m ) {
1.824 + results.push( elem );
1.825 + return results;
1.826 + }
1.827 + } else {
1.828 + return results;
1.829 + }
1.830 + } else {
1.831 + // Context is not a document
1.832 + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
1.833 + contains( context, elem ) && elem.id === m ) {
1.834 + results.push( elem );
1.835 + return results;
1.836 + }
1.837 + }
1.838 +
1.839 + // Speed-up: Sizzle("TAG")
1.840 + } else if ( match[2] ) {
1.841 + push.apply( results, context.getElementsByTagName( selector ) );
1.842 + return results;
1.843 +
1.844 + // Speed-up: Sizzle(".CLASS")
1.845 + } else if ( (m = match[3]) && support.getElementsByClassName ) {
1.846 + push.apply( results, context.getElementsByClassName( m ) );
1.847 + return results;
1.848 + }
1.849 + }
1.850 +
1.851 + // QSA path
1.852 + if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
1.853 + nid = old = expando;
1.854 + newContext = context;
1.855 + newSelector = nodeType !== 1 && selector;
1.856 +
1.857 + // qSA works strangely on Element-rooted queries
1.858 + // We can work around this by specifying an extra ID on the root
1.859 + // and working up from there (Thanks to Andrew Dupont for the technique)
1.860 + // IE 8 doesn't work on object elements
1.861 + if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
1.862 + groups = tokenize( selector );
1.863 +
1.864 + if ( (old = context.getAttribute("id")) ) {
1.865 + nid = old.replace( rescape, "\\$&" );
1.866 + } else {
1.867 + context.setAttribute( "id", nid );
1.868 + }
1.869 + nid = "[id='" + nid + "'] ";
1.870 +
1.871 + i = groups.length;
1.872 + while ( i-- ) {
1.873 + groups[i] = nid + toSelector( groups[i] );
1.874 + }
1.875 + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
1.876 + newSelector = groups.join(",");
1.877 + }
1.878 +
1.879 + if ( newSelector ) {
1.880 + try {
1.881 + push.apply( results,
1.882 + newContext.querySelectorAll( newSelector )
1.883 + );
1.884 + return results;
1.885 + } catch(qsaError) {
1.886 + } finally {
1.887 + if ( !old ) {
1.888 + context.removeAttribute("id");
1.889 + }
1.890 + }
1.891 + }
1.892 + }
1.893 + }
1.894 +
1.895 + // All others
1.896 + return select( selector.replace( rtrim, "$1" ), context, results, seed );
1.897 +}
1.898 +
1.899 +/**
1.900 + * Create key-value caches of limited size
1.901 + * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
1.902 + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
1.903 + * deleting the oldest entry
1.904 + */
1.905 +function createCache() {
1.906 + var keys = [];
1.907 +
1.908 + function cache( key, value ) {
1.909 + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
1.910 + if ( keys.push( key + " " ) > Expr.cacheLength ) {
1.911 + // Only keep the most recent entries
1.912 + delete cache[ keys.shift() ];
1.913 + }
1.914 + return (cache[ key + " " ] = value);
1.915 + }
1.916 + return cache;
1.917 +}
1.918 +
1.919 +/**
1.920 + * Mark a function for special use by Sizzle
1.921 + * @param {Function} fn The function to mark
1.922 + */
1.923 +function markFunction( fn ) {
1.924 + fn[ expando ] = true;
1.925 + return fn;
1.926 +}
1.927 +
1.928 +/**
1.929 + * Support testing using an element
1.930 + * @param {Function} fn Passed the created div and expects a boolean result
1.931 + */
1.932 +function assert( fn ) {
1.933 + var div = document.createElement("div");
1.934 +
1.935 + try {
1.936 + return !!fn( div );
1.937 + } catch (e) {
1.938 + return false;
1.939 + } finally {
1.940 + // Remove from its parent by default
1.941 + if ( div.parentNode ) {
1.942 + div.parentNode.removeChild( div );
1.943 + }
1.944 + // release memory in IE
1.945 + div = null;
1.946 + }
1.947 +}
1.948 +
1.949 +/**
1.950 + * Adds the same handler for all of the specified attrs
1.951 + * @param {String} attrs Pipe-separated list of attributes
1.952 + * @param {Function} handler The method that will be applied
1.953 + */
1.954 +function addHandle( attrs, handler ) {
1.955 + var arr = attrs.split("|"),
1.956 + i = attrs.length;
1.957 +
1.958 + while ( i-- ) {
1.959 + Expr.attrHandle[ arr[i] ] = handler;
1.960 + }
1.961 +}
1.962 +
1.963 +/**
1.964 + * Checks document order of two siblings
1.965 + * @param {Element} a
1.966 + * @param {Element} b
1.967 + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
1.968 + */
1.969 +function siblingCheck( a, b ) {
1.970 + var cur = b && a,
1.971 + diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
1.972 + ( ~b.sourceIndex || MAX_NEGATIVE ) -
1.973 + ( ~a.sourceIndex || MAX_NEGATIVE );
1.974 +
1.975 + // Use IE sourceIndex if available on both nodes
1.976 + if ( diff ) {
1.977 + return diff;
1.978 + }
1.979 +
1.980 + // Check if b follows a
1.981 + if ( cur ) {
1.982 + while ( (cur = cur.nextSibling) ) {
1.983 + if ( cur === b ) {
1.984 + return -1;
1.985 + }
1.986 + }
1.987 + }
1.988 +
1.989 + return a ? 1 : -1;
1.990 +}
1.991 +
1.992 +/**
1.993 + * Returns a function to use in pseudos for input types
1.994 + * @param {String} type
1.995 + */
1.996 +function createInputPseudo( type ) {
1.997 + return function( elem ) {
1.998 + var name = elem.nodeName.toLowerCase();
1.999 + return name === "input" && elem.type === type;
1.1000 + };
1.1001 +}
1.1002 +
1.1003 +/**
1.1004 + * Returns a function to use in pseudos for buttons
1.1005 + * @param {String} type
1.1006 + */
1.1007 +function createButtonPseudo( type ) {
1.1008 + return function( elem ) {
1.1009 + var name = elem.nodeName.toLowerCase();
1.1010 + return (name === "input" || name === "button") && elem.type === type;
1.1011 + };
1.1012 +}
1.1013 +
1.1014 +/**
1.1015 + * Returns a function to use in pseudos for positionals
1.1016 + * @param {Function} fn
1.1017 + */
1.1018 +function createPositionalPseudo( fn ) {
1.1019 + return markFunction(function( argument ) {
1.1020 + argument = +argument;
1.1021 + return markFunction(function( seed, matches ) {
1.1022 + var j,
1.1023 + matchIndexes = fn( [], seed.length, argument ),
1.1024 + i = matchIndexes.length;
1.1025 +
1.1026 + // Match elements found at the specified indexes
1.1027 + while ( i-- ) {
1.1028 + if ( seed[ (j = matchIndexes[i]) ] ) {
1.1029 + seed[j] = !(matches[j] = seed[j]);
1.1030 + }
1.1031 + }
1.1032 + });
1.1033 + });
1.1034 +}
1.1035 +
1.1036 +/**
1.1037 + * Checks a node for validity as a Sizzle context
1.1038 + * @param {Element|Object=} context
1.1039 + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1.1040 + */
1.1041 +function testContext( context ) {
1.1042 + return context && typeof context.getElementsByTagName !== "undefined" && context;
1.1043 +}
1.1044 +
1.1045 +// Expose support vars for convenience
1.1046 +support = Sizzle.support = {};
1.1047 +
1.1048 +/**
1.1049 + * Detects XML nodes
1.1050 + * @param {Element|Object} elem An element or a document
1.1051 + * @returns {Boolean} True iff elem is a non-HTML XML node
1.1052 + */
1.1053 +isXML = Sizzle.isXML = function( elem ) {
1.1054 + // documentElement is verified for cases where it doesn't yet exist
1.1055 + // (such as loading iframes in IE - #4833)
1.1056 + var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1.1057 + return documentElement ? documentElement.nodeName !== "HTML" : false;
1.1058 +};
1.1059 +
1.1060 +/**
1.1061 + * Sets document-related variables once based on the current document
1.1062 + * @param {Element|Object} [doc] An element or document object to use to set the document
1.1063 + * @returns {Object} Returns the current document
1.1064 + */
1.1065 +setDocument = Sizzle.setDocument = function( node ) {
1.1066 + var hasCompare, parent,
1.1067 + doc = node ? node.ownerDocument || node : preferredDoc;
1.1068 +
1.1069 + // If no document and documentElement is available, return
1.1070 + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1.1071 + return document;
1.1072 + }
1.1073 +
1.1074 + // Set our document
1.1075 + document = doc;
1.1076 + docElem = doc.documentElement;
1.1077 + parent = doc.defaultView;
1.1078 +
1.1079 + // Support: IE>8
1.1080 + // If iframe document is assigned to "document" variable and if iframe has been reloaded,
1.1081 + // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
1.1082 + // IE6-8 do not support the defaultView property so parent will be undefined
1.1083 + if ( parent && parent !== parent.top ) {
1.1084 + // IE11 does not have attachEvent, so all must suffer
1.1085 + if ( parent.addEventListener ) {
1.1086 + parent.addEventListener( "unload", unloadHandler, false );
1.1087 + } else if ( parent.attachEvent ) {
1.1088 + parent.attachEvent( "onunload", unloadHandler );
1.1089 + }
1.1090 + }
1.1091 +
1.1092 + /* Support tests
1.1093 + ---------------------------------------------------------------------- */
1.1094 + documentIsHTML = !isXML( doc );
1.1095 +
1.1096 + /* Attributes
1.1097 + ---------------------------------------------------------------------- */
1.1098 +
1.1099 + // Support: IE<8
1.1100 + // Verify that getAttribute really returns attributes and not properties
1.1101 + // (excepting IE8 booleans)
1.1102 + support.attributes = assert(function( div ) {
1.1103 + div.className = "i";
1.1104 + return !div.getAttribute("className");
1.1105 + });
1.1106 +
1.1107 + /* getElement(s)By*
1.1108 + ---------------------------------------------------------------------- */
1.1109 +
1.1110 + // Check if getElementsByTagName("*") returns only elements
1.1111 + support.getElementsByTagName = assert(function( div ) {
1.1112 + div.appendChild( doc.createComment("") );
1.1113 + return !div.getElementsByTagName("*").length;
1.1114 + });
1.1115 +
1.1116 + // Support: IE<9
1.1117 + support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
1.1118 +
1.1119 + // Support: IE<10
1.1120 + // Check if getElementById returns elements by name
1.1121 + // The broken getElementById methods don't pick up programatically-set names,
1.1122 + // so use a roundabout getElementsByName test
1.1123 + support.getById = assert(function( div ) {
1.1124 + docElem.appendChild( div ).id = expando;
1.1125 + return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
1.1126 + });
1.1127 +
1.1128 + // ID find and filter
1.1129 + if ( support.getById ) {
1.1130 + Expr.find["ID"] = function( id, context ) {
1.1131 + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1.1132 + var m = context.getElementById( id );
1.1133 + // Check parentNode to catch when Blackberry 4.6 returns
1.1134 + // nodes that are no longer in the document #6963
1.1135 + return m && m.parentNode ? [ m ] : [];
1.1136 + }
1.1137 + };
1.1138 + Expr.filter["ID"] = function( id ) {
1.1139 + var attrId = id.replace( runescape, funescape );
1.1140 + return function( elem ) {
1.1141 + return elem.getAttribute("id") === attrId;
1.1142 + };
1.1143 + };
1.1144 + } else {
1.1145 + // Support: IE6/7
1.1146 + // getElementById is not reliable as a find shortcut
1.1147 + delete Expr.find["ID"];
1.1148 +
1.1149 + Expr.filter["ID"] = function( id ) {
1.1150 + var attrId = id.replace( runescape, funescape );
1.1151 + return function( elem ) {
1.1152 + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
1.1153 + return node && node.value === attrId;
1.1154 + };
1.1155 + };
1.1156 + }
1.1157 +
1.1158 + // Tag
1.1159 + Expr.find["TAG"] = support.getElementsByTagName ?
1.1160 + function( tag, context ) {
1.1161 + if ( typeof context.getElementsByTagName !== "undefined" ) {
1.1162 + return context.getElementsByTagName( tag );
1.1163 +
1.1164 + // DocumentFragment nodes don't have gEBTN
1.1165 + } else if ( support.qsa ) {
1.1166 + return context.querySelectorAll( tag );
1.1167 + }
1.1168 + } :
1.1169 +
1.1170 + function( tag, context ) {
1.1171 + var elem,
1.1172 + tmp = [],
1.1173 + i = 0,
1.1174 + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1.1175 + results = context.getElementsByTagName( tag );
1.1176 +
1.1177 + // Filter out possible comments
1.1178 + if ( tag === "*" ) {
1.1179 + while ( (elem = results[i++]) ) {
1.1180 + if ( elem.nodeType === 1 ) {
1.1181 + tmp.push( elem );
1.1182 + }
1.1183 + }
1.1184 +
1.1185 + return tmp;
1.1186 + }
1.1187 + return results;
1.1188 + };
1.1189 +
1.1190 + // Class
1.1191 + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1.1192 + if ( documentIsHTML ) {
1.1193 + return context.getElementsByClassName( className );
1.1194 + }
1.1195 + };
1.1196 +
1.1197 + /* QSA/matchesSelector
1.1198 + ---------------------------------------------------------------------- */
1.1199 +
1.1200 + // QSA and matchesSelector support
1.1201 +
1.1202 + // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1.1203 + rbuggyMatches = [];
1.1204 +
1.1205 + // qSa(:focus) reports false when true (Chrome 21)
1.1206 + // We allow this because of a bug in IE8/9 that throws an error
1.1207 + // whenever `document.activeElement` is accessed on an iframe
1.1208 + // So, we allow :focus to pass through QSA all the time to avoid the IE error
1.1209 + // See http://bugs.jquery.com/ticket/13378
1.1210 + rbuggyQSA = [];
1.1211 +
1.1212 + if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
1.1213 + // Build QSA regex
1.1214 + // Regex strategy adopted from Diego Perini
1.1215 + assert(function( div ) {
1.1216 + // Select is set to empty string on purpose
1.1217 + // This is to test IE's treatment of not explicitly
1.1218 + // setting a boolean content attribute,
1.1219 + // since its presence should be enough
1.1220 + // http://bugs.jquery.com/ticket/12359
1.1221 + docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
1.1222 + "<select id='" + expando + "-\f]' msallowcapture=''>" +
1.1223 + "<option selected=''></option></select>";
1.1224 +
1.1225 + // Support: IE8, Opera 11-12.16
1.1226 + // Nothing should be selected when empty strings follow ^= or $= or *=
1.1227 + // The test attribute must be unknown in Opera but "safe" for WinRT
1.1228 + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1.1229 + if ( div.querySelectorAll("[msallowcapture^='']").length ) {
1.1230 + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1.1231 + }
1.1232 +
1.1233 + // Support: IE8
1.1234 + // Boolean attributes and "value" are not treated correctly
1.1235 + if ( !div.querySelectorAll("[selected]").length ) {
1.1236 + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1.1237 + }
1.1238 +
1.1239 + // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
1.1240 + if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
1.1241 + rbuggyQSA.push("~=");
1.1242 + }
1.1243 +
1.1244 + // Webkit/Opera - :checked should return selected option elements
1.1245 + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1.1246 + // IE8 throws error here and will not see later tests
1.1247 + if ( !div.querySelectorAll(":checked").length ) {
1.1248 + rbuggyQSA.push(":checked");
1.1249 + }
1.1250 +
1.1251 + // Support: Safari 8+, iOS 8+
1.1252 + // https://bugs.webkit.org/show_bug.cgi?id=136851
1.1253 + // In-page `selector#id sibing-combinator selector` fails
1.1254 + if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
1.1255 + rbuggyQSA.push(".#.+[+~]");
1.1256 + }
1.1257 + });
1.1258 +
1.1259 + assert(function( div ) {
1.1260 + // Support: Windows 8 Native Apps
1.1261 + // The type and name attributes are restricted during .innerHTML assignment
1.1262 + var input = doc.createElement("input");
1.1263 + input.setAttribute( "type", "hidden" );
1.1264 + div.appendChild( input ).setAttribute( "name", "D" );
1.1265 +
1.1266 + // Support: IE8
1.1267 + // Enforce case-sensitivity of name attribute
1.1268 + if ( div.querySelectorAll("[name=d]").length ) {
1.1269 + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1.1270 + }
1.1271 +
1.1272 + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1.1273 + // IE8 throws error here and will not see later tests
1.1274 + if ( !div.querySelectorAll(":enabled").length ) {
1.1275 + rbuggyQSA.push( ":enabled", ":disabled" );
1.1276 + }
1.1277 +
1.1278 + // Opera 10-11 does not throw on post-comma invalid pseudos
1.1279 + div.querySelectorAll("*,:x");
1.1280 + rbuggyQSA.push(",.*:");
1.1281 + });
1.1282 + }
1.1283 +
1.1284 + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1.1285 + docElem.webkitMatchesSelector ||
1.1286 + docElem.mozMatchesSelector ||
1.1287 + docElem.oMatchesSelector ||
1.1288 + docElem.msMatchesSelector) )) ) {
1.1289 +
1.1290 + assert(function( div ) {
1.1291 + // Check to see if it's possible to do matchesSelector
1.1292 + // on a disconnected node (IE 9)
1.1293 + support.disconnectedMatch = matches.call( div, "div" );
1.1294 +
1.1295 + // This should fail with an exception
1.1296 + // Gecko does not error, returns false instead
1.1297 + matches.call( div, "[s!='']:x" );
1.1298 + rbuggyMatches.push( "!=", pseudos );
1.1299 + });
1.1300 + }
1.1301 +
1.1302 + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1.1303 + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1.1304 +
1.1305 + /* Contains
1.1306 + ---------------------------------------------------------------------- */
1.1307 + hasCompare = rnative.test( docElem.compareDocumentPosition );
1.1308 +
1.1309 + // Element contains another
1.1310 + // Purposefully does not implement inclusive descendent
1.1311 + // As in, an element does not contain itself
1.1312 + contains = hasCompare || rnative.test( docElem.contains ) ?
1.1313 + function( a, b ) {
1.1314 + var adown = a.nodeType === 9 ? a.documentElement : a,
1.1315 + bup = b && b.parentNode;
1.1316 + return a === bup || !!( bup && bup.nodeType === 1 && (
1.1317 + adown.contains ?
1.1318 + adown.contains( bup ) :
1.1319 + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1.1320 + ));
1.1321 + } :
1.1322 + function( a, b ) {
1.1323 + if ( b ) {
1.1324 + while ( (b = b.parentNode) ) {
1.1325 + if ( b === a ) {
1.1326 + return true;
1.1327 + }
1.1328 + }
1.1329 + }
1.1330 + return false;
1.1331 + };
1.1332 +
1.1333 + /* Sorting
1.1334 + ---------------------------------------------------------------------- */
1.1335 +
1.1336 + // Document order sorting
1.1337 + sortOrder = hasCompare ?
1.1338 + function( a, b ) {
1.1339 +
1.1340 + // Flag for duplicate removal
1.1341 + if ( a === b ) {
1.1342 + hasDuplicate = true;
1.1343 + return 0;
1.1344 + }
1.1345 +
1.1346 + // Sort on method existence if only one input has compareDocumentPosition
1.1347 + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1.1348 + if ( compare ) {
1.1349 + return compare;
1.1350 + }
1.1351 +
1.1352 + // Calculate position if both inputs belong to the same document
1.1353 + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1.1354 + a.compareDocumentPosition( b ) :
1.1355 +
1.1356 + // Otherwise we know they are disconnected
1.1357 + 1;
1.1358 +
1.1359 + // Disconnected nodes
1.1360 + if ( compare & 1 ||
1.1361 + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1.1362 +
1.1363 + // Choose the first element that is related to our preferred document
1.1364 + if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1.1365 + return -1;
1.1366 + }
1.1367 + if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1.1368 + return 1;
1.1369 + }
1.1370 +
1.1371 + // Maintain original order
1.1372 + return sortInput ?
1.1373 + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1.1374 + 0;
1.1375 + }
1.1376 +
1.1377 + return compare & 4 ? -1 : 1;
1.1378 + } :
1.1379 + function( a, b ) {
1.1380 + // Exit early if the nodes are identical
1.1381 + if ( a === b ) {
1.1382 + hasDuplicate = true;
1.1383 + return 0;
1.1384 + }
1.1385 +
1.1386 + var cur,
1.1387 + i = 0,
1.1388 + aup = a.parentNode,
1.1389 + bup = b.parentNode,
1.1390 + ap = [ a ],
1.1391 + bp = [ b ];
1.1392 +
1.1393 + // Parentless nodes are either documents or disconnected
1.1394 + if ( !aup || !bup ) {
1.1395 + return a === doc ? -1 :
1.1396 + b === doc ? 1 :
1.1397 + aup ? -1 :
1.1398 + bup ? 1 :
1.1399 + sortInput ?
1.1400 + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1.1401 + 0;
1.1402 +
1.1403 + // If the nodes are siblings, we can do a quick check
1.1404 + } else if ( aup === bup ) {
1.1405 + return siblingCheck( a, b );
1.1406 + }
1.1407 +
1.1408 + // Otherwise we need full lists of their ancestors for comparison
1.1409 + cur = a;
1.1410 + while ( (cur = cur.parentNode) ) {
1.1411 + ap.unshift( cur );
1.1412 + }
1.1413 + cur = b;
1.1414 + while ( (cur = cur.parentNode) ) {
1.1415 + bp.unshift( cur );
1.1416 + }
1.1417 +
1.1418 + // Walk down the tree looking for a discrepancy
1.1419 + while ( ap[i] === bp[i] ) {
1.1420 + i++;
1.1421 + }
1.1422 +
1.1423 + return i ?
1.1424 + // Do a sibling check if the nodes have a common ancestor
1.1425 + siblingCheck( ap[i], bp[i] ) :
1.1426 +
1.1427 + // Otherwise nodes in our document sort first
1.1428 + ap[i] === preferredDoc ? -1 :
1.1429 + bp[i] === preferredDoc ? 1 :
1.1430 + 0;
1.1431 + };
1.1432 +
1.1433 + return doc;
1.1434 +};
1.1435 +
1.1436 +Sizzle.matches = function( expr, elements ) {
1.1437 + return Sizzle( expr, null, null, elements );
1.1438 +};
1.1439 +
1.1440 +Sizzle.matchesSelector = function( elem, expr ) {
1.1441 + // Set document vars if needed
1.1442 + if ( ( elem.ownerDocument || elem ) !== document ) {
1.1443 + setDocument( elem );
1.1444 + }
1.1445 +
1.1446 + // Make sure that attribute selectors are quoted
1.1447 + expr = expr.replace( rattributeQuotes, "='$1']" );
1.1448 +
1.1449 + if ( support.matchesSelector && documentIsHTML &&
1.1450 + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1.1451 + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1.1452 +
1.1453 + try {
1.1454 + var ret = matches.call( elem, expr );
1.1455 +
1.1456 + // IE 9's matchesSelector returns false on disconnected nodes
1.1457 + if ( ret || support.disconnectedMatch ||
1.1458 + // As well, disconnected nodes are said to be in a document
1.1459 + // fragment in IE 9
1.1460 + elem.document && elem.document.nodeType !== 11 ) {
1.1461 + return ret;
1.1462 + }
1.1463 + } catch (e) {}
1.1464 + }
1.1465 +
1.1466 + return Sizzle( expr, document, null, [ elem ] ).length > 0;
1.1467 +};
1.1468 +
1.1469 +Sizzle.contains = function( context, elem ) {
1.1470 + // Set document vars if needed
1.1471 + if ( ( context.ownerDocument || context ) !== document ) {
1.1472 + setDocument( context );
1.1473 + }
1.1474 + return contains( context, elem );
1.1475 +};
1.1476 +
1.1477 +Sizzle.attr = function( elem, name ) {
1.1478 + // Set document vars if needed
1.1479 + if ( ( elem.ownerDocument || elem ) !== document ) {
1.1480 + setDocument( elem );
1.1481 + }
1.1482 +
1.1483 + var fn = Expr.attrHandle[ name.toLowerCase() ],
1.1484 + // Don't get fooled by Object.prototype properties (jQuery #13807)
1.1485 + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1.1486 + fn( elem, name, !documentIsHTML ) :
1.1487 + undefined;
1.1488 +
1.1489 + return val !== undefined ?
1.1490 + val :
1.1491 + support.attributes || !documentIsHTML ?
1.1492 + elem.getAttribute( name ) :
1.1493 + (val = elem.getAttributeNode(name)) && val.specified ?
1.1494 + val.value :
1.1495 + null;
1.1496 +};
1.1497 +
1.1498 +Sizzle.error = function( msg ) {
1.1499 + throw new Error( "Syntax error, unrecognized expression: " + msg );
1.1500 +};
1.1501 +
1.1502 +/**
1.1503 + * Document sorting and removing duplicates
1.1504 + * @param {ArrayLike} results
1.1505 + */
1.1506 +Sizzle.uniqueSort = function( results ) {
1.1507 + var elem,
1.1508 + duplicates = [],
1.1509 + j = 0,
1.1510 + i = 0;
1.1511 +
1.1512 + // Unless we *know* we can detect duplicates, assume their presence
1.1513 + hasDuplicate = !support.detectDuplicates;
1.1514 + sortInput = !support.sortStable && results.slice( 0 );
1.1515 + results.sort( sortOrder );
1.1516 +
1.1517 + if ( hasDuplicate ) {
1.1518 + while ( (elem = results[i++]) ) {
1.1519 + if ( elem === results[ i ] ) {
1.1520 + j = duplicates.push( i );
1.1521 + }
1.1522 + }
1.1523 + while ( j-- ) {
1.1524 + results.splice( duplicates[ j ], 1 );
1.1525 + }
1.1526 + }
1.1527 +
1.1528 + // Clear input after sorting to release objects
1.1529 + // See https://github.com/jquery/sizzle/pull/225
1.1530 + sortInput = null;
1.1531 +
1.1532 + return results;
1.1533 +};
1.1534 +
1.1535 +/**
1.1536 + * Utility function for retrieving the text value of an array of DOM nodes
1.1537 + * @param {Array|Element} elem
1.1538 + */
1.1539 +getText = Sizzle.getText = function( elem ) {
1.1540 + var node,
1.1541 + ret = "",
1.1542 + i = 0,
1.1543 + nodeType = elem.nodeType;
1.1544 +
1.1545 + if ( !nodeType ) {
1.1546 + // If no nodeType, this is expected to be an array
1.1547 + while ( (node = elem[i++]) ) {
1.1548 + // Do not traverse comment nodes
1.1549 + ret += getText( node );
1.1550 + }
1.1551 + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1.1552 + // Use textContent for elements
1.1553 + // innerText usage removed for consistency of new lines (jQuery #11153)
1.1554 + if ( typeof elem.textContent === "string" ) {
1.1555 + return elem.textContent;
1.1556 + } else {
1.1557 + // Traverse its children
1.1558 + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1.1559 + ret += getText( elem );
1.1560 + }
1.1561 + }
1.1562 + } else if ( nodeType === 3 || nodeType === 4 ) {
1.1563 + return elem.nodeValue;
1.1564 + }
1.1565 + // Do not include comment or processing instruction nodes
1.1566 +
1.1567 + return ret;
1.1568 +};
1.1569 +
1.1570 +Expr = Sizzle.selectors = {
1.1571 +
1.1572 + // Can be adjusted by the user
1.1573 + cacheLength: 50,
1.1574 +
1.1575 + createPseudo: markFunction,
1.1576 +
1.1577 + match: matchExpr,
1.1578 +
1.1579 + attrHandle: {},
1.1580 +
1.1581 + find: {},
1.1582 +
1.1583 + relative: {
1.1584 + ">": { dir: "parentNode", first: true },
1.1585 + " ": { dir: "parentNode" },
1.1586 + "+": { dir: "previousSibling", first: true },
1.1587 + "~": { dir: "previousSibling" }
1.1588 + },
1.1589 +
1.1590 + preFilter: {
1.1591 + "ATTR": function( match ) {
1.1592 + match[1] = match[1].replace( runescape, funescape );
1.1593 +
1.1594 + // Move the given value to match[3] whether quoted or unquoted
1.1595 + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1.1596 +
1.1597 + if ( match[2] === "~=" ) {
1.1598 + match[3] = " " + match[3] + " ";
1.1599 + }
1.1600 +
1.1601 + return match.slice( 0, 4 );
1.1602 + },
1.1603 +
1.1604 + "CHILD": function( match ) {
1.1605 + /* matches from matchExpr["CHILD"]
1.1606 + 1 type (only|nth|...)
1.1607 + 2 what (child|of-type)
1.1608 + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1.1609 + 4 xn-component of xn+y argument ([+-]?\d*n|)
1.1610 + 5 sign of xn-component
1.1611 + 6 x of xn-component
1.1612 + 7 sign of y-component
1.1613 + 8 y of y-component
1.1614 + */
1.1615 + match[1] = match[1].toLowerCase();
1.1616 +
1.1617 + if ( match[1].slice( 0, 3 ) === "nth" ) {
1.1618 + // nth-* requires argument
1.1619 + if ( !match[3] ) {
1.1620 + Sizzle.error( match[0] );
1.1621 + }
1.1622 +
1.1623 + // numeric x and y parameters for Expr.filter.CHILD
1.1624 + // remember that false/true cast respectively to 0/1
1.1625 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1.1626 + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1.1627 +
1.1628 + // other types prohibit arguments
1.1629 + } else if ( match[3] ) {
1.1630 + Sizzle.error( match[0] );
1.1631 + }
1.1632 +
1.1633 + return match;
1.1634 + },
1.1635 +
1.1636 + "PSEUDO": function( match ) {
1.1637 + var excess,
1.1638 + unquoted = !match[6] && match[2];
1.1639 +
1.1640 + if ( matchExpr["CHILD"].test( match[0] ) ) {
1.1641 + return null;
1.1642 + }
1.1643 +
1.1644 + // Accept quoted arguments as-is
1.1645 + if ( match[3] ) {
1.1646 + match[2] = match[4] || match[5] || "";
1.1647 +
1.1648 + // Strip excess characters from unquoted arguments
1.1649 + } else if ( unquoted && rpseudo.test( unquoted ) &&
1.1650 + // Get excess from tokenize (recursively)
1.1651 + (excess = tokenize( unquoted, true )) &&
1.1652 + // advance to the next closing parenthesis
1.1653 + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1.1654 +
1.1655 + // excess is a negative index
1.1656 + match[0] = match[0].slice( 0, excess );
1.1657 + match[2] = unquoted.slice( 0, excess );
1.1658 + }
1.1659 +
1.1660 + // Return only captures needed by the pseudo filter method (type and argument)
1.1661 + return match.slice( 0, 3 );
1.1662 + }
1.1663 + },
1.1664 +
1.1665 + filter: {
1.1666 +
1.1667 + "TAG": function( nodeNameSelector ) {
1.1668 + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1.1669 + return nodeNameSelector === "*" ?
1.1670 + function() { return true; } :
1.1671 + function( elem ) {
1.1672 + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1.1673 + };
1.1674 + },
1.1675 +
1.1676 + "CLASS": function( className ) {
1.1677 + var pattern = classCache[ className + " " ];
1.1678 +
1.1679 + return pattern ||
1.1680 + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1.1681 + classCache( className, function( elem ) {
1.1682 + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
1.1683 + });
1.1684 + },
1.1685 +
1.1686 + "ATTR": function( name, operator, check ) {
1.1687 + return function( elem ) {
1.1688 + var result = Sizzle.attr( elem, name );
1.1689 +
1.1690 + if ( result == null ) {
1.1691 + return operator === "!=";
1.1692 + }
1.1693 + if ( !operator ) {
1.1694 + return true;
1.1695 + }
1.1696 +
1.1697 + result += "";
1.1698 +
1.1699 + return operator === "=" ? result === check :
1.1700 + operator === "!=" ? result !== check :
1.1701 + operator === "^=" ? check && result.indexOf( check ) === 0 :
1.1702 + operator === "*=" ? check && result.indexOf( check ) > -1 :
1.1703 + operator === "$=" ? check && result.slice( -check.length ) === check :
1.1704 + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
1.1705 + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1.1706 + false;
1.1707 + };
1.1708 + },
1.1709 +
1.1710 + "CHILD": function( type, what, argument, first, last ) {
1.1711 + var simple = type.slice( 0, 3 ) !== "nth",
1.1712 + forward = type.slice( -4 ) !== "last",
1.1713 + ofType = what === "of-type";
1.1714 +
1.1715 + return first === 1 && last === 0 ?
1.1716 +
1.1717 + // Shortcut for :nth-*(n)
1.1718 + function( elem ) {
1.1719 + return !!elem.parentNode;
1.1720 + } :
1.1721 +
1.1722 + function( elem, context, xml ) {
1.1723 + var cache, outerCache, node, diff, nodeIndex, start,
1.1724 + dir = simple !== forward ? "nextSibling" : "previousSibling",
1.1725 + parent = elem.parentNode,
1.1726 + name = ofType && elem.nodeName.toLowerCase(),
1.1727 + useCache = !xml && !ofType;
1.1728 +
1.1729 + if ( parent ) {
1.1730 +
1.1731 + // :(first|last|only)-(child|of-type)
1.1732 + if ( simple ) {
1.1733 + while ( dir ) {
1.1734 + node = elem;
1.1735 + while ( (node = node[ dir ]) ) {
1.1736 + if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
1.1737 + return false;
1.1738 + }
1.1739 + }
1.1740 + // Reverse direction for :only-* (if we haven't yet done so)
1.1741 + start = dir = type === "only" && !start && "nextSibling";
1.1742 + }
1.1743 + return true;
1.1744 + }
1.1745 +
1.1746 + start = [ forward ? parent.firstChild : parent.lastChild ];
1.1747 +
1.1748 + // non-xml :nth-child(...) stores cache data on `parent`
1.1749 + if ( forward && useCache ) {
1.1750 + // Seek `elem` from a previously-cached index
1.1751 + outerCache = parent[ expando ] || (parent[ expando ] = {});
1.1752 + cache = outerCache[ type ] || [];
1.1753 + nodeIndex = cache[0] === dirruns && cache[1];
1.1754 + diff = cache[0] === dirruns && cache[2];
1.1755 + node = nodeIndex && parent.childNodes[ nodeIndex ];
1.1756 +
1.1757 + while ( (node = ++nodeIndex && node && node[ dir ] ||
1.1758 +
1.1759 + // Fallback to seeking `elem` from the start
1.1760 + (diff = nodeIndex = 0) || start.pop()) ) {
1.1761 +
1.1762 + // When found, cache indexes on `parent` and break
1.1763 + if ( node.nodeType === 1 && ++diff && node === elem ) {
1.1764 + outerCache[ type ] = [ dirruns, nodeIndex, diff ];
1.1765 + break;
1.1766 + }
1.1767 + }
1.1768 +
1.1769 + // Use previously-cached element index if available
1.1770 + } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
1.1771 + diff = cache[1];
1.1772 +
1.1773 + // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
1.1774 + } else {
1.1775 + // Use the same loop as above to seek `elem` from the start
1.1776 + while ( (node = ++nodeIndex && node && node[ dir ] ||
1.1777 + (diff = nodeIndex = 0) || start.pop()) ) {
1.1778 +
1.1779 + if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
1.1780 + // Cache the index of each encountered element
1.1781 + if ( useCache ) {
1.1782 + (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
1.1783 + }
1.1784 +
1.1785 + if ( node === elem ) {
1.1786 + break;
1.1787 + }
1.1788 + }
1.1789 + }
1.1790 + }
1.1791 +
1.1792 + // Incorporate the offset, then check against cycle size
1.1793 + diff -= last;
1.1794 + return diff === first || ( diff % first === 0 && diff / first >= 0 );
1.1795 + }
1.1796 + };
1.1797 + },
1.1798 +
1.1799 + "PSEUDO": function( pseudo, argument ) {
1.1800 + // pseudo-class names are case-insensitive
1.1801 + // http://www.w3.org/TR/selectors/#pseudo-classes
1.1802 + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1.1803 + // Remember that setFilters inherits from pseudos
1.1804 + var args,
1.1805 + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1.1806 + Sizzle.error( "unsupported pseudo: " + pseudo );
1.1807 +
1.1808 + // The user may use createPseudo to indicate that
1.1809 + // arguments are needed to create the filter function
1.1810 + // just as Sizzle does
1.1811 + if ( fn[ expando ] ) {
1.1812 + return fn( argument );
1.1813 + }
1.1814 +
1.1815 + // But maintain support for old signatures
1.1816 + if ( fn.length > 1 ) {
1.1817 + args = [ pseudo, pseudo, "", argument ];
1.1818 + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1.1819 + markFunction(function( seed, matches ) {
1.1820 + var idx,
1.1821 + matched = fn( seed, argument ),
1.1822 + i = matched.length;
1.1823 + while ( i-- ) {
1.1824 + idx = indexOf( seed, matched[i] );
1.1825 + seed[ idx ] = !( matches[ idx ] = matched[i] );
1.1826 + }
1.1827 + }) :
1.1828 + function( elem ) {
1.1829 + return fn( elem, 0, args );
1.1830 + };
1.1831 + }
1.1832 +
1.1833 + return fn;
1.1834 + }
1.1835 + },
1.1836 +
1.1837 + pseudos: {
1.1838 + // Potentially complex pseudos
1.1839 + "not": markFunction(function( selector ) {
1.1840 + // Trim the selector passed to compile
1.1841 + // to avoid treating leading and trailing
1.1842 + // spaces as combinators
1.1843 + var input = [],
1.1844 + results = [],
1.1845 + matcher = compile( selector.replace( rtrim, "$1" ) );
1.1846 +
1.1847 + return matcher[ expando ] ?
1.1848 + markFunction(function( seed, matches, context, xml ) {
1.1849 + var elem,
1.1850 + unmatched = matcher( seed, null, xml, [] ),
1.1851 + i = seed.length;
1.1852 +
1.1853 + // Match elements unmatched by `matcher`
1.1854 + while ( i-- ) {
1.1855 + if ( (elem = unmatched[i]) ) {
1.1856 + seed[i] = !(matches[i] = elem);
1.1857 + }
1.1858 + }
1.1859 + }) :
1.1860 + function( elem, context, xml ) {
1.1861 + input[0] = elem;
1.1862 + matcher( input, null, xml, results );
1.1863 + // Don't keep the element (issue #299)
1.1864 + input[0] = null;
1.1865 + return !results.pop();
1.1866 + };
1.1867 + }),
1.1868 +
1.1869 + "has": markFunction(function( selector ) {
1.1870 + return function( elem ) {
1.1871 + return Sizzle( selector, elem ).length > 0;
1.1872 + };
1.1873 + }),
1.1874 +
1.1875 + "contains": markFunction(function( text ) {
1.1876 + text = text.replace( runescape, funescape );
1.1877 + return function( elem ) {
1.1878 + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1.1879 + };
1.1880 + }),
1.1881 +
1.1882 + // "Whether an element is represented by a :lang() selector
1.1883 + // is based solely on the element's language value
1.1884 + // being equal to the identifier C,
1.1885 + // or beginning with the identifier C immediately followed by "-".
1.1886 + // The matching of C against the element's language value is performed case-insensitively.
1.1887 + // The identifier C does not have to be a valid language name."
1.1888 + // http://www.w3.org/TR/selectors/#lang-pseudo
1.1889 + "lang": markFunction( function( lang ) {
1.1890 + // lang value must be a valid identifier
1.1891 + if ( !ridentifier.test(lang || "") ) {
1.1892 + Sizzle.error( "unsupported lang: " + lang );
1.1893 + }
1.1894 + lang = lang.replace( runescape, funescape ).toLowerCase();
1.1895 + return function( elem ) {
1.1896 + var elemLang;
1.1897 + do {
1.1898 + if ( (elemLang = documentIsHTML ?
1.1899 + elem.lang :
1.1900 + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
1.1901 +
1.1902 + elemLang = elemLang.toLowerCase();
1.1903 + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
1.1904 + }
1.1905 + } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1.1906 + return false;
1.1907 + };
1.1908 + }),
1.1909 +
1.1910 + // Miscellaneous
1.1911 + "target": function( elem ) {
1.1912 + var hash = window.location && window.location.hash;
1.1913 + return hash && hash.slice( 1 ) === elem.id;
1.1914 + },
1.1915 +
1.1916 + "root": function( elem ) {
1.1917 + return elem === docElem;
1.1918 + },
1.1919 +
1.1920 + "focus": function( elem ) {
1.1921 + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1.1922 + },
1.1923 +
1.1924 + // Boolean properties
1.1925 + "enabled": function( elem ) {
1.1926 + return elem.disabled === false;
1.1927 + },
1.1928 +
1.1929 + "disabled": function( elem ) {
1.1930 + return elem.disabled === true;
1.1931 + },
1.1932 +
1.1933 + "checked": function( elem ) {
1.1934 + // In CSS3, :checked should return both checked and selected elements
1.1935 + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1.1936 + var nodeName = elem.nodeName.toLowerCase();
1.1937 + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
1.1938 + },
1.1939 +
1.1940 + "selected": function( elem ) {
1.1941 + // Accessing this property makes selected-by-default
1.1942 + // options in Safari work properly
1.1943 + if ( elem.parentNode ) {
1.1944 + elem.parentNode.selectedIndex;
1.1945 + }
1.1946 +
1.1947 + return elem.selected === true;
1.1948 + },
1.1949 +
1.1950 + // Contents
1.1951 + "empty": function( elem ) {
1.1952 + // http://www.w3.org/TR/selectors/#empty-pseudo
1.1953 + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
1.1954 + // but not by others (comment: 8; processing instruction: 7; etc.)
1.1955 + // nodeType < 6 works because attributes (2) do not appear as children
1.1956 + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1.1957 + if ( elem.nodeType < 6 ) {
1.1958 + return false;
1.1959 + }
1.1960 + }
1.1961 + return true;
1.1962 + },
1.1963 +
1.1964 + "parent": function( elem ) {
1.1965 + return !Expr.pseudos["empty"]( elem );
1.1966 + },
1.1967 +
1.1968 + // Element/input types
1.1969 + "header": function( elem ) {
1.1970 + return rheader.test( elem.nodeName );
1.1971 + },
1.1972 +
1.1973 + "input": function( elem ) {
1.1974 + return rinputs.test( elem.nodeName );
1.1975 + },
1.1976 +
1.1977 + "button": function( elem ) {
1.1978 + var name = elem.nodeName.toLowerCase();
1.1979 + return name === "input" && elem.type === "button" || name === "button";
1.1980 + },
1.1981 +
1.1982 + "text": function( elem ) {
1.1983 + var attr;
1.1984 + return elem.nodeName.toLowerCase() === "input" &&
1.1985 + elem.type === "text" &&
1.1986 +
1.1987 + // Support: IE<8
1.1988 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
1.1989 + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
1.1990 + },
1.1991 +
1.1992 + // Position-in-collection
1.1993 + "first": createPositionalPseudo(function() {
1.1994 + return [ 0 ];
1.1995 + }),
1.1996 +
1.1997 + "last": createPositionalPseudo(function( matchIndexes, length ) {
1.1998 + return [ length - 1 ];
1.1999 + }),
1.2000 +
1.2001 + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
1.2002 + return [ argument < 0 ? argument + length : argument ];
1.2003 + }),
1.2004 +
1.2005 + "even": createPositionalPseudo(function( matchIndexes, length ) {
1.2006 + var i = 0;
1.2007 + for ( ; i < length; i += 2 ) {
1.2008 + matchIndexes.push( i );
1.2009 + }
1.2010 + return matchIndexes;
1.2011 + }),
1.2012 +
1.2013 + "odd": createPositionalPseudo(function( matchIndexes, length ) {
1.2014 + var i = 1;
1.2015 + for ( ; i < length; i += 2 ) {
1.2016 + matchIndexes.push( i );
1.2017 + }
1.2018 + return matchIndexes;
1.2019 + }),
1.2020 +
1.2021 + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
1.2022 + var i = argument < 0 ? argument + length : argument;
1.2023 + for ( ; --i >= 0; ) {
1.2024 + matchIndexes.push( i );
1.2025 + }
1.2026 + return matchIndexes;
1.2027 + }),
1.2028 +
1.2029 + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
1.2030 + var i = argument < 0 ? argument + length : argument;
1.2031 + for ( ; ++i < length; ) {
1.2032 + matchIndexes.push( i );
1.2033 + }
1.2034 + return matchIndexes;
1.2035 + })
1.2036 + }
1.2037 +};
1.2038 +
1.2039 +Expr.pseudos["nth"] = Expr.pseudos["eq"];
1.2040 +
1.2041 +// Add button/input type pseudos
1.2042 +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
1.2043 + Expr.pseudos[ i ] = createInputPseudo( i );
1.2044 +}
1.2045 +for ( i in { submit: true, reset: true } ) {
1.2046 + Expr.pseudos[ i ] = createButtonPseudo( i );
1.2047 +}
1.2048 +
1.2049 +// Easy API for creating new setFilters
1.2050 +function setFilters() {}
1.2051 +setFilters.prototype = Expr.filters = Expr.pseudos;
1.2052 +Expr.setFilters = new setFilters();
1.2053 +
1.2054 +tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
1.2055 + var matched, match, tokens, type,
1.2056 + soFar, groups, preFilters,
1.2057 + cached = tokenCache[ selector + " " ];
1.2058 +
1.2059 + if ( cached ) {
1.2060 + return parseOnly ? 0 : cached.slice( 0 );
1.2061 + }
1.2062 +
1.2063 + soFar = selector;
1.2064 + groups = [];
1.2065 + preFilters = Expr.preFilter;
1.2066 +
1.2067 + while ( soFar ) {
1.2068 +
1.2069 + // Comma and first run
1.2070 + if ( !matched || (match = rcomma.exec( soFar )) ) {
1.2071 + if ( match ) {
1.2072 + // Don't consume trailing commas as valid
1.2073 + soFar = soFar.slice( match[0].length ) || soFar;
1.2074 + }
1.2075 + groups.push( (tokens = []) );
1.2076 + }
1.2077 +
1.2078 + matched = false;
1.2079 +
1.2080 + // Combinators
1.2081 + if ( (match = rcombinators.exec( soFar )) ) {
1.2082 + matched = match.shift();
1.2083 + tokens.push({
1.2084 + value: matched,
1.2085 + // Cast descendant combinators to space
1.2086 + type: match[0].replace( rtrim, " " )
1.2087 + });
1.2088 + soFar = soFar.slice( matched.length );
1.2089 + }
1.2090 +
1.2091 + // Filters
1.2092 + for ( type in Expr.filter ) {
1.2093 + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
1.2094 + (match = preFilters[ type ]( match ))) ) {
1.2095 + matched = match.shift();
1.2096 + tokens.push({
1.2097 + value: matched,
1.2098 + type: type,
1.2099 + matches: match
1.2100 + });
1.2101 + soFar = soFar.slice( matched.length );
1.2102 + }
1.2103 + }
1.2104 +
1.2105 + if ( !matched ) {
1.2106 + break;
1.2107 + }
1.2108 + }
1.2109 +
1.2110 + // Return the length of the invalid excess
1.2111 + // if we're just parsing
1.2112 + // Otherwise, throw an error or return tokens
1.2113 + return parseOnly ?
1.2114 + soFar.length :
1.2115 + soFar ?
1.2116 + Sizzle.error( selector ) :
1.2117 + // Cache the tokens
1.2118 + tokenCache( selector, groups ).slice( 0 );
1.2119 +};
1.2120 +
1.2121 +function toSelector( tokens ) {
1.2122 + var i = 0,
1.2123 + len = tokens.length,
1.2124 + selector = "";
1.2125 + for ( ; i < len; i++ ) {
1.2126 + selector += tokens[i].value;
1.2127 + }
1.2128 + return selector;
1.2129 +}
1.2130 +
1.2131 +function addCombinator( matcher, combinator, base ) {
1.2132 + var dir = combinator.dir,
1.2133 + checkNonElements = base && dir === "parentNode",
1.2134 + doneName = done++;
1.2135 +
1.2136 + return combinator.first ?
1.2137 + // Check against closest ancestor/preceding element
1.2138 + function( elem, context, xml ) {
1.2139 + while ( (elem = elem[ dir ]) ) {
1.2140 + if ( elem.nodeType === 1 || checkNonElements ) {
1.2141 + return matcher( elem, context, xml );
1.2142 + }
1.2143 + }
1.2144 + } :
1.2145 +
1.2146 + // Check against all ancestor/preceding elements
1.2147 + function( elem, context, xml ) {
1.2148 + var oldCache, outerCache,
1.2149 + newCache = [ dirruns, doneName ];
1.2150 +
1.2151 + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
1.2152 + if ( xml ) {
1.2153 + while ( (elem = elem[ dir ]) ) {
1.2154 + if ( elem.nodeType === 1 || checkNonElements ) {
1.2155 + if ( matcher( elem, context, xml ) ) {
1.2156 + return true;
1.2157 + }
1.2158 + }
1.2159 + }
1.2160 + } else {
1.2161 + while ( (elem = elem[ dir ]) ) {
1.2162 + if ( elem.nodeType === 1 || checkNonElements ) {
1.2163 + outerCache = elem[ expando ] || (elem[ expando ] = {});
1.2164 + if ( (oldCache = outerCache[ dir ]) &&
1.2165 + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
1.2166 +
1.2167 + // Assign to newCache so results back-propagate to previous elements
1.2168 + return (newCache[ 2 ] = oldCache[ 2 ]);
1.2169 + } else {
1.2170 + // Reuse newcache so results back-propagate to previous elements
1.2171 + outerCache[ dir ] = newCache;
1.2172 +
1.2173 + // A match means we're done; a fail means we have to keep checking
1.2174 + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
1.2175 + return true;
1.2176 + }
1.2177 + }
1.2178 + }
1.2179 + }
1.2180 + }
1.2181 + };
1.2182 +}
1.2183 +
1.2184 +function elementMatcher( matchers ) {
1.2185 + return matchers.length > 1 ?
1.2186 + function( elem, context, xml ) {
1.2187 + var i = matchers.length;
1.2188 + while ( i-- ) {
1.2189 + if ( !matchers[i]( elem, context, xml ) ) {
1.2190 + return false;
1.2191 + }
1.2192 + }
1.2193 + return true;
1.2194 + } :
1.2195 + matchers[0];
1.2196 +}
1.2197 +
1.2198 +function multipleContexts( selector, contexts, results ) {
1.2199 + var i = 0,
1.2200 + len = contexts.length;
1.2201 + for ( ; i < len; i++ ) {
1.2202 + Sizzle( selector, contexts[i], results );
1.2203 + }
1.2204 + return results;
1.2205 +}
1.2206 +
1.2207 +function condense( unmatched, map, filter, context, xml ) {
1.2208 + var elem,
1.2209 + newUnmatched = [],
1.2210 + i = 0,
1.2211 + len = unmatched.length,
1.2212 + mapped = map != null;
1.2213 +
1.2214 + for ( ; i < len; i++ ) {
1.2215 + if ( (elem = unmatched[i]) ) {
1.2216 + if ( !filter || filter( elem, context, xml ) ) {
1.2217 + newUnmatched.push( elem );
1.2218 + if ( mapped ) {
1.2219 + map.push( i );
1.2220 + }
1.2221 + }
1.2222 + }
1.2223 + }
1.2224 +
1.2225 + return newUnmatched;
1.2226 +}
1.2227 +
1.2228 +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
1.2229 + if ( postFilter && !postFilter[ expando ] ) {
1.2230 + postFilter = setMatcher( postFilter );
1.2231 + }
1.2232 + if ( postFinder && !postFinder[ expando ] ) {
1.2233 + postFinder = setMatcher( postFinder, postSelector );
1.2234 + }
1.2235 + return markFunction(function( seed, results, context, xml ) {
1.2236 + var temp, i, elem,
1.2237 + preMap = [],
1.2238 + postMap = [],
1.2239 + preexisting = results.length,
1.2240 +
1.2241 + // Get initial elements from seed or context
1.2242 + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
1.2243 +
1.2244 + // Prefilter to get matcher input, preserving a map for seed-results synchronization
1.2245 + matcherIn = preFilter && ( seed || !selector ) ?
1.2246 + condense( elems, preMap, preFilter, context, xml ) :
1.2247 + elems,
1.2248 +
1.2249 + matcherOut = matcher ?
1.2250 + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
1.2251 + postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
1.2252 +
1.2253 + // ...intermediate processing is necessary
1.2254 + [] :
1.2255 +
1.2256 + // ...otherwise use results directly
1.2257 + results :
1.2258 + matcherIn;
1.2259 +
1.2260 + // Find primary matches
1.2261 + if ( matcher ) {
1.2262 + matcher( matcherIn, matcherOut, context, xml );
1.2263 + }
1.2264 +
1.2265 + // Apply postFilter
1.2266 + if ( postFilter ) {
1.2267 + temp = condense( matcherOut, postMap );
1.2268 + postFilter( temp, [], context, xml );
1.2269 +
1.2270 + // Un-match failing elements by moving them back to matcherIn
1.2271 + i = temp.length;
1.2272 + while ( i-- ) {
1.2273 + if ( (elem = temp[i]) ) {
1.2274 + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
1.2275 + }
1.2276 + }
1.2277 + }
1.2278 +
1.2279 + if ( seed ) {
1.2280 + if ( postFinder || preFilter ) {
1.2281 + if ( postFinder ) {
1.2282 + // Get the final matcherOut by condensing this intermediate into postFinder contexts
1.2283 + temp = [];
1.2284 + i = matcherOut.length;
1.2285 + while ( i-- ) {
1.2286 + if ( (elem = matcherOut[i]) ) {
1.2287 + // Restore matcherIn since elem is not yet a final match
1.2288 + temp.push( (matcherIn[i] = elem) );
1.2289 + }
1.2290 + }
1.2291 + postFinder( null, (matcherOut = []), temp, xml );
1.2292 + }
1.2293 +
1.2294 + // Move matched elements from seed to results to keep them synchronized
1.2295 + i = matcherOut.length;
1.2296 + while ( i-- ) {
1.2297 + if ( (elem = matcherOut[i]) &&
1.2298 + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
1.2299 +
1.2300 + seed[temp] = !(results[temp] = elem);
1.2301 + }
1.2302 + }
1.2303 + }
1.2304 +
1.2305 + // Add elements to results, through postFinder if defined
1.2306 + } else {
1.2307 + matcherOut = condense(
1.2308 + matcherOut === results ?
1.2309 + matcherOut.splice( preexisting, matcherOut.length ) :
1.2310 + matcherOut
1.2311 + );
1.2312 + if ( postFinder ) {
1.2313 + postFinder( null, results, matcherOut, xml );
1.2314 + } else {
1.2315 + push.apply( results, matcherOut );
1.2316 + }
1.2317 + }
1.2318 + });
1.2319 +}
1.2320 +
1.2321 +function matcherFromTokens( tokens ) {
1.2322 + var checkContext, matcher, j,
1.2323 + len = tokens.length,
1.2324 + leadingRelative = Expr.relative[ tokens[0].type ],
1.2325 + implicitRelative = leadingRelative || Expr.relative[" "],
1.2326 + i = leadingRelative ? 1 : 0,
1.2327 +
1.2328 + // The foundational matcher ensures that elements are reachable from top-level context(s)
1.2329 + matchContext = addCombinator( function( elem ) {
1.2330 + return elem === checkContext;
1.2331 + }, implicitRelative, true ),
1.2332 + matchAnyContext = addCombinator( function( elem ) {
1.2333 + return indexOf( checkContext, elem ) > -1;
1.2334 + }, implicitRelative, true ),
1.2335 + matchers = [ function( elem, context, xml ) {
1.2336 + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
1.2337 + (checkContext = context).nodeType ?
1.2338 + matchContext( elem, context, xml ) :
1.2339 + matchAnyContext( elem, context, xml ) );
1.2340 + // Avoid hanging onto element (issue #299)
1.2341 + checkContext = null;
1.2342 + return ret;
1.2343 + } ];
1.2344 +
1.2345 + for ( ; i < len; i++ ) {
1.2346 + if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
1.2347 + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
1.2348 + } else {
1.2349 + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
1.2350 +
1.2351 + // Return special upon seeing a positional matcher
1.2352 + if ( matcher[ expando ] ) {
1.2353 + // Find the next relative operator (if any) for proper handling
1.2354 + j = ++i;
1.2355 + for ( ; j < len; j++ ) {
1.2356 + if ( Expr.relative[ tokens[j].type ] ) {
1.2357 + break;
1.2358 + }
1.2359 + }
1.2360 + return setMatcher(
1.2361 + i > 1 && elementMatcher( matchers ),
1.2362 + i > 1 && toSelector(
1.2363 + // If the preceding token was a descendant combinator, insert an implicit any-element `*`
1.2364 + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
1.2365 + ).replace( rtrim, "$1" ),
1.2366 + matcher,
1.2367 + i < j && matcherFromTokens( tokens.slice( i, j ) ),
1.2368 + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
1.2369 + j < len && toSelector( tokens )
1.2370 + );
1.2371 + }
1.2372 + matchers.push( matcher );
1.2373 + }
1.2374 + }
1.2375 +
1.2376 + return elementMatcher( matchers );
1.2377 +}
1.2378 +
1.2379 +function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
1.2380 + var bySet = setMatchers.length > 0,
1.2381 + byElement = elementMatchers.length > 0,
1.2382 + superMatcher = function( seed, context, xml, results, outermost ) {
1.2383 + var elem, j, matcher,
1.2384 + matchedCount = 0,
1.2385 + i = "0",
1.2386 + unmatched = seed && [],
1.2387 + setMatched = [],
1.2388 + contextBackup = outermostContext,
1.2389 + // We must always have either seed elements or outermost context
1.2390 + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
1.2391 + // Use integer dirruns iff this is the outermost matcher
1.2392 + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
1.2393 + len = elems.length;
1.2394 +
1.2395 + if ( outermost ) {
1.2396 + outermostContext = context !== document && context;
1.2397 + }
1.2398 +
1.2399 + // Add elements passing elementMatchers directly to results
1.2400 + // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
1.2401 + // Support: IE<9, Safari
1.2402 + // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
1.2403 + for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
1.2404 + if ( byElement && elem ) {
1.2405 + j = 0;
1.2406 + while ( (matcher = elementMatchers[j++]) ) {
1.2407 + if ( matcher( elem, context, xml ) ) {
1.2408 + results.push( elem );
1.2409 + break;
1.2410 + }
1.2411 + }
1.2412 + if ( outermost ) {
1.2413 + dirruns = dirrunsUnique;
1.2414 + }
1.2415 + }
1.2416 +
1.2417 + // Track unmatched elements for set filters
1.2418 + if ( bySet ) {
1.2419 + // They will have gone through all possible matchers
1.2420 + if ( (elem = !matcher && elem) ) {
1.2421 + matchedCount--;
1.2422 + }
1.2423 +
1.2424 + // Lengthen the array for every element, matched or not
1.2425 + if ( seed ) {
1.2426 + unmatched.push( elem );
1.2427 + }
1.2428 + }
1.2429 + }
1.2430 +
1.2431 + // Apply set filters to unmatched elements
1.2432 + matchedCount += i;
1.2433 + if ( bySet && i !== matchedCount ) {
1.2434 + j = 0;
1.2435 + while ( (matcher = setMatchers[j++]) ) {
1.2436 + matcher( unmatched, setMatched, context, xml );
1.2437 + }
1.2438 +
1.2439 + if ( seed ) {
1.2440 + // Reintegrate element matches to eliminate the need for sorting
1.2441 + if ( matchedCount > 0 ) {
1.2442 + while ( i-- ) {
1.2443 + if ( !(unmatched[i] || setMatched[i]) ) {
1.2444 + setMatched[i] = pop.call( results );
1.2445 + }
1.2446 + }
1.2447 + }
1.2448 +
1.2449 + // Discard index placeholder values to get only actual matches
1.2450 + setMatched = condense( setMatched );
1.2451 + }
1.2452 +
1.2453 + // Add matches to results
1.2454 + push.apply( results, setMatched );
1.2455 +
1.2456 + // Seedless set matches succeeding multiple successful matchers stipulate sorting
1.2457 + if ( outermost && !seed && setMatched.length > 0 &&
1.2458 + ( matchedCount + setMatchers.length ) > 1 ) {
1.2459 +
1.2460 + Sizzle.uniqueSort( results );
1.2461 + }
1.2462 + }
1.2463 +
1.2464 + // Override manipulation of globals by nested matchers
1.2465 + if ( outermost ) {
1.2466 + dirruns = dirrunsUnique;
1.2467 + outermostContext = contextBackup;
1.2468 + }
1.2469 +
1.2470 + return unmatched;
1.2471 + };
1.2472 +
1.2473 + return bySet ?
1.2474 + markFunction( superMatcher ) :
1.2475 + superMatcher;
1.2476 +}
1.2477 +
1.2478 +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
1.2479 + var i,
1.2480 + setMatchers = [],
1.2481 + elementMatchers = [],
1.2482 + cached = compilerCache[ selector + " " ];
1.2483 +
1.2484 + if ( !cached ) {
1.2485 + // Generate a function of recursive functions that can be used to check each element
1.2486 + if ( !match ) {
1.2487 + match = tokenize( selector );
1.2488 + }
1.2489 + i = match.length;
1.2490 + while ( i-- ) {
1.2491 + cached = matcherFromTokens( match[i] );
1.2492 + if ( cached[ expando ] ) {
1.2493 + setMatchers.push( cached );
1.2494 + } else {
1.2495 + elementMatchers.push( cached );
1.2496 + }
1.2497 + }
1.2498 +
1.2499 + // Cache the compiled function
1.2500 + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
1.2501 +
1.2502 + // Save selector and tokenization
1.2503 + cached.selector = selector;
1.2504 + }
1.2505 + return cached;
1.2506 +};
1.2507 +
1.2508 +/**
1.2509 + * A low-level selection function that works with Sizzle's compiled
1.2510 + * selector functions
1.2511 + * @param {String|Function} selector A selector or a pre-compiled
1.2512 + * selector function built with Sizzle.compile
1.2513 + * @param {Element} context
1.2514 + * @param {Array} [results]
1.2515 + * @param {Array} [seed] A set of elements to match against
1.2516 + */
1.2517 +select = Sizzle.select = function( selector, context, results, seed ) {
1.2518 + var i, tokens, token, type, find,
1.2519 + compiled = typeof selector === "function" && selector,
1.2520 + match = !seed && tokenize( (selector = compiled.selector || selector) );
1.2521 +
1.2522 + results = results || [];
1.2523 +
1.2524 + // Try to minimize operations if there is no seed and only one group
1.2525 + if ( match.length === 1 ) {
1.2526 +
1.2527 + // Take a shortcut and set the context if the root selector is an ID
1.2528 + tokens = match[0] = match[0].slice( 0 );
1.2529 + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
1.2530 + support.getById && context.nodeType === 9 && documentIsHTML &&
1.2531 + Expr.relative[ tokens[1].type ] ) {
1.2532 +
1.2533 + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
1.2534 + if ( !context ) {
1.2535 + return results;
1.2536 +
1.2537 + // Precompiled matchers will still verify ancestry, so step up a level
1.2538 + } else if ( compiled ) {
1.2539 + context = context.parentNode;
1.2540 + }
1.2541 +
1.2542 + selector = selector.slice( tokens.shift().value.length );
1.2543 + }
1.2544 +
1.2545 + // Fetch a seed set for right-to-left matching
1.2546 + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
1.2547 + while ( i-- ) {
1.2548 + token = tokens[i];
1.2549 +
1.2550 + // Abort if we hit a combinator
1.2551 + if ( Expr.relative[ (type = token.type) ] ) {
1.2552 + break;
1.2553 + }
1.2554 + if ( (find = Expr.find[ type ]) ) {
1.2555 + // Search, expanding context for leading sibling combinators
1.2556 + if ( (seed = find(
1.2557 + token.matches[0].replace( runescape, funescape ),
1.2558 + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
1.2559 + )) ) {
1.2560 +
1.2561 + // If seed is empty or no tokens remain, we can return early
1.2562 + tokens.splice( i, 1 );
1.2563 + selector = seed.length && toSelector( tokens );
1.2564 + if ( !selector ) {
1.2565 + push.apply( results, seed );
1.2566 + return results;
1.2567 + }
1.2568 +
1.2569 + break;
1.2570 + }
1.2571 + }
1.2572 + }
1.2573 + }
1.2574 +
1.2575 + // Compile and execute a filtering function if one is not provided
1.2576 + // Provide `match` to avoid retokenization if we modified the selector above
1.2577 + ( compiled || compile( selector, match ) )(
1.2578 + seed,
1.2579 + context,
1.2580 + !documentIsHTML,
1.2581 + results,
1.2582 + rsibling.test( selector ) && testContext( context.parentNode ) || context
1.2583 + );
1.2584 + return results;
1.2585 +};
1.2586 +
1.2587 +// One-time assignments
1.2588 +
1.2589 +// Sort stability
1.2590 +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
1.2591 +
1.2592 +// Support: Chrome 14-35+
1.2593 +// Always assume duplicates if they aren't passed to the comparison function
1.2594 +support.detectDuplicates = !!hasDuplicate;
1.2595 +
1.2596 +// Initialize against the default document
1.2597 +setDocument();
1.2598 +
1.2599 +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
1.2600 +// Detached nodes confoundingly follow *each other*
1.2601 +support.sortDetached = assert(function( div1 ) {
1.2602 + // Should return 1, but returns 4 (following)
1.2603 + return div1.compareDocumentPosition( document.createElement("div") ) & 1;
1.2604 +});
1.2605 +
1.2606 +// Support: IE<8
1.2607 +// Prevent attribute/property "interpolation"
1.2608 +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
1.2609 +if ( !assert(function( div ) {
1.2610 + div.innerHTML = "<a href='#'></a>";
1.2611 + return div.firstChild.getAttribute("href") === "#" ;
1.2612 +}) ) {
1.2613 + addHandle( "type|href|height|width", function( elem, name, isXML ) {
1.2614 + if ( !isXML ) {
1.2615 + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
1.2616 + }
1.2617 + });
1.2618 +}
1.2619 +
1.2620 +// Support: IE<9
1.2621 +// Use defaultValue in place of getAttribute("value")
1.2622 +if ( !support.attributes || !assert(function( div ) {
1.2623 + div.innerHTML = "<input/>";
1.2624 + div.firstChild.setAttribute( "value", "" );
1.2625 + return div.firstChild.getAttribute( "value" ) === "";
1.2626 +}) ) {
1.2627 + addHandle( "value", function( elem, name, isXML ) {
1.2628 + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
1.2629 + return elem.defaultValue;
1.2630 + }
1.2631 + });
1.2632 +}
1.2633 +
1.2634 +// Support: IE<9
1.2635 +// Use getAttributeNode to fetch booleans when getAttribute lies
1.2636 +if ( !assert(function( div ) {
1.2637 + return div.getAttribute("disabled") == null;
1.2638 +}) ) {
1.2639 + addHandle( booleans, function( elem, name, isXML ) {
1.2640 + var val;
1.2641 + if ( !isXML ) {
1.2642 + return elem[ name ] === true ? name.toLowerCase() :
1.2643 + (val = elem.getAttributeNode( name )) && val.specified ?
1.2644 + val.value :
1.2645 + null;
1.2646 + }
1.2647 + });
1.2648 +}
1.2649 +
1.2650 +return Sizzle;
1.2651 +
1.2652 +})( window );
1.2653 +
1.2654 +
1.2655 +
1.2656 +jQuery.find = Sizzle;
1.2657 +jQuery.expr = Sizzle.selectors;
1.2658 +jQuery.expr[":"] = jQuery.expr.pseudos;
1.2659 +jQuery.unique = Sizzle.uniqueSort;
1.2660 +jQuery.text = Sizzle.getText;
1.2661 +jQuery.isXMLDoc = Sizzle.isXML;
1.2662 +jQuery.contains = Sizzle.contains;
1.2663 +
1.2664 +
1.2665 +
1.2666 +var rneedsContext = jQuery.expr.match.needsContext;
1.2667 +
1.2668 +var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
1.2669 +
1.2670 +
1.2671 +
1.2672 +var risSimple = /^.[^:#\[\.,]*$/;
1.2673 +
1.2674 +// Implement the identical functionality for filter and not
1.2675 +function winnow( elements, qualifier, not ) {
1.2676 + if ( jQuery.isFunction( qualifier ) ) {
1.2677 + return jQuery.grep( elements, function( elem, i ) {
1.2678 + /* jshint -W018 */
1.2679 + return !!qualifier.call( elem, i, elem ) !== not;
1.2680 + });
1.2681 +
1.2682 + }
1.2683 +
1.2684 + if ( qualifier.nodeType ) {
1.2685 + return jQuery.grep( elements, function( elem ) {
1.2686 + return ( elem === qualifier ) !== not;
1.2687 + });
1.2688 +
1.2689 + }
1.2690 +
1.2691 + if ( typeof qualifier === "string" ) {
1.2692 + if ( risSimple.test( qualifier ) ) {
1.2693 + return jQuery.filter( qualifier, elements, not );
1.2694 + }
1.2695 +
1.2696 + qualifier = jQuery.filter( qualifier, elements );
1.2697 + }
1.2698 +
1.2699 + return jQuery.grep( elements, function( elem ) {
1.2700 + return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
1.2701 + });
1.2702 +}
1.2703 +
1.2704 +jQuery.filter = function( expr, elems, not ) {
1.2705 + var elem = elems[ 0 ];
1.2706 +
1.2707 + if ( not ) {
1.2708 + expr = ":not(" + expr + ")";
1.2709 + }
1.2710 +
1.2711 + return elems.length === 1 && elem.nodeType === 1 ?
1.2712 + jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
1.2713 + jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
1.2714 + return elem.nodeType === 1;
1.2715 + }));
1.2716 +};
1.2717 +
1.2718 +jQuery.fn.extend({
1.2719 + find: function( selector ) {
1.2720 + var i,
1.2721 + ret = [],
1.2722 + self = this,
1.2723 + len = self.length;
1.2724 +
1.2725 + if ( typeof selector !== "string" ) {
1.2726 + return this.pushStack( jQuery( selector ).filter(function() {
1.2727 + for ( i = 0; i < len; i++ ) {
1.2728 + if ( jQuery.contains( self[ i ], this ) ) {
1.2729 + return true;
1.2730 + }
1.2731 + }
1.2732 + }) );
1.2733 + }
1.2734 +
1.2735 + for ( i = 0; i < len; i++ ) {
1.2736 + jQuery.find( selector, self[ i ], ret );
1.2737 + }
1.2738 +
1.2739 + // Needed because $( selector, context ) becomes $( context ).find( selector )
1.2740 + ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
1.2741 + ret.selector = this.selector ? this.selector + " " + selector : selector;
1.2742 + return ret;
1.2743 + },
1.2744 + filter: function( selector ) {
1.2745 + return this.pushStack( winnow(this, selector || [], false) );
1.2746 + },
1.2747 + not: function( selector ) {
1.2748 + return this.pushStack( winnow(this, selector || [], true) );
1.2749 + },
1.2750 + is: function( selector ) {
1.2751 + return !!winnow(
1.2752 + this,
1.2753 +
1.2754 + // If this is a positional/relative selector, check membership in the returned set
1.2755 + // so $("p:first").is("p:last") won't return true for a doc with two "p".
1.2756 + typeof selector === "string" && rneedsContext.test( selector ) ?
1.2757 + jQuery( selector ) :
1.2758 + selector || [],
1.2759 + false
1.2760 + ).length;
1.2761 + }
1.2762 +});
1.2763 +
1.2764 +
1.2765 +// Initialize a jQuery object
1.2766 +
1.2767 +
1.2768 +// A central reference to the root jQuery(document)
1.2769 +var rootjQuery,
1.2770 +
1.2771 + // Use the correct document accordingly with window argument (sandbox)
1.2772 + document = window.document,
1.2773 +
1.2774 + // A simple way to check for HTML strings
1.2775 + // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
1.2776 + // Strict HTML recognition (#11290: must start with <)
1.2777 + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
1.2778 +
1.2779 + init = jQuery.fn.init = function( selector, context ) {
1.2780 + var match, elem;
1.2781 +
1.2782 + // HANDLE: $(""), $(null), $(undefined), $(false)
1.2783 + if ( !selector ) {
1.2784 + return this;
1.2785 + }
1.2786 +
1.2787 + // Handle HTML strings
1.2788 + if ( typeof selector === "string" ) {
1.2789 + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
1.2790 + // Assume that strings that start and end with <> are HTML and skip the regex check
1.2791 + match = [ null, selector, null ];
1.2792 +
1.2793 + } else {
1.2794 + match = rquickExpr.exec( selector );
1.2795 + }
1.2796 +
1.2797 + // Match html or make sure no context is specified for #id
1.2798 + if ( match && (match[1] || !context) ) {
1.2799 +
1.2800 + // HANDLE: $(html) -> $(array)
1.2801 + if ( match[1] ) {
1.2802 + context = context instanceof jQuery ? context[0] : context;
1.2803 +
1.2804 + // scripts is true for back-compat
1.2805 + // Intentionally let the error be thrown if parseHTML is not present
1.2806 + jQuery.merge( this, jQuery.parseHTML(
1.2807 + match[1],
1.2808 + context && context.nodeType ? context.ownerDocument || context : document,
1.2809 + true
1.2810 + ) );
1.2811 +
1.2812 + // HANDLE: $(html, props)
1.2813 + if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
1.2814 + for ( match in context ) {
1.2815 + // Properties of context are called as methods if possible
1.2816 + if ( jQuery.isFunction( this[ match ] ) ) {
1.2817 + this[ match ]( context[ match ] );
1.2818 +
1.2819 + // ...and otherwise set as attributes
1.2820 + } else {
1.2821 + this.attr( match, context[ match ] );
1.2822 + }
1.2823 + }
1.2824 + }
1.2825 +
1.2826 + return this;
1.2827 +
1.2828 + // HANDLE: $(#id)
1.2829 + } else {
1.2830 + elem = document.getElementById( match[2] );
1.2831 +
1.2832 + // Check parentNode to catch when Blackberry 4.6 returns
1.2833 + // nodes that are no longer in the document #6963
1.2834 + if ( elem && elem.parentNode ) {
1.2835 + // Handle the case where IE and Opera return items
1.2836 + // by name instead of ID
1.2837 + if ( elem.id !== match[2] ) {
1.2838 + return rootjQuery.find( selector );
1.2839 + }
1.2840 +
1.2841 + // Otherwise, we inject the element directly into the jQuery object
1.2842 + this.length = 1;
1.2843 + this[0] = elem;
1.2844 + }
1.2845 +
1.2846 + this.context = document;
1.2847 + this.selector = selector;
1.2848 + return this;
1.2849 + }
1.2850 +
1.2851 + // HANDLE: $(expr, $(...))
1.2852 + } else if ( !context || context.jquery ) {
1.2853 + return ( context || rootjQuery ).find( selector );
1.2854 +
1.2855 + // HANDLE: $(expr, context)
1.2856 + // (which is just equivalent to: $(context).find(expr)
1.2857 + } else {
1.2858 + return this.constructor( context ).find( selector );
1.2859 + }
1.2860 +
1.2861 + // HANDLE: $(DOMElement)
1.2862 + } else if ( selector.nodeType ) {
1.2863 + this.context = this[0] = selector;
1.2864 + this.length = 1;
1.2865 + return this;
1.2866 +
1.2867 + // HANDLE: $(function)
1.2868 + // Shortcut for document ready
1.2869 + } else if ( jQuery.isFunction( selector ) ) {
1.2870 + return typeof rootjQuery.ready !== "undefined" ?
1.2871 + rootjQuery.ready( selector ) :
1.2872 + // Execute immediately if ready is not present
1.2873 + selector( jQuery );
1.2874 + }
1.2875 +
1.2876 + if ( selector.selector !== undefined ) {
1.2877 + this.selector = selector.selector;
1.2878 + this.context = selector.context;
1.2879 + }
1.2880 +
1.2881 + return jQuery.makeArray( selector, this );
1.2882 + };
1.2883 +
1.2884 +// Give the init function the jQuery prototype for later instantiation
1.2885 +init.prototype = jQuery.fn;
1.2886 +
1.2887 +// Initialize central reference
1.2888 +rootjQuery = jQuery( document );
1.2889 +
1.2890 +
1.2891 +var rparentsprev = /^(?:parents|prev(?:Until|All))/,
1.2892 + // methods guaranteed to produce a unique set when starting from a unique set
1.2893 + guaranteedUnique = {
1.2894 + children: true,
1.2895 + contents: true,
1.2896 + next: true,
1.2897 + prev: true
1.2898 + };
1.2899 +
1.2900 +jQuery.extend({
1.2901 + dir: function( elem, dir, until ) {
1.2902 + var matched = [],
1.2903 + cur = elem[ dir ];
1.2904 +
1.2905 + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
1.2906 + if ( cur.nodeType === 1 ) {
1.2907 + matched.push( cur );
1.2908 + }
1.2909 + cur = cur[dir];
1.2910 + }
1.2911 + return matched;
1.2912 + },
1.2913 +
1.2914 + sibling: function( n, elem ) {
1.2915 + var r = [];
1.2916 +
1.2917 + for ( ; n; n = n.nextSibling ) {
1.2918 + if ( n.nodeType === 1 && n !== elem ) {
1.2919 + r.push( n );
1.2920 + }
1.2921 + }
1.2922 +
1.2923 + return r;
1.2924 + }
1.2925 +});
1.2926 +
1.2927 +jQuery.fn.extend({
1.2928 + has: function( target ) {
1.2929 + var i,
1.2930 + targets = jQuery( target, this ),
1.2931 + len = targets.length;
1.2932 +
1.2933 + return this.filter(function() {
1.2934 + for ( i = 0; i < len; i++ ) {
1.2935 + if ( jQuery.contains( this, targets[i] ) ) {
1.2936 + return true;
1.2937 + }
1.2938 + }
1.2939 + });
1.2940 + },
1.2941 +
1.2942 + closest: function( selectors, context ) {
1.2943 + var cur,
1.2944 + i = 0,
1.2945 + l = this.length,
1.2946 + matched = [],
1.2947 + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
1.2948 + jQuery( selectors, context || this.context ) :
1.2949 + 0;
1.2950 +
1.2951 + for ( ; i < l; i++ ) {
1.2952 + for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
1.2953 + // Always skip document fragments
1.2954 + if ( cur.nodeType < 11 && (pos ?
1.2955 + pos.index(cur) > -1 :
1.2956 +
1.2957 + // Don't pass non-elements to Sizzle
1.2958 + cur.nodeType === 1 &&
1.2959 + jQuery.find.matchesSelector(cur, selectors)) ) {
1.2960 +
1.2961 + matched.push( cur );
1.2962 + break;
1.2963 + }
1.2964 + }
1.2965 + }
1.2966 +
1.2967 + return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
1.2968 + },
1.2969 +
1.2970 + // Determine the position of an element within
1.2971 + // the matched set of elements
1.2972 + index: function( elem ) {
1.2973 +
1.2974 + // No argument, return index in parent
1.2975 + if ( !elem ) {
1.2976 + return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
1.2977 + }
1.2978 +
1.2979 + // index in selector
1.2980 + if ( typeof elem === "string" ) {
1.2981 + return jQuery.inArray( this[0], jQuery( elem ) );
1.2982 + }
1.2983 +
1.2984 + // Locate the position of the desired element
1.2985 + return jQuery.inArray(
1.2986 + // If it receives a jQuery object, the first element is used
1.2987 + elem.jquery ? elem[0] : elem, this );
1.2988 + },
1.2989 +
1.2990 + add: function( selector, context ) {
1.2991 + return this.pushStack(
1.2992 + jQuery.unique(
1.2993 + jQuery.merge( this.get(), jQuery( selector, context ) )
1.2994 + )
1.2995 + );
1.2996 + },
1.2997 +
1.2998 + addBack: function( selector ) {
1.2999 + return this.add( selector == null ?
1.3000 + this.prevObject : this.prevObject.filter(selector)
1.3001 + );
1.3002 + }
1.3003 +});
1.3004 +
1.3005 +function sibling( cur, dir ) {
1.3006 + do {
1.3007 + cur = cur[ dir ];
1.3008 + } while ( cur && cur.nodeType !== 1 );
1.3009 +
1.3010 + return cur;
1.3011 +}
1.3012 +
1.3013 +jQuery.each({
1.3014 + parent: function( elem ) {
1.3015 + var parent = elem.parentNode;
1.3016 + return parent && parent.nodeType !== 11 ? parent : null;
1.3017 + },
1.3018 + parents: function( elem ) {
1.3019 + return jQuery.dir( elem, "parentNode" );
1.3020 + },
1.3021 + parentsUntil: function( elem, i, until ) {
1.3022 + return jQuery.dir( elem, "parentNode", until );
1.3023 + },
1.3024 + next: function( elem ) {
1.3025 + return sibling( elem, "nextSibling" );
1.3026 + },
1.3027 + prev: function( elem ) {
1.3028 + return sibling( elem, "previousSibling" );
1.3029 + },
1.3030 + nextAll: function( elem ) {
1.3031 + return jQuery.dir( elem, "nextSibling" );
1.3032 + },
1.3033 + prevAll: function( elem ) {
1.3034 + return jQuery.dir( elem, "previousSibling" );
1.3035 + },
1.3036 + nextUntil: function( elem, i, until ) {
1.3037 + return jQuery.dir( elem, "nextSibling", until );
1.3038 + },
1.3039 + prevUntil: function( elem, i, until ) {
1.3040 + return jQuery.dir( elem, "previousSibling", until );
1.3041 + },
1.3042 + siblings: function( elem ) {
1.3043 + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
1.3044 + },
1.3045 + children: function( elem ) {
1.3046 + return jQuery.sibling( elem.firstChild );
1.3047 + },
1.3048 + contents: function( elem ) {
1.3049 + return jQuery.nodeName( elem, "iframe" ) ?
1.3050 + elem.contentDocument || elem.contentWindow.document :
1.3051 + jQuery.merge( [], elem.childNodes );
1.3052 + }
1.3053 +}, function( name, fn ) {
1.3054 + jQuery.fn[ name ] = function( until, selector ) {
1.3055 + var ret = jQuery.map( this, fn, until );
1.3056 +
1.3057 + if ( name.slice( -5 ) !== "Until" ) {
1.3058 + selector = until;
1.3059 + }
1.3060 +
1.3061 + if ( selector && typeof selector === "string" ) {
1.3062 + ret = jQuery.filter( selector, ret );
1.3063 + }
1.3064 +
1.3065 + if ( this.length > 1 ) {
1.3066 + // Remove duplicates
1.3067 + if ( !guaranteedUnique[ name ] ) {
1.3068 + ret = jQuery.unique( ret );
1.3069 + }
1.3070 +
1.3071 + // Reverse order for parents* and prev-derivatives
1.3072 + if ( rparentsprev.test( name ) ) {
1.3073 + ret = ret.reverse();
1.3074 + }
1.3075 + }
1.3076 +
1.3077 + return this.pushStack( ret );
1.3078 + };
1.3079 +});
1.3080 +var rnotwhite = (/\S+/g);
1.3081 +
1.3082 +
1.3083 +
1.3084 +// String to Object options format cache
1.3085 +var optionsCache = {};
1.3086 +
1.3087 +// Convert String-formatted options into Object-formatted ones and store in cache
1.3088 +function createOptions( options ) {
1.3089 + var object = optionsCache[ options ] = {};
1.3090 + jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
1.3091 + object[ flag ] = true;
1.3092 + });
1.3093 + return object;
1.3094 +}
1.3095 +
1.3096 +/*
1.3097 + * Create a callback list using the following parameters:
1.3098 + *
1.3099 + * options: an optional list of space-separated options that will change how
1.3100 + * the callback list behaves or a more traditional option object
1.3101 + *
1.3102 + * By default a callback list will act like an event callback list and can be
1.3103 + * "fired" multiple times.
1.3104 + *
1.3105 + * Possible options:
1.3106 + *
1.3107 + * once: will ensure the callback list can only be fired once (like a Deferred)
1.3108 + *
1.3109 + * memory: will keep track of previous values and will call any callback added
1.3110 + * after the list has been fired right away with the latest "memorized"
1.3111 + * values (like a Deferred)
1.3112 + *
1.3113 + * unique: will ensure a callback can only be added once (no duplicate in the list)
1.3114 + *
1.3115 + * stopOnFalse: interrupt callings when a callback returns false
1.3116 + *
1.3117 + */
1.3118 +jQuery.Callbacks = function( options ) {
1.3119 +
1.3120 + // Convert options from String-formatted to Object-formatted if needed
1.3121 + // (we check in cache first)
1.3122 + options = typeof options === "string" ?
1.3123 + ( optionsCache[ options ] || createOptions( options ) ) :
1.3124 + jQuery.extend( {}, options );
1.3125 +
1.3126 + var // Flag to know if list is currently firing
1.3127 + firing,
1.3128 + // Last fire value (for non-forgettable lists)
1.3129 + memory,
1.3130 + // Flag to know if list was already fired
1.3131 + fired,
1.3132 + // End of the loop when firing
1.3133 + firingLength,
1.3134 + // Index of currently firing callback (modified by remove if needed)
1.3135 + firingIndex,
1.3136 + // First callback to fire (used internally by add and fireWith)
1.3137 + firingStart,
1.3138 + // Actual callback list
1.3139 + list = [],
1.3140 + // Stack of fire calls for repeatable lists
1.3141 + stack = !options.once && [],
1.3142 + // Fire callbacks
1.3143 + fire = function( data ) {
1.3144 + memory = options.memory && data;
1.3145 + fired = true;
1.3146 + firingIndex = firingStart || 0;
1.3147 + firingStart = 0;
1.3148 + firingLength = list.length;
1.3149 + firing = true;
1.3150 + for ( ; list && firingIndex < firingLength; firingIndex++ ) {
1.3151 + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
1.3152 + memory = false; // To prevent further calls using add
1.3153 + break;
1.3154 + }
1.3155 + }
1.3156 + firing = false;
1.3157 + if ( list ) {
1.3158 + if ( stack ) {
1.3159 + if ( stack.length ) {
1.3160 + fire( stack.shift() );
1.3161 + }
1.3162 + } else if ( memory ) {
1.3163 + list = [];
1.3164 + } else {
1.3165 + self.disable();
1.3166 + }
1.3167 + }
1.3168 + },
1.3169 + // Actual Callbacks object
1.3170 + self = {
1.3171 + // Add a callback or a collection of callbacks to the list
1.3172 + add: function() {
1.3173 + if ( list ) {
1.3174 + // First, we save the current length
1.3175 + var start = list.length;
1.3176 + (function add( args ) {
1.3177 + jQuery.each( args, function( _, arg ) {
1.3178 + var type = jQuery.type( arg );
1.3179 + if ( type === "function" ) {
1.3180 + if ( !options.unique || !self.has( arg ) ) {
1.3181 + list.push( arg );
1.3182 + }
1.3183 + } else if ( arg && arg.length && type !== "string" ) {
1.3184 + // Inspect recursively
1.3185 + add( arg );
1.3186 + }
1.3187 + });
1.3188 + })( arguments );
1.3189 + // Do we need to add the callbacks to the
1.3190 + // current firing batch?
1.3191 + if ( firing ) {
1.3192 + firingLength = list.length;
1.3193 + // With memory, if we're not firing then
1.3194 + // we should call right away
1.3195 + } else if ( memory ) {
1.3196 + firingStart = start;
1.3197 + fire( memory );
1.3198 + }
1.3199 + }
1.3200 + return this;
1.3201 + },
1.3202 + // Remove a callback from the list
1.3203 + remove: function() {
1.3204 + if ( list ) {
1.3205 + jQuery.each( arguments, function( _, arg ) {
1.3206 + var index;
1.3207 + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
1.3208 + list.splice( index, 1 );
1.3209 + // Handle firing indexes
1.3210 + if ( firing ) {
1.3211 + if ( index <= firingLength ) {
1.3212 + firingLength--;
1.3213 + }
1.3214 + if ( index <= firingIndex ) {
1.3215 + firingIndex--;
1.3216 + }
1.3217 + }
1.3218 + }
1.3219 + });
1.3220 + }
1.3221 + return this;
1.3222 + },
1.3223 + // Check if a given callback is in the list.
1.3224 + // If no argument is given, return whether or not list has callbacks attached.
1.3225 + has: function( fn ) {
1.3226 + return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
1.3227 + },
1.3228 + // Remove all callbacks from the list
1.3229 + empty: function() {
1.3230 + list = [];
1.3231 + firingLength = 0;
1.3232 + return this;
1.3233 + },
1.3234 + // Have the list do nothing anymore
1.3235 + disable: function() {
1.3236 + list = stack = memory = undefined;
1.3237 + return this;
1.3238 + },
1.3239 + // Is it disabled?
1.3240 + disabled: function() {
1.3241 + return !list;
1.3242 + },
1.3243 + // Lock the list in its current state
1.3244 + lock: function() {
1.3245 + stack = undefined;
1.3246 + if ( !memory ) {
1.3247 + self.disable();
1.3248 + }
1.3249 + return this;
1.3250 + },
1.3251 + // Is it locked?
1.3252 + locked: function() {
1.3253 + return !stack;
1.3254 + },
1.3255 + // Call all callbacks with the given context and arguments
1.3256 + fireWith: function( context, args ) {
1.3257 + if ( list && ( !fired || stack ) ) {
1.3258 + args = args || [];
1.3259 + args = [ context, args.slice ? args.slice() : args ];
1.3260 + if ( firing ) {
1.3261 + stack.push( args );
1.3262 + } else {
1.3263 + fire( args );
1.3264 + }
1.3265 + }
1.3266 + return this;
1.3267 + },
1.3268 + // Call all the callbacks with the given arguments
1.3269 + fire: function() {
1.3270 + self.fireWith( this, arguments );
1.3271 + return this;
1.3272 + },
1.3273 + // To know if the callbacks have already been called at least once
1.3274 + fired: function() {
1.3275 + return !!fired;
1.3276 + }
1.3277 + };
1.3278 +
1.3279 + return self;
1.3280 +};
1.3281 +
1.3282 +
1.3283 +jQuery.extend({
1.3284 +
1.3285 + Deferred: function( func ) {
1.3286 + var tuples = [
1.3287 + // action, add listener, listener list, final state
1.3288 + [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
1.3289 + [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
1.3290 + [ "notify", "progress", jQuery.Callbacks("memory") ]
1.3291 + ],
1.3292 + state = "pending",
1.3293 + promise = {
1.3294 + state: function() {
1.3295 + return state;
1.3296 + },
1.3297 + always: function() {
1.3298 + deferred.done( arguments ).fail( arguments );
1.3299 + return this;
1.3300 + },
1.3301 + then: function( /* fnDone, fnFail, fnProgress */ ) {
1.3302 + var fns = arguments;
1.3303 + return jQuery.Deferred(function( newDefer ) {
1.3304 + jQuery.each( tuples, function( i, tuple ) {
1.3305 + var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
1.3306 + // deferred[ done | fail | progress ] for forwarding actions to newDefer
1.3307 + deferred[ tuple[1] ](function() {
1.3308 + var returned = fn && fn.apply( this, arguments );
1.3309 + if ( returned && jQuery.isFunction( returned.promise ) ) {
1.3310 + returned.promise()
1.3311 + .done( newDefer.resolve )
1.3312 + .fail( newDefer.reject )
1.3313 + .progress( newDefer.notify );
1.3314 + } else {
1.3315 + newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
1.3316 + }
1.3317 + });
1.3318 + });
1.3319 + fns = null;
1.3320 + }).promise();
1.3321 + },
1.3322 + // Get a promise for this deferred
1.3323 + // If obj is provided, the promise aspect is added to the object
1.3324 + promise: function( obj ) {
1.3325 + return obj != null ? jQuery.extend( obj, promise ) : promise;
1.3326 + }
1.3327 + },
1.3328 + deferred = {};
1.3329 +
1.3330 + // Keep pipe for back-compat
1.3331 + promise.pipe = promise.then;
1.3332 +
1.3333 + // Add list-specific methods
1.3334 + jQuery.each( tuples, function( i, tuple ) {
1.3335 + var list = tuple[ 2 ],
1.3336 + stateString = tuple[ 3 ];
1.3337 +
1.3338 + // promise[ done | fail | progress ] = list.add
1.3339 + promise[ tuple[1] ] = list.add;
1.3340 +
1.3341 + // Handle state
1.3342 + if ( stateString ) {
1.3343 + list.add(function() {
1.3344 + // state = [ resolved | rejected ]
1.3345 + state = stateString;
1.3346 +
1.3347 + // [ reject_list | resolve_list ].disable; progress_list.lock
1.3348 + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
1.3349 + }
1.3350 +
1.3351 + // deferred[ resolve | reject | notify ]
1.3352 + deferred[ tuple[0] ] = function() {
1.3353 + deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
1.3354 + return this;
1.3355 + };
1.3356 + deferred[ tuple[0] + "With" ] = list.fireWith;
1.3357 + });
1.3358 +
1.3359 + // Make the deferred a promise
1.3360 + promise.promise( deferred );
1.3361 +
1.3362 + // Call given func if any
1.3363 + if ( func ) {
1.3364 + func.call( deferred, deferred );
1.3365 + }
1.3366 +
1.3367 + // All done!
1.3368 + return deferred;
1.3369 + },
1.3370 +
1.3371 + // Deferred helper
1.3372 + when: function( subordinate /* , ..., subordinateN */ ) {
1.3373 + var i = 0,
1.3374 + resolveValues = slice.call( arguments ),
1.3375 + length = resolveValues.length,
1.3376 +
1.3377 + // the count of uncompleted subordinates
1.3378 + remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
1.3379 +
1.3380 + // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
1.3381 + deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
1.3382 +
1.3383 + // Update function for both resolve and progress values
1.3384 + updateFunc = function( i, contexts, values ) {
1.3385 + return function( value ) {
1.3386 + contexts[ i ] = this;
1.3387 + values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
1.3388 + if ( values === progressValues ) {
1.3389 + deferred.notifyWith( contexts, values );
1.3390 +
1.3391 + } else if ( !(--remaining) ) {
1.3392 + deferred.resolveWith( contexts, values );
1.3393 + }
1.3394 + };
1.3395 + },
1.3396 +
1.3397 + progressValues, progressContexts, resolveContexts;
1.3398 +
1.3399 + // add listeners to Deferred subordinates; treat others as resolved
1.3400 + if ( length > 1 ) {
1.3401 + progressValues = new Array( length );
1.3402 + progressContexts = new Array( length );
1.3403 + resolveContexts = new Array( length );
1.3404 + for ( ; i < length; i++ ) {
1.3405 + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
1.3406 + resolveValues[ i ].promise()
1.3407 + .done( updateFunc( i, resolveContexts, resolveValues ) )
1.3408 + .fail( deferred.reject )
1.3409 + .progress( updateFunc( i, progressContexts, progressValues ) );
1.3410 + } else {
1.3411 + --remaining;
1.3412 + }
1.3413 + }
1.3414 + }
1.3415 +
1.3416 + // if we're not waiting on anything, resolve the master
1.3417 + if ( !remaining ) {
1.3418 + deferred.resolveWith( resolveContexts, resolveValues );
1.3419 + }
1.3420 +
1.3421 + return deferred.promise();
1.3422 + }
1.3423 +});
1.3424 +
1.3425 +
1.3426 +// The deferred used on DOM ready
1.3427 +var readyList;
1.3428 +
1.3429 +jQuery.fn.ready = function( fn ) {
1.3430 + // Add the callback
1.3431 + jQuery.ready.promise().done( fn );
1.3432 +
1.3433 + return this;
1.3434 +};
1.3435 +
1.3436 +jQuery.extend({
1.3437 + // Is the DOM ready to be used? Set to true once it occurs.
1.3438 + isReady: false,
1.3439 +
1.3440 + // A counter to track how many items to wait for before
1.3441 + // the ready event fires. See #6781
1.3442 + readyWait: 1,
1.3443 +
1.3444 + // Hold (or release) the ready event
1.3445 + holdReady: function( hold ) {
1.3446 + if ( hold ) {
1.3447 + jQuery.readyWait++;
1.3448 + } else {
1.3449 + jQuery.ready( true );
1.3450 + }
1.3451 + },
1.3452 +
1.3453 + // Handle when the DOM is ready
1.3454 + ready: function( wait ) {
1.3455 +
1.3456 + // Abort if there are pending holds or we're already ready
1.3457 + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
1.3458 + return;
1.3459 + }
1.3460 +
1.3461 + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
1.3462 + if ( !document.body ) {
1.3463 + return setTimeout( jQuery.ready );
1.3464 + }
1.3465 +
1.3466 + // Remember that the DOM is ready
1.3467 + jQuery.isReady = true;
1.3468 +
1.3469 + // If a normal DOM Ready event fired, decrement, and wait if need be
1.3470 + if ( wait !== true && --jQuery.readyWait > 0 ) {
1.3471 + return;
1.3472 + }
1.3473 +
1.3474 + // If there are functions bound, to execute
1.3475 + readyList.resolveWith( document, [ jQuery ] );
1.3476 +
1.3477 + // Trigger any bound ready events
1.3478 + if ( jQuery.fn.triggerHandler ) {
1.3479 + jQuery( document ).triggerHandler( "ready" );
1.3480 + jQuery( document ).off( "ready" );
1.3481 + }
1.3482 + }
1.3483 +});
1.3484 +
1.3485 +/**
1.3486 + * Clean-up method for dom ready events
1.3487 + */
1.3488 +function detach() {
1.3489 + if ( document.addEventListener ) {
1.3490 + document.removeEventListener( "DOMContentLoaded", completed, false );
1.3491 + window.removeEventListener( "load", completed, false );
1.3492 +
1.3493 + } else {
1.3494 + document.detachEvent( "onreadystatechange", completed );
1.3495 + window.detachEvent( "onload", completed );
1.3496 + }
1.3497 +}
1.3498 +
1.3499 +/**
1.3500 + * The ready event handler and self cleanup method
1.3501 + */
1.3502 +function completed() {
1.3503 + // readyState === "complete" is good enough for us to call the dom ready in oldIE
1.3504 + if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
1.3505 + detach();
1.3506 + jQuery.ready();
1.3507 + }
1.3508 +}
1.3509 +
1.3510 +jQuery.ready.promise = function( obj ) {
1.3511 + if ( !readyList ) {
1.3512 +
1.3513 + readyList = jQuery.Deferred();
1.3514 +
1.3515 + // Catch cases where $(document).ready() is called after the browser event has already occurred.
1.3516 + // we once tried to use readyState "interactive" here, but it caused issues like the one
1.3517 + // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
1.3518 + if ( document.readyState === "complete" ) {
1.3519 + // Handle it asynchronously to allow scripts the opportunity to delay ready
1.3520 + setTimeout( jQuery.ready );
1.3521 +
1.3522 + // Standards-based browsers support DOMContentLoaded
1.3523 + } else if ( document.addEventListener ) {
1.3524 + // Use the handy event callback
1.3525 + document.addEventListener( "DOMContentLoaded", completed, false );
1.3526 +
1.3527 + // A fallback to window.onload, that will always work
1.3528 + window.addEventListener( "load", completed, false );
1.3529 +
1.3530 + // If IE event model is used
1.3531 + } else {
1.3532 + // Ensure firing before onload, maybe late but safe also for iframes
1.3533 + document.attachEvent( "onreadystatechange", completed );
1.3534 +
1.3535 + // A fallback to window.onload, that will always work
1.3536 + window.attachEvent( "onload", completed );
1.3537 +
1.3538 + // If IE and not a frame
1.3539 + // continually check to see if the document is ready
1.3540 + var top = false;
1.3541 +
1.3542 + try {
1.3543 + top = window.frameElement == null && document.documentElement;
1.3544 + } catch(e) {}
1.3545 +
1.3546 + if ( top && top.doScroll ) {
1.3547 + (function doScrollCheck() {
1.3548 + if ( !jQuery.isReady ) {
1.3549 +
1.3550 + try {
1.3551 + // Use the trick by Diego Perini
1.3552 + // http://javascript.nwbox.com/IEContentLoaded/
1.3553 + top.doScroll("left");
1.3554 + } catch(e) {
1.3555 + return setTimeout( doScrollCheck, 50 );
1.3556 + }
1.3557 +
1.3558 + // detach all dom ready events
1.3559 + detach();
1.3560 +
1.3561 + // and execute any waiting functions
1.3562 + jQuery.ready();
1.3563 + }
1.3564 + })();
1.3565 + }
1.3566 + }
1.3567 + }
1.3568 + return readyList.promise( obj );
1.3569 +};
1.3570 +
1.3571 +
1.3572 +var strundefined = typeof undefined;
1.3573 +
1.3574 +
1.3575 +
1.3576 +// Support: IE<9
1.3577 +// Iteration over object's inherited properties before its own
1.3578 +var i;
1.3579 +for ( i in jQuery( support ) ) {
1.3580 + break;
1.3581 +}
1.3582 +support.ownLast = i !== "0";
1.3583 +
1.3584 +// Note: most support tests are defined in their respective modules.
1.3585 +// false until the test is run
1.3586 +support.inlineBlockNeedsLayout = false;
1.3587 +
1.3588 +// Execute ASAP in case we need to set body.style.zoom
1.3589 +jQuery(function() {
1.3590 + // Minified: var a,b,c,d
1.3591 + var val, div, body, container;
1.3592 +
1.3593 + body = document.getElementsByTagName( "body" )[ 0 ];
1.3594 + if ( !body || !body.style ) {
1.3595 + // Return for frameset docs that don't have a body
1.3596 + return;
1.3597 + }
1.3598 +
1.3599 + // Setup
1.3600 + div = document.createElement( "div" );
1.3601 + container = document.createElement( "div" );
1.3602 + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
1.3603 + body.appendChild( container ).appendChild( div );
1.3604 +
1.3605 + if ( typeof div.style.zoom !== strundefined ) {
1.3606 + // Support: IE<8
1.3607 + // Check if natively block-level elements act like inline-block
1.3608 + // elements when setting their display to 'inline' and giving
1.3609 + // them layout
1.3610 + div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
1.3611 +
1.3612 + support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
1.3613 + if ( val ) {
1.3614 + // Prevent IE 6 from affecting layout for positioned elements #11048
1.3615 + // Prevent IE from shrinking the body in IE 7 mode #12869
1.3616 + // Support: IE<8
1.3617 + body.style.zoom = 1;
1.3618 + }
1.3619 + }
1.3620 +
1.3621 + body.removeChild( container );
1.3622 +});
1.3623 +
1.3624 +
1.3625 +
1.3626 +
1.3627 +(function() {
1.3628 + var div = document.createElement( "div" );
1.3629 +
1.3630 + // Execute the test only if not already executed in another module.
1.3631 + if (support.deleteExpando == null) {
1.3632 + // Support: IE<9
1.3633 + support.deleteExpando = true;
1.3634 + try {
1.3635 + delete div.test;
1.3636 + } catch( e ) {
1.3637 + support.deleteExpando = false;
1.3638 + }
1.3639 + }
1.3640 +
1.3641 + // Null elements to avoid leaks in IE.
1.3642 + div = null;
1.3643 +})();
1.3644 +
1.3645 +
1.3646 +/**
1.3647 + * Determines whether an object can have data
1.3648 + */
1.3649 +jQuery.acceptData = function( elem ) {
1.3650 + var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
1.3651 + nodeType = +elem.nodeType || 1;
1.3652 +
1.3653 + // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
1.3654 + return nodeType !== 1 && nodeType !== 9 ?
1.3655 + false :
1.3656 +
1.3657 + // Nodes accept data unless otherwise specified; rejection can be conditional
1.3658 + !noData || noData !== true && elem.getAttribute("classid") === noData;
1.3659 +};
1.3660 +
1.3661 +
1.3662 +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
1.3663 + rmultiDash = /([A-Z])/g;
1.3664 +
1.3665 +function dataAttr( elem, key, data ) {
1.3666 + // If nothing was found internally, try to fetch any
1.3667 + // data from the HTML5 data-* attribute
1.3668 + if ( data === undefined && elem.nodeType === 1 ) {
1.3669 +
1.3670 + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
1.3671 +
1.3672 + data = elem.getAttribute( name );
1.3673 +
1.3674 + if ( typeof data === "string" ) {
1.3675 + try {
1.3676 + data = data === "true" ? true :
1.3677 + data === "false" ? false :
1.3678 + data === "null" ? null :
1.3679 + // Only convert to a number if it doesn't change the string
1.3680 + +data + "" === data ? +data :
1.3681 + rbrace.test( data ) ? jQuery.parseJSON( data ) :
1.3682 + data;
1.3683 + } catch( e ) {}
1.3684 +
1.3685 + // Make sure we set the data so it isn't changed later
1.3686 + jQuery.data( elem, key, data );
1.3687 +
1.3688 + } else {
1.3689 + data = undefined;
1.3690 + }
1.3691 + }
1.3692 +
1.3693 + return data;
1.3694 +}
1.3695 +
1.3696 +// checks a cache object for emptiness
1.3697 +function isEmptyDataObject( obj ) {
1.3698 + var name;
1.3699 + for ( name in obj ) {
1.3700 +
1.3701 + // if the public data object is empty, the private is still empty
1.3702 + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
1.3703 + continue;
1.3704 + }
1.3705 + if ( name !== "toJSON" ) {
1.3706 + return false;
1.3707 + }
1.3708 + }
1.3709 +
1.3710 + return true;
1.3711 +}
1.3712 +
1.3713 +function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
1.3714 + if ( !jQuery.acceptData( elem ) ) {
1.3715 + return;
1.3716 + }
1.3717 +
1.3718 + var ret, thisCache,
1.3719 + internalKey = jQuery.expando,
1.3720 +
1.3721 + // We have to handle DOM nodes and JS objects differently because IE6-7
1.3722 + // can't GC object references properly across the DOM-JS boundary
1.3723 + isNode = elem.nodeType,
1.3724 +
1.3725 + // Only DOM nodes need the global jQuery cache; JS object data is
1.3726 + // attached directly to the object so GC can occur automatically
1.3727 + cache = isNode ? jQuery.cache : elem,
1.3728 +
1.3729 + // Only defining an ID for JS objects if its cache already exists allows
1.3730 + // the code to shortcut on the same path as a DOM node with no cache
1.3731 + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
1.3732 +
1.3733 + // Avoid doing any more work than we need to when trying to get data on an
1.3734 + // object that has no data at all
1.3735 + if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
1.3736 + return;
1.3737 + }
1.3738 +
1.3739 + if ( !id ) {
1.3740 + // Only DOM nodes need a new unique ID for each element since their data
1.3741 + // ends up in the global cache
1.3742 + if ( isNode ) {
1.3743 + id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
1.3744 + } else {
1.3745 + id = internalKey;
1.3746 + }
1.3747 + }
1.3748 +
1.3749 + if ( !cache[ id ] ) {
1.3750 + // Avoid exposing jQuery metadata on plain JS objects when the object
1.3751 + // is serialized using JSON.stringify
1.3752 + cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
1.3753 + }
1.3754 +
1.3755 + // An object can be passed to jQuery.data instead of a key/value pair; this gets
1.3756 + // shallow copied over onto the existing cache
1.3757 + if ( typeof name === "object" || typeof name === "function" ) {
1.3758 + if ( pvt ) {
1.3759 + cache[ id ] = jQuery.extend( cache[ id ], name );
1.3760 + } else {
1.3761 + cache[ id ].data = jQuery.extend( cache[ id ].data, name );
1.3762 + }
1.3763 + }
1.3764 +
1.3765 + thisCache = cache[ id ];
1.3766 +
1.3767 + // jQuery data() is stored in a separate object inside the object's internal data
1.3768 + // cache in order to avoid key collisions between internal data and user-defined
1.3769 + // data.
1.3770 + if ( !pvt ) {
1.3771 + if ( !thisCache.data ) {
1.3772 + thisCache.data = {};
1.3773 + }
1.3774 +
1.3775 + thisCache = thisCache.data;
1.3776 + }
1.3777 +
1.3778 + if ( data !== undefined ) {
1.3779 + thisCache[ jQuery.camelCase( name ) ] = data;
1.3780 + }
1.3781 +
1.3782 + // Check for both converted-to-camel and non-converted data property names
1.3783 + // If a data property was specified
1.3784 + if ( typeof name === "string" ) {
1.3785 +
1.3786 + // First Try to find as-is property data
1.3787 + ret = thisCache[ name ];
1.3788 +
1.3789 + // Test for null|undefined property data
1.3790 + if ( ret == null ) {
1.3791 +
1.3792 + // Try to find the camelCased property
1.3793 + ret = thisCache[ jQuery.camelCase( name ) ];
1.3794 + }
1.3795 + } else {
1.3796 + ret = thisCache;
1.3797 + }
1.3798 +
1.3799 + return ret;
1.3800 +}
1.3801 +
1.3802 +function internalRemoveData( elem, name, pvt ) {
1.3803 + if ( !jQuery.acceptData( elem ) ) {
1.3804 + return;
1.3805 + }
1.3806 +
1.3807 + var thisCache, i,
1.3808 + isNode = elem.nodeType,
1.3809 +
1.3810 + // See jQuery.data for more information
1.3811 + cache = isNode ? jQuery.cache : elem,
1.3812 + id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
1.3813 +
1.3814 + // If there is already no cache entry for this object, there is no
1.3815 + // purpose in continuing
1.3816 + if ( !cache[ id ] ) {
1.3817 + return;
1.3818 + }
1.3819 +
1.3820 + if ( name ) {
1.3821 +
1.3822 + thisCache = pvt ? cache[ id ] : cache[ id ].data;
1.3823 +
1.3824 + if ( thisCache ) {
1.3825 +
1.3826 + // Support array or space separated string names for data keys
1.3827 + if ( !jQuery.isArray( name ) ) {
1.3828 +
1.3829 + // try the string as a key before any manipulation
1.3830 + if ( name in thisCache ) {
1.3831 + name = [ name ];
1.3832 + } else {
1.3833 +
1.3834 + // split the camel cased version by spaces unless a key with the spaces exists
1.3835 + name = jQuery.camelCase( name );
1.3836 + if ( name in thisCache ) {
1.3837 + name = [ name ];
1.3838 + } else {
1.3839 + name = name.split(" ");
1.3840 + }
1.3841 + }
1.3842 + } else {
1.3843 + // If "name" is an array of keys...
1.3844 + // When data is initially created, via ("key", "val") signature,
1.3845 + // keys will be converted to camelCase.
1.3846 + // Since there is no way to tell _how_ a key was added, remove
1.3847 + // both plain key and camelCase key. #12786
1.3848 + // This will only penalize the array argument path.
1.3849 + name = name.concat( jQuery.map( name, jQuery.camelCase ) );
1.3850 + }
1.3851 +
1.3852 + i = name.length;
1.3853 + while ( i-- ) {
1.3854 + delete thisCache[ name[i] ];
1.3855 + }
1.3856 +
1.3857 + // If there is no data left in the cache, we want to continue
1.3858 + // and let the cache object itself get destroyed
1.3859 + if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
1.3860 + return;
1.3861 + }
1.3862 + }
1.3863 + }
1.3864 +
1.3865 + // See jQuery.data for more information
1.3866 + if ( !pvt ) {
1.3867 + delete cache[ id ].data;
1.3868 +
1.3869 + // Don't destroy the parent cache unless the internal data object
1.3870 + // had been the only thing left in it
1.3871 + if ( !isEmptyDataObject( cache[ id ] ) ) {
1.3872 + return;
1.3873 + }
1.3874 + }
1.3875 +
1.3876 + // Destroy the cache
1.3877 + if ( isNode ) {
1.3878 + jQuery.cleanData( [ elem ], true );
1.3879 +
1.3880 + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
1.3881 + /* jshint eqeqeq: false */
1.3882 + } else if ( support.deleteExpando || cache != cache.window ) {
1.3883 + /* jshint eqeqeq: true */
1.3884 + delete cache[ id ];
1.3885 +
1.3886 + // When all else fails, null
1.3887 + } else {
1.3888 + cache[ id ] = null;
1.3889 + }
1.3890 +}
1.3891 +
1.3892 +jQuery.extend({
1.3893 + cache: {},
1.3894 +
1.3895 + // The following elements (space-suffixed to avoid Object.prototype collisions)
1.3896 + // throw uncatchable exceptions if you attempt to set expando properties
1.3897 + noData: {
1.3898 + "applet ": true,
1.3899 + "embed ": true,
1.3900 + // ...but Flash objects (which have this classid) *can* handle expandos
1.3901 + "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
1.3902 + },
1.3903 +
1.3904 + hasData: function( elem ) {
1.3905 + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
1.3906 + return !!elem && !isEmptyDataObject( elem );
1.3907 + },
1.3908 +
1.3909 + data: function( elem, name, data ) {
1.3910 + return internalData( elem, name, data );
1.3911 + },
1.3912 +
1.3913 + removeData: function( elem, name ) {
1.3914 + return internalRemoveData( elem, name );
1.3915 + },
1.3916 +
1.3917 + // For internal use only.
1.3918 + _data: function( elem, name, data ) {
1.3919 + return internalData( elem, name, data, true );
1.3920 + },
1.3921 +
1.3922 + _removeData: function( elem, name ) {
1.3923 + return internalRemoveData( elem, name, true );
1.3924 + }
1.3925 +});
1.3926 +
1.3927 +jQuery.fn.extend({
1.3928 + data: function( key, value ) {
1.3929 + var i, name, data,
1.3930 + elem = this[0],
1.3931 + attrs = elem && elem.attributes;
1.3932 +
1.3933 + // Special expections of .data basically thwart jQuery.access,
1.3934 + // so implement the relevant behavior ourselves
1.3935 +
1.3936 + // Gets all values
1.3937 + if ( key === undefined ) {
1.3938 + if ( this.length ) {
1.3939 + data = jQuery.data( elem );
1.3940 +
1.3941 + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
1.3942 + i = attrs.length;
1.3943 + while ( i-- ) {
1.3944 +
1.3945 + // Support: IE11+
1.3946 + // The attrs elements can be null (#14894)
1.3947 + if ( attrs[ i ] ) {
1.3948 + name = attrs[ i ].name;
1.3949 + if ( name.indexOf( "data-" ) === 0 ) {
1.3950 + name = jQuery.camelCase( name.slice(5) );
1.3951 + dataAttr( elem, name, data[ name ] );
1.3952 + }
1.3953 + }
1.3954 + }
1.3955 + jQuery._data( elem, "parsedAttrs", true );
1.3956 + }
1.3957 + }
1.3958 +
1.3959 + return data;
1.3960 + }
1.3961 +
1.3962 + // Sets multiple values
1.3963 + if ( typeof key === "object" ) {
1.3964 + return this.each(function() {
1.3965 + jQuery.data( this, key );
1.3966 + });
1.3967 + }
1.3968 +
1.3969 + return arguments.length > 1 ?
1.3970 +
1.3971 + // Sets one value
1.3972 + this.each(function() {
1.3973 + jQuery.data( this, key, value );
1.3974 + }) :
1.3975 +
1.3976 + // Gets one value
1.3977 + // Try to fetch any internally stored data first
1.3978 + elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
1.3979 + },
1.3980 +
1.3981 + removeData: function( key ) {
1.3982 + return this.each(function() {
1.3983 + jQuery.removeData( this, key );
1.3984 + });
1.3985 + }
1.3986 +});
1.3987 +
1.3988 +
1.3989 +jQuery.extend({
1.3990 + queue: function( elem, type, data ) {
1.3991 + var queue;
1.3992 +
1.3993 + if ( elem ) {
1.3994 + type = ( type || "fx" ) + "queue";
1.3995 + queue = jQuery._data( elem, type );
1.3996 +
1.3997 + // Speed up dequeue by getting out quickly if this is just a lookup
1.3998 + if ( data ) {
1.3999 + if ( !queue || jQuery.isArray(data) ) {
1.4000 + queue = jQuery._data( elem, type, jQuery.makeArray(data) );
1.4001 + } else {
1.4002 + queue.push( data );
1.4003 + }
1.4004 + }
1.4005 + return queue || [];
1.4006 + }
1.4007 + },
1.4008 +
1.4009 + dequeue: function( elem, type ) {
1.4010 + type = type || "fx";
1.4011 +
1.4012 + var queue = jQuery.queue( elem, type ),
1.4013 + startLength = queue.length,
1.4014 + fn = queue.shift(),
1.4015 + hooks = jQuery._queueHooks( elem, type ),
1.4016 + next = function() {
1.4017 + jQuery.dequeue( elem, type );
1.4018 + };
1.4019 +
1.4020 + // If the fx queue is dequeued, always remove the progress sentinel
1.4021 + if ( fn === "inprogress" ) {
1.4022 + fn = queue.shift();
1.4023 + startLength--;
1.4024 + }
1.4025 +
1.4026 + if ( fn ) {
1.4027 +
1.4028 + // Add a progress sentinel to prevent the fx queue from being
1.4029 + // automatically dequeued
1.4030 + if ( type === "fx" ) {
1.4031 + queue.unshift( "inprogress" );
1.4032 + }
1.4033 +
1.4034 + // clear up the last queue stop function
1.4035 + delete hooks.stop;
1.4036 + fn.call( elem, next, hooks );
1.4037 + }
1.4038 +
1.4039 + if ( !startLength && hooks ) {
1.4040 + hooks.empty.fire();
1.4041 + }
1.4042 + },
1.4043 +
1.4044 + // not intended for public consumption - generates a queueHooks object, or returns the current one
1.4045 + _queueHooks: function( elem, type ) {
1.4046 + var key = type + "queueHooks";
1.4047 + return jQuery._data( elem, key ) || jQuery._data( elem, key, {
1.4048 + empty: jQuery.Callbacks("once memory").add(function() {
1.4049 + jQuery._removeData( elem, type + "queue" );
1.4050 + jQuery._removeData( elem, key );
1.4051 + })
1.4052 + });
1.4053 + }
1.4054 +});
1.4055 +
1.4056 +jQuery.fn.extend({
1.4057 + queue: function( type, data ) {
1.4058 + var setter = 2;
1.4059 +
1.4060 + if ( typeof type !== "string" ) {
1.4061 + data = type;
1.4062 + type = "fx";
1.4063 + setter--;
1.4064 + }
1.4065 +
1.4066 + if ( arguments.length < setter ) {
1.4067 + return jQuery.queue( this[0], type );
1.4068 + }
1.4069 +
1.4070 + return data === undefined ?
1.4071 + this :
1.4072 + this.each(function() {
1.4073 + var queue = jQuery.queue( this, type, data );
1.4074 +
1.4075 + // ensure a hooks for this queue
1.4076 + jQuery._queueHooks( this, type );
1.4077 +
1.4078 + if ( type === "fx" && queue[0] !== "inprogress" ) {
1.4079 + jQuery.dequeue( this, type );
1.4080 + }
1.4081 + });
1.4082 + },
1.4083 + dequeue: function( type ) {
1.4084 + return this.each(function() {
1.4085 + jQuery.dequeue( this, type );
1.4086 + });
1.4087 + },
1.4088 + clearQueue: function( type ) {
1.4089 + return this.queue( type || "fx", [] );
1.4090 + },
1.4091 + // Get a promise resolved when queues of a certain type
1.4092 + // are emptied (fx is the type by default)
1.4093 + promise: function( type, obj ) {
1.4094 + var tmp,
1.4095 + count = 1,
1.4096 + defer = jQuery.Deferred(),
1.4097 + elements = this,
1.4098 + i = this.length,
1.4099 + resolve = function() {
1.4100 + if ( !( --count ) ) {
1.4101 + defer.resolveWith( elements, [ elements ] );
1.4102 + }
1.4103 + };
1.4104 +
1.4105 + if ( typeof type !== "string" ) {
1.4106 + obj = type;
1.4107 + type = undefined;
1.4108 + }
1.4109 + type = type || "fx";
1.4110 +
1.4111 + while ( i-- ) {
1.4112 + tmp = jQuery._data( elements[ i ], type + "queueHooks" );
1.4113 + if ( tmp && tmp.empty ) {
1.4114 + count++;
1.4115 + tmp.empty.add( resolve );
1.4116 + }
1.4117 + }
1.4118 + resolve();
1.4119 + return defer.promise( obj );
1.4120 + }
1.4121 +});
1.4122 +var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
1.4123 +
1.4124 +var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
1.4125 +
1.4126 +var isHidden = function( elem, el ) {
1.4127 + // isHidden might be called from jQuery#filter function;
1.4128 + // in that case, element will be second argument
1.4129 + elem = el || elem;
1.4130 + return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
1.4131 + };
1.4132 +
1.4133 +
1.4134 +
1.4135 +// Multifunctional method to get and set values of a collection
1.4136 +// The value/s can optionally be executed if it's a function
1.4137 +var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
1.4138 + var i = 0,
1.4139 + length = elems.length,
1.4140 + bulk = key == null;
1.4141 +
1.4142 + // Sets many values
1.4143 + if ( jQuery.type( key ) === "object" ) {
1.4144 + chainable = true;
1.4145 + for ( i in key ) {
1.4146 + jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
1.4147 + }
1.4148 +
1.4149 + // Sets one value
1.4150 + } else if ( value !== undefined ) {
1.4151 + chainable = true;
1.4152 +
1.4153 + if ( !jQuery.isFunction( value ) ) {
1.4154 + raw = true;
1.4155 + }
1.4156 +
1.4157 + if ( bulk ) {
1.4158 + // Bulk operations run against the entire set
1.4159 + if ( raw ) {
1.4160 + fn.call( elems, value );
1.4161 + fn = null;
1.4162 +
1.4163 + // ...except when executing function values
1.4164 + } else {
1.4165 + bulk = fn;
1.4166 + fn = function( elem, key, value ) {
1.4167 + return bulk.call( jQuery( elem ), value );
1.4168 + };
1.4169 + }
1.4170 + }
1.4171 +
1.4172 + if ( fn ) {
1.4173 + for ( ; i < length; i++ ) {
1.4174 + fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
1.4175 + }
1.4176 + }
1.4177 + }
1.4178 +
1.4179 + return chainable ?
1.4180 + elems :
1.4181 +
1.4182 + // Gets
1.4183 + bulk ?
1.4184 + fn.call( elems ) :
1.4185 + length ? fn( elems[0], key ) : emptyGet;
1.4186 +};
1.4187 +var rcheckableType = (/^(?:checkbox|radio)$/i);
1.4188 +
1.4189 +
1.4190 +
1.4191 +(function() {
1.4192 + // Minified: var a,b,c
1.4193 + var input = document.createElement( "input" ),
1.4194 + div = document.createElement( "div" ),
1.4195 + fragment = document.createDocumentFragment();
1.4196 +
1.4197 + // Setup
1.4198 + div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
1.4199 +
1.4200 + // IE strips leading whitespace when .innerHTML is used
1.4201 + support.leadingWhitespace = div.firstChild.nodeType === 3;
1.4202 +
1.4203 + // Make sure that tbody elements aren't automatically inserted
1.4204 + // IE will insert them into empty tables
1.4205 + support.tbody = !div.getElementsByTagName( "tbody" ).length;
1.4206 +
1.4207 + // Make sure that link elements get serialized correctly by innerHTML
1.4208 + // This requires a wrapper element in IE
1.4209 + support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
1.4210 +
1.4211 + // Makes sure cloning an html5 element does not cause problems
1.4212 + // Where outerHTML is undefined, this still works
1.4213 + support.html5Clone =
1.4214 + document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
1.4215 +
1.4216 + // Check if a disconnected checkbox will retain its checked
1.4217 + // value of true after appended to the DOM (IE6/7)
1.4218 + input.type = "checkbox";
1.4219 + input.checked = true;
1.4220 + fragment.appendChild( input );
1.4221 + support.appendChecked = input.checked;
1.4222 +
1.4223 + // Make sure textarea (and checkbox) defaultValue is properly cloned
1.4224 + // Support: IE6-IE11+
1.4225 + div.innerHTML = "<textarea>x</textarea>";
1.4226 + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
1.4227 +
1.4228 + // #11217 - WebKit loses check when the name is after the checked attribute
1.4229 + fragment.appendChild( div );
1.4230 + div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
1.4231 +
1.4232 + // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
1.4233 + // old WebKit doesn't clone checked state correctly in fragments
1.4234 + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
1.4235 +
1.4236 + // Support: IE<9
1.4237 + // Opera does not clone events (and typeof div.attachEvent === undefined).
1.4238 + // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
1.4239 + support.noCloneEvent = true;
1.4240 + if ( div.attachEvent ) {
1.4241 + div.attachEvent( "onclick", function() {
1.4242 + support.noCloneEvent = false;
1.4243 + });
1.4244 +
1.4245 + div.cloneNode( true ).click();
1.4246 + }
1.4247 +
1.4248 + // Execute the test only if not already executed in another module.
1.4249 + if (support.deleteExpando == null) {
1.4250 + // Support: IE<9
1.4251 + support.deleteExpando = true;
1.4252 + try {
1.4253 + delete div.test;
1.4254 + } catch( e ) {
1.4255 + support.deleteExpando = false;
1.4256 + }
1.4257 + }
1.4258 +})();
1.4259 +
1.4260 +
1.4261 +(function() {
1.4262 + var i, eventName,
1.4263 + div = document.createElement( "div" );
1.4264 +
1.4265 + // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
1.4266 + for ( i in { submit: true, change: true, focusin: true }) {
1.4267 + eventName = "on" + i;
1.4268 +
1.4269 + if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
1.4270 + // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
1.4271 + div.setAttribute( eventName, "t" );
1.4272 + support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
1.4273 + }
1.4274 + }
1.4275 +
1.4276 + // Null elements to avoid leaks in IE.
1.4277 + div = null;
1.4278 +})();
1.4279 +
1.4280 +
1.4281 +var rformElems = /^(?:input|select|textarea)$/i,
1.4282 + rkeyEvent = /^key/,
1.4283 + rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
1.4284 + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
1.4285 + rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
1.4286 +
1.4287 +function returnTrue() {
1.4288 + return true;
1.4289 +}
1.4290 +
1.4291 +function returnFalse() {
1.4292 + return false;
1.4293 +}
1.4294 +
1.4295 +function safeActiveElement() {
1.4296 + try {
1.4297 + return document.activeElement;
1.4298 + } catch ( err ) { }
1.4299 +}
1.4300 +
1.4301 +/*
1.4302 + * Helper functions for managing events -- not part of the public interface.
1.4303 + * Props to Dean Edwards' addEvent library for many of the ideas.
1.4304 + */
1.4305 +jQuery.event = {
1.4306 +
1.4307 + global: {},
1.4308 +
1.4309 + add: function( elem, types, handler, data, selector ) {
1.4310 + var tmp, events, t, handleObjIn,
1.4311 + special, eventHandle, handleObj,
1.4312 + handlers, type, namespaces, origType,
1.4313 + elemData = jQuery._data( elem );
1.4314 +
1.4315 + // Don't attach events to noData or text/comment nodes (but allow plain objects)
1.4316 + if ( !elemData ) {
1.4317 + return;
1.4318 + }
1.4319 +
1.4320 + // Caller can pass in an object of custom data in lieu of the handler
1.4321 + if ( handler.handler ) {
1.4322 + handleObjIn = handler;
1.4323 + handler = handleObjIn.handler;
1.4324 + selector = handleObjIn.selector;
1.4325 + }
1.4326 +
1.4327 + // Make sure that the handler has a unique ID, used to find/remove it later
1.4328 + if ( !handler.guid ) {
1.4329 + handler.guid = jQuery.guid++;
1.4330 + }
1.4331 +
1.4332 + // Init the element's event structure and main handler, if this is the first
1.4333 + if ( !(events = elemData.events) ) {
1.4334 + events = elemData.events = {};
1.4335 + }
1.4336 + if ( !(eventHandle = elemData.handle) ) {
1.4337 + eventHandle = elemData.handle = function( e ) {
1.4338 + // Discard the second event of a jQuery.event.trigger() and
1.4339 + // when an event is called after a page has unloaded
1.4340 + return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
1.4341 + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
1.4342 + undefined;
1.4343 + };
1.4344 + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
1.4345 + eventHandle.elem = elem;
1.4346 + }
1.4347 +
1.4348 + // Handle multiple events separated by a space
1.4349 + types = ( types || "" ).match( rnotwhite ) || [ "" ];
1.4350 + t = types.length;
1.4351 + while ( t-- ) {
1.4352 + tmp = rtypenamespace.exec( types[t] ) || [];
1.4353 + type = origType = tmp[1];
1.4354 + namespaces = ( tmp[2] || "" ).split( "." ).sort();
1.4355 +
1.4356 + // There *must* be a type, no attaching namespace-only handlers
1.4357 + if ( !type ) {
1.4358 + continue;
1.4359 + }
1.4360 +
1.4361 + // If event changes its type, use the special event handlers for the changed type
1.4362 + special = jQuery.event.special[ type ] || {};
1.4363 +
1.4364 + // If selector defined, determine special event api type, otherwise given type
1.4365 + type = ( selector ? special.delegateType : special.bindType ) || type;
1.4366 +
1.4367 + // Update special based on newly reset type
1.4368 + special = jQuery.event.special[ type ] || {};
1.4369 +
1.4370 + // handleObj is passed to all event handlers
1.4371 + handleObj = jQuery.extend({
1.4372 + type: type,
1.4373 + origType: origType,
1.4374 + data: data,
1.4375 + handler: handler,
1.4376 + guid: handler.guid,
1.4377 + selector: selector,
1.4378 + needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
1.4379 + namespace: namespaces.join(".")
1.4380 + }, handleObjIn );
1.4381 +
1.4382 + // Init the event handler queue if we're the first
1.4383 + if ( !(handlers = events[ type ]) ) {
1.4384 + handlers = events[ type ] = [];
1.4385 + handlers.delegateCount = 0;
1.4386 +
1.4387 + // Only use addEventListener/attachEvent if the special events handler returns false
1.4388 + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
1.4389 + // Bind the global event handler to the element
1.4390 + if ( elem.addEventListener ) {
1.4391 + elem.addEventListener( type, eventHandle, false );
1.4392 +
1.4393 + } else if ( elem.attachEvent ) {
1.4394 + elem.attachEvent( "on" + type, eventHandle );
1.4395 + }
1.4396 + }
1.4397 + }
1.4398 +
1.4399 + if ( special.add ) {
1.4400 + special.add.call( elem, handleObj );
1.4401 +
1.4402 + if ( !handleObj.handler.guid ) {
1.4403 + handleObj.handler.guid = handler.guid;
1.4404 + }
1.4405 + }
1.4406 +
1.4407 + // Add to the element's handler list, delegates in front
1.4408 + if ( selector ) {
1.4409 + handlers.splice( handlers.delegateCount++, 0, handleObj );
1.4410 + } else {
1.4411 + handlers.push( handleObj );
1.4412 + }
1.4413 +
1.4414 + // Keep track of which events have ever been used, for event optimization
1.4415 + jQuery.event.global[ type ] = true;
1.4416 + }
1.4417 +
1.4418 + // Nullify elem to prevent memory leaks in IE
1.4419 + elem = null;
1.4420 + },
1.4421 +
1.4422 + // Detach an event or set of events from an element
1.4423 + remove: function( elem, types, handler, selector, mappedTypes ) {
1.4424 + var j, handleObj, tmp,
1.4425 + origCount, t, events,
1.4426 + special, handlers, type,
1.4427 + namespaces, origType,
1.4428 + elemData = jQuery.hasData( elem ) && jQuery._data( elem );
1.4429 +
1.4430 + if ( !elemData || !(events = elemData.events) ) {
1.4431 + return;
1.4432 + }
1.4433 +
1.4434 + // Once for each type.namespace in types; type may be omitted
1.4435 + types = ( types || "" ).match( rnotwhite ) || [ "" ];
1.4436 + t = types.length;
1.4437 + while ( t-- ) {
1.4438 + tmp = rtypenamespace.exec( types[t] ) || [];
1.4439 + type = origType = tmp[1];
1.4440 + namespaces = ( tmp[2] || "" ).split( "." ).sort();
1.4441 +
1.4442 + // Unbind all events (on this namespace, if provided) for the element
1.4443 + if ( !type ) {
1.4444 + for ( type in events ) {
1.4445 + jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
1.4446 + }
1.4447 + continue;
1.4448 + }
1.4449 +
1.4450 + special = jQuery.event.special[ type ] || {};
1.4451 + type = ( selector ? special.delegateType : special.bindType ) || type;
1.4452 + handlers = events[ type ] || [];
1.4453 + tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
1.4454 +
1.4455 + // Remove matching events
1.4456 + origCount = j = handlers.length;
1.4457 + while ( j-- ) {
1.4458 + handleObj = handlers[ j ];
1.4459 +
1.4460 + if ( ( mappedTypes || origType === handleObj.origType ) &&
1.4461 + ( !handler || handler.guid === handleObj.guid ) &&
1.4462 + ( !tmp || tmp.test( handleObj.namespace ) ) &&
1.4463 + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
1.4464 + handlers.splice( j, 1 );
1.4465 +
1.4466 + if ( handleObj.selector ) {
1.4467 + handlers.delegateCount--;
1.4468 + }
1.4469 + if ( special.remove ) {
1.4470 + special.remove.call( elem, handleObj );
1.4471 + }
1.4472 + }
1.4473 + }
1.4474 +
1.4475 + // Remove generic event handler if we removed something and no more handlers exist
1.4476 + // (avoids potential for endless recursion during removal of special event handlers)
1.4477 + if ( origCount && !handlers.length ) {
1.4478 + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
1.4479 + jQuery.removeEvent( elem, type, elemData.handle );
1.4480 + }
1.4481 +
1.4482 + delete events[ type ];
1.4483 + }
1.4484 + }
1.4485 +
1.4486 + // Remove the expando if it's no longer used
1.4487 + if ( jQuery.isEmptyObject( events ) ) {
1.4488 + delete elemData.handle;
1.4489 +
1.4490 + // removeData also checks for emptiness and clears the expando if empty
1.4491 + // so use it instead of delete
1.4492 + jQuery._removeData( elem, "events" );
1.4493 + }
1.4494 + },
1.4495 +
1.4496 + trigger: function( event, data, elem, onlyHandlers ) {
1.4497 + var handle, ontype, cur,
1.4498 + bubbleType, special, tmp, i,
1.4499 + eventPath = [ elem || document ],
1.4500 + type = hasOwn.call( event, "type" ) ? event.type : event,
1.4501 + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
1.4502 +
1.4503 + cur = tmp = elem = elem || document;
1.4504 +
1.4505 + // Don't do events on text and comment nodes
1.4506 + if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
1.4507 + return;
1.4508 + }
1.4509 +
1.4510 + // focus/blur morphs to focusin/out; ensure we're not firing them right now
1.4511 + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
1.4512 + return;
1.4513 + }
1.4514 +
1.4515 + if ( type.indexOf(".") >= 0 ) {
1.4516 + // Namespaced trigger; create a regexp to match event type in handle()
1.4517 + namespaces = type.split(".");
1.4518 + type = namespaces.shift();
1.4519 + namespaces.sort();
1.4520 + }
1.4521 + ontype = type.indexOf(":") < 0 && "on" + type;
1.4522 +
1.4523 + // Caller can pass in a jQuery.Event object, Object, or just an event type string
1.4524 + event = event[ jQuery.expando ] ?
1.4525 + event :
1.4526 + new jQuery.Event( type, typeof event === "object" && event );
1.4527 +
1.4528 + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
1.4529 + event.isTrigger = onlyHandlers ? 2 : 3;
1.4530 + event.namespace = namespaces.join(".");
1.4531 + event.namespace_re = event.namespace ?
1.4532 + new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
1.4533 + null;
1.4534 +
1.4535 + // Clean up the event in case it is being reused
1.4536 + event.result = undefined;
1.4537 + if ( !event.target ) {
1.4538 + event.target = elem;
1.4539 + }
1.4540 +
1.4541 + // Clone any incoming data and prepend the event, creating the handler arg list
1.4542 + data = data == null ?
1.4543 + [ event ] :
1.4544 + jQuery.makeArray( data, [ event ] );
1.4545 +
1.4546 + // Allow special events to draw outside the lines
1.4547 + special = jQuery.event.special[ type ] || {};
1.4548 + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
1.4549 + return;
1.4550 + }
1.4551 +
1.4552 + // Determine event propagation path in advance, per W3C events spec (#9951)
1.4553 + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
1.4554 + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
1.4555 +
1.4556 + bubbleType = special.delegateType || type;
1.4557 + if ( !rfocusMorph.test( bubbleType + type ) ) {
1.4558 + cur = cur.parentNode;
1.4559 + }
1.4560 + for ( ; cur; cur = cur.parentNode ) {
1.4561 + eventPath.push( cur );
1.4562 + tmp = cur;
1.4563 + }
1.4564 +
1.4565 + // Only add window if we got to document (e.g., not plain obj or detached DOM)
1.4566 + if ( tmp === (elem.ownerDocument || document) ) {
1.4567 + eventPath.push( tmp.defaultView || tmp.parentWindow || window );
1.4568 + }
1.4569 + }
1.4570 +
1.4571 + // Fire handlers on the event path
1.4572 + i = 0;
1.4573 + while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
1.4574 +
1.4575 + event.type = i > 1 ?
1.4576 + bubbleType :
1.4577 + special.bindType || type;
1.4578 +
1.4579 + // jQuery handler
1.4580 + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
1.4581 + if ( handle ) {
1.4582 + handle.apply( cur, data );
1.4583 + }
1.4584 +
1.4585 + // Native handler
1.4586 + handle = ontype && cur[ ontype ];
1.4587 + if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
1.4588 + event.result = handle.apply( cur, data );
1.4589 + if ( event.result === false ) {
1.4590 + event.preventDefault();
1.4591 + }
1.4592 + }
1.4593 + }
1.4594 + event.type = type;
1.4595 +
1.4596 + // If nobody prevented the default action, do it now
1.4597 + if ( !onlyHandlers && !event.isDefaultPrevented() ) {
1.4598 +
1.4599 + if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
1.4600 + jQuery.acceptData( elem ) ) {
1.4601 +
1.4602 + // Call a native DOM method on the target with the same name name as the event.
1.4603 + // Can't use an .isFunction() check here because IE6/7 fails that test.
1.4604 + // Don't do default actions on window, that's where global variables be (#6170)
1.4605 + if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
1.4606 +
1.4607 + // Don't re-trigger an onFOO event when we call its FOO() method
1.4608 + tmp = elem[ ontype ];
1.4609 +
1.4610 + if ( tmp ) {
1.4611 + elem[ ontype ] = null;
1.4612 + }
1.4613 +
1.4614 + // Prevent re-triggering of the same event, since we already bubbled it above
1.4615 + jQuery.event.triggered = type;
1.4616 + try {
1.4617 + elem[ type ]();
1.4618 + } catch ( e ) {
1.4619 + // IE<9 dies on focus/blur to hidden element (#1486,#12518)
1.4620 + // only reproducible on winXP IE8 native, not IE9 in IE8 mode
1.4621 + }
1.4622 + jQuery.event.triggered = undefined;
1.4623 +
1.4624 + if ( tmp ) {
1.4625 + elem[ ontype ] = tmp;
1.4626 + }
1.4627 + }
1.4628 + }
1.4629 + }
1.4630 +
1.4631 + return event.result;
1.4632 + },
1.4633 +
1.4634 + dispatch: function( event ) {
1.4635 +
1.4636 + // Make a writable jQuery.Event from the native event object
1.4637 + event = jQuery.event.fix( event );
1.4638 +
1.4639 + var i, ret, handleObj, matched, j,
1.4640 + handlerQueue = [],
1.4641 + args = slice.call( arguments ),
1.4642 + handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
1.4643 + special = jQuery.event.special[ event.type ] || {};
1.4644 +
1.4645 + // Use the fix-ed jQuery.Event rather than the (read-only) native event
1.4646 + args[0] = event;
1.4647 + event.delegateTarget = this;
1.4648 +
1.4649 + // Call the preDispatch hook for the mapped type, and let it bail if desired
1.4650 + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
1.4651 + return;
1.4652 + }
1.4653 +
1.4654 + // Determine handlers
1.4655 + handlerQueue = jQuery.event.handlers.call( this, event, handlers );
1.4656 +
1.4657 + // Run delegates first; they may want to stop propagation beneath us
1.4658 + i = 0;
1.4659 + while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
1.4660 + event.currentTarget = matched.elem;
1.4661 +
1.4662 + j = 0;
1.4663 + while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
1.4664 +
1.4665 + // Triggered event must either 1) have no namespace, or
1.4666 + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
1.4667 + if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
1.4668 +
1.4669 + event.handleObj = handleObj;
1.4670 + event.data = handleObj.data;
1.4671 +
1.4672 + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
1.4673 + .apply( matched.elem, args );
1.4674 +
1.4675 + if ( ret !== undefined ) {
1.4676 + if ( (event.result = ret) === false ) {
1.4677 + event.preventDefault();
1.4678 + event.stopPropagation();
1.4679 + }
1.4680 + }
1.4681 + }
1.4682 + }
1.4683 + }
1.4684 +
1.4685 + // Call the postDispatch hook for the mapped type
1.4686 + if ( special.postDispatch ) {
1.4687 + special.postDispatch.call( this, event );
1.4688 + }
1.4689 +
1.4690 + return event.result;
1.4691 + },
1.4692 +
1.4693 + handlers: function( event, handlers ) {
1.4694 + var sel, handleObj, matches, i,
1.4695 + handlerQueue = [],
1.4696 + delegateCount = handlers.delegateCount,
1.4697 + cur = event.target;
1.4698 +
1.4699 + // Find delegate handlers
1.4700 + // Black-hole SVG <use> instance trees (#13180)
1.4701 + // Avoid non-left-click bubbling in Firefox (#3861)
1.4702 + if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
1.4703 +
1.4704 + /* jshint eqeqeq: false */
1.4705 + for ( ; cur != this; cur = cur.parentNode || this ) {
1.4706 + /* jshint eqeqeq: true */
1.4707 +
1.4708 + // Don't check non-elements (#13208)
1.4709 + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
1.4710 + if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
1.4711 + matches = [];
1.4712 + for ( i = 0; i < delegateCount; i++ ) {
1.4713 + handleObj = handlers[ i ];
1.4714 +
1.4715 + // Don't conflict with Object.prototype properties (#13203)
1.4716 + sel = handleObj.selector + " ";
1.4717 +
1.4718 + if ( matches[ sel ] === undefined ) {
1.4719 + matches[ sel ] = handleObj.needsContext ?
1.4720 + jQuery( sel, this ).index( cur ) >= 0 :
1.4721 + jQuery.find( sel, this, null, [ cur ] ).length;
1.4722 + }
1.4723 + if ( matches[ sel ] ) {
1.4724 + matches.push( handleObj );
1.4725 + }
1.4726 + }
1.4727 + if ( matches.length ) {
1.4728 + handlerQueue.push({ elem: cur, handlers: matches });
1.4729 + }
1.4730 + }
1.4731 + }
1.4732 + }
1.4733 +
1.4734 + // Add the remaining (directly-bound) handlers
1.4735 + if ( delegateCount < handlers.length ) {
1.4736 + handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
1.4737 + }
1.4738 +
1.4739 + return handlerQueue;
1.4740 + },
1.4741 +
1.4742 + fix: function( event ) {
1.4743 + if ( event[ jQuery.expando ] ) {
1.4744 + return event;
1.4745 + }
1.4746 +
1.4747 + // Create a writable copy of the event object and normalize some properties
1.4748 + var i, prop, copy,
1.4749 + type = event.type,
1.4750 + originalEvent = event,
1.4751 + fixHook = this.fixHooks[ type ];
1.4752 +
1.4753 + if ( !fixHook ) {
1.4754 + this.fixHooks[ type ] = fixHook =
1.4755 + rmouseEvent.test( type ) ? this.mouseHooks :
1.4756 + rkeyEvent.test( type ) ? this.keyHooks :
1.4757 + {};
1.4758 + }
1.4759 + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
1.4760 +
1.4761 + event = new jQuery.Event( originalEvent );
1.4762 +
1.4763 + i = copy.length;
1.4764 + while ( i-- ) {
1.4765 + prop = copy[ i ];
1.4766 + event[ prop ] = originalEvent[ prop ];
1.4767 + }
1.4768 +
1.4769 + // Support: IE<9
1.4770 + // Fix target property (#1925)
1.4771 + if ( !event.target ) {
1.4772 + event.target = originalEvent.srcElement || document;
1.4773 + }
1.4774 +
1.4775 + // Support: Chrome 23+, Safari?
1.4776 + // Target should not be a text node (#504, #13143)
1.4777 + if ( event.target.nodeType === 3 ) {
1.4778 + event.target = event.target.parentNode;
1.4779 + }
1.4780 +
1.4781 + // Support: IE<9
1.4782 + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
1.4783 + event.metaKey = !!event.metaKey;
1.4784 +
1.4785 + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
1.4786 + },
1.4787 +
1.4788 + // Includes some event props shared by KeyEvent and MouseEvent
1.4789 + props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
1.4790 +
1.4791 + fixHooks: {},
1.4792 +
1.4793 + keyHooks: {
1.4794 + props: "char charCode key keyCode".split(" "),
1.4795 + filter: function( event, original ) {
1.4796 +
1.4797 + // Add which for key events
1.4798 + if ( event.which == null ) {
1.4799 + event.which = original.charCode != null ? original.charCode : original.keyCode;
1.4800 + }
1.4801 +
1.4802 + return event;
1.4803 + }
1.4804 + },
1.4805 +
1.4806 + mouseHooks: {
1.4807 + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
1.4808 + filter: function( event, original ) {
1.4809 + var body, eventDoc, doc,
1.4810 + button = original.button,
1.4811 + fromElement = original.fromElement;
1.4812 +
1.4813 + // Calculate pageX/Y if missing and clientX/Y available
1.4814 + if ( event.pageX == null && original.clientX != null ) {
1.4815 + eventDoc = event.target.ownerDocument || document;
1.4816 + doc = eventDoc.documentElement;
1.4817 + body = eventDoc.body;
1.4818 +
1.4819 + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
1.4820 + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
1.4821 + }
1.4822 +
1.4823 + // Add relatedTarget, if necessary
1.4824 + if ( !event.relatedTarget && fromElement ) {
1.4825 + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
1.4826 + }
1.4827 +
1.4828 + // Add which for click: 1 === left; 2 === middle; 3 === right
1.4829 + // Note: button is not normalized, so don't use it
1.4830 + if ( !event.which && button !== undefined ) {
1.4831 + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
1.4832 + }
1.4833 +
1.4834 + return event;
1.4835 + }
1.4836 + },
1.4837 +
1.4838 + special: {
1.4839 + load: {
1.4840 + // Prevent triggered image.load events from bubbling to window.load
1.4841 + noBubble: true
1.4842 + },
1.4843 + focus: {
1.4844 + // Fire native event if possible so blur/focus sequence is correct
1.4845 + trigger: function() {
1.4846 + if ( this !== safeActiveElement() && this.focus ) {
1.4847 + try {
1.4848 + this.focus();
1.4849 + return false;
1.4850 + } catch ( e ) {
1.4851 + // Support: IE<9
1.4852 + // If we error on focus to hidden element (#1486, #12518),
1.4853 + // let .trigger() run the handlers
1.4854 + }
1.4855 + }
1.4856 + },
1.4857 + delegateType: "focusin"
1.4858 + },
1.4859 + blur: {
1.4860 + trigger: function() {
1.4861 + if ( this === safeActiveElement() && this.blur ) {
1.4862 + this.blur();
1.4863 + return false;
1.4864 + }
1.4865 + },
1.4866 + delegateType: "focusout"
1.4867 + },
1.4868 + click: {
1.4869 + // For checkbox, fire native event so checked state will be right
1.4870 + trigger: function() {
1.4871 + if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
1.4872 + this.click();
1.4873 + return false;
1.4874 + }
1.4875 + },
1.4876 +
1.4877 + // For cross-browser consistency, don't fire native .click() on links
1.4878 + _default: function( event ) {
1.4879 + return jQuery.nodeName( event.target, "a" );
1.4880 + }
1.4881 + },
1.4882 +
1.4883 + beforeunload: {
1.4884 + postDispatch: function( event ) {
1.4885 +
1.4886 + // Support: Firefox 20+
1.4887 + // Firefox doesn't alert if the returnValue field is not set.
1.4888 + if ( event.result !== undefined && event.originalEvent ) {
1.4889 + event.originalEvent.returnValue = event.result;
1.4890 + }
1.4891 + }
1.4892 + }
1.4893 + },
1.4894 +
1.4895 + simulate: function( type, elem, event, bubble ) {
1.4896 + // Piggyback on a donor event to simulate a different one.
1.4897 + // Fake originalEvent to avoid donor's stopPropagation, but if the
1.4898 + // simulated event prevents default then we do the same on the donor.
1.4899 + var e = jQuery.extend(
1.4900 + new jQuery.Event(),
1.4901 + event,
1.4902 + {
1.4903 + type: type,
1.4904 + isSimulated: true,
1.4905 + originalEvent: {}
1.4906 + }
1.4907 + );
1.4908 + if ( bubble ) {
1.4909 + jQuery.event.trigger( e, null, elem );
1.4910 + } else {
1.4911 + jQuery.event.dispatch.call( elem, e );
1.4912 + }
1.4913 + if ( e.isDefaultPrevented() ) {
1.4914 + event.preventDefault();
1.4915 + }
1.4916 + }
1.4917 +};
1.4918 +
1.4919 +jQuery.removeEvent = document.removeEventListener ?
1.4920 + function( elem, type, handle ) {
1.4921 + if ( elem.removeEventListener ) {
1.4922 + elem.removeEventListener( type, handle, false );
1.4923 + }
1.4924 + } :
1.4925 + function( elem, type, handle ) {
1.4926 + var name = "on" + type;
1.4927 +
1.4928 + if ( elem.detachEvent ) {
1.4929 +
1.4930 + // #8545, #7054, preventing memory leaks for custom events in IE6-8
1.4931 + // detachEvent needed property on element, by name of that event, to properly expose it to GC
1.4932 + if ( typeof elem[ name ] === strundefined ) {
1.4933 + elem[ name ] = null;
1.4934 + }
1.4935 +
1.4936 + elem.detachEvent( name, handle );
1.4937 + }
1.4938 + };
1.4939 +
1.4940 +jQuery.Event = function( src, props ) {
1.4941 + // Allow instantiation without the 'new' keyword
1.4942 + if ( !(this instanceof jQuery.Event) ) {
1.4943 + return new jQuery.Event( src, props );
1.4944 + }
1.4945 +
1.4946 + // Event object
1.4947 + if ( src && src.type ) {
1.4948 + this.originalEvent = src;
1.4949 + this.type = src.type;
1.4950 +
1.4951 + // Events bubbling up the document may have been marked as prevented
1.4952 + // by a handler lower down the tree; reflect the correct value.
1.4953 + this.isDefaultPrevented = src.defaultPrevented ||
1.4954 + src.defaultPrevented === undefined &&
1.4955 + // Support: IE < 9, Android < 4.0
1.4956 + src.returnValue === false ?
1.4957 + returnTrue :
1.4958 + returnFalse;
1.4959 +
1.4960 + // Event type
1.4961 + } else {
1.4962 + this.type = src;
1.4963 + }
1.4964 +
1.4965 + // Put explicitly provided properties onto the event object
1.4966 + if ( props ) {
1.4967 + jQuery.extend( this, props );
1.4968 + }
1.4969 +
1.4970 + // Create a timestamp if incoming event doesn't have one
1.4971 + this.timeStamp = src && src.timeStamp || jQuery.now();
1.4972 +
1.4973 + // Mark it as fixed
1.4974 + this[ jQuery.expando ] = true;
1.4975 +};
1.4976 +
1.4977 +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
1.4978 +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
1.4979 +jQuery.Event.prototype = {
1.4980 + isDefaultPrevented: returnFalse,
1.4981 + isPropagationStopped: returnFalse,
1.4982 + isImmediatePropagationStopped: returnFalse,
1.4983 +
1.4984 + preventDefault: function() {
1.4985 + var e = this.originalEvent;
1.4986 +
1.4987 + this.isDefaultPrevented = returnTrue;
1.4988 + if ( !e ) {
1.4989 + return;
1.4990 + }
1.4991 +
1.4992 + // If preventDefault exists, run it on the original event
1.4993 + if ( e.preventDefault ) {
1.4994 + e.preventDefault();
1.4995 +
1.4996 + // Support: IE
1.4997 + // Otherwise set the returnValue property of the original event to false
1.4998 + } else {
1.4999 + e.returnValue = false;
1.5000 + }
1.5001 + },
1.5002 + stopPropagation: function() {
1.5003 + var e = this.originalEvent;
1.5004 +
1.5005 + this.isPropagationStopped = returnTrue;
1.5006 + if ( !e ) {
1.5007 + return;
1.5008 + }
1.5009 + // If stopPropagation exists, run it on the original event
1.5010 + if ( e.stopPropagation ) {
1.5011 + e.stopPropagation();
1.5012 + }
1.5013 +
1.5014 + // Support: IE
1.5015 + // Set the cancelBubble property of the original event to true
1.5016 + e.cancelBubble = true;
1.5017 + },
1.5018 + stopImmediatePropagation: function() {
1.5019 + var e = this.originalEvent;
1.5020 +
1.5021 + this.isImmediatePropagationStopped = returnTrue;
1.5022 +
1.5023 + if ( e && e.stopImmediatePropagation ) {
1.5024 + e.stopImmediatePropagation();
1.5025 + }
1.5026 +
1.5027 + this.stopPropagation();
1.5028 + }
1.5029 +};
1.5030 +
1.5031 +// Create mouseenter/leave events using mouseover/out and event-time checks
1.5032 +jQuery.each({
1.5033 + mouseenter: "mouseover",
1.5034 + mouseleave: "mouseout",
1.5035 + pointerenter: "pointerover",
1.5036 + pointerleave: "pointerout"
1.5037 +}, function( orig, fix ) {
1.5038 + jQuery.event.special[ orig ] = {
1.5039 + delegateType: fix,
1.5040 + bindType: fix,
1.5041 +
1.5042 + handle: function( event ) {
1.5043 + var ret,
1.5044 + target = this,
1.5045 + related = event.relatedTarget,
1.5046 + handleObj = event.handleObj;
1.5047 +
1.5048 + // For mousenter/leave call the handler if related is outside the target.
1.5049 + // NB: No relatedTarget if the mouse left/entered the browser window
1.5050 + if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
1.5051 + event.type = handleObj.origType;
1.5052 + ret = handleObj.handler.apply( this, arguments );
1.5053 + event.type = fix;
1.5054 + }
1.5055 + return ret;
1.5056 + }
1.5057 + };
1.5058 +});
1.5059 +
1.5060 +// IE submit delegation
1.5061 +if ( !support.submitBubbles ) {
1.5062 +
1.5063 + jQuery.event.special.submit = {
1.5064 + setup: function() {
1.5065 + // Only need this for delegated form submit events
1.5066 + if ( jQuery.nodeName( this, "form" ) ) {
1.5067 + return false;
1.5068 + }
1.5069 +
1.5070 + // Lazy-add a submit handler when a descendant form may potentially be submitted
1.5071 + jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
1.5072 + // Node name check avoids a VML-related crash in IE (#9807)
1.5073 + var elem = e.target,
1.5074 + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
1.5075 + if ( form && !jQuery._data( form, "submitBubbles" ) ) {
1.5076 + jQuery.event.add( form, "submit._submit", function( event ) {
1.5077 + event._submit_bubble = true;
1.5078 + });
1.5079 + jQuery._data( form, "submitBubbles", true );
1.5080 + }
1.5081 + });
1.5082 + // return undefined since we don't need an event listener
1.5083 + },
1.5084 +
1.5085 + postDispatch: function( event ) {
1.5086 + // If form was submitted by the user, bubble the event up the tree
1.5087 + if ( event._submit_bubble ) {
1.5088 + delete event._submit_bubble;
1.5089 + if ( this.parentNode && !event.isTrigger ) {
1.5090 + jQuery.event.simulate( "submit", this.parentNode, event, true );
1.5091 + }
1.5092 + }
1.5093 + },
1.5094 +
1.5095 + teardown: function() {
1.5096 + // Only need this for delegated form submit events
1.5097 + if ( jQuery.nodeName( this, "form" ) ) {
1.5098 + return false;
1.5099 + }
1.5100 +
1.5101 + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
1.5102 + jQuery.event.remove( this, "._submit" );
1.5103 + }
1.5104 + };
1.5105 +}
1.5106 +
1.5107 +// IE change delegation and checkbox/radio fix
1.5108 +if ( !support.changeBubbles ) {
1.5109 +
1.5110 + jQuery.event.special.change = {
1.5111 +
1.5112 + setup: function() {
1.5113 +
1.5114 + if ( rformElems.test( this.nodeName ) ) {
1.5115 + // IE doesn't fire change on a check/radio until blur; trigger it on click
1.5116 + // after a propertychange. Eat the blur-change in special.change.handle.
1.5117 + // This still fires onchange a second time for check/radio after blur.
1.5118 + if ( this.type === "checkbox" || this.type === "radio" ) {
1.5119 + jQuery.event.add( this, "propertychange._change", function( event ) {
1.5120 + if ( event.originalEvent.propertyName === "checked" ) {
1.5121 + this._just_changed = true;
1.5122 + }
1.5123 + });
1.5124 + jQuery.event.add( this, "click._change", function( event ) {
1.5125 + if ( this._just_changed && !event.isTrigger ) {
1.5126 + this._just_changed = false;
1.5127 + }
1.5128 + // Allow triggered, simulated change events (#11500)
1.5129 + jQuery.event.simulate( "change", this, event, true );
1.5130 + });
1.5131 + }
1.5132 + return false;
1.5133 + }
1.5134 + // Delegated event; lazy-add a change handler on descendant inputs
1.5135 + jQuery.event.add( this, "beforeactivate._change", function( e ) {
1.5136 + var elem = e.target;
1.5137 +
1.5138 + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
1.5139 + jQuery.event.add( elem, "change._change", function( event ) {
1.5140 + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
1.5141 + jQuery.event.simulate( "change", this.parentNode, event, true );
1.5142 + }
1.5143 + });
1.5144 + jQuery._data( elem, "changeBubbles", true );
1.5145 + }
1.5146 + });
1.5147 + },
1.5148 +
1.5149 + handle: function( event ) {
1.5150 + var elem = event.target;
1.5151 +
1.5152 + // Swallow native change events from checkbox/radio, we already triggered them above
1.5153 + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
1.5154 + return event.handleObj.handler.apply( this, arguments );
1.5155 + }
1.5156 + },
1.5157 +
1.5158 + teardown: function() {
1.5159 + jQuery.event.remove( this, "._change" );
1.5160 +
1.5161 + return !rformElems.test( this.nodeName );
1.5162 + }
1.5163 + };
1.5164 +}
1.5165 +
1.5166 +// Create "bubbling" focus and blur events
1.5167 +if ( !support.focusinBubbles ) {
1.5168 + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
1.5169 +
1.5170 + // Attach a single capturing handler on the document while someone wants focusin/focusout
1.5171 + var handler = function( event ) {
1.5172 + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
1.5173 + };
1.5174 +
1.5175 + jQuery.event.special[ fix ] = {
1.5176 + setup: function() {
1.5177 + var doc = this.ownerDocument || this,
1.5178 + attaches = jQuery._data( doc, fix );
1.5179 +
1.5180 + if ( !attaches ) {
1.5181 + doc.addEventListener( orig, handler, true );
1.5182 + }
1.5183 + jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
1.5184 + },
1.5185 + teardown: function() {
1.5186 + var doc = this.ownerDocument || this,
1.5187 + attaches = jQuery._data( doc, fix ) - 1;
1.5188 +
1.5189 + if ( !attaches ) {
1.5190 + doc.removeEventListener( orig, handler, true );
1.5191 + jQuery._removeData( doc, fix );
1.5192 + } else {
1.5193 + jQuery._data( doc, fix, attaches );
1.5194 + }
1.5195 + }
1.5196 + };
1.5197 + });
1.5198 +}
1.5199 +
1.5200 +jQuery.fn.extend({
1.5201 +
1.5202 + on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
1.5203 + var type, origFn;
1.5204 +
1.5205 + // Types can be a map of types/handlers
1.5206 + if ( typeof types === "object" ) {
1.5207 + // ( types-Object, selector, data )
1.5208 + if ( typeof selector !== "string" ) {
1.5209 + // ( types-Object, data )
1.5210 + data = data || selector;
1.5211 + selector = undefined;
1.5212 + }
1.5213 + for ( type in types ) {
1.5214 + this.on( type, selector, data, types[ type ], one );
1.5215 + }
1.5216 + return this;
1.5217 + }
1.5218 +
1.5219 + if ( data == null && fn == null ) {
1.5220 + // ( types, fn )
1.5221 + fn = selector;
1.5222 + data = selector = undefined;
1.5223 + } else if ( fn == null ) {
1.5224 + if ( typeof selector === "string" ) {
1.5225 + // ( types, selector, fn )
1.5226 + fn = data;
1.5227 + data = undefined;
1.5228 + } else {
1.5229 + // ( types, data, fn )
1.5230 + fn = data;
1.5231 + data = selector;
1.5232 + selector = undefined;
1.5233 + }
1.5234 + }
1.5235 + if ( fn === false ) {
1.5236 + fn = returnFalse;
1.5237 + } else if ( !fn ) {
1.5238 + return this;
1.5239 + }
1.5240 +
1.5241 + if ( one === 1 ) {
1.5242 + origFn = fn;
1.5243 + fn = function( event ) {
1.5244 + // Can use an empty set, since event contains the info
1.5245 + jQuery().off( event );
1.5246 + return origFn.apply( this, arguments );
1.5247 + };
1.5248 + // Use same guid so caller can remove using origFn
1.5249 + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
1.5250 + }
1.5251 + return this.each( function() {
1.5252 + jQuery.event.add( this, types, fn, data, selector );
1.5253 + });
1.5254 + },
1.5255 + one: function( types, selector, data, fn ) {
1.5256 + return this.on( types, selector, data, fn, 1 );
1.5257 + },
1.5258 + off: function( types, selector, fn ) {
1.5259 + var handleObj, type;
1.5260 + if ( types && types.preventDefault && types.handleObj ) {
1.5261 + // ( event ) dispatched jQuery.Event
1.5262 + handleObj = types.handleObj;
1.5263 + jQuery( types.delegateTarget ).off(
1.5264 + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
1.5265 + handleObj.selector,
1.5266 + handleObj.handler
1.5267 + );
1.5268 + return this;
1.5269 + }
1.5270 + if ( typeof types === "object" ) {
1.5271 + // ( types-object [, selector] )
1.5272 + for ( type in types ) {
1.5273 + this.off( type, selector, types[ type ] );
1.5274 + }
1.5275 + return this;
1.5276 + }
1.5277 + if ( selector === false || typeof selector === "function" ) {
1.5278 + // ( types [, fn] )
1.5279 + fn = selector;
1.5280 + selector = undefined;
1.5281 + }
1.5282 + if ( fn === false ) {
1.5283 + fn = returnFalse;
1.5284 + }
1.5285 + return this.each(function() {
1.5286 + jQuery.event.remove( this, types, fn, selector );
1.5287 + });
1.5288 + },
1.5289 +
1.5290 + trigger: function( type, data ) {
1.5291 + return this.each(function() {
1.5292 + jQuery.event.trigger( type, data, this );
1.5293 + });
1.5294 + },
1.5295 + triggerHandler: function( type, data ) {
1.5296 + var elem = this[0];
1.5297 + if ( elem ) {
1.5298 + return jQuery.event.trigger( type, data, elem, true );
1.5299 + }
1.5300 + }
1.5301 +});
1.5302 +
1.5303 +
1.5304 +function createSafeFragment( document ) {
1.5305 + var list = nodeNames.split( "|" ),
1.5306 + safeFrag = document.createDocumentFragment();
1.5307 +
1.5308 + if ( safeFrag.createElement ) {
1.5309 + while ( list.length ) {
1.5310 + safeFrag.createElement(
1.5311 + list.pop()
1.5312 + );
1.5313 + }
1.5314 + }
1.5315 + return safeFrag;
1.5316 +}
1.5317 +
1.5318 +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
1.5319 + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
1.5320 + rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
1.5321 + rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
1.5322 + rleadingWhitespace = /^\s+/,
1.5323 + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
1.5324 + rtagName = /<([\w:]+)/,
1.5325 + rtbody = /<tbody/i,
1.5326 + rhtml = /<|&#?\w+;/,
1.5327 + rnoInnerhtml = /<(?:script|style|link)/i,
1.5328 + // checked="checked" or checked
1.5329 + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
1.5330 + rscriptType = /^$|\/(?:java|ecma)script/i,
1.5331 + rscriptTypeMasked = /^true\/(.*)/,
1.5332 + rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
1.5333 +
1.5334 + // We have to close these tags to support XHTML (#13200)
1.5335 + wrapMap = {
1.5336 + option: [ 1, "<select multiple='multiple'>", "</select>" ],
1.5337 + legend: [ 1, "<fieldset>", "</fieldset>" ],
1.5338 + area: [ 1, "<map>", "</map>" ],
1.5339 + param: [ 1, "<object>", "</object>" ],
1.5340 + thead: [ 1, "<table>", "</table>" ],
1.5341 + tr: [ 2, "<table><tbody>", "</tbody></table>" ],
1.5342 + col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
1.5343 + td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
1.5344 +
1.5345 + // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
1.5346 + // unless wrapped in a div with non-breaking characters in front of it.
1.5347 + _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
1.5348 + },
1.5349 + safeFragment = createSafeFragment( document ),
1.5350 + fragmentDiv = safeFragment.appendChild( document.createElement("div") );
1.5351 +
1.5352 +wrapMap.optgroup = wrapMap.option;
1.5353 +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
1.5354 +wrapMap.th = wrapMap.td;
1.5355 +
1.5356 +function getAll( context, tag ) {
1.5357 + var elems, elem,
1.5358 + i = 0,
1.5359 + found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
1.5360 + typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
1.5361 + undefined;
1.5362 +
1.5363 + if ( !found ) {
1.5364 + for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
1.5365 + if ( !tag || jQuery.nodeName( elem, tag ) ) {
1.5366 + found.push( elem );
1.5367 + } else {
1.5368 + jQuery.merge( found, getAll( elem, tag ) );
1.5369 + }
1.5370 + }
1.5371 + }
1.5372 +
1.5373 + return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
1.5374 + jQuery.merge( [ context ], found ) :
1.5375 + found;
1.5376 +}
1.5377 +
1.5378 +// Used in buildFragment, fixes the defaultChecked property
1.5379 +function fixDefaultChecked( elem ) {
1.5380 + if ( rcheckableType.test( elem.type ) ) {
1.5381 + elem.defaultChecked = elem.checked;
1.5382 + }
1.5383 +}
1.5384 +
1.5385 +// Support: IE<8
1.5386 +// Manipulating tables requires a tbody
1.5387 +function manipulationTarget( elem, content ) {
1.5388 + return jQuery.nodeName( elem, "table" ) &&
1.5389 + jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
1.5390 +
1.5391 + elem.getElementsByTagName("tbody")[0] ||
1.5392 + elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
1.5393 + elem;
1.5394 +}
1.5395 +
1.5396 +// Replace/restore the type attribute of script elements for safe DOM manipulation
1.5397 +function disableScript( elem ) {
1.5398 + elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
1.5399 + return elem;
1.5400 +}
1.5401 +function restoreScript( elem ) {
1.5402 + var match = rscriptTypeMasked.exec( elem.type );
1.5403 + if ( match ) {
1.5404 + elem.type = match[1];
1.5405 + } else {
1.5406 + elem.removeAttribute("type");
1.5407 + }
1.5408 + return elem;
1.5409 +}
1.5410 +
1.5411 +// Mark scripts as having already been evaluated
1.5412 +function setGlobalEval( elems, refElements ) {
1.5413 + var elem,
1.5414 + i = 0;
1.5415 + for ( ; (elem = elems[i]) != null; i++ ) {
1.5416 + jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
1.5417 + }
1.5418 +}
1.5419 +
1.5420 +function cloneCopyEvent( src, dest ) {
1.5421 +
1.5422 + if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
1.5423 + return;
1.5424 + }
1.5425 +
1.5426 + var type, i, l,
1.5427 + oldData = jQuery._data( src ),
1.5428 + curData = jQuery._data( dest, oldData ),
1.5429 + events = oldData.events;
1.5430 +
1.5431 + if ( events ) {
1.5432 + delete curData.handle;
1.5433 + curData.events = {};
1.5434 +
1.5435 + for ( type in events ) {
1.5436 + for ( i = 0, l = events[ type ].length; i < l; i++ ) {
1.5437 + jQuery.event.add( dest, type, events[ type ][ i ] );
1.5438 + }
1.5439 + }
1.5440 + }
1.5441 +
1.5442 + // make the cloned public data object a copy from the original
1.5443 + if ( curData.data ) {
1.5444 + curData.data = jQuery.extend( {}, curData.data );
1.5445 + }
1.5446 +}
1.5447 +
1.5448 +function fixCloneNodeIssues( src, dest ) {
1.5449 + var nodeName, e, data;
1.5450 +
1.5451 + // We do not need to do anything for non-Elements
1.5452 + if ( dest.nodeType !== 1 ) {
1.5453 + return;
1.5454 + }
1.5455 +
1.5456 + nodeName = dest.nodeName.toLowerCase();
1.5457 +
1.5458 + // IE6-8 copies events bound via attachEvent when using cloneNode.
1.5459 + if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
1.5460 + data = jQuery._data( dest );
1.5461 +
1.5462 + for ( e in data.events ) {
1.5463 + jQuery.removeEvent( dest, e, data.handle );
1.5464 + }
1.5465 +
1.5466 + // Event data gets referenced instead of copied if the expando gets copied too
1.5467 + dest.removeAttribute( jQuery.expando );
1.5468 + }
1.5469 +
1.5470 + // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
1.5471 + if ( nodeName === "script" && dest.text !== src.text ) {
1.5472 + disableScript( dest ).text = src.text;
1.5473 + restoreScript( dest );
1.5474 +
1.5475 + // IE6-10 improperly clones children of object elements using classid.
1.5476 + // IE10 throws NoModificationAllowedError if parent is null, #12132.
1.5477 + } else if ( nodeName === "object" ) {
1.5478 + if ( dest.parentNode ) {
1.5479 + dest.outerHTML = src.outerHTML;
1.5480 + }
1.5481 +
1.5482 + // This path appears unavoidable for IE9. When cloning an object
1.5483 + // element in IE9, the outerHTML strategy above is not sufficient.
1.5484 + // If the src has innerHTML and the destination does not,
1.5485 + // copy the src.innerHTML into the dest.innerHTML. #10324
1.5486 + if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
1.5487 + dest.innerHTML = src.innerHTML;
1.5488 + }
1.5489 +
1.5490 + } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
1.5491 + // IE6-8 fails to persist the checked state of a cloned checkbox
1.5492 + // or radio button. Worse, IE6-7 fail to give the cloned element
1.5493 + // a checked appearance if the defaultChecked value isn't also set
1.5494 +
1.5495 + dest.defaultChecked = dest.checked = src.checked;
1.5496 +
1.5497 + // IE6-7 get confused and end up setting the value of a cloned
1.5498 + // checkbox/radio button to an empty string instead of "on"
1.5499 + if ( dest.value !== src.value ) {
1.5500 + dest.value = src.value;
1.5501 + }
1.5502 +
1.5503 + // IE6-8 fails to return the selected option to the default selected
1.5504 + // state when cloning options
1.5505 + } else if ( nodeName === "option" ) {
1.5506 + dest.defaultSelected = dest.selected = src.defaultSelected;
1.5507 +
1.5508 + // IE6-8 fails to set the defaultValue to the correct value when
1.5509 + // cloning other types of input fields
1.5510 + } else if ( nodeName === "input" || nodeName === "textarea" ) {
1.5511 + dest.defaultValue = src.defaultValue;
1.5512 + }
1.5513 +}
1.5514 +
1.5515 +jQuery.extend({
1.5516 + clone: function( elem, dataAndEvents, deepDataAndEvents ) {
1.5517 + var destElements, node, clone, i, srcElements,
1.5518 + inPage = jQuery.contains( elem.ownerDocument, elem );
1.5519 +
1.5520 + if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
1.5521 + clone = elem.cloneNode( true );
1.5522 +
1.5523 + // IE<=8 does not properly clone detached, unknown element nodes
1.5524 + } else {
1.5525 + fragmentDiv.innerHTML = elem.outerHTML;
1.5526 + fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
1.5527 + }
1.5528 +
1.5529 + if ( (!support.noCloneEvent || !support.noCloneChecked) &&
1.5530 + (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
1.5531 +
1.5532 + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
1.5533 + destElements = getAll( clone );
1.5534 + srcElements = getAll( elem );
1.5535 +
1.5536 + // Fix all IE cloning issues
1.5537 + for ( i = 0; (node = srcElements[i]) != null; ++i ) {
1.5538 + // Ensure that the destination node is not null; Fixes #9587
1.5539 + if ( destElements[i] ) {
1.5540 + fixCloneNodeIssues( node, destElements[i] );
1.5541 + }
1.5542 + }
1.5543 + }
1.5544 +
1.5545 + // Copy the events from the original to the clone
1.5546 + if ( dataAndEvents ) {
1.5547 + if ( deepDataAndEvents ) {
1.5548 + srcElements = srcElements || getAll( elem );
1.5549 + destElements = destElements || getAll( clone );
1.5550 +
1.5551 + for ( i = 0; (node = srcElements[i]) != null; i++ ) {
1.5552 + cloneCopyEvent( node, destElements[i] );
1.5553 + }
1.5554 + } else {
1.5555 + cloneCopyEvent( elem, clone );
1.5556 + }
1.5557 + }
1.5558 +
1.5559 + // Preserve script evaluation history
1.5560 + destElements = getAll( clone, "script" );
1.5561 + if ( destElements.length > 0 ) {
1.5562 + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
1.5563 + }
1.5564 +
1.5565 + destElements = srcElements = node = null;
1.5566 +
1.5567 + // Return the cloned set
1.5568 + return clone;
1.5569 + },
1.5570 +
1.5571 + buildFragment: function( elems, context, scripts, selection ) {
1.5572 + var j, elem, contains,
1.5573 + tmp, tag, tbody, wrap,
1.5574 + l = elems.length,
1.5575 +
1.5576 + // Ensure a safe fragment
1.5577 + safe = createSafeFragment( context ),
1.5578 +
1.5579 + nodes = [],
1.5580 + i = 0;
1.5581 +
1.5582 + for ( ; i < l; i++ ) {
1.5583 + elem = elems[ i ];
1.5584 +
1.5585 + if ( elem || elem === 0 ) {
1.5586 +
1.5587 + // Add nodes directly
1.5588 + if ( jQuery.type( elem ) === "object" ) {
1.5589 + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
1.5590 +
1.5591 + // Convert non-html into a text node
1.5592 + } else if ( !rhtml.test( elem ) ) {
1.5593 + nodes.push( context.createTextNode( elem ) );
1.5594 +
1.5595 + // Convert html into DOM nodes
1.5596 + } else {
1.5597 + tmp = tmp || safe.appendChild( context.createElement("div") );
1.5598 +
1.5599 + // Deserialize a standard representation
1.5600 + tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
1.5601 + wrap = wrapMap[ tag ] || wrapMap._default;
1.5602 +
1.5603 + tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
1.5604 +
1.5605 + // Descend through wrappers to the right content
1.5606 + j = wrap[0];
1.5607 + while ( j-- ) {
1.5608 + tmp = tmp.lastChild;
1.5609 + }
1.5610 +
1.5611 + // Manually add leading whitespace removed by IE
1.5612 + if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
1.5613 + nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
1.5614 + }
1.5615 +
1.5616 + // Remove IE's autoinserted <tbody> from table fragments
1.5617 + if ( !support.tbody ) {
1.5618 +
1.5619 + // String was a <table>, *may* have spurious <tbody>
1.5620 + elem = tag === "table" && !rtbody.test( elem ) ?
1.5621 + tmp.firstChild :
1.5622 +
1.5623 + // String was a bare <thead> or <tfoot>
1.5624 + wrap[1] === "<table>" && !rtbody.test( elem ) ?
1.5625 + tmp :
1.5626 + 0;
1.5627 +
1.5628 + j = elem && elem.childNodes.length;
1.5629 + while ( j-- ) {
1.5630 + if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
1.5631 + elem.removeChild( tbody );
1.5632 + }
1.5633 + }
1.5634 + }
1.5635 +
1.5636 + jQuery.merge( nodes, tmp.childNodes );
1.5637 +
1.5638 + // Fix #12392 for WebKit and IE > 9
1.5639 + tmp.textContent = "";
1.5640 +
1.5641 + // Fix #12392 for oldIE
1.5642 + while ( tmp.firstChild ) {
1.5643 + tmp.removeChild( tmp.firstChild );
1.5644 + }
1.5645 +
1.5646 + // Remember the top-level container for proper cleanup
1.5647 + tmp = safe.lastChild;
1.5648 + }
1.5649 + }
1.5650 + }
1.5651 +
1.5652 + // Fix #11356: Clear elements from fragment
1.5653 + if ( tmp ) {
1.5654 + safe.removeChild( tmp );
1.5655 + }
1.5656 +
1.5657 + // Reset defaultChecked for any radios and checkboxes
1.5658 + // about to be appended to the DOM in IE 6/7 (#8060)
1.5659 + if ( !support.appendChecked ) {
1.5660 + jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
1.5661 + }
1.5662 +
1.5663 + i = 0;
1.5664 + while ( (elem = nodes[ i++ ]) ) {
1.5665 +
1.5666 + // #4087 - If origin and destination elements are the same, and this is
1.5667 + // that element, do not do anything
1.5668 + if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
1.5669 + continue;
1.5670 + }
1.5671 +
1.5672 + contains = jQuery.contains( elem.ownerDocument, elem );
1.5673 +
1.5674 + // Append to fragment
1.5675 + tmp = getAll( safe.appendChild( elem ), "script" );
1.5676 +
1.5677 + // Preserve script evaluation history
1.5678 + if ( contains ) {
1.5679 + setGlobalEval( tmp );
1.5680 + }
1.5681 +
1.5682 + // Capture executables
1.5683 + if ( scripts ) {
1.5684 + j = 0;
1.5685 + while ( (elem = tmp[ j++ ]) ) {
1.5686 + if ( rscriptType.test( elem.type || "" ) ) {
1.5687 + scripts.push( elem );
1.5688 + }
1.5689 + }
1.5690 + }
1.5691 + }
1.5692 +
1.5693 + tmp = null;
1.5694 +
1.5695 + return safe;
1.5696 + },
1.5697 +
1.5698 + cleanData: function( elems, /* internal */ acceptData ) {
1.5699 + var elem, type, id, data,
1.5700 + i = 0,
1.5701 + internalKey = jQuery.expando,
1.5702 + cache = jQuery.cache,
1.5703 + deleteExpando = support.deleteExpando,
1.5704 + special = jQuery.event.special;
1.5705 +
1.5706 + for ( ; (elem = elems[i]) != null; i++ ) {
1.5707 + if ( acceptData || jQuery.acceptData( elem ) ) {
1.5708 +
1.5709 + id = elem[ internalKey ];
1.5710 + data = id && cache[ id ];
1.5711 +
1.5712 + if ( data ) {
1.5713 + if ( data.events ) {
1.5714 + for ( type in data.events ) {
1.5715 + if ( special[ type ] ) {
1.5716 + jQuery.event.remove( elem, type );
1.5717 +
1.5718 + // This is a shortcut to avoid jQuery.event.remove's overhead
1.5719 + } else {
1.5720 + jQuery.removeEvent( elem, type, data.handle );
1.5721 + }
1.5722 + }
1.5723 + }
1.5724 +
1.5725 + // Remove cache only if it was not already removed by jQuery.event.remove
1.5726 + if ( cache[ id ] ) {
1.5727 +
1.5728 + delete cache[ id ];
1.5729 +
1.5730 + // IE does not allow us to delete expando properties from nodes,
1.5731 + // nor does it have a removeAttribute function on Document nodes;
1.5732 + // we must handle all of these cases
1.5733 + if ( deleteExpando ) {
1.5734 + delete elem[ internalKey ];
1.5735 +
1.5736 + } else if ( typeof elem.removeAttribute !== strundefined ) {
1.5737 + elem.removeAttribute( internalKey );
1.5738 +
1.5739 + } else {
1.5740 + elem[ internalKey ] = null;
1.5741 + }
1.5742 +
1.5743 + deletedIds.push( id );
1.5744 + }
1.5745 + }
1.5746 + }
1.5747 + }
1.5748 + }
1.5749 +});
1.5750 +
1.5751 +jQuery.fn.extend({
1.5752 + text: function( value ) {
1.5753 + return access( this, function( value ) {
1.5754 + return value === undefined ?
1.5755 + jQuery.text( this ) :
1.5756 + this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
1.5757 + }, null, value, arguments.length );
1.5758 + },
1.5759 +
1.5760 + append: function() {
1.5761 + return this.domManip( arguments, function( elem ) {
1.5762 + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
1.5763 + var target = manipulationTarget( this, elem );
1.5764 + target.appendChild( elem );
1.5765 + }
1.5766 + });
1.5767 + },
1.5768 +
1.5769 + prepend: function() {
1.5770 + return this.domManip( arguments, function( elem ) {
1.5771 + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
1.5772 + var target = manipulationTarget( this, elem );
1.5773 + target.insertBefore( elem, target.firstChild );
1.5774 + }
1.5775 + });
1.5776 + },
1.5777 +
1.5778 + before: function() {
1.5779 + return this.domManip( arguments, function( elem ) {
1.5780 + if ( this.parentNode ) {
1.5781 + this.parentNode.insertBefore( elem, this );
1.5782 + }
1.5783 + });
1.5784 + },
1.5785 +
1.5786 + after: function() {
1.5787 + return this.domManip( arguments, function( elem ) {
1.5788 + if ( this.parentNode ) {
1.5789 + this.parentNode.insertBefore( elem, this.nextSibling );
1.5790 + }
1.5791 + });
1.5792 + },
1.5793 +
1.5794 + remove: function( selector, keepData /* Internal Use Only */ ) {
1.5795 + var elem,
1.5796 + elems = selector ? jQuery.filter( selector, this ) : this,
1.5797 + i = 0;
1.5798 +
1.5799 + for ( ; (elem = elems[i]) != null; i++ ) {
1.5800 +
1.5801 + if ( !keepData && elem.nodeType === 1 ) {
1.5802 + jQuery.cleanData( getAll( elem ) );
1.5803 + }
1.5804 +
1.5805 + if ( elem.parentNode ) {
1.5806 + if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
1.5807 + setGlobalEval( getAll( elem, "script" ) );
1.5808 + }
1.5809 + elem.parentNode.removeChild( elem );
1.5810 + }
1.5811 + }
1.5812 +
1.5813 + return this;
1.5814 + },
1.5815 +
1.5816 + empty: function() {
1.5817 + var elem,
1.5818 + i = 0;
1.5819 +
1.5820 + for ( ; (elem = this[i]) != null; i++ ) {
1.5821 + // Remove element nodes and prevent memory leaks
1.5822 + if ( elem.nodeType === 1 ) {
1.5823 + jQuery.cleanData( getAll( elem, false ) );
1.5824 + }
1.5825 +
1.5826 + // Remove any remaining nodes
1.5827 + while ( elem.firstChild ) {
1.5828 + elem.removeChild( elem.firstChild );
1.5829 + }
1.5830 +
1.5831 + // If this is a select, ensure that it displays empty (#12336)
1.5832 + // Support: IE<9
1.5833 + if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
1.5834 + elem.options.length = 0;
1.5835 + }
1.5836 + }
1.5837 +
1.5838 + return this;
1.5839 + },
1.5840 +
1.5841 + clone: function( dataAndEvents, deepDataAndEvents ) {
1.5842 + dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
1.5843 + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
1.5844 +
1.5845 + return this.map(function() {
1.5846 + return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
1.5847 + });
1.5848 + },
1.5849 +
1.5850 + html: function( value ) {
1.5851 + return access( this, function( value ) {
1.5852 + var elem = this[ 0 ] || {},
1.5853 + i = 0,
1.5854 + l = this.length;
1.5855 +
1.5856 + if ( value === undefined ) {
1.5857 + return elem.nodeType === 1 ?
1.5858 + elem.innerHTML.replace( rinlinejQuery, "" ) :
1.5859 + undefined;
1.5860 + }
1.5861 +
1.5862 + // See if we can take a shortcut and just use innerHTML
1.5863 + if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
1.5864 + ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
1.5865 + ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
1.5866 + !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
1.5867 +
1.5868 + value = value.replace( rxhtmlTag, "<$1></$2>" );
1.5869 +
1.5870 + try {
1.5871 + for (; i < l; i++ ) {
1.5872 + // Remove element nodes and prevent memory leaks
1.5873 + elem = this[i] || {};
1.5874 + if ( elem.nodeType === 1 ) {
1.5875 + jQuery.cleanData( getAll( elem, false ) );
1.5876 + elem.innerHTML = value;
1.5877 + }
1.5878 + }
1.5879 +
1.5880 + elem = 0;
1.5881 +
1.5882 + // If using innerHTML throws an exception, use the fallback method
1.5883 + } catch(e) {}
1.5884 + }
1.5885 +
1.5886 + if ( elem ) {
1.5887 + this.empty().append( value );
1.5888 + }
1.5889 + }, null, value, arguments.length );
1.5890 + },
1.5891 +
1.5892 + replaceWith: function() {
1.5893 + var arg = arguments[ 0 ];
1.5894 +
1.5895 + // Make the changes, replacing each context element with the new content
1.5896 + this.domManip( arguments, function( elem ) {
1.5897 + arg = this.parentNode;
1.5898 +
1.5899 + jQuery.cleanData( getAll( this ) );
1.5900 +
1.5901 + if ( arg ) {
1.5902 + arg.replaceChild( elem, this );
1.5903 + }
1.5904 + });
1.5905 +
1.5906 + // Force removal if there was no new content (e.g., from empty arguments)
1.5907 + return arg && (arg.length || arg.nodeType) ? this : this.remove();
1.5908 + },
1.5909 +
1.5910 + detach: function( selector ) {
1.5911 + return this.remove( selector, true );
1.5912 + },
1.5913 +
1.5914 + domManip: function( args, callback ) {
1.5915 +
1.5916 + // Flatten any nested arrays
1.5917 + args = concat.apply( [], args );
1.5918 +
1.5919 + var first, node, hasScripts,
1.5920 + scripts, doc, fragment,
1.5921 + i = 0,
1.5922 + l = this.length,
1.5923 + set = this,
1.5924 + iNoClone = l - 1,
1.5925 + value = args[0],
1.5926 + isFunction = jQuery.isFunction( value );
1.5927 +
1.5928 + // We can't cloneNode fragments that contain checked, in WebKit
1.5929 + if ( isFunction ||
1.5930 + ( l > 1 && typeof value === "string" &&
1.5931 + !support.checkClone && rchecked.test( value ) ) ) {
1.5932 + return this.each(function( index ) {
1.5933 + var self = set.eq( index );
1.5934 + if ( isFunction ) {
1.5935 + args[0] = value.call( this, index, self.html() );
1.5936 + }
1.5937 + self.domManip( args, callback );
1.5938 + });
1.5939 + }
1.5940 +
1.5941 + if ( l ) {
1.5942 + fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
1.5943 + first = fragment.firstChild;
1.5944 +
1.5945 + if ( fragment.childNodes.length === 1 ) {
1.5946 + fragment = first;
1.5947 + }
1.5948 +
1.5949 + if ( first ) {
1.5950 + scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
1.5951 + hasScripts = scripts.length;
1.5952 +
1.5953 + // Use the original fragment for the last item instead of the first because it can end up
1.5954 + // being emptied incorrectly in certain situations (#8070).
1.5955 + for ( ; i < l; i++ ) {
1.5956 + node = fragment;
1.5957 +
1.5958 + if ( i !== iNoClone ) {
1.5959 + node = jQuery.clone( node, true, true );
1.5960 +
1.5961 + // Keep references to cloned scripts for later restoration
1.5962 + if ( hasScripts ) {
1.5963 + jQuery.merge( scripts, getAll( node, "script" ) );
1.5964 + }
1.5965 + }
1.5966 +
1.5967 + callback.call( this[i], node, i );
1.5968 + }
1.5969 +
1.5970 + if ( hasScripts ) {
1.5971 + doc = scripts[ scripts.length - 1 ].ownerDocument;
1.5972 +
1.5973 + // Reenable scripts
1.5974 + jQuery.map( scripts, restoreScript );
1.5975 +
1.5976 + // Evaluate executable scripts on first document insertion
1.5977 + for ( i = 0; i < hasScripts; i++ ) {
1.5978 + node = scripts[ i ];
1.5979 + if ( rscriptType.test( node.type || "" ) &&
1.5980 + !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
1.5981 +
1.5982 + if ( node.src ) {
1.5983 + // Optional AJAX dependency, but won't run scripts if not present
1.5984 + if ( jQuery._evalUrl ) {
1.5985 + jQuery._evalUrl( node.src );
1.5986 + }
1.5987 + } else {
1.5988 + jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
1.5989 + }
1.5990 + }
1.5991 + }
1.5992 + }
1.5993 +
1.5994 + // Fix #11809: Avoid leaking memory
1.5995 + fragment = first = null;
1.5996 + }
1.5997 + }
1.5998 +
1.5999 + return this;
1.6000 + }
1.6001 +});
1.6002 +
1.6003 +jQuery.each({
1.6004 + appendTo: "append",
1.6005 + prependTo: "prepend",
1.6006 + insertBefore: "before",
1.6007 + insertAfter: "after",
1.6008 + replaceAll: "replaceWith"
1.6009 +}, function( name, original ) {
1.6010 + jQuery.fn[ name ] = function( selector ) {
1.6011 + var elems,
1.6012 + i = 0,
1.6013 + ret = [],
1.6014 + insert = jQuery( selector ),
1.6015 + last = insert.length - 1;
1.6016 +
1.6017 + for ( ; i <= last; i++ ) {
1.6018 + elems = i === last ? this : this.clone(true);
1.6019 + jQuery( insert[i] )[ original ]( elems );
1.6020 +
1.6021 + // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
1.6022 + push.apply( ret, elems.get() );
1.6023 + }
1.6024 +
1.6025 + return this.pushStack( ret );
1.6026 + };
1.6027 +});
1.6028 +
1.6029 +
1.6030 +var iframe,
1.6031 + elemdisplay = {};
1.6032 +
1.6033 +/**
1.6034 + * Retrieve the actual display of a element
1.6035 + * @param {String} name nodeName of the element
1.6036 + * @param {Object} doc Document object
1.6037 + */
1.6038 +// Called only from within defaultDisplay
1.6039 +function actualDisplay( name, doc ) {
1.6040 + var style,
1.6041 + elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
1.6042 +
1.6043 + // getDefaultComputedStyle might be reliably used only on attached element
1.6044 + display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
1.6045 +
1.6046 + // Use of this method is a temporary fix (more like optmization) until something better comes along,
1.6047 + // since it was removed from specification and supported only in FF
1.6048 + style.display : jQuery.css( elem[ 0 ], "display" );
1.6049 +
1.6050 + // We don't have any data stored on the element,
1.6051 + // so use "detach" method as fast way to get rid of the element
1.6052 + elem.detach();
1.6053 +
1.6054 + return display;
1.6055 +}
1.6056 +
1.6057 +/**
1.6058 + * Try to determine the default display value of an element
1.6059 + * @param {String} nodeName
1.6060 + */
1.6061 +function defaultDisplay( nodeName ) {
1.6062 + var doc = document,
1.6063 + display = elemdisplay[ nodeName ];
1.6064 +
1.6065 + if ( !display ) {
1.6066 + display = actualDisplay( nodeName, doc );
1.6067 +
1.6068 + // If the simple way fails, read from inside an iframe
1.6069 + if ( display === "none" || !display ) {
1.6070 +
1.6071 + // Use the already-created iframe if possible
1.6072 + iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
1.6073 +
1.6074 + // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
1.6075 + doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
1.6076 +
1.6077 + // Support: IE
1.6078 + doc.write();
1.6079 + doc.close();
1.6080 +
1.6081 + display = actualDisplay( nodeName, doc );
1.6082 + iframe.detach();
1.6083 + }
1.6084 +
1.6085 + // Store the correct default display
1.6086 + elemdisplay[ nodeName ] = display;
1.6087 + }
1.6088 +
1.6089 + return display;
1.6090 +}
1.6091 +
1.6092 +
1.6093 +(function() {
1.6094 + var shrinkWrapBlocksVal;
1.6095 +
1.6096 + support.shrinkWrapBlocks = function() {
1.6097 + if ( shrinkWrapBlocksVal != null ) {
1.6098 + return shrinkWrapBlocksVal;
1.6099 + }
1.6100 +
1.6101 + // Will be changed later if needed.
1.6102 + shrinkWrapBlocksVal = false;
1.6103 +
1.6104 + // Minified: var b,c,d
1.6105 + var div, body, container;
1.6106 +
1.6107 + body = document.getElementsByTagName( "body" )[ 0 ];
1.6108 + if ( !body || !body.style ) {
1.6109 + // Test fired too early or in an unsupported environment, exit.
1.6110 + return;
1.6111 + }
1.6112 +
1.6113 + // Setup
1.6114 + div = document.createElement( "div" );
1.6115 + container = document.createElement( "div" );
1.6116 + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
1.6117 + body.appendChild( container ).appendChild( div );
1.6118 +
1.6119 + // Support: IE6
1.6120 + // Check if elements with layout shrink-wrap their children
1.6121 + if ( typeof div.style.zoom !== strundefined ) {
1.6122 + // Reset CSS: box-sizing; display; margin; border
1.6123 + div.style.cssText =
1.6124 + // Support: Firefox<29, Android 2.3
1.6125 + // Vendor-prefix box-sizing
1.6126 + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
1.6127 + "box-sizing:content-box;display:block;margin:0;border:0;" +
1.6128 + "padding:1px;width:1px;zoom:1";
1.6129 + div.appendChild( document.createElement( "div" ) ).style.width = "5px";
1.6130 + shrinkWrapBlocksVal = div.offsetWidth !== 3;
1.6131 + }
1.6132 +
1.6133 + body.removeChild( container );
1.6134 +
1.6135 + return shrinkWrapBlocksVal;
1.6136 + };
1.6137 +
1.6138 +})();
1.6139 +var rmargin = (/^margin/);
1.6140 +
1.6141 +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
1.6142 +
1.6143 +
1.6144 +
1.6145 +var getStyles, curCSS,
1.6146 + rposition = /^(top|right|bottom|left)$/;
1.6147 +
1.6148 +if ( window.getComputedStyle ) {
1.6149 + getStyles = function( elem ) {
1.6150 + // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
1.6151 + // IE throws on elements created in popups
1.6152 + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
1.6153 + if ( elem.ownerDocument.defaultView.opener ) {
1.6154 + return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
1.6155 + }
1.6156 +
1.6157 + return window.getComputedStyle( elem, null );
1.6158 + };
1.6159 +
1.6160 + curCSS = function( elem, name, computed ) {
1.6161 + var width, minWidth, maxWidth, ret,
1.6162 + style = elem.style;
1.6163 +
1.6164 + computed = computed || getStyles( elem );
1.6165 +
1.6166 + // getPropertyValue is only needed for .css('filter') in IE9, see #12537
1.6167 + ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
1.6168 +
1.6169 + if ( computed ) {
1.6170 +
1.6171 + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
1.6172 + ret = jQuery.style( elem, name );
1.6173 + }
1.6174 +
1.6175 + // A tribute to the "awesome hack by Dean Edwards"
1.6176 + // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
1.6177 + // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
1.6178 + // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
1.6179 + if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
1.6180 +
1.6181 + // Remember the original values
1.6182 + width = style.width;
1.6183 + minWidth = style.minWidth;
1.6184 + maxWidth = style.maxWidth;
1.6185 +
1.6186 + // Put in the new values to get a computed value out
1.6187 + style.minWidth = style.maxWidth = style.width = ret;
1.6188 + ret = computed.width;
1.6189 +
1.6190 + // Revert the changed values
1.6191 + style.width = width;
1.6192 + style.minWidth = minWidth;
1.6193 + style.maxWidth = maxWidth;
1.6194 + }
1.6195 + }
1.6196 +
1.6197 + // Support: IE
1.6198 + // IE returns zIndex value as an integer.
1.6199 + return ret === undefined ?
1.6200 + ret :
1.6201 + ret + "";
1.6202 + };
1.6203 +} else if ( document.documentElement.currentStyle ) {
1.6204 + getStyles = function( elem ) {
1.6205 + return elem.currentStyle;
1.6206 + };
1.6207 +
1.6208 + curCSS = function( elem, name, computed ) {
1.6209 + var left, rs, rsLeft, ret,
1.6210 + style = elem.style;
1.6211 +
1.6212 + computed = computed || getStyles( elem );
1.6213 + ret = computed ? computed[ name ] : undefined;
1.6214 +
1.6215 + // Avoid setting ret to empty string here
1.6216 + // so we don't default to auto
1.6217 + if ( ret == null && style && style[ name ] ) {
1.6218 + ret = style[ name ];
1.6219 + }
1.6220 +
1.6221 + // From the awesome hack by Dean Edwards
1.6222 + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
1.6223 +
1.6224 + // If we're not dealing with a regular pixel number
1.6225 + // but a number that has a weird ending, we need to convert it to pixels
1.6226 + // but not position css attributes, as those are proportional to the parent element instead
1.6227 + // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
1.6228 + if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
1.6229 +
1.6230 + // Remember the original values
1.6231 + left = style.left;
1.6232 + rs = elem.runtimeStyle;
1.6233 + rsLeft = rs && rs.left;
1.6234 +
1.6235 + // Put in the new values to get a computed value out
1.6236 + if ( rsLeft ) {
1.6237 + rs.left = elem.currentStyle.left;
1.6238 + }
1.6239 + style.left = name === "fontSize" ? "1em" : ret;
1.6240 + ret = style.pixelLeft + "px";
1.6241 +
1.6242 + // Revert the changed values
1.6243 + style.left = left;
1.6244 + if ( rsLeft ) {
1.6245 + rs.left = rsLeft;
1.6246 + }
1.6247 + }
1.6248 +
1.6249 + // Support: IE
1.6250 + // IE returns zIndex value as an integer.
1.6251 + return ret === undefined ?
1.6252 + ret :
1.6253 + ret + "" || "auto";
1.6254 + };
1.6255 +}
1.6256 +
1.6257 +
1.6258 +
1.6259 +
1.6260 +function addGetHookIf( conditionFn, hookFn ) {
1.6261 + // Define the hook, we'll check on the first run if it's really needed.
1.6262 + return {
1.6263 + get: function() {
1.6264 + var condition = conditionFn();
1.6265 +
1.6266 + if ( condition == null ) {
1.6267 + // The test was not ready at this point; screw the hook this time
1.6268 + // but check again when needed next time.
1.6269 + return;
1.6270 + }
1.6271 +
1.6272 + if ( condition ) {
1.6273 + // Hook not needed (or it's not possible to use it due to missing dependency),
1.6274 + // remove it.
1.6275 + // Since there are no other hooks for marginRight, remove the whole object.
1.6276 + delete this.get;
1.6277 + return;
1.6278 + }
1.6279 +
1.6280 + // Hook needed; redefine it so that the support test is not executed again.
1.6281 +
1.6282 + return (this.get = hookFn).apply( this, arguments );
1.6283 + }
1.6284 + };
1.6285 +}
1.6286 +
1.6287 +
1.6288 +(function() {
1.6289 + // Minified: var b,c,d,e,f,g, h,i
1.6290 + var div, style, a, pixelPositionVal, boxSizingReliableVal,
1.6291 + reliableHiddenOffsetsVal, reliableMarginRightVal;
1.6292 +
1.6293 + // Setup
1.6294 + div = document.createElement( "div" );
1.6295 + div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
1.6296 + a = div.getElementsByTagName( "a" )[ 0 ];
1.6297 + style = a && a.style;
1.6298 +
1.6299 + // Finish early in limited (non-browser) environments
1.6300 + if ( !style ) {
1.6301 + return;
1.6302 + }
1.6303 +
1.6304 + style.cssText = "float:left;opacity:.5";
1.6305 +
1.6306 + // Support: IE<9
1.6307 + // Make sure that element opacity exists (as opposed to filter)
1.6308 + support.opacity = style.opacity === "0.5";
1.6309 +
1.6310 + // Verify style float existence
1.6311 + // (IE uses styleFloat instead of cssFloat)
1.6312 + support.cssFloat = !!style.cssFloat;
1.6313 +
1.6314 + div.style.backgroundClip = "content-box";
1.6315 + div.cloneNode( true ).style.backgroundClip = "";
1.6316 + support.clearCloneStyle = div.style.backgroundClip === "content-box";
1.6317 +
1.6318 + // Support: Firefox<29, Android 2.3
1.6319 + // Vendor-prefix box-sizing
1.6320 + support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||
1.6321 + style.WebkitBoxSizing === "";
1.6322 +
1.6323 + jQuery.extend(support, {
1.6324 + reliableHiddenOffsets: function() {
1.6325 + if ( reliableHiddenOffsetsVal == null ) {
1.6326 + computeStyleTests();
1.6327 + }
1.6328 + return reliableHiddenOffsetsVal;
1.6329 + },
1.6330 +
1.6331 + boxSizingReliable: function() {
1.6332 + if ( boxSizingReliableVal == null ) {
1.6333 + computeStyleTests();
1.6334 + }
1.6335 + return boxSizingReliableVal;
1.6336 + },
1.6337 +
1.6338 + pixelPosition: function() {
1.6339 + if ( pixelPositionVal == null ) {
1.6340 + computeStyleTests();
1.6341 + }
1.6342 + return pixelPositionVal;
1.6343 + },
1.6344 +
1.6345 + // Support: Android 2.3
1.6346 + reliableMarginRight: function() {
1.6347 + if ( reliableMarginRightVal == null ) {
1.6348 + computeStyleTests();
1.6349 + }
1.6350 + return reliableMarginRightVal;
1.6351 + }
1.6352 + });
1.6353 +
1.6354 + function computeStyleTests() {
1.6355 + // Minified: var b,c,d,j
1.6356 + var div, body, container, contents;
1.6357 +
1.6358 + body = document.getElementsByTagName( "body" )[ 0 ];
1.6359 + if ( !body || !body.style ) {
1.6360 + // Test fired too early or in an unsupported environment, exit.
1.6361 + return;
1.6362 + }
1.6363 +
1.6364 + // Setup
1.6365 + div = document.createElement( "div" );
1.6366 + container = document.createElement( "div" );
1.6367 + container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
1.6368 + body.appendChild( container ).appendChild( div );
1.6369 +
1.6370 + div.style.cssText =
1.6371 + // Support: Firefox<29, Android 2.3
1.6372 + // Vendor-prefix box-sizing
1.6373 + "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
1.6374 + "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
1.6375 + "border:1px;padding:1px;width:4px;position:absolute";
1.6376 +
1.6377 + // Support: IE<9
1.6378 + // Assume reasonable values in the absence of getComputedStyle
1.6379 + pixelPositionVal = boxSizingReliableVal = false;
1.6380 + reliableMarginRightVal = true;
1.6381 +
1.6382 + // Check for getComputedStyle so that this code is not run in IE<9.
1.6383 + if ( window.getComputedStyle ) {
1.6384 + pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
1.6385 + boxSizingReliableVal =
1.6386 + ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
1.6387 +
1.6388 + // Support: Android 2.3
1.6389 + // Div with explicit width and no margin-right incorrectly
1.6390 + // gets computed margin-right based on width of container (#3333)
1.6391 + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1.6392 + contents = div.appendChild( document.createElement( "div" ) );
1.6393 +
1.6394 + // Reset CSS: box-sizing; display; margin; border; padding
1.6395 + contents.style.cssText = div.style.cssText =
1.6396 + // Support: Firefox<29, Android 2.3
1.6397 + // Vendor-prefix box-sizing
1.6398 + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
1.6399 + "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
1.6400 + contents.style.marginRight = contents.style.width = "0";
1.6401 + div.style.width = "1px";
1.6402 +
1.6403 + reliableMarginRightVal =
1.6404 + !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
1.6405 +
1.6406 + div.removeChild( contents );
1.6407 + }
1.6408 +
1.6409 + // Support: IE8
1.6410 + // Check if table cells still have offsetWidth/Height when they are set
1.6411 + // to display:none and there are still other visible table cells in a
1.6412 + // table row; if so, offsetWidth/Height are not reliable for use when
1.6413 + // determining if an element has been hidden directly using
1.6414 + // display:none (it is still safe to use offsets if a parent element is
1.6415 + // hidden; don safety goggles and see bug #4512 for more information).
1.6416 + div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
1.6417 + contents = div.getElementsByTagName( "td" );
1.6418 + contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
1.6419 + reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
1.6420 + if ( reliableHiddenOffsetsVal ) {
1.6421 + contents[ 0 ].style.display = "";
1.6422 + contents[ 1 ].style.display = "none";
1.6423 + reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
1.6424 + }
1.6425 +
1.6426 + body.removeChild( container );
1.6427 + }
1.6428 +
1.6429 +})();
1.6430 +
1.6431 +
1.6432 +// A method for quickly swapping in/out CSS properties to get correct calculations.
1.6433 +jQuery.swap = function( elem, options, callback, args ) {
1.6434 + var ret, name,
1.6435 + old = {};
1.6436 +
1.6437 + // Remember the old values, and insert the new ones
1.6438 + for ( name in options ) {
1.6439 + old[ name ] = elem.style[ name ];
1.6440 + elem.style[ name ] = options[ name ];
1.6441 + }
1.6442 +
1.6443 + ret = callback.apply( elem, args || [] );
1.6444 +
1.6445 + // Revert the old values
1.6446 + for ( name in options ) {
1.6447 + elem.style[ name ] = old[ name ];
1.6448 + }
1.6449 +
1.6450 + return ret;
1.6451 +};
1.6452 +
1.6453 +
1.6454 +var
1.6455 + ralpha = /alpha\([^)]*\)/i,
1.6456 + ropacity = /opacity\s*=\s*([^)]*)/,
1.6457 +
1.6458 + // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
1.6459 + // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
1.6460 + rdisplayswap = /^(none|table(?!-c[ea]).+)/,
1.6461 + rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
1.6462 + rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
1.6463 +
1.6464 + cssShow = { position: "absolute", visibility: "hidden", display: "block" },
1.6465 + cssNormalTransform = {
1.6466 + letterSpacing: "0",
1.6467 + fontWeight: "400"
1.6468 + },
1.6469 +
1.6470 + cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
1.6471 +
1.6472 +
1.6473 +// return a css property mapped to a potentially vendor prefixed property
1.6474 +function vendorPropName( style, name ) {
1.6475 +
1.6476 + // shortcut for names that are not vendor prefixed
1.6477 + if ( name in style ) {
1.6478 + return name;
1.6479 + }
1.6480 +
1.6481 + // check for vendor prefixed names
1.6482 + var capName = name.charAt(0).toUpperCase() + name.slice(1),
1.6483 + origName = name,
1.6484 + i = cssPrefixes.length;
1.6485 +
1.6486 + while ( i-- ) {
1.6487 + name = cssPrefixes[ i ] + capName;
1.6488 + if ( name in style ) {
1.6489 + return name;
1.6490 + }
1.6491 + }
1.6492 +
1.6493 + return origName;
1.6494 +}
1.6495 +
1.6496 +function showHide( elements, show ) {
1.6497 + var display, elem, hidden,
1.6498 + values = [],
1.6499 + index = 0,
1.6500 + length = elements.length;
1.6501 +
1.6502 + for ( ; index < length; index++ ) {
1.6503 + elem = elements[ index ];
1.6504 + if ( !elem.style ) {
1.6505 + continue;
1.6506 + }
1.6507 +
1.6508 + values[ index ] = jQuery._data( elem, "olddisplay" );
1.6509 + display = elem.style.display;
1.6510 + if ( show ) {
1.6511 + // Reset the inline display of this element to learn if it is
1.6512 + // being hidden by cascaded rules or not
1.6513 + if ( !values[ index ] && display === "none" ) {
1.6514 + elem.style.display = "";
1.6515 + }
1.6516 +
1.6517 + // Set elements which have been overridden with display: none
1.6518 + // in a stylesheet to whatever the default browser style is
1.6519 + // for such an element
1.6520 + if ( elem.style.display === "" && isHidden( elem ) ) {
1.6521 + values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
1.6522 + }
1.6523 + } else {
1.6524 + hidden = isHidden( elem );
1.6525 +
1.6526 + if ( display && display !== "none" || !hidden ) {
1.6527 + jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
1.6528 + }
1.6529 + }
1.6530 + }
1.6531 +
1.6532 + // Set the display of most of the elements in a second loop
1.6533 + // to avoid the constant reflow
1.6534 + for ( index = 0; index < length; index++ ) {
1.6535 + elem = elements[ index ];
1.6536 + if ( !elem.style ) {
1.6537 + continue;
1.6538 + }
1.6539 + if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
1.6540 + elem.style.display = show ? values[ index ] || "" : "none";
1.6541 + }
1.6542 + }
1.6543 +
1.6544 + return elements;
1.6545 +}
1.6546 +
1.6547 +function setPositiveNumber( elem, value, subtract ) {
1.6548 + var matches = rnumsplit.exec( value );
1.6549 + return matches ?
1.6550 + // Guard against undefined "subtract", e.g., when used as in cssHooks
1.6551 + Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
1.6552 + value;
1.6553 +}
1.6554 +
1.6555 +function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
1.6556 + var i = extra === ( isBorderBox ? "border" : "content" ) ?
1.6557 + // If we already have the right measurement, avoid augmentation
1.6558 + 4 :
1.6559 + // Otherwise initialize for horizontal or vertical properties
1.6560 + name === "width" ? 1 : 0,
1.6561 +
1.6562 + val = 0;
1.6563 +
1.6564 + for ( ; i < 4; i += 2 ) {
1.6565 + // both box models exclude margin, so add it if we want it
1.6566 + if ( extra === "margin" ) {
1.6567 + val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
1.6568 + }
1.6569 +
1.6570 + if ( isBorderBox ) {
1.6571 + // border-box includes padding, so remove it if we want content
1.6572 + if ( extra === "content" ) {
1.6573 + val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
1.6574 + }
1.6575 +
1.6576 + // at this point, extra isn't border nor margin, so remove border
1.6577 + if ( extra !== "margin" ) {
1.6578 + val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
1.6579 + }
1.6580 + } else {
1.6581 + // at this point, extra isn't content, so add padding
1.6582 + val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
1.6583 +
1.6584 + // at this point, extra isn't content nor padding, so add border
1.6585 + if ( extra !== "padding" ) {
1.6586 + val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
1.6587 + }
1.6588 + }
1.6589 + }
1.6590 +
1.6591 + return val;
1.6592 +}
1.6593 +
1.6594 +function getWidthOrHeight( elem, name, extra ) {
1.6595 +
1.6596 + // Start with offset property, which is equivalent to the border-box value
1.6597 + var valueIsBorderBox = true,
1.6598 + val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
1.6599 + styles = getStyles( elem ),
1.6600 + isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
1.6601 +
1.6602 + // some non-html elements return undefined for offsetWidth, so check for null/undefined
1.6603 + // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
1.6604 + // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
1.6605 + if ( val <= 0 || val == null ) {
1.6606 + // Fall back to computed then uncomputed css if necessary
1.6607 + val = curCSS( elem, name, styles );
1.6608 + if ( val < 0 || val == null ) {
1.6609 + val = elem.style[ name ];
1.6610 + }
1.6611 +
1.6612 + // Computed unit is not pixels. Stop here and return.
1.6613 + if ( rnumnonpx.test(val) ) {
1.6614 + return val;
1.6615 + }
1.6616 +
1.6617 + // we need the check for style in case a browser which returns unreliable values
1.6618 + // for getComputedStyle silently falls back to the reliable elem.style
1.6619 + valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
1.6620 +
1.6621 + // Normalize "", auto, and prepare for extra
1.6622 + val = parseFloat( val ) || 0;
1.6623 + }
1.6624 +
1.6625 + // use the active box-sizing model to add/subtract irrelevant styles
1.6626 + return ( val +
1.6627 + augmentWidthOrHeight(
1.6628 + elem,
1.6629 + name,
1.6630 + extra || ( isBorderBox ? "border" : "content" ),
1.6631 + valueIsBorderBox,
1.6632 + styles
1.6633 + )
1.6634 + ) + "px";
1.6635 +}
1.6636 +
1.6637 +jQuery.extend({
1.6638 + // Add in style property hooks for overriding the default
1.6639 + // behavior of getting and setting a style property
1.6640 + cssHooks: {
1.6641 + opacity: {
1.6642 + get: function( elem, computed ) {
1.6643 + if ( computed ) {
1.6644 + // We should always get a number back from opacity
1.6645 + var ret = curCSS( elem, "opacity" );
1.6646 + return ret === "" ? "1" : ret;
1.6647 + }
1.6648 + }
1.6649 + }
1.6650 + },
1.6651 +
1.6652 + // Don't automatically add "px" to these possibly-unitless properties
1.6653 + cssNumber: {
1.6654 + "columnCount": true,
1.6655 + "fillOpacity": true,
1.6656 + "flexGrow": true,
1.6657 + "flexShrink": true,
1.6658 + "fontWeight": true,
1.6659 + "lineHeight": true,
1.6660 + "opacity": true,
1.6661 + "order": true,
1.6662 + "orphans": true,
1.6663 + "widows": true,
1.6664 + "zIndex": true,
1.6665 + "zoom": true
1.6666 + },
1.6667 +
1.6668 + // Add in properties whose names you wish to fix before
1.6669 + // setting or getting the value
1.6670 + cssProps: {
1.6671 + // normalize float css property
1.6672 + "float": support.cssFloat ? "cssFloat" : "styleFloat"
1.6673 + },
1.6674 +
1.6675 + // Get and set the style property on a DOM Node
1.6676 + style: function( elem, name, value, extra ) {
1.6677 + // Don't set styles on text and comment nodes
1.6678 + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
1.6679 + return;
1.6680 + }
1.6681 +
1.6682 + // Make sure that we're working with the right name
1.6683 + var ret, type, hooks,
1.6684 + origName = jQuery.camelCase( name ),
1.6685 + style = elem.style;
1.6686 +
1.6687 + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
1.6688 +
1.6689 + // gets hook for the prefixed version
1.6690 + // followed by the unprefixed version
1.6691 + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
1.6692 +
1.6693 + // Check if we're setting a value
1.6694 + if ( value !== undefined ) {
1.6695 + type = typeof value;
1.6696 +
1.6697 + // convert relative number strings (+= or -=) to relative numbers. #7345
1.6698 + if ( type === "string" && (ret = rrelNum.exec( value )) ) {
1.6699 + value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
1.6700 + // Fixes bug #9237
1.6701 + type = "number";
1.6702 + }
1.6703 +
1.6704 + // Make sure that null and NaN values aren't set. See: #7116
1.6705 + if ( value == null || value !== value ) {
1.6706 + return;
1.6707 + }
1.6708 +
1.6709 + // If a number was passed in, add 'px' to the (except for certain CSS properties)
1.6710 + if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
1.6711 + value += "px";
1.6712 + }
1.6713 +
1.6714 + // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
1.6715 + // but it would mean to define eight (for every problematic property) identical functions
1.6716 + if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
1.6717 + style[ name ] = "inherit";
1.6718 + }
1.6719 +
1.6720 + // If a hook was provided, use that value, otherwise just set the specified value
1.6721 + if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
1.6722 +
1.6723 + // Support: IE
1.6724 + // Swallow errors from 'invalid' CSS values (#5509)
1.6725 + try {
1.6726 + style[ name ] = value;
1.6727 + } catch(e) {}
1.6728 + }
1.6729 +
1.6730 + } else {
1.6731 + // If a hook was provided get the non-computed value from there
1.6732 + if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
1.6733 + return ret;
1.6734 + }
1.6735 +
1.6736 + // Otherwise just get the value from the style object
1.6737 + return style[ name ];
1.6738 + }
1.6739 + },
1.6740 +
1.6741 + css: function( elem, name, extra, styles ) {
1.6742 + var num, val, hooks,
1.6743 + origName = jQuery.camelCase( name );
1.6744 +
1.6745 + // Make sure that we're working with the right name
1.6746 + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
1.6747 +
1.6748 + // gets hook for the prefixed version
1.6749 + // followed by the unprefixed version
1.6750 + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
1.6751 +
1.6752 + // If a hook was provided get the computed value from there
1.6753 + if ( hooks && "get" in hooks ) {
1.6754 + val = hooks.get( elem, true, extra );
1.6755 + }
1.6756 +
1.6757 + // Otherwise, if a way to get the computed value exists, use that
1.6758 + if ( val === undefined ) {
1.6759 + val = curCSS( elem, name, styles );
1.6760 + }
1.6761 +
1.6762 + //convert "normal" to computed value
1.6763 + if ( val === "normal" && name in cssNormalTransform ) {
1.6764 + val = cssNormalTransform[ name ];
1.6765 + }
1.6766 +
1.6767 + // Return, converting to number if forced or a qualifier was provided and val looks numeric
1.6768 + if ( extra === "" || extra ) {
1.6769 + num = parseFloat( val );
1.6770 + return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
1.6771 + }
1.6772 + return val;
1.6773 + }
1.6774 +});
1.6775 +
1.6776 +jQuery.each([ "height", "width" ], function( i, name ) {
1.6777 + jQuery.cssHooks[ name ] = {
1.6778 + get: function( elem, computed, extra ) {
1.6779 + if ( computed ) {
1.6780 + // certain elements can have dimension info if we invisibly show them
1.6781 + // however, it must have a current display style that would benefit from this
1.6782 + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
1.6783 + jQuery.swap( elem, cssShow, function() {
1.6784 + return getWidthOrHeight( elem, name, extra );
1.6785 + }) :
1.6786 + getWidthOrHeight( elem, name, extra );
1.6787 + }
1.6788 + },
1.6789 +
1.6790 + set: function( elem, value, extra ) {
1.6791 + var styles = extra && getStyles( elem );
1.6792 + return setPositiveNumber( elem, value, extra ?
1.6793 + augmentWidthOrHeight(
1.6794 + elem,
1.6795 + name,
1.6796 + extra,
1.6797 + support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
1.6798 + styles
1.6799 + ) : 0
1.6800 + );
1.6801 + }
1.6802 + };
1.6803 +});
1.6804 +
1.6805 +if ( !support.opacity ) {
1.6806 + jQuery.cssHooks.opacity = {
1.6807 + get: function( elem, computed ) {
1.6808 + // IE uses filters for opacity
1.6809 + return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
1.6810 + ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
1.6811 + computed ? "1" : "";
1.6812 + },
1.6813 +
1.6814 + set: function( elem, value ) {
1.6815 + var style = elem.style,
1.6816 + currentStyle = elem.currentStyle,
1.6817 + opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
1.6818 + filter = currentStyle && currentStyle.filter || style.filter || "";
1.6819 +
1.6820 + // IE has trouble with opacity if it does not have layout
1.6821 + // Force it by setting the zoom level
1.6822 + style.zoom = 1;
1.6823 +
1.6824 + // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
1.6825 + // if value === "", then remove inline opacity #12685
1.6826 + if ( ( value >= 1 || value === "" ) &&
1.6827 + jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
1.6828 + style.removeAttribute ) {
1.6829 +
1.6830 + // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
1.6831 + // if "filter:" is present at all, clearType is disabled, we want to avoid this
1.6832 + // style.removeAttribute is IE Only, but so apparently is this code path...
1.6833 + style.removeAttribute( "filter" );
1.6834 +
1.6835 + // if there is no filter style applied in a css rule or unset inline opacity, we are done
1.6836 + if ( value === "" || currentStyle && !currentStyle.filter ) {
1.6837 + return;
1.6838 + }
1.6839 + }
1.6840 +
1.6841 + // otherwise, set new filter values
1.6842 + style.filter = ralpha.test( filter ) ?
1.6843 + filter.replace( ralpha, opacity ) :
1.6844 + filter + " " + opacity;
1.6845 + }
1.6846 + };
1.6847 +}
1.6848 +
1.6849 +jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
1.6850 + function( elem, computed ) {
1.6851 + if ( computed ) {
1.6852 + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
1.6853 + // Work around by temporarily setting element display to inline-block
1.6854 + return jQuery.swap( elem, { "display": "inline-block" },
1.6855 + curCSS, [ elem, "marginRight" ] );
1.6856 + }
1.6857 + }
1.6858 +);
1.6859 +
1.6860 +// These hooks are used by animate to expand properties
1.6861 +jQuery.each({
1.6862 + margin: "",
1.6863 + padding: "",
1.6864 + border: "Width"
1.6865 +}, function( prefix, suffix ) {
1.6866 + jQuery.cssHooks[ prefix + suffix ] = {
1.6867 + expand: function( value ) {
1.6868 + var i = 0,
1.6869 + expanded = {},
1.6870 +
1.6871 + // assumes a single number if not a string
1.6872 + parts = typeof value === "string" ? value.split(" ") : [ value ];
1.6873 +
1.6874 + for ( ; i < 4; i++ ) {
1.6875 + expanded[ prefix + cssExpand[ i ] + suffix ] =
1.6876 + parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
1.6877 + }
1.6878 +
1.6879 + return expanded;
1.6880 + }
1.6881 + };
1.6882 +
1.6883 + if ( !rmargin.test( prefix ) ) {
1.6884 + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
1.6885 + }
1.6886 +});
1.6887 +
1.6888 +jQuery.fn.extend({
1.6889 + css: function( name, value ) {
1.6890 + return access( this, function( elem, name, value ) {
1.6891 + var styles, len,
1.6892 + map = {},
1.6893 + i = 0;
1.6894 +
1.6895 + if ( jQuery.isArray( name ) ) {
1.6896 + styles = getStyles( elem );
1.6897 + len = name.length;
1.6898 +
1.6899 + for ( ; i < len; i++ ) {
1.6900 + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
1.6901 + }
1.6902 +
1.6903 + return map;
1.6904 + }
1.6905 +
1.6906 + return value !== undefined ?
1.6907 + jQuery.style( elem, name, value ) :
1.6908 + jQuery.css( elem, name );
1.6909 + }, name, value, arguments.length > 1 );
1.6910 + },
1.6911 + show: function() {
1.6912 + return showHide( this, true );
1.6913 + },
1.6914 + hide: function() {
1.6915 + return showHide( this );
1.6916 + },
1.6917 + toggle: function( state ) {
1.6918 + if ( typeof state === "boolean" ) {
1.6919 + return state ? this.show() : this.hide();
1.6920 + }
1.6921 +
1.6922 + return this.each(function() {
1.6923 + if ( isHidden( this ) ) {
1.6924 + jQuery( this ).show();
1.6925 + } else {
1.6926 + jQuery( this ).hide();
1.6927 + }
1.6928 + });
1.6929 + }
1.6930 +});
1.6931 +
1.6932 +
1.6933 +function Tween( elem, options, prop, end, easing ) {
1.6934 + return new Tween.prototype.init( elem, options, prop, end, easing );
1.6935 +}
1.6936 +jQuery.Tween = Tween;
1.6937 +
1.6938 +Tween.prototype = {
1.6939 + constructor: Tween,
1.6940 + init: function( elem, options, prop, end, easing, unit ) {
1.6941 + this.elem = elem;
1.6942 + this.prop = prop;
1.6943 + this.easing = easing || "swing";
1.6944 + this.options = options;
1.6945 + this.start = this.now = this.cur();
1.6946 + this.end = end;
1.6947 + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
1.6948 + },
1.6949 + cur: function() {
1.6950 + var hooks = Tween.propHooks[ this.prop ];
1.6951 +
1.6952 + return hooks && hooks.get ?
1.6953 + hooks.get( this ) :
1.6954 + Tween.propHooks._default.get( this );
1.6955 + },
1.6956 + run: function( percent ) {
1.6957 + var eased,
1.6958 + hooks = Tween.propHooks[ this.prop ];
1.6959 +
1.6960 + if ( this.options.duration ) {
1.6961 + this.pos = eased = jQuery.easing[ this.easing ](
1.6962 + percent, this.options.duration * percent, 0, 1, this.options.duration
1.6963 + );
1.6964 + } else {
1.6965 + this.pos = eased = percent;
1.6966 + }
1.6967 + this.now = ( this.end - this.start ) * eased + this.start;
1.6968 +
1.6969 + if ( this.options.step ) {
1.6970 + this.options.step.call( this.elem, this.now, this );
1.6971 + }
1.6972 +
1.6973 + if ( hooks && hooks.set ) {
1.6974 + hooks.set( this );
1.6975 + } else {
1.6976 + Tween.propHooks._default.set( this );
1.6977 + }
1.6978 + return this;
1.6979 + }
1.6980 +};
1.6981 +
1.6982 +Tween.prototype.init.prototype = Tween.prototype;
1.6983 +
1.6984 +Tween.propHooks = {
1.6985 + _default: {
1.6986 + get: function( tween ) {
1.6987 + var result;
1.6988 +
1.6989 + if ( tween.elem[ tween.prop ] != null &&
1.6990 + (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
1.6991 + return tween.elem[ tween.prop ];
1.6992 + }
1.6993 +
1.6994 + // passing an empty string as a 3rd parameter to .css will automatically
1.6995 + // attempt a parseFloat and fallback to a string if the parse fails
1.6996 + // so, simple values such as "10px" are parsed to Float.
1.6997 + // complex values such as "rotate(1rad)" are returned as is.
1.6998 + result = jQuery.css( tween.elem, tween.prop, "" );
1.6999 + // Empty strings, null, undefined and "auto" are converted to 0.
1.7000 + return !result || result === "auto" ? 0 : result;
1.7001 + },
1.7002 + set: function( tween ) {
1.7003 + // use step hook for back compat - use cssHook if its there - use .style if its
1.7004 + // available and use plain properties where available
1.7005 + if ( jQuery.fx.step[ tween.prop ] ) {
1.7006 + jQuery.fx.step[ tween.prop ]( tween );
1.7007 + } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
1.7008 + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
1.7009 + } else {
1.7010 + tween.elem[ tween.prop ] = tween.now;
1.7011 + }
1.7012 + }
1.7013 + }
1.7014 +};
1.7015 +
1.7016 +// Support: IE <=9
1.7017 +// Panic based approach to setting things on disconnected nodes
1.7018 +
1.7019 +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
1.7020 + set: function( tween ) {
1.7021 + if ( tween.elem.nodeType && tween.elem.parentNode ) {
1.7022 + tween.elem[ tween.prop ] = tween.now;
1.7023 + }
1.7024 + }
1.7025 +};
1.7026 +
1.7027 +jQuery.easing = {
1.7028 + linear: function( p ) {
1.7029 + return p;
1.7030 + },
1.7031 + swing: function( p ) {
1.7032 + return 0.5 - Math.cos( p * Math.PI ) / 2;
1.7033 + }
1.7034 +};
1.7035 +
1.7036 +jQuery.fx = Tween.prototype.init;
1.7037 +
1.7038 +// Back Compat <1.8 extension point
1.7039 +jQuery.fx.step = {};
1.7040 +
1.7041 +
1.7042 +
1.7043 +
1.7044 +var
1.7045 + fxNow, timerId,
1.7046 + rfxtypes = /^(?:toggle|show|hide)$/,
1.7047 + rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
1.7048 + rrun = /queueHooks$/,
1.7049 + animationPrefilters = [ defaultPrefilter ],
1.7050 + tweeners = {
1.7051 + "*": [ function( prop, value ) {
1.7052 + var tween = this.createTween( prop, value ),
1.7053 + target = tween.cur(),
1.7054 + parts = rfxnum.exec( value ),
1.7055 + unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
1.7056 +
1.7057 + // Starting value computation is required for potential unit mismatches
1.7058 + start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
1.7059 + rfxnum.exec( jQuery.css( tween.elem, prop ) ),
1.7060 + scale = 1,
1.7061 + maxIterations = 20;
1.7062 +
1.7063 + if ( start && start[ 3 ] !== unit ) {
1.7064 + // Trust units reported by jQuery.css
1.7065 + unit = unit || start[ 3 ];
1.7066 +
1.7067 + // Make sure we update the tween properties later on
1.7068 + parts = parts || [];
1.7069 +
1.7070 + // Iteratively approximate from a nonzero starting point
1.7071 + start = +target || 1;
1.7072 +
1.7073 + do {
1.7074 + // If previous iteration zeroed out, double until we get *something*
1.7075 + // Use a string for doubling factor so we don't accidentally see scale as unchanged below
1.7076 + scale = scale || ".5";
1.7077 +
1.7078 + // Adjust and apply
1.7079 + start = start / scale;
1.7080 + jQuery.style( tween.elem, prop, start + unit );
1.7081 +
1.7082 + // Update scale, tolerating zero or NaN from tween.cur()
1.7083 + // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
1.7084 + } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
1.7085 + }
1.7086 +
1.7087 + // Update tween properties
1.7088 + if ( parts ) {
1.7089 + start = tween.start = +start || +target || 0;
1.7090 + tween.unit = unit;
1.7091 + // If a +=/-= token was provided, we're doing a relative animation
1.7092 + tween.end = parts[ 1 ] ?
1.7093 + start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
1.7094 + +parts[ 2 ];
1.7095 + }
1.7096 +
1.7097 + return tween;
1.7098 + } ]
1.7099 + };
1.7100 +
1.7101 +// Animations created synchronously will run synchronously
1.7102 +function createFxNow() {
1.7103 + setTimeout(function() {
1.7104 + fxNow = undefined;
1.7105 + });
1.7106 + return ( fxNow = jQuery.now() );
1.7107 +}
1.7108 +
1.7109 +// Generate parameters to create a standard animation
1.7110 +function genFx( type, includeWidth ) {
1.7111 + var which,
1.7112 + attrs = { height: type },
1.7113 + i = 0;
1.7114 +
1.7115 + // if we include width, step value is 1 to do all cssExpand values,
1.7116 + // if we don't include width, step value is 2 to skip over Left and Right
1.7117 + includeWidth = includeWidth ? 1 : 0;
1.7118 + for ( ; i < 4 ; i += 2 - includeWidth ) {
1.7119 + which = cssExpand[ i ];
1.7120 + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
1.7121 + }
1.7122 +
1.7123 + if ( includeWidth ) {
1.7124 + attrs.opacity = attrs.width = type;
1.7125 + }
1.7126 +
1.7127 + return attrs;
1.7128 +}
1.7129 +
1.7130 +function createTween( value, prop, animation ) {
1.7131 + var tween,
1.7132 + collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
1.7133 + index = 0,
1.7134 + length = collection.length;
1.7135 + for ( ; index < length; index++ ) {
1.7136 + if ( (tween = collection[ index ].call( animation, prop, value )) ) {
1.7137 +
1.7138 + // we're done with this property
1.7139 + return tween;
1.7140 + }
1.7141 + }
1.7142 +}
1.7143 +
1.7144 +function defaultPrefilter( elem, props, opts ) {
1.7145 + /* jshint validthis: true */
1.7146 + var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
1.7147 + anim = this,
1.7148 + orig = {},
1.7149 + style = elem.style,
1.7150 + hidden = elem.nodeType && isHidden( elem ),
1.7151 + dataShow = jQuery._data( elem, "fxshow" );
1.7152 +
1.7153 + // handle queue: false promises
1.7154 + if ( !opts.queue ) {
1.7155 + hooks = jQuery._queueHooks( elem, "fx" );
1.7156 + if ( hooks.unqueued == null ) {
1.7157 + hooks.unqueued = 0;
1.7158 + oldfire = hooks.empty.fire;
1.7159 + hooks.empty.fire = function() {
1.7160 + if ( !hooks.unqueued ) {
1.7161 + oldfire();
1.7162 + }
1.7163 + };
1.7164 + }
1.7165 + hooks.unqueued++;
1.7166 +
1.7167 + anim.always(function() {
1.7168 + // doing this makes sure that the complete handler will be called
1.7169 + // before this completes
1.7170 + anim.always(function() {
1.7171 + hooks.unqueued--;
1.7172 + if ( !jQuery.queue( elem, "fx" ).length ) {
1.7173 + hooks.empty.fire();
1.7174 + }
1.7175 + });
1.7176 + });
1.7177 + }
1.7178 +
1.7179 + // height/width overflow pass
1.7180 + if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
1.7181 + // Make sure that nothing sneaks out
1.7182 + // Record all 3 overflow attributes because IE does not
1.7183 + // change the overflow attribute when overflowX and
1.7184 + // overflowY are set to the same value
1.7185 + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
1.7186 +
1.7187 + // Set display property to inline-block for height/width
1.7188 + // animations on inline elements that are having width/height animated
1.7189 + display = jQuery.css( elem, "display" );
1.7190 +
1.7191 + // Test default display if display is currently "none"
1.7192 + checkDisplay = display === "none" ?
1.7193 + jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
1.7194 +
1.7195 + if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
1.7196 +
1.7197 + // inline-level elements accept inline-block;
1.7198 + // block-level elements need to be inline with layout
1.7199 + if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
1.7200 + style.display = "inline-block";
1.7201 + } else {
1.7202 + style.zoom = 1;
1.7203 + }
1.7204 + }
1.7205 + }
1.7206 +
1.7207 + if ( opts.overflow ) {
1.7208 + style.overflow = "hidden";
1.7209 + if ( !support.shrinkWrapBlocks() ) {
1.7210 + anim.always(function() {
1.7211 + style.overflow = opts.overflow[ 0 ];
1.7212 + style.overflowX = opts.overflow[ 1 ];
1.7213 + style.overflowY = opts.overflow[ 2 ];
1.7214 + });
1.7215 + }
1.7216 + }
1.7217 +
1.7218 + // show/hide pass
1.7219 + for ( prop in props ) {
1.7220 + value = props[ prop ];
1.7221 + if ( rfxtypes.exec( value ) ) {
1.7222 + delete props[ prop ];
1.7223 + toggle = toggle || value === "toggle";
1.7224 + if ( value === ( hidden ? "hide" : "show" ) ) {
1.7225 +
1.7226 + // 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
1.7227 + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
1.7228 + hidden = true;
1.7229 + } else {
1.7230 + continue;
1.7231 + }
1.7232 + }
1.7233 + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
1.7234 +
1.7235 + // Any non-fx value stops us from restoring the original display value
1.7236 + } else {
1.7237 + display = undefined;
1.7238 + }
1.7239 + }
1.7240 +
1.7241 + if ( !jQuery.isEmptyObject( orig ) ) {
1.7242 + if ( dataShow ) {
1.7243 + if ( "hidden" in dataShow ) {
1.7244 + hidden = dataShow.hidden;
1.7245 + }
1.7246 + } else {
1.7247 + dataShow = jQuery._data( elem, "fxshow", {} );
1.7248 + }
1.7249 +
1.7250 + // store state if its toggle - enables .stop().toggle() to "reverse"
1.7251 + if ( toggle ) {
1.7252 + dataShow.hidden = !hidden;
1.7253 + }
1.7254 + if ( hidden ) {
1.7255 + jQuery( elem ).show();
1.7256 + } else {
1.7257 + anim.done(function() {
1.7258 + jQuery( elem ).hide();
1.7259 + });
1.7260 + }
1.7261 + anim.done(function() {
1.7262 + var prop;
1.7263 + jQuery._removeData( elem, "fxshow" );
1.7264 + for ( prop in orig ) {
1.7265 + jQuery.style( elem, prop, orig[ prop ] );
1.7266 + }
1.7267 + });
1.7268 + for ( prop in orig ) {
1.7269 + tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
1.7270 +
1.7271 + if ( !( prop in dataShow ) ) {
1.7272 + dataShow[ prop ] = tween.start;
1.7273 + if ( hidden ) {
1.7274 + tween.end = tween.start;
1.7275 + tween.start = prop === "width" || prop === "height" ? 1 : 0;
1.7276 + }
1.7277 + }
1.7278 + }
1.7279 +
1.7280 + // If this is a noop like .hide().hide(), restore an overwritten display value
1.7281 + } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
1.7282 + style.display = display;
1.7283 + }
1.7284 +}
1.7285 +
1.7286 +function propFilter( props, specialEasing ) {
1.7287 + var index, name, easing, value, hooks;
1.7288 +
1.7289 + // camelCase, specialEasing and expand cssHook pass
1.7290 + for ( index in props ) {
1.7291 + name = jQuery.camelCase( index );
1.7292 + easing = specialEasing[ name ];
1.7293 + value = props[ index ];
1.7294 + if ( jQuery.isArray( value ) ) {
1.7295 + easing = value[ 1 ];
1.7296 + value = props[ index ] = value[ 0 ];
1.7297 + }
1.7298 +
1.7299 + if ( index !== name ) {
1.7300 + props[ name ] = value;
1.7301 + delete props[ index ];
1.7302 + }
1.7303 +
1.7304 + hooks = jQuery.cssHooks[ name ];
1.7305 + if ( hooks && "expand" in hooks ) {
1.7306 + value = hooks.expand( value );
1.7307 + delete props[ name ];
1.7308 +
1.7309 + // not quite $.extend, this wont overwrite keys already present.
1.7310 + // also - reusing 'index' from above because we have the correct "name"
1.7311 + for ( index in value ) {
1.7312 + if ( !( index in props ) ) {
1.7313 + props[ index ] = value[ index ];
1.7314 + specialEasing[ index ] = easing;
1.7315 + }
1.7316 + }
1.7317 + } else {
1.7318 + specialEasing[ name ] = easing;
1.7319 + }
1.7320 + }
1.7321 +}
1.7322 +
1.7323 +function Animation( elem, properties, options ) {
1.7324 + var result,
1.7325 + stopped,
1.7326 + index = 0,
1.7327 + length = animationPrefilters.length,
1.7328 + deferred = jQuery.Deferred().always( function() {
1.7329 + // don't match elem in the :animated selector
1.7330 + delete tick.elem;
1.7331 + }),
1.7332 + tick = function() {
1.7333 + if ( stopped ) {
1.7334 + return false;
1.7335 + }
1.7336 + var currentTime = fxNow || createFxNow(),
1.7337 + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
1.7338 + // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
1.7339 + temp = remaining / animation.duration || 0,
1.7340 + percent = 1 - temp,
1.7341 + index = 0,
1.7342 + length = animation.tweens.length;
1.7343 +
1.7344 + for ( ; index < length ; index++ ) {
1.7345 + animation.tweens[ index ].run( percent );
1.7346 + }
1.7347 +
1.7348 + deferred.notifyWith( elem, [ animation, percent, remaining ]);
1.7349 +
1.7350 + if ( percent < 1 && length ) {
1.7351 + return remaining;
1.7352 + } else {
1.7353 + deferred.resolveWith( elem, [ animation ] );
1.7354 + return false;
1.7355 + }
1.7356 + },
1.7357 + animation = deferred.promise({
1.7358 + elem: elem,
1.7359 + props: jQuery.extend( {}, properties ),
1.7360 + opts: jQuery.extend( true, { specialEasing: {} }, options ),
1.7361 + originalProperties: properties,
1.7362 + originalOptions: options,
1.7363 + startTime: fxNow || createFxNow(),
1.7364 + duration: options.duration,
1.7365 + tweens: [],
1.7366 + createTween: function( prop, end ) {
1.7367 + var tween = jQuery.Tween( elem, animation.opts, prop, end,
1.7368 + animation.opts.specialEasing[ prop ] || animation.opts.easing );
1.7369 + animation.tweens.push( tween );
1.7370 + return tween;
1.7371 + },
1.7372 + stop: function( gotoEnd ) {
1.7373 + var index = 0,
1.7374 + // if we are going to the end, we want to run all the tweens
1.7375 + // otherwise we skip this part
1.7376 + length = gotoEnd ? animation.tweens.length : 0;
1.7377 + if ( stopped ) {
1.7378 + return this;
1.7379 + }
1.7380 + stopped = true;
1.7381 + for ( ; index < length ; index++ ) {
1.7382 + animation.tweens[ index ].run( 1 );
1.7383 + }
1.7384 +
1.7385 + // resolve when we played the last frame
1.7386 + // otherwise, reject
1.7387 + if ( gotoEnd ) {
1.7388 + deferred.resolveWith( elem, [ animation, gotoEnd ] );
1.7389 + } else {
1.7390 + deferred.rejectWith( elem, [ animation, gotoEnd ] );
1.7391 + }
1.7392 + return this;
1.7393 + }
1.7394 + }),
1.7395 + props = animation.props;
1.7396 +
1.7397 + propFilter( props, animation.opts.specialEasing );
1.7398 +
1.7399 + for ( ; index < length ; index++ ) {
1.7400 + result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
1.7401 + if ( result ) {
1.7402 + return result;
1.7403 + }
1.7404 + }
1.7405 +
1.7406 + jQuery.map( props, createTween, animation );
1.7407 +
1.7408 + if ( jQuery.isFunction( animation.opts.start ) ) {
1.7409 + animation.opts.start.call( elem, animation );
1.7410 + }
1.7411 +
1.7412 + jQuery.fx.timer(
1.7413 + jQuery.extend( tick, {
1.7414 + elem: elem,
1.7415 + anim: animation,
1.7416 + queue: animation.opts.queue
1.7417 + })
1.7418 + );
1.7419 +
1.7420 + // attach callbacks from options
1.7421 + return animation.progress( animation.opts.progress )
1.7422 + .done( animation.opts.done, animation.opts.complete )
1.7423 + .fail( animation.opts.fail )
1.7424 + .always( animation.opts.always );
1.7425 +}
1.7426 +
1.7427 +jQuery.Animation = jQuery.extend( Animation, {
1.7428 + tweener: function( props, callback ) {
1.7429 + if ( jQuery.isFunction( props ) ) {
1.7430 + callback = props;
1.7431 + props = [ "*" ];
1.7432 + } else {
1.7433 + props = props.split(" ");
1.7434 + }
1.7435 +
1.7436 + var prop,
1.7437 + index = 0,
1.7438 + length = props.length;
1.7439 +
1.7440 + for ( ; index < length ; index++ ) {
1.7441 + prop = props[ index ];
1.7442 + tweeners[ prop ] = tweeners[ prop ] || [];
1.7443 + tweeners[ prop ].unshift( callback );
1.7444 + }
1.7445 + },
1.7446 +
1.7447 + prefilter: function( callback, prepend ) {
1.7448 + if ( prepend ) {
1.7449 + animationPrefilters.unshift( callback );
1.7450 + } else {
1.7451 + animationPrefilters.push( callback );
1.7452 + }
1.7453 + }
1.7454 +});
1.7455 +
1.7456 +jQuery.speed = function( speed, easing, fn ) {
1.7457 + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
1.7458 + complete: fn || !fn && easing ||
1.7459 + jQuery.isFunction( speed ) && speed,
1.7460 + duration: speed,
1.7461 + easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
1.7462 + };
1.7463 +
1.7464 + opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
1.7465 + opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
1.7466 +
1.7467 + // normalize opt.queue - true/undefined/null -> "fx"
1.7468 + if ( opt.queue == null || opt.queue === true ) {
1.7469 + opt.queue = "fx";
1.7470 + }
1.7471 +
1.7472 + // Queueing
1.7473 + opt.old = opt.complete;
1.7474 +
1.7475 + opt.complete = function() {
1.7476 + if ( jQuery.isFunction( opt.old ) ) {
1.7477 + opt.old.call( this );
1.7478 + }
1.7479 +
1.7480 + if ( opt.queue ) {
1.7481 + jQuery.dequeue( this, opt.queue );
1.7482 + }
1.7483 + };
1.7484 +
1.7485 + return opt;
1.7486 +};
1.7487 +
1.7488 +jQuery.fn.extend({
1.7489 + fadeTo: function( speed, to, easing, callback ) {
1.7490 +
1.7491 + // show any hidden elements after setting opacity to 0
1.7492 + return this.filter( isHidden ).css( "opacity", 0 ).show()
1.7493 +
1.7494 + // animate to the value specified
1.7495 + .end().animate({ opacity: to }, speed, easing, callback );
1.7496 + },
1.7497 + animate: function( prop, speed, easing, callback ) {
1.7498 + var empty = jQuery.isEmptyObject( prop ),
1.7499 + optall = jQuery.speed( speed, easing, callback ),
1.7500 + doAnimation = function() {
1.7501 + // Operate on a copy of prop so per-property easing won't be lost
1.7502 + var anim = Animation( this, jQuery.extend( {}, prop ), optall );
1.7503 +
1.7504 + // Empty animations, or finishing resolves immediately
1.7505 + if ( empty || jQuery._data( this, "finish" ) ) {
1.7506 + anim.stop( true );
1.7507 + }
1.7508 + };
1.7509 + doAnimation.finish = doAnimation;
1.7510 +
1.7511 + return empty || optall.queue === false ?
1.7512 + this.each( doAnimation ) :
1.7513 + this.queue( optall.queue, doAnimation );
1.7514 + },
1.7515 + stop: function( type, clearQueue, gotoEnd ) {
1.7516 + var stopQueue = function( hooks ) {
1.7517 + var stop = hooks.stop;
1.7518 + delete hooks.stop;
1.7519 + stop( gotoEnd );
1.7520 + };
1.7521 +
1.7522 + if ( typeof type !== "string" ) {
1.7523 + gotoEnd = clearQueue;
1.7524 + clearQueue = type;
1.7525 + type = undefined;
1.7526 + }
1.7527 + if ( clearQueue && type !== false ) {
1.7528 + this.queue( type || "fx", [] );
1.7529 + }
1.7530 +
1.7531 + return this.each(function() {
1.7532 + var dequeue = true,
1.7533 + index = type != null && type + "queueHooks",
1.7534 + timers = jQuery.timers,
1.7535 + data = jQuery._data( this );
1.7536 +
1.7537 + if ( index ) {
1.7538 + if ( data[ index ] && data[ index ].stop ) {
1.7539 + stopQueue( data[ index ] );
1.7540 + }
1.7541 + } else {
1.7542 + for ( index in data ) {
1.7543 + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
1.7544 + stopQueue( data[ index ] );
1.7545 + }
1.7546 + }
1.7547 + }
1.7548 +
1.7549 + for ( index = timers.length; index--; ) {
1.7550 + if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
1.7551 + timers[ index ].anim.stop( gotoEnd );
1.7552 + dequeue = false;
1.7553 + timers.splice( index, 1 );
1.7554 + }
1.7555 + }
1.7556 +
1.7557 + // start the next in the queue if the last step wasn't forced
1.7558 + // timers currently will call their complete callbacks, which will dequeue
1.7559 + // but only if they were gotoEnd
1.7560 + if ( dequeue || !gotoEnd ) {
1.7561 + jQuery.dequeue( this, type );
1.7562 + }
1.7563 + });
1.7564 + },
1.7565 + finish: function( type ) {
1.7566 + if ( type !== false ) {
1.7567 + type = type || "fx";
1.7568 + }
1.7569 + return this.each(function() {
1.7570 + var index,
1.7571 + data = jQuery._data( this ),
1.7572 + queue = data[ type + "queue" ],
1.7573 + hooks = data[ type + "queueHooks" ],
1.7574 + timers = jQuery.timers,
1.7575 + length = queue ? queue.length : 0;
1.7576 +
1.7577 + // enable finishing flag on private data
1.7578 + data.finish = true;
1.7579 +
1.7580 + // empty the queue first
1.7581 + jQuery.queue( this, type, [] );
1.7582 +
1.7583 + if ( hooks && hooks.stop ) {
1.7584 + hooks.stop.call( this, true );
1.7585 + }
1.7586 +
1.7587 + // look for any active animations, and finish them
1.7588 + for ( index = timers.length; index--; ) {
1.7589 + if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
1.7590 + timers[ index ].anim.stop( true );
1.7591 + timers.splice( index, 1 );
1.7592 + }
1.7593 + }
1.7594 +
1.7595 + // look for any animations in the old queue and finish them
1.7596 + for ( index = 0; index < length; index++ ) {
1.7597 + if ( queue[ index ] && queue[ index ].finish ) {
1.7598 + queue[ index ].finish.call( this );
1.7599 + }
1.7600 + }
1.7601 +
1.7602 + // turn off finishing flag
1.7603 + delete data.finish;
1.7604 + });
1.7605 + }
1.7606 +});
1.7607 +
1.7608 +jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
1.7609 + var cssFn = jQuery.fn[ name ];
1.7610 + jQuery.fn[ name ] = function( speed, easing, callback ) {
1.7611 + return speed == null || typeof speed === "boolean" ?
1.7612 + cssFn.apply( this, arguments ) :
1.7613 + this.animate( genFx( name, true ), speed, easing, callback );
1.7614 + };
1.7615 +});
1.7616 +
1.7617 +// Generate shortcuts for custom animations
1.7618 +jQuery.each({
1.7619 + slideDown: genFx("show"),
1.7620 + slideUp: genFx("hide"),
1.7621 + slideToggle: genFx("toggle"),
1.7622 + fadeIn: { opacity: "show" },
1.7623 + fadeOut: { opacity: "hide" },
1.7624 + fadeToggle: { opacity: "toggle" }
1.7625 +}, function( name, props ) {
1.7626 + jQuery.fn[ name ] = function( speed, easing, callback ) {
1.7627 + return this.animate( props, speed, easing, callback );
1.7628 + };
1.7629 +});
1.7630 +
1.7631 +jQuery.timers = [];
1.7632 +jQuery.fx.tick = function() {
1.7633 + var timer,
1.7634 + timers = jQuery.timers,
1.7635 + i = 0;
1.7636 +
1.7637 + fxNow = jQuery.now();
1.7638 +
1.7639 + for ( ; i < timers.length; i++ ) {
1.7640 + timer = timers[ i ];
1.7641 + // Checks the timer has not already been removed
1.7642 + if ( !timer() && timers[ i ] === timer ) {
1.7643 + timers.splice( i--, 1 );
1.7644 + }
1.7645 + }
1.7646 +
1.7647 + if ( !timers.length ) {
1.7648 + jQuery.fx.stop();
1.7649 + }
1.7650 + fxNow = undefined;
1.7651 +};
1.7652 +
1.7653 +jQuery.fx.timer = function( timer ) {
1.7654 + jQuery.timers.push( timer );
1.7655 + if ( timer() ) {
1.7656 + jQuery.fx.start();
1.7657 + } else {
1.7658 + jQuery.timers.pop();
1.7659 + }
1.7660 +};
1.7661 +
1.7662 +jQuery.fx.interval = 13;
1.7663 +
1.7664 +jQuery.fx.start = function() {
1.7665 + if ( !timerId ) {
1.7666 + timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
1.7667 + }
1.7668 +};
1.7669 +
1.7670 +jQuery.fx.stop = function() {
1.7671 + clearInterval( timerId );
1.7672 + timerId = null;
1.7673 +};
1.7674 +
1.7675 +jQuery.fx.speeds = {
1.7676 + slow: 600,
1.7677 + fast: 200,
1.7678 + // Default speed
1.7679 + _default: 400
1.7680 +};
1.7681 +
1.7682 +
1.7683 +// Based off of the plugin by Clint Helfers, with permission.
1.7684 +// http://blindsignals.com/index.php/2009/07/jquery-delay/
1.7685 +jQuery.fn.delay = function( time, type ) {
1.7686 + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
1.7687 + type = type || "fx";
1.7688 +
1.7689 + return this.queue( type, function( next, hooks ) {
1.7690 + var timeout = setTimeout( next, time );
1.7691 + hooks.stop = function() {
1.7692 + clearTimeout( timeout );
1.7693 + };
1.7694 + });
1.7695 +};
1.7696 +
1.7697 +
1.7698 +(function() {
1.7699 + // Minified: var a,b,c,d,e
1.7700 + var input, div, select, a, opt;
1.7701 +
1.7702 + // Setup
1.7703 + div = document.createElement( "div" );
1.7704 + div.setAttribute( "className", "t" );
1.7705 + div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
1.7706 + a = div.getElementsByTagName("a")[ 0 ];
1.7707 +
1.7708 + // First batch of tests.
1.7709 + select = document.createElement("select");
1.7710 + opt = select.appendChild( document.createElement("option") );
1.7711 + input = div.getElementsByTagName("input")[ 0 ];
1.7712 +
1.7713 + a.style.cssText = "top:1px";
1.7714 +
1.7715 + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
1.7716 + support.getSetAttribute = div.className !== "t";
1.7717 +
1.7718 + // Get the style information from getAttribute
1.7719 + // (IE uses .cssText instead)
1.7720 + support.style = /top/.test( a.getAttribute("style") );
1.7721 +
1.7722 + // Make sure that URLs aren't manipulated
1.7723 + // (IE normalizes it by default)
1.7724 + support.hrefNormalized = a.getAttribute("href") === "/a";
1.7725 +
1.7726 + // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
1.7727 + support.checkOn = !!input.value;
1.7728 +
1.7729 + // Make sure that a selected-by-default option has a working selected property.
1.7730 + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
1.7731 + support.optSelected = opt.selected;
1.7732 +
1.7733 + // Tests for enctype support on a form (#6743)
1.7734 + support.enctype = !!document.createElement("form").enctype;
1.7735 +
1.7736 + // Make sure that the options inside disabled selects aren't marked as disabled
1.7737 + // (WebKit marks them as disabled)
1.7738 + select.disabled = true;
1.7739 + support.optDisabled = !opt.disabled;
1.7740 +
1.7741 + // Support: IE8 only
1.7742 + // Check if we can trust getAttribute("value")
1.7743 + input = document.createElement( "input" );
1.7744 + input.setAttribute( "value", "" );
1.7745 + support.input = input.getAttribute( "value" ) === "";
1.7746 +
1.7747 + // Check if an input maintains its value after becoming a radio
1.7748 + input.value = "t";
1.7749 + input.setAttribute( "type", "radio" );
1.7750 + support.radioValue = input.value === "t";
1.7751 +})();
1.7752 +
1.7753 +
1.7754 +var rreturn = /\r/g;
1.7755 +
1.7756 +jQuery.fn.extend({
1.7757 + val: function( value ) {
1.7758 + var hooks, ret, isFunction,
1.7759 + elem = this[0];
1.7760 +
1.7761 + if ( !arguments.length ) {
1.7762 + if ( elem ) {
1.7763 + hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
1.7764 +
1.7765 + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
1.7766 + return ret;
1.7767 + }
1.7768 +
1.7769 + ret = elem.value;
1.7770 +
1.7771 + return typeof ret === "string" ?
1.7772 + // handle most common string cases
1.7773 + ret.replace(rreturn, "") :
1.7774 + // handle cases where value is null/undef or number
1.7775 + ret == null ? "" : ret;
1.7776 + }
1.7777 +
1.7778 + return;
1.7779 + }
1.7780 +
1.7781 + isFunction = jQuery.isFunction( value );
1.7782 +
1.7783 + return this.each(function( i ) {
1.7784 + var val;
1.7785 +
1.7786 + if ( this.nodeType !== 1 ) {
1.7787 + return;
1.7788 + }
1.7789 +
1.7790 + if ( isFunction ) {
1.7791 + val = value.call( this, i, jQuery( this ).val() );
1.7792 + } else {
1.7793 + val = value;
1.7794 + }
1.7795 +
1.7796 + // Treat null/undefined as ""; convert numbers to string
1.7797 + if ( val == null ) {
1.7798 + val = "";
1.7799 + } else if ( typeof val === "number" ) {
1.7800 + val += "";
1.7801 + } else if ( jQuery.isArray( val ) ) {
1.7802 + val = jQuery.map( val, function( value ) {
1.7803 + return value == null ? "" : value + "";
1.7804 + });
1.7805 + }
1.7806 +
1.7807 + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
1.7808 +
1.7809 + // If set returns undefined, fall back to normal setting
1.7810 + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
1.7811 + this.value = val;
1.7812 + }
1.7813 + });
1.7814 + }
1.7815 +});
1.7816 +
1.7817 +jQuery.extend({
1.7818 + valHooks: {
1.7819 + option: {
1.7820 + get: function( elem ) {
1.7821 + var val = jQuery.find.attr( elem, "value" );
1.7822 + return val != null ?
1.7823 + val :
1.7824 + // Support: IE10-11+
1.7825 + // option.text throws exceptions (#14686, #14858)
1.7826 + jQuery.trim( jQuery.text( elem ) );
1.7827 + }
1.7828 + },
1.7829 + select: {
1.7830 + get: function( elem ) {
1.7831 + var value, option,
1.7832 + options = elem.options,
1.7833 + index = elem.selectedIndex,
1.7834 + one = elem.type === "select-one" || index < 0,
1.7835 + values = one ? null : [],
1.7836 + max = one ? index + 1 : options.length,
1.7837 + i = index < 0 ?
1.7838 + max :
1.7839 + one ? index : 0;
1.7840 +
1.7841 + // Loop through all the selected options
1.7842 + for ( ; i < max; i++ ) {
1.7843 + option = options[ i ];
1.7844 +
1.7845 + // oldIE doesn't update selected after form reset (#2551)
1.7846 + if ( ( option.selected || i === index ) &&
1.7847 + // Don't return options that are disabled or in a disabled optgroup
1.7848 + ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
1.7849 + ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
1.7850 +
1.7851 + // Get the specific value for the option
1.7852 + value = jQuery( option ).val();
1.7853 +
1.7854 + // We don't need an array for one selects
1.7855 + if ( one ) {
1.7856 + return value;
1.7857 + }
1.7858 +
1.7859 + // Multi-Selects return an array
1.7860 + values.push( value );
1.7861 + }
1.7862 + }
1.7863 +
1.7864 + return values;
1.7865 + },
1.7866 +
1.7867 + set: function( elem, value ) {
1.7868 + var optionSet, option,
1.7869 + options = elem.options,
1.7870 + values = jQuery.makeArray( value ),
1.7871 + i = options.length;
1.7872 +
1.7873 + while ( i-- ) {
1.7874 + option = options[ i ];
1.7875 +
1.7876 + if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
1.7877 +
1.7878 + // Support: IE6
1.7879 + // When new option element is added to select box we need to
1.7880 + // force reflow of newly added node in order to workaround delay
1.7881 + // of initialization properties
1.7882 + try {
1.7883 + option.selected = optionSet = true;
1.7884 +
1.7885 + } catch ( _ ) {
1.7886 +
1.7887 + // Will be executed only in IE6
1.7888 + option.scrollHeight;
1.7889 + }
1.7890 +
1.7891 + } else {
1.7892 + option.selected = false;
1.7893 + }
1.7894 + }
1.7895 +
1.7896 + // Force browsers to behave consistently when non-matching value is set
1.7897 + if ( !optionSet ) {
1.7898 + elem.selectedIndex = -1;
1.7899 + }
1.7900 +
1.7901 + return options;
1.7902 + }
1.7903 + }
1.7904 + }
1.7905 +});
1.7906 +
1.7907 +// Radios and checkboxes getter/setter
1.7908 +jQuery.each([ "radio", "checkbox" ], function() {
1.7909 + jQuery.valHooks[ this ] = {
1.7910 + set: function( elem, value ) {
1.7911 + if ( jQuery.isArray( value ) ) {
1.7912 + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
1.7913 + }
1.7914 + }
1.7915 + };
1.7916 + if ( !support.checkOn ) {
1.7917 + jQuery.valHooks[ this ].get = function( elem ) {
1.7918 + // Support: Webkit
1.7919 + // "" is returned instead of "on" if a value isn't specified
1.7920 + return elem.getAttribute("value") === null ? "on" : elem.value;
1.7921 + };
1.7922 + }
1.7923 +});
1.7924 +
1.7925 +
1.7926 +
1.7927 +
1.7928 +var nodeHook, boolHook,
1.7929 + attrHandle = jQuery.expr.attrHandle,
1.7930 + ruseDefault = /^(?:checked|selected)$/i,
1.7931 + getSetAttribute = support.getSetAttribute,
1.7932 + getSetInput = support.input;
1.7933 +
1.7934 +jQuery.fn.extend({
1.7935 + attr: function( name, value ) {
1.7936 + return access( this, jQuery.attr, name, value, arguments.length > 1 );
1.7937 + },
1.7938 +
1.7939 + removeAttr: function( name ) {
1.7940 + return this.each(function() {
1.7941 + jQuery.removeAttr( this, name );
1.7942 + });
1.7943 + }
1.7944 +});
1.7945 +
1.7946 +jQuery.extend({
1.7947 + attr: function( elem, name, value ) {
1.7948 + var hooks, ret,
1.7949 + nType = elem.nodeType;
1.7950 +
1.7951 + // don't get/set attributes on text, comment and attribute nodes
1.7952 + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
1.7953 + return;
1.7954 + }
1.7955 +
1.7956 + // Fallback to prop when attributes are not supported
1.7957 + if ( typeof elem.getAttribute === strundefined ) {
1.7958 + return jQuery.prop( elem, name, value );
1.7959 + }
1.7960 +
1.7961 + // All attributes are lowercase
1.7962 + // Grab necessary hook if one is defined
1.7963 + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
1.7964 + name = name.toLowerCase();
1.7965 + hooks = jQuery.attrHooks[ name ] ||
1.7966 + ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
1.7967 + }
1.7968 +
1.7969 + if ( value !== undefined ) {
1.7970 +
1.7971 + if ( value === null ) {
1.7972 + jQuery.removeAttr( elem, name );
1.7973 +
1.7974 + } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
1.7975 + return ret;
1.7976 +
1.7977 + } else {
1.7978 + elem.setAttribute( name, value + "" );
1.7979 + return value;
1.7980 + }
1.7981 +
1.7982 + } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
1.7983 + return ret;
1.7984 +
1.7985 + } else {
1.7986 + ret = jQuery.find.attr( elem, name );
1.7987 +
1.7988 + // Non-existent attributes return null, we normalize to undefined
1.7989 + return ret == null ?
1.7990 + undefined :
1.7991 + ret;
1.7992 + }
1.7993 + },
1.7994 +
1.7995 + removeAttr: function( elem, value ) {
1.7996 + var name, propName,
1.7997 + i = 0,
1.7998 + attrNames = value && value.match( rnotwhite );
1.7999 +
1.8000 + if ( attrNames && elem.nodeType === 1 ) {
1.8001 + while ( (name = attrNames[i++]) ) {
1.8002 + propName = jQuery.propFix[ name ] || name;
1.8003 +
1.8004 + // Boolean attributes get special treatment (#10870)
1.8005 + if ( jQuery.expr.match.bool.test( name ) ) {
1.8006 + // Set corresponding property to false
1.8007 + if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
1.8008 + elem[ propName ] = false;
1.8009 + // Support: IE<9
1.8010 + // Also clear defaultChecked/defaultSelected (if appropriate)
1.8011 + } else {
1.8012 + elem[ jQuery.camelCase( "default-" + name ) ] =
1.8013 + elem[ propName ] = false;
1.8014 + }
1.8015 +
1.8016 + // See #9699 for explanation of this approach (setting first, then removal)
1.8017 + } else {
1.8018 + jQuery.attr( elem, name, "" );
1.8019 + }
1.8020 +
1.8021 + elem.removeAttribute( getSetAttribute ? name : propName );
1.8022 + }
1.8023 + }
1.8024 + },
1.8025 +
1.8026 + attrHooks: {
1.8027 + type: {
1.8028 + set: function( elem, value ) {
1.8029 + if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
1.8030 + // Setting the type on a radio button after the value resets the value in IE6-9
1.8031 + // Reset value to default in case type is set after value during creation
1.8032 + var val = elem.value;
1.8033 + elem.setAttribute( "type", value );
1.8034 + if ( val ) {
1.8035 + elem.value = val;
1.8036 + }
1.8037 + return value;
1.8038 + }
1.8039 + }
1.8040 + }
1.8041 + }
1.8042 +});
1.8043 +
1.8044 +// Hook for boolean attributes
1.8045 +boolHook = {
1.8046 + set: function( elem, value, name ) {
1.8047 + if ( value === false ) {
1.8048 + // Remove boolean attributes when set to false
1.8049 + jQuery.removeAttr( elem, name );
1.8050 + } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
1.8051 + // IE<8 needs the *property* name
1.8052 + elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
1.8053 +
1.8054 + // Use defaultChecked and defaultSelected for oldIE
1.8055 + } else {
1.8056 + elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
1.8057 + }
1.8058 +
1.8059 + return name;
1.8060 + }
1.8061 +};
1.8062 +
1.8063 +// Retrieve booleans specially
1.8064 +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
1.8065 +
1.8066 + var getter = attrHandle[ name ] || jQuery.find.attr;
1.8067 +
1.8068 + attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
1.8069 + function( elem, name, isXML ) {
1.8070 + var ret, handle;
1.8071 + if ( !isXML ) {
1.8072 + // Avoid an infinite loop by temporarily removing this function from the getter
1.8073 + handle = attrHandle[ name ];
1.8074 + attrHandle[ name ] = ret;
1.8075 + ret = getter( elem, name, isXML ) != null ?
1.8076 + name.toLowerCase() :
1.8077 + null;
1.8078 + attrHandle[ name ] = handle;
1.8079 + }
1.8080 + return ret;
1.8081 + } :
1.8082 + function( elem, name, isXML ) {
1.8083 + if ( !isXML ) {
1.8084 + return elem[ jQuery.camelCase( "default-" + name ) ] ?
1.8085 + name.toLowerCase() :
1.8086 + null;
1.8087 + }
1.8088 + };
1.8089 +});
1.8090 +
1.8091 +// fix oldIE attroperties
1.8092 +if ( !getSetInput || !getSetAttribute ) {
1.8093 + jQuery.attrHooks.value = {
1.8094 + set: function( elem, value, name ) {
1.8095 + if ( jQuery.nodeName( elem, "input" ) ) {
1.8096 + // Does not return so that setAttribute is also used
1.8097 + elem.defaultValue = value;
1.8098 + } else {
1.8099 + // Use nodeHook if defined (#1954); otherwise setAttribute is fine
1.8100 + return nodeHook && nodeHook.set( elem, value, name );
1.8101 + }
1.8102 + }
1.8103 + };
1.8104 +}
1.8105 +
1.8106 +// IE6/7 do not support getting/setting some attributes with get/setAttribute
1.8107 +if ( !getSetAttribute ) {
1.8108 +
1.8109 + // Use this for any attribute in IE6/7
1.8110 + // This fixes almost every IE6/7 issue
1.8111 + nodeHook = {
1.8112 + set: function( elem, value, name ) {
1.8113 + // Set the existing or create a new attribute node
1.8114 + var ret = elem.getAttributeNode( name );
1.8115 + if ( !ret ) {
1.8116 + elem.setAttributeNode(
1.8117 + (ret = elem.ownerDocument.createAttribute( name ))
1.8118 + );
1.8119 + }
1.8120 +
1.8121 + ret.value = value += "";
1.8122 +
1.8123 + // Break association with cloned elements by also using setAttribute (#9646)
1.8124 + if ( name === "value" || value === elem.getAttribute( name ) ) {
1.8125 + return value;
1.8126 + }
1.8127 + }
1.8128 + };
1.8129 +
1.8130 + // Some attributes are constructed with empty-string values when not defined
1.8131 + attrHandle.id = attrHandle.name = attrHandle.coords =
1.8132 + function( elem, name, isXML ) {
1.8133 + var ret;
1.8134 + if ( !isXML ) {
1.8135 + return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
1.8136 + ret.value :
1.8137 + null;
1.8138 + }
1.8139 + };
1.8140 +
1.8141 + // Fixing value retrieval on a button requires this module
1.8142 + jQuery.valHooks.button = {
1.8143 + get: function( elem, name ) {
1.8144 + var ret = elem.getAttributeNode( name );
1.8145 + if ( ret && ret.specified ) {
1.8146 + return ret.value;
1.8147 + }
1.8148 + },
1.8149 + set: nodeHook.set
1.8150 + };
1.8151 +
1.8152 + // Set contenteditable to false on removals(#10429)
1.8153 + // Setting to empty string throws an error as an invalid value
1.8154 + jQuery.attrHooks.contenteditable = {
1.8155 + set: function( elem, value, name ) {
1.8156 + nodeHook.set( elem, value === "" ? false : value, name );
1.8157 + }
1.8158 + };
1.8159 +
1.8160 + // Set width and height to auto instead of 0 on empty string( Bug #8150 )
1.8161 + // This is for removals
1.8162 + jQuery.each([ "width", "height" ], function( i, name ) {
1.8163 + jQuery.attrHooks[ name ] = {
1.8164 + set: function( elem, value ) {
1.8165 + if ( value === "" ) {
1.8166 + elem.setAttribute( name, "auto" );
1.8167 + return value;
1.8168 + }
1.8169 + }
1.8170 + };
1.8171 + });
1.8172 +}
1.8173 +
1.8174 +if ( !support.style ) {
1.8175 + jQuery.attrHooks.style = {
1.8176 + get: function( elem ) {
1.8177 + // Return undefined in the case of empty string
1.8178 + // Note: IE uppercases css property names, but if we were to .toLowerCase()
1.8179 + // .cssText, that would destroy case senstitivity in URL's, like in "background"
1.8180 + return elem.style.cssText || undefined;
1.8181 + },
1.8182 + set: function( elem, value ) {
1.8183 + return ( elem.style.cssText = value + "" );
1.8184 + }
1.8185 + };
1.8186 +}
1.8187 +
1.8188 +
1.8189 +
1.8190 +
1.8191 +var rfocusable = /^(?:input|select|textarea|button|object)$/i,
1.8192 + rclickable = /^(?:a|area)$/i;
1.8193 +
1.8194 +jQuery.fn.extend({
1.8195 + prop: function( name, value ) {
1.8196 + return access( this, jQuery.prop, name, value, arguments.length > 1 );
1.8197 + },
1.8198 +
1.8199 + removeProp: function( name ) {
1.8200 + name = jQuery.propFix[ name ] || name;
1.8201 + return this.each(function() {
1.8202 + // try/catch handles cases where IE balks (such as removing a property on window)
1.8203 + try {
1.8204 + this[ name ] = undefined;
1.8205 + delete this[ name ];
1.8206 + } catch( e ) {}
1.8207 + });
1.8208 + }
1.8209 +});
1.8210 +
1.8211 +jQuery.extend({
1.8212 + propFix: {
1.8213 + "for": "htmlFor",
1.8214 + "class": "className"
1.8215 + },
1.8216 +
1.8217 + prop: function( elem, name, value ) {
1.8218 + var ret, hooks, notxml,
1.8219 + nType = elem.nodeType;
1.8220 +
1.8221 + // don't get/set properties on text, comment and attribute nodes
1.8222 + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
1.8223 + return;
1.8224 + }
1.8225 +
1.8226 + notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
1.8227 +
1.8228 + if ( notxml ) {
1.8229 + // Fix name and attach hooks
1.8230 + name = jQuery.propFix[ name ] || name;
1.8231 + hooks = jQuery.propHooks[ name ];
1.8232 + }
1.8233 +
1.8234 + if ( value !== undefined ) {
1.8235 + return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
1.8236 + ret :
1.8237 + ( elem[ name ] = value );
1.8238 +
1.8239 + } else {
1.8240 + return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
1.8241 + ret :
1.8242 + elem[ name ];
1.8243 + }
1.8244 + },
1.8245 +
1.8246 + propHooks: {
1.8247 + tabIndex: {
1.8248 + get: function( elem ) {
1.8249 + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
1.8250 + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
1.8251 + // Use proper attribute retrieval(#12072)
1.8252 + var tabindex = jQuery.find.attr( elem, "tabindex" );
1.8253 +
1.8254 + return tabindex ?
1.8255 + parseInt( tabindex, 10 ) :
1.8256 + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
1.8257 + 0 :
1.8258 + -1;
1.8259 + }
1.8260 + }
1.8261 + }
1.8262 +});
1.8263 +
1.8264 +// Some attributes require a special call on IE
1.8265 +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
1.8266 +if ( !support.hrefNormalized ) {
1.8267 + // href/src property should get the full normalized URL (#10299/#12915)
1.8268 + jQuery.each([ "href", "src" ], function( i, name ) {
1.8269 + jQuery.propHooks[ name ] = {
1.8270 + get: function( elem ) {
1.8271 + return elem.getAttribute( name, 4 );
1.8272 + }
1.8273 + };
1.8274 + });
1.8275 +}
1.8276 +
1.8277 +// Support: Safari, IE9+
1.8278 +// mis-reports the default selected property of an option
1.8279 +// Accessing the parent's selectedIndex property fixes it
1.8280 +if ( !support.optSelected ) {
1.8281 + jQuery.propHooks.selected = {
1.8282 + get: function( elem ) {
1.8283 + var parent = elem.parentNode;
1.8284 +
1.8285 + if ( parent ) {
1.8286 + parent.selectedIndex;
1.8287 +
1.8288 + // Make sure that it also works with optgroups, see #5701
1.8289 + if ( parent.parentNode ) {
1.8290 + parent.parentNode.selectedIndex;
1.8291 + }
1.8292 + }
1.8293 + return null;
1.8294 + }
1.8295 + };
1.8296 +}
1.8297 +
1.8298 +jQuery.each([
1.8299 + "tabIndex",
1.8300 + "readOnly",
1.8301 + "maxLength",
1.8302 + "cellSpacing",
1.8303 + "cellPadding",
1.8304 + "rowSpan",
1.8305 + "colSpan",
1.8306 + "useMap",
1.8307 + "frameBorder",
1.8308 + "contentEditable"
1.8309 +], function() {
1.8310 + jQuery.propFix[ this.toLowerCase() ] = this;
1.8311 +});
1.8312 +
1.8313 +// IE6/7 call enctype encoding
1.8314 +if ( !support.enctype ) {
1.8315 + jQuery.propFix.enctype = "encoding";
1.8316 +}
1.8317 +
1.8318 +
1.8319 +
1.8320 +
1.8321 +var rclass = /[\t\r\n\f]/g;
1.8322 +
1.8323 +jQuery.fn.extend({
1.8324 + addClass: function( value ) {
1.8325 + var classes, elem, cur, clazz, j, finalValue,
1.8326 + i = 0,
1.8327 + len = this.length,
1.8328 + proceed = typeof value === "string" && value;
1.8329 +
1.8330 + if ( jQuery.isFunction( value ) ) {
1.8331 + return this.each(function( j ) {
1.8332 + jQuery( this ).addClass( value.call( this, j, this.className ) );
1.8333 + });
1.8334 + }
1.8335 +
1.8336 + if ( proceed ) {
1.8337 + // The disjunction here is for better compressibility (see removeClass)
1.8338 + classes = ( value || "" ).match( rnotwhite ) || [];
1.8339 +
1.8340 + for ( ; i < len; i++ ) {
1.8341 + elem = this[ i ];
1.8342 + cur = elem.nodeType === 1 && ( elem.className ?
1.8343 + ( " " + elem.className + " " ).replace( rclass, " " ) :
1.8344 + " "
1.8345 + );
1.8346 +
1.8347 + if ( cur ) {
1.8348 + j = 0;
1.8349 + while ( (clazz = classes[j++]) ) {
1.8350 + if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
1.8351 + cur += clazz + " ";
1.8352 + }
1.8353 + }
1.8354 +
1.8355 + // only assign if different to avoid unneeded rendering.
1.8356 + finalValue = jQuery.trim( cur );
1.8357 + if ( elem.className !== finalValue ) {
1.8358 + elem.className = finalValue;
1.8359 + }
1.8360 + }
1.8361 + }
1.8362 + }
1.8363 +
1.8364 + return this;
1.8365 + },
1.8366 +
1.8367 + removeClass: function( value ) {
1.8368 + var classes, elem, cur, clazz, j, finalValue,
1.8369 + i = 0,
1.8370 + len = this.length,
1.8371 + proceed = arguments.length === 0 || typeof value === "string" && value;
1.8372 +
1.8373 + if ( jQuery.isFunction( value ) ) {
1.8374 + return this.each(function( j ) {
1.8375 + jQuery( this ).removeClass( value.call( this, j, this.className ) );
1.8376 + });
1.8377 + }
1.8378 + if ( proceed ) {
1.8379 + classes = ( value || "" ).match( rnotwhite ) || [];
1.8380 +
1.8381 + for ( ; i < len; i++ ) {
1.8382 + elem = this[ i ];
1.8383 + // This expression is here for better compressibility (see addClass)
1.8384 + cur = elem.nodeType === 1 && ( elem.className ?
1.8385 + ( " " + elem.className + " " ).replace( rclass, " " ) :
1.8386 + ""
1.8387 + );
1.8388 +
1.8389 + if ( cur ) {
1.8390 + j = 0;
1.8391 + while ( (clazz = classes[j++]) ) {
1.8392 + // Remove *all* instances
1.8393 + while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
1.8394 + cur = cur.replace( " " + clazz + " ", " " );
1.8395 + }
1.8396 + }
1.8397 +
1.8398 + // only assign if different to avoid unneeded rendering.
1.8399 + finalValue = value ? jQuery.trim( cur ) : "";
1.8400 + if ( elem.className !== finalValue ) {
1.8401 + elem.className = finalValue;
1.8402 + }
1.8403 + }
1.8404 + }
1.8405 + }
1.8406 +
1.8407 + return this;
1.8408 + },
1.8409 +
1.8410 + toggleClass: function( value, stateVal ) {
1.8411 + var type = typeof value;
1.8412 +
1.8413 + if ( typeof stateVal === "boolean" && type === "string" ) {
1.8414 + return stateVal ? this.addClass( value ) : this.removeClass( value );
1.8415 + }
1.8416 +
1.8417 + if ( jQuery.isFunction( value ) ) {
1.8418 + return this.each(function( i ) {
1.8419 + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
1.8420 + });
1.8421 + }
1.8422 +
1.8423 + return this.each(function() {
1.8424 + if ( type === "string" ) {
1.8425 + // toggle individual class names
1.8426 + var className,
1.8427 + i = 0,
1.8428 + self = jQuery( this ),
1.8429 + classNames = value.match( rnotwhite ) || [];
1.8430 +
1.8431 + while ( (className = classNames[ i++ ]) ) {
1.8432 + // check each className given, space separated list
1.8433 + if ( self.hasClass( className ) ) {
1.8434 + self.removeClass( className );
1.8435 + } else {
1.8436 + self.addClass( className );
1.8437 + }
1.8438 + }
1.8439 +
1.8440 + // Toggle whole class name
1.8441 + } else if ( type === strundefined || type === "boolean" ) {
1.8442 + if ( this.className ) {
1.8443 + // store className if set
1.8444 + jQuery._data( this, "__className__", this.className );
1.8445 + }
1.8446 +
1.8447 + // If the element has a class name or if we're passed "false",
1.8448 + // then remove the whole classname (if there was one, the above saved it).
1.8449 + // Otherwise bring back whatever was previously saved (if anything),
1.8450 + // falling back to the empty string if nothing was stored.
1.8451 + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
1.8452 + }
1.8453 + });
1.8454 + },
1.8455 +
1.8456 + hasClass: function( selector ) {
1.8457 + var className = " " + selector + " ",
1.8458 + i = 0,
1.8459 + l = this.length;
1.8460 + for ( ; i < l; i++ ) {
1.8461 + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
1.8462 + return true;
1.8463 + }
1.8464 + }
1.8465 +
1.8466 + return false;
1.8467 + }
1.8468 +});
1.8469 +
1.8470 +
1.8471 +
1.8472 +
1.8473 +// Return jQuery for attributes-only inclusion
1.8474 +
1.8475 +
1.8476 +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
1.8477 + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
1.8478 + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
1.8479 +
1.8480 + // Handle event binding
1.8481 + jQuery.fn[ name ] = function( data, fn ) {
1.8482 + return arguments.length > 0 ?
1.8483 + this.on( name, null, data, fn ) :
1.8484 + this.trigger( name );
1.8485 + };
1.8486 +});
1.8487 +
1.8488 +jQuery.fn.extend({
1.8489 + hover: function( fnOver, fnOut ) {
1.8490 + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
1.8491 + },
1.8492 +
1.8493 + bind: function( types, data, fn ) {
1.8494 + return this.on( types, null, data, fn );
1.8495 + },
1.8496 + unbind: function( types, fn ) {
1.8497 + return this.off( types, null, fn );
1.8498 + },
1.8499 +
1.8500 + delegate: function( selector, types, data, fn ) {
1.8501 + return this.on( types, selector, data, fn );
1.8502 + },
1.8503 + undelegate: function( selector, types, fn ) {
1.8504 + // ( namespace ) or ( selector, types [, fn] )
1.8505 + return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
1.8506 + }
1.8507 +});
1.8508 +
1.8509 +
1.8510 +var nonce = jQuery.now();
1.8511 +
1.8512 +var rquery = (/\?/);
1.8513 +
1.8514 +
1.8515 +
1.8516 +var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
1.8517 +
1.8518 +jQuery.parseJSON = function( data ) {
1.8519 + // Attempt to parse using the native JSON parser first
1.8520 + if ( window.JSON && window.JSON.parse ) {
1.8521 + // Support: Android 2.3
1.8522 + // Workaround failure to string-cast null input
1.8523 + return window.JSON.parse( data + "" );
1.8524 + }
1.8525 +
1.8526 + var requireNonComma,
1.8527 + depth = null,
1.8528 + str = jQuery.trim( data + "" );
1.8529 +
1.8530 + // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
1.8531 + // after removing valid tokens
1.8532 + return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
1.8533 +
1.8534 + // Force termination if we see a misplaced comma
1.8535 + if ( requireNonComma && comma ) {
1.8536 + depth = 0;
1.8537 + }
1.8538 +
1.8539 + // Perform no more replacements after returning to outermost depth
1.8540 + if ( depth === 0 ) {
1.8541 + return token;
1.8542 + }
1.8543 +
1.8544 + // Commas must not follow "[", "{", or ","
1.8545 + requireNonComma = open || comma;
1.8546 +
1.8547 + // Determine new depth
1.8548 + // array/object open ("[" or "{"): depth += true - false (increment)
1.8549 + // array/object close ("]" or "}"): depth += false - true (decrement)
1.8550 + // other cases ("," or primitive): depth += true - true (numeric cast)
1.8551 + depth += !close - !open;
1.8552 +
1.8553 + // Remove this token
1.8554 + return "";
1.8555 + }) ) ?
1.8556 + ( Function( "return " + str ) )() :
1.8557 + jQuery.error( "Invalid JSON: " + data );
1.8558 +};
1.8559 +
1.8560 +
1.8561 +// Cross-browser xml parsing
1.8562 +jQuery.parseXML = function( data ) {
1.8563 + var xml, tmp;
1.8564 + if ( !data || typeof data !== "string" ) {
1.8565 + return null;
1.8566 + }
1.8567 + try {
1.8568 + if ( window.DOMParser ) { // Standard
1.8569 + tmp = new DOMParser();
1.8570 + xml = tmp.parseFromString( data, "text/xml" );
1.8571 + } else { // IE
1.8572 + xml = new ActiveXObject( "Microsoft.XMLDOM" );
1.8573 + xml.async = "false";
1.8574 + xml.loadXML( data );
1.8575 + }
1.8576 + } catch( e ) {
1.8577 + xml = undefined;
1.8578 + }
1.8579 + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
1.8580 + jQuery.error( "Invalid XML: " + data );
1.8581 + }
1.8582 + return xml;
1.8583 +};
1.8584 +
1.8585 +
1.8586 +var
1.8587 + // Document location
1.8588 + ajaxLocParts,
1.8589 + ajaxLocation,
1.8590 +
1.8591 + rhash = /#.*$/,
1.8592 + rts = /([?&])_=[^&]*/,
1.8593 + rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
1.8594 + // #7653, #8125, #8152: local protocol detection
1.8595 + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
1.8596 + rnoContent = /^(?:GET|HEAD)$/,
1.8597 + rprotocol = /^\/\//,
1.8598 + rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
1.8599 +
1.8600 + /* Prefilters
1.8601 + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
1.8602 + * 2) These are called:
1.8603 + * - BEFORE asking for a transport
1.8604 + * - AFTER param serialization (s.data is a string if s.processData is true)
1.8605 + * 3) key is the dataType
1.8606 + * 4) the catchall symbol "*" can be used
1.8607 + * 5) execution will start with transport dataType and THEN continue down to "*" if needed
1.8608 + */
1.8609 + prefilters = {},
1.8610 +
1.8611 + /* Transports bindings
1.8612 + * 1) key is the dataType
1.8613 + * 2) the catchall symbol "*" can be used
1.8614 + * 3) selection will start with transport dataType and THEN go to "*" if needed
1.8615 + */
1.8616 + transports = {},
1.8617 +
1.8618 + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
1.8619 + allTypes = "*/".concat("*");
1.8620 +
1.8621 +// #8138, IE may throw an exception when accessing
1.8622 +// a field from window.location if document.domain has been set
1.8623 +try {
1.8624 + ajaxLocation = location.href;
1.8625 +} catch( e ) {
1.8626 + // Use the href attribute of an A element
1.8627 + // since IE will modify it given document.location
1.8628 + ajaxLocation = document.createElement( "a" );
1.8629 + ajaxLocation.href = "";
1.8630 + ajaxLocation = ajaxLocation.href;
1.8631 +}
1.8632 +
1.8633 +// Segment location into parts
1.8634 +ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
1.8635 +
1.8636 +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
1.8637 +function addToPrefiltersOrTransports( structure ) {
1.8638 +
1.8639 + // dataTypeExpression is optional and defaults to "*"
1.8640 + return function( dataTypeExpression, func ) {
1.8641 +
1.8642 + if ( typeof dataTypeExpression !== "string" ) {
1.8643 + func = dataTypeExpression;
1.8644 + dataTypeExpression = "*";
1.8645 + }
1.8646 +
1.8647 + var dataType,
1.8648 + i = 0,
1.8649 + dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
1.8650 +
1.8651 + if ( jQuery.isFunction( func ) ) {
1.8652 + // For each dataType in the dataTypeExpression
1.8653 + while ( (dataType = dataTypes[i++]) ) {
1.8654 + // Prepend if requested
1.8655 + if ( dataType.charAt( 0 ) === "+" ) {
1.8656 + dataType = dataType.slice( 1 ) || "*";
1.8657 + (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
1.8658 +
1.8659 + // Otherwise append
1.8660 + } else {
1.8661 + (structure[ dataType ] = structure[ dataType ] || []).push( func );
1.8662 + }
1.8663 + }
1.8664 + }
1.8665 + };
1.8666 +}
1.8667 +
1.8668 +// Base inspection function for prefilters and transports
1.8669 +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
1.8670 +
1.8671 + var inspected = {},
1.8672 + seekingTransport = ( structure === transports );
1.8673 +
1.8674 + function inspect( dataType ) {
1.8675 + var selected;
1.8676 + inspected[ dataType ] = true;
1.8677 + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
1.8678 + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
1.8679 + if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
1.8680 + options.dataTypes.unshift( dataTypeOrTransport );
1.8681 + inspect( dataTypeOrTransport );
1.8682 + return false;
1.8683 + } else if ( seekingTransport ) {
1.8684 + return !( selected = dataTypeOrTransport );
1.8685 + }
1.8686 + });
1.8687 + return selected;
1.8688 + }
1.8689 +
1.8690 + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
1.8691 +}
1.8692 +
1.8693 +// A special extend for ajax options
1.8694 +// that takes "flat" options (not to be deep extended)
1.8695 +// Fixes #9887
1.8696 +function ajaxExtend( target, src ) {
1.8697 + var deep, key,
1.8698 + flatOptions = jQuery.ajaxSettings.flatOptions || {};
1.8699 +
1.8700 + for ( key in src ) {
1.8701 + if ( src[ key ] !== undefined ) {
1.8702 + ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
1.8703 + }
1.8704 + }
1.8705 + if ( deep ) {
1.8706 + jQuery.extend( true, target, deep );
1.8707 + }
1.8708 +
1.8709 + return target;
1.8710 +}
1.8711 +
1.8712 +/* Handles responses to an ajax request:
1.8713 + * - finds the right dataType (mediates between content-type and expected dataType)
1.8714 + * - returns the corresponding response
1.8715 + */
1.8716 +function ajaxHandleResponses( s, jqXHR, responses ) {
1.8717 + var firstDataType, ct, finalDataType, type,
1.8718 + contents = s.contents,
1.8719 + dataTypes = s.dataTypes;
1.8720 +
1.8721 + // Remove auto dataType and get content-type in the process
1.8722 + while ( dataTypes[ 0 ] === "*" ) {
1.8723 + dataTypes.shift();
1.8724 + if ( ct === undefined ) {
1.8725 + ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
1.8726 + }
1.8727 + }
1.8728 +
1.8729 + // Check if we're dealing with a known content-type
1.8730 + if ( ct ) {
1.8731 + for ( type in contents ) {
1.8732 + if ( contents[ type ] && contents[ type ].test( ct ) ) {
1.8733 + dataTypes.unshift( type );
1.8734 + break;
1.8735 + }
1.8736 + }
1.8737 + }
1.8738 +
1.8739 + // Check to see if we have a response for the expected dataType
1.8740 + if ( dataTypes[ 0 ] in responses ) {
1.8741 + finalDataType = dataTypes[ 0 ];
1.8742 + } else {
1.8743 + // Try convertible dataTypes
1.8744 + for ( type in responses ) {
1.8745 + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
1.8746 + finalDataType = type;
1.8747 + break;
1.8748 + }
1.8749 + if ( !firstDataType ) {
1.8750 + firstDataType = type;
1.8751 + }
1.8752 + }
1.8753 + // Or just use first one
1.8754 + finalDataType = finalDataType || firstDataType;
1.8755 + }
1.8756 +
1.8757 + // If we found a dataType
1.8758 + // We add the dataType to the list if needed
1.8759 + // and return the corresponding response
1.8760 + if ( finalDataType ) {
1.8761 + if ( finalDataType !== dataTypes[ 0 ] ) {
1.8762 + dataTypes.unshift( finalDataType );
1.8763 + }
1.8764 + return responses[ finalDataType ];
1.8765 + }
1.8766 +}
1.8767 +
1.8768 +/* Chain conversions given the request and the original response
1.8769 + * Also sets the responseXXX fields on the jqXHR instance
1.8770 + */
1.8771 +function ajaxConvert( s, response, jqXHR, isSuccess ) {
1.8772 + var conv2, current, conv, tmp, prev,
1.8773 + converters = {},
1.8774 + // Work with a copy of dataTypes in case we need to modify it for conversion
1.8775 + dataTypes = s.dataTypes.slice();
1.8776 +
1.8777 + // Create converters map with lowercased keys
1.8778 + if ( dataTypes[ 1 ] ) {
1.8779 + for ( conv in s.converters ) {
1.8780 + converters[ conv.toLowerCase() ] = s.converters[ conv ];
1.8781 + }
1.8782 + }
1.8783 +
1.8784 + current = dataTypes.shift();
1.8785 +
1.8786 + // Convert to each sequential dataType
1.8787 + while ( current ) {
1.8788 +
1.8789 + if ( s.responseFields[ current ] ) {
1.8790 + jqXHR[ s.responseFields[ current ] ] = response;
1.8791 + }
1.8792 +
1.8793 + // Apply the dataFilter if provided
1.8794 + if ( !prev && isSuccess && s.dataFilter ) {
1.8795 + response = s.dataFilter( response, s.dataType );
1.8796 + }
1.8797 +
1.8798 + prev = current;
1.8799 + current = dataTypes.shift();
1.8800 +
1.8801 + if ( current ) {
1.8802 +
1.8803 + // There's only work to do if current dataType is non-auto
1.8804 + if ( current === "*" ) {
1.8805 +
1.8806 + current = prev;
1.8807 +
1.8808 + // Convert response if prev dataType is non-auto and differs from current
1.8809 + } else if ( prev !== "*" && prev !== current ) {
1.8810 +
1.8811 + // Seek a direct converter
1.8812 + conv = converters[ prev + " " + current ] || converters[ "* " + current ];
1.8813 +
1.8814 + // If none found, seek a pair
1.8815 + if ( !conv ) {
1.8816 + for ( conv2 in converters ) {
1.8817 +
1.8818 + // If conv2 outputs current
1.8819 + tmp = conv2.split( " " );
1.8820 + if ( tmp[ 1 ] === current ) {
1.8821 +
1.8822 + // If prev can be converted to accepted input
1.8823 + conv = converters[ prev + " " + tmp[ 0 ] ] ||
1.8824 + converters[ "* " + tmp[ 0 ] ];
1.8825 + if ( conv ) {
1.8826 + // Condense equivalence converters
1.8827 + if ( conv === true ) {
1.8828 + conv = converters[ conv2 ];
1.8829 +
1.8830 + // Otherwise, insert the intermediate dataType
1.8831 + } else if ( converters[ conv2 ] !== true ) {
1.8832 + current = tmp[ 0 ];
1.8833 + dataTypes.unshift( tmp[ 1 ] );
1.8834 + }
1.8835 + break;
1.8836 + }
1.8837 + }
1.8838 + }
1.8839 + }
1.8840 +
1.8841 + // Apply converter (if not an equivalence)
1.8842 + if ( conv !== true ) {
1.8843 +
1.8844 + // Unless errors are allowed to bubble, catch and return them
1.8845 + if ( conv && s[ "throws" ] ) {
1.8846 + response = conv( response );
1.8847 + } else {
1.8848 + try {
1.8849 + response = conv( response );
1.8850 + } catch ( e ) {
1.8851 + return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
1.8852 + }
1.8853 + }
1.8854 + }
1.8855 + }
1.8856 + }
1.8857 + }
1.8858 +
1.8859 + return { state: "success", data: response };
1.8860 +}
1.8861 +
1.8862 +jQuery.extend({
1.8863 +
1.8864 + // Counter for holding the number of active queries
1.8865 + active: 0,
1.8866 +
1.8867 + // Last-Modified header cache for next request
1.8868 + lastModified: {},
1.8869 + etag: {},
1.8870 +
1.8871 + ajaxSettings: {
1.8872 + url: ajaxLocation,
1.8873 + type: "GET",
1.8874 + isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
1.8875 + global: true,
1.8876 + processData: true,
1.8877 + async: true,
1.8878 + contentType: "application/x-www-form-urlencoded; charset=UTF-8",
1.8879 + /*
1.8880 + timeout: 0,
1.8881 + data: null,
1.8882 + dataType: null,
1.8883 + username: null,
1.8884 + password: null,
1.8885 + cache: null,
1.8886 + throws: false,
1.8887 + traditional: false,
1.8888 + headers: {},
1.8889 + */
1.8890 +
1.8891 + accepts: {
1.8892 + "*": allTypes,
1.8893 + text: "text/plain",
1.8894 + html: "text/html",
1.8895 + xml: "application/xml, text/xml",
1.8896 + json: "application/json, text/javascript"
1.8897 + },
1.8898 +
1.8899 + contents: {
1.8900 + xml: /xml/,
1.8901 + html: /html/,
1.8902 + json: /json/
1.8903 + },
1.8904 +
1.8905 + responseFields: {
1.8906 + xml: "responseXML",
1.8907 + text: "responseText",
1.8908 + json: "responseJSON"
1.8909 + },
1.8910 +
1.8911 + // Data converters
1.8912 + // Keys separate source (or catchall "*") and destination types with a single space
1.8913 + converters: {
1.8914 +
1.8915 + // Convert anything to text
1.8916 + "* text": String,
1.8917 +
1.8918 + // Text to html (true = no transformation)
1.8919 + "text html": true,
1.8920 +
1.8921 + // Evaluate text as a json expression
1.8922 + "text json": jQuery.parseJSON,
1.8923 +
1.8924 + // Parse text as xml
1.8925 + "text xml": jQuery.parseXML
1.8926 + },
1.8927 +
1.8928 + // For options that shouldn't be deep extended:
1.8929 + // you can add your own custom options here if
1.8930 + // and when you create one that shouldn't be
1.8931 + // deep extended (see ajaxExtend)
1.8932 + flatOptions: {
1.8933 + url: true,
1.8934 + context: true
1.8935 + }
1.8936 + },
1.8937 +
1.8938 + // Creates a full fledged settings object into target
1.8939 + // with both ajaxSettings and settings fields.
1.8940 + // If target is omitted, writes into ajaxSettings.
1.8941 + ajaxSetup: function( target, settings ) {
1.8942 + return settings ?
1.8943 +
1.8944 + // Building a settings object
1.8945 + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
1.8946 +
1.8947 + // Extending ajaxSettings
1.8948 + ajaxExtend( jQuery.ajaxSettings, target );
1.8949 + },
1.8950 +
1.8951 + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
1.8952 + ajaxTransport: addToPrefiltersOrTransports( transports ),
1.8953 +
1.8954 + // Main method
1.8955 + ajax: function( url, options ) {
1.8956 +
1.8957 + // If url is an object, simulate pre-1.5 signature
1.8958 + if ( typeof url === "object" ) {
1.8959 + options = url;
1.8960 + url = undefined;
1.8961 + }
1.8962 +
1.8963 + // Force options to be an object
1.8964 + options = options || {};
1.8965 +
1.8966 + var // Cross-domain detection vars
1.8967 + parts,
1.8968 + // Loop variable
1.8969 + i,
1.8970 + // URL without anti-cache param
1.8971 + cacheURL,
1.8972 + // Response headers as string
1.8973 + responseHeadersString,
1.8974 + // timeout handle
1.8975 + timeoutTimer,
1.8976 +
1.8977 + // To know if global events are to be dispatched
1.8978 + fireGlobals,
1.8979 +
1.8980 + transport,
1.8981 + // Response headers
1.8982 + responseHeaders,
1.8983 + // Create the final options object
1.8984 + s = jQuery.ajaxSetup( {}, options ),
1.8985 + // Callbacks context
1.8986 + callbackContext = s.context || s,
1.8987 + // Context for global events is callbackContext if it is a DOM node or jQuery collection
1.8988 + globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
1.8989 + jQuery( callbackContext ) :
1.8990 + jQuery.event,
1.8991 + // Deferreds
1.8992 + deferred = jQuery.Deferred(),
1.8993 + completeDeferred = jQuery.Callbacks("once memory"),
1.8994 + // Status-dependent callbacks
1.8995 + statusCode = s.statusCode || {},
1.8996 + // Headers (they are sent all at once)
1.8997 + requestHeaders = {},
1.8998 + requestHeadersNames = {},
1.8999 + // The jqXHR state
1.9000 + state = 0,
1.9001 + // Default abort message
1.9002 + strAbort = "canceled",
1.9003 + // Fake xhr
1.9004 + jqXHR = {
1.9005 + readyState: 0,
1.9006 +
1.9007 + // Builds headers hashtable if needed
1.9008 + getResponseHeader: function( key ) {
1.9009 + var match;
1.9010 + if ( state === 2 ) {
1.9011 + if ( !responseHeaders ) {
1.9012 + responseHeaders = {};
1.9013 + while ( (match = rheaders.exec( responseHeadersString )) ) {
1.9014 + responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
1.9015 + }
1.9016 + }
1.9017 + match = responseHeaders[ key.toLowerCase() ];
1.9018 + }
1.9019 + return match == null ? null : match;
1.9020 + },
1.9021 +
1.9022 + // Raw string
1.9023 + getAllResponseHeaders: function() {
1.9024 + return state === 2 ? responseHeadersString : null;
1.9025 + },
1.9026 +
1.9027 + // Caches the header
1.9028 + setRequestHeader: function( name, value ) {
1.9029 + var lname = name.toLowerCase();
1.9030 + if ( !state ) {
1.9031 + name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
1.9032 + requestHeaders[ name ] = value;
1.9033 + }
1.9034 + return this;
1.9035 + },
1.9036 +
1.9037 + // Overrides response content-type header
1.9038 + overrideMimeType: function( type ) {
1.9039 + if ( !state ) {
1.9040 + s.mimeType = type;
1.9041 + }
1.9042 + return this;
1.9043 + },
1.9044 +
1.9045 + // Status-dependent callbacks
1.9046 + statusCode: function( map ) {
1.9047 + var code;
1.9048 + if ( map ) {
1.9049 + if ( state < 2 ) {
1.9050 + for ( code in map ) {
1.9051 + // Lazy-add the new callback in a way that preserves old ones
1.9052 + statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
1.9053 + }
1.9054 + } else {
1.9055 + // Execute the appropriate callbacks
1.9056 + jqXHR.always( map[ jqXHR.status ] );
1.9057 + }
1.9058 + }
1.9059 + return this;
1.9060 + },
1.9061 +
1.9062 + // Cancel the request
1.9063 + abort: function( statusText ) {
1.9064 + var finalText = statusText || strAbort;
1.9065 + if ( transport ) {
1.9066 + transport.abort( finalText );
1.9067 + }
1.9068 + done( 0, finalText );
1.9069 + return this;
1.9070 + }
1.9071 + };
1.9072 +
1.9073 + // Attach deferreds
1.9074 + deferred.promise( jqXHR ).complete = completeDeferred.add;
1.9075 + jqXHR.success = jqXHR.done;
1.9076 + jqXHR.error = jqXHR.fail;
1.9077 +
1.9078 + // Remove hash character (#7531: and string promotion)
1.9079 + // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
1.9080 + // Handle falsy url in the settings object (#10093: consistency with old signature)
1.9081 + // We also use the url parameter if available
1.9082 + s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
1.9083 +
1.9084 + // Alias method option to type as per ticket #12004
1.9085 + s.type = options.method || options.type || s.method || s.type;
1.9086 +
1.9087 + // Extract dataTypes list
1.9088 + s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
1.9089 +
1.9090 + // A cross-domain request is in order when we have a protocol:host:port mismatch
1.9091 + if ( s.crossDomain == null ) {
1.9092 + parts = rurl.exec( s.url.toLowerCase() );
1.9093 + s.crossDomain = !!( parts &&
1.9094 + ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
1.9095 + ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
1.9096 + ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
1.9097 + );
1.9098 + }
1.9099 +
1.9100 + // Convert data if not already a string
1.9101 + if ( s.data && s.processData && typeof s.data !== "string" ) {
1.9102 + s.data = jQuery.param( s.data, s.traditional );
1.9103 + }
1.9104 +
1.9105 + // Apply prefilters
1.9106 + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
1.9107 +
1.9108 + // If request was aborted inside a prefilter, stop there
1.9109 + if ( state === 2 ) {
1.9110 + return jqXHR;
1.9111 + }
1.9112 +
1.9113 + // We can fire global events as of now if asked to
1.9114 + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
1.9115 + fireGlobals = jQuery.event && s.global;
1.9116 +
1.9117 + // Watch for a new set of requests
1.9118 + if ( fireGlobals && jQuery.active++ === 0 ) {
1.9119 + jQuery.event.trigger("ajaxStart");
1.9120 + }
1.9121 +
1.9122 + // Uppercase the type
1.9123 + s.type = s.type.toUpperCase();
1.9124 +
1.9125 + // Determine if request has content
1.9126 + s.hasContent = !rnoContent.test( s.type );
1.9127 +
1.9128 + // Save the URL in case we're toying with the If-Modified-Since
1.9129 + // and/or If-None-Match header later on
1.9130 + cacheURL = s.url;
1.9131 +
1.9132 + // More options handling for requests with no content
1.9133 + if ( !s.hasContent ) {
1.9134 +
1.9135 + // If data is available, append data to url
1.9136 + if ( s.data ) {
1.9137 + cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
1.9138 + // #9682: remove data so that it's not used in an eventual retry
1.9139 + delete s.data;
1.9140 + }
1.9141 +
1.9142 + // Add anti-cache in url if needed
1.9143 + if ( s.cache === false ) {
1.9144 + s.url = rts.test( cacheURL ) ?
1.9145 +
1.9146 + // If there is already a '_' parameter, set its value
1.9147 + cacheURL.replace( rts, "$1_=" + nonce++ ) :
1.9148 +
1.9149 + // Otherwise add one to the end
1.9150 + cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
1.9151 + }
1.9152 + }
1.9153 +
1.9154 + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
1.9155 + if ( s.ifModified ) {
1.9156 + if ( jQuery.lastModified[ cacheURL ] ) {
1.9157 + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
1.9158 + }
1.9159 + if ( jQuery.etag[ cacheURL ] ) {
1.9160 + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
1.9161 + }
1.9162 + }
1.9163 +
1.9164 + // Set the correct header, if data is being sent
1.9165 + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
1.9166 + jqXHR.setRequestHeader( "Content-Type", s.contentType );
1.9167 + }
1.9168 +
1.9169 + // Set the Accepts header for the server, depending on the dataType
1.9170 + jqXHR.setRequestHeader(
1.9171 + "Accept",
1.9172 + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
1.9173 + s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
1.9174 + s.accepts[ "*" ]
1.9175 + );
1.9176 +
1.9177 + // Check for headers option
1.9178 + for ( i in s.headers ) {
1.9179 + jqXHR.setRequestHeader( i, s.headers[ i ] );
1.9180 + }
1.9181 +
1.9182 + // Allow custom headers/mimetypes and early abort
1.9183 + if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
1.9184 + // Abort if not done already and return
1.9185 + return jqXHR.abort();
1.9186 + }
1.9187 +
1.9188 + // aborting is no longer a cancellation
1.9189 + strAbort = "abort";
1.9190 +
1.9191 + // Install callbacks on deferreds
1.9192 + for ( i in { success: 1, error: 1, complete: 1 } ) {
1.9193 + jqXHR[ i ]( s[ i ] );
1.9194 + }
1.9195 +
1.9196 + // Get transport
1.9197 + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
1.9198 +
1.9199 + // If no transport, we auto-abort
1.9200 + if ( !transport ) {
1.9201 + done( -1, "No Transport" );
1.9202 + } else {
1.9203 + jqXHR.readyState = 1;
1.9204 +
1.9205 + // Send global event
1.9206 + if ( fireGlobals ) {
1.9207 + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
1.9208 + }
1.9209 + // Timeout
1.9210 + if ( s.async && s.timeout > 0 ) {
1.9211 + timeoutTimer = setTimeout(function() {
1.9212 + jqXHR.abort("timeout");
1.9213 + }, s.timeout );
1.9214 + }
1.9215 +
1.9216 + try {
1.9217 + state = 1;
1.9218 + transport.send( requestHeaders, done );
1.9219 + } catch ( e ) {
1.9220 + // Propagate exception as error if not done
1.9221 + if ( state < 2 ) {
1.9222 + done( -1, e );
1.9223 + // Simply rethrow otherwise
1.9224 + } else {
1.9225 + throw e;
1.9226 + }
1.9227 + }
1.9228 + }
1.9229 +
1.9230 + // Callback for when everything is done
1.9231 + function done( status, nativeStatusText, responses, headers ) {
1.9232 + var isSuccess, success, error, response, modified,
1.9233 + statusText = nativeStatusText;
1.9234 +
1.9235 + // Called once
1.9236 + if ( state === 2 ) {
1.9237 + return;
1.9238 + }
1.9239 +
1.9240 + // State is "done" now
1.9241 + state = 2;
1.9242 +
1.9243 + // Clear timeout if it exists
1.9244 + if ( timeoutTimer ) {
1.9245 + clearTimeout( timeoutTimer );
1.9246 + }
1.9247 +
1.9248 + // Dereference transport for early garbage collection
1.9249 + // (no matter how long the jqXHR object will be used)
1.9250 + transport = undefined;
1.9251 +
1.9252 + // Cache response headers
1.9253 + responseHeadersString = headers || "";
1.9254 +
1.9255 + // Set readyState
1.9256 + jqXHR.readyState = status > 0 ? 4 : 0;
1.9257 +
1.9258 + // Determine if successful
1.9259 + isSuccess = status >= 200 && status < 300 || status === 304;
1.9260 +
1.9261 + // Get response data
1.9262 + if ( responses ) {
1.9263 + response = ajaxHandleResponses( s, jqXHR, responses );
1.9264 + }
1.9265 +
1.9266 + // Convert no matter what (that way responseXXX fields are always set)
1.9267 + response = ajaxConvert( s, response, jqXHR, isSuccess );
1.9268 +
1.9269 + // If successful, handle type chaining
1.9270 + if ( isSuccess ) {
1.9271 +
1.9272 + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
1.9273 + if ( s.ifModified ) {
1.9274 + modified = jqXHR.getResponseHeader("Last-Modified");
1.9275 + if ( modified ) {
1.9276 + jQuery.lastModified[ cacheURL ] = modified;
1.9277 + }
1.9278 + modified = jqXHR.getResponseHeader("etag");
1.9279 + if ( modified ) {
1.9280 + jQuery.etag[ cacheURL ] = modified;
1.9281 + }
1.9282 + }
1.9283 +
1.9284 + // if no content
1.9285 + if ( status === 204 || s.type === "HEAD" ) {
1.9286 + statusText = "nocontent";
1.9287 +
1.9288 + // if not modified
1.9289 + } else if ( status === 304 ) {
1.9290 + statusText = "notmodified";
1.9291 +
1.9292 + // If we have data, let's convert it
1.9293 + } else {
1.9294 + statusText = response.state;
1.9295 + success = response.data;
1.9296 + error = response.error;
1.9297 + isSuccess = !error;
1.9298 + }
1.9299 + } else {
1.9300 + // We extract error from statusText
1.9301 + // then normalize statusText and status for non-aborts
1.9302 + error = statusText;
1.9303 + if ( status || !statusText ) {
1.9304 + statusText = "error";
1.9305 + if ( status < 0 ) {
1.9306 + status = 0;
1.9307 + }
1.9308 + }
1.9309 + }
1.9310 +
1.9311 + // Set data for the fake xhr object
1.9312 + jqXHR.status = status;
1.9313 + jqXHR.statusText = ( nativeStatusText || statusText ) + "";
1.9314 +
1.9315 + // Success/Error
1.9316 + if ( isSuccess ) {
1.9317 + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
1.9318 + } else {
1.9319 + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
1.9320 + }
1.9321 +
1.9322 + // Status-dependent callbacks
1.9323 + jqXHR.statusCode( statusCode );
1.9324 + statusCode = undefined;
1.9325 +
1.9326 + if ( fireGlobals ) {
1.9327 + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
1.9328 + [ jqXHR, s, isSuccess ? success : error ] );
1.9329 + }
1.9330 +
1.9331 + // Complete
1.9332 + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
1.9333 +
1.9334 + if ( fireGlobals ) {
1.9335 + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
1.9336 + // Handle the global AJAX counter
1.9337 + if ( !( --jQuery.active ) ) {
1.9338 + jQuery.event.trigger("ajaxStop");
1.9339 + }
1.9340 + }
1.9341 + }
1.9342 +
1.9343 + return jqXHR;
1.9344 + },
1.9345 +
1.9346 + getJSON: function( url, data, callback ) {
1.9347 + return jQuery.get( url, data, callback, "json" );
1.9348 + },
1.9349 +
1.9350 + getScript: function( url, callback ) {
1.9351 + return jQuery.get( url, undefined, callback, "script" );
1.9352 + }
1.9353 +});
1.9354 +
1.9355 +jQuery.each( [ "get", "post" ], function( i, method ) {
1.9356 + jQuery[ method ] = function( url, data, callback, type ) {
1.9357 + // shift arguments if data argument was omitted
1.9358 + if ( jQuery.isFunction( data ) ) {
1.9359 + type = type || callback;
1.9360 + callback = data;
1.9361 + data = undefined;
1.9362 + }
1.9363 +
1.9364 + return jQuery.ajax({
1.9365 + url: url,
1.9366 + type: method,
1.9367 + dataType: type,
1.9368 + data: data,
1.9369 + success: callback
1.9370 + });
1.9371 + };
1.9372 +});
1.9373 +
1.9374 +
1.9375 +jQuery._evalUrl = function( url ) {
1.9376 + return jQuery.ajax({
1.9377 + url: url,
1.9378 + type: "GET",
1.9379 + dataType: "script",
1.9380 + async: false,
1.9381 + global: false,
1.9382 + "throws": true
1.9383 + });
1.9384 +};
1.9385 +
1.9386 +
1.9387 +jQuery.fn.extend({
1.9388 + wrapAll: function( html ) {
1.9389 + if ( jQuery.isFunction( html ) ) {
1.9390 + return this.each(function(i) {
1.9391 + jQuery(this).wrapAll( html.call(this, i) );
1.9392 + });
1.9393 + }
1.9394 +
1.9395 + if ( this[0] ) {
1.9396 + // The elements to wrap the target around
1.9397 + var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
1.9398 +
1.9399 + if ( this[0].parentNode ) {
1.9400 + wrap.insertBefore( this[0] );
1.9401 + }
1.9402 +
1.9403 + wrap.map(function() {
1.9404 + var elem = this;
1.9405 +
1.9406 + while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
1.9407 + elem = elem.firstChild;
1.9408 + }
1.9409 +
1.9410 + return elem;
1.9411 + }).append( this );
1.9412 + }
1.9413 +
1.9414 + return this;
1.9415 + },
1.9416 +
1.9417 + wrapInner: function( html ) {
1.9418 + if ( jQuery.isFunction( html ) ) {
1.9419 + return this.each(function(i) {
1.9420 + jQuery(this).wrapInner( html.call(this, i) );
1.9421 + });
1.9422 + }
1.9423 +
1.9424 + return this.each(function() {
1.9425 + var self = jQuery( this ),
1.9426 + contents = self.contents();
1.9427 +
1.9428 + if ( contents.length ) {
1.9429 + contents.wrapAll( html );
1.9430 +
1.9431 + } else {
1.9432 + self.append( html );
1.9433 + }
1.9434 + });
1.9435 + },
1.9436 +
1.9437 + wrap: function( html ) {
1.9438 + var isFunction = jQuery.isFunction( html );
1.9439 +
1.9440 + return this.each(function(i) {
1.9441 + jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
1.9442 + });
1.9443 + },
1.9444 +
1.9445 + unwrap: function() {
1.9446 + return this.parent().each(function() {
1.9447 + if ( !jQuery.nodeName( this, "body" ) ) {
1.9448 + jQuery( this ).replaceWith( this.childNodes );
1.9449 + }
1.9450 + }).end();
1.9451 + }
1.9452 +});
1.9453 +
1.9454 +
1.9455 +jQuery.expr.filters.hidden = function( elem ) {
1.9456 + // Support: Opera <= 12.12
1.9457 + // Opera reports offsetWidths and offsetHeights less than zero on some elements
1.9458 + return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
1.9459 + (!support.reliableHiddenOffsets() &&
1.9460 + ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
1.9461 +};
1.9462 +
1.9463 +jQuery.expr.filters.visible = function( elem ) {
1.9464 + return !jQuery.expr.filters.hidden( elem );
1.9465 +};
1.9466 +
1.9467 +
1.9468 +
1.9469 +
1.9470 +var r20 = /%20/g,
1.9471 + rbracket = /\[\]$/,
1.9472 + rCRLF = /\r?\n/g,
1.9473 + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
1.9474 + rsubmittable = /^(?:input|select|textarea|keygen)/i;
1.9475 +
1.9476 +function buildParams( prefix, obj, traditional, add ) {
1.9477 + var name;
1.9478 +
1.9479 + if ( jQuery.isArray( obj ) ) {
1.9480 + // Serialize array item.
1.9481 + jQuery.each( obj, function( i, v ) {
1.9482 + if ( traditional || rbracket.test( prefix ) ) {
1.9483 + // Treat each array item as a scalar.
1.9484 + add( prefix, v );
1.9485 +
1.9486 + } else {
1.9487 + // Item is non-scalar (array or object), encode its numeric index.
1.9488 + buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
1.9489 + }
1.9490 + });
1.9491 +
1.9492 + } else if ( !traditional && jQuery.type( obj ) === "object" ) {
1.9493 + // Serialize object item.
1.9494 + for ( name in obj ) {
1.9495 + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
1.9496 + }
1.9497 +
1.9498 + } else {
1.9499 + // Serialize scalar item.
1.9500 + add( prefix, obj );
1.9501 + }
1.9502 +}
1.9503 +
1.9504 +// Serialize an array of form elements or a set of
1.9505 +// key/values into a query string
1.9506 +jQuery.param = function( a, traditional ) {
1.9507 + var prefix,
1.9508 + s = [],
1.9509 + add = function( key, value ) {
1.9510 + // If value is a function, invoke it and return its value
1.9511 + value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
1.9512 + s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
1.9513 + };
1.9514 +
1.9515 + // Set traditional to true for jQuery <= 1.3.2 behavior.
1.9516 + if ( traditional === undefined ) {
1.9517 + traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
1.9518 + }
1.9519 +
1.9520 + // If an array was passed in, assume that it is an array of form elements.
1.9521 + if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
1.9522 + // Serialize the form elements
1.9523 + jQuery.each( a, function() {
1.9524 + add( this.name, this.value );
1.9525 + });
1.9526 +
1.9527 + } else {
1.9528 + // If traditional, encode the "old" way (the way 1.3.2 or older
1.9529 + // did it), otherwise encode params recursively.
1.9530 + for ( prefix in a ) {
1.9531 + buildParams( prefix, a[ prefix ], traditional, add );
1.9532 + }
1.9533 + }
1.9534 +
1.9535 + // Return the resulting serialization
1.9536 + return s.join( "&" ).replace( r20, "+" );
1.9537 +};
1.9538 +
1.9539 +jQuery.fn.extend({
1.9540 + serialize: function() {
1.9541 + return jQuery.param( this.serializeArray() );
1.9542 + },
1.9543 + serializeArray: function() {
1.9544 + return this.map(function() {
1.9545 + // Can add propHook for "elements" to filter or add form elements
1.9546 + var elements = jQuery.prop( this, "elements" );
1.9547 + return elements ? jQuery.makeArray( elements ) : this;
1.9548 + })
1.9549 + .filter(function() {
1.9550 + var type = this.type;
1.9551 + // Use .is(":disabled") so that fieldset[disabled] works
1.9552 + return this.name && !jQuery( this ).is( ":disabled" ) &&
1.9553 + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
1.9554 + ( this.checked || !rcheckableType.test( type ) );
1.9555 + })
1.9556 + .map(function( i, elem ) {
1.9557 + var val = jQuery( this ).val();
1.9558 +
1.9559 + return val == null ?
1.9560 + null :
1.9561 + jQuery.isArray( val ) ?
1.9562 + jQuery.map( val, function( val ) {
1.9563 + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
1.9564 + }) :
1.9565 + { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
1.9566 + }).get();
1.9567 + }
1.9568 +});
1.9569 +
1.9570 +
1.9571 +// Create the request object
1.9572 +// (This is still attached to ajaxSettings for backward compatibility)
1.9573 +jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
1.9574 + // Support: IE6+
1.9575 + function() {
1.9576 +
1.9577 + // XHR cannot access local files, always use ActiveX for that case
1.9578 + return !this.isLocal &&
1.9579 +
1.9580 + // Support: IE7-8
1.9581 + // oldIE XHR does not support non-RFC2616 methods (#13240)
1.9582 + // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
1.9583 + // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
1.9584 + // Although this check for six methods instead of eight
1.9585 + // since IE also does not support "trace" and "connect"
1.9586 + /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
1.9587 +
1.9588 + createStandardXHR() || createActiveXHR();
1.9589 + } :
1.9590 + // For all other browsers, use the standard XMLHttpRequest object
1.9591 + createStandardXHR;
1.9592 +
1.9593 +var xhrId = 0,
1.9594 + xhrCallbacks = {},
1.9595 + xhrSupported = jQuery.ajaxSettings.xhr();
1.9596 +
1.9597 +// Support: IE<10
1.9598 +// Open requests must be manually aborted on unload (#5280)
1.9599 +// See https://support.microsoft.com/kb/2856746 for more info
1.9600 +if ( window.attachEvent ) {
1.9601 + window.attachEvent( "onunload", function() {
1.9602 + for ( var key in xhrCallbacks ) {
1.9603 + xhrCallbacks[ key ]( undefined, true );
1.9604 + }
1.9605 + });
1.9606 +}
1.9607 +
1.9608 +// Determine support properties
1.9609 +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
1.9610 +xhrSupported = support.ajax = !!xhrSupported;
1.9611 +
1.9612 +// Create transport if the browser can provide an xhr
1.9613 +if ( xhrSupported ) {
1.9614 +
1.9615 + jQuery.ajaxTransport(function( options ) {
1.9616 + // Cross domain only allowed if supported through XMLHttpRequest
1.9617 + if ( !options.crossDomain || support.cors ) {
1.9618 +
1.9619 + var callback;
1.9620 +
1.9621 + return {
1.9622 + send: function( headers, complete ) {
1.9623 + var i,
1.9624 + xhr = options.xhr(),
1.9625 + id = ++xhrId;
1.9626 +
1.9627 + // Open the socket
1.9628 + xhr.open( options.type, options.url, options.async, options.username, options.password );
1.9629 +
1.9630 + // Apply custom fields if provided
1.9631 + if ( options.xhrFields ) {
1.9632 + for ( i in options.xhrFields ) {
1.9633 + xhr[ i ] = options.xhrFields[ i ];
1.9634 + }
1.9635 + }
1.9636 +
1.9637 + // Override mime type if needed
1.9638 + if ( options.mimeType && xhr.overrideMimeType ) {
1.9639 + xhr.overrideMimeType( options.mimeType );
1.9640 + }
1.9641 +
1.9642 + // X-Requested-With header
1.9643 + // For cross-domain requests, seeing as conditions for a preflight are
1.9644 + // akin to a jigsaw puzzle, we simply never set it to be sure.
1.9645 + // (it can always be set on a per-request basis or even using ajaxSetup)
1.9646 + // For same-domain requests, won't change header if already provided.
1.9647 + if ( !options.crossDomain && !headers["X-Requested-With"] ) {
1.9648 + headers["X-Requested-With"] = "XMLHttpRequest";
1.9649 + }
1.9650 +
1.9651 + // Set headers
1.9652 + for ( i in headers ) {
1.9653 + // Support: IE<9
1.9654 + // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
1.9655 + // request header to a null-value.
1.9656 + //
1.9657 + // To keep consistent with other XHR implementations, cast the value
1.9658 + // to string and ignore `undefined`.
1.9659 + if ( headers[ i ] !== undefined ) {
1.9660 + xhr.setRequestHeader( i, headers[ i ] + "" );
1.9661 + }
1.9662 + }
1.9663 +
1.9664 + // Do send the request
1.9665 + // This may raise an exception which is actually
1.9666 + // handled in jQuery.ajax (so no try/catch here)
1.9667 + xhr.send( ( options.hasContent && options.data ) || null );
1.9668 +
1.9669 + // Listener
1.9670 + callback = function( _, isAbort ) {
1.9671 + var status, statusText, responses;
1.9672 +
1.9673 + // Was never called and is aborted or complete
1.9674 + if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
1.9675 + // Clean up
1.9676 + delete xhrCallbacks[ id ];
1.9677 + callback = undefined;
1.9678 + xhr.onreadystatechange = jQuery.noop;
1.9679 +
1.9680 + // Abort manually if needed
1.9681 + if ( isAbort ) {
1.9682 + if ( xhr.readyState !== 4 ) {
1.9683 + xhr.abort();
1.9684 + }
1.9685 + } else {
1.9686 + responses = {};
1.9687 + status = xhr.status;
1.9688 +
1.9689 + // Support: IE<10
1.9690 + // Accessing binary-data responseText throws an exception
1.9691 + // (#11426)
1.9692 + if ( typeof xhr.responseText === "string" ) {
1.9693 + responses.text = xhr.responseText;
1.9694 + }
1.9695 +
1.9696 + // Firefox throws an exception when accessing
1.9697 + // statusText for faulty cross-domain requests
1.9698 + try {
1.9699 + statusText = xhr.statusText;
1.9700 + } catch( e ) {
1.9701 + // We normalize with Webkit giving an empty statusText
1.9702 + statusText = "";
1.9703 + }
1.9704 +
1.9705 + // Filter status for non standard behaviors
1.9706 +
1.9707 + // If the request is local and we have data: assume a success
1.9708 + // (success with no data won't get notified, that's the best we
1.9709 + // can do given current implementations)
1.9710 + if ( !status && options.isLocal && !options.crossDomain ) {
1.9711 + status = responses.text ? 200 : 404;
1.9712 + // IE - #1450: sometimes returns 1223 when it should be 204
1.9713 + } else if ( status === 1223 ) {
1.9714 + status = 204;
1.9715 + }
1.9716 + }
1.9717 + }
1.9718 +
1.9719 + // Call complete if needed
1.9720 + if ( responses ) {
1.9721 + complete( status, statusText, responses, xhr.getAllResponseHeaders() );
1.9722 + }
1.9723 + };
1.9724 +
1.9725 + if ( !options.async ) {
1.9726 + // if we're in sync mode we fire the callback
1.9727 + callback();
1.9728 + } else if ( xhr.readyState === 4 ) {
1.9729 + // (IE6 & IE7) if it's in cache and has been
1.9730 + // retrieved directly we need to fire the callback
1.9731 + setTimeout( callback );
1.9732 + } else {
1.9733 + // Add to the list of active xhr callbacks
1.9734 + xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
1.9735 + }
1.9736 + },
1.9737 +
1.9738 + abort: function() {
1.9739 + if ( callback ) {
1.9740 + callback( undefined, true );
1.9741 + }
1.9742 + }
1.9743 + };
1.9744 + }
1.9745 + });
1.9746 +}
1.9747 +
1.9748 +// Functions to create xhrs
1.9749 +function createStandardXHR() {
1.9750 + try {
1.9751 + return new window.XMLHttpRequest();
1.9752 + } catch( e ) {}
1.9753 +}
1.9754 +
1.9755 +function createActiveXHR() {
1.9756 + try {
1.9757 + return new window.ActiveXObject( "Microsoft.XMLHTTP" );
1.9758 + } catch( e ) {}
1.9759 +}
1.9760 +
1.9761 +
1.9762 +
1.9763 +
1.9764 +// Install script dataType
1.9765 +jQuery.ajaxSetup({
1.9766 + accepts: {
1.9767 + script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
1.9768 + },
1.9769 + contents: {
1.9770 + script: /(?:java|ecma)script/
1.9771 + },
1.9772 + converters: {
1.9773 + "text script": function( text ) {
1.9774 + jQuery.globalEval( text );
1.9775 + return text;
1.9776 + }
1.9777 + }
1.9778 +});
1.9779 +
1.9780 +// Handle cache's special case and global
1.9781 +jQuery.ajaxPrefilter( "script", function( s ) {
1.9782 + if ( s.cache === undefined ) {
1.9783 + s.cache = false;
1.9784 + }
1.9785 + if ( s.crossDomain ) {
1.9786 + s.type = "GET";
1.9787 + s.global = false;
1.9788 + }
1.9789 +});
1.9790 +
1.9791 +// Bind script tag hack transport
1.9792 +jQuery.ajaxTransport( "script", function(s) {
1.9793 +
1.9794 + // This transport only deals with cross domain requests
1.9795 + if ( s.crossDomain ) {
1.9796 +
1.9797 + var script,
1.9798 + head = document.head || jQuery("head")[0] || document.documentElement;
1.9799 +
1.9800 + return {
1.9801 +
1.9802 + send: function( _, callback ) {
1.9803 +
1.9804 + script = document.createElement("script");
1.9805 +
1.9806 + script.async = true;
1.9807 +
1.9808 + if ( s.scriptCharset ) {
1.9809 + script.charset = s.scriptCharset;
1.9810 + }
1.9811 +
1.9812 + script.src = s.url;
1.9813 +
1.9814 + // Attach handlers for all browsers
1.9815 + script.onload = script.onreadystatechange = function( _, isAbort ) {
1.9816 +
1.9817 + if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
1.9818 +
1.9819 + // Handle memory leak in IE
1.9820 + script.onload = script.onreadystatechange = null;
1.9821 +
1.9822 + // Remove the script
1.9823 + if ( script.parentNode ) {
1.9824 + script.parentNode.removeChild( script );
1.9825 + }
1.9826 +
1.9827 + // Dereference the script
1.9828 + script = null;
1.9829 +
1.9830 + // Callback if not abort
1.9831 + if ( !isAbort ) {
1.9832 + callback( 200, "success" );
1.9833 + }
1.9834 + }
1.9835 + };
1.9836 +
1.9837 + // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
1.9838 + // Use native DOM manipulation to avoid our domManip AJAX trickery
1.9839 + head.insertBefore( script, head.firstChild );
1.9840 + },
1.9841 +
1.9842 + abort: function() {
1.9843 + if ( script ) {
1.9844 + script.onload( undefined, true );
1.9845 + }
1.9846 + }
1.9847 + };
1.9848 + }
1.9849 +});
1.9850 +
1.9851 +
1.9852 +
1.9853 +
1.9854 +var oldCallbacks = [],
1.9855 + rjsonp = /(=)\?(?=&|$)|\?\?/;
1.9856 +
1.9857 +// Default jsonp settings
1.9858 +jQuery.ajaxSetup({
1.9859 + jsonp: "callback",
1.9860 + jsonpCallback: function() {
1.9861 + var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
1.9862 + this[ callback ] = true;
1.9863 + return callback;
1.9864 + }
1.9865 +});
1.9866 +
1.9867 +// Detect, normalize options and install callbacks for jsonp requests
1.9868 +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
1.9869 +
1.9870 + var callbackName, overwritten, responseContainer,
1.9871 + jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
1.9872 + "url" :
1.9873 + typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
1.9874 + );
1.9875 +
1.9876 + // Handle iff the expected data type is "jsonp" or we have a parameter to set
1.9877 + if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
1.9878 +
1.9879 + // Get callback name, remembering preexisting value associated with it
1.9880 + callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
1.9881 + s.jsonpCallback() :
1.9882 + s.jsonpCallback;
1.9883 +
1.9884 + // Insert callback into url or form data
1.9885 + if ( jsonProp ) {
1.9886 + s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
1.9887 + } else if ( s.jsonp !== false ) {
1.9888 + s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
1.9889 + }
1.9890 +
1.9891 + // Use data converter to retrieve json after script execution
1.9892 + s.converters["script json"] = function() {
1.9893 + if ( !responseContainer ) {
1.9894 + jQuery.error( callbackName + " was not called" );
1.9895 + }
1.9896 + return responseContainer[ 0 ];
1.9897 + };
1.9898 +
1.9899 + // force json dataType
1.9900 + s.dataTypes[ 0 ] = "json";
1.9901 +
1.9902 + // Install callback
1.9903 + overwritten = window[ callbackName ];
1.9904 + window[ callbackName ] = function() {
1.9905 + responseContainer = arguments;
1.9906 + };
1.9907 +
1.9908 + // Clean-up function (fires after converters)
1.9909 + jqXHR.always(function() {
1.9910 + // Restore preexisting value
1.9911 + window[ callbackName ] = overwritten;
1.9912 +
1.9913 + // Save back as free
1.9914 + if ( s[ callbackName ] ) {
1.9915 + // make sure that re-using the options doesn't screw things around
1.9916 + s.jsonpCallback = originalSettings.jsonpCallback;
1.9917 +
1.9918 + // save the callback name for future use
1.9919 + oldCallbacks.push( callbackName );
1.9920 + }
1.9921 +
1.9922 + // Call if it was a function and we have a response
1.9923 + if ( responseContainer && jQuery.isFunction( overwritten ) ) {
1.9924 + overwritten( responseContainer[ 0 ] );
1.9925 + }
1.9926 +
1.9927 + responseContainer = overwritten = undefined;
1.9928 + });
1.9929 +
1.9930 + // Delegate to script
1.9931 + return "script";
1.9932 + }
1.9933 +});
1.9934 +
1.9935 +
1.9936 +
1.9937 +
1.9938 +// data: string of html
1.9939 +// context (optional): If specified, the fragment will be created in this context, defaults to document
1.9940 +// keepScripts (optional): If true, will include scripts passed in the html string
1.9941 +jQuery.parseHTML = function( data, context, keepScripts ) {
1.9942 + if ( !data || typeof data !== "string" ) {
1.9943 + return null;
1.9944 + }
1.9945 + if ( typeof context === "boolean" ) {
1.9946 + keepScripts = context;
1.9947 + context = false;
1.9948 + }
1.9949 + context = context || document;
1.9950 +
1.9951 + var parsed = rsingleTag.exec( data ),
1.9952 + scripts = !keepScripts && [];
1.9953 +
1.9954 + // Single tag
1.9955 + if ( parsed ) {
1.9956 + return [ context.createElement( parsed[1] ) ];
1.9957 + }
1.9958 +
1.9959 + parsed = jQuery.buildFragment( [ data ], context, scripts );
1.9960 +
1.9961 + if ( scripts && scripts.length ) {
1.9962 + jQuery( scripts ).remove();
1.9963 + }
1.9964 +
1.9965 + return jQuery.merge( [], parsed.childNodes );
1.9966 +};
1.9967 +
1.9968 +
1.9969 +// Keep a copy of the old load method
1.9970 +var _load = jQuery.fn.load;
1.9971 +
1.9972 +/**
1.9973 + * Load a url into a page
1.9974 + */
1.9975 +jQuery.fn.load = function( url, params, callback ) {
1.9976 + if ( typeof url !== "string" && _load ) {
1.9977 + return _load.apply( this, arguments );
1.9978 + }
1.9979 +
1.9980 + var selector, response, type,
1.9981 + self = this,
1.9982 + off = url.indexOf(" ");
1.9983 +
1.9984 + if ( off >= 0 ) {
1.9985 + selector = jQuery.trim( url.slice( off, url.length ) );
1.9986 + url = url.slice( 0, off );
1.9987 + }
1.9988 +
1.9989 + // If it's a function
1.9990 + if ( jQuery.isFunction( params ) ) {
1.9991 +
1.9992 + // We assume that it's the callback
1.9993 + callback = params;
1.9994 + params = undefined;
1.9995 +
1.9996 + // Otherwise, build a param string
1.9997 + } else if ( params && typeof params === "object" ) {
1.9998 + type = "POST";
1.9999 + }
1.10000 +
1.10001 + // If we have elements to modify, make the request
1.10002 + if ( self.length > 0 ) {
1.10003 + jQuery.ajax({
1.10004 + url: url,
1.10005 +
1.10006 + // if "type" variable is undefined, then "GET" method will be used
1.10007 + type: type,
1.10008 + dataType: "html",
1.10009 + data: params
1.10010 + }).done(function( responseText ) {
1.10011 +
1.10012 + // Save response for use in complete callback
1.10013 + response = arguments;
1.10014 +
1.10015 + self.html( selector ?
1.10016 +
1.10017 + // If a selector was specified, locate the right elements in a dummy div
1.10018 + // Exclude scripts to avoid IE 'Permission Denied' errors
1.10019 + jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
1.10020 +
1.10021 + // Otherwise use the full result
1.10022 + responseText );
1.10023 +
1.10024 + }).complete( callback && function( jqXHR, status ) {
1.10025 + self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
1.10026 + });
1.10027 + }
1.10028 +
1.10029 + return this;
1.10030 +};
1.10031 +
1.10032 +
1.10033 +
1.10034 +
1.10035 +// Attach a bunch of functions for handling common AJAX events
1.10036 +jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
1.10037 + jQuery.fn[ type ] = function( fn ) {
1.10038 + return this.on( type, fn );
1.10039 + };
1.10040 +});
1.10041 +
1.10042 +
1.10043 +
1.10044 +
1.10045 +jQuery.expr.filters.animated = function( elem ) {
1.10046 + return jQuery.grep(jQuery.timers, function( fn ) {
1.10047 + return elem === fn.elem;
1.10048 + }).length;
1.10049 +};
1.10050 +
1.10051 +
1.10052 +
1.10053 +
1.10054 +
1.10055 +var docElem = window.document.documentElement;
1.10056 +
1.10057 +/**
1.10058 + * Gets a window from an element
1.10059 + */
1.10060 +function getWindow( elem ) {
1.10061 + return jQuery.isWindow( elem ) ?
1.10062 + elem :
1.10063 + elem.nodeType === 9 ?
1.10064 + elem.defaultView || elem.parentWindow :
1.10065 + false;
1.10066 +}
1.10067 +
1.10068 +jQuery.offset = {
1.10069 + setOffset: function( elem, options, i ) {
1.10070 + var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
1.10071 + position = jQuery.css( elem, "position" ),
1.10072 + curElem = jQuery( elem ),
1.10073 + props = {};
1.10074 +
1.10075 + // set position first, in-case top/left are set even on static elem
1.10076 + if ( position === "static" ) {
1.10077 + elem.style.position = "relative";
1.10078 + }
1.10079 +
1.10080 + curOffset = curElem.offset();
1.10081 + curCSSTop = jQuery.css( elem, "top" );
1.10082 + curCSSLeft = jQuery.css( elem, "left" );
1.10083 + calculatePosition = ( position === "absolute" || position === "fixed" ) &&
1.10084 + jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
1.10085 +
1.10086 + // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
1.10087 + if ( calculatePosition ) {
1.10088 + curPosition = curElem.position();
1.10089 + curTop = curPosition.top;
1.10090 + curLeft = curPosition.left;
1.10091 + } else {
1.10092 + curTop = parseFloat( curCSSTop ) || 0;
1.10093 + curLeft = parseFloat( curCSSLeft ) || 0;
1.10094 + }
1.10095 +
1.10096 + if ( jQuery.isFunction( options ) ) {
1.10097 + options = options.call( elem, i, curOffset );
1.10098 + }
1.10099 +
1.10100 + if ( options.top != null ) {
1.10101 + props.top = ( options.top - curOffset.top ) + curTop;
1.10102 + }
1.10103 + if ( options.left != null ) {
1.10104 + props.left = ( options.left - curOffset.left ) + curLeft;
1.10105 + }
1.10106 +
1.10107 + if ( "using" in options ) {
1.10108 + options.using.call( elem, props );
1.10109 + } else {
1.10110 + curElem.css( props );
1.10111 + }
1.10112 + }
1.10113 +};
1.10114 +
1.10115 +jQuery.fn.extend({
1.10116 + offset: function( options ) {
1.10117 + if ( arguments.length ) {
1.10118 + return options === undefined ?
1.10119 + this :
1.10120 + this.each(function( i ) {
1.10121 + jQuery.offset.setOffset( this, options, i );
1.10122 + });
1.10123 + }
1.10124 +
1.10125 + var docElem, win,
1.10126 + box = { top: 0, left: 0 },
1.10127 + elem = this[ 0 ],
1.10128 + doc = elem && elem.ownerDocument;
1.10129 +
1.10130 + if ( !doc ) {
1.10131 + return;
1.10132 + }
1.10133 +
1.10134 + docElem = doc.documentElement;
1.10135 +
1.10136 + // Make sure it's not a disconnected DOM node
1.10137 + if ( !jQuery.contains( docElem, elem ) ) {
1.10138 + return box;
1.10139 + }
1.10140 +
1.10141 + // If we don't have gBCR, just use 0,0 rather than error
1.10142 + // BlackBerry 5, iOS 3 (original iPhone)
1.10143 + if ( typeof elem.getBoundingClientRect !== strundefined ) {
1.10144 + box = elem.getBoundingClientRect();
1.10145 + }
1.10146 + win = getWindow( doc );
1.10147 + return {
1.10148 + top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
1.10149 + left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
1.10150 + };
1.10151 + },
1.10152 +
1.10153 + position: function() {
1.10154 + if ( !this[ 0 ] ) {
1.10155 + return;
1.10156 + }
1.10157 +
1.10158 + var offsetParent, offset,
1.10159 + parentOffset = { top: 0, left: 0 },
1.10160 + elem = this[ 0 ];
1.10161 +
1.10162 + // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
1.10163 + if ( jQuery.css( elem, "position" ) === "fixed" ) {
1.10164 + // we assume that getBoundingClientRect is available when computed position is fixed
1.10165 + offset = elem.getBoundingClientRect();
1.10166 + } else {
1.10167 + // Get *real* offsetParent
1.10168 + offsetParent = this.offsetParent();
1.10169 +
1.10170 + // Get correct offsets
1.10171 + offset = this.offset();
1.10172 + if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
1.10173 + parentOffset = offsetParent.offset();
1.10174 + }
1.10175 +
1.10176 + // Add offsetParent borders
1.10177 + parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
1.10178 + parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
1.10179 + }
1.10180 +
1.10181 + // Subtract parent offsets and element margins
1.10182 + // note: when an element has margin: auto the offsetLeft and marginLeft
1.10183 + // are the same in Safari causing offset.left to incorrectly be 0
1.10184 + return {
1.10185 + top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
1.10186 + left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
1.10187 + };
1.10188 + },
1.10189 +
1.10190 + offsetParent: function() {
1.10191 + return this.map(function() {
1.10192 + var offsetParent = this.offsetParent || docElem;
1.10193 +
1.10194 + while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
1.10195 + offsetParent = offsetParent.offsetParent;
1.10196 + }
1.10197 + return offsetParent || docElem;
1.10198 + });
1.10199 + }
1.10200 +});
1.10201 +
1.10202 +// Create scrollLeft and scrollTop methods
1.10203 +jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
1.10204 + var top = /Y/.test( prop );
1.10205 +
1.10206 + jQuery.fn[ method ] = function( val ) {
1.10207 + return access( this, function( elem, method, val ) {
1.10208 + var win = getWindow( elem );
1.10209 +
1.10210 + if ( val === undefined ) {
1.10211 + return win ? (prop in win) ? win[ prop ] :
1.10212 + win.document.documentElement[ method ] :
1.10213 + elem[ method ];
1.10214 + }
1.10215 +
1.10216 + if ( win ) {
1.10217 + win.scrollTo(
1.10218 + !top ? val : jQuery( win ).scrollLeft(),
1.10219 + top ? val : jQuery( win ).scrollTop()
1.10220 + );
1.10221 +
1.10222 + } else {
1.10223 + elem[ method ] = val;
1.10224 + }
1.10225 + }, method, val, arguments.length, null );
1.10226 + };
1.10227 +});
1.10228 +
1.10229 +// Add the top/left cssHooks using jQuery.fn.position
1.10230 +// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
1.10231 +// getComputedStyle returns percent when specified for top/left/bottom/right
1.10232 +// rather than make the css module depend on the offset module, we just check for it here
1.10233 +jQuery.each( [ "top", "left" ], function( i, prop ) {
1.10234 + jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
1.10235 + function( elem, computed ) {
1.10236 + if ( computed ) {
1.10237 + computed = curCSS( elem, prop );
1.10238 + // if curCSS returns percentage, fallback to offset
1.10239 + return rnumnonpx.test( computed ) ?
1.10240 + jQuery( elem ).position()[ prop ] + "px" :
1.10241 + computed;
1.10242 + }
1.10243 + }
1.10244 + );
1.10245 +});
1.10246 +
1.10247 +
1.10248 +// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
1.10249 +jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
1.10250 + jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
1.10251 + // margin is only for outerHeight, outerWidth
1.10252 + jQuery.fn[ funcName ] = function( margin, value ) {
1.10253 + var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
1.10254 + extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
1.10255 +
1.10256 + return access( this, function( elem, type, value ) {
1.10257 + var doc;
1.10258 +
1.10259 + if ( jQuery.isWindow( elem ) ) {
1.10260 + // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
1.10261 + // isn't a whole lot we can do. See pull request at this URL for discussion:
1.10262 + // https://github.com/jquery/jquery/pull/764
1.10263 + return elem.document.documentElement[ "client" + name ];
1.10264 + }
1.10265 +
1.10266 + // Get document width or height
1.10267 + if ( elem.nodeType === 9 ) {
1.10268 + doc = elem.documentElement;
1.10269 +
1.10270 + // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
1.10271 + // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
1.10272 + return Math.max(
1.10273 + elem.body[ "scroll" + name ], doc[ "scroll" + name ],
1.10274 + elem.body[ "offset" + name ], doc[ "offset" + name ],
1.10275 + doc[ "client" + name ]
1.10276 + );
1.10277 + }
1.10278 +
1.10279 + return value === undefined ?
1.10280 + // Get width or height on the element, requesting but not forcing parseFloat
1.10281 + jQuery.css( elem, type, extra ) :
1.10282 +
1.10283 + // Set width or height on the element
1.10284 + jQuery.style( elem, type, value, extra );
1.10285 + }, type, chainable ? margin : undefined, chainable, null );
1.10286 + };
1.10287 + });
1.10288 +});
1.10289 +
1.10290 +
1.10291 +// The number of elements contained in the matched element set
1.10292 +jQuery.fn.size = function() {
1.10293 + return this.length;
1.10294 +};
1.10295 +
1.10296 +jQuery.fn.andSelf = jQuery.fn.addBack;
1.10297 +
1.10298 +
1.10299 +
1.10300 +
1.10301 +// Register as a named AMD module, since jQuery can be concatenated with other
1.10302 +// files that may use define, but not via a proper concatenation script that
1.10303 +// understands anonymous AMD modules. A named AMD is safest and most robust
1.10304 +// way to register. Lowercase jquery is used because AMD module names are
1.10305 +// derived from file names, and jQuery is normally delivered in a lowercase
1.10306 +// file name. Do this after creating the global so that if an AMD module wants
1.10307 +// to call noConflict to hide this version of jQuery, it will work.
1.10308 +
1.10309 +// Note that for maximum portability, libraries that are not jQuery should
1.10310 +// declare themselves as anonymous modules, and avoid setting a global if an
1.10311 +// AMD loader is present. jQuery is a special case. For more information, see
1.10312 +// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
1.10313 +
1.10314 +if ( typeof define === "function" && define.amd ) {
1.10315 + define( "jquery", [], function() {
1.10316 + return jQuery;
1.10317 + });
1.10318 +}
1.10319 +
1.10320 +
1.10321 +
1.10322 +
1.10323 +var
1.10324 + // Map over jQuery in case of overwrite
1.10325 + _jQuery = window.jQuery,
1.10326 +
1.10327 + // Map over the $ in case of overwrite
1.10328 + _$ = window.$;
1.10329 +
1.10330 +jQuery.noConflict = function( deep ) {
1.10331 + if ( window.$ === jQuery ) {
1.10332 + window.$ = _$;
1.10333 + }
1.10334 +
1.10335 + if ( deep && window.jQuery === jQuery ) {
1.10336 + window.jQuery = _jQuery;
1.10337 + }
1.10338 +
1.10339 + return jQuery;
1.10340 +};
1.10341 +
1.10342 +// Expose jQuery and $ identifiers, even in
1.10343 +// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
1.10344 +// and CommonJS for browser emulators (#13566)
1.10345 +if ( typeof noGlobal === strundefined ) {
1.10346 + window.jQuery = window.$ = jQuery;
1.10347 +}
1.10348 +
1.10349 +
1.10350 +
1.10351 +
1.10352 +return jQuery;
1.10353 +
1.10354 +}));