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