2012-06-16 01:01:44 +00:00
|
|
|
var
|
2012-07-10 01:38:11 +00:00
|
|
|
// A central reference to the root jQuery(document)
|
|
|
|
rootjQuery,
|
|
|
|
|
|
|
|
// The deferred used on DOM ready
|
|
|
|
readyList,
|
|
|
|
|
2012-06-16 01:01:44 +00:00
|
|
|
// Use the correct document accordingly with window argument (sandbox)
|
|
|
|
document = window.document,
|
2012-06-04 16:48:18 +00:00
|
|
|
location = window.location,
|
2012-06-16 01:01:44 +00:00
|
|
|
|
|
|
|
// Map over jQuery in case of overwrite
|
|
|
|
_jQuery = window.jQuery,
|
|
|
|
|
|
|
|
// Map over the $ in case of overwrite
|
|
|
|
_$ = window.$,
|
2010-03-23 16:12:16 +00:00
|
|
|
|
2012-11-26 08:20:43 +00:00
|
|
|
// [[Class]] -> type pairs
|
|
|
|
class2type = {},
|
|
|
|
|
|
|
|
// List of deleted data cache ids, so we can reuse them
|
|
|
|
core_deletedIds = [],
|
|
|
|
|
|
|
|
core_version = "@VERSION",
|
|
|
|
|
2012-06-04 16:48:18 +00:00
|
|
|
// Save a reference to some core methods
|
2012-11-26 08:20:43 +00:00
|
|
|
core_concat = core_deletedIds.concat,
|
|
|
|
core_push = core_deletedIds.push,
|
|
|
|
core_slice = core_deletedIds.slice,
|
|
|
|
core_indexOf = core_deletedIds.indexOf,
|
|
|
|
core_toString = class2type.toString,
|
|
|
|
core_hasOwn = class2type.hasOwnProperty,
|
|
|
|
core_trim = core_version.trim,
|
2012-06-04 16:48:18 +00:00
|
|
|
|
|
|
|
// Define a local copy of jQuery
|
|
|
|
jQuery = function( selector, context ) {
|
2009-05-20 21:12:08 +00:00
|
|
|
// The jQuery object is actually just the init constructor 'enhanced'
|
2010-10-10 00:32:54 +00:00
|
|
|
return new jQuery.fn.init( selector, context, rootjQuery );
|
2009-05-20 21:12:08 +00:00
|
|
|
},
|
2009-03-31 17:35:20 +00:00
|
|
|
|
2012-07-23 02:23:32 +00:00
|
|
|
// Used for matching numbers
|
2012-11-26 08:20:43 +00:00
|
|
|
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
|
2012-07-23 02:23:32 +00:00
|
|
|
|
2012-11-26 08:20:43 +00:00
|
|
|
// Used for splitting on whitespace
|
|
|
|
core_rnotwhite = /\S+/g,
|
2012-06-21 19:57:12 +00:00
|
|
|
|
2012-06-18 22:43:50 +00:00
|
|
|
// A simple way to check for HTML strings
|
2012-06-20 20:19:06 +00:00
|
|
|
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
2012-06-20 15:19:24 +00:00
|
|
|
// Strict HTML recognition (#11290: must start with <)
|
|
|
|
rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
|
2012-06-16 01:01:44 +00:00
|
|
|
|
2009-09-07 18:58:01 +00:00
|
|
|
// Match a standalone tag
|
2012-07-23 02:23:32 +00:00
|
|
|
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
|
2009-09-07 18:58:01 +00:00
|
|
|
|
2011-05-25 19:10:49 +00:00
|
|
|
// Matches dashed string for camelizing
|
2011-08-17 21:30:31 +00:00
|
|
|
rmsPrefix = /^-ms-/,
|
2012-06-16 01:01:44 +00:00
|
|
|
rdashAlpha = /-([\da-z])/gi,
|
2011-05-25 19:10:49 +00:00
|
|
|
|
|
|
|
// Used by jQuery.camelCase as callback to replace()
|
|
|
|
fcamelCase = function( all, letter ) {
|
2012-11-26 08:20:43 +00:00
|
|
|
return letter.toUpperCase();
|
2011-05-25 19:10:49 +00:00
|
|
|
},
|
|
|
|
|
2012-05-04 17:31:35 +00:00
|
|
|
// The ready event handler and self cleanup method
|
2012-05-04 13:57:32 +00:00
|
|
|
DOMContentLoaded = function() {
|
2012-12-17 21:51:59 +00:00
|
|
|
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
|
|
|
|
jQuery.ready();
|
2012-11-26 08:20:43 +00:00
|
|
|
};
|
2009-03-31 17:35:20 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
jQuery.fn = jQuery.prototype = {
|
2012-11-26 08:20:43 +00:00
|
|
|
// The current version of jQuery being used
|
|
|
|
jquery: core_version,
|
|
|
|
|
2010-10-10 00:32:54 +00:00
|
|
|
constructor: jQuery,
|
|
|
|
init: function( selector, context, rootjQuery ) {
|
2012-11-05 22:21:24 +00:00
|
|
|
var match, elem;
|
2009-03-31 17:35:20 +00:00
|
|
|
|
2012-11-05 22:21:24 +00:00
|
|
|
// HANDLE: $(""), $(null), $(undefined), $(false)
|
2012-07-01 20:35:50 +00:00
|
|
|
if ( !selector ) {
|
2009-07-27 20:48:42 +00:00
|
|
|
return this;
|
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Handle HTML strings
|
2008-11-17 16:32:05 +00:00
|
|
|
if ( typeof selector === "string" ) {
|
2011-05-02 17:31:23 +00:00
|
|
|
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
|
2011-05-02 17:14:13 +00:00
|
|
|
// Assume that strings that start and end with <> are HTML and skip the regex check
|
2011-01-19 23:37:31 +00:00
|
|
|
match = [ null, selector, null ];
|
2011-05-02 17:14:13 +00:00
|
|
|
|
2011-01-19 23:37:31 +00:00
|
|
|
} else {
|
2012-07-01 20:35:50 +00:00
|
|
|
match = rquickExpr.exec( selector );
|
2011-01-19 23:37:31 +00:00
|
|
|
}
|
2011-01-20 16:58:44 +00:00
|
|
|
|
2012-07-01 20:35:50 +00:00
|
|
|
// Match html or make sure no context is specified for #id
|
|
|
|
if ( match && (match[1] || !context) ) {
|
|
|
|
|
|
|
|
// HANDLE: $(html) -> $(array)
|
|
|
|
if ( match[1] ) {
|
|
|
|
context = context instanceof jQuery ? context[0] : context;
|
|
|
|
|
|
|
|
// scripts is true for back-compat
|
2012-11-05 22:21:24 +00:00
|
|
|
jQuery.merge( this, jQuery.parseHTML(
|
|
|
|
match[1],
|
|
|
|
context && context.nodeType ? context.ownerDocument || context : document,
|
|
|
|
true
|
|
|
|
) );
|
|
|
|
|
|
|
|
// HANDLE: $(html, props)
|
2012-07-01 20:35:50 +00:00
|
|
|
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
|
2012-11-05 22:21:24 +00:00
|
|
|
for ( match in context ) {
|
|
|
|
// Properties of context are called as methods if possible
|
|
|
|
if ( jQuery.isFunction( this[ match ] ) ) {
|
|
|
|
this[ match ]( context[ match ] );
|
|
|
|
|
|
|
|
// ...and otherwise set as attributes
|
|
|
|
} else {
|
|
|
|
this.attr( match, context[ match ] );
|
|
|
|
}
|
|
|
|
}
|
2012-07-01 20:35:50 +00:00
|
|
|
}
|
|
|
|
|
2012-11-05 22:21:24 +00:00
|
|
|
return this;
|
2012-07-01 20:35:50 +00:00
|
|
|
|
|
|
|
// HANDLE: $(#id)
|
|
|
|
} else {
|
|
|
|
elem = document.getElementById( match[2] );
|
|
|
|
|
|
|
|
// Check parentNode to catch when Blackberry 4.6 returns
|
|
|
|
// nodes that are no longer in the document #6963
|
|
|
|
if ( elem && elem.parentNode ) {
|
|
|
|
// Handle the case where IE and Opera return items
|
|
|
|
// by name instead of ID
|
|
|
|
if ( elem.id !== match[2] ) {
|
|
|
|
return rootjQuery.find( selector );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Otherwise, we inject the element directly into the jQuery object
|
|
|
|
this.length = 1;
|
|
|
|
this[0] = elem;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.context = document;
|
|
|
|
this.selector = selector;
|
|
|
|
return this;
|
2011-01-20 16:58:44 +00:00
|
|
|
}
|
2009-09-08 04:26:47 +00:00
|
|
|
|
2009-02-25 14:23:25 +00:00
|
|
|
// HANDLE: $(expr, $(...))
|
|
|
|
} else if ( !context || context.jquery ) {
|
2011-10-27 19:25:30 +00:00
|
|
|
return ( context || rootjQuery ).find( selector );
|
2009-02-25 04:57:00 +00:00
|
|
|
|
2009-02-25 14:23:25 +00:00
|
|
|
// HANDLE: $(expr, context)
|
2009-03-05 13:36:12 +00:00
|
|
|
// (which is just equivalent to: $(context).find(expr)
|
2009-02-25 04:57:00 +00:00
|
|
|
} else {
|
2010-10-10 00:32:54 +00:00
|
|
|
return this.constructor( context ).find( selector );
|
2009-02-25 04:57:00 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2012-12-23 20:57:01 +00:00
|
|
|
// HANDLE: $(DOMElement)
|
|
|
|
} else if ( selector.nodeType ) {
|
|
|
|
this.context = this[0] = selector;
|
|
|
|
this.length = 1;
|
|
|
|
return this;
|
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// HANDLE: $(function)
|
|
|
|
// Shortcut for document ready
|
2009-02-25 04:57:00 +00:00
|
|
|
} else if ( jQuery.isFunction( selector ) ) {
|
2009-02-25 14:23:25 +00:00
|
|
|
return rootjQuery.ready( selector );
|
2009-02-25 04:57:00 +00:00
|
|
|
}
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2011-10-27 19:25:30 +00:00
|
|
|
if ( selector.selector !== undefined ) {
|
2009-01-08 21:41:58 +00:00
|
|
|
this.selector = selector.selector;
|
|
|
|
this.context = selector.context;
|
|
|
|
}
|
|
|
|
|
2010-01-28 22:17:51 +00:00
|
|
|
return jQuery.makeArray( selector, this );
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2008-12-19 04:37:10 +00:00
|
|
|
// Start with an empty selector
|
|
|
|
selector: "",
|
|
|
|
|
2009-07-17 01:47:26 +00:00
|
|
|
// The default length of a jQuery object is 0
|
|
|
|
length: 0,
|
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// The number of elements contained in the matched element set
|
|
|
|
size: function() {
|
|
|
|
return this.length;
|
|
|
|
},
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2009-12-22 00:58:13 +00:00
|
|
|
toArray: function() {
|
2012-06-16 01:01:44 +00:00
|
|
|
return core_slice.call( this );
|
2009-07-23 13:22:55 +00:00
|
|
|
},
|
2009-07-16 07:31:32 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// Get the Nth element in the matched element set OR
|
|
|
|
// Get the whole matched element set as a clean array
|
|
|
|
get: function( num ) {
|
2009-03-31 17:35:20 +00:00
|
|
|
return num == null ?
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Return a 'clean' array
|
2009-07-16 07:31:41 +00:00
|
|
|
this.toArray() :
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Return just the object
|
2010-11-19 11:28:13 +00:00
|
|
|
( num < 0 ? this[ this.length + num ] : this[ num ] );
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// Take an array of elements and push it onto the stack
|
|
|
|
// (returning the new matched element set)
|
2012-10-24 00:22:34 +00:00
|
|
|
pushStack: function( elems ) {
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2012-06-28 00:55:36 +00:00
|
|
|
// Build a new jQuery matched element set
|
|
|
|
var ret = jQuery.merge( this.constructor(), elems );
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Add the old object onto the stack (as a reference)
|
|
|
|
ret.prevObject = this;
|
2008-12-19 04:37:10 +00:00
|
|
|
ret.context = this.context;
|
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// Return the newly-formed element set
|
|
|
|
return ret;
|
|
|
|
},
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// Execute a callback for every element in the matched set.
|
|
|
|
// (You can seed the arguments with an array of args, but this is
|
|
|
|
// only used internally.)
|
|
|
|
each: function( callback, args ) {
|
|
|
|
return jQuery.each( this, callback, args );
|
|
|
|
},
|
2011-01-05 21:41:23 +00:00
|
|
|
|
2011-01-23 04:01:36 +00:00
|
|
|
ready: function( fn ) {
|
|
|
|
// Add the callback
|
2012-05-05 23:05:03 +00:00
|
|
|
jQuery.ready.promise().done( fn );
|
2011-01-23 04:01:36 +00:00
|
|
|
|
|
|
|
return this;
|
2009-12-08 00:34:55 +00:00
|
|
|
},
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2012-10-19 21:08:50 +00:00
|
|
|
slice: function() {
|
2012-11-02 00:36:48 +00:00
|
|
|
return this.pushStack( core_slice.apply( this, arguments ) );
|
2009-12-10 17:25:25 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
first: function() {
|
|
|
|
return this.eq( 0 );
|
|
|
|
},
|
|
|
|
|
|
|
|
last: function() {
|
|
|
|
return this.eq( -1 );
|
|
|
|
},
|
|
|
|
|
2012-10-19 21:08:50 +00:00
|
|
|
eq: function( i ) {
|
|
|
|
var len = this.length,
|
|
|
|
j = +i + ( i < 0 ? len : 0 );
|
|
|
|
return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
|
2009-12-10 17:25:25 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
map: function( callback ) {
|
2009-12-22 00:58:13 +00:00
|
|
|
return this.pushStack( jQuery.map(this, function( elem, i ) {
|
2009-12-10 17:25:25 +00:00
|
|
|
return callback.call( elem, i, elem );
|
|
|
|
}));
|
|
|
|
},
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2009-12-10 17:25:25 +00:00
|
|
|
end: function() {
|
2010-10-10 00:32:54 +00:00
|
|
|
return this.prevObject || this.constructor(null);
|
2009-12-10 17:25:25 +00:00
|
|
|
},
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2009-03-17 20:39:29 +00:00
|
|
|
// For internal use only.
|
|
|
|
// Behaves like an Array's method, not like a jQuery method.
|
2012-06-16 01:01:44 +00:00
|
|
|
push: core_push,
|
2009-03-17 20:39:29 +00:00
|
|
|
sort: [].sort,
|
2009-03-18 21:15:38 +00:00
|
|
|
splice: [].splice
|
2008-01-14 22:30:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Give the init function the jQuery prototype for later instantiation
|
2008-04-29 23:34:50 +00:00
|
|
|
jQuery.fn.init.prototype = jQuery.fn;
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
jQuery.extend = jQuery.fn.extend = function() {
|
2011-02-15 21:03:23 +00:00
|
|
|
var options, name, src, copy, copyIsArray, clone,
|
2010-11-09 16:09:07 +00:00
|
|
|
target = arguments[0] || {},
|
|
|
|
i = 1,
|
|
|
|
length = arguments.length,
|
|
|
|
deep = false;
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Handle a deep copy situation
|
2008-11-17 16:32:05 +00:00
|
|
|
if ( typeof target === "boolean" ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
deep = target;
|
|
|
|
target = arguments[1] || {};
|
|
|
|
// skip the boolean and the target
|
|
|
|
i = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Handle case when target is a string or something (possible in deep copy)
|
2009-03-31 17:35:20 +00:00
|
|
|
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
target = {};
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// extend jQuery itself if only one argument is passed
|
2009-03-31 17:35:20 +00:00
|
|
|
if ( length === i ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
target = this;
|
2008-04-30 00:09:55 +00:00
|
|
|
--i;
|
2008-01-14 22:30:48 +00:00
|
|
|
}
|
|
|
|
|
2009-03-31 17:35:20 +00:00
|
|
|
for ( ; i < length; i++ ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
// Only deal with non-null/undefined values
|
2009-03-31 17:35:20 +00:00
|
|
|
if ( (options = arguments[ i ]) != null ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
// Extend the base object
|
2009-03-31 17:35:20 +00:00
|
|
|
for ( name in options ) {
|
|
|
|
src = target[ name ];
|
|
|
|
copy = options[ name ];
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// Prevent never-ending loop
|
2009-03-31 17:35:20 +00:00
|
|
|
if ( target === copy ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
continue;
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2010-01-30 18:50:49 +00:00
|
|
|
// Recurse if we're merging plain objects or arrays
|
|
|
|
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
|
|
|
|
if ( copyIsArray ) {
|
|
|
|
copyIsArray = false;
|
|
|
|
clone = src && jQuery.isArray(src) ? src : [];
|
|
|
|
|
|
|
|
} else {
|
|
|
|
clone = src && jQuery.isPlainObject(src) ? src : {};
|
|
|
|
}
|
2009-07-16 07:32:03 +00:00
|
|
|
|
|
|
|
// Never move original objects, clone them
|
|
|
|
target[ name ] = jQuery.extend( deep, clone, copy );
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Don't bring in undefined values
|
2009-03-31 17:35:20 +00:00
|
|
|
} else if ( copy !== undefined ) {
|
2008-04-30 00:09:55 +00:00
|
|
|
target[ name ] = copy;
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
}
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Return the modified object
|
|
|
|
return target;
|
|
|
|
};
|
|
|
|
|
|
|
|
jQuery.extend({
|
|
|
|
noConflict: function( deep ) {
|
2010-11-22 04:12:12 +00:00
|
|
|
if ( window.$ === jQuery ) {
|
|
|
|
window.$ = _$;
|
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2010-10-19 05:29:20 +00:00
|
|
|
if ( deep && window.jQuery === jQuery ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
window.jQuery = _jQuery;
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
return jQuery;
|
|
|
|
},
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2009-12-08 00:34:55 +00:00
|
|
|
// Is the DOM ready to be used? Set to true once it occurs.
|
|
|
|
isReady: false,
|
2010-09-20 18:53:29 +00:00
|
|
|
|
|
|
|
// A counter to track how many items to wait for before
|
|
|
|
// the ready event fires. See #6781
|
|
|
|
readyWait: 1,
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2011-02-03 02:57:44 +00:00
|
|
|
// Hold (or release) the ready event
|
|
|
|
holdReady: function( hold ) {
|
|
|
|
if ( hold ) {
|
|
|
|
jQuery.readyWait++;
|
|
|
|
} else {
|
|
|
|
jQuery.ready( true );
|
2010-09-20 18:53:29 +00:00
|
|
|
}
|
2011-02-03 02:57:44 +00:00
|
|
|
},
|
2010-09-20 18:53:29 +00:00
|
|
|
|
2011-02-03 02:57:44 +00:00
|
|
|
// Handle when the DOM is ready
|
|
|
|
ready: function( wait ) {
|
2012-04-23 19:43:26 +00:00
|
|
|
|
2012-06-21 17:40:59 +00:00
|
|
|
// Abort if there are pending holds or we're already ready
|
|
|
|
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
|
|
|
|
return;
|
|
|
|
}
|
2009-12-08 00:34:55 +00:00
|
|
|
|
2012-06-21 17:40:59 +00:00
|
|
|
// Remember that the DOM is ready
|
|
|
|
jQuery.isReady = true;
|
2010-09-20 18:53:29 +00:00
|
|
|
|
2012-06-21 17:40:59 +00:00
|
|
|
// If a normal DOM Ready event fired, decrement, and wait if need be
|
|
|
|
if ( wait !== true && --jQuery.readyWait > 0 ) {
|
|
|
|
return;
|
|
|
|
}
|
2011-01-05 21:41:23 +00:00
|
|
|
|
2012-06-21 17:40:59 +00:00
|
|
|
// If there are functions bound, to execute
|
|
|
|
readyList.resolveWith( document, [ jQuery ] );
|
|
|
|
|
|
|
|
// Trigger any bound ready events
|
|
|
|
if ( jQuery.fn.trigger ) {
|
|
|
|
jQuery( document ).trigger("ready").off("ready");
|
2009-12-08 00:34:55 +00:00
|
|
|
}
|
|
|
|
},
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2008-11-17 16:32:05 +00:00
|
|
|
// See test/unit/core.js for details concerning isFunction.
|
2008-10-18 22:22:08 +00:00
|
|
|
// Since version 1.3, DOM methods and functions like alert
|
2008-07-23 16:18:05 +00:00
|
|
|
// aren't supported. They return false on IE (#2968).
|
2008-11-17 16:32:05 +00:00
|
|
|
isFunction: function( obj ) {
|
2010-08-25 16:57:34 +00:00
|
|
|
return jQuery.type(obj) === "function";
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
2008-11-17 16:32:05 +00:00
|
|
|
|
2012-12-17 22:09:30 +00:00
|
|
|
isArray: Array.isArray,
|
2010-08-25 16:57:34 +00:00
|
|
|
|
2010-09-22 20:41:51 +00:00
|
|
|
isWindow: function( obj ) {
|
2011-12-06 21:17:09 +00:00
|
|
|
return obj != null && obj == obj.window;
|
2010-09-22 20:41:51 +00:00
|
|
|
},
|
|
|
|
|
2011-10-12 01:04:22 +00:00
|
|
|
isNumeric: function( obj ) {
|
2011-11-07 16:25:51 +00:00
|
|
|
return !isNaN( parseFloat(obj) ) && isFinite( obj );
|
2010-09-27 15:51:01 +00:00
|
|
|
},
|
|
|
|
|
2010-08-25 16:57:34 +00:00
|
|
|
type: function( obj ) {
|
2012-12-18 15:33:32 +00:00
|
|
|
if ( obj == null ) {
|
|
|
|
return String( obj );
|
|
|
|
}
|
|
|
|
return typeof obj === "object" || typeof obj === "function" ?
|
|
|
|
class2type[ core_toString.call(obj) ] || "object" :
|
|
|
|
typeof obj;
|
2008-10-29 02:01:22 +00:00
|
|
|
},
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2009-12-06 22:11:51 +00:00
|
|
|
isPlainObject: function( obj ) {
|
2012-12-24 15:54:11 +00:00
|
|
|
// Not plain objects:
|
|
|
|
// - Any object or value whose internal [[Class]] property is not "[object Object]"
|
|
|
|
// - DOM nodes
|
|
|
|
// - window
|
2012-12-17 22:30:38 +00:00
|
|
|
if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
|
2009-11-08 23:26:01 +00:00
|
|
|
return false;
|
|
|
|
}
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2012-12-17 23:08:14 +00:00
|
|
|
// Support: Firefox >16
|
2012-12-24 15:54:11 +00:00
|
|
|
// The try/catch supresses exceptions thrown when attempting to access
|
|
|
|
// the "constructor" property of certain host objects, ie. |window.location|
|
2011-07-25 21:06:38 +00:00
|
|
|
try {
|
|
|
|
if ( obj.constructor &&
|
2012-12-17 22:30:38 +00:00
|
|
|
!core_hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
|
2011-07-25 21:06:38 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} catch ( e ) {
|
2009-11-12 04:50:40 +00:00
|
|
|
return false;
|
|
|
|
}
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2012-12-24 15:54:11 +00:00
|
|
|
// If the function hasn't returned already, we're confident that
|
|
|
|
// |obj| is a plain object, created by {} or constructed with new Object
|
2012-12-24 15:38:02 +00:00
|
|
|
return true;
|
2009-07-16 07:32:03 +00:00
|
|
|
},
|
|
|
|
|
2009-07-16 07:32:31 +00:00
|
|
|
isEmptyObject: function( obj ) {
|
2012-07-10 01:38:11 +00:00
|
|
|
var name;
|
|
|
|
for ( name in obj ) {
|
2009-07-16 15:16:44 +00:00
|
|
|
return false;
|
2009-07-19 19:55:21 +00:00
|
|
|
}
|
2009-07-16 15:16:44 +00:00
|
|
|
return true;
|
2009-07-16 07:32:31 +00:00
|
|
|
},
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2010-01-23 21:48:47 +00:00
|
|
|
error: function( msg ) {
|
2011-11-07 16:40:39 +00:00
|
|
|
throw new Error( msg );
|
2010-01-23 21:48:47 +00:00
|
|
|
},
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2012-06-21 19:28:57 +00:00
|
|
|
// data: string of html
|
|
|
|
// context (optional): If specified, the fragment will be created in this context, defaults to document
|
2012-11-19 14:50:19 +00:00
|
|
|
// keepScripts (optional): If true, will include scripts passed in the html string
|
|
|
|
parseHTML: function( data, context, keepScripts ) {
|
2012-06-21 19:28:57 +00:00
|
|
|
if ( !data || typeof data !== "string" ) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
if ( typeof context === "boolean" ) {
|
2012-11-19 14:50:19 +00:00
|
|
|
keepScripts = context;
|
|
|
|
context = false;
|
2012-06-21 19:28:57 +00:00
|
|
|
}
|
|
|
|
context = context || document;
|
|
|
|
|
2012-11-19 14:50:19 +00:00
|
|
|
var parsed = rsingleTag.exec( data ),
|
|
|
|
scripts = !keepScripts && [];
|
|
|
|
|
2012-06-21 19:28:57 +00:00
|
|
|
// Single tag
|
2012-11-19 14:50:19 +00:00
|
|
|
if ( parsed ) {
|
2012-06-21 19:28:57 +00:00
|
|
|
return [ context.createElement( parsed[1] ) ];
|
|
|
|
}
|
|
|
|
|
2013-01-07 14:38:21 +00:00
|
|
|
parsed = jQuery.buildFragment( [ data ], context, scripts );
|
|
|
|
|
2012-11-19 14:50:19 +00:00
|
|
|
if ( scripts ) {
|
|
|
|
jQuery( scripts ).remove();
|
|
|
|
}
|
2013-01-07 14:38:21 +00:00
|
|
|
|
2012-12-05 02:30:37 +00:00
|
|
|
return jQuery.merge( [], parsed.childNodes );
|
2012-06-21 19:28:57 +00:00
|
|
|
},
|
|
|
|
|
2012-12-17 23:11:11 +00:00
|
|
|
parseJSON: JSON.parse,
|
2011-01-05 21:41:23 +00:00
|
|
|
|
2010-12-24 17:02:00 +00:00
|
|
|
// Cross-browser xml parsing
|
2011-07-23 01:26:36 +00:00
|
|
|
parseXML: function( data ) {
|
2012-06-21 19:28:57 +00:00
|
|
|
var xml, tmp;
|
|
|
|
if ( !data || typeof data !== "string" ) {
|
2012-03-07 16:37:14 +00:00
|
|
|
return null;
|
|
|
|
}
|
2012-12-17 22:41:38 +00:00
|
|
|
|
2012-12-17 23:06:33 +00:00
|
|
|
// Support: IE9
|
2011-07-23 01:26:36 +00:00
|
|
|
try {
|
2012-12-17 22:41:38 +00:00
|
|
|
tmp = new DOMParser();
|
|
|
|
xml = tmp.parseFromString( data , "text/xml" );
|
|
|
|
} catch ( e ) {
|
2011-07-23 01:26:36 +00:00
|
|
|
xml = undefined;
|
2010-12-24 17:02:00 +00:00
|
|
|
}
|
2012-12-17 22:41:38 +00:00
|
|
|
|
|
|
|
if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
|
2010-12-24 17:02:00 +00:00
|
|
|
jQuery.error( "Invalid XML: " + data );
|
|
|
|
}
|
|
|
|
return xml;
|
|
|
|
},
|
2009-07-16 07:32:31 +00:00
|
|
|
|
2009-12-31 14:50:49 +00:00
|
|
|
noop: function() {},
|
|
|
|
|
2011-04-07 04:47:15 +00:00
|
|
|
// Evaluates a script in a global context
|
2008-01-14 22:30:48 +00:00
|
|
|
globalEval: function( data ) {
|
2012-12-17 22:49:17 +00:00
|
|
|
var indirect = eval;
|
|
|
|
if ( jQuery.trim( data ) ) {
|
|
|
|
indirect( data + ";" );
|
2008-01-14 22:30:48 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2011-08-17 21:30:31 +00:00
|
|
|
// Convert dashed to camelCase; used by the css and data modules
|
|
|
|
// Microsoft forgot to hump their vendor prefix (#9572)
|
2011-05-25 19:10:49 +00:00
|
|
|
camelCase: function( string ) {
|
2011-08-17 21:30:31 +00:00
|
|
|
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
2011-05-25 19:10:49 +00:00
|
|
|
},
|
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
nodeName: function( elem, name ) {
|
2012-09-18 21:39:44 +00:00
|
|
|
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
// args is for internal usage only
|
2012-06-29 01:39:58 +00:00
|
|
|
each: function( obj, callback, args ) {
|
2012-12-10 18:52:02 +00:00
|
|
|
var value,
|
2012-07-10 01:38:11 +00:00
|
|
|
i = 0,
|
2012-06-29 01:39:58 +00:00
|
|
|
length = obj.length,
|
2012-12-10 18:52:02 +00:00
|
|
|
isArray = isArraylike( obj );
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
if ( args ) {
|
2012-12-10 18:52:02 +00:00
|
|
|
if ( isArray ) {
|
|
|
|
for ( ; i < length; i++ ) {
|
|
|
|
value = callback.apply( obj[ i ], args );
|
|
|
|
|
|
|
|
if ( value === false ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
break;
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2012-12-10 18:52:02 +00:00
|
|
|
for ( i in obj ) {
|
|
|
|
value = callback.apply( obj[ i ], args );
|
|
|
|
|
|
|
|
if ( value === false ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
break;
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// A special, fast, case for the most common use of each
|
|
|
|
} else {
|
2012-12-10 18:52:02 +00:00
|
|
|
if ( isArray ) {
|
|
|
|
for ( ; i < length; i++ ) {
|
|
|
|
value = callback.call( obj[ i ], i, obj[ i ] );
|
|
|
|
|
|
|
|
if ( value === false ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
break;
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
2012-12-10 18:52:02 +00:00
|
|
|
for ( i in obj ) {
|
|
|
|
value = callback.call( obj[ i ], i, obj[ i ] );
|
|
|
|
|
|
|
|
if ( value === false ) {
|
2011-03-30 17:17:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
}
|
|
|
|
|
2012-06-29 01:39:58 +00:00
|
|
|
return obj;
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
2008-05-13 01:45:58 +00:00
|
|
|
|
2012-12-17 21:56:36 +00:00
|
|
|
trim: function( text ) {
|
|
|
|
return text == null ? "" : core_trim.call( text );
|
|
|
|
},
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2009-11-18 02:26:42 +00:00
|
|
|
// results is for internal usage only
|
2012-06-29 01:39:58 +00:00
|
|
|
makeArray: function( arr, results ) {
|
2012-12-10 18:52:02 +00:00
|
|
|
var ret = results || [];
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2012-06-29 01:39:58 +00:00
|
|
|
if ( arr != null ) {
|
2012-12-10 18:52:02 +00:00
|
|
|
if ( isArraylike( Object(arr) ) ) {
|
|
|
|
jQuery.merge( ret,
|
|
|
|
typeof arr === "string" ?
|
|
|
|
[ arr ] : arr
|
|
|
|
);
|
2009-03-31 17:35:20 +00:00
|
|
|
} else {
|
2012-12-10 18:52:02 +00:00
|
|
|
core_push.call( ret, arr );
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-04-25 03:48:07 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
},
|
|
|
|
|
2012-06-29 01:39:58 +00:00
|
|
|
inArray: function( elem, arr, i ) {
|
2012-12-21 20:24:42 +00:00
|
|
|
return arr == null ? -1 : core_indexOf.call( arr, elem, i );
|
2008-01-14 22:30:48 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
merge: function( first, second ) {
|
2012-07-10 01:38:11 +00:00
|
|
|
var l = second.length,
|
|
|
|
i = first.length,
|
2010-11-09 16:09:07 +00:00
|
|
|
j = 0;
|
2009-05-02 19:22:55 +00:00
|
|
|
|
2012-07-10 01:38:11 +00:00
|
|
|
if ( typeof l === "number" ) {
|
|
|
|
for ( ; j < l; j++ ) {
|
2009-12-10 05:43:20 +00:00
|
|
|
first[ i++ ] = second[ j ];
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
while ( second[j] !== undefined ) {
|
|
|
|
first[ i++ ] = second[ j++ ];
|
|
|
|
}
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2009-12-10 05:43:20 +00:00
|
|
|
first.length = i;
|
|
|
|
|
2008-01-14 22:30:48 +00:00
|
|
|
return first;
|
|
|
|
},
|
|
|
|
|
|
|
|
grep: function( elems, callback, inv ) {
|
2012-07-10 01:38:11 +00:00
|
|
|
var retVal,
|
|
|
|
ret = [],
|
|
|
|
i = 0,
|
|
|
|
length = elems.length;
|
2010-03-02 02:24:49 +00:00
|
|
|
inv = !!inv;
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Go through the array, only saving the items
|
|
|
|
// that pass the validator function
|
2012-07-10 01:38:11 +00:00
|
|
|
for ( ; i < length; i++ ) {
|
2010-03-02 02:24:49 +00:00
|
|
|
retVal = !!callback( elems[ i ], i );
|
|
|
|
if ( inv !== retVal ) {
|
2008-01-14 22:30:48 +00:00
|
|
|
ret.push( elems[ i ] );
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
},
|
|
|
|
|
2009-12-04 17:28:47 +00:00
|
|
|
// arg is for internal usage only
|
|
|
|
map: function( elems, callback, arg ) {
|
2012-12-10 18:52:02 +00:00
|
|
|
var value,
|
2011-04-05 06:59:54 +00:00
|
|
|
i = 0,
|
2011-03-21 19:24:53 +00:00
|
|
|
length = elems.length,
|
2012-12-10 18:52:02 +00:00
|
|
|
isArray = isArraylike( elems ),
|
|
|
|
ret = [];
|
2008-01-14 22:30:48 +00:00
|
|
|
|
|
|
|
// Go through the array, translating each of the items to their
|
2011-03-21 19:12:31 +00:00
|
|
|
if ( isArray ) {
|
|
|
|
for ( ; i < length; i++ ) {
|
|
|
|
value = callback( elems[ i ], i, arg );
|
|
|
|
|
2011-02-27 18:47:35 +00:00
|
|
|
if ( value != null ) {
|
|
|
|
ret[ ret.length ] = value;
|
|
|
|
}
|
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
|
2011-04-22 01:51:23 +00:00
|
|
|
// Go through every key on the object,
|
2011-04-05 06:59:54 +00:00
|
|
|
} else {
|
2012-12-10 18:52:02 +00:00
|
|
|
for ( i in elems ) {
|
|
|
|
value = callback( elems[ i ], i, arg );
|
2011-03-21 19:12:31 +00:00
|
|
|
|
|
|
|
if ( value != null ) {
|
|
|
|
ret[ ret.length ] = value;
|
|
|
|
}
|
2009-03-31 17:35:20 +00:00
|
|
|
}
|
2008-01-14 22:30:48 +00:00
|
|
|
}
|
|
|
|
|
2010-11-27 22:15:33 +00:00
|
|
|
// Flatten any nested arrays
|
2012-11-19 14:50:19 +00:00
|
|
|
return core_concat.apply( [], ret );
|
2009-03-31 17:35:20 +00:00
|
|
|
},
|
|
|
|
|
2009-12-31 20:06:45 +00:00
|
|
|
// A global GUID counter for objects
|
|
|
|
guid: 1,
|
|
|
|
|
2010-12-15 02:53:04 +00:00
|
|
|
// Bind a function to a context, optionally partially applying any
|
|
|
|
// arguments.
|
|
|
|
proxy: function( fn, context ) {
|
2012-07-10 01:38:11 +00:00
|
|
|
var tmp, args, proxy;
|
|
|
|
|
2011-01-21 15:33:50 +00:00
|
|
|
if ( typeof context === "string" ) {
|
2012-07-10 01:38:11 +00:00
|
|
|
tmp = fn[ context ];
|
2011-04-17 21:11:40 +00:00
|
|
|
context = fn;
|
|
|
|
fn = tmp;
|
2009-12-31 20:06:45 +00:00
|
|
|
}
|
|
|
|
|
2010-12-15 02:53:04 +00:00
|
|
|
// Quick check to determine if target is callable, in the spec
|
|
|
|
// this throws a TypeError, but we will just return undefined.
|
2011-04-17 21:11:40 +00:00
|
|
|
if ( !jQuery.isFunction( fn ) ) {
|
2010-12-15 02:53:04 +00:00
|
|
|
return undefined;
|
2009-12-31 20:17:52 +00:00
|
|
|
}
|
2009-12-31 20:06:45 +00:00
|
|
|
|
2011-04-17 21:11:40 +00:00
|
|
|
// Simulated bind
|
2012-07-10 01:38:11 +00:00
|
|
|
args = core_slice.call( arguments, 2 );
|
|
|
|
proxy = function() {
|
2012-07-19 15:54:14 +00:00
|
|
|
return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
|
2012-07-10 01:38:11 +00:00
|
|
|
};
|
2009-12-31 20:06:45 +00:00
|
|
|
|
|
|
|
// Set the guid of unique handler to the same of original handler, so it can be removed
|
2012-09-18 21:39:44 +00:00
|
|
|
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
|
2009-12-31 20:06:45 +00:00
|
|
|
|
|
|
|
return proxy;
|
|
|
|
},
|
|
|
|
|
2012-04-17 01:57:41 +00:00
|
|
|
// Multifunctional method to get and set values of a collection
|
2011-06-14 20:01:50 +00:00
|
|
|
// The value/s can optionally be executed if it's a function
|
2012-11-06 14:53:00 +00:00
|
|
|
access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
2012-11-05 22:21:24 +00:00
|
|
|
var i = 0,
|
|
|
|
length = elems.length,
|
2012-11-06 14:53:00 +00:00
|
|
|
bulk = key == null;
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2011-12-06 20:25:38 +00:00
|
|
|
// Sets many values
|
2012-12-11 13:06:48 +00:00
|
|
|
if ( jQuery.type( key ) === "object" ) {
|
2012-11-05 22:21:24 +00:00
|
|
|
chainable = true;
|
2011-12-06 20:25:38 +00:00
|
|
|
for ( i in key ) {
|
2012-11-06 14:53:00 +00:00
|
|
|
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
|
2010-03-23 16:12:16 +00:00
|
|
|
}
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2011-12-06 20:25:38 +00:00
|
|
|
// Sets one value
|
|
|
|
} else if ( value !== undefined ) {
|
2012-11-05 22:21:24 +00:00
|
|
|
chainable = true;
|
2011-12-06 20:25:38 +00:00
|
|
|
|
2012-11-06 14:53:00 +00:00
|
|
|
if ( !jQuery.isFunction( value ) ) {
|
|
|
|
raw = true;
|
|
|
|
}
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2012-11-06 14:53:00 +00:00
|
|
|
if ( bulk ) {
|
|
|
|
// Bulk operations run against the entire set
|
|
|
|
if ( raw ) {
|
2011-12-06 20:25:38 +00:00
|
|
|
fn.call( elems, value );
|
|
|
|
fn = null;
|
2012-11-06 14:53:00 +00:00
|
|
|
|
|
|
|
// ...except when executing function values
|
|
|
|
} else {
|
|
|
|
bulk = fn;
|
|
|
|
fn = function( elem, key, value ) {
|
|
|
|
return bulk.call( jQuery( elem ), value );
|
|
|
|
};
|
2011-12-06 20:25:38 +00:00
|
|
|
}
|
2010-03-23 16:12:16 +00:00
|
|
|
}
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2011-12-06 20:25:38 +00:00
|
|
|
if ( fn ) {
|
2012-11-05 22:21:24 +00:00
|
|
|
for ( ; i < length; i++ ) {
|
2012-11-06 14:53:00 +00:00
|
|
|
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
|
2011-12-06 20:25:38 +00:00
|
|
|
}
|
|
|
|
}
|
2010-03-23 16:12:16 +00:00
|
|
|
}
|
2010-12-30 06:34:48 +00:00
|
|
|
|
2011-12-06 20:25:38 +00:00
|
|
|
return chainable ?
|
|
|
|
elems :
|
|
|
|
|
|
|
|
// Gets
|
|
|
|
bulk ?
|
|
|
|
fn.call( elems ) :
|
|
|
|
length ? fn( elems[0], key ) : emptyGet;
|
2010-03-23 16:12:16 +00:00
|
|
|
},
|
|
|
|
|
2012-12-17 22:06:57 +00:00
|
|
|
now: Date.now
|
2008-01-14 22:30:48 +00:00
|
|
|
});
|
|
|
|
|
2012-06-29 01:39:58 +00:00
|
|
|
jQuery.ready.promise = function( obj ) {
|
2012-05-05 23:05:03 +00:00
|
|
|
if ( !readyList ) {
|
|
|
|
|
|
|
|
readyList = jQuery.Deferred();
|
|
|
|
|
2012-08-19 21:41:43 +00:00
|
|
|
// Catch cases where $(document).ready() is called after the browser event has already occurred.
|
2012-08-23 21:46:12 +00:00
|
|
|
// we once tried to use readyState "interactive" here, but it caused issues like the one
|
2012-08-19 21:41:43 +00:00
|
|
|
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
|
2012-08-23 21:46:12 +00:00
|
|
|
if ( document.readyState === "complete" ) {
|
2012-05-05 23:05:03 +00:00
|
|
|
// Handle it asynchronously to allow scripts the opportunity to delay ready
|
2012-12-10 08:00:12 +00:00
|
|
|
setTimeout( jQuery.ready );
|
2012-05-05 23:05:03 +00:00
|
|
|
|
2012-06-26 13:16:29 +00:00
|
|
|
// Standards-based browsers support DOMContentLoaded
|
2012-12-17 21:51:59 +00:00
|
|
|
} else {
|
2012-05-05 23:05:03 +00:00
|
|
|
// Use the handy event callback
|
|
|
|
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
|
|
|
|
|
|
|
|
// A fallback to window.onload, that will always work
|
|
|
|
window.addEventListener( "load", jQuery.ready, false );
|
|
|
|
}
|
|
|
|
}
|
2012-06-29 01:39:58 +00:00
|
|
|
return readyList.promise( obj );
|
2012-05-05 23:05:03 +00:00
|
|
|
};
|
|
|
|
|
2010-08-27 23:14:59 +00:00
|
|
|
// Populate the class2type map
|
2012-11-24 22:22:14 +00:00
|
|
|
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
|
2010-08-27 23:14:59 +00:00
|
|
|
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
|
|
|
});
|
|
|
|
|
2012-12-10 18:52:02 +00:00
|
|
|
function isArraylike( obj ) {
|
|
|
|
var length = obj.length,
|
|
|
|
type = jQuery.type( obj );
|
|
|
|
|
|
|
|
if ( jQuery.isWindow( obj ) ) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-12-11 01:19:26 +00:00
|
|
|
if ( obj.nodeType === 1 && length ) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-12-10 18:52:02 +00:00
|
|
|
return type === "array" || type !== "function" &&
|
|
|
|
( length === 0 ||
|
|
|
|
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
|
|
|
|
}
|
|
|
|
|
2009-02-25 14:23:25 +00:00
|
|
|
// All jQuery objects should point back to these
|
2009-03-31 17:35:20 +00:00
|
|
|
rootjQuery = jQuery(document);
|