PageRenderTime 61ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/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

  1. /*
  2. * This file has been commented to support Visual Studio Intellisense.
  3. * You should not use this file at runtime inside the browser--it is only
  4. * intended to be used only for design-time IntelliSense. Please use the
  5. * standard jQuery library for all production use.
  6. *
  7. * Comment version: 1.5.1
  8. */
  9. /*!
  10. * Note: While Microsoft is not the author of this file, Microsoft is
  11. * offering you a license subject to the terms of the Microsoft Software
  12. * License Terms for Microsoft ASP.NET Model View Controller 3.
  13. * Microsoft reserves all other rights. The notices below are provided
  14. * for informational purposes only and are not the license terms under
  15. * which Microsoft distributed this file.
  16. *
  17. * jQuery JavaScript Library v1.5.1
  18. * http://jquery.com/
  19. *
  20. * Copyright 2010, John Resig
  21. *
  22. * Includes Sizzle.js
  23. * http://sizzlejs.com/
  24. * Copyright 2010, The Dojo Foundation
  25. *
  26. */
  27. (function( window, undefined ) {
  28. // Use the correct document accordingly with window argument (sandbox)
  29. var document = window.document;
  30. var jQuery = (function() {
  31. // Define a local copy of jQuery
  32. var jQuery = function( selector, context ) {
  33. /// <summary>
  34. /// 1: $(expression, context) - This function accepts a string containing a CSS selector which is then used to match a set of elements.
  35. /// &#10;2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML.
  36. /// &#10;3: $(elements) - Wrap jQuery functionality around a single or multiple DOM Element(s).
  37. /// &#10;4: $(callback) - A shorthand for $(document).ready().
  38. /// &#10;5: $() - As of jQuery 1.4, if you pass no arguments in to the jQuery() method, an empty jQuery set will be returned.
  39. /// </summary>
  40. /// <param name="selector" type="String">
  41. /// 1: expression - An expression to search with.
  42. /// &#10;2: html - A string of HTML to create on the fly.
  43. /// &#10;3: elements - DOM element(s) to be encapsulated by a jQuery object.
  44. /// &#10;4: callback - The function to execute when the DOM is ready.
  45. /// </param>
  46. /// <param name="context" type="jQuery">
  47. /// 1: context - A DOM Element, Document or jQuery to use as context.
  48. /// </param>
  49. /// <returns type="jQuery" />
  50. // The jQuery object is actually just the init constructor 'enhanced'
  51. return new jQuery.fn.init( selector, context );
  52. },
  53. // Map over jQuery in case of overwrite
  54. _jQuery = window.jQuery,
  55. // Map over the $ in case of overwrite
  56. _$ = window.$,
  57. // A central reference to the root jQuery(document)
  58. rootjQuery,
  59. // A simple way to check for HTML strings or ID strings
  60. // (both of which we optimize for)
  61. quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
  62. // Is it a simple selector
  63. isSimple = /^.[^:#\[\.,]*$/,
  64. // Check if a string has a non-whitespace character in it
  65. rnotwhite = /\S/,
  66. rwhite = /\s/,
  67. // Used for trimming whitespace
  68. trimLeft = /^\s+/,
  69. trimRight = /\s+$/,
  70. // Check for non-word characters
  71. rnonword = /\W/,
  72. // Check for digits
  73. rdigit = /\d/,
  74. // Match a standalone tag
  75. rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
  76. // JSON RegExp
  77. rvalidchars = /^[\],:{}\s]*$/,
  78. rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
  79. rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  80. rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
  81. // Useragent RegExp
  82. rwebkit = /(webkit)[ \/]([\w.]+)/,
  83. ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
  84. rmsie = /(msie) ([\w.]+)/,
  85. rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
  86. // Keep a UserAgent string for use with jQuery.browser
  87. userAgent = navigator.userAgent,
  88. // For matching the engine and version of the browser
  89. browserMatch,
  90. // Has the ready events already been bound?
  91. readyBound = false,
  92. // The functions to execute on DOM ready
  93. readyList = [],
  94. // The ready event handler
  95. DOMContentLoaded,
  96. // Save a reference to some core methods
  97. toString = Object.prototype.toString,
  98. hasOwn = Object.prototype.hasOwnProperty,
  99. push = Array.prototype.push,
  100. slice = Array.prototype.slice,
  101. trim = String.prototype.trim,
  102. indexOf = Array.prototype.indexOf,
  103. // [[Class]] -> type pairs
  104. class2type = {};
  105. jQuery.fn = jQuery.prototype = {
  106. init: function( selector, context ) {
  107. var match, elem, ret, doc;
  108. // Handle $(""), $(null), or $(undefined)
  109. if ( !selector ) {
  110. return this;
  111. }
  112. // Handle $(DOMElement)
  113. if ( selector.nodeType ) {
  114. this.context = this[0] = selector;
  115. this.length = 1;
  116. return this;
  117. }
  118. // The body element only exists once, optimize finding it
  119. if ( selector === "body" && !context && document.body ) {
  120. this.context = document;
  121. this[0] = document.body;
  122. this.selector = "body";
  123. this.length = 1;
  124. return this;
  125. }
  126. // Handle HTML strings
  127. if ( typeof selector === "string" ) {
  128. // Are we dealing with HTML string or an ID?
  129. match = quickExpr.exec( selector );
  130. // Verify a match, and that no context was specified for #id
  131. if ( match && (match[1] || !context) ) {
  132. // HANDLE: $(html) -> $(array)
  133. if ( match[1] ) {
  134. doc = (context ? context.ownerDocument || context : document);
  135. // If a single string is passed in and it's a single tag
  136. // just do a createElement and skip the rest
  137. ret = rsingleTag.exec( selector );
  138. if ( ret ) {
  139. if ( jQuery.isPlainObject( context ) ) {
  140. selector = [ document.createElement( ret[1] ) ];
  141. jQuery.fn.attr.call( selector, context, true );
  142. } else {
  143. selector = [ doc.createElement( ret[1] ) ];
  144. }
  145. } else {
  146. ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
  147. selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
  148. }
  149. return jQuery.merge( this, selector );
  150. // HANDLE: $("#id")
  151. } else {
  152. elem = document.getElementById( match[2] );
  153. // Check parentNode to catch when Blackberry 4.6 returns
  154. // nodes that are no longer in the document #6963
  155. if ( elem && elem.parentNode ) {
  156. // Handle the case where IE and Opera return items
  157. // by name instead of ID
  158. if ( elem.id !== match[2] ) {
  159. return rootjQuery.find( selector );
  160. }
  161. // Otherwise, we inject the element directly into the jQuery object
  162. this.length = 1;
  163. this[0] = elem;
  164. }
  165. this.context = document;
  166. this.selector = selector;
  167. return this;
  168. }
  169. // HANDLE: $("TAG")
  170. } else if ( !context && !rnonword.test( selector ) ) {
  171. this.selector = selector;
  172. this.context = document;
  173. selector = document.getElementsByTagName( selector );
  174. return jQuery.merge( this, selector );
  175. // HANDLE: $(expr, $(...))
  176. } else if ( !context || context.jquery ) {
  177. return (context || rootjQuery).find( selector );
  178. // HANDLE: $(expr, context)
  179. // (which is just equivalent to: $(context).find(expr)
  180. } else {
  181. return jQuery( context ).find( selector );
  182. }
  183. // HANDLE: $(function)
  184. // Shortcut for document ready
  185. } else if ( jQuery.isFunction( selector ) ) {
  186. return rootjQuery.ready( selector );
  187. }
  188. if (selector.selector !== undefined) {
  189. this.selector = selector.selector;
  190. this.context = selector.context;
  191. }
  192. return jQuery.makeArray( selector, this );
  193. },
  194. // Start with an empty selector
  195. selector: "",
  196. // The current version of jQuery being used
  197. jquery: "1.4.4",
  198. // The default length of a jQuery object is 0
  199. length: 0,
  200. // The number of elements contained in the matched element set
  201. size: function() {
  202. /// <summary>
  203. /// &#10;The number of elements currently matched.
  204. /// &#10;Part of Core
  205. /// </summary>
  206. /// <returns type="Number" />
  207. return this.length;
  208. },
  209. toArray: function() {
  210. /// <summary>
  211. /// &#10;Retrieve all the DOM elements contained in the jQuery set, as an array.
  212. /// </summary>
  213. /// <returns type="Array" />
  214. return slice.call( this, 0 );
  215. },
  216. // Get the Nth element in the matched element set OR
  217. // Get the whole matched element set as a clean array
  218. get: function( num ) {
  219. /// <summary>
  220. /// &#10;Access a single matched element. num is used to access the
  221. /// &#10;Nth element matched.
  222. /// &#10;Part of Core
  223. /// </summary>
  224. /// <returns type="Element" />
  225. /// <param name="num" type="Number">
  226. /// &#10;Access the element in the Nth position.
  227. /// </param>
  228. return num == null ?
  229. // Return a 'clean' array
  230. this.toArray() :
  231. // Return just the object
  232. ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
  233. },
  234. // Take an array of elements and push it onto the stack
  235. // (returning the new matched element set)
  236. pushStack: function( elems, name, selector ) {
  237. /// <summary>
  238. /// &#10;Set the jQuery object to an array of elements, while maintaining
  239. /// &#10;the stack.
  240. /// &#10;Part of Core
  241. /// </summary>
  242. /// <returns type="jQuery" />
  243. /// <param name="elems" type="Elements">
  244. /// &#10;An array of elements
  245. /// </param>
  246. // Build a new jQuery matched element set
  247. var ret = jQuery();
  248. if ( jQuery.isArray( elems ) ) {
  249. push.apply( ret, elems );
  250. } else {
  251. jQuery.merge( ret, elems );
  252. }
  253. // Add the old object onto the stack (as a reference)
  254. ret.prevObject = this;
  255. ret.context = this.context;
  256. if ( name === "find" ) {
  257. ret.selector = this.selector + (this.selector ? " " : "") + selector;
  258. } else if ( name ) {
  259. ret.selector = this.selector + "." + name + "(" + selector + ")";
  260. }
  261. // Return the newly-formed element set
  262. return ret;
  263. },
  264. // Execute a callback for every element in the matched set.
  265. // (You can seed the arguments with an array of args, but this is
  266. // only used internally.)
  267. each: function( callback, args ) {
  268. /// <summary>
  269. /// &#10;Execute a function within the context of every matched element.
  270. /// &#10;This means that every time the passed-in function is executed
  271. /// &#10;(which is once for every element matched) the 'this' keyword
  272. /// &#10;points to the specific element.
  273. /// &#10;Additionally, the function, when executed, is passed a single
  274. /// &#10;argument representing the position of the element in the matched
  275. /// &#10;set.
  276. /// &#10;Part of Core
  277. /// </summary>
  278. /// <returns type="jQuery" />
  279. /// <param name="callback" type="Function">
  280. /// &#10;A function to execute
  281. /// </param>
  282. return jQuery.each( this, callback, args );
  283. },
  284. ready: function( fn ) {
  285. /// <summary>
  286. /// &#10;Binds a function to be executed whenever the DOM is ready to be traversed and manipulated.
  287. /// </summary>
  288. /// <param name="fn" type="Function">The function to be executed when the DOM is ready.</param>
  289. // Attach the listeners
  290. jQuery.bindReady();
  291. // If the DOM is already ready
  292. if ( jQuery.isReady ) {
  293. // Execute the function immediately
  294. fn.call( document, jQuery );
  295. // Otherwise, remember the function for later
  296. } else if ( readyList ) {
  297. // Add the function to the wait list
  298. readyList.push( fn );
  299. }
  300. return this;
  301. },
  302. eq: function( i ) {
  303. /// <summary>
  304. /// &#10;Reduce the set of matched elements to a single element.
  305. /// &#10;The position of the element in the set of matched elements
  306. /// &#10;starts at 0 and goes to length - 1.
  307. /// &#10;Part of Core
  308. /// </summary>
  309. /// <returns type="jQuery" />
  310. /// <param name="num" type="Number">
  311. /// &#10;pos The index of the element that you wish to limit to.
  312. /// </param>
  313. return i === -1 ?
  314. this.slice( i ) :
  315. this.slice( i, +i + 1 );
  316. },
  317. first: function() {
  318. /// <summary>
  319. /// &#10;Reduce the set of matched elements to the first in the set.
  320. /// </summary>
  321. /// <returns type="jQuery" />
  322. return this.eq( 0 );
  323. },
  324. last: function() {
  325. /// <summary>
  326. /// &#10;Reduce the set of matched elements to the final one in the set.
  327. /// </summary>
  328. /// <returns type="jQuery" />
  329. return this.eq( -1 );
  330. },
  331. slice: function() {
  332. /// <summary>
  333. /// &#10;Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method.
  334. /// </summary>
  335. /// <param name="start" type="Number" integer="true">Where to start the subset (0-based).</param>
  336. /// <param name="end" optional="true" type="Number" integer="true">Where to end the subset (not including the end element itself).
  337. /// &#10;If omitted, ends at the end of the selection</param>
  338. /// <returns type="jQuery">The sliced elements</returns>
  339. return this.pushStack( slice.apply( this, arguments ),
  340. "slice", slice.call(arguments).join(",") );
  341. },
  342. map: function( callback ) {
  343. /// <summary>
  344. /// &#10;This member is internal.
  345. /// </summary>
  346. /// <private />
  347. /// <returns type="jQuery" />
  348. return this.pushStack( jQuery.map(this, function( elem, i ) {
  349. return callback.call( elem, i, elem );
  350. }));
  351. },
  352. end: function() {
  353. /// <summary>
  354. /// &#10;End the most recent 'destructive' operation, reverting the list of matched elements
  355. /// &#10;back to its previous state. After an end operation, the list of matched elements will
  356. /// &#10;revert to the last state of matched elements.
  357. /// &#10;If there was no destructive operation before, an empty set is returned.
  358. /// &#10;Part of DOM/Traversing
  359. /// </summary>
  360. /// <returns type="jQuery" />
  361. return this.prevObject || jQuery(null);
  362. },
  363. // For internal use only.
  364. // Behaves like an Array's method, not like a jQuery method.
  365. push: push,
  366. sort: [].sort,
  367. splice: [].splice
  368. };
  369. // Give the init function the jQuery prototype for later instantiation
  370. jQuery.fn.init.prototype = jQuery.fn;
  371. jQuery.extend = jQuery.fn.extend = function() {
  372. /// <summary>
  373. /// &#10;Extend one object with one or more others, returning the original,
  374. /// &#10;modified, object. This is a great utility for simple inheritance.
  375. /// &#10;jQuery.extend(settings, options);
  376. /// &#10;var settings = jQuery.extend({}, defaults, options);
  377. /// &#10;Part of JavaScript
  378. /// </summary>
  379. /// <param name="target" type="Object">
  380. /// &#10; The object to extend
  381. /// </param>
  382. /// <param name="prop1" type="Object">
  383. /// &#10; The object that will be merged into the first.
  384. /// </param>
  385. /// <param name="propN" type="Object" optional="true" parameterArray="true">
  386. /// &#10; (optional) More objects to merge into the first
  387. /// </param>
  388. /// <returns type="Object" />
  389. var options, name, src, copy, copyIsArray, clone,
  390. target = arguments[0] || {},
  391. i = 1,
  392. length = arguments.length,
  393. deep = false;
  394. // Handle a deep copy situation
  395. if ( typeof target === "boolean" ) {
  396. deep = target;
  397. target = arguments[1] || {};
  398. // skip the boolean and the target
  399. i = 2;
  400. }
  401. // Handle case when target is a string or something (possible in deep copy)
  402. if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  403. target = {};
  404. }
  405. // extend jQuery itself if only one argument is passed
  406. if ( length === i ) {
  407. target = this;
  408. --i;
  409. }
  410. for ( ; i < length; i++ ) {
  411. // Only deal with non-null/undefined values
  412. if ( (options = arguments[ i ]) != null ) {
  413. // Extend the base object
  414. for ( name in options ) {
  415. src = target[ name ];
  416. copy = options[ name ];
  417. // Prevent never-ending loop
  418. if ( target === copy ) {
  419. continue;
  420. }
  421. // Recurse if we're merging plain objects or arrays
  422. if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
  423. if ( copyIsArray ) {
  424. copyIsArray = false;
  425. clone = src && jQuery.isArray(src) ? src : [];
  426. } else {
  427. clone = src && jQuery.isPlainObject(src) ? src : {};
  428. }
  429. // Never move original objects, clone them
  430. target[ name ] = jQuery.extend( deep, clone, copy );
  431. // Don't bring in undefined values
  432. } else if ( copy !== undefined ) {
  433. target[ name ] = copy;
  434. }
  435. }
  436. }
  437. }
  438. // Return the modified object
  439. return target;
  440. };
  441. jQuery.extend({
  442. noConflict: function( deep ) {
  443. /// <summary>
  444. /// &#10;Run this function to give control of the $ variable back
  445. /// &#10;to whichever library first implemented it. This helps to make
  446. /// &#10;sure that jQuery doesn't conflict with the $ object
  447. /// &#10;of other libraries.
  448. /// &#10;By using this function, you will only be able to access jQuery
  449. /// &#10;using the 'jQuery' variable. For example, where you used to do
  450. /// &#10;$(&quot;div p&quot;), you now must do jQuery(&quot;div p&quot;).
  451. /// &#10;Part of Core
  452. /// </summary>
  453. /// <returns type="undefined" />
  454. window.$ = _$;
  455. if ( deep ) {
  456. window.jQuery = _jQuery;
  457. }
  458. return jQuery;
  459. },
  460. // Is the DOM ready to be used? Set to true once it occurs.
  461. isReady: false,
  462. // A counter to track how many items to wait for before
  463. // the ready event fires. See #6781
  464. readyWait: 1,
  465. // Handle when the DOM is ready
  466. ready: function( wait ) {
  467. /// <summary>
  468. /// &#10;This method is internal.
  469. /// </summary>
  470. /// <private />
  471. // A third-party is pushing the ready event forwards
  472. if ( wait === true ) {
  473. jQuery.readyWait--;
  474. }
  475. // Make sure that the DOM is not already loaded
  476. if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
  477. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  478. if ( !document.body ) {
  479. return setTimeout( jQuery.ready, 1 );
  480. }
  481. // Remember that the DOM is ready
  482. jQuery.isReady = true;
  483. // If a normal DOM Ready event fired, decrement, and wait if need be
  484. if ( wait !== true && --jQuery.readyWait > 0 ) {
  485. return;
  486. }
  487. // If there are functions bound, to execute
  488. if ( readyList ) {
  489. // Execute all of them
  490. var fn,
  491. i = 0,
  492. ready = readyList;
  493. // Reset the list of functions
  494. readyList = null;
  495. while ( (fn = ready[ i++ ]) ) {
  496. fn.call( document, jQuery );
  497. }
  498. // Trigger any bound ready events
  499. if ( jQuery.fn.trigger ) {
  500. jQuery( document ).trigger( "ready" ).unbind( "ready" );
  501. }
  502. }
  503. }
  504. },
  505. bindReady: function() {
  506. if ( readyBound ) {
  507. return;
  508. }
  509. readyBound = true;
  510. // Catch cases where $(document).ready() is called after the
  511. // browser event has already occurred.
  512. if ( document.readyState === "complete" ) {
  513. // Handle it asynchronously to allow scripts the opportunity to delay ready
  514. return setTimeout( jQuery.ready, 1 );
  515. }
  516. // Mozilla, Opera and webkit nightlies currently support this event
  517. if ( document.addEventListener ) {
  518. // Use the handy event callback
  519. document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  520. // A fallback to window.onload, that will always work
  521. window.addEventListener( "load", jQuery.ready, false );
  522. // If IE event model is used
  523. } else if ( document.attachEvent ) {
  524. // ensure firing before onload,
  525. // maybe late but safe also for iframes
  526. document.attachEvent("onreadystatechange", DOMContentLoaded);
  527. // A fallback to window.onload, that will always work
  528. window.attachEvent( "onload", jQuery.ready );
  529. // If IE and not a frame
  530. // continually check to see if the document is ready
  531. var toplevel = false;
  532. try {
  533. toplevel = window.frameElement == null;
  534. } catch(e) {}
  535. if ( document.documentElement.doScroll && toplevel ) {
  536. doScrollCheck();
  537. }
  538. }
  539. },
  540. // See test/unit/core.js for details concerning isFunction.
  541. // Since version 1.3, DOM methods and functions like alert
  542. // aren't supported. They return false on IE (#2968).
  543. isFunction: function( obj ) {
  544. /// <summary>
  545. /// &#10;Determines if the parameter passed is a function.
  546. /// </summary>
  547. /// <param name="obj" type="Object">The object to check</param>
  548. /// <returns type="Boolean">True if the parameter is a function; otherwise false.</returns>
  549. return jQuery.type(obj) === "function";
  550. },
  551. isArray: Array.isArray || function( obj ) {
  552. /// <summary>
  553. /// &#10;Determine if the parameter passed is an array.
  554. /// </summary>
  555. /// <param name="obj" type="Object">Object to test whether or not it is an array.</param>
  556. /// <returns type="Boolean">True if the parameter is a function; otherwise false.</returns>
  557. return jQuery.type(obj) === "array";
  558. },
  559. // A crude way of determining if an object is a window
  560. isWindow: function( obj ) {
  561. return obj && typeof obj === "object" && "setInterval" in obj;
  562. },
  563. isNaN: function( obj ) {
  564. return obj == null || !rdigit.test( obj ) || isNaN( obj );
  565. },
  566. type: function( obj ) {
  567. return obj == null ?
  568. String( obj ) :
  569. class2type[ toString.call(obj) ] || "object";
  570. },
  571. isPlainObject: function( obj ) {
  572. /// <summary>
  573. /// &#10;Check to see if an object is a plain object (created using "{}" or "new Object").
  574. /// </summary>
  575. /// <param name="obj" type="Object">
  576. /// &#10;The object that will be checked to see if it's a plain object.
  577. /// </param>
  578. /// <returns type="Boolean" />
  579. // Must be an Object.
  580. // Because of IE, we also have to check the presence of the constructor property.
  581. // Make sure that DOM nodes and window objects don't pass through, as well
  582. if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  583. return false;
  584. }
  585. // Not own constructor property must be Object
  586. if ( obj.constructor &&
  587. !hasOwn.call(obj, "constructor") &&
  588. !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
  589. return false;
  590. }
  591. // Own properties are enumerated firstly, so to speed up,
  592. // if last one is own, then all properties are own.
  593. var key;
  594. for ( key in obj ) {}
  595. return key === undefined || hasOwn.call( obj, key );
  596. },
  597. isEmptyObject: function( obj ) {
  598. /// <summary>
  599. /// &#10;Check to see if an object is empty (contains no properties).
  600. /// </summary>
  601. /// <param name="obj" type="Object">
  602. /// &#10;The object that will be checked to see if it's empty.
  603. /// </param>
  604. /// <returns type="Boolean" />
  605. for ( var name in obj ) {
  606. return false;
  607. }
  608. return true;
  609. },
  610. error: function( msg ) {
  611. throw msg;
  612. },
  613. parseJSON: function( data ) {
  614. if ( typeof data !== "string" || !data ) {
  615. return null;
  616. }
  617. // Make sure leading/trailing whitespace is removed (IE can't handle it)
  618. data = jQuery.trim( data );
  619. // Make sure the incoming data is actual JSON
  620. // Logic borrowed from http://json.org/json2.js
  621. if ( rvalidchars.test(data.replace(rvalidescape, "@")
  622. .replace(rvalidtokens, "]")
  623. .replace(rvalidbraces, "")) ) {
  624. // Try to use the native JSON parser first
  625. return window.JSON && window.JSON.parse ?
  626. window.JSON.parse( data ) :
  627. (new Function("return " + data))();
  628. } else {
  629. jQuery.error( "Invalid JSON: " + data );
  630. }
  631. },
  632. noop: function() {
  633. /// <summary>
  634. /// &#10;An empty function.
  635. /// </summary>
  636. /// <returns type="Function" />
  637. },
  638. // Evalulates a script in a global context
  639. globalEval: function( data ) {
  640. /// <summary>
  641. /// &#10;Internally evaluates a script in a global context.
  642. /// </summary>
  643. /// <private />
  644. if ( data && rnotwhite.test(data) ) {
  645. // Inspired by code by Andrea Giammarchi
  646. // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
  647. var head = document.getElementsByTagName("head")[0] || document.documentElement,
  648. script = document.createElement("script");
  649. script.type = "text/javascript";
  650. if ( jQuery.support.scriptEval ) {
  651. script.appendChild( document.createTextNode( data ) );
  652. } else {
  653. script.text = data;
  654. }
  655. // Use insertBefore instead of appendChild to circumvent an IE6 bug.
  656. // This arises when a base node is used (#2709).
  657. head.insertBefore( script, head.firstChild );
  658. head.removeChild( script );
  659. }
  660. },
  661. nodeName: function( elem, name ) {
  662. /// <summary>
  663. /// &#10;Checks whether the specified element has the specified DOM node name.
  664. /// </summary>
  665. /// <param name="elem" type="Element">The element to examine</param>
  666. /// <param name="name" type="String">The node name to check</param>
  667. /// <returns type="Boolean">True if the specified node name matches the node's DOM node name; otherwise false</returns>
  668. return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
  669. },
  670. // args is for internal usage only
  671. each: function( object, callback, args ) {
  672. /// <summary>
  673. /// &#10;A generic iterator function, which can be used to seemlessly
  674. /// &#10;iterate over both objects and arrays. This function is not the same
  675. /// &#10;as $().each() - which is used to iterate, exclusively, over a jQuery
  676. /// &#10;object. This function can be used to iterate over anything.
  677. /// &#10;The callback has two arguments:the key (objects) or index (arrays) as first
  678. /// &#10;the first, and the value as the second.
  679. /// &#10;Part of JavaScript
  680. /// </summary>
  681. /// <param name="obj" type="Object">
  682. /// &#10; The object, or array, to iterate over.
  683. /// </param>
  684. /// <param name="fn" type="Function">
  685. /// &#10; The function that will be executed on every object.
  686. /// </param>
  687. /// <returns type="Object" />
  688. var name, i = 0,
  689. length = object.length,
  690. isObj = length === undefined || jQuery.isFunction(object);
  691. if ( args ) {
  692. if ( isObj ) {
  693. for ( name in object ) {
  694. if ( callback.apply( object[ name ], args ) === false ) {
  695. break;
  696. }
  697. }
  698. } else {
  699. for ( ; i < length; ) {
  700. if ( callback.apply( object[ i++ ], args ) === false ) {
  701. break;
  702. }
  703. }
  704. }
  705. // A special, fast, case for the most common use of each
  706. } else {
  707. if ( isObj ) {
  708. for ( name in object ) {
  709. if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
  710. break;
  711. }
  712. }
  713. } else {
  714. for ( var value = object[0];
  715. i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
  716. }
  717. }
  718. return object;
  719. },
  720. // Use native String.trim function wherever possible
  721. trim: trim ?
  722. function( text ) {
  723. return text == null ?
  724. "" :
  725. trim.call( text );
  726. } :
  727. // Otherwise use our own trimming functionality
  728. function( text ) {
  729. return text == null ?
  730. "" :
  731. text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
  732. },
  733. // results is for internal usage only
  734. makeArray: function( array, results ) {
  735. /// <summary>
  736. /// &#10;Turns anything into a true array. This is an internal method.
  737. /// </summary>
  738. /// <param name="array" type="Object">Anything to turn into an actual Array</param>
  739. /// <returns type="Array" />
  740. /// <private />
  741. var ret = results || [];
  742. if ( array != null ) {
  743. // The window, strings (and functions) also have 'length'
  744. // The extra typeof function check is to prevent crashes
  745. // in Safari 2 (See: #3039)
  746. // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
  747. var type = jQuery.type(array);
  748. if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
  749. push.call( ret, array );
  750. } else {
  751. jQuery.merge( ret, array );
  752. }
  753. }
  754. return ret;
  755. },
  756. inArray: function( elem, array ) {
  757. if ( array.indexOf ) {
  758. return array.indexOf( elem );
  759. }
  760. for ( var i = 0, length = array.length; i < length; i++ ) {
  761. if ( array[ i ] === elem ) {
  762. return i;
  763. }
  764. }
  765. return -1;
  766. },
  767. merge: function( first, second ) {
  768. /// <summary>
  769. /// &#10;Merge two arrays together, removing all duplicates.
  770. /// &#10;The new array is: All the results from the first array, followed
  771. /// &#10;by the unique results from the second array.
  772. /// &#10;Part of JavaScript
  773. /// </summary>
  774. /// <returns type="Array" />
  775. /// <param name="first" type="Array">
  776. /// &#10; The first array to merge.
  777. /// </param>
  778. /// <param name="second" type="Array">
  779. /// &#10; The second array to merge.
  780. /// </param>
  781. var i = first.length,
  782. j = 0;
  783. if ( typeof second.length === "number" ) {
  784. for ( var l = second.length; j < l; j++ ) {
  785. first[ i++ ] = second[ j ];
  786. }
  787. } else {
  788. while ( second[j] !== undefined ) {
  789. first[ i++ ] = second[ j++ ];
  790. }
  791. }
  792. first.length = i;
  793. return first;
  794. },
  795. grep: function( elems, callback, inv ) {
  796. /// <summary>
  797. /// &#10;Filter items out of an array, by using a filter function.
  798. /// &#10;The specified function will be passed two arguments: The
  799. /// &#10;current array item and the index of the item in the array. The
  800. /// &#10;function must return 'true' to keep the item in the array,
  801. /// &#10;false to remove it.
  802. /// &#10;});
  803. /// &#10;Part of JavaScript
  804. /// </summary>
  805. /// <returns type="Array" />
  806. /// <param name="elems" type="Array">
  807. /// &#10;array The Array to find items in.
  808. /// </param>
  809. /// <param name="fn" type="Function">
  810. /// &#10; The function to process each item against.
  811. /// </param>
  812. /// <param name="inv" type="Boolean">
  813. /// &#10; Invert the selection - select the opposite of the function.
  814. /// </param>
  815. var ret = [], retVal;
  816. inv = !!inv;
  817. // Go through the array, only saving the items
  818. // that pass the validator function
  819. for ( var i = 0, length = elems.length; i < length; i++ ) {
  820. retVal = !!callback( elems[ i ], i );
  821. if ( inv !== retVal ) {
  822. ret.push( elems[ i ] );
  823. }
  824. }
  825. return ret;
  826. },
  827. // arg is for internal usage only
  828. map: function( elems, callback, arg ) {
  829. /// <summary>
  830. /// &#10;Translate all items in an array to another array of items.
  831. /// &#10;The translation function that is provided to this method is
  832. /// &#10;called for each item in the array and is passed one argument:
  833. /// &#10;The item to be translated.
  834. /// &#10;The function can then return the translated value, 'null'
  835. /// &#10;(to remove the item), or an array of values - which will
  836. /// &#10;be flattened into the full array.
  837. /// &#10;Part of JavaScript
  838. /// </summary>
  839. /// <returns type="Array" />
  840. /// <param name="elems" type="Array">
  841. /// &#10;array The Array to translate.
  842. /// </param>
  843. /// <param name="fn" type="Function">
  844. /// &#10; The function to process each item against.
  845. /// </param>
  846. var ret = [], value;
  847. // Go through the array, translating each of the items to their
  848. // new value (or values).
  849. for ( var i = 0, length = elems.length; i < length; i++ ) {
  850. value = callback( elems[ i ], i, arg );
  851. if ( value != null ) {
  852. ret[ ret.length ] = value;
  853. }
  854. }
  855. return ret.concat.apply( [], ret );
  856. },
  857. // A global GUID counter for objects
  858. guid: 1,
  859. proxy: function( fn, proxy, thisObject ) {
  860. /// <summary>
  861. /// &#10;Takes a function and returns a new one that will always have a particular scope.
  862. /// </summary>
  863. /// <param name="fn" type="Function">
  864. /// &#10;The function whose scope will be changed.
  865. /// </param>
  866. /// <param name="proxy" type="Object">
  867. /// &#10;The object to which the scope of the function should be set.
  868. /// </param>
  869. /// <returns type="Function" />
  870. if ( arguments.length === 2 ) {
  871. if ( typeof proxy === "string" ) {
  872. thisObject = fn;
  873. fn = thisObject[ proxy ];
  874. proxy = undefined;
  875. } else if ( proxy && !jQuery.isFunction( proxy ) ) {
  876. thisObject = proxy;
  877. proxy = undefined;
  878. }
  879. }
  880. if ( !proxy && fn ) {
  881. proxy = function() {
  882. return fn.apply( thisObject || this, arguments );
  883. };
  884. }
  885. // Set the guid of unique handler to the same of original handler, so it can be removed
  886. if ( fn ) {
  887. proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
  888. }
  889. // So proxy can be declared as an argument
  890. return proxy;
  891. },
  892. // Mutifunctional method to get and set values to a collection
  893. // The value/s can be optionally by executed if its a function
  894. access: function( elems, key, value, exec, fn, pass ) {
  895. var length = elems.length;
  896. // Setting many attributes
  897. if ( typeof key === "object" ) {
  898. for ( var k in key ) {
  899. jQuery.access( elems, k, key[k], exec, fn, value );
  900. }
  901. return elems;
  902. }
  903. // Setting one attribute
  904. if ( value !== undefined ) {
  905. // Optionally, function values get executed if exec is true
  906. exec = !pass && exec && jQuery.isFunction(value);
  907. for ( var i = 0; i < length; i++ ) {
  908. fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
  909. }
  910. return elems;
  911. }
  912. // Getting an attribute
  913. return length ? fn( elems[0], key ) : undefined;
  914. },
  915. now: function() {
  916. return (new Date()).getTime();
  917. },
  918. // Use of jQuery.browser is frowned upon.
  919. // More details: http://docs.jquery.com/Utilities/jQuery.browser
  920. uaMatch: function( ua ) {
  921. ua = ua.toLowerCase();
  922. var match = rwebkit.exec( ua ) ||
  923. ropera.exec( ua ) ||
  924. rmsie.exec( ua ) ||
  925. ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
  926. [];
  927. return { browser: match[1] || "", version: match[2] || "0" };
  928. },
  929. browser: {}
  930. });
  931. // Populate the class2type map
  932. jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
  933. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  934. });
  935. browserMatch = jQuery.uaMatch( userAgent );
  936. if ( browserMatch.browser ) {
  937. jQuery.browser[ browserMatch.browser ] = true;
  938. jQuery.browser.version = browserMatch.version;
  939. }
  940. // Deprecated, use jQuery.browser.webkit instead
  941. if ( jQuery.browser.webkit ) {
  942. jQuery.browser.safari = true;
  943. }
  944. if ( indexOf ) {
  945. jQuery.inArray = function( elem, array ) {
  946. /// <summary>
  947. /// &#10;Determines the index of the first parameter in the array.
  948. /// </summary>
  949. /// <param name="elem">The value to see if it exists in the array.</param>
  950. /// <param name="array" type="Array">The array to look through for the value</param>
  951. /// <returns type="Number" integer="true">The 0-based index of the item if it was found, otherwise -1.</returns>
  952. return indexOf.call( array, elem );
  953. };
  954. }
  955. // Verify that \s matches non-breaking spaces
  956. // (IE fails on this test)
  957. if ( !rwhite.test( "\xA0" ) ) {
  958. trimLeft = /^[\s\xA0]+/;
  959. trimRight = /[\s\xA0]+$/;
  960. }
  961. // All jQuery objects should point back to these
  962. rootjQuery = jQuery(document);
  963. // Cleanup functions for the document ready method
  964. if ( document.addEventListener ) {
  965. DOMContentLoaded = function() {
  966. document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  967. jQuery.ready();
  968. };
  969. } else if ( document.attachEvent ) {
  970. DOMContentLoaded = function() {
  971. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  972. if ( document.readyState === "complete" ) {
  973. document.detachEvent( "onreadystatechange", DOMContentLoaded );
  974. jQuery.ready();
  975. }
  976. };
  977. }
  978. // The DOM ready check for Internet Explorer
  979. function doScrollCheck() {
  980. if ( jQuery.isReady ) {
  981. return;
  982. }
  983. try {
  984. // If IE is used, use the trick by Diego Perini
  985. // http://javascript.nwbox.com/IEContentLoaded/
  986. document.documentElement.doScroll("left");
  987. } catch(e) {
  988. setTimeout( doScrollCheck, 1 );
  989. return;
  990. }
  991. // and execute any waiting functions
  992. jQuery.ready();
  993. }
  994. // Expose jQuery to the global object
  995. return (window.jQuery = window.$ = jQuery);
  996. })();
  997. // [vsdoc] The following function has been modified for IntelliSense.
  998. // [vsdoc] Stubbing support properties to "false" for IntelliSense compat.
  999. (function() {
  1000. jQuery.support = {};
  1001. // var root = document.documentElement,
  1002. // script = document.createElement("script"),
  1003. // div = document.createElement("div"),
  1004. // id = "script" + jQuery.now();
  1005. // div.style.display = "none";
  1006. // div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
  1007. // var all = div.getElementsByTagName("*"),
  1008. // a = div.getElementsByTagName("a")[0],
  1009. // select = document.createElement("select"),
  1010. // opt = select.appendChild( document.createElement("option") );
  1011. // // Can't get basic test support
  1012. // if ( !all || !all.length || !a ) {
  1013. // return;
  1014. // }
  1015. jQuery.support = {
  1016. // IE strips leading whitespace when .innerHTML is used
  1017. leadingWhitespace: false,
  1018. // Make sure that tbody elements aren't automatically inserted
  1019. // IE will insert them into empty tables
  1020. tbody: false,
  1021. // Make sure that link elements get serialized correctly by innerHTML
  1022. // This requires a wrapper element in IE
  1023. htmlSerialize: false,
  1024. // Get the style information from getAttribute
  1025. // (IE uses .cssText insted)
  1026. style: false,
  1027. // Make sure that URLs aren't manipulated
  1028. // (IE normalizes it by default)
  1029. hrefNormalized: false,
  1030. // Make sure that element opacity exists
  1031. // (IE uses filter instead)
  1032. // Use a regex to work around a WebKit issue. See #5145
  1033. opacity: false,
  1034. // Verify style float existence
  1035. // (IE uses styleFloat instead of cssFloat)
  1036. cssFloat: false,
  1037. // Make sure that if no value is specified for a checkbox
  1038. // that it defaults to "on".
  1039. // (WebKit defaults to "" instead)
  1040. checkOn: false,
  1041. // Make sure that a selected-by-default option has a working selected property.
  1042. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
  1043. optSelected: false,
  1044. // Will be defined later
  1045. deleteExpando: false,
  1046. optDisabled: false,
  1047. checkClone: false,
  1048. scriptEval: false,
  1049. noCloneEvent: false,
  1050. boxModel: false,
  1051. inlineBlockNeedsLayout: false,
  1052. shrinkWrapBlocks: false,
  1053. reliableHiddenOffsets: true
  1054. };
  1055. // // Make sure that the options inside disabled selects aren't marked as disabled
  1056. // // (WebKit marks them as diabled)
  1057. // select.disabled = true;
  1058. // jQuery.support.optDisabled = !opt.disabled;
  1059. // script.type = "text/javascript";
  1060. // try {
  1061. // script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
  1062. // } catch(e) {}
  1063. // root.insertBefore( script, root.firstChild );
  1064. // // Make sure that the execution of code works by injecting a script
  1065. // // tag with appendChild/createTextNode
  1066. // // (IE doesn't support this, fails, and uses .text instead)
  1067. // if ( window[ id ] ) {
  1068. // jQuery.support.scriptEval = true;
  1069. // delete window[ id ];
  1070. // }
  1071. // // Test to see if it's possible to delete an expando from an element
  1072. // // Fails in Internet Explorer
  1073. // try {
  1074. // delete script.test;
  1075. // } catch(e) {
  1076. // jQuery.support.deleteExpando = false;
  1077. // }
  1078. // root.removeChild( script );
  1079. // if ( div.attachEvent && div.fireEvent ) {
  1080. // div.attachEvent("onclick", function click() {
  1081. // // Cloning a node shouldn't copy over any
  1082. // // bound event handlers (IE does this)
  1083. // jQuery.support.noCloneEvent = false;
  1084. // div.detachEvent("onclick", click);
  1085. // });
  1086. // div.cloneNode(true).fireEvent("onclick");
  1087. // }
  1088. // div = document.createElement("div");
  1089. // div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
  1090. // var fragment = document.createDocumentFragment();
  1091. // fragment.appendChild( div.firstChild );
  1092. // // WebKit doesn't clone checked state correctly in fragments
  1093. // jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
  1094. // // Figure out if the W3C box model works as expected
  1095. // // document.body must exist before we can do this
  1096. // jQuery(function() {
  1097. // var div = document.createElement("div");
  1098. // div.style.width = div.style.paddingLeft = "1px";
  1099. // document.body.appendChild( div );
  1100. // jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
  1101. // if ( "zoom" in div.style ) {
  1102. // // Check if natively block-level elements act like inline-block
  1103. // // elements when setting their display to 'inline' and giving
  1104. // // them layout
  1105. // // (IE < 8 does this)
  1106. // div.style.display = "inline";
  1107. // div.style.zoom = 1;
  1108. // jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
  1109. // // Check if elements with layout shrink-wrap their children
  1110. // // (IE 6 does this)
  1111. // div.style.display = "";
  1112. // div.innerHTML = "<div style='width:4px;'></div>";
  1113. // jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
  1114. // }
  1115. // div.innerHTML = "<table><tr><td style='padding:0;display:none'></td><td>t</td></tr></table>";
  1116. // var tds = div.getElementsByTagName("td");
  1117. // // Check if table cells still have offsetWidth/Height when they are set
  1118. // // to display:none and there are still other visible table cells in a
  1119. // // table row; if so, offsetWidth/Height are not reliable for use when
  1120. // // determining if an element has been hidden directly using
  1121. // // display:none (it is still safe to use offsets if a parent element is
  1122. // // hidden; don safety goggles and see bug #4512 for more information).
  1123. // // (only IE 8 fails this test)
  1124. // jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
  1125. // tds[0].style.display = "";
  1126. // tds[1].style.display = "none";
  1127. // // Check if empty table cells still have offsetWidth/Height
  1128. // // (IE < 8 fail this test)
  1129. // jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
  1130. // div.innerHTML = "";
  1131. // document.body.removeChild( div ).style.display = "none";
  1132. // div = tds = null;
  1133. // });
  1134. // // Technique from Juriy Zaytsev
  1135. // // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
  1136. // var eventSupported = function( eventName ) {
  1137. // var el = document.createElement("div");
  1138. // eventName = "on" + eventName;
  1139. // var isSupported = (eventName in el);
  1140. // if ( !isSupported ) {
  1141. // el.setAttribute(eventName, "return;");
  1142. // isSupported = typeof el[eventName] === "function";
  1143. // }
  1144. // el = null;
  1145. // return isSupported;
  1146. // };
  1147. jQuery.support.submitBubbles = false;
  1148. jQuery.support.changeBubbles = false;
  1149. // // release memory in IE
  1150. // root = script = div = all = a = null;
  1151. })();
  1152. var windowData = {},
  1153. rbrace = /^(?:\{.*\}|\[.*\])$/;
  1154. jQuery.extend({
  1155. cache: {},
  1156. // Please use with caution
  1157. uuid: 0,
  1158. // Unique for each copy of jQuery on the page
  1159. expando: "jQuery" + jQuery.now(),
  1160. // The following elements throw uncatchable exceptions if you
  1161. // attempt to add expando properties to them.
  1162. noData: {
  1163. "embed": true,
  1164. // Ban all objects except for Flash (which handle expandos)
  1165. "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
  1166. "applet": true
  1167. },
  1168. data: function( elem, name, data ) {
  1169. /// <summary>
  1170. /// &#10;Store arbitrary data associated with the specified element.
  1171. /// </summary>
  1172. /// <param name="elem" type="Element">
  1173. /// &#10;The DOM element to associate with the data.
  1174. /// </param>
  1175. /// <param name="name" type="String">
  1176. /// &#10;A string naming the piece of data to set.
  1177. /// </param>
  1178. /// <param name="value" type="Object">
  1179. /// &#10;The new data value.
  1180. /// </param>
  1181. /// <returns type="jQuery" />
  1182. if ( !jQuery.acceptData( elem ) ) {
  1183. return;
  1184. }
  1185. elem = elem == window ?
  1186. windowData :
  1187. elem;
  1188. var isNode = elem.nodeType,
  1189. id = isNode ? elem[ jQuery.expando ] : null,
  1190. cache = jQuery.cache, thisCache;
  1191. if ( isNode && !id && typeof name === "string" && data === undefined ) {
  1192. return;
  1193. }
  1194. // Get the data from the object directly
  1195. if ( !isNode ) {
  1196. cache = elem;
  1197. // Compute a unique ID for the element
  1198. } else if ( !id ) {
  1199. elem[ jQuery.expando ] = id = ++jQuery.uuid;
  1200. }
  1201. // Avoid generating a new cache unless none exists and we
  1202. // want to manipulate it.
  1203. if ( typeof name === "object" ) {
  1204. if ( isNode ) {
  1205. cache[ id ] = jQuery.extend(cache[ id ], name);
  1206. } else {
  1207. jQuery.extend( cache, name );
  1208. }
  1209. } else if ( isNode && !cache[ id ] ) {
  1210. cache[ id ] = {};
  1211. }
  1212. thisCache = isNode ? cache[ id ] : cache;
  1213. // Prevent overriding the named cache with undefined values
  1214. if ( data !== undefined ) {
  1215. thisCache[ name ] = data;
  1216. }
  1217. return typeof name === "string" ? thisCache[ name ] : thisCache;
  1218. },
  1219. removeData: function( elem, name ) {
  1220. if ( !jQuery.acceptData( elem ) ) {
  1221. return;
  1222. }
  1223. elem = elem == window ?
  1224. windowData :
  1225. elem;
  1226. var isNode = elem.nodeType,
  1227. id = isNode ? elem[ jQuery.expando ] : elem,
  1228. cache = jQuery.cache,
  1229. thisCache = isNode ? cache[ id ] : id;
  1230. // If we want to remove a specific section of the element's data
  1231. if ( name ) {
  1232. if ( thisCache ) {
  1233. // Remove the section of cache data
  1234. delete thisCache[ name ];
  1235. // If we've removed all the data, remove the element's cache
  1236. if ( isNode && jQuery.isEmptyObject(thisCache) ) {
  1237. jQuery.removeData( elem );
  1238. }
  1239. }
  1240. // Otherwise, we want to remove all of the element's data
  1241. } else {
  1242. if ( isNode && jQuery.support.deleteExpando ) {
  1243. delete elem[ jQuery.expando ];
  1244. } else if ( elem.removeAttribute ) {
  1245. elem.removeAttribute( jQuery.expando );
  1246. // Completely remove the data cache
  1247. } else if ( isNode ) {
  1248. delete cache[ id ];
  1249. // Remove all fields from the object
  1250. } else {
  1251. for ( var n in elem ) {
  1252. delete elem[ n ];
  1253. }
  1254. }
  1255. }
  1256. },
  1257. // A method for determining if a DOM node can handle the data expando
  1258. acceptData: function( elem ) {
  1259. if ( elem.nodeName ) {
  1260. var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
  1261. if ( match ) {
  1262. return !(match === true || elem.getAttribute("classid") !== match);
  1263. }
  1264. }
  1265. return true;
  1266. }
  1267. });
  1268. jQuery.fn.extend({
  1269. data: function( key, value ) {
  1270. /// <summary>
  1271. /// &#10;Store arbitrary data associated with the matched elements.
  1272. /// </summary>
  1273. /// <param name="key" type="String">
  1274. /// &#10;A string naming the piece of data to set.
  1275. /// </param>
  1276. /// <param name="value" type="Object">
  1277. /// &#10;The new data value.
  1278. /// </param>
  1279. /// <returns type="jQuery" />
  1280. var data = null;
  1281. if ( typeof key === "undefined" ) {
  1282. if ( this.length ) {
  1283. var attr = this[0].attributes, name;
  1284. data = jQuery.data( this[0] );
  1285. for ( var i = 0, l = attr.length; i < l; i++ ) {
  1286. name = attr[i].name;
  1287. if ( name.indexOf( "data-" ) === 0 ) {
  1288. name = name.substr( 5 );
  1289. dataAttr( this[0], name, data[ name ] );
  1290. }
  1291. }
  1292. }
  1293. return data;
  1294. } else if ( typeof key === "object" ) {
  1295. return this.each(function() {
  1296. jQuery.data( this, key );
  1297. });
  1298. }
  1299. var parts = key.split(".");
  1300. parts[1] = parts[1] ? "." + parts[1] : "";
  1301. if ( value === undefined ) {
  1302. data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
  1303. // Try to fetch any internally stored data first
  1304. if ( data === undefined && this.length ) {
  1305. data = jQuery.data( this[0], key );
  1306. data = dataAttr( this[0], key, data );
  1307. }
  1308. return data === undefined && parts[1] ?
  1309. this.data( parts[0] ) :
  1310. data;
  1311. } else {
  1312. return this.each(function() {
  1313. var $this = jQuery( this ),
  1314. args = [ parts[0], value ];
  1315. $this.triggerHandler( "setData" + parts[1] + "!", args );
  1316. jQuery.data( this, key, value );
  1317. $this.triggerHandler( "changeData" + parts[1] + "!", args );
  1318. });
  1319. }
  1320. },
  1321. removeData: function( key ) {
  1322. return this.each(function() {
  1323. jQuery.removeData( this, key );
  1324. });
  1325. }
  1326. });
  1327. function dataAttr( elem, key, data ) {
  1328. // If nothing was found internally, try to fetch any
  1329. // data from the HTML5 data-* attribute
  1330. if ( data === undefined && elem.nodeType === 1 ) {
  1331. data = elem.getAttribute( "data-" + key );
  1332. if ( typeof data === "string" ) {
  1333. try {
  1334. data = data === "true" ? true :
  1335. data === "false" ? false :
  1336. data === "null" ? null :
  1337. !jQuery.isNaN( data ) ? parseFloat( data ) :
  1338. rbrace.test( data ) ? jQuery.parseJSON( data ) :
  1339. data;
  1340. } catch( e ) {}
  1341. // Make sure we set the data so it isn't changed later
  1342. jQuery.data( elem, key, data );
  1343. } else {
  1344. data = undefined;
  1345. }
  1346. }
  1347. return data;
  1348. }
  1349. jQuery.extend({
  1350. queue: function( elem, type, data ) {
  1351. if ( !elem ) {
  1352. return;
  1353. }
  1354. type = (type || "fx") + "queue";
  1355. var q = jQuery.data( elem, type );
  1356. // Speed up dequeue by getting out quickly if this is just a lookup
  1357. if ( !data ) {
  1358. return q || [];
  1359. }
  1360. if ( !q || jQuery.isArray(data) ) {
  1361. q = jQuery.data( elem, type, jQuery.makeArray(data) );
  1362. } else {
  1363. q.push( data );
  1364. }
  1365. return q;
  1366. },
  1367. dequeue: function( elem, type ) {
  1368. type = type || "fx";
  1369. var queue = jQuery.queue( elem, type ),
  1370. fn = queue.shift();
  1371. // If the fx queue is dequeued, always remove the progress sentinel
  1372. if ( fn === "inprogress" ) {
  1373. fn = queue.shift();
  1374. }
  1375. if ( fn ) {
  1376. // Add a progress sentinel to prevent the fx queue from being
  1377. // automatically dequeued
  1378. if ( type === "fx" ) {
  1379. queue.unshift("inprogress");
  1380. }
  1381. fn.call(elem, function() {
  1382. jQuery.dequeue(elem, type);

Large files files are truncated, but you can click here to view the full file