PageRenderTime 83ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 3ms

/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/app.js

https://bitbucket.org/mpuckett/iostudio-whiteboard
JavaScript | 14291 lines | 10479 code | 1963 blank | 1849 comment | 2373 complexity | dc89ca0c0ee287847dfb7aac75688c5f MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, MIT

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

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

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