b@1402: /*!
b@1402: * jQuery JavaScript Library v2.1.4
b@1402: * http://jquery.com/
b@1402: *
b@1402: * Includes Sizzle.js
b@1402: * http://sizzlejs.com/
b@1402: *
b@1402: * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
b@1402: * Released under the MIT license
b@1402: * http://jquery.org/license
b@1402: *
b@1402: * Date: 2015-04-28T16:01Z
b@1402: */
b@1402:
b@1402: (function( global, factory ) {
b@1402:
b@1402: if ( typeof module === "object" && typeof module.exports === "object" ) {
b@1402: // For CommonJS and CommonJS-like environments where a proper `window`
b@1402: // is present, execute the factory and get jQuery.
b@1402: // For environments that do not have a `window` with a `document`
b@1402: // (such as Node.js), expose a factory as module.exports.
b@1402: // This accentuates the need for the creation of a real `window`.
b@1402: // e.g. var jQuery = require("jquery")(window);
b@1402: // See ticket #14549 for more info.
b@1402: module.exports = global.document ?
b@1402: factory( global, true ) :
b@1402: function( w ) {
b@1402: if ( !w.document ) {
b@1402: throw new Error( "jQuery requires a window with a document" );
b@1402: }
b@1402: return factory( w );
b@1402: };
b@1402: } else {
b@1402: factory( global );
b@1402: }
b@1402:
b@1402: // Pass this if window is not defined yet
b@1402: }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
b@1402:
b@1402: // Support: Firefox 18+
b@1402: // Can't be in strict mode, several libs including ASP.NET trace
b@1402: // the stack via arguments.caller.callee and Firefox dies if
b@1402: // you try to trace through "use strict" call chains. (#13335)
b@1402: //
b@1402:
b@1402: var arr = [];
b@1402:
b@1402: var slice = arr.slice;
b@1402:
b@1402: var concat = arr.concat;
b@1402:
b@1402: var push = arr.push;
b@1402:
b@1402: var indexOf = arr.indexOf;
b@1402:
b@1402: var class2type = {};
b@1402:
b@1402: var toString = class2type.toString;
b@1402:
b@1402: var hasOwn = class2type.hasOwnProperty;
b@1402:
b@1402: var support = {};
b@1402:
b@1402:
b@1402:
b@1402: var
b@1402: // Use the correct document accordingly with window argument (sandbox)
b@1402: document = window.document,
b@1402:
b@1402: version = "2.1.4",
b@1402:
b@1402: // Define a local copy of jQuery
b@1402: jQuery = function( selector, context ) {
b@1402: // The jQuery object is actually just the init constructor 'enhanced'
b@1402: // Need init if jQuery is called (just allow error to be thrown if not included)
b@1402: return new jQuery.fn.init( selector, context );
b@1402: },
b@1402:
b@1402: // Support: Android<4.1
b@1402: // Make sure we trim BOM and NBSP
b@1402: rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
b@1402:
b@1402: // Matches dashed string for camelizing
b@1402: rmsPrefix = /^-ms-/,
b@1402: rdashAlpha = /-([\da-z])/gi,
b@1402:
b@1402: // Used by jQuery.camelCase as callback to replace()
b@1402: fcamelCase = function( all, letter ) {
b@1402: return letter.toUpperCase();
b@1402: };
b@1402:
b@1402: jQuery.fn = jQuery.prototype = {
b@1402: // The current version of jQuery being used
b@1402: jquery: version,
b@1402:
b@1402: constructor: jQuery,
b@1402:
b@1402: // Start with an empty selector
b@1402: selector: "",
b@1402:
b@1402: // The default length of a jQuery object is 0
b@1402: length: 0,
b@1402:
b@1402: toArray: function() {
b@1402: return slice.call( this );
b@1402: },
b@1402:
b@1402: // Get the Nth element in the matched element set OR
b@1402: // Get the whole matched element set as a clean array
b@1402: get: function( num ) {
b@1402: return num != null ?
b@1402:
b@1402: // Return just the one element from the set
b@1402: ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
b@1402:
b@1402: // Return all the elements in a clean array
b@1402: slice.call( this );
b@1402: },
b@1402:
b@1402: // Take an array of elements and push it onto the stack
b@1402: // (returning the new matched element set)
b@1402: pushStack: function( elems ) {
b@1402:
b@1402: // Build a new jQuery matched element set
b@1402: var ret = jQuery.merge( this.constructor(), elems );
b@1402:
b@1402: // Add the old object onto the stack (as a reference)
b@1402: ret.prevObject = this;
b@1402: ret.context = this.context;
b@1402:
b@1402: // Return the newly-formed element set
b@1402: return ret;
b@1402: },
b@1402:
b@1402: // Execute a callback for every element in the matched set.
b@1402: // (You can seed the arguments with an array of args, but this is
b@1402: // only used internally.)
b@1402: each: function( callback, args ) {
b@1402: return jQuery.each( this, callback, args );
b@1402: },
b@1402:
b@1402: map: function( callback ) {
b@1402: return this.pushStack( jQuery.map(this, function( elem, i ) {
b@1402: return callback.call( elem, i, elem );
b@1402: }));
b@1402: },
b@1402:
b@1402: slice: function() {
b@1402: return this.pushStack( slice.apply( this, arguments ) );
b@1402: },
b@1402:
b@1402: first: function() {
b@1402: return this.eq( 0 );
b@1402: },
b@1402:
b@1402: last: function() {
b@1402: return this.eq( -1 );
b@1402: },
b@1402:
b@1402: eq: function( i ) {
b@1402: var len = this.length,
b@1402: j = +i + ( i < 0 ? len : 0 );
b@1402: return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
b@1402: },
b@1402:
b@1402: end: function() {
b@1402: return this.prevObject || this.constructor(null);
b@1402: },
b@1402:
b@1402: // For internal use only.
b@1402: // Behaves like an Array's method, not like a jQuery method.
b@1402: push: push,
b@1402: sort: arr.sort,
b@1402: splice: arr.splice
b@1402: };
b@1402:
b@1402: jQuery.extend = jQuery.fn.extend = function() {
b@1402: var options, name, src, copy, copyIsArray, clone,
b@1402: target = arguments[0] || {},
b@1402: i = 1,
b@1402: length = arguments.length,
b@1402: deep = false;
b@1402:
b@1402: // Handle a deep copy situation
b@1402: if ( typeof target === "boolean" ) {
b@1402: deep = target;
b@1402:
b@1402: // Skip the boolean and the target
b@1402: target = arguments[ i ] || {};
b@1402: i++;
b@1402: }
b@1402:
b@1402: // Handle case when target is a string or something (possible in deep copy)
b@1402: if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
b@1402: target = {};
b@1402: }
b@1402:
b@1402: // Extend jQuery itself if only one argument is passed
b@1402: if ( i === length ) {
b@1402: target = this;
b@1402: i--;
b@1402: }
b@1402:
b@1402: for ( ; i < length; i++ ) {
b@1402: // Only deal with non-null/undefined values
b@1402: if ( (options = arguments[ i ]) != null ) {
b@1402: // Extend the base object
b@1402: for ( name in options ) {
b@1402: src = target[ name ];
b@1402: copy = options[ name ];
b@1402:
b@1402: // Prevent never-ending loop
b@1402: if ( target === copy ) {
b@1402: continue;
b@1402: }
b@1402:
b@1402: // Recurse if we're merging plain objects or arrays
b@1402: if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
b@1402: if ( copyIsArray ) {
b@1402: copyIsArray = false;
b@1402: clone = src && jQuery.isArray(src) ? src : [];
b@1402:
b@1402: } else {
b@1402: clone = src && jQuery.isPlainObject(src) ? src : {};
b@1402: }
b@1402:
b@1402: // Never move original objects, clone them
b@1402: target[ name ] = jQuery.extend( deep, clone, copy );
b@1402:
b@1402: // Don't bring in undefined values
b@1402: } else if ( copy !== undefined ) {
b@1402: target[ name ] = copy;
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // Return the modified object
b@1402: return target;
b@1402: };
b@1402:
b@1402: jQuery.extend({
b@1402: // Unique for each copy of jQuery on the page
b@1402: expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
b@1402:
b@1402: // Assume jQuery is ready without the ready module
b@1402: isReady: true,
b@1402:
b@1402: error: function( msg ) {
b@1402: throw new Error( msg );
b@1402: },
b@1402:
b@1402: noop: function() {},
b@1402:
b@1402: isFunction: function( obj ) {
b@1402: return jQuery.type(obj) === "function";
b@1402: },
b@1402:
b@1402: isArray: Array.isArray,
b@1402:
b@1402: isWindow: function( obj ) {
b@1402: return obj != null && obj === obj.window;
b@1402: },
b@1402:
b@1402: isNumeric: function( obj ) {
b@1402: // parseFloat NaNs numeric-cast false positives (null|true|false|"")
b@1402: // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
b@1402: // subtraction forces infinities to NaN
b@1402: // adding 1 corrects loss of precision from parseFloat (#15100)
b@1402: return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
b@1402: },
b@1402:
b@1402: isPlainObject: function( obj ) {
b@1402: // Not plain objects:
b@1402: // - Any object or value whose internal [[Class]] property is not "[object Object]"
b@1402: // - DOM nodes
b@1402: // - window
b@1402: if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
b@1402: return false;
b@1402: }
b@1402:
b@1402: if ( obj.constructor &&
b@1402: !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
b@1402: return false;
b@1402: }
b@1402:
b@1402: // If the function hasn't returned already, we're confident that
b@1402: // |obj| is a plain object, created by {} or constructed with new Object
b@1402: return true;
b@1402: },
b@1402:
b@1402: isEmptyObject: function( obj ) {
b@1402: var name;
b@1402: for ( name in obj ) {
b@1402: return false;
b@1402: }
b@1402: return true;
b@1402: },
b@1402:
b@1402: type: function( obj ) {
b@1402: if ( obj == null ) {
b@1402: return obj + "";
b@1402: }
b@1402: // Support: Android<4.0, iOS<6 (functionish RegExp)
b@1402: return typeof obj === "object" || typeof obj === "function" ?
b@1402: class2type[ toString.call(obj) ] || "object" :
b@1402: typeof obj;
b@1402: },
b@1402:
b@1402: // Evaluates a script in a global context
b@1402: globalEval: function( code ) {
b@1402: var script,
b@1402: indirect = eval;
b@1402:
b@1402: code = jQuery.trim( code );
b@1402:
b@1402: if ( code ) {
b@1402: // If the code includes a valid, prologue position
b@1402: // strict mode pragma, execute code by injecting a
b@1402: // script tag into the document.
b@1402: if ( code.indexOf("use strict") === 1 ) {
b@1402: script = document.createElement("script");
b@1402: script.text = code;
b@1402: document.head.appendChild( script ).parentNode.removeChild( script );
b@1402: } else {
b@1402: // Otherwise, avoid the DOM node creation, insertion
b@1402: // and removal by using an indirect global eval
b@1402: indirect( code );
b@1402: }
b@1402: }
b@1402: },
b@1402:
b@1402: // Convert dashed to camelCase; used by the css and data modules
b@1402: // Support: IE9-11+
b@1402: // Microsoft forgot to hump their vendor prefix (#9572)
b@1402: camelCase: function( string ) {
b@1402: return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
b@1402: },
b@1402:
b@1402: nodeName: function( elem, name ) {
b@1402: return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
b@1402: },
b@1402:
b@1402: // args is for internal usage only
b@1402: each: function( obj, callback, args ) {
b@1402: var value,
b@1402: i = 0,
b@1402: length = obj.length,
b@1402: isArray = isArraylike( obj );
b@1402:
b@1402: if ( args ) {
b@1402: if ( isArray ) {
b@1402: for ( ; i < length; i++ ) {
b@1402: value = callback.apply( obj[ i ], args );
b@1402:
b@1402: if ( value === false ) {
b@1402: break;
b@1402: }
b@1402: }
b@1402: } else {
b@1402: for ( i in obj ) {
b@1402: value = callback.apply( obj[ i ], args );
b@1402:
b@1402: if ( value === false ) {
b@1402: break;
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // A special, fast, case for the most common use of each
b@1402: } else {
b@1402: if ( isArray ) {
b@1402: for ( ; i < length; i++ ) {
b@1402: value = callback.call( obj[ i ], i, obj[ i ] );
b@1402:
b@1402: if ( value === false ) {
b@1402: break;
b@1402: }
b@1402: }
b@1402: } else {
b@1402: for ( i in obj ) {
b@1402: value = callback.call( obj[ i ], i, obj[ i ] );
b@1402:
b@1402: if ( value === false ) {
b@1402: break;
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: return obj;
b@1402: },
b@1402:
b@1402: // Support: Android<4.1
b@1402: trim: function( text ) {
b@1402: return text == null ?
b@1402: "" :
b@1402: ( text + "" ).replace( rtrim, "" );
b@1402: },
b@1402:
b@1402: // results is for internal usage only
b@1402: makeArray: function( arr, results ) {
b@1402: var ret = results || [];
b@1402:
b@1402: if ( arr != null ) {
b@1402: if ( isArraylike( Object(arr) ) ) {
b@1402: jQuery.merge( ret,
b@1402: typeof arr === "string" ?
b@1402: [ arr ] : arr
b@1402: );
b@1402: } else {
b@1402: push.call( ret, arr );
b@1402: }
b@1402: }
b@1402:
b@1402: return ret;
b@1402: },
b@1402:
b@1402: inArray: function( elem, arr, i ) {
b@1402: return arr == null ? -1 : indexOf.call( arr, elem, i );
b@1402: },
b@1402:
b@1402: merge: function( first, second ) {
b@1402: var len = +second.length,
b@1402: j = 0,
b@1402: i = first.length;
b@1402:
b@1402: for ( ; j < len; j++ ) {
b@1402: first[ i++ ] = second[ j ];
b@1402: }
b@1402:
b@1402: first.length = i;
b@1402:
b@1402: return first;
b@1402: },
b@1402:
b@1402: grep: function( elems, callback, invert ) {
b@1402: var callbackInverse,
b@1402: matches = [],
b@1402: i = 0,
b@1402: length = elems.length,
b@1402: callbackExpect = !invert;
b@1402:
b@1402: // Go through the array, only saving the items
b@1402: // that pass the validator function
b@1402: for ( ; i < length; i++ ) {
b@1402: callbackInverse = !callback( elems[ i ], i );
b@1402: if ( callbackInverse !== callbackExpect ) {
b@1402: matches.push( elems[ i ] );
b@1402: }
b@1402: }
b@1402:
b@1402: return matches;
b@1402: },
b@1402:
b@1402: // arg is for internal usage only
b@1402: map: function( elems, callback, arg ) {
b@1402: var value,
b@1402: i = 0,
b@1402: length = elems.length,
b@1402: isArray = isArraylike( elems ),
b@1402: ret = [];
b@1402:
b@1402: // Go through the array, translating each of the items to their new values
b@1402: if ( isArray ) {
b@1402: for ( ; i < length; i++ ) {
b@1402: value = callback( elems[ i ], i, arg );
b@1402:
b@1402: if ( value != null ) {
b@1402: ret.push( value );
b@1402: }
b@1402: }
b@1402:
b@1402: // Go through every key on the object,
b@1402: } else {
b@1402: for ( i in elems ) {
b@1402: value = callback( elems[ i ], i, arg );
b@1402:
b@1402: if ( value != null ) {
b@1402: ret.push( value );
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // Flatten any nested arrays
b@1402: return concat.apply( [], ret );
b@1402: },
b@1402:
b@1402: // A global GUID counter for objects
b@1402: guid: 1,
b@1402:
b@1402: // Bind a function to a context, optionally partially applying any
b@1402: // arguments.
b@1402: proxy: function( fn, context ) {
b@1402: var tmp, args, proxy;
b@1402:
b@1402: if ( typeof context === "string" ) {
b@1402: tmp = fn[ context ];
b@1402: context = fn;
b@1402: fn = tmp;
b@1402: }
b@1402:
b@1402: // Quick check to determine if target is callable, in the spec
b@1402: // this throws a TypeError, but we will just return undefined.
b@1402: if ( !jQuery.isFunction( fn ) ) {
b@1402: return undefined;
b@1402: }
b@1402:
b@1402: // Simulated bind
b@1402: args = slice.call( arguments, 2 );
b@1402: proxy = function() {
b@1402: return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
b@1402: };
b@1402:
b@1402: // Set the guid of unique handler to the same of original handler, so it can be removed
b@1402: proxy.guid = fn.guid = fn.guid || jQuery.guid++;
b@1402:
b@1402: return proxy;
b@1402: },
b@1402:
b@1402: now: Date.now,
b@1402:
b@1402: // jQuery.support is not used in Core but other projects attach their
b@1402: // properties to it so it needs to exist.
b@1402: support: support
b@1402: });
b@1402:
b@1402: // Populate the class2type map
b@1402: jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
b@1402: class2type[ "[object " + name + "]" ] = name.toLowerCase();
b@1402: });
b@1402:
b@1402: function isArraylike( obj ) {
b@1402:
b@1402: // Support: iOS 8.2 (not reproducible in simulator)
b@1402: // `in` check used to prevent JIT error (gh-2145)
b@1402: // hasOwn isn't used here due to false negatives
b@1402: // regarding Nodelist length in IE
b@1402: var length = "length" in obj && obj.length,
b@1402: type = jQuery.type( obj );
b@1402:
b@1402: if ( type === "function" || jQuery.isWindow( obj ) ) {
b@1402: return false;
b@1402: }
b@1402:
b@1402: if ( obj.nodeType === 1 && length ) {
b@1402: return true;
b@1402: }
b@1402:
b@1402: return type === "array" || length === 0 ||
b@1402: typeof length === "number" && length > 0 && ( length - 1 ) in obj;
b@1402: }
b@1402: var Sizzle =
b@1402: /*!
b@1402: * Sizzle CSS Selector Engine v2.2.0-pre
b@1402: * http://sizzlejs.com/
b@1402: *
b@1402: * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
b@1402: * Released under the MIT license
b@1402: * http://jquery.org/license
b@1402: *
b@1402: * Date: 2014-12-16
b@1402: */
b@1402: (function( window ) {
b@1402:
b@1402: var i,
b@1402: support,
b@1402: Expr,
b@1402: getText,
b@1402: isXML,
b@1402: tokenize,
b@1402: compile,
b@1402: select,
b@1402: outermostContext,
b@1402: sortInput,
b@1402: hasDuplicate,
b@1402:
b@1402: // Local document vars
b@1402: setDocument,
b@1402: document,
b@1402: docElem,
b@1402: documentIsHTML,
b@1402: rbuggyQSA,
b@1402: rbuggyMatches,
b@1402: matches,
b@1402: contains,
b@1402:
b@1402: // Instance-specific data
b@1402: expando = "sizzle" + 1 * new Date(),
b@1402: preferredDoc = window.document,
b@1402: dirruns = 0,
b@1402: done = 0,
b@1402: classCache = createCache(),
b@1402: tokenCache = createCache(),
b@1402: compilerCache = createCache(),
b@1402: sortOrder = function( a, b ) {
b@1402: if ( a === b ) {
b@1402: hasDuplicate = true;
b@1402: }
b@1402: return 0;
b@1402: },
b@1402:
b@1402: // General-purpose constants
b@1402: MAX_NEGATIVE = 1 << 31,
b@1402:
b@1402: // Instance methods
b@1402: hasOwn = ({}).hasOwnProperty,
b@1402: arr = [],
b@1402: pop = arr.pop,
b@1402: push_native = arr.push,
b@1402: push = arr.push,
b@1402: slice = arr.slice,
b@1402: // Use a stripped-down indexOf as it's faster than native
b@1402: // http://jsperf.com/thor-indexof-vs-for/5
b@1402: indexOf = function( list, elem ) {
b@1402: var i = 0,
b@1402: len = list.length;
b@1402: for ( ; i < len; i++ ) {
b@1402: if ( list[i] === elem ) {
b@1402: return i;
b@1402: }
b@1402: }
b@1402: return -1;
b@1402: },
b@1402:
b@1402: booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
b@1402:
b@1402: // Regular expressions
b@1402:
b@1402: // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
b@1402: whitespace = "[\\x20\\t\\r\\n\\f]",
b@1402: // http://www.w3.org/TR/css3-syntax/#characters
b@1402: characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
b@1402:
b@1402: // Loosely modeled on CSS identifier characters
b@1402: // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
b@1402: // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
b@1402: identifier = characterEncoding.replace( "w", "w#" ),
b@1402:
b@1402: // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
b@1402: attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
b@1402: // Operator (capture 2)
b@1402: "*([*^$|!~]?=)" + whitespace +
b@1402: // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
b@1402: "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
b@1402: "*\\]",
b@1402:
b@1402: pseudos = ":(" + characterEncoding + ")(?:\\((" +
b@1402: // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
b@1402: // 1. quoted (capture 3; capture 4 or capture 5)
b@1402: "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
b@1402: // 2. simple (capture 6)
b@1402: "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
b@1402: // 3. anything else (capture 2)
b@1402: ".*" +
b@1402: ")\\)|)",
b@1402:
b@1402: // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
b@1402: rwhitespace = new RegExp( whitespace + "+", "g" ),
b@1402: rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
b@1402:
b@1402: rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
b@1402: rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
b@1402:
b@1402: rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
b@1402:
b@1402: rpseudo = new RegExp( pseudos ),
b@1402: ridentifier = new RegExp( "^" + identifier + "$" ),
b@1402:
b@1402: matchExpr = {
b@1402: "ID": new RegExp( "^#(" + characterEncoding + ")" ),
b@1402: "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
b@1402: "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
b@1402: "ATTR": new RegExp( "^" + attributes ),
b@1402: "PSEUDO": new RegExp( "^" + pseudos ),
b@1402: "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
b@1402: "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
b@1402: "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
b@1402: "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
b@1402: // For use in libraries implementing .is()
b@1402: // We use this for POS matching in `select`
b@1402: "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
b@1402: whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
b@1402: },
b@1402:
b@1402: rinputs = /^(?:input|select|textarea|button)$/i,
b@1402: rheader = /^h\d$/i,
b@1402:
b@1402: rnative = /^[^{]+\{\s*\[native \w/,
b@1402:
b@1402: // Easily-parseable/retrievable ID or TAG or CLASS selectors
b@1402: rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
b@1402:
b@1402: rsibling = /[+~]/,
b@1402: rescape = /'|\\/g,
b@1402:
b@1402: // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
b@1402: runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
b@1402: funescape = function( _, escaped, escapedWhitespace ) {
b@1402: var high = "0x" + escaped - 0x10000;
b@1402: // NaN means non-codepoint
b@1402: // Support: Firefox<24
b@1402: // Workaround erroneous numeric interpretation of +"0x"
b@1402: return high !== high || escapedWhitespace ?
b@1402: escaped :
b@1402: high < 0 ?
b@1402: // BMP codepoint
b@1402: String.fromCharCode( high + 0x10000 ) :
b@1402: // Supplemental Plane codepoint (surrogate pair)
b@1402: String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
b@1402: },
b@1402:
b@1402: // Used for iframes
b@1402: // See setDocument()
b@1402: // Removing the function wrapper causes a "Permission Denied"
b@1402: // error in IE
b@1402: unloadHandler = function() {
b@1402: setDocument();
b@1402: };
b@1402:
b@1402: // Optimize for push.apply( _, NodeList )
b@1402: try {
b@1402: push.apply(
b@1402: (arr = slice.call( preferredDoc.childNodes )),
b@1402: preferredDoc.childNodes
b@1402: );
b@1402: // Support: Android<4.0
b@1402: // Detect silently failing push.apply
b@1402: arr[ preferredDoc.childNodes.length ].nodeType;
b@1402: } catch ( e ) {
b@1402: push = { apply: arr.length ?
b@1402:
b@1402: // Leverage slice if possible
b@1402: function( target, els ) {
b@1402: push_native.apply( target, slice.call(els) );
b@1402: } :
b@1402:
b@1402: // Support: IE<9
b@1402: // Otherwise append directly
b@1402: function( target, els ) {
b@1402: var j = target.length,
b@1402: i = 0;
b@1402: // Can't trust NodeList.length
b@1402: while ( (target[j++] = els[i++]) ) {}
b@1402: target.length = j - 1;
b@1402: }
b@1402: };
b@1402: }
b@1402:
b@1402: function Sizzle( selector, context, results, seed ) {
b@1402: var match, elem, m, nodeType,
b@1402: // QSA vars
b@1402: i, groups, old, nid, newContext, newSelector;
b@1402:
b@1402: if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
b@1402: setDocument( context );
b@1402: }
b@1402:
b@1402: context = context || document;
b@1402: results = results || [];
b@1402: nodeType = context.nodeType;
b@1402:
b@1402: if ( typeof selector !== "string" || !selector ||
b@1402: nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
b@1402:
b@1402: return results;
b@1402: }
b@1402:
b@1402: if ( !seed && documentIsHTML ) {
b@1402:
b@1402: // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
b@1402: if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
b@1402: // Speed-up: Sizzle("#ID")
b@1402: if ( (m = match[1]) ) {
b@1402: if ( nodeType === 9 ) {
b@1402: elem = context.getElementById( m );
b@1402: // Check parentNode to catch when Blackberry 4.6 returns
b@1402: // nodes that are no longer in the document (jQuery #6963)
b@1402: if ( elem && elem.parentNode ) {
b@1402: // Handle the case where IE, Opera, and Webkit return items
b@1402: // by name instead of ID
b@1402: if ( elem.id === m ) {
b@1402: results.push( elem );
b@1402: return results;
b@1402: }
b@1402: } else {
b@1402: return results;
b@1402: }
b@1402: } else {
b@1402: // Context is not a document
b@1402: if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
b@1402: contains( context, elem ) && elem.id === m ) {
b@1402: results.push( elem );
b@1402: return results;
b@1402: }
b@1402: }
b@1402:
b@1402: // Speed-up: Sizzle("TAG")
b@1402: } else if ( match[2] ) {
b@1402: push.apply( results, context.getElementsByTagName( selector ) );
b@1402: return results;
b@1402:
b@1402: // Speed-up: Sizzle(".CLASS")
b@1402: } else if ( (m = match[3]) && support.getElementsByClassName ) {
b@1402: push.apply( results, context.getElementsByClassName( m ) );
b@1402: return results;
b@1402: }
b@1402: }
b@1402:
b@1402: // QSA path
b@1402: if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
b@1402: nid = old = expando;
b@1402: newContext = context;
b@1402: newSelector = nodeType !== 1 && selector;
b@1402:
b@1402: // qSA works strangely on Element-rooted queries
b@1402: // We can work around this by specifying an extra ID on the root
b@1402: // and working up from there (Thanks to Andrew Dupont for the technique)
b@1402: // IE 8 doesn't work on object elements
b@1402: if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
b@1402: groups = tokenize( selector );
b@1402:
b@1402: if ( (old = context.getAttribute("id")) ) {
b@1402: nid = old.replace( rescape, "\\$&" );
b@1402: } else {
b@1402: context.setAttribute( "id", nid );
b@1402: }
b@1402: nid = "[id='" + nid + "'] ";
b@1402:
b@1402: i = groups.length;
b@1402: while ( i-- ) {
b@1402: groups[i] = nid + toSelector( groups[i] );
b@1402: }
b@1402: newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
b@1402: newSelector = groups.join(",");
b@1402: }
b@1402:
b@1402: if ( newSelector ) {
b@1402: try {
b@1402: push.apply( results,
b@1402: newContext.querySelectorAll( newSelector )
b@1402: );
b@1402: return results;
b@1402: } catch(qsaError) {
b@1402: } finally {
b@1402: if ( !old ) {
b@1402: context.removeAttribute("id");
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // All others
b@1402: return select( selector.replace( rtrim, "$1" ), context, results, seed );
b@1402: }
b@1402:
b@1402: /**
b@1402: * Create key-value caches of limited size
b@1402: * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
b@1402: * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
b@1402: * deleting the oldest entry
b@1402: */
b@1402: function createCache() {
b@1402: var keys = [];
b@1402:
b@1402: function cache( key, value ) {
b@1402: // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
b@1402: if ( keys.push( key + " " ) > Expr.cacheLength ) {
b@1402: // Only keep the most recent entries
b@1402: delete cache[ keys.shift() ];
b@1402: }
b@1402: return (cache[ key + " " ] = value);
b@1402: }
b@1402: return cache;
b@1402: }
b@1402:
b@1402: /**
b@1402: * Mark a function for special use by Sizzle
b@1402: * @param {Function} fn The function to mark
b@1402: */
b@1402: function markFunction( fn ) {
b@1402: fn[ expando ] = true;
b@1402: return fn;
b@1402: }
b@1402:
b@1402: /**
b@1402: * Support testing using an element
b@1402: * @param {Function} fn Passed the created div and expects a boolean result
b@1402: */
b@1402: function assert( fn ) {
b@1402: var div = document.createElement("div");
b@1402:
b@1402: try {
b@1402: return !!fn( div );
b@1402: } catch (e) {
b@1402: return false;
b@1402: } finally {
b@1402: // Remove from its parent by default
b@1402: if ( div.parentNode ) {
b@1402: div.parentNode.removeChild( div );
b@1402: }
b@1402: // release memory in IE
b@1402: div = null;
b@1402: }
b@1402: }
b@1402:
b@1402: /**
b@1402: * Adds the same handler for all of the specified attrs
b@1402: * @param {String} attrs Pipe-separated list of attributes
b@1402: * @param {Function} handler The method that will be applied
b@1402: */
b@1402: function addHandle( attrs, handler ) {
b@1402: var arr = attrs.split("|"),
b@1402: i = attrs.length;
b@1402:
b@1402: while ( i-- ) {
b@1402: Expr.attrHandle[ arr[i] ] = handler;
b@1402: }
b@1402: }
b@1402:
b@1402: /**
b@1402: * Checks document order of two siblings
b@1402: * @param {Element} a
b@1402: * @param {Element} b
b@1402: * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
b@1402: */
b@1402: function siblingCheck( a, b ) {
b@1402: var cur = b && a,
b@1402: diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
b@1402: ( ~b.sourceIndex || MAX_NEGATIVE ) -
b@1402: ( ~a.sourceIndex || MAX_NEGATIVE );
b@1402:
b@1402: // Use IE sourceIndex if available on both nodes
b@1402: if ( diff ) {
b@1402: return diff;
b@1402: }
b@1402:
b@1402: // Check if b follows a
b@1402: if ( cur ) {
b@1402: while ( (cur = cur.nextSibling) ) {
b@1402: if ( cur === b ) {
b@1402: return -1;
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: return a ? 1 : -1;
b@1402: }
b@1402:
b@1402: /**
b@1402: * Returns a function to use in pseudos for input types
b@1402: * @param {String} type
b@1402: */
b@1402: function createInputPseudo( type ) {
b@1402: return function( elem ) {
b@1402: var name = elem.nodeName.toLowerCase();
b@1402: return name === "input" && elem.type === type;
b@1402: };
b@1402: }
b@1402:
b@1402: /**
b@1402: * Returns a function to use in pseudos for buttons
b@1402: * @param {String} type
b@1402: */
b@1402: function createButtonPseudo( type ) {
b@1402: return function( elem ) {
b@1402: var name = elem.nodeName.toLowerCase();
b@1402: return (name === "input" || name === "button") && elem.type === type;
b@1402: };
b@1402: }
b@1402:
b@1402: /**
b@1402: * Returns a function to use in pseudos for positionals
b@1402: * @param {Function} fn
b@1402: */
b@1402: function createPositionalPseudo( fn ) {
b@1402: return markFunction(function( argument ) {
b@1402: argument = +argument;
b@1402: return markFunction(function( seed, matches ) {
b@1402: var j,
b@1402: matchIndexes = fn( [], seed.length, argument ),
b@1402: i = matchIndexes.length;
b@1402:
b@1402: // Match elements found at the specified indexes
b@1402: while ( i-- ) {
b@1402: if ( seed[ (j = matchIndexes[i]) ] ) {
b@1402: seed[j] = !(matches[j] = seed[j]);
b@1402: }
b@1402: }
b@1402: });
b@1402: });
b@1402: }
b@1402:
b@1402: /**
b@1402: * Checks a node for validity as a Sizzle context
b@1402: * @param {Element|Object=} context
b@1402: * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
b@1402: */
b@1402: function testContext( context ) {
b@1402: return context && typeof context.getElementsByTagName !== "undefined" && context;
b@1402: }
b@1402:
b@1402: // Expose support vars for convenience
b@1402: support = Sizzle.support = {};
b@1402:
b@1402: /**
b@1402: * Detects XML nodes
b@1402: * @param {Element|Object} elem An element or a document
b@1402: * @returns {Boolean} True iff elem is a non-HTML XML node
b@1402: */
b@1402: isXML = Sizzle.isXML = function( elem ) {
b@1402: // documentElement is verified for cases where it doesn't yet exist
b@1402: // (such as loading iframes in IE - #4833)
b@1402: var documentElement = elem && (elem.ownerDocument || elem).documentElement;
b@1402: return documentElement ? documentElement.nodeName !== "HTML" : false;
b@1402: };
b@1402:
b@1402: /**
b@1402: * Sets document-related variables once based on the current document
b@1402: * @param {Element|Object} [doc] An element or document object to use to set the document
b@1402: * @returns {Object} Returns the current document
b@1402: */
b@1402: setDocument = Sizzle.setDocument = function( node ) {
b@1402: var hasCompare, parent,
b@1402: doc = node ? node.ownerDocument || node : preferredDoc;
b@1402:
b@1402: // If no document and documentElement is available, return
b@1402: if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
b@1402: return document;
b@1402: }
b@1402:
b@1402: // Set our document
b@1402: document = doc;
b@1402: docElem = doc.documentElement;
b@1402: parent = doc.defaultView;
b@1402:
b@1402: // Support: IE>8
b@1402: // If iframe document is assigned to "document" variable and if iframe has been reloaded,
b@1402: // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
b@1402: // IE6-8 do not support the defaultView property so parent will be undefined
b@1402: if ( parent && parent !== parent.top ) {
b@1402: // IE11 does not have attachEvent, so all must suffer
b@1402: if ( parent.addEventListener ) {
b@1402: parent.addEventListener( "unload", unloadHandler, false );
b@1402: } else if ( parent.attachEvent ) {
b@1402: parent.attachEvent( "onunload", unloadHandler );
b@1402: }
b@1402: }
b@1402:
b@1402: /* Support tests
b@1402: ---------------------------------------------------------------------- */
b@1402: documentIsHTML = !isXML( doc );
b@1402:
b@1402: /* Attributes
b@1402: ---------------------------------------------------------------------- */
b@1402:
b@1402: // Support: IE<8
b@1402: // Verify that getAttribute really returns attributes and not properties
b@1402: // (excepting IE8 booleans)
b@1402: support.attributes = assert(function( div ) {
b@1402: div.className = "i";
b@1402: return !div.getAttribute("className");
b@1402: });
b@1402:
b@1402: /* getElement(s)By*
b@1402: ---------------------------------------------------------------------- */
b@1402:
b@1402: // Check if getElementsByTagName("*") returns only elements
b@1402: support.getElementsByTagName = assert(function( div ) {
b@1402: div.appendChild( doc.createComment("") );
b@1402: return !div.getElementsByTagName("*").length;
b@1402: });
b@1402:
b@1402: // Support: IE<9
b@1402: support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
b@1402:
b@1402: // Support: IE<10
b@1402: // Check if getElementById returns elements by name
b@1402: // The broken getElementById methods don't pick up programatically-set names,
b@1402: // so use a roundabout getElementsByName test
b@1402: support.getById = assert(function( div ) {
b@1402: docElem.appendChild( div ).id = expando;
b@1402: return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
b@1402: });
b@1402:
b@1402: // ID find and filter
b@1402: if ( support.getById ) {
b@1402: Expr.find["ID"] = function( id, context ) {
b@1402: if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
b@1402: var m = context.getElementById( id );
b@1402: // Check parentNode to catch when Blackberry 4.6 returns
b@1402: // nodes that are no longer in the document #6963
b@1402: return m && m.parentNode ? [ m ] : [];
b@1402: }
b@1402: };
b@1402: Expr.filter["ID"] = function( id ) {
b@1402: var attrId = id.replace( runescape, funescape );
b@1402: return function( elem ) {
b@1402: return elem.getAttribute("id") === attrId;
b@1402: };
b@1402: };
b@1402: } else {
b@1402: // Support: IE6/7
b@1402: // getElementById is not reliable as a find shortcut
b@1402: delete Expr.find["ID"];
b@1402:
b@1402: Expr.filter["ID"] = function( id ) {
b@1402: var attrId = id.replace( runescape, funescape );
b@1402: return function( elem ) {
b@1402: var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
b@1402: return node && node.value === attrId;
b@1402: };
b@1402: };
b@1402: }
b@1402:
b@1402: // Tag
b@1402: Expr.find["TAG"] = support.getElementsByTagName ?
b@1402: function( tag, context ) {
b@1402: if ( typeof context.getElementsByTagName !== "undefined" ) {
b@1402: return context.getElementsByTagName( tag );
b@1402:
b@1402: // DocumentFragment nodes don't have gEBTN
b@1402: } else if ( support.qsa ) {
b@1402: return context.querySelectorAll( tag );
b@1402: }
b@1402: } :
b@1402:
b@1402: function( tag, context ) {
b@1402: var elem,
b@1402: tmp = [],
b@1402: i = 0,
b@1402: // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
b@1402: results = context.getElementsByTagName( tag );
b@1402:
b@1402: // Filter out possible comments
b@1402: if ( tag === "*" ) {
b@1402: while ( (elem = results[i++]) ) {
b@1402: if ( elem.nodeType === 1 ) {
b@1402: tmp.push( elem );
b@1402: }
b@1402: }
b@1402:
b@1402: return tmp;
b@1402: }
b@1402: return results;
b@1402: };
b@1402:
b@1402: // Class
b@1402: Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
b@1402: if ( documentIsHTML ) {
b@1402: return context.getElementsByClassName( className );
b@1402: }
b@1402: };
b@1402:
b@1402: /* QSA/matchesSelector
b@1402: ---------------------------------------------------------------------- */
b@1402:
b@1402: // QSA and matchesSelector support
b@1402:
b@1402: // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
b@1402: rbuggyMatches = [];
b@1402:
b@1402: // qSa(:focus) reports false when true (Chrome 21)
b@1402: // We allow this because of a bug in IE8/9 that throws an error
b@1402: // whenever `document.activeElement` is accessed on an iframe
b@1402: // So, we allow :focus to pass through QSA all the time to avoid the IE error
b@1402: // See http://bugs.jquery.com/ticket/13378
b@1402: rbuggyQSA = [];
b@1402:
b@1402: if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
b@1402: // Build QSA regex
b@1402: // Regex strategy adopted from Diego Perini
b@1402: assert(function( div ) {
b@1402: // Select is set to empty string on purpose
b@1402: // This is to test IE's treatment of not explicitly
b@1402: // setting a boolean content attribute,
b@1402: // since its presence should be enough
b@1402: // http://bugs.jquery.com/ticket/12359
b@1402: docElem.appendChild( div ).innerHTML = "" +
b@1402: "";
b@1402:
b@1402: // Support: IE8, Opera 11-12.16
b@1402: // Nothing should be selected when empty strings follow ^= or $= or *=
b@1402: // The test attribute must be unknown in Opera but "safe" for WinRT
b@1402: // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
b@1402: if ( div.querySelectorAll("[msallowcapture^='']").length ) {
b@1402: rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
b@1402: }
b@1402:
b@1402: // Support: IE8
b@1402: // Boolean attributes and "value" are not treated correctly
b@1402: if ( !div.querySelectorAll("[selected]").length ) {
b@1402: rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
b@1402: }
b@1402:
b@1402: // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
b@1402: if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
b@1402: rbuggyQSA.push("~=");
b@1402: }
b@1402:
b@1402: // Webkit/Opera - :checked should return selected option elements
b@1402: // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
b@1402: // IE8 throws error here and will not see later tests
b@1402: if ( !div.querySelectorAll(":checked").length ) {
b@1402: rbuggyQSA.push(":checked");
b@1402: }
b@1402:
b@1402: // Support: Safari 8+, iOS 8+
b@1402: // https://bugs.webkit.org/show_bug.cgi?id=136851
b@1402: // In-page `selector#id sibing-combinator selector` fails
b@1402: if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
b@1402: rbuggyQSA.push(".#.+[+~]");
b@1402: }
b@1402: });
b@1402:
b@1402: assert(function( div ) {
b@1402: // Support: Windows 8 Native Apps
b@1402: // The type and name attributes are restricted during .innerHTML assignment
b@1402: var input = doc.createElement("input");
b@1402: input.setAttribute( "type", "hidden" );
b@1402: div.appendChild( input ).setAttribute( "name", "D" );
b@1402:
b@1402: // Support: IE8
b@1402: // Enforce case-sensitivity of name attribute
b@1402: if ( div.querySelectorAll("[name=d]").length ) {
b@1402: rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
b@1402: }
b@1402:
b@1402: // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
b@1402: // IE8 throws error here and will not see later tests
b@1402: if ( !div.querySelectorAll(":enabled").length ) {
b@1402: rbuggyQSA.push( ":enabled", ":disabled" );
b@1402: }
b@1402:
b@1402: // Opera 10-11 does not throw on post-comma invalid pseudos
b@1402: div.querySelectorAll("*,:x");
b@1402: rbuggyQSA.push(",.*:");
b@1402: });
b@1402: }
b@1402:
b@1402: if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
b@1402: docElem.webkitMatchesSelector ||
b@1402: docElem.mozMatchesSelector ||
b@1402: docElem.oMatchesSelector ||
b@1402: docElem.msMatchesSelector) )) ) {
b@1402:
b@1402: assert(function( div ) {
b@1402: // Check to see if it's possible to do matchesSelector
b@1402: // on a disconnected node (IE 9)
b@1402: support.disconnectedMatch = matches.call( div, "div" );
b@1402:
b@1402: // This should fail with an exception
b@1402: // Gecko does not error, returns false instead
b@1402: matches.call( div, "[s!='']:x" );
b@1402: rbuggyMatches.push( "!=", pseudos );
b@1402: });
b@1402: }
b@1402:
b@1402: rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
b@1402: rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
b@1402:
b@1402: /* Contains
b@1402: ---------------------------------------------------------------------- */
b@1402: hasCompare = rnative.test( docElem.compareDocumentPosition );
b@1402:
b@1402: // Element contains another
b@1402: // Purposefully does not implement inclusive descendent
b@1402: // As in, an element does not contain itself
b@1402: contains = hasCompare || rnative.test( docElem.contains ) ?
b@1402: function( a, b ) {
b@1402: var adown = a.nodeType === 9 ? a.documentElement : a,
b@1402: bup = b && b.parentNode;
b@1402: return a === bup || !!( bup && bup.nodeType === 1 && (
b@1402: adown.contains ?
b@1402: adown.contains( bup ) :
b@1402: a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
b@1402: ));
b@1402: } :
b@1402: function( a, b ) {
b@1402: if ( b ) {
b@1402: while ( (b = b.parentNode) ) {
b@1402: if ( b === a ) {
b@1402: return true;
b@1402: }
b@1402: }
b@1402: }
b@1402: return false;
b@1402: };
b@1402:
b@1402: /* Sorting
b@1402: ---------------------------------------------------------------------- */
b@1402:
b@1402: // Document order sorting
b@1402: sortOrder = hasCompare ?
b@1402: function( a, b ) {
b@1402:
b@1402: // Flag for duplicate removal
b@1402: if ( a === b ) {
b@1402: hasDuplicate = true;
b@1402: return 0;
b@1402: }
b@1402:
b@1402: // Sort on method existence if only one input has compareDocumentPosition
b@1402: var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
b@1402: if ( compare ) {
b@1402: return compare;
b@1402: }
b@1402:
b@1402: // Calculate position if both inputs belong to the same document
b@1402: compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
b@1402: a.compareDocumentPosition( b ) :
b@1402:
b@1402: // Otherwise we know they are disconnected
b@1402: 1;
b@1402:
b@1402: // Disconnected nodes
b@1402: if ( compare & 1 ||
b@1402: (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
b@1402:
b@1402: // Choose the first element that is related to our preferred document
b@1402: if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
b@1402: return -1;
b@1402: }
b@1402: if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
b@1402: return 1;
b@1402: }
b@1402:
b@1402: // Maintain original order
b@1402: return sortInput ?
b@1402: ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
b@1402: 0;
b@1402: }
b@1402:
b@1402: return compare & 4 ? -1 : 1;
b@1402: } :
b@1402: function( a, b ) {
b@1402: // Exit early if the nodes are identical
b@1402: if ( a === b ) {
b@1402: hasDuplicate = true;
b@1402: return 0;
b@1402: }
b@1402:
b@1402: var cur,
b@1402: i = 0,
b@1402: aup = a.parentNode,
b@1402: bup = b.parentNode,
b@1402: ap = [ a ],
b@1402: bp = [ b ];
b@1402:
b@1402: // Parentless nodes are either documents or disconnected
b@1402: if ( !aup || !bup ) {
b@1402: return a === doc ? -1 :
b@1402: b === doc ? 1 :
b@1402: aup ? -1 :
b@1402: bup ? 1 :
b@1402: sortInput ?
b@1402: ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
b@1402: 0;
b@1402:
b@1402: // If the nodes are siblings, we can do a quick check
b@1402: } else if ( aup === bup ) {
b@1402: return siblingCheck( a, b );
b@1402: }
b@1402:
b@1402: // Otherwise we need full lists of their ancestors for comparison
b@1402: cur = a;
b@1402: while ( (cur = cur.parentNode) ) {
b@1402: ap.unshift( cur );
b@1402: }
b@1402: cur = b;
b@1402: while ( (cur = cur.parentNode) ) {
b@1402: bp.unshift( cur );
b@1402: }
b@1402:
b@1402: // Walk down the tree looking for a discrepancy
b@1402: while ( ap[i] === bp[i] ) {
b@1402: i++;
b@1402: }
b@1402:
b@1402: return i ?
b@1402: // Do a sibling check if the nodes have a common ancestor
b@1402: siblingCheck( ap[i], bp[i] ) :
b@1402:
b@1402: // Otherwise nodes in our document sort first
b@1402: ap[i] === preferredDoc ? -1 :
b@1402: bp[i] === preferredDoc ? 1 :
b@1402: 0;
b@1402: };
b@1402:
b@1402: return doc;
b@1402: };
b@1402:
b@1402: Sizzle.matches = function( expr, elements ) {
b@1402: return Sizzle( expr, null, null, elements );
b@1402: };
b@1402:
b@1402: Sizzle.matchesSelector = function( elem, expr ) {
b@1402: // Set document vars if needed
b@1402: if ( ( elem.ownerDocument || elem ) !== document ) {
b@1402: setDocument( elem );
b@1402: }
b@1402:
b@1402: // Make sure that attribute selectors are quoted
b@1402: expr = expr.replace( rattributeQuotes, "='$1']" );
b@1402:
b@1402: if ( support.matchesSelector && documentIsHTML &&
b@1402: ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
b@1402: ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
b@1402:
b@1402: try {
b@1402: var ret = matches.call( elem, expr );
b@1402:
b@1402: // IE 9's matchesSelector returns false on disconnected nodes
b@1402: if ( ret || support.disconnectedMatch ||
b@1402: // As well, disconnected nodes are said to be in a document
b@1402: // fragment in IE 9
b@1402: elem.document && elem.document.nodeType !== 11 ) {
b@1402: return ret;
b@1402: }
b@1402: } catch (e) {}
b@1402: }
b@1402:
b@1402: return Sizzle( expr, document, null, [ elem ] ).length > 0;
b@1402: };
b@1402:
b@1402: Sizzle.contains = function( context, elem ) {
b@1402: // Set document vars if needed
b@1402: if ( ( context.ownerDocument || context ) !== document ) {
b@1402: setDocument( context );
b@1402: }
b@1402: return contains( context, elem );
b@1402: };
b@1402:
b@1402: Sizzle.attr = function( elem, name ) {
b@1402: // Set document vars if needed
b@1402: if ( ( elem.ownerDocument || elem ) !== document ) {
b@1402: setDocument( elem );
b@1402: }
b@1402:
b@1402: var fn = Expr.attrHandle[ name.toLowerCase() ],
b@1402: // Don't get fooled by Object.prototype properties (jQuery #13807)
b@1402: val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
b@1402: fn( elem, name, !documentIsHTML ) :
b@1402: undefined;
b@1402:
b@1402: return val !== undefined ?
b@1402: val :
b@1402: support.attributes || !documentIsHTML ?
b@1402: elem.getAttribute( name ) :
b@1402: (val = elem.getAttributeNode(name)) && val.specified ?
b@1402: val.value :
b@1402: null;
b@1402: };
b@1402:
b@1402: Sizzle.error = function( msg ) {
b@1402: throw new Error( "Syntax error, unrecognized expression: " + msg );
b@1402: };
b@1402:
b@1402: /**
b@1402: * Document sorting and removing duplicates
b@1402: * @param {ArrayLike} results
b@1402: */
b@1402: Sizzle.uniqueSort = function( results ) {
b@1402: var elem,
b@1402: duplicates = [],
b@1402: j = 0,
b@1402: i = 0;
b@1402:
b@1402: // Unless we *know* we can detect duplicates, assume their presence
b@1402: hasDuplicate = !support.detectDuplicates;
b@1402: sortInput = !support.sortStable && results.slice( 0 );
b@1402: results.sort( sortOrder );
b@1402:
b@1402: if ( hasDuplicate ) {
b@1402: while ( (elem = results[i++]) ) {
b@1402: if ( elem === results[ i ] ) {
b@1402: j = duplicates.push( i );
b@1402: }
b@1402: }
b@1402: while ( j-- ) {
b@1402: results.splice( duplicates[ j ], 1 );
b@1402: }
b@1402: }
b@1402:
b@1402: // Clear input after sorting to release objects
b@1402: // See https://github.com/jquery/sizzle/pull/225
b@1402: sortInput = null;
b@1402:
b@1402: return results;
b@1402: };
b@1402:
b@1402: /**
b@1402: * Utility function for retrieving the text value of an array of DOM nodes
b@1402: * @param {Array|Element} elem
b@1402: */
b@1402: getText = Sizzle.getText = function( elem ) {
b@1402: var node,
b@1402: ret = "",
b@1402: i = 0,
b@1402: nodeType = elem.nodeType;
b@1402:
b@1402: if ( !nodeType ) {
b@1402: // If no nodeType, this is expected to be an array
b@1402: while ( (node = elem[i++]) ) {
b@1402: // Do not traverse comment nodes
b@1402: ret += getText( node );
b@1402: }
b@1402: } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
b@1402: // Use textContent for elements
b@1402: // innerText usage removed for consistency of new lines (jQuery #11153)
b@1402: if ( typeof elem.textContent === "string" ) {
b@1402: return elem.textContent;
b@1402: } else {
b@1402: // Traverse its children
b@1402: for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
b@1402: ret += getText( elem );
b@1402: }
b@1402: }
b@1402: } else if ( nodeType === 3 || nodeType === 4 ) {
b@1402: return elem.nodeValue;
b@1402: }
b@1402: // Do not include comment or processing instruction nodes
b@1402:
b@1402: return ret;
b@1402: };
b@1402:
b@1402: Expr = Sizzle.selectors = {
b@1402:
b@1402: // Can be adjusted by the user
b@1402: cacheLength: 50,
b@1402:
b@1402: createPseudo: markFunction,
b@1402:
b@1402: match: matchExpr,
b@1402:
b@1402: attrHandle: {},
b@1402:
b@1402: find: {},
b@1402:
b@1402: relative: {
b@1402: ">": { dir: "parentNode", first: true },
b@1402: " ": { dir: "parentNode" },
b@1402: "+": { dir: "previousSibling", first: true },
b@1402: "~": { dir: "previousSibling" }
b@1402: },
b@1402:
b@1402: preFilter: {
b@1402: "ATTR": function( match ) {
b@1402: match[1] = match[1].replace( runescape, funescape );
b@1402:
b@1402: // Move the given value to match[3] whether quoted or unquoted
b@1402: match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
b@1402:
b@1402: if ( match[2] === "~=" ) {
b@1402: match[3] = " " + match[3] + " ";
b@1402: }
b@1402:
b@1402: return match.slice( 0, 4 );
b@1402: },
b@1402:
b@1402: "CHILD": function( match ) {
b@1402: /* matches from matchExpr["CHILD"]
b@1402: 1 type (only|nth|...)
b@1402: 2 what (child|of-type)
b@1402: 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
b@1402: 4 xn-component of xn+y argument ([+-]?\d*n|)
b@1402: 5 sign of xn-component
b@1402: 6 x of xn-component
b@1402: 7 sign of y-component
b@1402: 8 y of y-component
b@1402: */
b@1402: match[1] = match[1].toLowerCase();
b@1402:
b@1402: if ( match[1].slice( 0, 3 ) === "nth" ) {
b@1402: // nth-* requires argument
b@1402: if ( !match[3] ) {
b@1402: Sizzle.error( match[0] );
b@1402: }
b@1402:
b@1402: // numeric x and y parameters for Expr.filter.CHILD
b@1402: // remember that false/true cast respectively to 0/1
b@1402: match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
b@1402: match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
b@1402:
b@1402: // other types prohibit arguments
b@1402: } else if ( match[3] ) {
b@1402: Sizzle.error( match[0] );
b@1402: }
b@1402:
b@1402: return match;
b@1402: },
b@1402:
b@1402: "PSEUDO": function( match ) {
b@1402: var excess,
b@1402: unquoted = !match[6] && match[2];
b@1402:
b@1402: if ( matchExpr["CHILD"].test( match[0] ) ) {
b@1402: return null;
b@1402: }
b@1402:
b@1402: // Accept quoted arguments as-is
b@1402: if ( match[3] ) {
b@1402: match[2] = match[4] || match[5] || "";
b@1402:
b@1402: // Strip excess characters from unquoted arguments
b@1402: } else if ( unquoted && rpseudo.test( unquoted ) &&
b@1402: // Get excess from tokenize (recursively)
b@1402: (excess = tokenize( unquoted, true )) &&
b@1402: // advance to the next closing parenthesis
b@1402: (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
b@1402:
b@1402: // excess is a negative index
b@1402: match[0] = match[0].slice( 0, excess );
b@1402: match[2] = unquoted.slice( 0, excess );
b@1402: }
b@1402:
b@1402: // Return only captures needed by the pseudo filter method (type and argument)
b@1402: return match.slice( 0, 3 );
b@1402: }
b@1402: },
b@1402:
b@1402: filter: {
b@1402:
b@1402: "TAG": function( nodeNameSelector ) {
b@1402: var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
b@1402: return nodeNameSelector === "*" ?
b@1402: function() { return true; } :
b@1402: function( elem ) {
b@1402: return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
b@1402: };
b@1402: },
b@1402:
b@1402: "CLASS": function( className ) {
b@1402: var pattern = classCache[ className + " " ];
b@1402:
b@1402: return pattern ||
b@1402: (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
b@1402: classCache( className, function( elem ) {
b@1402: return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
b@1402: });
b@1402: },
b@1402:
b@1402: "ATTR": function( name, operator, check ) {
b@1402: return function( elem ) {
b@1402: var result = Sizzle.attr( elem, name );
b@1402:
b@1402: if ( result == null ) {
b@1402: return operator === "!=";
b@1402: }
b@1402: if ( !operator ) {
b@1402: return true;
b@1402: }
b@1402:
b@1402: result += "";
b@1402:
b@1402: return operator === "=" ? result === check :
b@1402: operator === "!=" ? result !== check :
b@1402: operator === "^=" ? check && result.indexOf( check ) === 0 :
b@1402: operator === "*=" ? check && result.indexOf( check ) > -1 :
b@1402: operator === "$=" ? check && result.slice( -check.length ) === check :
b@1402: operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
b@1402: operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
b@1402: false;
b@1402: };
b@1402: },
b@1402:
b@1402: "CHILD": function( type, what, argument, first, last ) {
b@1402: var simple = type.slice( 0, 3 ) !== "nth",
b@1402: forward = type.slice( -4 ) !== "last",
b@1402: ofType = what === "of-type";
b@1402:
b@1402: return first === 1 && last === 0 ?
b@1402:
b@1402: // Shortcut for :nth-*(n)
b@1402: function( elem ) {
b@1402: return !!elem.parentNode;
b@1402: } :
b@1402:
b@1402: function( elem, context, xml ) {
b@1402: var cache, outerCache, node, diff, nodeIndex, start,
b@1402: dir = simple !== forward ? "nextSibling" : "previousSibling",
b@1402: parent = elem.parentNode,
b@1402: name = ofType && elem.nodeName.toLowerCase(),
b@1402: useCache = !xml && !ofType;
b@1402:
b@1402: if ( parent ) {
b@1402:
b@1402: // :(first|last|only)-(child|of-type)
b@1402: if ( simple ) {
b@1402: while ( dir ) {
b@1402: node = elem;
b@1402: while ( (node = node[ dir ]) ) {
b@1402: if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
b@1402: return false;
b@1402: }
b@1402: }
b@1402: // Reverse direction for :only-* (if we haven't yet done so)
b@1402: start = dir = type === "only" && !start && "nextSibling";
b@1402: }
b@1402: return true;
b@1402: }
b@1402:
b@1402: start = [ forward ? parent.firstChild : parent.lastChild ];
b@1402:
b@1402: // non-xml :nth-child(...) stores cache data on `parent`
b@1402: if ( forward && useCache ) {
b@1402: // Seek `elem` from a previously-cached index
b@1402: outerCache = parent[ expando ] || (parent[ expando ] = {});
b@1402: cache = outerCache[ type ] || [];
b@1402: nodeIndex = cache[0] === dirruns && cache[1];
b@1402: diff = cache[0] === dirruns && cache[2];
b@1402: node = nodeIndex && parent.childNodes[ nodeIndex ];
b@1402:
b@1402: while ( (node = ++nodeIndex && node && node[ dir ] ||
b@1402:
b@1402: // Fallback to seeking `elem` from the start
b@1402: (diff = nodeIndex = 0) || start.pop()) ) {
b@1402:
b@1402: // When found, cache indexes on `parent` and break
b@1402: if ( node.nodeType === 1 && ++diff && node === elem ) {
b@1402: outerCache[ type ] = [ dirruns, nodeIndex, diff ];
b@1402: break;
b@1402: }
b@1402: }
b@1402:
b@1402: // Use previously-cached element index if available
b@1402: } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
b@1402: diff = cache[1];
b@1402:
b@1402: // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
b@1402: } else {
b@1402: // Use the same loop as above to seek `elem` from the start
b@1402: while ( (node = ++nodeIndex && node && node[ dir ] ||
b@1402: (diff = nodeIndex = 0) || start.pop()) ) {
b@1402:
b@1402: if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
b@1402: // Cache the index of each encountered element
b@1402: if ( useCache ) {
b@1402: (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
b@1402: }
b@1402:
b@1402: if ( node === elem ) {
b@1402: break;
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // Incorporate the offset, then check against cycle size
b@1402: diff -= last;
b@1402: return diff === first || ( diff % first === 0 && diff / first >= 0 );
b@1402: }
b@1402: };
b@1402: },
b@1402:
b@1402: "PSEUDO": function( pseudo, argument ) {
b@1402: // pseudo-class names are case-insensitive
b@1402: // http://www.w3.org/TR/selectors/#pseudo-classes
b@1402: // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
b@1402: // Remember that setFilters inherits from pseudos
b@1402: var args,
b@1402: fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
b@1402: Sizzle.error( "unsupported pseudo: " + pseudo );
b@1402:
b@1402: // The user may use createPseudo to indicate that
b@1402: // arguments are needed to create the filter function
b@1402: // just as Sizzle does
b@1402: if ( fn[ expando ] ) {
b@1402: return fn( argument );
b@1402: }
b@1402:
b@1402: // But maintain support for old signatures
b@1402: if ( fn.length > 1 ) {
b@1402: args = [ pseudo, pseudo, "", argument ];
b@1402: return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
b@1402: markFunction(function( seed, matches ) {
b@1402: var idx,
b@1402: matched = fn( seed, argument ),
b@1402: i = matched.length;
b@1402: while ( i-- ) {
b@1402: idx = indexOf( seed, matched[i] );
b@1402: seed[ idx ] = !( matches[ idx ] = matched[i] );
b@1402: }
b@1402: }) :
b@1402: function( elem ) {
b@1402: return fn( elem, 0, args );
b@1402: };
b@1402: }
b@1402:
b@1402: return fn;
b@1402: }
b@1402: },
b@1402:
b@1402: pseudos: {
b@1402: // Potentially complex pseudos
b@1402: "not": markFunction(function( selector ) {
b@1402: // Trim the selector passed to compile
b@1402: // to avoid treating leading and trailing
b@1402: // spaces as combinators
b@1402: var input = [],
b@1402: results = [],
b@1402: matcher = compile( selector.replace( rtrim, "$1" ) );
b@1402:
b@1402: return matcher[ expando ] ?
b@1402: markFunction(function( seed, matches, context, xml ) {
b@1402: var elem,
b@1402: unmatched = matcher( seed, null, xml, [] ),
b@1402: i = seed.length;
b@1402:
b@1402: // Match elements unmatched by `matcher`
b@1402: while ( i-- ) {
b@1402: if ( (elem = unmatched[i]) ) {
b@1402: seed[i] = !(matches[i] = elem);
b@1402: }
b@1402: }
b@1402: }) :
b@1402: function( elem, context, xml ) {
b@1402: input[0] = elem;
b@1402: matcher( input, null, xml, results );
b@1402: // Don't keep the element (issue #299)
b@1402: input[0] = null;
b@1402: return !results.pop();
b@1402: };
b@1402: }),
b@1402:
b@1402: "has": markFunction(function( selector ) {
b@1402: return function( elem ) {
b@1402: return Sizzle( selector, elem ).length > 0;
b@1402: };
b@1402: }),
b@1402:
b@1402: "contains": markFunction(function( text ) {
b@1402: text = text.replace( runescape, funescape );
b@1402: return function( elem ) {
b@1402: return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
b@1402: };
b@1402: }),
b@1402:
b@1402: // "Whether an element is represented by a :lang() selector
b@1402: // is based solely on the element's language value
b@1402: // being equal to the identifier C,
b@1402: // or beginning with the identifier C immediately followed by "-".
b@1402: // The matching of C against the element's language value is performed case-insensitively.
b@1402: // The identifier C does not have to be a valid language name."
b@1402: // http://www.w3.org/TR/selectors/#lang-pseudo
b@1402: "lang": markFunction( function( lang ) {
b@1402: // lang value must be a valid identifier
b@1402: if ( !ridentifier.test(lang || "") ) {
b@1402: Sizzle.error( "unsupported lang: " + lang );
b@1402: }
b@1402: lang = lang.replace( runescape, funescape ).toLowerCase();
b@1402: return function( elem ) {
b@1402: var elemLang;
b@1402: do {
b@1402: if ( (elemLang = documentIsHTML ?
b@1402: elem.lang :
b@1402: elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
b@1402:
b@1402: elemLang = elemLang.toLowerCase();
b@1402: return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
b@1402: }
b@1402: } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
b@1402: return false;
b@1402: };
b@1402: }),
b@1402:
b@1402: // Miscellaneous
b@1402: "target": function( elem ) {
b@1402: var hash = window.location && window.location.hash;
b@1402: return hash && hash.slice( 1 ) === elem.id;
b@1402: },
b@1402:
b@1402: "root": function( elem ) {
b@1402: return elem === docElem;
b@1402: },
b@1402:
b@1402: "focus": function( elem ) {
b@1402: return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
b@1402: },
b@1402:
b@1402: // Boolean properties
b@1402: "enabled": function( elem ) {
b@1402: return elem.disabled === false;
b@1402: },
b@1402:
b@1402: "disabled": function( elem ) {
b@1402: return elem.disabled === true;
b@1402: },
b@1402:
b@1402: "checked": function( elem ) {
b@1402: // In CSS3, :checked should return both checked and selected elements
b@1402: // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
b@1402: var nodeName = elem.nodeName.toLowerCase();
b@1402: return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
b@1402: },
b@1402:
b@1402: "selected": function( elem ) {
b@1402: // Accessing this property makes selected-by-default
b@1402: // options in Safari work properly
b@1402: if ( elem.parentNode ) {
b@1402: elem.parentNode.selectedIndex;
b@1402: }
b@1402:
b@1402: return elem.selected === true;
b@1402: },
b@1402:
b@1402: // Contents
b@1402: "empty": function( elem ) {
b@1402: // http://www.w3.org/TR/selectors/#empty-pseudo
b@1402: // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
b@1402: // but not by others (comment: 8; processing instruction: 7; etc.)
b@1402: // nodeType < 6 works because attributes (2) do not appear as children
b@1402: for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
b@1402: if ( elem.nodeType < 6 ) {
b@1402: return false;
b@1402: }
b@1402: }
b@1402: return true;
b@1402: },
b@1402:
b@1402: "parent": function( elem ) {
b@1402: return !Expr.pseudos["empty"]( elem );
b@1402: },
b@1402:
b@1402: // Element/input types
b@1402: "header": function( elem ) {
b@1402: return rheader.test( elem.nodeName );
b@1402: },
b@1402:
b@1402: "input": function( elem ) {
b@1402: return rinputs.test( elem.nodeName );
b@1402: },
b@1402:
b@1402: "button": function( elem ) {
b@1402: var name = elem.nodeName.toLowerCase();
b@1402: return name === "input" && elem.type === "button" || name === "button";
b@1402: },
b@1402:
b@1402: "text": function( elem ) {
b@1402: var attr;
b@1402: return elem.nodeName.toLowerCase() === "input" &&
b@1402: elem.type === "text" &&
b@1402:
b@1402: // Support: IE<8
b@1402: // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
b@1402: ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
b@1402: },
b@1402:
b@1402: // Position-in-collection
b@1402: "first": createPositionalPseudo(function() {
b@1402: return [ 0 ];
b@1402: }),
b@1402:
b@1402: "last": createPositionalPseudo(function( matchIndexes, length ) {
b@1402: return [ length - 1 ];
b@1402: }),
b@1402:
b@1402: "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
b@1402: return [ argument < 0 ? argument + length : argument ];
b@1402: }),
b@1402:
b@1402: "even": createPositionalPseudo(function( matchIndexes, length ) {
b@1402: var i = 0;
b@1402: for ( ; i < length; i += 2 ) {
b@1402: matchIndexes.push( i );
b@1402: }
b@1402: return matchIndexes;
b@1402: }),
b@1402:
b@1402: "odd": createPositionalPseudo(function( matchIndexes, length ) {
b@1402: var i = 1;
b@1402: for ( ; i < length; i += 2 ) {
b@1402: matchIndexes.push( i );
b@1402: }
b@1402: return matchIndexes;
b@1402: }),
b@1402:
b@1402: "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
b@1402: var i = argument < 0 ? argument + length : argument;
b@1402: for ( ; --i >= 0; ) {
b@1402: matchIndexes.push( i );
b@1402: }
b@1402: return matchIndexes;
b@1402: }),
b@1402:
b@1402: "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
b@1402: var i = argument < 0 ? argument + length : argument;
b@1402: for ( ; ++i < length; ) {
b@1402: matchIndexes.push( i );
b@1402: }
b@1402: return matchIndexes;
b@1402: })
b@1402: }
b@1402: };
b@1402:
b@1402: Expr.pseudos["nth"] = Expr.pseudos["eq"];
b@1402:
b@1402: // Add button/input type pseudos
b@1402: for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
b@1402: Expr.pseudos[ i ] = createInputPseudo( i );
b@1402: }
b@1402: for ( i in { submit: true, reset: true } ) {
b@1402: Expr.pseudos[ i ] = createButtonPseudo( i );
b@1402: }
b@1402:
b@1402: // Easy API for creating new setFilters
b@1402: function setFilters() {}
b@1402: setFilters.prototype = Expr.filters = Expr.pseudos;
b@1402: Expr.setFilters = new setFilters();
b@1402:
b@1402: tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
b@1402: var matched, match, tokens, type,
b@1402: soFar, groups, preFilters,
b@1402: cached = tokenCache[ selector + " " ];
b@1402:
b@1402: if ( cached ) {
b@1402: return parseOnly ? 0 : cached.slice( 0 );
b@1402: }
b@1402:
b@1402: soFar = selector;
b@1402: groups = [];
b@1402: preFilters = Expr.preFilter;
b@1402:
b@1402: while ( soFar ) {
b@1402:
b@1402: // Comma and first run
b@1402: if ( !matched || (match = rcomma.exec( soFar )) ) {
b@1402: if ( match ) {
b@1402: // Don't consume trailing commas as valid
b@1402: soFar = soFar.slice( match[0].length ) || soFar;
b@1402: }
b@1402: groups.push( (tokens = []) );
b@1402: }
b@1402:
b@1402: matched = false;
b@1402:
b@1402: // Combinators
b@1402: if ( (match = rcombinators.exec( soFar )) ) {
b@1402: matched = match.shift();
b@1402: tokens.push({
b@1402: value: matched,
b@1402: // Cast descendant combinators to space
b@1402: type: match[0].replace( rtrim, " " )
b@1402: });
b@1402: soFar = soFar.slice( matched.length );
b@1402: }
b@1402:
b@1402: // Filters
b@1402: for ( type in Expr.filter ) {
b@1402: if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
b@1402: (match = preFilters[ type ]( match ))) ) {
b@1402: matched = match.shift();
b@1402: tokens.push({
b@1402: value: matched,
b@1402: type: type,
b@1402: matches: match
b@1402: });
b@1402: soFar = soFar.slice( matched.length );
b@1402: }
b@1402: }
b@1402:
b@1402: if ( !matched ) {
b@1402: break;
b@1402: }
b@1402: }
b@1402:
b@1402: // Return the length of the invalid excess
b@1402: // if we're just parsing
b@1402: // Otherwise, throw an error or return tokens
b@1402: return parseOnly ?
b@1402: soFar.length :
b@1402: soFar ?
b@1402: Sizzle.error( selector ) :
b@1402: // Cache the tokens
b@1402: tokenCache( selector, groups ).slice( 0 );
b@1402: };
b@1402:
b@1402: function toSelector( tokens ) {
b@1402: var i = 0,
b@1402: len = tokens.length,
b@1402: selector = "";
b@1402: for ( ; i < len; i++ ) {
b@1402: selector += tokens[i].value;
b@1402: }
b@1402: return selector;
b@1402: }
b@1402:
b@1402: function addCombinator( matcher, combinator, base ) {
b@1402: var dir = combinator.dir,
b@1402: checkNonElements = base && dir === "parentNode",
b@1402: doneName = done++;
b@1402:
b@1402: return combinator.first ?
b@1402: // Check against closest ancestor/preceding element
b@1402: function( elem, context, xml ) {
b@1402: while ( (elem = elem[ dir ]) ) {
b@1402: if ( elem.nodeType === 1 || checkNonElements ) {
b@1402: return matcher( elem, context, xml );
b@1402: }
b@1402: }
b@1402: } :
b@1402:
b@1402: // Check against all ancestor/preceding elements
b@1402: function( elem, context, xml ) {
b@1402: var oldCache, outerCache,
b@1402: newCache = [ dirruns, doneName ];
b@1402:
b@1402: // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
b@1402: if ( xml ) {
b@1402: while ( (elem = elem[ dir ]) ) {
b@1402: if ( elem.nodeType === 1 || checkNonElements ) {
b@1402: if ( matcher( elem, context, xml ) ) {
b@1402: return true;
b@1402: }
b@1402: }
b@1402: }
b@1402: } else {
b@1402: while ( (elem = elem[ dir ]) ) {
b@1402: if ( elem.nodeType === 1 || checkNonElements ) {
b@1402: outerCache = elem[ expando ] || (elem[ expando ] = {});
b@1402: if ( (oldCache = outerCache[ dir ]) &&
b@1402: oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
b@1402:
b@1402: // Assign to newCache so results back-propagate to previous elements
b@1402: return (newCache[ 2 ] = oldCache[ 2 ]);
b@1402: } else {
b@1402: // Reuse newcache so results back-propagate to previous elements
b@1402: outerCache[ dir ] = newCache;
b@1402:
b@1402: // A match means we're done; a fail means we have to keep checking
b@1402: if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
b@1402: return true;
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402: };
b@1402: }
b@1402:
b@1402: function elementMatcher( matchers ) {
b@1402: return matchers.length > 1 ?
b@1402: function( elem, context, xml ) {
b@1402: var i = matchers.length;
b@1402: while ( i-- ) {
b@1402: if ( !matchers[i]( elem, context, xml ) ) {
b@1402: return false;
b@1402: }
b@1402: }
b@1402: return true;
b@1402: } :
b@1402: matchers[0];
b@1402: }
b@1402:
b@1402: function multipleContexts( selector, contexts, results ) {
b@1402: var i = 0,
b@1402: len = contexts.length;
b@1402: for ( ; i < len; i++ ) {
b@1402: Sizzle( selector, contexts[i], results );
b@1402: }
b@1402: return results;
b@1402: }
b@1402:
b@1402: function condense( unmatched, map, filter, context, xml ) {
b@1402: var elem,
b@1402: newUnmatched = [],
b@1402: i = 0,
b@1402: len = unmatched.length,
b@1402: mapped = map != null;
b@1402:
b@1402: for ( ; i < len; i++ ) {
b@1402: if ( (elem = unmatched[i]) ) {
b@1402: if ( !filter || filter( elem, context, xml ) ) {
b@1402: newUnmatched.push( elem );
b@1402: if ( mapped ) {
b@1402: map.push( i );
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: return newUnmatched;
b@1402: }
b@1402:
b@1402: function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
b@1402: if ( postFilter && !postFilter[ expando ] ) {
b@1402: postFilter = setMatcher( postFilter );
b@1402: }
b@1402: if ( postFinder && !postFinder[ expando ] ) {
b@1402: postFinder = setMatcher( postFinder, postSelector );
b@1402: }
b@1402: return markFunction(function( seed, results, context, xml ) {
b@1402: var temp, i, elem,
b@1402: preMap = [],
b@1402: postMap = [],
b@1402: preexisting = results.length,
b@1402:
b@1402: // Get initial elements from seed or context
b@1402: elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
b@1402:
b@1402: // Prefilter to get matcher input, preserving a map for seed-results synchronization
b@1402: matcherIn = preFilter && ( seed || !selector ) ?
b@1402: condense( elems, preMap, preFilter, context, xml ) :
b@1402: elems,
b@1402:
b@1402: matcherOut = matcher ?
b@1402: // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
b@1402: postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
b@1402:
b@1402: // ...intermediate processing is necessary
b@1402: [] :
b@1402:
b@1402: // ...otherwise use results directly
b@1402: results :
b@1402: matcherIn;
b@1402:
b@1402: // Find primary matches
b@1402: if ( matcher ) {
b@1402: matcher( matcherIn, matcherOut, context, xml );
b@1402: }
b@1402:
b@1402: // Apply postFilter
b@1402: if ( postFilter ) {
b@1402: temp = condense( matcherOut, postMap );
b@1402: postFilter( temp, [], context, xml );
b@1402:
b@1402: // Un-match failing elements by moving them back to matcherIn
b@1402: i = temp.length;
b@1402: while ( i-- ) {
b@1402: if ( (elem = temp[i]) ) {
b@1402: matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: if ( seed ) {
b@1402: if ( postFinder || preFilter ) {
b@1402: if ( postFinder ) {
b@1402: // Get the final matcherOut by condensing this intermediate into postFinder contexts
b@1402: temp = [];
b@1402: i = matcherOut.length;
b@1402: while ( i-- ) {
b@1402: if ( (elem = matcherOut[i]) ) {
b@1402: // Restore matcherIn since elem is not yet a final match
b@1402: temp.push( (matcherIn[i] = elem) );
b@1402: }
b@1402: }
b@1402: postFinder( null, (matcherOut = []), temp, xml );
b@1402: }
b@1402:
b@1402: // Move matched elements from seed to results to keep them synchronized
b@1402: i = matcherOut.length;
b@1402: while ( i-- ) {
b@1402: if ( (elem = matcherOut[i]) &&
b@1402: (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
b@1402:
b@1402: seed[temp] = !(results[temp] = elem);
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // Add elements to results, through postFinder if defined
b@1402: } else {
b@1402: matcherOut = condense(
b@1402: matcherOut === results ?
b@1402: matcherOut.splice( preexisting, matcherOut.length ) :
b@1402: matcherOut
b@1402: );
b@1402: if ( postFinder ) {
b@1402: postFinder( null, results, matcherOut, xml );
b@1402: } else {
b@1402: push.apply( results, matcherOut );
b@1402: }
b@1402: }
b@1402: });
b@1402: }
b@1402:
b@1402: function matcherFromTokens( tokens ) {
b@1402: var checkContext, matcher, j,
b@1402: len = tokens.length,
b@1402: leadingRelative = Expr.relative[ tokens[0].type ],
b@1402: implicitRelative = leadingRelative || Expr.relative[" "],
b@1402: i = leadingRelative ? 1 : 0,
b@1402:
b@1402: // The foundational matcher ensures that elements are reachable from top-level context(s)
b@1402: matchContext = addCombinator( function( elem ) {
b@1402: return elem === checkContext;
b@1402: }, implicitRelative, true ),
b@1402: matchAnyContext = addCombinator( function( elem ) {
b@1402: return indexOf( checkContext, elem ) > -1;
b@1402: }, implicitRelative, true ),
b@1402: matchers = [ function( elem, context, xml ) {
b@1402: var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
b@1402: (checkContext = context).nodeType ?
b@1402: matchContext( elem, context, xml ) :
b@1402: matchAnyContext( elem, context, xml ) );
b@1402: // Avoid hanging onto element (issue #299)
b@1402: checkContext = null;
b@1402: return ret;
b@1402: } ];
b@1402:
b@1402: for ( ; i < len; i++ ) {
b@1402: if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
b@1402: matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
b@1402: } else {
b@1402: matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
b@1402:
b@1402: // Return special upon seeing a positional matcher
b@1402: if ( matcher[ expando ] ) {
b@1402: // Find the next relative operator (if any) for proper handling
b@1402: j = ++i;
b@1402: for ( ; j < len; j++ ) {
b@1402: if ( Expr.relative[ tokens[j].type ] ) {
b@1402: break;
b@1402: }
b@1402: }
b@1402: return setMatcher(
b@1402: i > 1 && elementMatcher( matchers ),
b@1402: i > 1 && toSelector(
b@1402: // If the preceding token was a descendant combinator, insert an implicit any-element `*`
b@1402: tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
b@1402: ).replace( rtrim, "$1" ),
b@1402: matcher,
b@1402: i < j && matcherFromTokens( tokens.slice( i, j ) ),
b@1402: j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
b@1402: j < len && toSelector( tokens )
b@1402: );
b@1402: }
b@1402: matchers.push( matcher );
b@1402: }
b@1402: }
b@1402:
b@1402: return elementMatcher( matchers );
b@1402: }
b@1402:
b@1402: function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
b@1402: var bySet = setMatchers.length > 0,
b@1402: byElement = elementMatchers.length > 0,
b@1402: superMatcher = function( seed, context, xml, results, outermost ) {
b@1402: var elem, j, matcher,
b@1402: matchedCount = 0,
b@1402: i = "0",
b@1402: unmatched = seed && [],
b@1402: setMatched = [],
b@1402: contextBackup = outermostContext,
b@1402: // We must always have either seed elements or outermost context
b@1402: elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
b@1402: // Use integer dirruns iff this is the outermost matcher
b@1402: dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
b@1402: len = elems.length;
b@1402:
b@1402: if ( outermost ) {
b@1402: outermostContext = context !== document && context;
b@1402: }
b@1402:
b@1402: // Add elements passing elementMatchers directly to results
b@1402: // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
b@1402: // Support: IE<9, Safari
b@1402: // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id
b@1402: for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
b@1402: if ( byElement && elem ) {
b@1402: j = 0;
b@1402: while ( (matcher = elementMatchers[j++]) ) {
b@1402: if ( matcher( elem, context, xml ) ) {
b@1402: results.push( elem );
b@1402: break;
b@1402: }
b@1402: }
b@1402: if ( outermost ) {
b@1402: dirruns = dirrunsUnique;
b@1402: }
b@1402: }
b@1402:
b@1402: // Track unmatched elements for set filters
b@1402: if ( bySet ) {
b@1402: // They will have gone through all possible matchers
b@1402: if ( (elem = !matcher && elem) ) {
b@1402: matchedCount--;
b@1402: }
b@1402:
b@1402: // Lengthen the array for every element, matched or not
b@1402: if ( seed ) {
b@1402: unmatched.push( elem );
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // Apply set filters to unmatched elements
b@1402: matchedCount += i;
b@1402: if ( bySet && i !== matchedCount ) {
b@1402: j = 0;
b@1402: while ( (matcher = setMatchers[j++]) ) {
b@1402: matcher( unmatched, setMatched, context, xml );
b@1402: }
b@1402:
b@1402: if ( seed ) {
b@1402: // Reintegrate element matches to eliminate the need for sorting
b@1402: if ( matchedCount > 0 ) {
b@1402: while ( i-- ) {
b@1402: if ( !(unmatched[i] || setMatched[i]) ) {
b@1402: setMatched[i] = pop.call( results );
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // Discard index placeholder values to get only actual matches
b@1402: setMatched = condense( setMatched );
b@1402: }
b@1402:
b@1402: // Add matches to results
b@1402: push.apply( results, setMatched );
b@1402:
b@1402: // Seedless set matches succeeding multiple successful matchers stipulate sorting
b@1402: if ( outermost && !seed && setMatched.length > 0 &&
b@1402: ( matchedCount + setMatchers.length ) > 1 ) {
b@1402:
b@1402: Sizzle.uniqueSort( results );
b@1402: }
b@1402: }
b@1402:
b@1402: // Override manipulation of globals by nested matchers
b@1402: if ( outermost ) {
b@1402: dirruns = dirrunsUnique;
b@1402: outermostContext = contextBackup;
b@1402: }
b@1402:
b@1402: return unmatched;
b@1402: };
b@1402:
b@1402: return bySet ?
b@1402: markFunction( superMatcher ) :
b@1402: superMatcher;
b@1402: }
b@1402:
b@1402: compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
b@1402: var i,
b@1402: setMatchers = [],
b@1402: elementMatchers = [],
b@1402: cached = compilerCache[ selector + " " ];
b@1402:
b@1402: if ( !cached ) {
b@1402: // Generate a function of recursive functions that can be used to check each element
b@1402: if ( !match ) {
b@1402: match = tokenize( selector );
b@1402: }
b@1402: i = match.length;
b@1402: while ( i-- ) {
b@1402: cached = matcherFromTokens( match[i] );
b@1402: if ( cached[ expando ] ) {
b@1402: setMatchers.push( cached );
b@1402: } else {
b@1402: elementMatchers.push( cached );
b@1402: }
b@1402: }
b@1402:
b@1402: // Cache the compiled function
b@1402: cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
b@1402:
b@1402: // Save selector and tokenization
b@1402: cached.selector = selector;
b@1402: }
b@1402: return cached;
b@1402: };
b@1402:
b@1402: /**
b@1402: * A low-level selection function that works with Sizzle's compiled
b@1402: * selector functions
b@1402: * @param {String|Function} selector A selector or a pre-compiled
b@1402: * selector function built with Sizzle.compile
b@1402: * @param {Element} context
b@1402: * @param {Array} [results]
b@1402: * @param {Array} [seed] A set of elements to match against
b@1402: */
b@1402: select = Sizzle.select = function( selector, context, results, seed ) {
b@1402: var i, tokens, token, type, find,
b@1402: compiled = typeof selector === "function" && selector,
b@1402: match = !seed && tokenize( (selector = compiled.selector || selector) );
b@1402:
b@1402: results = results || [];
b@1402:
b@1402: // Try to minimize operations if there is no seed and only one group
b@1402: if ( match.length === 1 ) {
b@1402:
b@1402: // Take a shortcut and set the context if the root selector is an ID
b@1402: tokens = match[0] = match[0].slice( 0 );
b@1402: if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
b@1402: support.getById && context.nodeType === 9 && documentIsHTML &&
b@1402: Expr.relative[ tokens[1].type ] ) {
b@1402:
b@1402: context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
b@1402: if ( !context ) {
b@1402: return results;
b@1402:
b@1402: // Precompiled matchers will still verify ancestry, so step up a level
b@1402: } else if ( compiled ) {
b@1402: context = context.parentNode;
b@1402: }
b@1402:
b@1402: selector = selector.slice( tokens.shift().value.length );
b@1402: }
b@1402:
b@1402: // Fetch a seed set for right-to-left matching
b@1402: i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
b@1402: while ( i-- ) {
b@1402: token = tokens[i];
b@1402:
b@1402: // Abort if we hit a combinator
b@1402: if ( Expr.relative[ (type = token.type) ] ) {
b@1402: break;
b@1402: }
b@1402: if ( (find = Expr.find[ type ]) ) {
b@1402: // Search, expanding context for leading sibling combinators
b@1402: if ( (seed = find(
b@1402: token.matches[0].replace( runescape, funescape ),
b@1402: rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
b@1402: )) ) {
b@1402:
b@1402: // If seed is empty or no tokens remain, we can return early
b@1402: tokens.splice( i, 1 );
b@1402: selector = seed.length && toSelector( tokens );
b@1402: if ( !selector ) {
b@1402: push.apply( results, seed );
b@1402: return results;
b@1402: }
b@1402:
b@1402: break;
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // Compile and execute a filtering function if one is not provided
b@1402: // Provide `match` to avoid retokenization if we modified the selector above
b@1402: ( compiled || compile( selector, match ) )(
b@1402: seed,
b@1402: context,
b@1402: !documentIsHTML,
b@1402: results,
b@1402: rsibling.test( selector ) && testContext( context.parentNode ) || context
b@1402: );
b@1402: return results;
b@1402: };
b@1402:
b@1402: // One-time assignments
b@1402:
b@1402: // Sort stability
b@1402: support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
b@1402:
b@1402: // Support: Chrome 14-35+
b@1402: // Always assume duplicates if they aren't passed to the comparison function
b@1402: support.detectDuplicates = !!hasDuplicate;
b@1402:
b@1402: // Initialize against the default document
b@1402: setDocument();
b@1402:
b@1402: // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
b@1402: // Detached nodes confoundingly follow *each other*
b@1402: support.sortDetached = assert(function( div1 ) {
b@1402: // Should return 1, but returns 4 (following)
b@1402: return div1.compareDocumentPosition( document.createElement("div") ) & 1;
b@1402: });
b@1402:
b@1402: // Support: IE<8
b@1402: // Prevent attribute/property "interpolation"
b@1402: // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
b@1402: if ( !assert(function( div ) {
b@1402: div.innerHTML = "";
b@1402: return div.firstChild.getAttribute("href") === "#" ;
b@1402: }) ) {
b@1402: addHandle( "type|href|height|width", function( elem, name, isXML ) {
b@1402: if ( !isXML ) {
b@1402: return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
b@1402: }
b@1402: });
b@1402: }
b@1402:
b@1402: // Support: IE<9
b@1402: // Use defaultValue in place of getAttribute("value")
b@1402: if ( !support.attributes || !assert(function( div ) {
b@1402: div.innerHTML = "";
b@1402: div.firstChild.setAttribute( "value", "" );
b@1402: return div.firstChild.getAttribute( "value" ) === "";
b@1402: }) ) {
b@1402: addHandle( "value", function( elem, name, isXML ) {
b@1402: if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
b@1402: return elem.defaultValue;
b@1402: }
b@1402: });
b@1402: }
b@1402:
b@1402: // Support: IE<9
b@1402: // Use getAttributeNode to fetch booleans when getAttribute lies
b@1402: if ( !assert(function( div ) {
b@1402: return div.getAttribute("disabled") == null;
b@1402: }) ) {
b@1402: addHandle( booleans, function( elem, name, isXML ) {
b@1402: var val;
b@1402: if ( !isXML ) {
b@1402: return elem[ name ] === true ? name.toLowerCase() :
b@1402: (val = elem.getAttributeNode( name )) && val.specified ?
b@1402: val.value :
b@1402: null;
b@1402: }
b@1402: });
b@1402: }
b@1402:
b@1402: return Sizzle;
b@1402:
b@1402: })( window );
b@1402:
b@1402:
b@1402:
b@1402: jQuery.find = Sizzle;
b@1402: jQuery.expr = Sizzle.selectors;
b@1402: jQuery.expr[":"] = jQuery.expr.pseudos;
b@1402: jQuery.unique = Sizzle.uniqueSort;
b@1402: jQuery.text = Sizzle.getText;
b@1402: jQuery.isXMLDoc = Sizzle.isXML;
b@1402: jQuery.contains = Sizzle.contains;
b@1402:
b@1402:
b@1402:
b@1402: var rneedsContext = jQuery.expr.match.needsContext;
b@1402:
b@1402: var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
b@1402:
b@1402:
b@1402:
b@1402: var risSimple = /^.[^:#\[\.,]*$/;
b@1402:
b@1402: // Implement the identical functionality for filter and not
b@1402: function winnow( elements, qualifier, not ) {
b@1402: if ( jQuery.isFunction( qualifier ) ) {
b@1402: return jQuery.grep( elements, function( elem, i ) {
b@1402: /* jshint -W018 */
b@1402: return !!qualifier.call( elem, i, elem ) !== not;
b@1402: });
b@1402:
b@1402: }
b@1402:
b@1402: if ( qualifier.nodeType ) {
b@1402: return jQuery.grep( elements, function( elem ) {
b@1402: return ( elem === qualifier ) !== not;
b@1402: });
b@1402:
b@1402: }
b@1402:
b@1402: if ( typeof qualifier === "string" ) {
b@1402: if ( risSimple.test( qualifier ) ) {
b@1402: return jQuery.filter( qualifier, elements, not );
b@1402: }
b@1402:
b@1402: qualifier = jQuery.filter( qualifier, elements );
b@1402: }
b@1402:
b@1402: return jQuery.grep( elements, function( elem ) {
b@1402: return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
b@1402: });
b@1402: }
b@1402:
b@1402: jQuery.filter = function( expr, elems, not ) {
b@1402: var elem = elems[ 0 ];
b@1402:
b@1402: if ( not ) {
b@1402: expr = ":not(" + expr + ")";
b@1402: }
b@1402:
b@1402: return elems.length === 1 && elem.nodeType === 1 ?
b@1402: jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
b@1402: jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
b@1402: return elem.nodeType === 1;
b@1402: }));
b@1402: };
b@1402:
b@1402: jQuery.fn.extend({
b@1402: find: function( selector ) {
b@1402: var i,
b@1402: len = this.length,
b@1402: ret = [],
b@1402: self = this;
b@1402:
b@1402: if ( typeof selector !== "string" ) {
b@1402: return this.pushStack( jQuery( selector ).filter(function() {
b@1402: for ( i = 0; i < len; i++ ) {
b@1402: if ( jQuery.contains( self[ i ], this ) ) {
b@1402: return true;
b@1402: }
b@1402: }
b@1402: }) );
b@1402: }
b@1402:
b@1402: for ( i = 0; i < len; i++ ) {
b@1402: jQuery.find( selector, self[ i ], ret );
b@1402: }
b@1402:
b@1402: // Needed because $( selector, context ) becomes $( context ).find( selector )
b@1402: ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
b@1402: ret.selector = this.selector ? this.selector + " " + selector : selector;
b@1402: return ret;
b@1402: },
b@1402: filter: function( selector ) {
b@1402: return this.pushStack( winnow(this, selector || [], false) );
b@1402: },
b@1402: not: function( selector ) {
b@1402: return this.pushStack( winnow(this, selector || [], true) );
b@1402: },
b@1402: is: function( selector ) {
b@1402: return !!winnow(
b@1402: this,
b@1402:
b@1402: // If this is a positional/relative selector, check membership in the returned set
b@1402: // so $("p:first").is("p:last") won't return true for a doc with two "p".
b@1402: typeof selector === "string" && rneedsContext.test( selector ) ?
b@1402: jQuery( selector ) :
b@1402: selector || [],
b@1402: false
b@1402: ).length;
b@1402: }
b@1402: });
b@1402:
b@1402:
b@1402: // Initialize a jQuery object
b@1402:
b@1402:
b@1402: // A central reference to the root jQuery(document)
b@1402: var rootjQuery,
b@1402:
b@1402: // A simple way to check for HTML strings
b@1402: // Prioritize #id over to avoid XSS via location.hash (#9521)
b@1402: // Strict HTML recognition (#11290: must start with <)
b@1402: rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
b@1402:
b@1402: init = jQuery.fn.init = function( selector, context ) {
b@1402: var match, elem;
b@1402:
b@1402: // HANDLE: $(""), $(null), $(undefined), $(false)
b@1402: if ( !selector ) {
b@1402: return this;
b@1402: }
b@1402:
b@1402: // Handle HTML strings
b@1402: if ( typeof selector === "string" ) {
b@1402: if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
b@1402: // Assume that strings that start and end with <> are HTML and skip the regex check
b@1402: match = [ null, selector, null ];
b@1402:
b@1402: } else {
b@1402: match = rquickExpr.exec( selector );
b@1402: }
b@1402:
b@1402: // Match html or make sure no context is specified for #id
b@1402: if ( match && (match[1] || !context) ) {
b@1402:
b@1402: // HANDLE: $(html) -> $(array)
b@1402: if ( match[1] ) {
b@1402: context = context instanceof jQuery ? context[0] : context;
b@1402:
b@1402: // Option to run scripts is true for back-compat
b@1402: // Intentionally let the error be thrown if parseHTML is not present
b@1402: jQuery.merge( this, jQuery.parseHTML(
b@1402: match[1],
b@1402: context && context.nodeType ? context.ownerDocument || context : document,
b@1402: true
b@1402: ) );
b@1402:
b@1402: // HANDLE: $(html, props)
b@1402: if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
b@1402: for ( match in context ) {
b@1402: // Properties of context are called as methods if possible
b@1402: if ( jQuery.isFunction( this[ match ] ) ) {
b@1402: this[ match ]( context[ match ] );
b@1402:
b@1402: // ...and otherwise set as attributes
b@1402: } else {
b@1402: this.attr( match, context[ match ] );
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: return this;
b@1402:
b@1402: // HANDLE: $(#id)
b@1402: } else {
b@1402: elem = document.getElementById( match[2] );
b@1402:
b@1402: // Support: Blackberry 4.6
b@1402: // gEBID returns nodes no longer in the document (#6963)
b@1402: if ( elem && elem.parentNode ) {
b@1402: // Inject the element directly into the jQuery object
b@1402: this.length = 1;
b@1402: this[0] = elem;
b@1402: }
b@1402:
b@1402: this.context = document;
b@1402: this.selector = selector;
b@1402: return this;
b@1402: }
b@1402:
b@1402: // HANDLE: $(expr, $(...))
b@1402: } else if ( !context || context.jquery ) {
b@1402: return ( context || rootjQuery ).find( selector );
b@1402:
b@1402: // HANDLE: $(expr, context)
b@1402: // (which is just equivalent to: $(context).find(expr)
b@1402: } else {
b@1402: return this.constructor( context ).find( selector );
b@1402: }
b@1402:
b@1402: // HANDLE: $(DOMElement)
b@1402: } else if ( selector.nodeType ) {
b@1402: this.context = this[0] = selector;
b@1402: this.length = 1;
b@1402: return this;
b@1402:
b@1402: // HANDLE: $(function)
b@1402: // Shortcut for document ready
b@1402: } else if ( jQuery.isFunction( selector ) ) {
b@1402: return typeof rootjQuery.ready !== "undefined" ?
b@1402: rootjQuery.ready( selector ) :
b@1402: // Execute immediately if ready is not present
b@1402: selector( jQuery );
b@1402: }
b@1402:
b@1402: if ( selector.selector !== undefined ) {
b@1402: this.selector = selector.selector;
b@1402: this.context = selector.context;
b@1402: }
b@1402:
b@1402: return jQuery.makeArray( selector, this );
b@1402: };
b@1402:
b@1402: // Give the init function the jQuery prototype for later instantiation
b@1402: init.prototype = jQuery.fn;
b@1402:
b@1402: // Initialize central reference
b@1402: rootjQuery = jQuery( document );
b@1402:
b@1402:
b@1402: var rparentsprev = /^(?:parents|prev(?:Until|All))/,
b@1402: // Methods guaranteed to produce a unique set when starting from a unique set
b@1402: guaranteedUnique = {
b@1402: children: true,
b@1402: contents: true,
b@1402: next: true,
b@1402: prev: true
b@1402: };
b@1402:
b@1402: jQuery.extend({
b@1402: dir: function( elem, dir, until ) {
b@1402: var matched = [],
b@1402: truncate = until !== undefined;
b@1402:
b@1402: while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
b@1402: if ( elem.nodeType === 1 ) {
b@1402: if ( truncate && jQuery( elem ).is( until ) ) {
b@1402: break;
b@1402: }
b@1402: matched.push( elem );
b@1402: }
b@1402: }
b@1402: return matched;
b@1402: },
b@1402:
b@1402: sibling: function( n, elem ) {
b@1402: var matched = [];
b@1402:
b@1402: for ( ; n; n = n.nextSibling ) {
b@1402: if ( n.nodeType === 1 && n !== elem ) {
b@1402: matched.push( n );
b@1402: }
b@1402: }
b@1402:
b@1402: return matched;
b@1402: }
b@1402: });
b@1402:
b@1402: jQuery.fn.extend({
b@1402: has: function( target ) {
b@1402: var targets = jQuery( target, this ),
b@1402: l = targets.length;
b@1402:
b@1402: return this.filter(function() {
b@1402: var i = 0;
b@1402: for ( ; i < l; i++ ) {
b@1402: if ( jQuery.contains( this, targets[i] ) ) {
b@1402: return true;
b@1402: }
b@1402: }
b@1402: });
b@1402: },
b@1402:
b@1402: closest: function( selectors, context ) {
b@1402: var cur,
b@1402: i = 0,
b@1402: l = this.length,
b@1402: matched = [],
b@1402: pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
b@1402: jQuery( selectors, context || this.context ) :
b@1402: 0;
b@1402:
b@1402: for ( ; i < l; i++ ) {
b@1402: for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
b@1402: // Always skip document fragments
b@1402: if ( cur.nodeType < 11 && (pos ?
b@1402: pos.index(cur) > -1 :
b@1402:
b@1402: // Don't pass non-elements to Sizzle
b@1402: cur.nodeType === 1 &&
b@1402: jQuery.find.matchesSelector(cur, selectors)) ) {
b@1402:
b@1402: matched.push( cur );
b@1402: break;
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
b@1402: },
b@1402:
b@1402: // Determine the position of an element within the set
b@1402: index: function( elem ) {
b@1402:
b@1402: // No argument, return index in parent
b@1402: if ( !elem ) {
b@1402: return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
b@1402: }
b@1402:
b@1402: // Index in selector
b@1402: if ( typeof elem === "string" ) {
b@1402: return indexOf.call( jQuery( elem ), this[ 0 ] );
b@1402: }
b@1402:
b@1402: // Locate the position of the desired element
b@1402: return indexOf.call( this,
b@1402:
b@1402: // If it receives a jQuery object, the first element is used
b@1402: elem.jquery ? elem[ 0 ] : elem
b@1402: );
b@1402: },
b@1402:
b@1402: add: function( selector, context ) {
b@1402: return this.pushStack(
b@1402: jQuery.unique(
b@1402: jQuery.merge( this.get(), jQuery( selector, context ) )
b@1402: )
b@1402: );
b@1402: },
b@1402:
b@1402: addBack: function( selector ) {
b@1402: return this.add( selector == null ?
b@1402: this.prevObject : this.prevObject.filter(selector)
b@1402: );
b@1402: }
b@1402: });
b@1402:
b@1402: function sibling( cur, dir ) {
b@1402: while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
b@1402: return cur;
b@1402: }
b@1402:
b@1402: jQuery.each({
b@1402: parent: function( elem ) {
b@1402: var parent = elem.parentNode;
b@1402: return parent && parent.nodeType !== 11 ? parent : null;
b@1402: },
b@1402: parents: function( elem ) {
b@1402: return jQuery.dir( elem, "parentNode" );
b@1402: },
b@1402: parentsUntil: function( elem, i, until ) {
b@1402: return jQuery.dir( elem, "parentNode", until );
b@1402: },
b@1402: next: function( elem ) {
b@1402: return sibling( elem, "nextSibling" );
b@1402: },
b@1402: prev: function( elem ) {
b@1402: return sibling( elem, "previousSibling" );
b@1402: },
b@1402: nextAll: function( elem ) {
b@1402: return jQuery.dir( elem, "nextSibling" );
b@1402: },
b@1402: prevAll: function( elem ) {
b@1402: return jQuery.dir( elem, "previousSibling" );
b@1402: },
b@1402: nextUntil: function( elem, i, until ) {
b@1402: return jQuery.dir( elem, "nextSibling", until );
b@1402: },
b@1402: prevUntil: function( elem, i, until ) {
b@1402: return jQuery.dir( elem, "previousSibling", until );
b@1402: },
b@1402: siblings: function( elem ) {
b@1402: return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
b@1402: },
b@1402: children: function( elem ) {
b@1402: return jQuery.sibling( elem.firstChild );
b@1402: },
b@1402: contents: function( elem ) {
b@1402: return elem.contentDocument || jQuery.merge( [], elem.childNodes );
b@1402: }
b@1402: }, function( name, fn ) {
b@1402: jQuery.fn[ name ] = function( until, selector ) {
b@1402: var matched = jQuery.map( this, fn, until );
b@1402:
b@1402: if ( name.slice( -5 ) !== "Until" ) {
b@1402: selector = until;
b@1402: }
b@1402:
b@1402: if ( selector && typeof selector === "string" ) {
b@1402: matched = jQuery.filter( selector, matched );
b@1402: }
b@1402:
b@1402: if ( this.length > 1 ) {
b@1402: // Remove duplicates
b@1402: if ( !guaranteedUnique[ name ] ) {
b@1402: jQuery.unique( matched );
b@1402: }
b@1402:
b@1402: // Reverse order for parents* and prev-derivatives
b@1402: if ( rparentsprev.test( name ) ) {
b@1402: matched.reverse();
b@1402: }
b@1402: }
b@1402:
b@1402: return this.pushStack( matched );
b@1402: };
b@1402: });
b@1402: var rnotwhite = (/\S+/g);
b@1402:
b@1402:
b@1402:
b@1402: // String to Object options format cache
b@1402: var optionsCache = {};
b@1402:
b@1402: // Convert String-formatted options into Object-formatted ones and store in cache
b@1402: function createOptions( options ) {
b@1402: var object = optionsCache[ options ] = {};
b@1402: jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
b@1402: object[ flag ] = true;
b@1402: });
b@1402: return object;
b@1402: }
b@1402:
b@1402: /*
b@1402: * Create a callback list using the following parameters:
b@1402: *
b@1402: * options: an optional list of space-separated options that will change how
b@1402: * the callback list behaves or a more traditional option object
b@1402: *
b@1402: * By default a callback list will act like an event callback list and can be
b@1402: * "fired" multiple times.
b@1402: *
b@1402: * Possible options:
b@1402: *
b@1402: * once: will ensure the callback list can only be fired once (like a Deferred)
b@1402: *
b@1402: * memory: will keep track of previous values and will call any callback added
b@1402: * after the list has been fired right away with the latest "memorized"
b@1402: * values (like a Deferred)
b@1402: *
b@1402: * unique: will ensure a callback can only be added once (no duplicate in the list)
b@1402: *
b@1402: * stopOnFalse: interrupt callings when a callback returns false
b@1402: *
b@1402: */
b@1402: jQuery.Callbacks = function( options ) {
b@1402:
b@1402: // Convert options from String-formatted to Object-formatted if needed
b@1402: // (we check in cache first)
b@1402: options = typeof options === "string" ?
b@1402: ( optionsCache[ options ] || createOptions( options ) ) :
b@1402: jQuery.extend( {}, options );
b@1402:
b@1402: var // Last fire value (for non-forgettable lists)
b@1402: memory,
b@1402: // Flag to know if list was already fired
b@1402: fired,
b@1402: // Flag to know if list is currently firing
b@1402: firing,
b@1402: // First callback to fire (used internally by add and fireWith)
b@1402: firingStart,
b@1402: // End of the loop when firing
b@1402: firingLength,
b@1402: // Index of currently firing callback (modified by remove if needed)
b@1402: firingIndex,
b@1402: // Actual callback list
b@1402: list = [],
b@1402: // Stack of fire calls for repeatable lists
b@1402: stack = !options.once && [],
b@1402: // Fire callbacks
b@1402: fire = function( data ) {
b@1402: memory = options.memory && data;
b@1402: fired = true;
b@1402: firingIndex = firingStart || 0;
b@1402: firingStart = 0;
b@1402: firingLength = list.length;
b@1402: firing = true;
b@1402: for ( ; list && firingIndex < firingLength; firingIndex++ ) {
b@1402: if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
b@1402: memory = false; // To prevent further calls using add
b@1402: break;
b@1402: }
b@1402: }
b@1402: firing = false;
b@1402: if ( list ) {
b@1402: if ( stack ) {
b@1402: if ( stack.length ) {
b@1402: fire( stack.shift() );
b@1402: }
b@1402: } else if ( memory ) {
b@1402: list = [];
b@1402: } else {
b@1402: self.disable();
b@1402: }
b@1402: }
b@1402: },
b@1402: // Actual Callbacks object
b@1402: self = {
b@1402: // Add a callback or a collection of callbacks to the list
b@1402: add: function() {
b@1402: if ( list ) {
b@1402: // First, we save the current length
b@1402: var start = list.length;
b@1402: (function add( args ) {
b@1402: jQuery.each( args, function( _, arg ) {
b@1402: var type = jQuery.type( arg );
b@1402: if ( type === "function" ) {
b@1402: if ( !options.unique || !self.has( arg ) ) {
b@1402: list.push( arg );
b@1402: }
b@1402: } else if ( arg && arg.length && type !== "string" ) {
b@1402: // Inspect recursively
b@1402: add( arg );
b@1402: }
b@1402: });
b@1402: })( arguments );
b@1402: // Do we need to add the callbacks to the
b@1402: // current firing batch?
b@1402: if ( firing ) {
b@1402: firingLength = list.length;
b@1402: // With memory, if we're not firing then
b@1402: // we should call right away
b@1402: } else if ( memory ) {
b@1402: firingStart = start;
b@1402: fire( memory );
b@1402: }
b@1402: }
b@1402: return this;
b@1402: },
b@1402: // Remove a callback from the list
b@1402: remove: function() {
b@1402: if ( list ) {
b@1402: jQuery.each( arguments, function( _, arg ) {
b@1402: var index;
b@1402: while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
b@1402: list.splice( index, 1 );
b@1402: // Handle firing indexes
b@1402: if ( firing ) {
b@1402: if ( index <= firingLength ) {
b@1402: firingLength--;
b@1402: }
b@1402: if ( index <= firingIndex ) {
b@1402: firingIndex--;
b@1402: }
b@1402: }
b@1402: }
b@1402: });
b@1402: }
b@1402: return this;
b@1402: },
b@1402: // Check if a given callback is in the list.
b@1402: // If no argument is given, return whether or not list has callbacks attached.
b@1402: has: function( fn ) {
b@1402: return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
b@1402: },
b@1402: // Remove all callbacks from the list
b@1402: empty: function() {
b@1402: list = [];
b@1402: firingLength = 0;
b@1402: return this;
b@1402: },
b@1402: // Have the list do nothing anymore
b@1402: disable: function() {
b@1402: list = stack = memory = undefined;
b@1402: return this;
b@1402: },
b@1402: // Is it disabled?
b@1402: disabled: function() {
b@1402: return !list;
b@1402: },
b@1402: // Lock the list in its current state
b@1402: lock: function() {
b@1402: stack = undefined;
b@1402: if ( !memory ) {
b@1402: self.disable();
b@1402: }
b@1402: return this;
b@1402: },
b@1402: // Is it locked?
b@1402: locked: function() {
b@1402: return !stack;
b@1402: },
b@1402: // Call all callbacks with the given context and arguments
b@1402: fireWith: function( context, args ) {
b@1402: if ( list && ( !fired || stack ) ) {
b@1402: args = args || [];
b@1402: args = [ context, args.slice ? args.slice() : args ];
b@1402: if ( firing ) {
b@1402: stack.push( args );
b@1402: } else {
b@1402: fire( args );
b@1402: }
b@1402: }
b@1402: return this;
b@1402: },
b@1402: // Call all the callbacks with the given arguments
b@1402: fire: function() {
b@1402: self.fireWith( this, arguments );
b@1402: return this;
b@1402: },
b@1402: // To know if the callbacks have already been called at least once
b@1402: fired: function() {
b@1402: return !!fired;
b@1402: }
b@1402: };
b@1402:
b@1402: return self;
b@1402: };
b@1402:
b@1402:
b@1402: jQuery.extend({
b@1402:
b@1402: Deferred: function( func ) {
b@1402: var tuples = [
b@1402: // action, add listener, listener list, final state
b@1402: [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
b@1402: [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
b@1402: [ "notify", "progress", jQuery.Callbacks("memory") ]
b@1402: ],
b@1402: state = "pending",
b@1402: promise = {
b@1402: state: function() {
b@1402: return state;
b@1402: },
b@1402: always: function() {
b@1402: deferred.done( arguments ).fail( arguments );
b@1402: return this;
b@1402: },
b@1402: then: function( /* fnDone, fnFail, fnProgress */ ) {
b@1402: var fns = arguments;
b@1402: return jQuery.Deferred(function( newDefer ) {
b@1402: jQuery.each( tuples, function( i, tuple ) {
b@1402: var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
b@1402: // deferred[ done | fail | progress ] for forwarding actions to newDefer
b@1402: deferred[ tuple[1] ](function() {
b@1402: var returned = fn && fn.apply( this, arguments );
b@1402: if ( returned && jQuery.isFunction( returned.promise ) ) {
b@1402: returned.promise()
b@1402: .done( newDefer.resolve )
b@1402: .fail( newDefer.reject )
b@1402: .progress( newDefer.notify );
b@1402: } else {
b@1402: newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
b@1402: }
b@1402: });
b@1402: });
b@1402: fns = null;
b@1402: }).promise();
b@1402: },
b@1402: // Get a promise for this deferred
b@1402: // If obj is provided, the promise aspect is added to the object
b@1402: promise: function( obj ) {
b@1402: return obj != null ? jQuery.extend( obj, promise ) : promise;
b@1402: }
b@1402: },
b@1402: deferred = {};
b@1402:
b@1402: // Keep pipe for back-compat
b@1402: promise.pipe = promise.then;
b@1402:
b@1402: // Add list-specific methods
b@1402: jQuery.each( tuples, function( i, tuple ) {
b@1402: var list = tuple[ 2 ],
b@1402: stateString = tuple[ 3 ];
b@1402:
b@1402: // promise[ done | fail | progress ] = list.add
b@1402: promise[ tuple[1] ] = list.add;
b@1402:
b@1402: // Handle state
b@1402: if ( stateString ) {
b@1402: list.add(function() {
b@1402: // state = [ resolved | rejected ]
b@1402: state = stateString;
b@1402:
b@1402: // [ reject_list | resolve_list ].disable; progress_list.lock
b@1402: }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
b@1402: }
b@1402:
b@1402: // deferred[ resolve | reject | notify ]
b@1402: deferred[ tuple[0] ] = function() {
b@1402: deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
b@1402: return this;
b@1402: };
b@1402: deferred[ tuple[0] + "With" ] = list.fireWith;
b@1402: });
b@1402:
b@1402: // Make the deferred a promise
b@1402: promise.promise( deferred );
b@1402:
b@1402: // Call given func if any
b@1402: if ( func ) {
b@1402: func.call( deferred, deferred );
b@1402: }
b@1402:
b@1402: // All done!
b@1402: return deferred;
b@1402: },
b@1402:
b@1402: // Deferred helper
b@1402: when: function( subordinate /* , ..., subordinateN */ ) {
b@1402: var i = 0,
b@1402: resolveValues = slice.call( arguments ),
b@1402: length = resolveValues.length,
b@1402:
b@1402: // the count of uncompleted subordinates
b@1402: remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
b@1402:
b@1402: // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
b@1402: deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
b@1402:
b@1402: // Update function for both resolve and progress values
b@1402: updateFunc = function( i, contexts, values ) {
b@1402: return function( value ) {
b@1402: contexts[ i ] = this;
b@1402: values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
b@1402: if ( values === progressValues ) {
b@1402: deferred.notifyWith( contexts, values );
b@1402: } else if ( !( --remaining ) ) {
b@1402: deferred.resolveWith( contexts, values );
b@1402: }
b@1402: };
b@1402: },
b@1402:
b@1402: progressValues, progressContexts, resolveContexts;
b@1402:
b@1402: // Add listeners to Deferred subordinates; treat others as resolved
b@1402: if ( length > 1 ) {
b@1402: progressValues = new Array( length );
b@1402: progressContexts = new Array( length );
b@1402: resolveContexts = new Array( length );
b@1402: for ( ; i < length; i++ ) {
b@1402: if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
b@1402: resolveValues[ i ].promise()
b@1402: .done( updateFunc( i, resolveContexts, resolveValues ) )
b@1402: .fail( deferred.reject )
b@1402: .progress( updateFunc( i, progressContexts, progressValues ) );
b@1402: } else {
b@1402: --remaining;
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // If we're not waiting on anything, resolve the master
b@1402: if ( !remaining ) {
b@1402: deferred.resolveWith( resolveContexts, resolveValues );
b@1402: }
b@1402:
b@1402: return deferred.promise();
b@1402: }
b@1402: });
b@1402:
b@1402:
b@1402: // The deferred used on DOM ready
b@1402: var readyList;
b@1402:
b@1402: jQuery.fn.ready = function( fn ) {
b@1402: // Add the callback
b@1402: jQuery.ready.promise().done( fn );
b@1402:
b@1402: return this;
b@1402: };
b@1402:
b@1402: jQuery.extend({
b@1402: // Is the DOM ready to be used? Set to true once it occurs.
b@1402: isReady: false,
b@1402:
b@1402: // A counter to track how many items to wait for before
b@1402: // the ready event fires. See #6781
b@1402: readyWait: 1,
b@1402:
b@1402: // Hold (or release) the ready event
b@1402: holdReady: function( hold ) {
b@1402: if ( hold ) {
b@1402: jQuery.readyWait++;
b@1402: } else {
b@1402: jQuery.ready( true );
b@1402: }
b@1402: },
b@1402:
b@1402: // Handle when the DOM is ready
b@1402: ready: function( wait ) {
b@1402:
b@1402: // Abort if there are pending holds or we're already ready
b@1402: if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
b@1402: return;
b@1402: }
b@1402:
b@1402: // Remember that the DOM is ready
b@1402: jQuery.isReady = true;
b@1402:
b@1402: // If a normal DOM Ready event fired, decrement, and wait if need be
b@1402: if ( wait !== true && --jQuery.readyWait > 0 ) {
b@1402: return;
b@1402: }
b@1402:
b@1402: // If there are functions bound, to execute
b@1402: readyList.resolveWith( document, [ jQuery ] );
b@1402:
b@1402: // Trigger any bound ready events
b@1402: if ( jQuery.fn.triggerHandler ) {
b@1402: jQuery( document ).triggerHandler( "ready" );
b@1402: jQuery( document ).off( "ready" );
b@1402: }
b@1402: }
b@1402: });
b@1402:
b@1402: /**
b@1402: * The ready event handler and self cleanup method
b@1402: */
b@1402: function completed() {
b@1402: document.removeEventListener( "DOMContentLoaded", completed, false );
b@1402: window.removeEventListener( "load", completed, false );
b@1402: jQuery.ready();
b@1402: }
b@1402:
b@1402: jQuery.ready.promise = function( obj ) {
b@1402: if ( !readyList ) {
b@1402:
b@1402: readyList = jQuery.Deferred();
b@1402:
b@1402: // Catch cases where $(document).ready() is called after the browser event has already occurred.
b@1402: // We once tried to use readyState "interactive" here, but it caused issues like the one
b@1402: // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
b@1402: if ( document.readyState === "complete" ) {
b@1402: // Handle it asynchronously to allow scripts the opportunity to delay ready
b@1402: setTimeout( jQuery.ready );
b@1402:
b@1402: } else {
b@1402:
b@1402: // Use the handy event callback
b@1402: document.addEventListener( "DOMContentLoaded", completed, false );
b@1402:
b@1402: // A fallback to window.onload, that will always work
b@1402: window.addEventListener( "load", completed, false );
b@1402: }
b@1402: }
b@1402: return readyList.promise( obj );
b@1402: };
b@1402:
b@1402: // Kick off the DOM ready check even if the user does not
b@1402: jQuery.ready.promise();
b@1402:
b@1402:
b@1402:
b@1402:
b@1402: // Multifunctional method to get and set values of a collection
b@1402: // The value/s can optionally be executed if it's a function
b@1402: var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
b@1402: var i = 0,
b@1402: len = elems.length,
b@1402: bulk = key == null;
b@1402:
b@1402: // Sets many values
b@1402: if ( jQuery.type( key ) === "object" ) {
b@1402: chainable = true;
b@1402: for ( i in key ) {
b@1402: jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
b@1402: }
b@1402:
b@1402: // Sets one value
b@1402: } else if ( value !== undefined ) {
b@1402: chainable = true;
b@1402:
b@1402: if ( !jQuery.isFunction( value ) ) {
b@1402: raw = true;
b@1402: }
b@1402:
b@1402: if ( bulk ) {
b@1402: // Bulk operations run against the entire set
b@1402: if ( raw ) {
b@1402: fn.call( elems, value );
b@1402: fn = null;
b@1402:
b@1402: // ...except when executing function values
b@1402: } else {
b@1402: bulk = fn;
b@1402: fn = function( elem, key, value ) {
b@1402: return bulk.call( jQuery( elem ), value );
b@1402: };
b@1402: }
b@1402: }
b@1402:
b@1402: if ( fn ) {
b@1402: for ( ; i < len; i++ ) {
b@1402: fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: return chainable ?
b@1402: elems :
b@1402:
b@1402: // Gets
b@1402: bulk ?
b@1402: fn.call( elems ) :
b@1402: len ? fn( elems[0], key ) : emptyGet;
b@1402: };
b@1402:
b@1402:
b@1402: /**
b@1402: * Determines whether an object can have data
b@1402: */
b@1402: jQuery.acceptData = function( owner ) {
b@1402: // Accepts only:
b@1402: // - Node
b@1402: // - Node.ELEMENT_NODE
b@1402: // - Node.DOCUMENT_NODE
b@1402: // - Object
b@1402: // - Any
b@1402: /* jshint -W018 */
b@1402: return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
b@1402: };
b@1402:
b@1402:
b@1402: function Data() {
b@1402: // Support: Android<4,
b@1402: // Old WebKit does not have Object.preventExtensions/freeze method,
b@1402: // return new empty object instead with no [[set]] accessor
b@1402: Object.defineProperty( this.cache = {}, 0, {
b@1402: get: function() {
b@1402: return {};
b@1402: }
b@1402: });
b@1402:
b@1402: this.expando = jQuery.expando + Data.uid++;
b@1402: }
b@1402:
b@1402: Data.uid = 1;
b@1402: Data.accepts = jQuery.acceptData;
b@1402:
b@1402: Data.prototype = {
b@1402: key: function( owner ) {
b@1402: // We can accept data for non-element nodes in modern browsers,
b@1402: // but we should not, see #8335.
b@1402: // Always return the key for a frozen object.
b@1402: if ( !Data.accepts( owner ) ) {
b@1402: return 0;
b@1402: }
b@1402:
b@1402: var descriptor = {},
b@1402: // Check if the owner object already has a cache key
b@1402: unlock = owner[ this.expando ];
b@1402:
b@1402: // If not, create one
b@1402: if ( !unlock ) {
b@1402: unlock = Data.uid++;
b@1402:
b@1402: // Secure it in a non-enumerable, non-writable property
b@1402: try {
b@1402: descriptor[ this.expando ] = { value: unlock };
b@1402: Object.defineProperties( owner, descriptor );
b@1402:
b@1402: // Support: Android<4
b@1402: // Fallback to a less secure definition
b@1402: } catch ( e ) {
b@1402: descriptor[ this.expando ] = unlock;
b@1402: jQuery.extend( owner, descriptor );
b@1402: }
b@1402: }
b@1402:
b@1402: // Ensure the cache object
b@1402: if ( !this.cache[ unlock ] ) {
b@1402: this.cache[ unlock ] = {};
b@1402: }
b@1402:
b@1402: return unlock;
b@1402: },
b@1402: set: function( owner, data, value ) {
b@1402: var prop,
b@1402: // There may be an unlock assigned to this node,
b@1402: // if there is no entry for this "owner", create one inline
b@1402: // and set the unlock as though an owner entry had always existed
b@1402: unlock = this.key( owner ),
b@1402: cache = this.cache[ unlock ];
b@1402:
b@1402: // Handle: [ owner, key, value ] args
b@1402: if ( typeof data === "string" ) {
b@1402: cache[ data ] = value;
b@1402:
b@1402: // Handle: [ owner, { properties } ] args
b@1402: } else {
b@1402: // Fresh assignments by object are shallow copied
b@1402: if ( jQuery.isEmptyObject( cache ) ) {
b@1402: jQuery.extend( this.cache[ unlock ], data );
b@1402: // Otherwise, copy the properties one-by-one to the cache object
b@1402: } else {
b@1402: for ( prop in data ) {
b@1402: cache[ prop ] = data[ prop ];
b@1402: }
b@1402: }
b@1402: }
b@1402: return cache;
b@1402: },
b@1402: get: function( owner, key ) {
b@1402: // Either a valid cache is found, or will be created.
b@1402: // New caches will be created and the unlock returned,
b@1402: // allowing direct access to the newly created
b@1402: // empty data object. A valid owner object must be provided.
b@1402: var cache = this.cache[ this.key( owner ) ];
b@1402:
b@1402: return key === undefined ?
b@1402: cache : cache[ key ];
b@1402: },
b@1402: access: function( owner, key, value ) {
b@1402: var stored;
b@1402: // In cases where either:
b@1402: //
b@1402: // 1. No key was specified
b@1402: // 2. A string key was specified, but no value provided
b@1402: //
b@1402: // Take the "read" path and allow the get method to determine
b@1402: // which value to return, respectively either:
b@1402: //
b@1402: // 1. The entire cache object
b@1402: // 2. The data stored at the key
b@1402: //
b@1402: if ( key === undefined ||
b@1402: ((key && typeof key === "string") && value === undefined) ) {
b@1402:
b@1402: stored = this.get( owner, key );
b@1402:
b@1402: return stored !== undefined ?
b@1402: stored : this.get( owner, jQuery.camelCase(key) );
b@1402: }
b@1402:
b@1402: // [*]When the key is not a string, or both a key and value
b@1402: // are specified, set or extend (existing objects) with either:
b@1402: //
b@1402: // 1. An object of properties
b@1402: // 2. A key and value
b@1402: //
b@1402: this.set( owner, key, value );
b@1402:
b@1402: // Since the "set" path can have two possible entry points
b@1402: // return the expected data based on which path was taken[*]
b@1402: return value !== undefined ? value : key;
b@1402: },
b@1402: remove: function( owner, key ) {
b@1402: var i, name, camel,
b@1402: unlock = this.key( owner ),
b@1402: cache = this.cache[ unlock ];
b@1402:
b@1402: if ( key === undefined ) {
b@1402: this.cache[ unlock ] = {};
b@1402:
b@1402: } else {
b@1402: // Support array or space separated string of keys
b@1402: if ( jQuery.isArray( key ) ) {
b@1402: // If "name" is an array of keys...
b@1402: // When data is initially created, via ("key", "val") signature,
b@1402: // keys will be converted to camelCase.
b@1402: // Since there is no way to tell _how_ a key was added, remove
b@1402: // both plain key and camelCase key. #12786
b@1402: // This will only penalize the array argument path.
b@1402: name = key.concat( key.map( jQuery.camelCase ) );
b@1402: } else {
b@1402: camel = jQuery.camelCase( key );
b@1402: // Try the string as a key before any manipulation
b@1402: if ( key in cache ) {
b@1402: name = [ key, camel ];
b@1402: } else {
b@1402: // If a key with the spaces exists, use it.
b@1402: // Otherwise, create an array by matching non-whitespace
b@1402: name = camel;
b@1402: name = name in cache ?
b@1402: [ name ] : ( name.match( rnotwhite ) || [] );
b@1402: }
b@1402: }
b@1402:
b@1402: i = name.length;
b@1402: while ( i-- ) {
b@1402: delete cache[ name[ i ] ];
b@1402: }
b@1402: }
b@1402: },
b@1402: hasData: function( owner ) {
b@1402: return !jQuery.isEmptyObject(
b@1402: this.cache[ owner[ this.expando ] ] || {}
b@1402: );
b@1402: },
b@1402: discard: function( owner ) {
b@1402: if ( owner[ this.expando ] ) {
b@1402: delete this.cache[ owner[ this.expando ] ];
b@1402: }
b@1402: }
b@1402: };
b@1402: var data_priv = new Data();
b@1402:
b@1402: var data_user = new Data();
b@1402:
b@1402:
b@1402:
b@1402: // Implementation Summary
b@1402: //
b@1402: // 1. Enforce API surface and semantic compatibility with 1.9.x branch
b@1402: // 2. Improve the module's maintainability by reducing the storage
b@1402: // paths to a single mechanism.
b@1402: // 3. Use the same single mechanism to support "private" and "user" data.
b@1402: // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
b@1402: // 5. Avoid exposing implementation details on user objects (eg. expando properties)
b@1402: // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
b@1402:
b@1402: var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
b@1402: rmultiDash = /([A-Z])/g;
b@1402:
b@1402: function dataAttr( elem, key, data ) {
b@1402: var name;
b@1402:
b@1402: // If nothing was found internally, try to fetch any
b@1402: // data from the HTML5 data-* attribute
b@1402: if ( data === undefined && elem.nodeType === 1 ) {
b@1402: name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
b@1402: data = elem.getAttribute( name );
b@1402:
b@1402: if ( typeof data === "string" ) {
b@1402: try {
b@1402: data = data === "true" ? true :
b@1402: data === "false" ? false :
b@1402: data === "null" ? null :
b@1402: // Only convert to a number if it doesn't change the string
b@1402: +data + "" === data ? +data :
b@1402: rbrace.test( data ) ? jQuery.parseJSON( data ) :
b@1402: data;
b@1402: } catch( e ) {}
b@1402:
b@1402: // Make sure we set the data so it isn't changed later
b@1402: data_user.set( elem, key, data );
b@1402: } else {
b@1402: data = undefined;
b@1402: }
b@1402: }
b@1402: return data;
b@1402: }
b@1402:
b@1402: jQuery.extend({
b@1402: hasData: function( elem ) {
b@1402: return data_user.hasData( elem ) || data_priv.hasData( elem );
b@1402: },
b@1402:
b@1402: data: function( elem, name, data ) {
b@1402: return data_user.access( elem, name, data );
b@1402: },
b@1402:
b@1402: removeData: function( elem, name ) {
b@1402: data_user.remove( elem, name );
b@1402: },
b@1402:
b@1402: // TODO: Now that all calls to _data and _removeData have been replaced
b@1402: // with direct calls to data_priv methods, these can be deprecated.
b@1402: _data: function( elem, name, data ) {
b@1402: return data_priv.access( elem, name, data );
b@1402: },
b@1402:
b@1402: _removeData: function( elem, name ) {
b@1402: data_priv.remove( elem, name );
b@1402: }
b@1402: });
b@1402:
b@1402: jQuery.fn.extend({
b@1402: data: function( key, value ) {
b@1402: var i, name, data,
b@1402: elem = this[ 0 ],
b@1402: attrs = elem && elem.attributes;
b@1402:
b@1402: // Gets all values
b@1402: if ( key === undefined ) {
b@1402: if ( this.length ) {
b@1402: data = data_user.get( elem );
b@1402:
b@1402: if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
b@1402: i = attrs.length;
b@1402: while ( i-- ) {
b@1402:
b@1402: // Support: IE11+
b@1402: // The attrs elements can be null (#14894)
b@1402: if ( attrs[ i ] ) {
b@1402: name = attrs[ i ].name;
b@1402: if ( name.indexOf( "data-" ) === 0 ) {
b@1402: name = jQuery.camelCase( name.slice(5) );
b@1402: dataAttr( elem, name, data[ name ] );
b@1402: }
b@1402: }
b@1402: }
b@1402: data_priv.set( elem, "hasDataAttrs", true );
b@1402: }
b@1402: }
b@1402:
b@1402: return data;
b@1402: }
b@1402:
b@1402: // Sets multiple values
b@1402: if ( typeof key === "object" ) {
b@1402: return this.each(function() {
b@1402: data_user.set( this, key );
b@1402: });
b@1402: }
b@1402:
b@1402: return access( this, function( value ) {
b@1402: var data,
b@1402: camelKey = jQuery.camelCase( key );
b@1402:
b@1402: // The calling jQuery object (element matches) is not empty
b@1402: // (and therefore has an element appears at this[ 0 ]) and the
b@1402: // `value` parameter was not undefined. An empty jQuery object
b@1402: // will result in `undefined` for elem = this[ 0 ] which will
b@1402: // throw an exception if an attempt to read a data cache is made.
b@1402: if ( elem && value === undefined ) {
b@1402: // Attempt to get data from the cache
b@1402: // with the key as-is
b@1402: data = data_user.get( elem, key );
b@1402: if ( data !== undefined ) {
b@1402: return data;
b@1402: }
b@1402:
b@1402: // Attempt to get data from the cache
b@1402: // with the key camelized
b@1402: data = data_user.get( elem, camelKey );
b@1402: if ( data !== undefined ) {
b@1402: return data;
b@1402: }
b@1402:
b@1402: // Attempt to "discover" the data in
b@1402: // HTML5 custom data-* attrs
b@1402: data = dataAttr( elem, camelKey, undefined );
b@1402: if ( data !== undefined ) {
b@1402: return data;
b@1402: }
b@1402:
b@1402: // We tried really hard, but the data doesn't exist.
b@1402: return;
b@1402: }
b@1402:
b@1402: // Set the data...
b@1402: this.each(function() {
b@1402: // First, attempt to store a copy or reference of any
b@1402: // data that might've been store with a camelCased key.
b@1402: var data = data_user.get( this, camelKey );
b@1402:
b@1402: // For HTML5 data-* attribute interop, we have to
b@1402: // store property names with dashes in a camelCase form.
b@1402: // This might not apply to all properties...*
b@1402: data_user.set( this, camelKey, value );
b@1402:
b@1402: // *... In the case of properties that might _actually_
b@1402: // have dashes, we need to also store a copy of that
b@1402: // unchanged property.
b@1402: if ( key.indexOf("-") !== -1 && data !== undefined ) {
b@1402: data_user.set( this, key, value );
b@1402: }
b@1402: });
b@1402: }, null, value, arguments.length > 1, null, true );
b@1402: },
b@1402:
b@1402: removeData: function( key ) {
b@1402: return this.each(function() {
b@1402: data_user.remove( this, key );
b@1402: });
b@1402: }
b@1402: });
b@1402:
b@1402:
b@1402: jQuery.extend({
b@1402: queue: function( elem, type, data ) {
b@1402: var queue;
b@1402:
b@1402: if ( elem ) {
b@1402: type = ( type || "fx" ) + "queue";
b@1402: queue = data_priv.get( elem, type );
b@1402:
b@1402: // Speed up dequeue by getting out quickly if this is just a lookup
b@1402: if ( data ) {
b@1402: if ( !queue || jQuery.isArray( data ) ) {
b@1402: queue = data_priv.access( elem, type, jQuery.makeArray(data) );
b@1402: } else {
b@1402: queue.push( data );
b@1402: }
b@1402: }
b@1402: return queue || [];
b@1402: }
b@1402: },
b@1402:
b@1402: dequeue: function( elem, type ) {
b@1402: type = type || "fx";
b@1402:
b@1402: var queue = jQuery.queue( elem, type ),
b@1402: startLength = queue.length,
b@1402: fn = queue.shift(),
b@1402: hooks = jQuery._queueHooks( elem, type ),
b@1402: next = function() {
b@1402: jQuery.dequeue( elem, type );
b@1402: };
b@1402:
b@1402: // If the fx queue is dequeued, always remove the progress sentinel
b@1402: if ( fn === "inprogress" ) {
b@1402: fn = queue.shift();
b@1402: startLength--;
b@1402: }
b@1402:
b@1402: if ( fn ) {
b@1402:
b@1402: // Add a progress sentinel to prevent the fx queue from being
b@1402: // automatically dequeued
b@1402: if ( type === "fx" ) {
b@1402: queue.unshift( "inprogress" );
b@1402: }
b@1402:
b@1402: // Clear up the last queue stop function
b@1402: delete hooks.stop;
b@1402: fn.call( elem, next, hooks );
b@1402: }
b@1402:
b@1402: if ( !startLength && hooks ) {
b@1402: hooks.empty.fire();
b@1402: }
b@1402: },
b@1402:
b@1402: // Not public - generate a queueHooks object, or return the current one
b@1402: _queueHooks: function( elem, type ) {
b@1402: var key = type + "queueHooks";
b@1402: return data_priv.get( elem, key ) || data_priv.access( elem, key, {
b@1402: empty: jQuery.Callbacks("once memory").add(function() {
b@1402: data_priv.remove( elem, [ type + "queue", key ] );
b@1402: })
b@1402: });
b@1402: }
b@1402: });
b@1402:
b@1402: jQuery.fn.extend({
b@1402: queue: function( type, data ) {
b@1402: var setter = 2;
b@1402:
b@1402: if ( typeof type !== "string" ) {
b@1402: data = type;
b@1402: type = "fx";
b@1402: setter--;
b@1402: }
b@1402:
b@1402: if ( arguments.length < setter ) {
b@1402: return jQuery.queue( this[0], type );
b@1402: }
b@1402:
b@1402: return data === undefined ?
b@1402: this :
b@1402: this.each(function() {
b@1402: var queue = jQuery.queue( this, type, data );
b@1402:
b@1402: // Ensure a hooks for this queue
b@1402: jQuery._queueHooks( this, type );
b@1402:
b@1402: if ( type === "fx" && queue[0] !== "inprogress" ) {
b@1402: jQuery.dequeue( this, type );
b@1402: }
b@1402: });
b@1402: },
b@1402: dequeue: function( type ) {
b@1402: return this.each(function() {
b@1402: jQuery.dequeue( this, type );
b@1402: });
b@1402: },
b@1402: clearQueue: function( type ) {
b@1402: return this.queue( type || "fx", [] );
b@1402: },
b@1402: // Get a promise resolved when queues of a certain type
b@1402: // are emptied (fx is the type by default)
b@1402: promise: function( type, obj ) {
b@1402: var tmp,
b@1402: count = 1,
b@1402: defer = jQuery.Deferred(),
b@1402: elements = this,
b@1402: i = this.length,
b@1402: resolve = function() {
b@1402: if ( !( --count ) ) {
b@1402: defer.resolveWith( elements, [ elements ] );
b@1402: }
b@1402: };
b@1402:
b@1402: if ( typeof type !== "string" ) {
b@1402: obj = type;
b@1402: type = undefined;
b@1402: }
b@1402: type = type || "fx";
b@1402:
b@1402: while ( i-- ) {
b@1402: tmp = data_priv.get( elements[ i ], type + "queueHooks" );
b@1402: if ( tmp && tmp.empty ) {
b@1402: count++;
b@1402: tmp.empty.add( resolve );
b@1402: }
b@1402: }
b@1402: resolve();
b@1402: return defer.promise( obj );
b@1402: }
b@1402: });
b@1402: var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
b@1402:
b@1402: var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
b@1402:
b@1402: var isHidden = function( elem, el ) {
b@1402: // isHidden might be called from jQuery#filter function;
b@1402: // in that case, element will be second argument
b@1402: elem = el || elem;
b@1402: return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
b@1402: };
b@1402:
b@1402: var rcheckableType = (/^(?:checkbox|radio)$/i);
b@1402:
b@1402:
b@1402:
b@1402: (function() {
b@1402: var fragment = document.createDocumentFragment(),
b@1402: div = fragment.appendChild( document.createElement( "div" ) ),
b@1402: input = document.createElement( "input" );
b@1402:
b@1402: // Support: Safari<=5.1
b@1402: // Check state lost if the name is set (#11217)
b@1402: // Support: Windows Web Apps (WWA)
b@1402: // `name` and `type` must use .setAttribute for WWA (#14901)
b@1402: input.setAttribute( "type", "radio" );
b@1402: input.setAttribute( "checked", "checked" );
b@1402: input.setAttribute( "name", "t" );
b@1402:
b@1402: div.appendChild( input );
b@1402:
b@1402: // Support: Safari<=5.1, Android<4.2
b@1402: // Older WebKit doesn't clone checked state correctly in fragments
b@1402: support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
b@1402:
b@1402: // Support: IE<=11+
b@1402: // Make sure textarea (and checkbox) defaultValue is properly cloned
b@1402: div.innerHTML = "";
b@1402: support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
b@1402: })();
b@1402: var strundefined = typeof undefined;
b@1402:
b@1402:
b@1402:
b@1402: support.focusinBubbles = "onfocusin" in window;
b@1402:
b@1402:
b@1402: var
b@1402: rkeyEvent = /^key/,
b@1402: rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
b@1402: rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
b@1402: rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
b@1402:
b@1402: function returnTrue() {
b@1402: return true;
b@1402: }
b@1402:
b@1402: function returnFalse() {
b@1402: return false;
b@1402: }
b@1402:
b@1402: function safeActiveElement() {
b@1402: try {
b@1402: return document.activeElement;
b@1402: } catch ( err ) { }
b@1402: }
b@1402:
b@1402: /*
b@1402: * Helper functions for managing events -- not part of the public interface.
b@1402: * Props to Dean Edwards' addEvent library for many of the ideas.
b@1402: */
b@1402: jQuery.event = {
b@1402:
b@1402: global: {},
b@1402:
b@1402: add: function( elem, types, handler, data, selector ) {
b@1402:
b@1402: var handleObjIn, eventHandle, tmp,
b@1402: events, t, handleObj,
b@1402: special, handlers, type, namespaces, origType,
b@1402: elemData = data_priv.get( elem );
b@1402:
b@1402: // Don't attach events to noData or text/comment nodes (but allow plain objects)
b@1402: if ( !elemData ) {
b@1402: return;
b@1402: }
b@1402:
b@1402: // Caller can pass in an object of custom data in lieu of the handler
b@1402: if ( handler.handler ) {
b@1402: handleObjIn = handler;
b@1402: handler = handleObjIn.handler;
b@1402: selector = handleObjIn.selector;
b@1402: }
b@1402:
b@1402: // Make sure that the handler has a unique ID, used to find/remove it later
b@1402: if ( !handler.guid ) {
b@1402: handler.guid = jQuery.guid++;
b@1402: }
b@1402:
b@1402: // Init the element's event structure and main handler, if this is the first
b@1402: if ( !(events = elemData.events) ) {
b@1402: events = elemData.events = {};
b@1402: }
b@1402: if ( !(eventHandle = elemData.handle) ) {
b@1402: eventHandle = elemData.handle = function( e ) {
b@1402: // Discard the second event of a jQuery.event.trigger() and
b@1402: // when an event is called after a page has unloaded
b@1402: return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
b@1402: jQuery.event.dispatch.apply( elem, arguments ) : undefined;
b@1402: };
b@1402: }
b@1402:
b@1402: // Handle multiple events separated by a space
b@1402: types = ( types || "" ).match( rnotwhite ) || [ "" ];
b@1402: t = types.length;
b@1402: while ( t-- ) {
b@1402: tmp = rtypenamespace.exec( types[t] ) || [];
b@1402: type = origType = tmp[1];
b@1402: namespaces = ( tmp[2] || "" ).split( "." ).sort();
b@1402:
b@1402: // There *must* be a type, no attaching namespace-only handlers
b@1402: if ( !type ) {
b@1402: continue;
b@1402: }
b@1402:
b@1402: // If event changes its type, use the special event handlers for the changed type
b@1402: special = jQuery.event.special[ type ] || {};
b@1402:
b@1402: // If selector defined, determine special event api type, otherwise given type
b@1402: type = ( selector ? special.delegateType : special.bindType ) || type;
b@1402:
b@1402: // Update special based on newly reset type
b@1402: special = jQuery.event.special[ type ] || {};
b@1402:
b@1402: // handleObj is passed to all event handlers
b@1402: handleObj = jQuery.extend({
b@1402: type: type,
b@1402: origType: origType,
b@1402: data: data,
b@1402: handler: handler,
b@1402: guid: handler.guid,
b@1402: selector: selector,
b@1402: needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
b@1402: namespace: namespaces.join(".")
b@1402: }, handleObjIn );
b@1402:
b@1402: // Init the event handler queue if we're the first
b@1402: if ( !(handlers = events[ type ]) ) {
b@1402: handlers = events[ type ] = [];
b@1402: handlers.delegateCount = 0;
b@1402:
b@1402: // Only use addEventListener if the special events handler returns false
b@1402: if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
b@1402: if ( elem.addEventListener ) {
b@1402: elem.addEventListener( type, eventHandle, false );
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: if ( special.add ) {
b@1402: special.add.call( elem, handleObj );
b@1402:
b@1402: if ( !handleObj.handler.guid ) {
b@1402: handleObj.handler.guid = handler.guid;
b@1402: }
b@1402: }
b@1402:
b@1402: // Add to the element's handler list, delegates in front
b@1402: if ( selector ) {
b@1402: handlers.splice( handlers.delegateCount++, 0, handleObj );
b@1402: } else {
b@1402: handlers.push( handleObj );
b@1402: }
b@1402:
b@1402: // Keep track of which events have ever been used, for event optimization
b@1402: jQuery.event.global[ type ] = true;
b@1402: }
b@1402:
b@1402: },
b@1402:
b@1402: // Detach an event or set of events from an element
b@1402: remove: function( elem, types, handler, selector, mappedTypes ) {
b@1402:
b@1402: var j, origCount, tmp,
b@1402: events, t, handleObj,
b@1402: special, handlers, type, namespaces, origType,
b@1402: elemData = data_priv.hasData( elem ) && data_priv.get( elem );
b@1402:
b@1402: if ( !elemData || !(events = elemData.events) ) {
b@1402: return;
b@1402: }
b@1402:
b@1402: // Once for each type.namespace in types; type may be omitted
b@1402: types = ( types || "" ).match( rnotwhite ) || [ "" ];
b@1402: t = types.length;
b@1402: while ( t-- ) {
b@1402: tmp = rtypenamespace.exec( types[t] ) || [];
b@1402: type = origType = tmp[1];
b@1402: namespaces = ( tmp[2] || "" ).split( "." ).sort();
b@1402:
b@1402: // Unbind all events (on this namespace, if provided) for the element
b@1402: if ( !type ) {
b@1402: for ( type in events ) {
b@1402: jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
b@1402: }
b@1402: continue;
b@1402: }
b@1402:
b@1402: special = jQuery.event.special[ type ] || {};
b@1402: type = ( selector ? special.delegateType : special.bindType ) || type;
b@1402: handlers = events[ type ] || [];
b@1402: tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
b@1402:
b@1402: // Remove matching events
b@1402: origCount = j = handlers.length;
b@1402: while ( j-- ) {
b@1402: handleObj = handlers[ j ];
b@1402:
b@1402: if ( ( mappedTypes || origType === handleObj.origType ) &&
b@1402: ( !handler || handler.guid === handleObj.guid ) &&
b@1402: ( !tmp || tmp.test( handleObj.namespace ) ) &&
b@1402: ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
b@1402: handlers.splice( j, 1 );
b@1402:
b@1402: if ( handleObj.selector ) {
b@1402: handlers.delegateCount--;
b@1402: }
b@1402: if ( special.remove ) {
b@1402: special.remove.call( elem, handleObj );
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // Remove generic event handler if we removed something and no more handlers exist
b@1402: // (avoids potential for endless recursion during removal of special event handlers)
b@1402: if ( origCount && !handlers.length ) {
b@1402: if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
b@1402: jQuery.removeEvent( elem, type, elemData.handle );
b@1402: }
b@1402:
b@1402: delete events[ type ];
b@1402: }
b@1402: }
b@1402:
b@1402: // Remove the expando if it's no longer used
b@1402: if ( jQuery.isEmptyObject( events ) ) {
b@1402: delete elemData.handle;
b@1402: data_priv.remove( elem, "events" );
b@1402: }
b@1402: },
b@1402:
b@1402: trigger: function( event, data, elem, onlyHandlers ) {
b@1402:
b@1402: var i, cur, tmp, bubbleType, ontype, handle, special,
b@1402: eventPath = [ elem || document ],
b@1402: type = hasOwn.call( event, "type" ) ? event.type : event,
b@1402: namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
b@1402:
b@1402: cur = tmp = elem = elem || document;
b@1402:
b@1402: // Don't do events on text and comment nodes
b@1402: if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
b@1402: return;
b@1402: }
b@1402:
b@1402: // focus/blur morphs to focusin/out; ensure we're not firing them right now
b@1402: if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
b@1402: return;
b@1402: }
b@1402:
b@1402: if ( type.indexOf(".") >= 0 ) {
b@1402: // Namespaced trigger; create a regexp to match event type in handle()
b@1402: namespaces = type.split(".");
b@1402: type = namespaces.shift();
b@1402: namespaces.sort();
b@1402: }
b@1402: ontype = type.indexOf(":") < 0 && "on" + type;
b@1402:
b@1402: // Caller can pass in a jQuery.Event object, Object, or just an event type string
b@1402: event = event[ jQuery.expando ] ?
b@1402: event :
b@1402: new jQuery.Event( type, typeof event === "object" && event );
b@1402:
b@1402: // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
b@1402: event.isTrigger = onlyHandlers ? 2 : 3;
b@1402: event.namespace = namespaces.join(".");
b@1402: event.namespace_re = event.namespace ?
b@1402: new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
b@1402: null;
b@1402:
b@1402: // Clean up the event in case it is being reused
b@1402: event.result = undefined;
b@1402: if ( !event.target ) {
b@1402: event.target = elem;
b@1402: }
b@1402:
b@1402: // Clone any incoming data and prepend the event, creating the handler arg list
b@1402: data = data == null ?
b@1402: [ event ] :
b@1402: jQuery.makeArray( data, [ event ] );
b@1402:
b@1402: // Allow special events to draw outside the lines
b@1402: special = jQuery.event.special[ type ] || {};
b@1402: if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
b@1402: return;
b@1402: }
b@1402:
b@1402: // Determine event propagation path in advance, per W3C events spec (#9951)
b@1402: // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
b@1402: if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
b@1402:
b@1402: bubbleType = special.delegateType || type;
b@1402: if ( !rfocusMorph.test( bubbleType + type ) ) {
b@1402: cur = cur.parentNode;
b@1402: }
b@1402: for ( ; cur; cur = cur.parentNode ) {
b@1402: eventPath.push( cur );
b@1402: tmp = cur;
b@1402: }
b@1402:
b@1402: // Only add window if we got to document (e.g., not plain obj or detached DOM)
b@1402: if ( tmp === (elem.ownerDocument || document) ) {
b@1402: eventPath.push( tmp.defaultView || tmp.parentWindow || window );
b@1402: }
b@1402: }
b@1402:
b@1402: // Fire handlers on the event path
b@1402: i = 0;
b@1402: while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
b@1402:
b@1402: event.type = i > 1 ?
b@1402: bubbleType :
b@1402: special.bindType || type;
b@1402:
b@1402: // jQuery handler
b@1402: handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
b@1402: if ( handle ) {
b@1402: handle.apply( cur, data );
b@1402: }
b@1402:
b@1402: // Native handler
b@1402: handle = ontype && cur[ ontype ];
b@1402: if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
b@1402: event.result = handle.apply( cur, data );
b@1402: if ( event.result === false ) {
b@1402: event.preventDefault();
b@1402: }
b@1402: }
b@1402: }
b@1402: event.type = type;
b@1402:
b@1402: // If nobody prevented the default action, do it now
b@1402: if ( !onlyHandlers && !event.isDefaultPrevented() ) {
b@1402:
b@1402: if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
b@1402: jQuery.acceptData( elem ) ) {
b@1402:
b@1402: // Call a native DOM method on the target with the same name name as the event.
b@1402: // Don't do default actions on window, that's where global variables be (#6170)
b@1402: if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
b@1402:
b@1402: // Don't re-trigger an onFOO event when we call its FOO() method
b@1402: tmp = elem[ ontype ];
b@1402:
b@1402: if ( tmp ) {
b@1402: elem[ ontype ] = null;
b@1402: }
b@1402:
b@1402: // Prevent re-triggering of the same event, since we already bubbled it above
b@1402: jQuery.event.triggered = type;
b@1402: elem[ type ]();
b@1402: jQuery.event.triggered = undefined;
b@1402:
b@1402: if ( tmp ) {
b@1402: elem[ ontype ] = tmp;
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: return event.result;
b@1402: },
b@1402:
b@1402: dispatch: function( event ) {
b@1402:
b@1402: // Make a writable jQuery.Event from the native event object
b@1402: event = jQuery.event.fix( event );
b@1402:
b@1402: var i, j, ret, matched, handleObj,
b@1402: handlerQueue = [],
b@1402: args = slice.call( arguments ),
b@1402: handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
b@1402: special = jQuery.event.special[ event.type ] || {};
b@1402:
b@1402: // Use the fix-ed jQuery.Event rather than the (read-only) native event
b@1402: args[0] = event;
b@1402: event.delegateTarget = this;
b@1402:
b@1402: // Call the preDispatch hook for the mapped type, and let it bail if desired
b@1402: if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
b@1402: return;
b@1402: }
b@1402:
b@1402: // Determine handlers
b@1402: handlerQueue = jQuery.event.handlers.call( this, event, handlers );
b@1402:
b@1402: // Run delegates first; they may want to stop propagation beneath us
b@1402: i = 0;
b@1402: while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
b@1402: event.currentTarget = matched.elem;
b@1402:
b@1402: j = 0;
b@1402: while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
b@1402:
b@1402: // Triggered event must either 1) have no namespace, or 2) have namespace(s)
b@1402: // a subset or equal to those in the bound event (both can have no namespace).
b@1402: if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
b@1402:
b@1402: event.handleObj = handleObj;
b@1402: event.data = handleObj.data;
b@1402:
b@1402: ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
b@1402: .apply( matched.elem, args );
b@1402:
b@1402: if ( ret !== undefined ) {
b@1402: if ( (event.result = ret) === false ) {
b@1402: event.preventDefault();
b@1402: event.stopPropagation();
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402: }
b@1402:
b@1402: // Call the postDispatch hook for the mapped type
b@1402: if ( special.postDispatch ) {
b@1402: special.postDispatch.call( this, event );
b@1402: }
b@1402:
b@1402: return event.result;
b@1402: },
b@1402:
b@1402: handlers: function( event, handlers ) {
b@1402: var i, matches, sel, handleObj,
b@1402: handlerQueue = [],
b@1402: delegateCount = handlers.delegateCount,
b@1402: cur = event.target;
b@1402:
b@1402: // Find delegate handlers
b@1402: // Black-hole SVG