PageRenderTime 71ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 1ms

/src/packages/jQuery.1.7/Content/Scripts/jquery-1.7.js

https://bitbucket.org/FunnelWeb/dev/
JavaScript | 2446 lines | 1625 code | 406 blank | 415 comment | 446 complexity | d10e709ff31b69e75ef7f452f5ef906a MD5 | raw file
Possible License(s): LGPL-2.1, BSD-3-Clause

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

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

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