PageRenderTime 83ms CodeModel.GetById 31ms RepoModel.GetById 1ms app.codeStats 2ms

/BlogEngine/BlogEngine.NET/Scripts/jQuery/jquery-1.5.2.js

#
JavaScript | 8374 lines | 5817 code | 1520 blank | 1037 comment | 1685 complexity | 45b0758e69da8012e629070d62b6fa7d MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause

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

  1. /*!
  2. * jQuery JavaScript Library v1.5.2
  3. * http://jquery.com/
  4. *
  5. * Copyright 2011, John Resig
  6. * Dual licensed under the MIT or GPL Version 2 licenses.
  7. * http://jquery.org/license
  8. *
  9. * Includes Sizzle.js
  10. * http://sizzlejs.com/
  11. * Copyright 2011, The Dojo Foundation
  12. * Released under the MIT, BSD, and GPL Licenses.
  13. *
  14. * Date: Thu Mar 31 15:28:23 2011 -0400
  15. */
  16. (function( window, undefined ) {
  17. // Use the correct document accordingly with window argument (sandbox)
  18. var document = window.document;
  19. var jQuery = (function() {
  20. // Define a local copy of jQuery
  21. var jQuery = function( selector, context ) {
  22. // The jQuery object is actually just the init constructor 'enhanced'
  23. return new jQuery.fn.init( selector, context, rootjQuery );
  24. },
  25. // Map over jQuery in case of overwrite
  26. _jQuery = window.jQuery,
  27. // Map over the $ in case of overwrite
  28. _$ = window.$,
  29. // A central reference to the root jQuery(document)
  30. rootjQuery,
  31. // A simple way to check for HTML strings or ID strings
  32. // (both of which we optimize for)
  33. quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,
  34. // Check if a string has a non-whitespace character in it
  35. rnotwhite = /\S/,
  36. // Used for trimming whitespace
  37. trimLeft = /^\s+/,
  38. trimRight = /\s+$/,
  39. // Check for digits
  40. rdigit = /\d/,
  41. // Match a standalone tag
  42. rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
  43. // JSON RegExp
  44. rvalidchars = /^[\],:{}\s]*$/,
  45. rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
  46. rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
  47. rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
  48. // Useragent RegExp
  49. rwebkit = /(webkit)[ \/]([\w.]+)/,
  50. ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
  51. rmsie = /(msie) ([\w.]+)/,
  52. rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
  53. // Keep a UserAgent string for use with jQuery.browser
  54. userAgent = navigator.userAgent,
  55. // For matching the engine and version of the browser
  56. browserMatch,
  57. // The deferred used on DOM ready
  58. readyList,
  59. // The ready event handler
  60. DOMContentLoaded,
  61. // Save a reference to some core methods
  62. toString = Object.prototype.toString,
  63. hasOwn = Object.prototype.hasOwnProperty,
  64. push = Array.prototype.push,
  65. slice = Array.prototype.slice,
  66. trim = String.prototype.trim,
  67. indexOf = Array.prototype.indexOf,
  68. // [[Class]] -> type pairs
  69. class2type = {};
  70. jQuery.fn = jQuery.prototype = {
  71. constructor: jQuery,
  72. init: function( selector, context, rootjQuery ) {
  73. var match, elem, ret, doc;
  74. // Handle $(""), $(null), or $(undefined)
  75. if ( !selector ) {
  76. return this;
  77. }
  78. // Handle $(DOMElement)
  79. if ( selector.nodeType ) {
  80. this.context = this[0] = selector;
  81. this.length = 1;
  82. return this;
  83. }
  84. // The body element only exists once, optimize finding it
  85. if ( selector === "body" && !context && document.body ) {
  86. this.context = document;
  87. this[0] = document.body;
  88. this.selector = "body";
  89. this.length = 1;
  90. return this;
  91. }
  92. // Handle HTML strings
  93. if ( typeof selector === "string" ) {
  94. // Are we dealing with HTML string or an ID?
  95. match = quickExpr.exec( selector );
  96. // Verify a match, and that no context was specified for #id
  97. if ( match && (match[1] || !context) ) {
  98. // HANDLE: $(html) -> $(array)
  99. if ( match[1] ) {
  100. context = context instanceof jQuery ? context[0] : context;
  101. doc = (context ? context.ownerDocument || context : document);
  102. // If a single string is passed in and it's a single tag
  103. // just do a createElement and skip the rest
  104. ret = rsingleTag.exec( selector );
  105. if ( ret ) {
  106. if ( jQuery.isPlainObject( context ) ) {
  107. selector = [ document.createElement( ret[1] ) ];
  108. jQuery.fn.attr.call( selector, context, true );
  109. } else {
  110. selector = [ doc.createElement( ret[1] ) ];
  111. }
  112. } else {
  113. ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
  114. selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
  115. }
  116. return jQuery.merge( this, selector );
  117. // HANDLE: $("#id")
  118. } else {
  119. elem = document.getElementById( match[2] );
  120. // Check parentNode to catch when Blackberry 4.6 returns
  121. // nodes that are no longer in the document #6963
  122. if ( elem && elem.parentNode ) {
  123. // Handle the case where IE and Opera return items
  124. // by name instead of ID
  125. if ( elem.id !== match[2] ) {
  126. return rootjQuery.find( selector );
  127. }
  128. // Otherwise, we inject the element directly into the jQuery object
  129. this.length = 1;
  130. this[0] = elem;
  131. }
  132. this.context = document;
  133. this.selector = selector;
  134. return this;
  135. }
  136. // HANDLE: $(expr, $(...))
  137. } else if ( !context || context.jquery ) {
  138. return (context || rootjQuery).find( selector );
  139. // HANDLE: $(expr, context)
  140. // (which is just equivalent to: $(context).find(expr)
  141. } else {
  142. return this.constructor( context ).find( selector );
  143. }
  144. // HANDLE: $(function)
  145. // Shortcut for document ready
  146. } else if ( jQuery.isFunction( selector ) ) {
  147. return rootjQuery.ready( selector );
  148. }
  149. if (selector.selector !== undefined) {
  150. this.selector = selector.selector;
  151. this.context = selector.context;
  152. }
  153. return jQuery.makeArray( selector, this );
  154. },
  155. // Start with an empty selector
  156. selector: "",
  157. // The current version of jQuery being used
  158. jquery: "1.5.2",
  159. // The default length of a jQuery object is 0
  160. length: 0,
  161. // The number of elements contained in the matched element set
  162. size: function() {
  163. return this.length;
  164. },
  165. toArray: function() {
  166. return slice.call( this, 0 );
  167. },
  168. // Get the Nth element in the matched element set OR
  169. // Get the whole matched element set as a clean array
  170. get: function( num ) {
  171. return num == null ?
  172. // Return a 'clean' array
  173. this.toArray() :
  174. // Return just the object
  175. ( num < 0 ? this[ this.length + num ] : this[ num ] );
  176. },
  177. // Take an array of elements and push it onto the stack
  178. // (returning the new matched element set)
  179. pushStack: function( elems, name, selector ) {
  180. // Build a new jQuery matched element set
  181. var ret = this.constructor();
  182. if ( jQuery.isArray( elems ) ) {
  183. push.apply( ret, elems );
  184. } else {
  185. jQuery.merge( ret, elems );
  186. }
  187. // Add the old object onto the stack (as a reference)
  188. ret.prevObject = this;
  189. ret.context = this.context;
  190. if ( name === "find" ) {
  191. ret.selector = this.selector + (this.selector ? " " : "") + selector;
  192. } else if ( name ) {
  193. ret.selector = this.selector + "." + name + "(" + selector + ")";
  194. }
  195. // Return the newly-formed element set
  196. return ret;
  197. },
  198. // Execute a callback for every element in the matched set.
  199. // (You can seed the arguments with an array of args, but this is
  200. // only used internally.)
  201. each: function( callback, args ) {
  202. return jQuery.each( this, callback, args );
  203. },
  204. ready: function( fn ) {
  205. // Attach the listeners
  206. jQuery.bindReady();
  207. // Add the callback
  208. readyList.done( fn );
  209. return this;
  210. },
  211. eq: function( i ) {
  212. return i === -1 ?
  213. this.slice( i ) :
  214. this.slice( i, +i + 1 );
  215. },
  216. first: function() {
  217. return this.eq( 0 );
  218. },
  219. last: function() {
  220. return this.eq( -1 );
  221. },
  222. slice: function() {
  223. return this.pushStack( slice.apply( this, arguments ),
  224. "slice", slice.call(arguments).join(",") );
  225. },
  226. map: function( callback ) {
  227. return this.pushStack( jQuery.map(this, function( elem, i ) {
  228. return callback.call( elem, i, elem );
  229. }));
  230. },
  231. end: function() {
  232. return this.prevObject || this.constructor(null);
  233. },
  234. // For internal use only.
  235. // Behaves like an Array's method, not like a jQuery method.
  236. push: push,
  237. sort: [].sort,
  238. splice: [].splice
  239. };
  240. // Give the init function the jQuery prototype for later instantiation
  241. jQuery.fn.init.prototype = jQuery.fn;
  242. jQuery.extend = jQuery.fn.extend = function() {
  243. var options, name, src, copy, copyIsArray, clone,
  244. target = arguments[0] || {},
  245. i = 1,
  246. length = arguments.length,
  247. deep = false;
  248. // Handle a deep copy situation
  249. if ( typeof target === "boolean" ) {
  250. deep = target;
  251. target = arguments[1] || {};
  252. // skip the boolean and the target
  253. i = 2;
  254. }
  255. // Handle case when target is a string or something (possible in deep copy)
  256. if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  257. target = {};
  258. }
  259. // extend jQuery itself if only one argument is passed
  260. if ( length === i ) {
  261. target = this;
  262. --i;
  263. }
  264. for ( ; i < length; i++ ) {
  265. // Only deal with non-null/undefined values
  266. if ( (options = arguments[ i ]) != null ) {
  267. // Extend the base object
  268. for ( name in options ) {
  269. src = target[ name ];
  270. copy = options[ name ];
  271. // Prevent never-ending loop
  272. if ( target === copy ) {
  273. continue;
  274. }
  275. // Recurse if we're merging plain objects or arrays
  276. if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
  277. if ( copyIsArray ) {
  278. copyIsArray = false;
  279. clone = src && jQuery.isArray(src) ? src : [];
  280. } else {
  281. clone = src && jQuery.isPlainObject(src) ? src : {};
  282. }
  283. // Never move original objects, clone them
  284. target[ name ] = jQuery.extend( deep, clone, copy );
  285. // Don't bring in undefined values
  286. } else if ( copy !== undefined ) {
  287. target[ name ] = copy;
  288. }
  289. }
  290. }
  291. }
  292. // Return the modified object
  293. return target;
  294. };
  295. jQuery.extend({
  296. noConflict: function( deep ) {
  297. window.$ = _$;
  298. if ( deep ) {
  299. window.jQuery = _jQuery;
  300. }
  301. return jQuery;
  302. },
  303. // Is the DOM ready to be used? Set to true once it occurs.
  304. isReady: false,
  305. // A counter to track how many items to wait for before
  306. // the ready event fires. See #6781
  307. readyWait: 1,
  308. // Handle when the DOM is ready
  309. ready: function( wait ) {
  310. // A third-party is pushing the ready event forwards
  311. if ( wait === true ) {
  312. jQuery.readyWait--;
  313. }
  314. // Make sure that the DOM is not already loaded
  315. if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) {
  316. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  317. if ( !document.body ) {
  318. return setTimeout( jQuery.ready, 1 );
  319. }
  320. // Remember that the DOM is ready
  321. jQuery.isReady = true;
  322. // If a normal DOM Ready event fired, decrement, and wait if need be
  323. if ( wait !== true && --jQuery.readyWait > 0 ) {
  324. return;
  325. }
  326. // If there are functions bound, to execute
  327. readyList.resolveWith( document, [ jQuery ] );
  328. // Trigger any bound ready events
  329. if ( jQuery.fn.trigger ) {
  330. jQuery( document ).trigger( "ready" ).unbind( "ready" );
  331. }
  332. }
  333. },
  334. bindReady: function() {
  335. if ( readyList ) {
  336. return;
  337. }
  338. readyList = jQuery._Deferred();
  339. // Catch cases where $(document).ready() is called after the
  340. // browser event has already occurred.
  341. if ( document.readyState === "complete" ) {
  342. // Handle it asynchronously to allow scripts the opportunity to delay ready
  343. return setTimeout( jQuery.ready, 1 );
  344. }
  345. // Mozilla, Opera and webkit nightlies currently support this event
  346. if ( document.addEventListener ) {
  347. // Use the handy event callback
  348. document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  349. // A fallback to window.onload, that will always work
  350. window.addEventListener( "load", jQuery.ready, false );
  351. // If IE event model is used
  352. } else if ( document.attachEvent ) {
  353. // ensure firing before onload,
  354. // maybe late but safe also for iframes
  355. document.attachEvent("onreadystatechange", DOMContentLoaded);
  356. // A fallback to window.onload, that will always work
  357. window.attachEvent( "onload", jQuery.ready );
  358. // If IE and not a frame
  359. // continually check to see if the document is ready
  360. var toplevel = false;
  361. try {
  362. toplevel = window.frameElement == null;
  363. } catch(e) {}
  364. if ( document.documentElement.doScroll && toplevel ) {
  365. doScrollCheck();
  366. }
  367. }
  368. },
  369. // See test/unit/core.js for details concerning isFunction.
  370. // Since version 1.3, DOM methods and functions like alert
  371. // aren't supported. They return false on IE (#2968).
  372. isFunction: function( obj ) {
  373. return jQuery.type(obj) === "function";
  374. },
  375. isArray: Array.isArray || function( obj ) {
  376. return jQuery.type(obj) === "array";
  377. },
  378. // A crude way of determining if an object is a window
  379. isWindow: function( obj ) {
  380. return obj && typeof obj === "object" && "setInterval" in obj;
  381. },
  382. isNaN: function( obj ) {
  383. return obj == null || !rdigit.test( obj ) || isNaN( obj );
  384. },
  385. type: function( obj ) {
  386. return obj == null ?
  387. String( obj ) :
  388. class2type[ toString.call(obj) ] || "object";
  389. },
  390. isPlainObject: function( obj ) {
  391. // Must be an Object.
  392. // Because of IE, we also have to check the presence of the constructor property.
  393. // Make sure that DOM nodes and window objects don't pass through, as well
  394. if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  395. return false;
  396. }
  397. // Not own constructor property must be Object
  398. if ( obj.constructor &&
  399. !hasOwn.call(obj, "constructor") &&
  400. !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
  401. return false;
  402. }
  403. // Own properties are enumerated firstly, so to speed up,
  404. // if last one is own, then all properties are own.
  405. var key;
  406. for ( key in obj ) {}
  407. return key === undefined || hasOwn.call( obj, key );
  408. },
  409. isEmptyObject: function( obj ) {
  410. for ( var name in obj ) {
  411. return false;
  412. }
  413. return true;
  414. },
  415. error: function( msg ) {
  416. throw msg;
  417. },
  418. parseJSON: function( data ) {
  419. if ( typeof data !== "string" || !data ) {
  420. return null;
  421. }
  422. // Make sure leading/trailing whitespace is removed (IE can't handle it)
  423. data = jQuery.trim( data );
  424. // Make sure the incoming data is actual JSON
  425. // Logic borrowed from http://json.org/json2.js
  426. if ( rvalidchars.test(data.replace(rvalidescape, "@")
  427. .replace(rvalidtokens, "]")
  428. .replace(rvalidbraces, "")) ) {
  429. // Try to use the native JSON parser first
  430. return window.JSON && window.JSON.parse ?
  431. window.JSON.parse( data ) :
  432. (new Function("return " + data))();
  433. } else {
  434. jQuery.error( "Invalid JSON: " + data );
  435. }
  436. },
  437. // Cross-browser xml parsing
  438. // (xml & tmp used internally)
  439. parseXML: function( data , xml , tmp ) {
  440. if ( window.DOMParser ) { // Standard
  441. tmp = new DOMParser();
  442. xml = tmp.parseFromString( data , "text/xml" );
  443. } else { // IE
  444. xml = new ActiveXObject( "Microsoft.XMLDOM" );
  445. xml.async = "false";
  446. xml.loadXML( data );
  447. }
  448. tmp = xml.documentElement;
  449. if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
  450. jQuery.error( "Invalid XML: " + data );
  451. }
  452. return xml;
  453. },
  454. noop: function() {},
  455. // Evalulates a script in a global context
  456. globalEval: function( data ) {
  457. if ( data && rnotwhite.test(data) ) {
  458. // Inspired by code by Andrea Giammarchi
  459. // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
  460. var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement,
  461. script = document.createElement( "script" );
  462. if ( jQuery.support.scriptEval() ) {
  463. script.appendChild( document.createTextNode( data ) );
  464. } else {
  465. script.text = data;
  466. }
  467. // Use insertBefore instead of appendChild to circumvent an IE6 bug.
  468. // This arises when a base node is used (#2709).
  469. head.insertBefore( script, head.firstChild );
  470. head.removeChild( script );
  471. }
  472. },
  473. nodeName: function( elem, name ) {
  474. return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
  475. },
  476. // args is for internal usage only
  477. each: function( object, callback, args ) {
  478. var name, i = 0,
  479. length = object.length,
  480. isObj = length === undefined || jQuery.isFunction(object);
  481. if ( args ) {
  482. if ( isObj ) {
  483. for ( name in object ) {
  484. if ( callback.apply( object[ name ], args ) === false ) {
  485. break;
  486. }
  487. }
  488. } else {
  489. for ( ; i < length; ) {
  490. if ( callback.apply( object[ i++ ], args ) === false ) {
  491. break;
  492. }
  493. }
  494. }
  495. // A special, fast, case for the most common use of each
  496. } else {
  497. if ( isObj ) {
  498. for ( name in object ) {
  499. if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
  500. break;
  501. }
  502. }
  503. } else {
  504. for ( var value = object[0];
  505. i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
  506. }
  507. }
  508. return object;
  509. },
  510. // Use native String.trim function wherever possible
  511. trim: trim ?
  512. function( text ) {
  513. return text == null ?
  514. "" :
  515. trim.call( text );
  516. } :
  517. // Otherwise use our own trimming functionality
  518. function( text ) {
  519. return text == null ?
  520. "" :
  521. text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
  522. },
  523. // results is for internal usage only
  524. makeArray: function( array, results ) {
  525. var ret = results || [];
  526. if ( array != null ) {
  527. // The window, strings (and functions) also have 'length'
  528. // The extra typeof function check is to prevent crashes
  529. // in Safari 2 (See: #3039)
  530. // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
  531. var type = jQuery.type(array);
  532. if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
  533. push.call( ret, array );
  534. } else {
  535. jQuery.merge( ret, array );
  536. }
  537. }
  538. return ret;
  539. },
  540. inArray: function( elem, array ) {
  541. if ( array.indexOf ) {
  542. return array.indexOf( elem );
  543. }
  544. for ( var i = 0, length = array.length; i < length; i++ ) {
  545. if ( array[ i ] === elem ) {
  546. return i;
  547. }
  548. }
  549. return -1;
  550. },
  551. merge: function( first, second ) {
  552. var i = first.length,
  553. j = 0;
  554. if ( typeof second.length === "number" ) {
  555. for ( var l = second.length; j < l; j++ ) {
  556. first[ i++ ] = second[ j ];
  557. }
  558. } else {
  559. while ( second[j] !== undefined ) {
  560. first[ i++ ] = second[ j++ ];
  561. }
  562. }
  563. first.length = i;
  564. return first;
  565. },
  566. grep: function( elems, callback, inv ) {
  567. var ret = [], retVal;
  568. inv = !!inv;
  569. // Go through the array, only saving the items
  570. // that pass the validator function
  571. for ( var i = 0, length = elems.length; i < length; i++ ) {
  572. retVal = !!callback( elems[ i ], i );
  573. if ( inv !== retVal ) {
  574. ret.push( elems[ i ] );
  575. }
  576. }
  577. return ret;
  578. },
  579. // arg is for internal usage only
  580. map: function( elems, callback, arg ) {
  581. var ret = [], value;
  582. // Go through the array, translating each of the items to their
  583. // new value (or values).
  584. for ( var i = 0, length = elems.length; i < length; i++ ) {
  585. value = callback( elems[ i ], i, arg );
  586. if ( value != null ) {
  587. ret[ ret.length ] = value;
  588. }
  589. }
  590. // Flatten any nested arrays
  591. return ret.concat.apply( [], ret );
  592. },
  593. // A global GUID counter for objects
  594. guid: 1,
  595. proxy: function( fn, proxy, thisObject ) {
  596. if ( arguments.length === 2 ) {
  597. if ( typeof proxy === "string" ) {
  598. thisObject = fn;
  599. fn = thisObject[ proxy ];
  600. proxy = undefined;
  601. } else if ( proxy && !jQuery.isFunction( proxy ) ) {
  602. thisObject = proxy;
  603. proxy = undefined;
  604. }
  605. }
  606. if ( !proxy && fn ) {
  607. proxy = function() {
  608. return fn.apply( thisObject || this, arguments );
  609. };
  610. }
  611. // Set the guid of unique handler to the same of original handler, so it can be removed
  612. if ( fn ) {
  613. proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
  614. }
  615. // So proxy can be declared as an argument
  616. return proxy;
  617. },
  618. // Mutifunctional method to get and set values to a collection
  619. // The value/s can be optionally by executed if its a function
  620. access: function( elems, key, value, exec, fn, pass ) {
  621. var length = elems.length;
  622. // Setting many attributes
  623. if ( typeof key === "object" ) {
  624. for ( var k in key ) {
  625. jQuery.access( elems, k, key[k], exec, fn, value );
  626. }
  627. return elems;
  628. }
  629. // Setting one attribute
  630. if ( value !== undefined ) {
  631. // Optionally, function values get executed if exec is true
  632. exec = !pass && exec && jQuery.isFunction(value);
  633. for ( var i = 0; i < length; i++ ) {
  634. fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
  635. }
  636. return elems;
  637. }
  638. // Getting an attribute
  639. return length ? fn( elems[0], key ) : undefined;
  640. },
  641. now: function() {
  642. return (new Date()).getTime();
  643. },
  644. // Use of jQuery.browser is frowned upon.
  645. // More details: http://docs.jquery.com/Utilities/jQuery.browser
  646. uaMatch: function( ua ) {
  647. ua = ua.toLowerCase();
  648. var match = rwebkit.exec( ua ) ||
  649. ropera.exec( ua ) ||
  650. rmsie.exec( ua ) ||
  651. ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
  652. [];
  653. return { browser: match[1] || "", version: match[2] || "0" };
  654. },
  655. sub: function() {
  656. function jQuerySubclass( selector, context ) {
  657. return new jQuerySubclass.fn.init( selector, context );
  658. }
  659. jQuery.extend( true, jQuerySubclass, this );
  660. jQuerySubclass.superclass = this;
  661. jQuerySubclass.fn = jQuerySubclass.prototype = this();
  662. jQuerySubclass.fn.constructor = jQuerySubclass;
  663. jQuerySubclass.subclass = this.subclass;
  664. jQuerySubclass.fn.init = function init( selector, context ) {
  665. if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) {
  666. context = jQuerySubclass(context);
  667. }
  668. return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass );
  669. };
  670. jQuerySubclass.fn.init.prototype = jQuerySubclass.fn;
  671. var rootjQuerySubclass = jQuerySubclass(document);
  672. return jQuerySubclass;
  673. },
  674. browser: {}
  675. });
  676. // Populate the class2type map
  677. jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
  678. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  679. });
  680. browserMatch = jQuery.uaMatch( userAgent );
  681. if ( browserMatch.browser ) {
  682. jQuery.browser[ browserMatch.browser ] = true;
  683. jQuery.browser.version = browserMatch.version;
  684. }
  685. // Deprecated, use jQuery.browser.webkit instead
  686. if ( jQuery.browser.webkit ) {
  687. jQuery.browser.safari = true;
  688. }
  689. if ( indexOf ) {
  690. jQuery.inArray = function( elem, array ) {
  691. return indexOf.call( array, elem );
  692. };
  693. }
  694. // IE doesn't match non-breaking spaces with \s
  695. if ( rnotwhite.test( "\xA0" ) ) {
  696. trimLeft = /^[\s\xA0]+/;
  697. trimRight = /[\s\xA0]+$/;
  698. }
  699. // All jQuery objects should point back to these
  700. rootjQuery = jQuery(document);
  701. // Cleanup functions for the document ready method
  702. if ( document.addEventListener ) {
  703. DOMContentLoaded = function() {
  704. document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
  705. jQuery.ready();
  706. };
  707. } else if ( document.attachEvent ) {
  708. DOMContentLoaded = function() {
  709. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  710. if ( document.readyState === "complete" ) {
  711. document.detachEvent( "onreadystatechange", DOMContentLoaded );
  712. jQuery.ready();
  713. }
  714. };
  715. }
  716. // The DOM ready check for Internet Explorer
  717. function doScrollCheck() {
  718. if ( jQuery.isReady ) {
  719. return;
  720. }
  721. try {
  722. // If IE is used, use the trick by Diego Perini
  723. // http://javascript.nwbox.com/IEContentLoaded/
  724. document.documentElement.doScroll("left");
  725. } catch(e) {
  726. setTimeout( doScrollCheck, 1 );
  727. return;
  728. }
  729. // and execute any waiting functions
  730. jQuery.ready();
  731. }
  732. // Expose jQuery to the global object
  733. return jQuery;
  734. })();
  735. var // Promise methods
  736. promiseMethods = "then done fail isResolved isRejected promise".split( " " ),
  737. // Static reference to slice
  738. sliceDeferred = [].slice;
  739. jQuery.extend({
  740. // Create a simple deferred (one callbacks list)
  741. _Deferred: function() {
  742. var // callbacks list
  743. callbacks = [],
  744. // stored [ context , args ]
  745. fired,
  746. // to avoid firing when already doing so
  747. firing,
  748. // flag to know if the deferred has been cancelled
  749. cancelled,
  750. // the deferred itself
  751. deferred = {
  752. // done( f1, f2, ...)
  753. done: function() {
  754. if ( !cancelled ) {
  755. var args = arguments,
  756. i,
  757. length,
  758. elem,
  759. type,
  760. _fired;
  761. if ( fired ) {
  762. _fired = fired;
  763. fired = 0;
  764. }
  765. for ( i = 0, length = args.length; i < length; i++ ) {
  766. elem = args[ i ];
  767. type = jQuery.type( elem );
  768. if ( type === "array" ) {
  769. deferred.done.apply( deferred, elem );
  770. } else if ( type === "function" ) {
  771. callbacks.push( elem );
  772. }
  773. }
  774. if ( _fired ) {
  775. deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
  776. }
  777. }
  778. return this;
  779. },
  780. // resolve with given context and args
  781. resolveWith: function( context, args ) {
  782. if ( !cancelled && !fired && !firing ) {
  783. // make sure args are available (#8421)
  784. args = args || [];
  785. firing = 1;
  786. try {
  787. while( callbacks[ 0 ] ) {
  788. callbacks.shift().apply( context, args );
  789. }
  790. }
  791. finally {
  792. fired = [ context, args ];
  793. firing = 0;
  794. }
  795. }
  796. return this;
  797. },
  798. // resolve with this as context and given arguments
  799. resolve: function() {
  800. deferred.resolveWith( this, arguments );
  801. return this;
  802. },
  803. // Has this deferred been resolved?
  804. isResolved: function() {
  805. return !!( firing || fired );
  806. },
  807. // Cancel
  808. cancel: function() {
  809. cancelled = 1;
  810. callbacks = [];
  811. return this;
  812. }
  813. };
  814. return deferred;
  815. },
  816. // Full fledged deferred (two callbacks list)
  817. Deferred: function( func ) {
  818. var deferred = jQuery._Deferred(),
  819. failDeferred = jQuery._Deferred(),
  820. promise;
  821. // Add errorDeferred methods, then and promise
  822. jQuery.extend( deferred, {
  823. then: function( doneCallbacks, failCallbacks ) {
  824. deferred.done( doneCallbacks ).fail( failCallbacks );
  825. return this;
  826. },
  827. fail: failDeferred.done,
  828. rejectWith: failDeferred.resolveWith,
  829. reject: failDeferred.resolve,
  830. isRejected: failDeferred.isResolved,
  831. // Get a promise for this deferred
  832. // If obj is provided, the promise aspect is added to the object
  833. promise: function( obj ) {
  834. if ( obj == null ) {
  835. if ( promise ) {
  836. return promise;
  837. }
  838. promise = obj = {};
  839. }
  840. var i = promiseMethods.length;
  841. while( i-- ) {
  842. obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
  843. }
  844. return obj;
  845. }
  846. } );
  847. // Make sure only one callback list will be used
  848. deferred.done( failDeferred.cancel ).fail( deferred.cancel );
  849. // Unexpose cancel
  850. delete deferred.cancel;
  851. // Call given func if any
  852. if ( func ) {
  853. func.call( deferred, deferred );
  854. }
  855. return deferred;
  856. },
  857. // Deferred helper
  858. when: function( firstParam ) {
  859. var args = arguments,
  860. i = 0,
  861. length = args.length,
  862. count = length,
  863. deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
  864. firstParam :
  865. jQuery.Deferred();
  866. function resolveFunc( i ) {
  867. return function( value ) {
  868. args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
  869. if ( !( --count ) ) {
  870. // Strange bug in FF4:
  871. // Values changed onto the arguments object sometimes end up as undefined values
  872. // outside the $.when method. Cloning the object into a fresh array solves the issue
  873. deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
  874. }
  875. };
  876. }
  877. if ( length > 1 ) {
  878. for( ; i < length; i++ ) {
  879. if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
  880. args[ i ].promise().then( resolveFunc(i), deferred.reject );
  881. } else {
  882. --count;
  883. }
  884. }
  885. if ( !count ) {
  886. deferred.resolveWith( deferred, args );
  887. }
  888. } else if ( deferred !== firstParam ) {
  889. deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
  890. }
  891. return deferred.promise();
  892. }
  893. });
  894. (function() {
  895. jQuery.support = {};
  896. var div = document.createElement("div");
  897. div.style.display = "none";
  898. div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
  899. var all = div.getElementsByTagName("*"),
  900. a = div.getElementsByTagName("a")[0],
  901. select = document.createElement("select"),
  902. opt = select.appendChild( document.createElement("option") ),
  903. input = div.getElementsByTagName("input")[0];
  904. // Can't get basic test support
  905. if ( !all || !all.length || !a ) {
  906. return;
  907. }
  908. jQuery.support = {
  909. // IE strips leading whitespace when .innerHTML is used
  910. leadingWhitespace: div.firstChild.nodeType === 3,
  911. // Make sure that tbody elements aren't automatically inserted
  912. // IE will insert them into empty tables
  913. tbody: !div.getElementsByTagName("tbody").length,
  914. // Make sure that link elements get serialized correctly by innerHTML
  915. // This requires a wrapper element in IE
  916. htmlSerialize: !!div.getElementsByTagName("link").length,
  917. // Get the style information from getAttribute
  918. // (IE uses .cssText insted)
  919. style: /red/.test( a.getAttribute("style") ),
  920. // Make sure that URLs aren't manipulated
  921. // (IE normalizes it by default)
  922. hrefNormalized: a.getAttribute("href") === "/a",
  923. // Make sure that element opacity exists
  924. // (IE uses filter instead)
  925. // Use a regex to work around a WebKit issue. See #5145
  926. opacity: /^0.55$/.test( a.style.opacity ),
  927. // Verify style float existence
  928. // (IE uses styleFloat instead of cssFloat)
  929. cssFloat: !!a.style.cssFloat,
  930. // Make sure that if no value is specified for a checkbox
  931. // that it defaults to "on".
  932. // (WebKit defaults to "" instead)
  933. checkOn: input.value === "on",
  934. // Make sure that a selected-by-default option has a working selected property.
  935. // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
  936. optSelected: opt.selected,
  937. // Will be defined later
  938. deleteExpando: true,
  939. optDisabled: false,
  940. checkClone: false,
  941. noCloneEvent: true,
  942. noCloneChecked: true,
  943. boxModel: null,
  944. inlineBlockNeedsLayout: false,
  945. shrinkWrapBlocks: false,
  946. reliableHiddenOffsets: true,
  947. reliableMarginRight: true
  948. };
  949. input.checked = true;
  950. jQuery.support.noCloneChecked = input.cloneNode( true ).checked;
  951. // Make sure that the options inside disabled selects aren't marked as disabled
  952. // (WebKit marks them as diabled)
  953. select.disabled = true;
  954. jQuery.support.optDisabled = !opt.disabled;
  955. var _scriptEval = null;
  956. jQuery.support.scriptEval = function() {
  957. if ( _scriptEval === null ) {
  958. var root = document.documentElement,
  959. script = document.createElement("script"),
  960. id = "script" + jQuery.now();
  961. // Make sure that the execution of code works by injecting a script
  962. // tag with appendChild/createTextNode
  963. // (IE doesn't support this, fails, and uses .text instead)
  964. try {
  965. script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
  966. } catch(e) {}
  967. root.insertBefore( script, root.firstChild );
  968. if ( window[ id ] ) {
  969. _scriptEval = true;
  970. delete window[ id ];
  971. } else {
  972. _scriptEval = false;
  973. }
  974. root.removeChild( script );
  975. }
  976. return _scriptEval;
  977. };
  978. // Test to see if it's possible to delete an expando from an element
  979. // Fails in Internet Explorer
  980. try {
  981. delete div.test;
  982. } catch(e) {
  983. jQuery.support.deleteExpando = false;
  984. }
  985. if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
  986. div.attachEvent("onclick", function click() {
  987. // Cloning a node shouldn't copy over any
  988. // bound event handlers (IE does this)
  989. jQuery.support.noCloneEvent = false;
  990. div.detachEvent("onclick", click);
  991. });
  992. div.cloneNode(true).fireEvent("onclick");
  993. }
  994. div = document.createElement("div");
  995. div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
  996. var fragment = document.createDocumentFragment();
  997. fragment.appendChild( div.firstChild );
  998. // WebKit doesn't clone checked state correctly in fragments
  999. jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
  1000. // Figure out if the W3C box model works as expected
  1001. // document.body must exist before we can do this
  1002. jQuery(function() {
  1003. var div = document.createElement("div"),
  1004. body = document.getElementsByTagName("body")[0];
  1005. // Frameset documents with no body should not run this code
  1006. if ( !body ) {
  1007. return;
  1008. }
  1009. div.style.width = div.style.paddingLeft = "1px";
  1010. body.appendChild( div );
  1011. jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
  1012. if ( "zoom" in div.style ) {
  1013. // Check if natively block-level elements act like inline-block
  1014. // elements when setting their display to 'inline' and giving
  1015. // them layout
  1016. // (IE < 8 does this)
  1017. div.style.display = "inline";
  1018. div.style.zoom = 1;
  1019. jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2;
  1020. // Check if elements with layout shrink-wrap their children
  1021. // (IE 6 does this)
  1022. div.style.display = "";
  1023. div.innerHTML = "<div style='width:4px;'></div>";
  1024. jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2;
  1025. }
  1026. div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
  1027. var tds = div.getElementsByTagName("td");
  1028. // Check if table cells still have offsetWidth/Height when they are set
  1029. // to display:none and there are still other visible table cells in a
  1030. // table row; if so, offsetWidth/Height are not reliable for use when
  1031. // determining if an element has been hidden directly using
  1032. // display:none (it is still safe to use offsets if a parent element is
  1033. // hidden; don safety goggles and see bug #4512 for more information).
  1034. // (only IE 8 fails this test)
  1035. jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0;
  1036. tds[0].style.display = "";
  1037. tds[1].style.display = "none";
  1038. // Check if empty table cells still have offsetWidth/Height
  1039. // (IE < 8 fail this test)
  1040. jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0;
  1041. div.innerHTML = "";
  1042. // Check if div with explicit width and no margin-right incorrectly
  1043. // gets computed margin-right based on width of container. For more
  1044. // info see bug #3333
  1045. // Fails in WebKit before Feb 2011 nightlies
  1046. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  1047. if ( document.defaultView && document.defaultView.getComputedStyle ) {
  1048. div.style.width = "1px";
  1049. div.style.marginRight = "0";
  1050. jQuery.support.reliableMarginRight = ( parseInt(document.defaultView.getComputedStyle(div, null).marginRight, 10) || 0 ) === 0;
  1051. }
  1052. body.removeChild( div ).style.display = "none";
  1053. div = tds = null;
  1054. });
  1055. // Technique from Juriy Zaytsev
  1056. // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
  1057. var eventSupported = function( eventName ) {
  1058. var el = document.createElement("div");
  1059. eventName = "on" + eventName;
  1060. // We only care about the case where non-standard event systems
  1061. // are used, namely in IE. Short-circuiting here helps us to
  1062. // avoid an eval call (in setAttribute) which can cause CSP
  1063. // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
  1064. if ( !el.attachEvent ) {
  1065. return true;
  1066. }
  1067. var isSupported = (eventName in el);
  1068. if ( !isSupported ) {
  1069. el.setAttribute(eventName, "return;");
  1070. isSupported = typeof el[eventName] === "function";
  1071. }
  1072. return isSupported;
  1073. };
  1074. jQuery.support.submitBubbles = eventSupported("submit");
  1075. jQuery.support.changeBubbles = eventSupported("change");
  1076. // release memory in IE
  1077. div = all = a = null;
  1078. })();
  1079. var rbrace = /^(?:\{.*\}|\[.*\])$/;
  1080. jQuery.extend({
  1081. cache: {},
  1082. // Please use with caution
  1083. uuid: 0,
  1084. // Unique for each copy of jQuery on the page
  1085. // Non-digits removed to match rinlinejQuery
  1086. expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
  1087. // The following elements throw uncatchable exceptions if you
  1088. // attempt to add expando properties to them.
  1089. noData: {
  1090. "embed": true,
  1091. // Ban all objects except for Flash (which handle expandos)
  1092. "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
  1093. "applet": true
  1094. },
  1095. hasData: function( elem ) {
  1096. elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
  1097. return !!elem && !isEmptyDataObject( elem );
  1098. },
  1099. data: function( elem, name, data, pvt /* Internal Use Only */ ) {
  1100. if ( !jQuery.acceptData( elem ) ) {
  1101. return;
  1102. }
  1103. var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
  1104. // We have to handle DOM nodes and JS objects differently because IE6-7
  1105. // can't GC object references properly across the DOM-JS boundary
  1106. isNode = elem.nodeType,
  1107. // Only DOM nodes need the global jQuery cache; JS object data is
  1108. // attached directly to the object so GC can occur automatically
  1109. cache = isNode ? jQuery.cache : elem,
  1110. // Only defining an ID for JS objects if its cache already exists allows
  1111. // the code to shortcut on the same path as a DOM node with no cache
  1112. id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
  1113. // Avoid doing any more work than we need to when trying to get data on an
  1114. // object that has no data at all
  1115. if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
  1116. return;
  1117. }
  1118. if ( !id ) {
  1119. // Only DOM nodes need a new unique ID for each element since their data
  1120. // ends up in the global cache
  1121. if ( isNode ) {
  1122. elem[ jQuery.expando ] = id = ++jQuery.uuid;
  1123. } else {
  1124. id = jQuery.expando;
  1125. }
  1126. }
  1127. if ( !cache[ id ] ) {
  1128. cache[ id ] = {};
  1129. // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
  1130. // metadata on plain JS objects when the object is serialized using
  1131. // JSON.stringify
  1132. if ( !isNode ) {
  1133. cache[ id ].toJSON = jQuery.noop;
  1134. }
  1135. }
  1136. // An object can be passed to jQuery.data instead of a key/value pair; this gets
  1137. // shallow copied over onto the existing cache
  1138. if ( typeof name === "object" || typeof name === "function" ) {
  1139. if ( pvt ) {
  1140. cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
  1141. } else {
  1142. cache[ id ] = jQuery.extend(cache[ id ], name);
  1143. }
  1144. }
  1145. thisCache = cache[ id ];
  1146. // Internal jQuery data is stored in a separate object inside the object's data
  1147. // cache in order to avoid key collisions between internal data and user-defined
  1148. // data
  1149. if ( pvt ) {
  1150. if ( !thisCache[ internalKey ] ) {
  1151. thisCache[ internalKey ] = {};
  1152. }
  1153. thisCache = thisCache[ internalKey ];
  1154. }
  1155. if ( data !== undefined ) {
  1156. thisCache[ name ] = data;
  1157. }
  1158. // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
  1159. // not attempt to inspect the internal events object using jQuery.data, as this
  1160. // internal data object is undocumented and subject to change.
  1161. if ( name === "events" && !thisCache[name] ) {
  1162. return thisCache[ internalKey ] && thisCache[ internalKey ].events;
  1163. }
  1164. return getByName ? thisCache[ name ] : thisCache;
  1165. },
  1166. removeData: function( elem, name, pvt /* Internal Use Only */ ) {
  1167. if ( !jQuery.acceptData( elem ) ) {
  1168. return;
  1169. }
  1170. var internalKey = jQuery.expando, isNode = elem.nodeType,
  1171. // See jQuery.data for more information
  1172. cache = isNode ? jQuery.cache : elem,
  1173. // See jQuery.data for more information
  1174. id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
  1175. // If there is already no cache entry for this object, there is no
  1176. // purpose in continuing
  1177. if ( !cache[ id ] ) {
  1178. return;
  1179. }
  1180. if ( name ) {
  1181. var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
  1182. if ( thisCache ) {
  1183. delete thisCache[ name ];
  1184. // If there is no data left in the cache, we want to continue
  1185. // and let the cache object itself get destroyed
  1186. if ( !isEmptyDataObject(thisCache) ) {
  1187. return;
  1188. }
  1189. }
  1190. }
  1191. // See jQuery.data for more information
  1192. if ( pvt ) {
  1193. delete cache[ id ][ internalKey ];
  1194. // Don't destroy the parent cache unless the internal data object
  1195. // had been the only thing left in it
  1196. if ( !isEmptyDataObject(cache[ id ]) ) {
  1197. return;
  1198. }
  1199. }
  1200. var internalCache = cache[ id ][ internalKey ];
  1201. // Browsers that fail expando deletion also refuse to delete expandos on
  1202. // the window, but it will allow it on all other JS objects; other browsers
  1203. // don't care
  1204. if ( jQuery.support.deleteExpando || cache != window ) {
  1205. delete cache[ id ];
  1206. } else {
  1207. cache[ id ] = null;
  1208. }
  1209. // We destroyed the entire user cache at once because it's faster than
  1210. // iterating through each key, but we need to continue to persist internal
  1211. // data if it existed
  1212. if ( internalCache ) {
  1213. cache[ id ] = {};
  1214. // TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
  1215. // metadata on plain JS objects when the object is serialized using
  1216. // JSON.stringify
  1217. if ( !isNode ) {
  1218. cache[ id ].toJSON = jQuery.noop;
  1219. }
  1220. cache[ id ][ internalKey ] = internalCache;
  1221. // Otherwise, we need to eliminate the expando on the node to avoid
  1222. // false lookups in the cache for entries that no longer exist
  1223. } else if ( isNode ) {
  1224. // IE does not allow us to delete expando properties from nodes,
  1225. // nor does it have a removeAttribute function on Document nodes;
  1226. // we must handle all of these cases
  1227. if ( jQuery.support.deleteExpando ) {
  1228. delete elem[ jQuery.expando ];
  1229. } else if ( elem.removeAttribute ) {
  1230. elem.removeAttribute( jQuery.expando );
  1231. } else {
  1232. elem[ jQuery.expando ] = null;
  1233. }
  1234. }
  1235. },
  1236. // For internal use only.
  1237. _data: function( elem, name, data ) {
  1238. return jQuery.data( elem, name, data, true );
  1239. },
  1240. // A method for determining if a DOM node can handle the data expando
  1241. acceptData: function( elem ) {
  1242. if ( elem.nodeName ) {
  1243. var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
  1244. if ( match ) {
  1245. return !(match === true || elem.getAttribute("classid") !== match);
  1246. }
  1247. }
  1248. return true;
  1249. }
  1250. });
  1251. jQuery.fn.extend({
  1252. data: function( key, value ) {
  1253. var data = null;
  1254. if ( typeof key === "undefined" ) {
  1255. if ( this.length ) {
  1256. data = jQuery.data( this[0] );
  1257. if ( this[0].nodeType === 1 ) {
  1258. var attr = this[0].attributes, name;
  1259. for ( var i = 0, l = attr.length; i < l; i++ ) {
  1260. name = attr[i].name;
  1261. if ( name.indexOf( "data-" ) === 0 ) {
  1262. name = name.substr( 5 );
  1263. dataAttr( this[0], name, data[ name ] );
  1264. }
  1265. }
  1266. }
  1267. }
  1268. return data;
  1269. } else if ( typeof key === "object" ) {
  1270. return this.each(function() {
  1271. jQuery.data( this, key );
  1272. });
  1273. }
  1274. var parts = key.split(".");
  1275. parts[1] = parts[1] ? "." + parts[1] : "";
  1276. if ( value === undefined ) {
  1277. data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
  1278. // Try to fetch any internally stored data first
  1279. if ( data === undefined && this.length ) {
  1280. data = jQuery.data( this[0], key );
  1281. data = dataAttr( this[0], key, data );
  1282. }
  1283. return data === undefined && parts[1] ?
  1284. this.data( parts[0] ) :
  1285. data;
  1286. } else {
  1287. return this.each(function() {
  1288. var $this = jQuery( this ),
  1289. args = [ parts[0], value ];
  1290. $this.triggerHandler( "setData" + parts[1] + "!", args );
  1291. jQuery.data( this, key, value );
  1292. $this.triggerHandler( "changeData" + parts[1] + "!", args );
  1293. });
  1294. }
  1295. },
  1296. removeData: function( key ) {
  1297. return this.each(function() {
  1298. jQuery.removeData( this, key );
  1299. });
  1300. }
  1301. });
  1302. function dataAttr( elem, key, data ) {
  1303. // If nothing was found internally, try to fetch any
  1304. // data from the HTML5 data-* attribute
  1305. if ( data === undefined && elem.nodeType === 1 ) {
  1306. data = elem.getAttribute( "data-" + key );
  1307. if ( typeof data === "string" ) {
  1308. try {
  1309. data = data === "true" ? true :
  1310. data === "false" ? false :
  1311. data === "null" ? null :
  1312. !jQuery.isNaN( data ) ? parseFloat( data ) :
  1313. rbrace.test( data ) ? jQuery.parseJSON( data ) :
  1314. data;
  1315. } catch( e ) {}
  1316. // Make sure we set the data so it isn't changed later
  1317. jQuery.data( elem, key, data );
  1318. } else {
  1319. data = undefined;
  1320. }
  1321. }
  1322. return data;
  1323. }
  1324. // TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
  1325. // property to be considered empty objects; this property always exists in
  1326. // order to make sure JSON.stringify does not expose internal metadata
  1327. function isEmptyDataObject( obj ) {
  1328. for ( var name in obj ) {
  1329. if ( name !== "toJSON" ) {
  1330. return false;
  1331. }
  1332. }
  1333. return true;
  1334. }
  1335. jQuery.extend({
  1336. queue: function( elem, type, data ) {
  1337. if ( !elem ) {
  1338. return;
  1339. }
  1340. type = (type || "fx") + "queue";
  1341. var q = jQuery._data( elem, type );
  1342. // Speed up dequeue by getting out quickly if this is just a lookup
  1343. if ( !data ) {
  1344. return q || [];
  1345. }
  1346. if ( !q || jQuery.isArray(data) ) {
  1347. q = jQuery._data( elem, type, jQuery.makeArray(data) );
  1348. } else {
  1349. q.push( data );
  1350. }
  1351. return q;
  1352. },
  1353. dequeue: function( elem, type ) {
  1354. type = type || "fx";
  1355. var queue = jQuery.queue( elem, type ),
  1356. fn = queue.shift();
  1357. // If the fx queue is dequeued, always remove the progress sentinel
  1358. if ( fn === "inprogress" ) {
  1359. fn = queue.shift();
  1360. }
  1361. if ( fn ) {
  1362. // Add a progress sentinel to prevent the fx queue from being
  1363. // automatically dequeued
  1364. if ( type === "fx" ) {
  1365. queue.unshift("inprogress");
  1366. }
  1367. fn.call(elem, function() {
  1368. jQuery.dequeue(elem, type);
  1369. });
  1370. }
  1371. if ( !queue.length ) {
  1372. jQuery.removeData( elem, type + "queue", true );
  1373. }
  1374. }
  1375. });
  1376. jQuery.fn.extend({
  1377. queue: function( type, data ) {
  1378. if ( typeof type !== "string" ) {
  1379. data = type;
  1380. type = "fx";
  1381. }
  1382. if ( data === undefined ) {
  1383. return jQuery.queue( this[0], type );
  1384. }
  1385. return this.each(function( i ) {
  1386. var queue = jQuery.queue( this, type, data );
  1387. if ( type === "fx" && queue[0] !== "inprogress" ) {
  1388. jQuery.dequeue( this, type );
  1389. }
  1390. });
  1391. },
  1392. dequeue: function( type ) {
  1393. return this.each(function() {
  1394. jQuery.dequeue( this, type );
  1395. });
  1396. },
  1397. // Based off of the plugin by Clint Helfers, with permission.
  1398. // http://blindsignals.com/index.php/2009/07/jquery-delay/
  1399. delay: function( time, type ) {
  1400. time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
  1401. type = type || "fx";
  1402. return this.queue( type, function() {
  1403. var elem = this;
  1404. setTimeout(function() {
  1405. jQuery.dequeue( elem, type );
  1406. }, time );
  1407. });
  1408. },
  1409. clearQueue: function( type ) {
  1410. return this.queue( type || "fx", [] );
  1411. }
  1412. });
  1413. var rclass = /[\n\t\r]/g,
  1414. rspaces = /\s+/,
  1415. rreturn = /\r/g,
  1416. rspecialurl = /^(?:href|src|style)$/,
  1417. rtype = /^(?:button|input)$/i,
  1418. rfocusable = /^(?:button|input|object|select|textarea)$/i,
  1419. rclickable = /^a(?:rea)?$/i,
  1420. rradiocheck = /^(?:radio|checkbox)$/i;
  1421. jQuery.props = {
  1422. "for": "htmlFor",
  1423. "class": "className",
  1424. readonly: "readOnly",
  1425. maxlength: "maxLength",
  1426. cellspacing: "cellSpacing",
  1427. rowspan: "rowSpan",
  1428. colspan: "colSpan",
  1429. tabindex: "tabIndex",
  1430. usemap: "useMap",
  1431. frameborder: "frameBorder"
  1432. };
  1433. jQuery.fn.extend({
  1434. attr: function( name, value ) {
  1435. return jQuery.access( this, name, value, true, jQuery.attr );
  1436. },
  1437. removeAttr: function( name, fn ) {
  1438. return this.each(function(){
  1439. jQuery.attr( this, name, "" );
  1440. if ( this.nodeType === 1 ) {
  1441. this.removeAttribute( name );
  1442. }
  1443. });
  1444. },
  1445. addClass: function( value ) {
  1446. if ( jQuery.isFunction(value) ) {
  1447. return this.each(function(i) {
  1448. var self = jQuery(this);
  1449. self.addClass( value.call(this, i, self.attr("class")) );
  1450. });
  1451. }
  1452. if ( value && typeof value === "string" ) {
  1453. var classNames = (value || "").split( rspaces );
  1454. for ( var i = 0, l = this.length; i < l; i++ ) {
  1455. var elem = this[i];
  1456. if ( elem.nodeType === 1 ) {
  1457. if ( !elem.className ) {
  1458. elem.className = value;
  1459. } else {
  1460. var className = " " + elem.className + " ",
  1461. setClass = elem.className;
  1462. for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
  1463. if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
  1464. setClass += " " + classNames[c];
  1465. }
  1466. }
  1467. elem.className = jQuery.trim( setClass );
  1468. }
  1469. }
  1470. }
  1471. }
  1472. return this;
  1473. },
  1474. removeClass: function( value ) {
  1475. if ( jQuery.isFunction(value) ) {
  1476. return this.each(function(i) {
  1477. var self = jQuery(this);
  1478. self.removeClass( value.call(this, i, self.attr("class")) );
  1479. });
  1480. }
  1481. if ( (value && typeof value === "string") || value === undefined ) {
  1482. var classNames = (value || "").split( rspaces );
  1483. for ( var i = 0, l = this.length; i < l; i++ ) {
  1484. var elem = this[i];
  1485. if ( elem.nodeType === 1 && elem.className ) {
  1486. if ( value ) {
  1487. var className = (" " + elem.className + " ").replace(rclass, " ");
  1488. for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
  1489. className = className.replace(" " + classNames[c] + " ", " ");
  1490. }
  1491. elem.className = jQuery.trim( className );
  1492. } else {
  1493. elem.className = "";
  1494. }
  1495. }
  1496. }
  1497. }
  1498. return this;
  1499. },
  1500. toggleClass: function( value, stateVal ) {
  1501. var type = typeof value,
  1502. isBool = typeof stateVal === "boolean";
  1503. if ( jQuery.isFunction( value ) ) {
  1504. return this.each(function(i) {
  1505. var self = jQuery(this);
  1506. self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal );
  1507. });
  1508. }
  1509. return this.each(function() {
  1510. if ( type === "string" ) {
  1511. // toggle individual class names
  1512. var className,
  1513. i = 0,
  1514. self = jQuery( this ),
  1515. state = stateVal,
  1516. classNames = value.split( rspaces );
  1517. while ( (className = classNames[ i++ ]) ) {
  1518. // check each className given, space seperated list
  1519. state = isBool ? state : !self.hasClass( className );
  1520. self[ state ? "addClass" : "removeClass" ]( className );
  1521. }
  1522. } else if ( type === "undefined" || type === "boolean" ) {
  1523. if ( this.className ) {
  1524. // store className if set
  1525. jQuery._data( this, "__className__", this.className );
  1526. }
  1527. // toggle whole className
  1528. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
  1529. }
  1530. });
  1531. },
  1532. hasClass: function( selector ) {
  1533. var className = " " + selector + " ";
  1534. for ( var i = 0, l = this.length; i < l; i++ ) {
  1535. if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
  1536. return true;
  1537. }
  1538. }
  1539. return false;
  1540. },
  1541. val: function( value ) {
  1542. if ( !arguments.length ) {
  1543. var elem

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