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