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