/packages/jQuery.vsdoc.1.5.1/Content/Scripts/jquery-1.5.1-vsdoc.js
JavaScript | 2224 lines | 1064 code | 411 blank | 749 comment | 344 complexity | a3809609ec504c75f6e0fec656b39783 MD5 | raw file
Large files files are truncated, but you can click here to view the full file
- /*
- * This file has been commented to support Visual Studio Intellisense.
- * You should not use this file at runtime inside the browser--it is only
- * intended to be used only for design-time IntelliSense. Please use the
- * standard jQuery library for all production use.
- *
- * Comment version: 1.5.1
- */
-
- /*!
- * Note: While Microsoft is not the author of this file, Microsoft is
- * offering you a license subject to the terms of the Microsoft Software
- * License Terms for Microsoft ASP.NET Model View Controller 3.
- * Microsoft reserves all other rights. The notices below are provided
- * for informational purposes only and are not the license terms under
- * which Microsoft distributed this file.
- *
- * jQuery JavaScript Library v1.5.1
- * http://jquery.com/
- *
- * Copyright 2010, John Resig
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2010, The Dojo Foundation
- *
- */
- (function( window, undefined ) {
-
- // Use the correct document accordingly with window argument (sandbox)
- var document = window.document;
- var jQuery = (function() {
-
- // Define a local copy of jQuery
- var jQuery = function( selector, context ) {
- /// <summary>
- /// 1: $(expression, context) - This function accepts a string containing a CSS selector which is then used to match a set of elements.
- /// 2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML.
- /// 3: $(elements) - Wrap jQuery functionality around a single or multiple DOM Element(s).
- /// 4: $(callback) - A shorthand for $(document).ready().
- /// 5: $() - As of jQuery 1.4, if you pass no arguments in to the jQuery() method, an empty jQuery set will be returned.
- /// </summary>
- /// <param name="selector" type="String">
- /// 1: expression - An expression to search with.
- /// 2: html - A string of HTML to create on the fly.
- /// 3: elements - DOM element(s) to be encapsulated by a jQuery object.
- /// 4: callback - The function to execute when the DOM is ready.
- /// </param>
- /// <param name="context" type="jQuery">
- /// 1: context - A DOM Element, Document or jQuery to use as context.
- /// </param>
- /// <returns type="jQuery" />
-
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init( selector, context );
- },
-
- // Map over jQuery in case of overwrite
- _jQuery = window.jQuery,
-
- // Map over the $ in case of overwrite
- _$ = window.$,
-
- // A central reference to the root jQuery(document)
- rootjQuery,
-
- // A simple way to check for HTML strings or ID strings
- // (both of which we optimize for)
- quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
-
- // Is it a simple selector
- isSimple = /^.[^:#\[\.,]*$/,
-
- // Check if a string has a non-whitespace character in it
- rnotwhite = /\S/,
- rwhite = /\s/,
-
- // Used for trimming whitespace
- trimLeft = /^\s+/,
- trimRight = /\s+$/,
-
- // Check for non-word characters
- rnonword = /\W/,
-
- // Check for digits
- rdigit = /\d/,
-
- // Match a standalone tag
- rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-
- // JSON RegExp
- rvalidchars = /^[\],:{}\s]*$/,
- rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
- rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
- rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-
- // Useragent RegExp
- rwebkit = /(webkit)[ \/]([\w.]+)/,
- ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
- rmsie = /(msie) ([\w.]+)/,
- rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
-
- // Keep a UserAgent string for use with jQuery.browser
- userAgent = navigator.userAgent,
-
- // For matching the engine and version of the browser
- browserMatch,
-
- // Has the ready events already been bound?
- readyBound = false,
-
- // The functions to execute on DOM ready
- readyList = [],
-
- // The ready event handler
- DOMContentLoaded,
-
- // Save a reference to some core methods
- toString = Object.prototype.toString,
- hasOwn = Object.prototype.hasOwnProperty,
- push = Array.prototype.push,
- slice = Array.prototype.slice,
- trim = String.prototype.trim,
- indexOf = Array.prototype.indexOf,
-
- // [[Class]] -> type pairs
- class2type = {};
-
- jQuery.fn = jQuery.prototype = {
- init: function( selector, context ) {
- var match, elem, ret, doc;
-
- // Handle $(""), $(null), or $(undefined)
- if ( !selector ) {
- return this;
- }
-
- // Handle $(DOMElement)
- if ( selector.nodeType ) {
- this.context = this[0] = selector;
- this.length = 1;
- return this;
- }
-
- // The body element only exists once, optimize finding it
- if ( selector === "body" && !context && document.body ) {
- this.context = document;
- this[0] = document.body;
- this.selector = "body";
- this.length = 1;
- return this;
- }
-
- // Handle HTML strings
- if ( typeof selector === "string" ) {
- // Are we dealing with HTML string or an ID?
- match = quickExpr.exec( selector );
-
- // Verify a match, and that no context was specified for #id
- if ( match && (match[1] || !context) ) {
-
- // HANDLE: $(html) -> $(array)
- if ( match[1] ) {
- doc = (context ? context.ownerDocument || context : document);
-
- // If a single string is passed in and it's a single tag
- // just do a createElement and skip the rest
- ret = rsingleTag.exec( selector );
-
- if ( ret ) {
- if ( jQuery.isPlainObject( context ) ) {
- selector = [ document.createElement( ret[1] ) ];
- jQuery.fn.attr.call( selector, context, true );
-
- } else {
- selector = [ doc.createElement( ret[1] ) ];
- }
-
- } else {
- ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
- selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
- }
-
- return jQuery.merge( this, selector );
-
- // 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;
- }
-
- // HANDLE: $("TAG")
- } else if ( !context && !rnonword.test( selector ) ) {
- this.selector = selector;
- this.context = document;
- selector = document.getElementsByTagName( selector );
- return jQuery.merge( this, selector );
-
- // HANDLE: $(expr, $(...))
- } else if ( !context || context.jquery ) {
- return (context || rootjQuery).find( selector );
-
- // HANDLE: $(expr, context)
- // (which is just equivalent to: $(context).find(expr)
- } else {
- return jQuery( context ).find( selector );
- }
-
- // HANDLE: $(function)
- // Shortcut for document ready
- } else if ( jQuery.isFunction( selector ) ) {
- return rootjQuery.ready( selector );
- }
-
- if (selector.selector !== undefined) {
- this.selector = selector.selector;
- this.context = selector.context;
- }
-
- return jQuery.makeArray( selector, this );
- },
-
- // Start with an empty selector
- selector: "",
-
- // The current version of jQuery being used
- jquery: "1.4.4",
-
- // The default length of a jQuery object is 0
- length: 0,
-
- // The number of elements contained in the matched element set
- size: function() {
- /// <summary>
- /// The number of elements currently matched.
- /// Part of Core
- /// </summary>
- /// <returns type="Number" />
-
- return this.length;
- },
-
- toArray: function() {
- /// <summary>
- /// Retrieve all the DOM elements contained in the jQuery set, as an array.
- /// </summary>
- /// <returns type="Array" />
- return slice.call( this, 0 );
- },
-
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function( num ) {
- /// <summary>
- /// Access a single matched element. num is used to access the
- /// Nth element matched.
- /// Part of Core
- /// </summary>
- /// <returns type="Element" />
- /// <param name="num" type="Number">
- /// Access the element in the Nth position.
- /// </param>
-
- return num == null ?
-
- // Return a 'clean' array
- this.toArray() :
-
- // Return just the object
- ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
- },
-
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function( elems, name, selector ) {
- /// <summary>
- /// Set the jQuery object to an array of elements, while maintaining
- /// the stack.
- /// Part of Core
- /// </summary>
- /// <returns type="jQuery" />
- /// <param name="elems" type="Elements">
- /// An array of elements
- /// </param>
-
- // Build a new jQuery matched element set
- var ret = jQuery();
-
- if ( jQuery.isArray( elems ) ) {
- push.apply( ret, elems );
-
- } else {
- jQuery.merge( ret, elems );
- }
-
- // Add the old object onto the stack (as a reference)
- ret.prevObject = this;
-
- ret.context = this.context;
-
- if ( name === "find" ) {
- ret.selector = this.selector + (this.selector ? " " : "") + selector;
- } else if ( name ) {
- ret.selector = this.selector + "." + name + "(" + selector + ")";
- }
-
- // Return the newly-formed element set
- return ret;
- },
-
- // 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 ) {
- /// <summary>
- /// Execute a function within the context of every matched element.
- /// This means that every time the passed-in function is executed
- /// (which is once for every element matched) the 'this' keyword
- /// points to the specific element.
- /// Additionally, the function, when executed, is passed a single
- /// argument representing the position of the element in the matched
- /// set.
- /// Part of Core
- /// </summary>
- /// <returns type="jQuery" />
- /// <param name="callback" type="Function">
- /// A function to execute
- /// </param>
-
- return jQuery.each( this, callback, args );
- },
-
- ready: function( fn ) {
- /// <summary>
- /// Binds a function to be executed whenever the DOM is ready to be traversed and manipulated.
- /// </summary>
- /// <param name="fn" type="Function">The function to be executed when the DOM is ready.</param>
-
- // Attach the listeners
- jQuery.bindReady();
-
- // If the DOM is already ready
- if ( jQuery.isReady ) {
- // Execute the function immediately
- fn.call( document, jQuery );
-
- // Otherwise, remember the function for later
- } else if ( readyList ) {
- // Add the function to the wait list
- readyList.push( fn );
- }
-
- return this;
- },
-
- eq: function( i ) {
- /// <summary>
- /// Reduce the set of matched elements to a single element.
- /// The position of the element in the set of matched elements
- /// starts at 0 and goes to length - 1.
- /// Part of Core
- /// </summary>
- /// <returns type="jQuery" />
- /// <param name="num" type="Number">
- /// pos The index of the element that you wish to limit to.
- /// </param>
-
- return i === -1 ?
- this.slice( i ) :
- this.slice( i, +i + 1 );
- },
-
- first: function() {
- /// <summary>
- /// Reduce the set of matched elements to the first in the set.
- /// </summary>
- /// <returns type="jQuery" />
-
- return this.eq( 0 );
- },
-
- last: function() {
- /// <summary>
- /// Reduce the set of matched elements to the final one in the set.
- /// </summary>
- /// <returns type="jQuery" />
-
- return this.eq( -1 );
- },
-
- slice: function() {
- /// <summary>
- /// Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method.
- /// </summary>
- /// <param name="start" type="Number" integer="true">Where to start the subset (0-based).</param>
- /// <param name="end" optional="true" type="Number" integer="true">Where to end the subset (not including the end element itself).
- /// If omitted, ends at the end of the selection</param>
- /// <returns type="jQuery">The sliced elements</returns>
-
- return this.pushStack( slice.apply( this, arguments ),
- "slice", slice.call(arguments).join(",") );
- },
-
- map: function( callback ) {
- /// <summary>
- /// This member is internal.
- /// </summary>
- /// <private />
- /// <returns type="jQuery" />
-
- return this.pushStack( jQuery.map(this, function( elem, i ) {
- return callback.call( elem, i, elem );
- }));
- },
-
- end: function() {
- /// <summary>
- /// End the most recent 'destructive' operation, reverting the list of matched elements
- /// back to its previous state. After an end operation, the list of matched elements will
- /// revert to the last state of matched elements.
- /// If there was no destructive operation before, an empty set is returned.
- /// Part of DOM/Traversing
- /// </summary>
- /// <returns type="jQuery" />
-
- return this.prevObject || jQuery(null);
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: [].sort,
- splice: [].splice
- };
-
- // Give the init function the jQuery prototype for later instantiation
- jQuery.fn.init.prototype = jQuery.fn;
-
- jQuery.extend = jQuery.fn.extend = function() {
- /// <summary>
- /// Extend one object with one or more others, returning the original,
- /// modified, object. This is a great utility for simple inheritance.
- /// jQuery.extend(settings, options);
- /// var settings = jQuery.extend({}, defaults, options);
- /// Part of JavaScript
- /// </summary>
- /// <param name="target" type="Object">
- /// The object to extend
- /// </param>
- /// <param name="prop1" type="Object">
- /// The object that will be merged into the first.
- /// </param>
- /// <param name="propN" type="Object" optional="true" parameterArray="true">
- /// (optional) More objects to merge into the first
- /// </param>
- /// <returns type="Object" />
-
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false;
-
- // Handle a deep copy situation
- if ( typeof target === "boolean" ) {
- 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)
- if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
- target = {};
- }
-
- // extend jQuery itself if only one argument is passed
- if ( length === i ) {
- target = this;
- --i;
- }
-
- for ( ; i < length; i++ ) {
- // Only deal with non-null/undefined values
- if ( (options = arguments[ i ]) != null ) {
- // Extend the base object
- for ( name in options ) {
- src = target[ name ];
- copy = options[ name ];
-
- // Prevent never-ending loop
- if ( target === copy ) {
- continue;
- }
-
- // 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 : {};
- }
-
- // Never move original objects, clone them
- target[ name ] = jQuery.extend( deep, clone, copy );
-
- // Don't bring in undefined values
- } else if ( copy !== undefined ) {
- target[ name ] = copy;
- }
- }
- }
- }
-
- // Return the modified object
- return target;
- };
-
- jQuery.extend({
- noConflict: function( deep ) {
- /// <summary>
- /// Run this function to give control of the $ variable back
- /// to whichever library first implemented it. This helps to make
- /// sure that jQuery doesn't conflict with the $ object
- /// of other libraries.
- /// By using this function, you will only be able to access jQuery
- /// using the 'jQuery' variable. For example, where you used to do
- /// $("div p"), you now must do jQuery("div p").
- /// Part of Core
- /// </summary>
- /// <returns type="undefined" />
-
- window.$ = _$;
-
- if ( deep ) {
- window.jQuery = _jQuery;
- }
-
- return jQuery;
- },
-
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
-
- // A counter to track how many items to wait for before
- // the ready event fires. See #6781
- readyWait: 1,
-
- // Handle when the DOM is ready
- ready: function( wait ) {
- /// <summary>
- /// This method is internal.
- /// </summary>
- /// <private />
-
- // A third-party is pushing the ready event forwards
- if ( wait === true ) {
- jQuery.readyWait--;
- }
-
- // Make sure that the DOM is not already loaded
- if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( !document.body ) {
- return setTimeout( jQuery.ready, 1 );
- }
-
- // Remember that the DOM is ready
- jQuery.isReady = true;
-
- // If a normal DOM Ready event fired, decrement, and wait if need be
- if ( wait !== true && --jQuery.readyWait > 0 ) {
- return;
- }
-
- // If there are functions bound, to execute
- if ( readyList ) {
- // Execute all of them
- var fn,
- i = 0,
- ready = readyList;
-
- // Reset the list of functions
- readyList = null;
-
- while ( (fn = ready[ i++ ]) ) {
- fn.call( document, jQuery );
- }
-
- // Trigger any bound ready events
- if ( jQuery.fn.trigger ) {
- jQuery( document ).trigger( "ready" ).unbind( "ready" );
- }
- }
- }
- },
-
- bindReady: function() {
- if ( readyBound ) {
- return;
- }
-
- readyBound = true;
-
- // Catch cases where $(document).ready() is called after the
- // browser event has already occurred.
- if ( document.readyState === "complete" ) {
- // Handle it asynchronously to allow scripts the opportunity to delay ready
- return setTimeout( jQuery.ready, 1 );
- }
-
- // Mozilla, Opera and webkit nightlies currently support this event
- if ( document.addEventListener ) {
- // 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 );
-
- // If IE event model is used
- } else if ( document.attachEvent ) {
- // ensure firing before onload,
- // maybe late but safe also for iframes
- document.attachEvent("onreadystatechange", DOMContentLoaded);
-
- // A fallback to window.onload, that will always work
- window.attachEvent( "onload", jQuery.ready );
-
- // If IE and not a frame
- // continually check to see if the document is ready
- var toplevel = false;
-
- try {
- toplevel = window.frameElement == null;
- } catch(e) {}
-
- if ( document.documentElement.doScroll && toplevel ) {
- doScrollCheck();
- }
- }
- },
-
- // See test/unit/core.js for details concerning isFunction.
- // Since version 1.3, DOM methods and functions like alert
- // aren't supported. They return false on IE (#2968).
- isFunction: function( obj ) {
- /// <summary>
- /// Determines if the parameter passed is a function.
- /// </summary>
- /// <param name="obj" type="Object">The object to check</param>
- /// <returns type="Boolean">True if the parameter is a function; otherwise false.</returns>
-
- return jQuery.type(obj) === "function";
- },
-
- isArray: Array.isArray || function( obj ) {
- /// <summary>
- /// Determine if the parameter passed is an array.
- /// </summary>
- /// <param name="obj" type="Object">Object to test whether or not it is an array.</param>
- /// <returns type="Boolean">True if the parameter is a function; otherwise false.</returns>
-
- return jQuery.type(obj) === "array";
- },
-
- // A crude way of determining if an object is a window
- isWindow: function( obj ) {
- return obj && typeof obj === "object" && "setInterval" in obj;
- },
-
- isNaN: function( obj ) {
- return obj == null || !rdigit.test( obj ) || isNaN( obj );
- },
-
- type: function( obj ) {
- return obj == null ?
- String( obj ) :
- class2type[ toString.call(obj) ] || "object";
- },
-
- isPlainObject: function( obj ) {
- /// <summary>
- /// Check to see if an object is a plain object (created using "{}" or "new Object").
- /// </summary>
- /// <param name="obj" type="Object">
- /// The object that will be checked to see if it's a plain object.
- /// </param>
- /// <returns type="Boolean" />
-
- // Must be an Object.
- // Because of IE, we also have to check the presence of the constructor property.
- // Make sure that DOM nodes and window objects don't pass through, as well
- if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
- return false;
- }
-
- // Not own constructor property must be Object
- if ( obj.constructor &&
- !hasOwn.call(obj, "constructor") &&
- !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
- return false;
- }
-
- // Own properties are enumerated firstly, so to speed up,
- // if last one is own, then all properties are own.
-
- var key;
- for ( key in obj ) {}
-
- return key === undefined || hasOwn.call( obj, key );
- },
-
- isEmptyObject: function( obj ) {
- /// <summary>
- /// Check to see if an object is empty (contains no properties).
- /// </summary>
- /// <param name="obj" type="Object">
- /// The object that will be checked to see if it's empty.
- /// </param>
- /// <returns type="Boolean" />
-
- for ( var name in obj ) {
- return false;
- }
- return true;
- },
-
- error: function( msg ) {
- throw msg;
- },
-
- parseJSON: function( data ) {
- if ( typeof data !== "string" || !data ) {
- return null;
- }
-
- // Make sure leading/trailing whitespace is removed (IE can't handle it)
- data = jQuery.trim( data );
-
- // Make sure the incoming data is actual JSON
- // Logic borrowed from http://json.org/json2.js
- if ( rvalidchars.test(data.replace(rvalidescape, "@")
- .replace(rvalidtokens, "]")
- .replace(rvalidbraces, "")) ) {
-
- // Try to use the native JSON parser first
- return window.JSON && window.JSON.parse ?
- window.JSON.parse( data ) :
- (new Function("return " + data))();
-
- } else {
- jQuery.error( "Invalid JSON: " + data );
- }
- },
-
- noop: function() {
- /// <summary>
- /// An empty function.
- /// </summary>
- /// <returns type="Function" />
- },
-
- // Evalulates a script in a global context
- globalEval: function( data ) {
- /// <summary>
- /// Internally evaluates a script in a global context.
- /// </summary>
- /// <private />
-
- if ( data && rnotwhite.test(data) ) {
- // Inspired by code by Andrea Giammarchi
- // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
- var head = document.getElementsByTagName("head")[0] || document.documentElement,
- script = document.createElement("script");
-
- script.type = "text/javascript";
-
- if ( jQuery.support.scriptEval ) {
- script.appendChild( document.createTextNode( data ) );
- } else {
- script.text = data;
- }
-
- // Use insertBefore instead of appendChild to circumvent an IE6 bug.
- // This arises when a base node is used (#2709).
- head.insertBefore( script, head.firstChild );
- head.removeChild( script );
- }
- },
-
- nodeName: function( elem, name ) {
- /// <summary>
- /// Checks whether the specified element has the specified DOM node name.
- /// </summary>
- /// <param name="elem" type="Element">The element to examine</param>
- /// <param name="name" type="String">The node name to check</param>
- /// <returns type="Boolean">True if the specified node name matches the node's DOM node name; otherwise false</returns>
-
- return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
- },
-
- // args is for internal usage only
- each: function( object, callback, args ) {
- /// <summary>
- /// A generic iterator function, which can be used to seemlessly
- /// iterate over both objects and arrays. This function is not the same
- /// as $().each() - which is used to iterate, exclusively, over a jQuery
- /// object. This function can be used to iterate over anything.
- /// The callback has two arguments:the key (objects) or index (arrays) as first
- /// the first, and the value as the second.
- /// Part of JavaScript
- /// </summary>
- /// <param name="obj" type="Object">
- /// The object, or array, to iterate over.
- /// </param>
- /// <param name="fn" type="Function">
- /// The function that will be executed on every object.
- /// </param>
- /// <returns type="Object" />
-
- var name, i = 0,
- length = object.length,
- isObj = length === undefined || jQuery.isFunction(object);
-
- if ( args ) {
- if ( isObj ) {
- for ( name in object ) {
- if ( callback.apply( object[ name ], args ) === false ) {
- break;
- }
- }
- } else {
- for ( ; i < length; ) {
- if ( callback.apply( object[ i++ ], args ) === false ) {
- break;
- }
- }
- }
-
- // A special, fast, case for the most common use of each
- } else {
- if ( isObj ) {
- for ( name in object ) {
- if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
- break;
- }
- }
- } else {
- for ( var value = object[0];
- i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
- }
- }
-
- return object;
- },
-
- // Use native String.trim function wherever possible
- trim: trim ?
- function( text ) {
- return text == null ?
- "" :
- trim.call( text );
- } :
-
- // Otherwise use our own trimming functionality
- function( text ) {
- return text == null ?
- "" :
- text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
- },
-
- // results is for internal usage only
- makeArray: function( array, results ) {
- /// <summary>
- /// Turns anything into a true array. This is an internal method.
- /// </summary>
- /// <param name="array" type="Object">Anything to turn into an actual Array</param>
- /// <returns type="Array" />
- /// <private />
-
- var ret = results || [];
-
- if ( array != null ) {
- // The window, strings (and functions) also have 'length'
- // The extra typeof function check is to prevent crashes
- // in Safari 2 (See: #3039)
- // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
- var type = jQuery.type(array);
-
- if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
- push.call( ret, array );
- } else {
- jQuery.merge( ret, array );
- }
- }
-
- return ret;
- },
-
- inArray: function( elem, array ) {
- if ( array.indexOf ) {
- return array.indexOf( elem );
- }
-
- for ( var i = 0, length = array.length; i < length; i++ ) {
- if ( array[ i ] === elem ) {
- return i;
- }
- }
-
- return -1;
- },
-
- merge: function( first, second ) {
- /// <summary>
- /// Merge two arrays together, removing all duplicates.
- /// The new array is: All the results from the first array, followed
- /// by the unique results from the second array.
- /// Part of JavaScript
- /// </summary>
- /// <returns type="Array" />
- /// <param name="first" type="Array">
- /// The first array to merge.
- /// </param>
- /// <param name="second" type="Array">
- /// The second array to merge.
- /// </param>
-
- var i = first.length,
- j = 0;
-
- if ( typeof second.length === "number" ) {
- for ( var l = second.length; j < l; j++ ) {
- first[ i++ ] = second[ j ];
- }
-
- } else {
- while ( second[j] !== undefined ) {
- first[ i++ ] = second[ j++ ];
- }
- }
-
- first.length = i;
-
- return first;
- },
-
- grep: function( elems, callback, inv ) {
- /// <summary>
- /// Filter items out of an array, by using a filter function.
- /// The specified function will be passed two arguments: The
- /// current array item and the index of the item in the array. The
- /// function must return 'true' to keep the item in the array,
- /// false to remove it.
- /// });
- /// Part of JavaScript
- /// </summary>
- /// <returns type="Array" />
- /// <param name="elems" type="Array">
- /// array The Array to find items in.
- /// </param>
- /// <param name="fn" type="Function">
- /// The function to process each item against.
- /// </param>
- /// <param name="inv" type="Boolean">
- /// Invert the selection - select the opposite of the function.
- /// </param>
-
- var ret = [], retVal;
- inv = !!inv;
-
- // Go through the array, only saving the items
- // that pass the validator function
- for ( var i = 0, length = elems.length; i < length; i++ ) {
- retVal = !!callback( elems[ i ], i );
- if ( inv !== retVal ) {
- ret.push( elems[ i ] );
- }
- }
-
- return ret;
- },
-
- // arg is for internal usage only
- map: function( elems, callback, arg ) {
- /// <summary>
- /// Translate all items in an array to another array of items.
- /// The translation function that is provided to this method is
- /// called for each item in the array and is passed one argument:
- /// The item to be translated.
- /// The function can then return the translated value, 'null'
- /// (to remove the item), or an array of values - which will
- /// be flattened into the full array.
- /// Part of JavaScript
- /// </summary>
- /// <returns type="Array" />
- /// <param name="elems" type="Array">
- /// array The Array to translate.
- /// </param>
- /// <param name="fn" type="Function">
- /// The function to process each item against.
- /// </param>
-
- var ret = [], value;
-
- // Go through the array, translating each of the items to their
- // new value (or values).
- for ( var i = 0, length = elems.length; i < length; i++ ) {
- value = callback( elems[ i ], i, arg );
-
- if ( value != null ) {
- ret[ ret.length ] = value;
- }
- }
-
- return ret.concat.apply( [], ret );
- },
-
- // A global GUID counter for objects
- guid: 1,
-
- proxy: function( fn, proxy, thisObject ) {
- /// <summary>
- /// Takes a function and returns a new one that will always have a particular scope.
- /// </summary>
- /// <param name="fn" type="Function">
- /// The function whose scope will be changed.
- /// </param>
- /// <param name="proxy" type="Object">
- /// The object to which the scope of the function should be set.
- /// </param>
- /// <returns type="Function" />
-
- if ( arguments.length === 2 ) {
- if ( typeof proxy === "string" ) {
- thisObject = fn;
- fn = thisObject[ proxy ];
- proxy = undefined;
-
- } else if ( proxy && !jQuery.isFunction( proxy ) ) {
- thisObject = proxy;
- proxy = undefined;
- }
- }
-
- if ( !proxy && fn ) {
- proxy = function() {
- return fn.apply( thisObject || this, arguments );
- };
- }
-
- // Set the guid of unique handler to the same of original handler, so it can be removed
- if ( fn ) {
- proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
- }
-
- // So proxy can be declared as an argument
- return proxy;
- },
-
- // Mutifunctional method to get and set values to a collection
- // The value/s can be optionally by executed if its a function
- access: function( elems, key, value, exec, fn, pass ) {
- var length = elems.length;
-
- // Setting many attributes
- if ( typeof key === "object" ) {
- for ( var k in key ) {
- jQuery.access( elems, k, key[k], exec, fn, value );
- }
- return elems;
- }
-
- // Setting one attribute
- if ( value !== undefined ) {
- // Optionally, function values get executed if exec is true
- exec = !pass && exec && jQuery.isFunction(value);
-
- for ( var i = 0; i < length; i++ ) {
- fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
- }
-
- return elems;
- }
-
- // Getting an attribute
- return length ? fn( elems[0], key ) : undefined;
- },
-
- now: function() {
- return (new Date()).getTime();
- },
-
- // Use of jQuery.browser is frowned upon.
- // More details: http://docs.jquery.com/Utilities/jQuery.browser
- uaMatch: function( ua ) {
- ua = ua.toLowerCase();
-
- var match = rwebkit.exec( ua ) ||
- ropera.exec( ua ) ||
- rmsie.exec( ua ) ||
- ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
- [];
-
- return { browser: match[1] || "", version: match[2] || "0" };
- },
-
- browser: {}
- });
-
- // Populate the class2type map
- jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
- class2type[ "[object " + name + "]" ] = name.toLowerCase();
- });
-
- browserMatch = jQuery.uaMatch( userAgent );
- if ( browserMatch.browser ) {
- jQuery.browser[ browserMatch.browser ] = true;
- jQuery.browser.version = browserMatch.version;
- }
-
- // Deprecated, use jQuery.browser.webkit instead
- if ( jQuery.browser.webkit ) {
- jQuery.browser.safari = true;
- }
-
- if ( indexOf ) {
- jQuery.inArray = function( elem, array ) {
- /// <summary>
- /// Determines the index of the first parameter in the array.
- /// </summary>
- /// <param name="elem">The value to see if it exists in the array.</param>
- /// <param name="array" type="Array">The array to look through for the value</param>
- /// <returns type="Number" integer="true">The 0-based index of the item if it was found, otherwise -1.</returns>
-
- return indexOf.call( array, elem );
- };
- }
-
- // Verify that \s matches non-breaking spaces
- // (IE fails on this test)
- if ( !rwhite.test( "\xA0" ) ) {
- trimLeft = /^[\s\xA0]+/;
- trimRight = /[\s\xA0]+$/;
- }
-
- // All jQuery objects should point back to these
- rootjQuery = jQuery(document);
-
- // Cleanup functions for the document ready method
- if ( document.addEventListener ) {
- DOMContentLoaded = function() {
- document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
- jQuery.ready();
- };
-
- } else if ( document.attachEvent ) {
- DOMContentLoaded = function() {
- // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
- if ( document.readyState === "complete" ) {
- document.detachEvent( "onreadystatechange", DOMContentLoaded );
- jQuery.ready();
- }
- };
- }
-
- // The DOM ready check for Internet Explorer
- function doScrollCheck() {
- if ( jQuery.isReady ) {
- return;
- }
-
- try {
- // If IE is used, use the trick by Diego Perini
- // http://javascript.nwbox.com/IEContentLoaded/
- document.documentElement.doScroll("left");
- } catch(e) {
- setTimeout( doScrollCheck, 1 );
- return;
- }
-
- // and execute any waiting functions
- jQuery.ready();
- }
-
- // Expose jQuery to the global object
- return (window.jQuery = window.$ = jQuery);
-
- })();
-
-
-
- // [vsdoc] The following function has been modified for IntelliSense.
- // [vsdoc] Stubbing support properties to "false" for IntelliSense compat.
- (function() {
-
- jQuery.support = {};
-
- // var root = document.documentElement,
- // script = document.createElement("script"),
- // div = document.createElement("div"),
- // id = "script" + jQuery.now();
-
- // div.style.display = "none";
- // div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
- // var all = div.getElementsByTagName("*"),
- // a = div.getElementsByTagName("a")[0],
- // select = document.createElement("select"),
- // opt = select.appendChild( document.createElement("option") );
-
- // // Can't get basic test support
- // if ( !all || !all.length || !a ) {
- // return;
- // }
-
- jQuery.support = {
- // IE strips leading whitespace when .innerHTML is used
- leadingWhitespace: false,
-
- // Make sure that tbody elements aren't automatically inserted
- // IE will insert them into empty tables
- tbody: false,
-
- // Make sure that link elements get serialized correctly by innerHTML
- // This requires a wrapper element in IE
- htmlSerialize: false,
-
- // Get the style information from getAttribute
- // (IE uses .cssText insted)
- style: false,
-
- // Make sure that URLs aren't manipulated
- // (IE normalizes it by default)
- hrefNormalized: false,
-
- // Make sure that element opacity exists
- // (IE uses filter instead)
- // Use a regex to work around a WebKit issue. See #5145
- opacity: false,
-
- // Verify style float existence
- // (IE uses styleFloat instead of cssFloat)
- cssFloat: false,
-
- // Make sure that if no value is specified for a checkbox
- // that it defaults to "on".
- // (WebKit defaults to "" instead)
- checkOn: false,
-
- // Make sure that a selected-by-default option has a working selected property.
- // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
- optSelected: false,
-
- // Will be defined later
- deleteExpando: false,
- optDisabled: false,
- checkClone: false,
- scriptEval: false,
- noCloneEvent: false,
- boxModel: false,
- inlineBlockNeedsLayout: false,
- shrinkWrapBlocks: false,
- reliableHiddenOffsets: true
- };
-
- // // Make sure that the options inside disabled selects aren't marked as disabled
- // // (WebKit marks them as diabled)
- // select.disabled = true;
- // jQuery.support.optDisabled = !opt.disabled;
-
- // script.type = "text/javascript";
- // try {
- // script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
- // } catch(e) {}
-
- // root.insertBefore( script, root.firstChild );
-
- // // Make sure that the execution of code works by injecting a script
- // // tag with appendChild/createTextNode
- // // (IE doesn't support this, fails, and uses .text instead)
- // if ( window[ id ] ) {
- // jQuery.support.scriptEval = true;
- // delete window[ id ];
- // }
-
- // // Test to see if it's possible to delete an expando from an element
- // // Fails in Internet Explorer
- // try {
- // delete script.test;
-
- // } catch(e) {
- // jQuery.support.deleteExpando = false;
- // }
-
- // root.removeChild( script );
-
- // if ( div.attachEvent && div.fireEvent ) {
- // div.attachEvent("onclick", function click() {
- // // Cloning a node shouldn't copy over any
- // // bound event handlers (IE does this)
- // jQuery.support.noCloneEvent = false;
- // div.detachEvent("onclick", click);
- // });
- // div.cloneNode(true).fireEvent("onclick");
- // }
-
- // div = document.createElement("div");
- // div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
-
- // var fragment = document.createDocumentFragment();
- // fragment.appendChild( div.firstChild );
-
- // // WebKit doesn't clone checked state correctly in fragments
- // jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
-
- // // Figure out if the W3C box model works as expected
- // // document.body must exist before we can do this
- // jQuery(function() {
- // var div = document.createElement("div");
- // div.style.width = div.style.paddingLeft = "1px";
-
- // document.body.appendChild( div );
- // jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
-
- // if ( "zoom" in div.style ) {
- // // Check if natively block-level elements act like inline-block
- // // elements when setting their display to 'inline' and giving
- // // them layout
- // // (IE < 8 does this)
- // div.style.display = "inline";
- // div.style.zoom = 1;
- // jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
-
- // // Check if elements with layout shrink-wrap their children
- // // (IE 6 does this)
- // div.style.display = "";
- // div.innerHTML = "<div style='width:4px;'></div>";
- // jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
- // }
-
- // div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";
- // var tds = div.getElementsByTagName("td");
-
- // // Check if table cells still have offsetWidth/Height when they are set
- // // to display:none and there are still other visible table cells in a
- // // table row; if so, offsetWidth/Height are not reliable for use when
- // // determining if an element has been hidden directly using
- // // display:none (it is still safe to use offsets if a parent element is
- // // hidden; don safety goggles and see bug #4512 for more information).
- // // (only IE 8 fails this test)
- // jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
-
- // tds[0].style.display = "";
- // tds[1].style.display = "none";
-
- // // Check if empty table cells still have offsetWidth/Height
- // // (IE < 8 fail this test)
- // jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
- // div.innerHTML = "";
-
- // document.body.removeChild( div ).style.display = "none";
- // div = tds = null;
- // });
-
- // // Technique from Juriy Zaytsev
- // // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
- // var eventSupported = function( eventName ) {
- // var el = document.createElement("div");
- // eventName = "on" + eventName;
-
- // var isSupported = (eventName in el);
- // if ( !isSupported ) {
- // el.setAttribute(eventName, "return;");
- // isSupported = typeof el[eventName] === "function";
- // }
- // el = null;
-
- // return isSupported;
- // };
-
- jQuery.support.submitBubbles = false;
- jQuery.support.changeBubbles = false;
-
- // // release memory in IE
- // root = script = div = all = a = null;
- })();
-
-
-
- var windowData = {},
- rbrace = /^(?:\{.*\}|\[.*\])$/;
-
- jQuery.extend({
- cache: {},
-
- // Please use with caution
- uuid: 0,
-
- // Unique for each copy of jQuery on the page
- expando: "jQuery" + jQuery.now(),
-
- // The following elements throw uncatchable exceptions if you
- // attempt to add expando properties to them.
- noData: {
- "embed": true,
- // Ban all objects except for Flash (which handle expandos)
- "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
- "applet": true
- },
-
- data: function( elem, name, data ) {
- /// <summary>
- /// Store arbitrary data associated with the specified element.
- /// </summary>
- /// <param name="elem" type="Element">
- /// The DOM element to associate with the data.
- /// </param>
- /// <param name="name" type="String">
- /// A string naming the piece of data to set.
- /// </param>
- /// <param name="value" type="Object">
- /// The new data value.
- /// </param>
- /// <returns type="jQuery" />
-
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- elem = elem == window ?
- windowData :
- elem;
-
- var isNode = elem.nodeType,
- id = isNode ? elem[ jQuery.expando ] : null,
- cache = jQuery.cache, thisCache;
-
- if ( isNode && !id && typeof name === "string" && data === undefined ) {
- return;
- }
-
- // Get the data from the object directly
- if ( !isNode ) {
- cache = elem;
-
- // Compute a unique ID for the element
- } else if ( !id ) {
- elem[ jQuery.expando ] = id = ++jQuery.uuid;
- }
-
- // Avoid generating a new cache unless none exists and we
- // want to manipulate it.
- if ( typeof name === "object" ) {
- if ( isNode ) {
- cache[ id ] = jQuery.extend(cache[ id ], name);
-
- } else {
- jQuery.extend( cache, name );
- }
-
- } else if ( isNode && !cache[ id ] ) {
- cache[ id ] = {};
- }
-
- thisCache = isNode ? cache[ id ] : cache;
-
- // Prevent overriding the named cache with undefined values
- if ( data !== undefined ) {
- thisCache[ name ] = data;
- }
-
- return typeof name === "string" ? thisCache[ name ] : thisCache;
- },
-
- removeData: function( elem, name ) {
- if ( !jQuery.acceptData( elem ) ) {
- return;
- }
-
- elem = elem == window ?
- windowData :
- elem;
-
- var isNode = elem.nodeType,
- id = isNode ? elem[ jQuery.expando ] : elem,
- cache = jQuery.cache,
- thisCache = isNode ? cache[ id ] : id;
-
- // If we want to remove a specific section of the element's data
- if ( name ) {
- if ( thisCache ) {
- // Remove the section of cache data
- delete thisCache[ name ];
-
- // If we've removed all the data, remove the element's cache
- if ( isNode && jQuery.isEmptyObject(thisCache) ) {
- jQuery.removeData( elem );
- }
- }
-
- // Otherwise, we want to remove all of the element's data
- } else {
- if ( isNode && jQuery.support.deleteExpando ) {
- delete elem[ jQuery.expando ];
-
- } else if ( elem.removeAttribute ) {
- elem.removeAttribute( jQuery.expando );
-
- // Completely remove the data cache
- } else if ( isNode ) {
- delete cache[ id ];
-
- // Remove all fields from the object
- } else {
- for ( var n in elem ) {
- delete elem[ n ];
- }
- }
- }
- },
-
- // A method for determining if a DOM node can handle the data expando
- acceptData: function( elem ) {
- if ( elem.nodeName ) {
- var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
-
- if ( match ) {
- return !(match === true || elem.getAttribute("classid") !== match);
- }
- }
-
- return true;
- }
- });
-
- jQuery.fn.extend({
- data: function( key, value ) {
- /// <summary>
- /// Store arbitrary data associated with the matched elements.
- /// </summary>
- /// <param name="key" type="String">
- /// A string naming the piece of data to set.
- /// </param>
- /// <param name="value" type="Object">
- /// The new data value.
- /// </param>
- /// <returns type="jQuery" />
-
- var data = null;
-
- if ( typeof key === "undefined" ) {
- if ( this.length ) {
- var attr = this[0].attributes, name;
- data = jQuery.data( this[0] );
-
- for ( var i = 0, l = attr.length; i < l; i++ ) {
- name = attr[i].name;
-
- if ( name.indexOf( "data-" ) === 0 ) {
- name = name.substr( 5 );
- dataAttr( this[0], name, data[ name ] );
- }
- }
- }
-
- return data;
-
- } else if ( typeof key === "object" ) {
- return this.each(function() {
- jQuery.data( this, key );
- });
- }
-
- var parts = key.split(".");
- parts[1] = parts[1] ? "." + parts[1] : "";
-
- if ( value === undefined ) {
- data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
-
- // Try to fetch any internally stored data first
- if ( data === undefined && this.length ) {
- data = jQuery.data( this[0], key );
- data = dataAttr( this[0], key, data );
- }
-
- return data === undefined && parts[1] ?
- this.data( parts[0] ) :
- data;
-
- } else {
- return this.each(function() {
- var $this = jQuery( this ),
- args = [ parts[0], value ];
-
- $this.triggerHandler( "setData" + parts[1] + "!", args );
- jQuery.data( this, key, value );
- $this.triggerHandler( "changeData" + parts[1] + "!", args );
- });
- }
- },
-
- removeData: function( key ) {
- return this.each(function() {
- jQuery.removeData( this, key );
- });
- }
- });
-
- function dataAttr( elem, key, data ) {
- // If nothing was found internally, try to fetch any
- // data from the HTML5 data-* attribute
- if ( data === undefined && elem.nodeType === 1 ) {
- data = elem.getAttribute( "data-" + key );
-
- if ( typeof data === "string" ) {
- try {
- data = data === "true" ? true :
- data === "false" ? false :
- data === "null" ? null :
- !jQuery.isNaN( data ) ? parseFloat( data ) :
- rbrace.test( data ) ? jQuery.parseJSON( data ) :
- data;
- } catch( e ) {}
-
- // Make sure we set the data so it isn't changed later
- jQuery.data( elem, key, data );
-
- } else {
- data = undefined;
- }
- }
-
- return data;
- }
-
-
-
-
- jQuery.extend({
- queue: function( elem, type, data ) {
- if ( !elem ) {
- return;
- }
-
- type = (type || "fx") + "queue";
- var q = jQuery.data( elem, type );
-
- // Speed up dequeue by getting out quickly if this is just a lookup
- if ( !data ) {
- return q || [];
- }
-
- if ( !q || jQuery.isArray(data) ) {
- q = jQuery.data( elem, type, jQuery.makeArray(data) );
-
- } else {
- q.push( data );
- }
-
- return q;
- },
-
- dequeue: function( elem, type ) {
- type = type || "fx";
-
- var queue = jQuery.queue( elem, type ),
- fn = queue.shift();
-
- // If the fx queue is dequeued, always remove the progress sentinel
- if ( fn === "inprogress" ) {
- fn = queue.shift();
- }
-
- if ( fn ) {
- // Add a progress sentinel to prevent the fx queue from being
- // automatically dequeued
- if ( type === "fx" ) {
- queue.unshift("inprogress");
- }
-
- fn.call(elem, function() {
- jQuery.dequeue(elem, type);
- …
Large files files are truncated, but you can click here to view the full file