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