PageRenderTime 88ms CodeModel.GetById 36ms RepoModel.GetById 1ms app.codeStats 3ms

/lib/infusion/MyInfusion.js

https://bitbucket.org/cindyli/decapod-0.7-ui-iteration3
JavaScript | 15897 lines | 11361 code | 2225 blank | 2311 comment | 2751 complexity | a7d596364914612aa7a0c2b292b87087 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, Apache-2.0, LGPL-2.0

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

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

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