You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

6747 lines
204 KiB

  1. /* NUGET: BEGIN LICENSE TEXT
  2. *
  3. * Microsoft grants you the right to use these script files for the sole
  4. * purpose of either: (i) interacting through your browser with the Microsoft
  5. * website or online service, subject to the applicable licensing or use
  6. * terms; or (ii) using the files as included with a Microsoft product subject
  7. * to that product's license terms. Microsoft reserves all other rights to the
  8. * files not expressly granted by Microsoft, whether by implication, estoppel
  9. * or otherwise. Insofar as a script file is dual licensed under GPL,
  10. * Microsoft neither took the code under GPL nor distributes it thereunder but
  11. * under the terms set out in this paragraph. All notices and licenses
  12. * below are for informational purposes only.
  13. *
  14. * NUGET: END LICENSE TEXT */
  15. /*
  16. * This file has been generated to support Visual Studio IntelliSense.
  17. * You should not use this file at runtime inside the browser--it is only
  18. * intended to be used only for design-time IntelliSense. Please use the
  19. * standard jQuery library for all runtime use.
  20. *
  21. * Comment version: 1.10.2
  22. */
  23. /*!
  24. * jQuery JavaScript Library v1.10.2
  25. * http://jquery.com/
  26. *
  27. * Includes Sizzle.js
  28. * http://sizzlejs.com/
  29. *
  30. * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
  31. * Released under the MIT license
  32. * http://jquery.org/license
  33. *
  34. */
  35. (function ( window, undefined ) {
  36. var jQuery = function( selector, context ) {
  37. /// <summary>
  38. /// 1: Accepts a string containing a CSS selector which is then used to match a set of elements.
  39. /// &#10; 1.1 - $(selector, context)
  40. /// &#10; 1.2 - $(element)
  41. /// &#10; 1.3 - $(object)
  42. /// &#10; 1.4 - $(elementArray)
  43. /// &#10; 1.5 - $(jQuery object)
  44. /// &#10; 1.6 - $()
  45. /// &#10;2: Creates DOM elements on the fly from the provided string of raw HTML.
  46. /// &#10; 2.1 - $(html, ownerDocument)
  47. /// &#10; 2.2 - $(html, props)
  48. /// &#10;3: Binds a function to be executed when the DOM has finished loading.
  49. /// &#10; 3.1 - $(callback)
  50. /// </summary>
  51. /// <param name="selector" type="String">
  52. /// A string containing a selector expression
  53. /// </param>
  54. /// <param name="context" type="jQuery">
  55. /// A DOM Element, Document, or jQuery to use as context
  56. /// </param>
  57. /// <returns type="jQuery" />
  58. // The jQuery object is actually just the init constructor 'enhanced'
  59. return new jQuery.fn.init( selector, context, rootjQuery );
  60. };
  61. jQuery.Animation = function Animation( elem, properties, options ) {
  62. var result,
  63. stopped,
  64. index = 0,
  65. length = animationPrefilters.length,
  66. deferred = jQuery.Deferred().always( function() {
  67. // don't match elem in the :animated selector
  68. delete tick.elem;
  69. }),
  70. tick = function() {
  71. if ( stopped ) {
  72. return false;
  73. }
  74. var currentTime = fxNow || createFxNow(),
  75. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  76. // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
  77. temp = remaining / animation.duration || 0,
  78. percent = 1 - temp,
  79. index = 0,
  80. length = animation.tweens.length;
  81. for ( ; index < length ; index++ ) {
  82. animation.tweens[ index ].run( percent );
  83. }
  84. deferred.notifyWith( elem, [ animation, percent, remaining ]);
  85. if ( percent < 1 && length ) {
  86. return remaining;
  87. } else {
  88. deferred.resolveWith( elem, [ animation ] );
  89. return false;
  90. }
  91. },
  92. animation = deferred.promise({
  93. elem: elem,
  94. props: jQuery.extend( {}, properties ),
  95. opts: jQuery.extend( true, { specialEasing: {} }, options ),
  96. originalProperties: properties,
  97. originalOptions: options,
  98. startTime: fxNow || createFxNow(),
  99. duration: options.duration,
  100. tweens: [],
  101. createTween: function( prop, end ) {
  102. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  103. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  104. animation.tweens.push( tween );
  105. return tween;
  106. },
  107. stop: function( gotoEnd ) {
  108. var index = 0,
  109. // if we are going to the end, we want to run all the tweens
  110. // otherwise we skip this part
  111. length = gotoEnd ? animation.tweens.length : 0;
  112. if ( stopped ) {
  113. return this;
  114. }
  115. stopped = true;
  116. for ( ; index < length ; index++ ) {
  117. animation.tweens[ index ].run( 1 );
  118. }
  119. // resolve when we played the last frame
  120. // otherwise, reject
  121. if ( gotoEnd ) {
  122. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  123. } else {
  124. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  125. }
  126. return this;
  127. }
  128. }),
  129. props = animation.props;
  130. propFilter( props, animation.opts.specialEasing );
  131. for ( ; index < length ; index++ ) {
  132. result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
  133. if ( result ) {
  134. return result;
  135. }
  136. }
  137. jQuery.map( props, createTween, animation );
  138. if ( jQuery.isFunction( animation.opts.start ) ) {
  139. animation.opts.start.call( elem, animation );
  140. }
  141. jQuery.fx.timer(
  142. jQuery.extend( tick, {
  143. elem: elem,
  144. anim: animation,
  145. queue: animation.opts.queue
  146. })
  147. );
  148. // attach callbacks from options
  149. return animation.progress( animation.opts.progress )
  150. .done( animation.opts.done, animation.opts.complete )
  151. .fail( animation.opts.fail )
  152. .always( animation.opts.always );
  153. };
  154. jQuery.Callbacks = function( options ) {
  155. /// <summary>
  156. /// A multi-purpose callbacks list object that provides a powerful way to manage callback lists.
  157. /// </summary>
  158. /// <param name="options" type="String">
  159. /// An optional list of space-separated flags that change how the callback list behaves.
  160. /// </param>
  161. // Convert options from String-formatted to Object-formatted if needed
  162. // (we check in cache first)
  163. options = typeof options === "string" ?
  164. ( optionsCache[ options ] || createOptions( options ) ) :
  165. jQuery.extend( {}, options );
  166. var // Flag to know if list is currently firing
  167. firing,
  168. // Last fire value (for non-forgettable lists)
  169. memory,
  170. // Flag to know if list was already fired
  171. fired,
  172. // End of the loop when firing
  173. firingLength,
  174. // Index of currently firing callback (modified by remove if needed)
  175. firingIndex,
  176. // First callback to fire (used internally by add and fireWith)
  177. firingStart,
  178. // Actual callback list
  179. list = [],
  180. // Stack of fire calls for repeatable lists
  181. stack = !options.once && [],
  182. // Fire callbacks
  183. fire = function( data ) {
  184. memory = options.memory && data;
  185. fired = true;
  186. firingIndex = firingStart || 0;
  187. firingStart = 0;
  188. firingLength = list.length;
  189. firing = true;
  190. for ( ; list && firingIndex < firingLength; firingIndex++ ) {
  191. if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
  192. memory = false; // To prevent further calls using add
  193. break;
  194. }
  195. }
  196. firing = false;
  197. if ( list ) {
  198. if ( stack ) {
  199. if ( stack.length ) {
  200. fire( stack.shift() );
  201. }
  202. } else if ( memory ) {
  203. list = [];
  204. } else {
  205. self.disable();
  206. }
  207. }
  208. },
  209. // Actual Callbacks object
  210. self = {
  211. // Add a callback or a collection of callbacks to the list
  212. add: function() {
  213. if ( list ) {
  214. // First, we save the current length
  215. var start = list.length;
  216. (function add( args ) {
  217. jQuery.each( args, function( _, arg ) {
  218. var type = jQuery.type( arg );
  219. if ( type === "function" ) {
  220. if ( !options.unique || !self.has( arg ) ) {
  221. list.push( arg );
  222. }
  223. } else if ( arg && arg.length && type !== "string" ) {
  224. // Inspect recursively
  225. add( arg );
  226. }
  227. });
  228. })( arguments );
  229. // Do we need to add the callbacks to the
  230. // current firing batch?
  231. if ( firing ) {
  232. firingLength = list.length;
  233. // With memory, if we're not firing then
  234. // we should call right away
  235. } else if ( memory ) {
  236. firingStart = start;
  237. fire( memory );
  238. }
  239. }
  240. return this;
  241. },
  242. // Remove a callback from the list
  243. remove: function() {
  244. if ( list ) {
  245. jQuery.each( arguments, function( _, arg ) {
  246. var index;
  247. while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  248. list.splice( index, 1 );
  249. // Handle firing indexes
  250. if ( firing ) {
  251. if ( index <= firingLength ) {
  252. firingLength--;
  253. }
  254. if ( index <= firingIndex ) {
  255. firingIndex--;
  256. }
  257. }
  258. }
  259. });
  260. }
  261. return this;
  262. },
  263. // Check if a given callback is in the list.
  264. // If no argument is given, return whether or not list has callbacks attached.
  265. has: function( fn ) {
  266. return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
  267. },
  268. // Remove all callbacks from the list
  269. empty: function() {
  270. list = [];
  271. firingLength = 0;
  272. return this;
  273. },
  274. // Have the list do nothing anymore
  275. disable: function() {
  276. list = stack = memory = undefined;
  277. return this;
  278. },
  279. // Is it disabled?
  280. disabled: function() {
  281. return !list;
  282. },
  283. // Lock the list in its current state
  284. lock: function() {
  285. stack = undefined;
  286. if ( !memory ) {
  287. self.disable();
  288. }
  289. return this;
  290. },
  291. // Is it locked?
  292. locked: function() {
  293. return !stack;
  294. },
  295. // Call all callbacks with the given context and arguments
  296. fireWith: function( context, args ) {
  297. args = args || [];
  298. args = [ context, args.slice ? args.slice() : args ];
  299. if ( list && ( !fired || stack ) ) {
  300. if ( firing ) {
  301. stack.push( args );
  302. } else {
  303. fire( args );
  304. }
  305. }
  306. return this;
  307. },
  308. // Call all the callbacks with the given arguments
  309. fire: function() {
  310. self.fireWith( this, arguments );
  311. return this;
  312. },
  313. // To know if the callbacks have already been called at least once
  314. fired: function() {
  315. return !!fired;
  316. }
  317. };
  318. return self;
  319. };
  320. jQuery.Deferred = function( func ) {
  321. var tuples = [
  322. // action, add listener, listener list, final state
  323. [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
  324. [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
  325. [ "notify", "progress", jQuery.Callbacks("memory") ]
  326. ],
  327. state = "pending",
  328. promise = {
  329. state: function() {
  330. return state;
  331. },
  332. always: function() {
  333. deferred.done( arguments ).fail( arguments );
  334. return this;
  335. },
  336. then: function( /* fnDone, fnFail, fnProgress */ ) {
  337. var fns = arguments;
  338. return jQuery.Deferred(function( newDefer ) {
  339. jQuery.each( tuples, function( i, tuple ) {
  340. var action = tuple[ 0 ],
  341. fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
  342. // deferred[ done | fail | progress ] for forwarding actions to newDefer
  343. deferred[ tuple[1] ](function() {
  344. var returned = fn && fn.apply( this, arguments );
  345. if ( returned && jQuery.isFunction( returned.promise ) ) {
  346. returned.promise()
  347. .done( newDefer.resolve )
  348. .fail( newDefer.reject )
  349. .progress( newDefer.notify );
  350. } else {
  351. newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
  352. }
  353. });
  354. });
  355. fns = null;
  356. }).promise();
  357. },
  358. // Get a promise for this deferred
  359. // If obj is provided, the promise aspect is added to the object
  360. promise: function( obj ) {
  361. return obj != null ? jQuery.extend( obj, promise ) : promise;
  362. }
  363. },
  364. deferred = {};
  365. // Keep pipe for back-compat
  366. promise.pipe = promise.then;
  367. // Add list-specific methods
  368. jQuery.each( tuples, function( i, tuple ) {
  369. var list = tuple[ 2 ],
  370. stateString = tuple[ 3 ];
  371. // promise[ done | fail | progress ] = list.add
  372. promise[ tuple[1] ] = list.add;
  373. // Handle state
  374. if ( stateString ) {
  375. list.add(function() {
  376. // state = [ resolved | rejected ]
  377. state = stateString;
  378. // [ reject_list | resolve_list ].disable; progress_list.lock
  379. }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
  380. }
  381. // deferred[ resolve | reject | notify ]
  382. deferred[ tuple[0] ] = function() {
  383. deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
  384. return this;
  385. };
  386. deferred[ tuple[0] + "With" ] = list.fireWith;
  387. });
  388. // Make the deferred a promise
  389. promise.promise( deferred );
  390. // Call given func if any
  391. if ( func ) {
  392. func.call( deferred, deferred );
  393. }
  394. // All done!
  395. return deferred;
  396. };
  397. jQuery.Event = function( src, props ) {
  398. // Allow instantiation without the 'new' keyword
  399. if ( !(this instanceof jQuery.Event) ) {
  400. return new jQuery.Event( src, props );
  401. }
  402. // Event object
  403. if ( src && src.type ) {
  404. this.originalEvent = src;
  405. this.type = src.type;
  406. // Events bubbling up the document may have been marked as prevented
  407. // by a handler lower down the tree; reflect the correct value.
  408. this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
  409. src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
  410. // Event type
  411. } else {
  412. this.type = src;
  413. }
  414. // Put explicitly provided properties onto the event object
  415. if ( props ) {
  416. jQuery.extend( this, props );
  417. }
  418. // Create a timestamp if incoming event doesn't have one
  419. this.timeStamp = src && src.timeStamp || jQuery.now();
  420. // Mark it as fixed
  421. this[ jQuery.expando ] = true;
  422. };
  423. jQuery.Tween = function Tween( elem, options, prop, end, easing ) {
  424. return new Tween.prototype.init( elem, options, prop, end, easing );
  425. };
  426. jQuery._data = function( elem, name, data ) {
  427. return internalData( elem, name, data, true );
  428. };
  429. jQuery._evalUrl = function( url ) {
  430. return jQuery.ajax({
  431. url: url,
  432. type: "GET",
  433. dataType: "script",
  434. async: false,
  435. global: false,
  436. "throws": true
  437. });
  438. };
  439. jQuery._queueHooks = function( elem, type ) {
  440. var key = type + "queueHooks";
  441. return jQuery._data( elem, key ) || jQuery._data( elem, key, {
  442. empty: jQuery.Callbacks("once memory").add(function() {
  443. jQuery._removeData( elem, type + "queue" );
  444. jQuery._removeData( elem, key );
  445. })
  446. });
  447. };
  448. jQuery._removeData = function( elem, name ) {
  449. return internalRemoveData( elem, name, true );
  450. };
  451. jQuery.acceptData = function( elem ) {
  452. // Do not set data on non-element because it will not be cleared (#8335).
  453. if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
  454. return false;
  455. }
  456. var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
  457. // nodes accept data unless otherwise specified; rejection can be conditional
  458. return !noData || noData !== true && elem.getAttribute("classid") === noData;
  459. };
  460. jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  461. var i = 0,
  462. length = elems.length,
  463. bulk = key == null;
  464. // Sets many values
  465. if ( jQuery.type( key ) === "object" ) {
  466. chainable = true;
  467. for ( i in key ) {
  468. jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
  469. }
  470. // Sets one value
  471. } else if ( value !== undefined ) {
  472. chainable = true;
  473. if ( !jQuery.isFunction( value ) ) {
  474. raw = true;
  475. }
  476. if ( bulk ) {
  477. // Bulk operations run against the entire set
  478. if ( raw ) {
  479. fn.call( elems, value );
  480. fn = null;
  481. // ...except when executing function values
  482. } else {
  483. bulk = fn;
  484. fn = function( elem, key, value ) {
  485. return bulk.call( jQuery( elem ), value );
  486. };
  487. }
  488. }
  489. if ( fn ) {
  490. for ( ; i < length; i++ ) {
  491. fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
  492. }
  493. }
  494. }
  495. return chainable ?
  496. elems :
  497. // Gets
  498. bulk ?
  499. fn.call( elems ) :
  500. length ? fn( elems[0], key ) : emptyGet;
  501. };
  502. jQuery.active = 0;
  503. jQuery.ajax = function( url, options ) {
  504. /// <summary>
  505. /// Perform an asynchronous HTTP (Ajax) request.
  506. /// &#10;1 - jQuery.ajax(url, settings)
  507. /// &#10;2 - jQuery.ajax(settings)
  508. /// </summary>
  509. /// <param name="url" type="String">
  510. /// A string containing the URL to which the request is sent.
  511. /// </param>
  512. /// <param name="options" type="Object">
  513. /// A set of key/value pairs that configure the Ajax request. All settings are optional. A default can be set for any option with $.ajaxSetup(). See jQuery.ajax( settings ) below for a complete list of all settings.
  514. /// </param>
  515. // If url is an object, simulate pre-1.5 signature
  516. if ( typeof url === "object" ) {
  517. options = url;
  518. url = undefined;
  519. }
  520. // Force options to be an object
  521. options = options || {};
  522. var // Cross-domain detection vars
  523. parts,
  524. // Loop variable
  525. i,
  526. // URL without anti-cache param
  527. cacheURL,
  528. // Response headers as string
  529. responseHeadersString,
  530. // timeout handle
  531. timeoutTimer,
  532. // To know if global events are to be dispatched
  533. fireGlobals,
  534. transport,
  535. // Response headers
  536. responseHeaders,
  537. // Create the final options object
  538. s = jQuery.ajaxSetup( {}, options ),
  539. // Callbacks context
  540. callbackContext = s.context || s,
  541. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  542. globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
  543. jQuery( callbackContext ) :
  544. jQuery.event,
  545. // Deferreds
  546. deferred = jQuery.Deferred(),
  547. completeDeferred = jQuery.Callbacks("once memory"),
  548. // Status-dependent callbacks
  549. statusCode = s.statusCode || {},
  550. // Headers (they are sent all at once)
  551. requestHeaders = {},
  552. requestHeadersNames = {},
  553. // The jqXHR state
  554. state = 0,
  555. // Default abort message
  556. strAbort = "canceled",
  557. // Fake xhr
  558. jqXHR = {
  559. readyState: 0,
  560. // Builds headers hashtable if needed
  561. getResponseHeader: function( key ) {
  562. var match;
  563. if ( state === 2 ) {
  564. if ( !responseHeaders ) {
  565. responseHeaders = {};
  566. while ( (match = rheaders.exec( responseHeadersString )) ) {
  567. responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
  568. }
  569. }
  570. match = responseHeaders[ key.toLowerCase() ];
  571. }
  572. return match == null ? null : match;
  573. },
  574. // Raw string
  575. getAllResponseHeaders: function() {
  576. return state === 2 ? responseHeadersString : null;
  577. },
  578. // Caches the header
  579. setRequestHeader: function( name, value ) {
  580. var lname = name.toLowerCase();
  581. if ( !state ) {
  582. name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
  583. requestHeaders[ name ] = value;
  584. }
  585. return this;
  586. },
  587. // Overrides response content-type header
  588. overrideMimeType: function( type ) {
  589. if ( !state ) {
  590. s.mimeType = type;
  591. }
  592. return this;
  593. },
  594. // Status-dependent callbacks
  595. statusCode: function( map ) {
  596. var code;
  597. if ( map ) {
  598. if ( state < 2 ) {
  599. for ( code in map ) {
  600. // Lazy-add the new callback in a way that preserves old ones
  601. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  602. }
  603. } else {
  604. // Execute the appropriate callbacks
  605. jqXHR.always( map[ jqXHR.status ] );
  606. }
  607. }
  608. return this;
  609. },
  610. // Cancel the request
  611. abort: function( statusText ) {
  612. var finalText = statusText || strAbort;
  613. if ( transport ) {
  614. transport.abort( finalText );
  615. }
  616. done( 0, finalText );
  617. return this;
  618. }
  619. };
  620. // Attach deferreds
  621. deferred.promise( jqXHR ).complete = completeDeferred.add;
  622. jqXHR.success = jqXHR.done;
  623. jqXHR.error = jqXHR.fail;
  624. // Remove hash character (#7531: and string promotion)
  625. // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
  626. // Handle falsy url in the settings object (#10093: consistency with old signature)
  627. // We also use the url parameter if available
  628. s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
  629. // Alias method option to type as per ticket #12004
  630. s.type = options.method || options.type || s.method || s.type;
  631. // Extract dataTypes list
  632. s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
  633. // A cross-domain request is in order when we have a protocol:host:port mismatch
  634. if ( s.crossDomain == null ) {
  635. parts = rurl.exec( s.url.toLowerCase() );
  636. s.crossDomain = !!( parts &&
  637. ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
  638. ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
  639. ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
  640. );
  641. }
  642. // Convert data if not already a string
  643. if ( s.data && s.processData && typeof s.data !== "string" ) {
  644. s.data = jQuery.param( s.data, s.traditional );
  645. }
  646. // Apply prefilters
  647. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  648. // If request was aborted inside a prefilter, stop there
  649. if ( state === 2 ) {
  650. return jqXHR;
  651. }
  652. // We can fire global events as of now if asked to
  653. fireGlobals = s.global;
  654. // Watch for a new set of requests
  655. if ( fireGlobals && jQuery.active++ === 0 ) {
  656. jQuery.event.trigger("ajaxStart");
  657. }
  658. // Uppercase the type
  659. s.type = s.type.toUpperCase();
  660. // Determine if request has content
  661. s.hasContent = !rnoContent.test( s.type );
  662. // Save the URL in case we're toying with the If-Modified-Since
  663. // and/or If-None-Match header later on
  664. cacheURL = s.url;
  665. // More options handling for requests with no content
  666. if ( !s.hasContent ) {
  667. // If data is available, append data to url
  668. if ( s.data ) {
  669. cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
  670. // #9682: remove data so that it's not used in an eventual retry
  671. delete s.data;
  672. }
  673. // Add anti-cache in url if needed
  674. if ( s.cache === false ) {
  675. s.url = rts.test( cacheURL ) ?
  676. // If there is already a '_' parameter, set its value
  677. cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
  678. // Otherwise add one to the end
  679. cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
  680. }
  681. }
  682. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  683. if ( s.ifModified ) {
  684. if ( jQuery.lastModified[ cacheURL ] ) {
  685. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  686. }
  687. if ( jQuery.etag[ cacheURL ] ) {
  688. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  689. }
  690. }
  691. // Set the correct header, if data is being sent
  692. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  693. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  694. }
  695. // Set the Accepts header for the server, depending on the dataType
  696. jqXHR.setRequestHeader(
  697. "Accept",
  698. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
  699. s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  700. s.accepts[ "*" ]
  701. );
  702. // Check for headers option
  703. for ( i in s.headers ) {
  704. jqXHR.setRequestHeader( i, s.headers[ i ] );
  705. }
  706. // Allow custom headers/mimetypes and early abort
  707. if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
  708. // Abort if not done already and return
  709. return jqXHR.abort();
  710. }
  711. // aborting is no longer a cancellation
  712. strAbort = "abort";
  713. // Install callbacks on deferreds
  714. for ( i in { success: 1, error: 1, complete: 1 } ) {
  715. jqXHR[ i ]( s[ i ] );
  716. }
  717. // Get transport
  718. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  719. // If no transport, we auto-abort
  720. if ( !transport ) {
  721. done( -1, "No Transport" );
  722. } else {
  723. jqXHR.readyState = 1;
  724. // Send global event
  725. if ( fireGlobals ) {
  726. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  727. }
  728. // Timeout
  729. if ( s.async && s.timeout > 0 ) {
  730. timeoutTimer = setTimeout(function() {
  731. jqXHR.abort("timeout");
  732. }, s.timeout );
  733. }
  734. try {
  735. state = 1;
  736. transport.send( requestHeaders, done );
  737. } catch ( e ) {
  738. // Propagate exception as error if not done
  739. if ( state < 2 ) {
  740. done( -1, e );
  741. // Simply rethrow otherwise
  742. } else {
  743. throw e;
  744. }
  745. }
  746. }
  747. // Callback for when everything is done
  748. function done( status, nativeStatusText, responses, headers ) {
  749. var isSuccess, success, error, response, modified,
  750. statusText = nativeStatusText;
  751. // Called once
  752. if ( state === 2 ) {
  753. return;
  754. }
  755. // State is "done" now
  756. state = 2;
  757. // Clear timeout if it exists
  758. if ( timeoutTimer ) {
  759. clearTimeout( timeoutTimer );
  760. }
  761. // Dereference transport for early garbage collection
  762. // (no matter how long the jqXHR object will be used)
  763. transport = undefined;
  764. // Cache response headers
  765. responseHeadersString = headers || "";
  766. // Set readyState
  767. jqXHR.readyState = status > 0 ? 4 : 0;
  768. // Determine if successful
  769. isSuccess = status >= 200 && status < 300 || status === 304;
  770. // Get response data
  771. if ( responses ) {
  772. response = ajaxHandleResponses( s, jqXHR, responses );
  773. }
  774. // Convert no matter what (that way responseXXX fields are always set)
  775. response = ajaxConvert( s, response, jqXHR, isSuccess );
  776. // If successful, handle type chaining
  777. if ( isSuccess ) {
  778. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  779. if ( s.ifModified ) {
  780. modified = jqXHR.getResponseHeader("Last-Modified");
  781. if ( modified ) {
  782. jQuery.lastModified[ cacheURL ] = modified;
  783. }
  784. modified = jqXHR.getResponseHeader("etag");
  785. if ( modified ) {
  786. jQuery.etag[ cacheURL ] = modified;
  787. }
  788. }
  789. // if no content
  790. if ( status === 204 || s.type === "HEAD" ) {
  791. statusText = "nocontent";
  792. // if not modified
  793. } else if ( status === 304 ) {
  794. statusText = "notmodified";
  795. // If we have data, let's convert it
  796. } else {
  797. statusText = response.state;
  798. success = response.data;
  799. error = response.error;
  800. isSuccess = !error;
  801. }
  802. } else {
  803. // We extract error from statusText
  804. // then normalize statusText and status for non-aborts
  805. error = statusText;
  806. if ( status || !statusText ) {
  807. statusText = "error";
  808. if ( status < 0 ) {
  809. status = 0;
  810. }
  811. }
  812. }
  813. // Set data for the fake xhr object
  814. jqXHR.status = status;
  815. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  816. // Success/Error
  817. if ( isSuccess ) {
  818. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  819. } else {
  820. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  821. }
  822. // Status-dependent callbacks
  823. jqXHR.statusCode( statusCode );
  824. statusCode = undefined;
  825. if ( fireGlobals ) {
  826. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  827. [ jqXHR, s, isSuccess ? success : error ] );
  828. }
  829. // Complete
  830. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  831. if ( fireGlobals ) {
  832. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  833. // Handle the global AJAX counter
  834. if ( !( --jQuery.active ) ) {
  835. jQuery.event.trigger("ajaxStop");
  836. }
  837. }
  838. }
  839. return jqXHR;
  840. };
  841. jQuery.ajaxPrefilter = function( dataTypeExpression, func ) {
  842. /// <summary>
  843. /// Handle custom Ajax options or modify existing options before each request is sent and before they are processed by $.ajax().
  844. /// </summary>
  845. /// <param name="dataTypeExpression" type="String">
  846. /// An optional string containing one or more space-separated dataTypes
  847. /// </param>
  848. /// <param name="func" type="Function">
  849. /// A handler to set default values for future Ajax requests.
  850. /// </param>
  851. /// <returns type="undefined" />
  852. if ( typeof dataTypeExpression !== "string" ) {
  853. func = dataTypeExpression;
  854. dataTypeExpression = "*";
  855. }
  856. var dataType,
  857. i = 0,
  858. dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
  859. if ( jQuery.isFunction( func ) ) {
  860. // For each dataType in the dataTypeExpression
  861. while ( (dataType = dataTypes[i++]) ) {
  862. // Prepend if requested
  863. if ( dataType[0] === "+" ) {
  864. dataType = dataType.slice( 1 ) || "*";
  865. (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
  866. // Otherwise append
  867. } else {
  868. (structure[ dataType ] = structure[ dataType ] || []).push( func );
  869. }
  870. }
  871. }
  872. };
  873. jQuery.ajaxSettings = { "url": 'http://jqueryvsdocgen.azurewebsites.net/?ver=1.10.2&newLineMethod=xml',
  874. "type": 'GET',
  875. "isLocal": false,
  876. "global": true,
  877. "processData": true,
  878. "async": true,
  879. "contentType": 'application/x-www-form-urlencoded; charset=UTF-8',
  880. "accepts": {},
  881. "contents": {},
  882. "responseFields": {},
  883. "converters": {},
  884. "flatOptions": {},
  885. "jsonp": 'callback' };
  886. jQuery.ajaxSetup = function( target, settings ) {
  887. /// <summary>
  888. /// Set default values for future Ajax requests.
  889. /// </summary>
  890. /// <param name="target" type="Object">
  891. /// A set of key/value pairs that configure the default Ajax request. All options are optional.
  892. /// </param>
  893. return settings ?
  894. // Building a settings object
  895. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  896. // Extending ajaxSettings
  897. ajaxExtend( jQuery.ajaxSettings, target );
  898. };
  899. jQuery.ajaxTransport = function( dataTypeExpression, func ) {
  900. if ( typeof dataTypeExpression !== "string" ) {
  901. func = dataTypeExpression;
  902. dataTypeExpression = "*";
  903. }
  904. var dataType,
  905. i = 0,
  906. dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
  907. if ( jQuery.isFunction( func ) ) {
  908. // For each dataType in the dataTypeExpression
  909. while ( (dataType = dataTypes[i++]) ) {
  910. // Prepend if requested
  911. if ( dataType[0] === "+" ) {
  912. dataType = dataType.slice( 1 ) || "*";
  913. (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
  914. // Otherwise append
  915. } else {
  916. (structure[ dataType ] = structure[ dataType ] || []).push( func );
  917. }
  918. }
  919. }
  920. };
  921. jQuery.attr = function( elem, name, value ) {
  922. var hooks, ret,
  923. nType = elem.nodeType;
  924. // don't get/set attributes on text, comment and attribute nodes
  925. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  926. return;
  927. }
  928. // Fallback to prop when attributes are not supported
  929. if ( typeof elem.getAttribute === core_strundefined ) {
  930. return jQuery.prop( elem, name, value );
  931. }
  932. // All attributes are lowercase
  933. // Grab necessary hook if one is defined
  934. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  935. name = name.toLowerCase();
  936. hooks = jQuery.attrHooks[ name ] ||
  937. ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
  938. }
  939. if ( value !== undefined ) {
  940. if ( value === null ) {
  941. jQuery.removeAttr( elem, name );
  942. } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
  943. return ret;
  944. } else {
  945. elem.setAttribute( name, value + "" );
  946. return value;
  947. }
  948. } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
  949. return ret;
  950. } else {
  951. ret = jQuery.find.attr( elem, name );
  952. // Non-existent attributes return null, we normalize to undefined
  953. return ret == null ?
  954. undefined :
  955. ret;
  956. }
  957. };
  958. jQuery.attrHooks = { "type": {} };
  959. jQuery.buildFragment = function( elems, context, scripts, selection ) {
  960. var j, elem, contains,
  961. tmp, tag, tbody, wrap,
  962. l = elems.length,
  963. // Ensure a safe fragment
  964. safe = createSafeFragment( context ),
  965. nodes = [],
  966. i = 0;
  967. for ( ; i < l; i++ ) {
  968. elem = elems[ i ];
  969. if ( elem || elem === 0 ) {
  970. // Add nodes directly
  971. if ( jQuery.type( elem ) === "object" ) {
  972. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  973. // Convert non-html into a text node
  974. } else if ( !rhtml.test( elem ) ) {
  975. nodes.push( context.createTextNode( elem ) );
  976. // Convert html into DOM nodes
  977. } else {
  978. tmp = tmp || safe.appendChild( context.createElement("div") );
  979. // Deserialize a standard representation
  980. tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
  981. wrap = wrapMap[ tag ] || wrapMap._default;
  982. tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
  983. // Descend through wrappers to the right content
  984. j = wrap[0];
  985. while ( j-- ) {
  986. tmp = tmp.lastChild;
  987. }
  988. // Manually add leading whitespace removed by IE
  989. if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
  990. nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
  991. }
  992. // Remove IE's autoinserted <tbody> from table fragments
  993. if ( !jQuery.support.tbody ) {
  994. // String was a <table>, *may* have spurious <tbody>
  995. elem = tag === "table" && !rtbody.test( elem ) ?
  996. tmp.firstChild :
  997. // String was a bare <thead> or <tfoot>
  998. wrap[1] === "<table>" && !rtbody.test( elem ) ?
  999. tmp :
  1000. 0;
  1001. j = elem && elem.childNodes.length;
  1002. while ( j-- ) {
  1003. if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
  1004. elem.removeChild( tbody );
  1005. }
  1006. }
  1007. }
  1008. jQuery.merge( nodes, tmp.childNodes );
  1009. // Fix #12392 for WebKit and IE > 9
  1010. tmp.textContent = "";
  1011. // Fix #12392 for oldIE
  1012. while ( tmp.firstChild ) {
  1013. tmp.removeChild( tmp.firstChild );
  1014. }
  1015. // Remember the top-level container for proper cleanup
  1016. tmp = safe.lastChild;
  1017. }
  1018. }
  1019. }
  1020. // Fix #11356: Clear elements from fragment
  1021. if ( tmp ) {
  1022. safe.removeChild( tmp );
  1023. }
  1024. // Reset defaultChecked for any radios and checkboxes
  1025. // about to be appended to the DOM in IE 6/7 (#8060)
  1026. if ( !jQuery.support.appendChecked ) {
  1027. jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
  1028. }
  1029. i = 0;
  1030. while ( (elem = nodes[ i++ ]) ) {
  1031. // #4087 - If origin and destination elements are the same, and this is
  1032. // that element, do not do anything
  1033. if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
  1034. continue;
  1035. }
  1036. contains = jQuery.contains( elem.ownerDocument, elem );
  1037. // Append to fragment
  1038. tmp = getAll( safe.appendChild( elem ), "script" );
  1039. // Preserve script evaluation history
  1040. if ( contains ) {
  1041. setGlobalEval( tmp );
  1042. }
  1043. // Capture executables
  1044. if ( scripts ) {
  1045. j = 0;
  1046. while ( (elem = tmp[ j++ ]) ) {
  1047. if ( rscriptType.test( elem.type || "" ) ) {
  1048. scripts.push( elem );
  1049. }
  1050. }
  1051. }
  1052. }
  1053. tmp = null;
  1054. return safe;
  1055. };
  1056. jQuery.cache = {};
  1057. jQuery.camelCase = function( string ) {
  1058. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  1059. };
  1060. jQuery.cleanData = function( elems, /* internal */ acceptData ) {
  1061. var elem, type, id, data,
  1062. i = 0,
  1063. internalKey = jQuery.expando,
  1064. cache = jQuery.cache,
  1065. deleteExpando = jQuery.support.deleteExpando,
  1066. special = jQuery.event.special;
  1067. for ( ; (elem = elems[i]) != null; i++ ) {
  1068. if ( acceptData || jQuery.acceptData( elem ) ) {
  1069. id = elem[ internalKey ];
  1070. data = id && cache[ id ];
  1071. if ( data ) {
  1072. if ( data.events ) {
  1073. for ( type in data.events ) {
  1074. if ( special[ type ] ) {
  1075. jQuery.event.remove( elem, type );
  1076. // This is a shortcut to avoid jQuery.event.remove's overhead
  1077. } else {
  1078. jQuery.removeEvent( elem, type, data.handle );
  1079. }
  1080. }
  1081. }
  1082. // Remove cache only if it was not already removed by jQuery.event.remove
  1083. if ( cache[ id ] ) {
  1084. delete cache[ id ];
  1085. // IE does not allow us to delete expando properties from nodes,
  1086. // nor does it have a removeAttribute function on Document nodes;
  1087. // we must handle all of these cases
  1088. if ( deleteExpando ) {
  1089. delete elem[ internalKey ];
  1090. } else if ( typeof elem.removeAttribute !== core_strundefined ) {
  1091. elem.removeAttribute( internalKey );
  1092. } else {
  1093. elem[ internalKey ] = null;
  1094. }
  1095. core_deletedIds.push( id );
  1096. }
  1097. }
  1098. }
  1099. }
  1100. };
  1101. jQuery.clone = function( elem, dataAndEvents, deepDataAndEvents ) {
  1102. var destElements, node, clone, i, srcElements,
  1103. inPage = jQuery.contains( elem.ownerDocument, elem );
  1104. if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
  1105. clone = elem.cloneNode( true );
  1106. // IE<=8 does not properly clone detached, unknown element nodes
  1107. } else {
  1108. fragmentDiv.innerHTML = elem.outerHTML;
  1109. fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
  1110. }
  1111. if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
  1112. (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
  1113. // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
  1114. destElements = getAll( clone );
  1115. srcElements = getAll( elem );
  1116. // Fix all IE cloning issues
  1117. for ( i = 0; (node = srcElements[i]) != null; ++i ) {
  1118. // Ensure that the destination node is not null; Fixes #9587
  1119. if ( destElements[i] ) {
  1120. fixCloneNodeIssues( node, destElements[i] );
  1121. }
  1122. }
  1123. }
  1124. // Copy the events from the original to the clone
  1125. if ( dataAndEvents ) {
  1126. if ( deepDataAndEvents ) {
  1127. srcElements = srcElements || getAll( elem );
  1128. destElements = destElements || getAll( clone );
  1129. for ( i = 0; (node = srcElements[i]) != null; i++ ) {
  1130. cloneCopyEvent( node, destElements[i] );
  1131. }
  1132. } else {
  1133. cloneCopyEvent( elem, clone );
  1134. }
  1135. }
  1136. // Preserve script evaluation history
  1137. destElements = getAll( clone, "script" );
  1138. if ( destElements.length > 0 ) {
  1139. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  1140. }
  1141. destElements = srcElements = node = null;
  1142. // Return the cloned set
  1143. return clone;
  1144. };
  1145. jQuery.contains = function( context, elem ) {
  1146. /// <summary>
  1147. /// Check to see if a DOM element is within another DOM element.
  1148. /// </summary>
  1149. /// <param name="context" domElement="true">
  1150. /// The DOM element that may contain the other element.
  1151. /// </param>
  1152. /// <param name="elem" domElement="true">
  1153. /// The DOM element that may be contained by the other element.
  1154. /// </param>
  1155. /// <returns type="Boolean" />
  1156. // Set document vars if needed
  1157. if ( ( context.ownerDocument || context ) !== document ) {
  1158. setDocument( context );
  1159. }
  1160. return contains( context, elem );
  1161. };
  1162. jQuery.css = function( elem, name, extra, styles ) {
  1163. var num, val, hooks,
  1164. origName = jQuery.camelCase( name );
  1165. // Make sure that we're working with the right name
  1166. name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
  1167. // gets hook for the prefixed version
  1168. // followed by the unprefixed version
  1169. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  1170. // If a hook was provided get the computed value from there
  1171. if ( hooks && "get" in hooks ) {
  1172. val = hooks.get( elem, true, extra );
  1173. }
  1174. // Otherwise, if a way to get the computed value exists, use that
  1175. if ( val === undefined ) {
  1176. val = curCSS( elem, name, styles );
  1177. }
  1178. //convert "normal" to computed value
  1179. if ( val === "normal" && name in cssNormalTransform ) {
  1180. val = cssNormalTransform[ name ];
  1181. }
  1182. // Return, converting to number if forced or a qualifier was provided and val looks numeric
  1183. if ( extra === "" || extra ) {
  1184. num = parseFloat( val );
  1185. return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
  1186. }
  1187. return val;
  1188. };
  1189. jQuery.cssHooks = { "opacity": {},
  1190. "height": {},
  1191. "width": {},
  1192. "margin": {},
  1193. "padding": {},
  1194. "borderWidth": {} };
  1195. jQuery.cssNumber = { "columnCount": true,
  1196. "fillOpacity": true,
  1197. "fontWeight": true,
  1198. "lineHeight": true,
  1199. "opacity": true,
  1200. "orphans": true,
  1201. "widows": true,
  1202. "zIndex": true,
  1203. "zoom": true };
  1204. jQuery.cssProps = { "float": 'cssFloat',
  1205. "display": 'display',
  1206. "visibility": 'visibility' };
  1207. jQuery.data = function( elem, name, data ) {
  1208. /// <summary>
  1209. /// 1: Store arbitrary data associated with the specified element. Returns the value that was set.
  1210. /// &#10; 1.1 - jQuery.data(element, key, value)
  1211. /// &#10;2: Returns value at named data store for the element, as set by jQuery.data(element, name, value), or the full data store for the element.
  1212. /// &#10; 2.1 - jQuery.data(element, key)
  1213. /// &#10; 2.2 - jQuery.data(element)
  1214. /// </summary>
  1215. /// <param name="elem" domElement="true">
  1216. /// The DOM element to associate with the data.
  1217. /// </param>
  1218. /// <param name="name" type="String">
  1219. /// A string naming the piece of data to set.
  1220. /// </param>
  1221. /// <param name="data" type="Object">
  1222. /// The new data value.
  1223. /// </param>
  1224. /// <returns type="Object" />
  1225. return internalData( elem, name, data );
  1226. };
  1227. jQuery.dequeue = function( elem, type ) {
  1228. /// <summary>
  1229. /// Execute the next function on the queue for the matched element.
  1230. /// </summary>
  1231. /// <param name="elem" domElement="true">
  1232. /// A DOM element from which to remove and execute a queued function.
  1233. /// </param>
  1234. /// <param name="type" type="String">
  1235. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  1236. /// </param>
  1237. /// <returns type="undefined" />
  1238. type = type || "fx";
  1239. var queue = jQuery.queue( elem, type ),
  1240. startLength = queue.length,
  1241. fn = queue.shift(),
  1242. hooks = jQuery._queueHooks( elem, type ),
  1243. next = function() {
  1244. jQuery.dequeue( elem, type );
  1245. };
  1246. // If the fx queue is dequeued, always remove the progress sentinel
  1247. if ( fn === "inprogress" ) {
  1248. fn = queue.shift();
  1249. startLength--;
  1250. }
  1251. hooks.cur = fn;
  1252. if ( fn ) {
  1253. // Add a progress sentinel to prevent the fx queue from being
  1254. // automatically dequeued
  1255. if ( type === "fx" ) {
  1256. queue.unshift( "inprogress" );
  1257. }
  1258. // clear up the last queue stop function
  1259. delete hooks.stop;
  1260. fn.call( elem, next, hooks );
  1261. }
  1262. if ( !startLength && hooks ) {
  1263. hooks.empty.fire();
  1264. }
  1265. };
  1266. jQuery.dir = function( elem, dir, until ) {
  1267. var matched = [],
  1268. cur = elem[ dir ];
  1269. while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
  1270. if ( cur.nodeType === 1 ) {
  1271. matched.push( cur );
  1272. }
  1273. cur = cur[dir];
  1274. }
  1275. return matched;
  1276. };
  1277. jQuery.each = function( obj, callback, args ) {
  1278. /// <summary>
  1279. /// A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.
  1280. /// </summary>
  1281. /// <param name="obj" type="Object">
  1282. /// The object or array to iterate over.
  1283. /// </param>
  1284. /// <param name="callback" type="Function">
  1285. /// The function that will be executed on every object.
  1286. /// </param>
  1287. /// <returns type="Object" />
  1288. var value,
  1289. i = 0,
  1290. length = obj.length,
  1291. isArray = isArraylike( obj );
  1292. if ( args ) {
  1293. if ( isArray ) {
  1294. for ( ; i < length; i++ ) {
  1295. value = callback.apply( obj[ i ], args );
  1296. if ( value === false ) {
  1297. break;
  1298. }
  1299. }
  1300. } else {
  1301. for ( i in obj ) {
  1302. value = callback.apply( obj[ i ], args );
  1303. if ( value === false ) {
  1304. break;
  1305. }
  1306. }
  1307. }
  1308. // A special, fast, case for the most common use of each
  1309. } else {
  1310. if ( isArray ) {
  1311. for ( ; i < length; i++ ) {
  1312. value = callback.call( obj[ i ], i, obj[ i ] );
  1313. if ( value === false ) {
  1314. break;
  1315. }
  1316. }
  1317. } else {
  1318. for ( i in obj ) {
  1319. value = callback.call( obj[ i ], i, obj[ i ] );
  1320. if ( value === false ) {
  1321. break;
  1322. }
  1323. }
  1324. }
  1325. }
  1326. return obj;
  1327. };
  1328. jQuery.easing = {};
  1329. jQuery.error = function( msg ) {
  1330. /// <summary>
  1331. /// Takes a string and throws an exception containing it.
  1332. /// </summary>
  1333. /// <param name="msg" type="String">
  1334. /// The message to send out.
  1335. /// </param>
  1336. throw new Error( msg );
  1337. };
  1338. jQuery.etag = {};
  1339. jQuery.event = { "global": {},
  1340. "props": ['altKey','bubbles','cancelable','ctrlKey','currentTarget','eventPhase','metaKey','relatedTarget','shiftKey','target','timeStamp','view','which'],
  1341. "fixHooks": {},
  1342. "keyHooks": {},
  1343. "mouseHooks": {},
  1344. "special": {},
  1345. "triggered": {} };
  1346. jQuery.expr = { "cacheLength": 50,
  1347. "match": {},
  1348. "attrHandle": {},
  1349. "find": {},
  1350. "relative": {},
  1351. "preFilter": {},
  1352. "filter": {},
  1353. "pseudos": {},
  1354. "filters": {},
  1355. "setFilters": {},
  1356. ":": {} };
  1357. jQuery.extend = function() {
  1358. /// <summary>
  1359. /// Merge the contents of two or more objects together into the first object.
  1360. /// &#10;1 - jQuery.extend(target, object1, objectN)
  1361. /// &#10;2 - jQuery.extend(deep, target, object1, objectN)
  1362. /// </summary>
  1363. /// <param name="" type="Boolean">
  1364. /// If true, the merge becomes recursive (aka. deep copy).
  1365. /// </param>
  1366. /// <param name="" type="Object">
  1367. /// The object to extend. It will receive the new properties.
  1368. /// </param>
  1369. /// <param name="" type="Object">
  1370. /// An object containing additional properties to merge in.
  1371. /// </param>
  1372. /// <param name="" type="Object">
  1373. /// Additional objects containing properties to merge in.
  1374. /// </param>
  1375. /// <returns type="Object" />
  1376. var src, copyIsArray, copy, name, options, clone,
  1377. target = arguments[0] || {},
  1378. i = 1,
  1379. length = arguments.length,
  1380. deep = false;
  1381. // Handle a deep copy situation
  1382. if ( typeof target === "boolean" ) {
  1383. deep = target;
  1384. target = arguments[1] || {};
  1385. // skip the boolean and the target
  1386. i = 2;
  1387. }
  1388. // Handle case when target is a string or something (possible in deep copy)
  1389. if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  1390. target = {};
  1391. }
  1392. // extend jQuery itself if only one argument is passed
  1393. if ( length === i ) {
  1394. target = this;
  1395. --i;
  1396. }
  1397. for ( ; i < length; i++ ) {
  1398. // Only deal with non-null/undefined values
  1399. if ( (options = arguments[ i ]) != null ) {
  1400. // Extend the base object
  1401. for ( name in options ) {
  1402. src = target[ name ];
  1403. copy = options[ name ];
  1404. // Prevent never-ending loop
  1405. if ( target === copy ) {
  1406. continue;
  1407. }
  1408. // Recurse if we're merging plain objects or arrays
  1409. if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
  1410. if ( copyIsArray ) {
  1411. copyIsArray = false;
  1412. clone = src && jQuery.isArray(src) ? src : [];
  1413. } else {
  1414. clone = src && jQuery.isPlainObject(src) ? src : {};
  1415. }
  1416. // Never move original objects, clone them
  1417. target[ name ] = jQuery.extend( deep, clone, copy );
  1418. // Don't bring in undefined values
  1419. } else if ( copy !== undefined ) {
  1420. target[ name ] = copy;
  1421. }
  1422. }
  1423. }
  1424. }
  1425. // Return the modified object
  1426. return target;
  1427. };
  1428. jQuery.filter = function( expr, elems, not ) {
  1429. var elem = elems[ 0 ];
  1430. if ( not ) {
  1431. expr = ":not(" + expr + ")";
  1432. }
  1433. return elems.length === 1 && elem.nodeType === 1 ?
  1434. jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
  1435. jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  1436. return elem.nodeType === 1;
  1437. }));
  1438. };
  1439. jQuery.find = function Sizzle( selector, context, results, seed ) {
  1440. var match, elem, m, nodeType,
  1441. // QSA vars
  1442. i, groups, old, nid, newContext, newSelector;
  1443. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  1444. setDocument( context );
  1445. }
  1446. context = context || document;
  1447. results = results || [];
  1448. if ( !selector || typeof selector !== "string" ) {
  1449. return results;
  1450. }
  1451. if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
  1452. return [];
  1453. }
  1454. if ( documentIsHTML && !seed ) {
  1455. // Shortcuts
  1456. if ( (match = rquickExpr.exec( selector )) ) {
  1457. // Speed-up: Sizzle("#ID")
  1458. if ( (m = match[1]) ) {
  1459. if ( nodeType === 9 ) {
  1460. elem = context.getElementById( m );
  1461. // Check parentNode to catch when Blackberry 4.6 returns
  1462. // nodes that are no longer in the document #6963
  1463. if ( elem && elem.parentNode ) {
  1464. // Handle the case where IE, Opera, and Webkit return items
  1465. // by name instead of ID
  1466. if ( elem.id === m ) {
  1467. results.push( elem );
  1468. return results;
  1469. }
  1470. } else {
  1471. return results;
  1472. }
  1473. } else {
  1474. // Context is not a document
  1475. if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
  1476. contains( context, elem ) && elem.id === m ) {
  1477. results.push( elem );
  1478. return results;
  1479. }
  1480. }
  1481. // Speed-up: Sizzle("TAG")
  1482. } else if ( match[2] ) {
  1483. push.apply( results, context.getElementsByTagName( selector ) );
  1484. return results;
  1485. // Speed-up: Sizzle(".CLASS")
  1486. } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
  1487. push.apply( results, context.getElementsByClassName( m ) );
  1488. return results;
  1489. }
  1490. }
  1491. // QSA path
  1492. if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  1493. nid = old = expando;
  1494. newContext = context;
  1495. newSelector = nodeType === 9 && selector;
  1496. // qSA works strangely on Element-rooted queries
  1497. // We can work around this by specifying an extra ID on the root
  1498. // and working up from there (Thanks to Andrew Dupont for the technique)
  1499. // IE 8 doesn't work on object elements
  1500. if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
  1501. groups = tokenize( selector );
  1502. if ( (old = context.getAttribute("id")) ) {
  1503. nid = old.replace( rescape, "\\$&" );
  1504. } else {
  1505. context.setAttribute( "id", nid );
  1506. }
  1507. nid = "[id='" + nid + "'] ";
  1508. i = groups.length;
  1509. while ( i-- ) {
  1510. groups[i] = nid + toSelector( groups[i] );
  1511. }
  1512. newContext = rsibling.test( selector ) && context.parentNode || context;
  1513. newSelector = groups.join(",");
  1514. }
  1515. if ( newSelector ) {
  1516. try {
  1517. push.apply( results,
  1518. newContext.querySelectorAll( newSelector )
  1519. );
  1520. return results;
  1521. } catch(qsaError) {
  1522. } finally {
  1523. if ( !old ) {
  1524. context.removeAttribute("id");
  1525. }
  1526. }
  1527. }
  1528. }
  1529. }
  1530. // All others
  1531. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  1532. };
  1533. jQuery.fn = { "jquery": '1.10.2',
  1534. "selector": '',
  1535. "length": 0 };
  1536. jQuery.fx = function( elem, options, prop, end, easing, unit ) {
  1537. this.elem = elem;
  1538. this.prop = prop;
  1539. this.easing = easing || "swing";
  1540. this.options = options;
  1541. this.start = this.now = this.cur();
  1542. this.end = end;
  1543. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  1544. };
  1545. jQuery.get = function( url, data, callback, type ) {
  1546. /// <summary>
  1547. /// Load data from the server using a HTTP GET request.
  1548. /// </summary>
  1549. /// <param name="url" type="String">
  1550. /// A string containing the URL to which the request is sent.
  1551. /// </param>
  1552. /// <param name="data" type="String">
  1553. /// A map or string that is sent to the server with the request.
  1554. /// </param>
  1555. /// <param name="callback" type="Function">
  1556. /// A callback function that is executed if the request succeeds.
  1557. /// </param>
  1558. /// <param name="type" type="String">
  1559. /// The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html).
  1560. /// </param>
  1561. // shift arguments if data argument was omitted
  1562. if ( jQuery.isFunction( data ) ) {
  1563. type = type || callback;
  1564. callback = data;
  1565. data = undefined;
  1566. }
  1567. return jQuery.ajax({
  1568. url: url,
  1569. type: method,
  1570. dataType: type,
  1571. data: data,
  1572. success: callback
  1573. });
  1574. };
  1575. jQuery.getJSON = function( url, data, callback ) {
  1576. /// <summary>
  1577. /// Load JSON-encoded data from the server using a GET HTTP request.
  1578. /// </summary>
  1579. /// <param name="url" type="String">
  1580. /// A string containing the URL to which the request is sent.
  1581. /// </param>
  1582. /// <param name="data" type="Object">
  1583. /// A map or string that is sent to the server with the request.
  1584. /// </param>
  1585. /// <param name="callback" type="Function">
  1586. /// A callback function that is executed if the request succeeds.
  1587. /// </param>
  1588. return jQuery.get( url, data, callback, "json" );
  1589. };
  1590. jQuery.getScript = function( url, callback ) {
  1591. /// <summary>
  1592. /// Load a JavaScript file from the server using a GET HTTP request, then execute it.
  1593. /// </summary>
  1594. /// <param name="url" type="String">
  1595. /// A string containing the URL to which the request is sent.
  1596. /// </param>
  1597. /// <param name="callback" type="Function">
  1598. /// A callback function that is executed if the request succeeds.
  1599. /// </param>
  1600. return jQuery.get( url, undefined, callback, "script" );
  1601. };
  1602. jQuery.globalEval = function( data ) {
  1603. /// <summary>
  1604. /// Execute some JavaScript code globally.
  1605. /// </summary>
  1606. /// <param name="data" type="String">
  1607. /// The JavaScript code to execute.
  1608. /// </param>
  1609. if ( data && jQuery.trim( data ) ) {
  1610. // We use execScript on Internet Explorer
  1611. // We use an anonymous function so that context is window
  1612. // rather than jQuery in Firefox
  1613. ( window.execScript || function( data ) {
  1614. window[ "eval" ].call( window, data );
  1615. } )( data );
  1616. }
  1617. };
  1618. jQuery.grep = function( elems, callback, inv ) {
  1619. /// <summary>
  1620. /// Finds the elements of an array which satisfy a filter function. The original array is not affected.
  1621. /// </summary>
  1622. /// <param name="elems" type="Array">
  1623. /// The array to search through.
  1624. /// </param>
  1625. /// <param name="callback" type="Function">
  1626. /// The function to process each item against. The first argument to the function is the item, and the second argument is the index. The function should return a Boolean value. this will be the global window object.
  1627. /// </param>
  1628. /// <param name="inv" type="Boolean">
  1629. /// If "invert" is false, or not provided, then the function returns an array consisting of all elements for which "callback" returns true. If "invert" is true, then the function returns an array consisting of all elements for which "callback" returns false.
  1630. /// </param>
  1631. /// <returns type="Array" />
  1632. var retVal,
  1633. ret = [],
  1634. i = 0,
  1635. length = elems.length;
  1636. inv = !!inv;
  1637. // Go through the array, only saving the items
  1638. // that pass the validator function
  1639. for ( ; i < length; i++ ) {
  1640. retVal = !!callback( elems[ i ], i );
  1641. if ( inv !== retVal ) {
  1642. ret.push( elems[ i ] );
  1643. }
  1644. }
  1645. return ret;
  1646. };
  1647. jQuery.guid = 1;
  1648. jQuery.hasData = function( elem ) {
  1649. /// <summary>
  1650. /// Determine whether an element has any jQuery data associated with it.
  1651. /// </summary>
  1652. /// <param name="elem" domElement="true">
  1653. /// A DOM element to be checked for data.
  1654. /// </param>
  1655. /// <returns type="Boolean" />
  1656. elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
  1657. return !!elem && !isEmptyDataObject( elem );
  1658. };
  1659. jQuery.holdReady = function( hold ) {
  1660. /// <summary>
  1661. /// Holds or releases the execution of jQuery's ready event.
  1662. /// </summary>
  1663. /// <param name="hold" type="Boolean">
  1664. /// Indicates whether the ready hold is being requested or released
  1665. /// </param>
  1666. /// <returns type="undefined" />
  1667. if ( hold ) {
  1668. jQuery.readyWait++;
  1669. } else {
  1670. jQuery.ready( true );
  1671. }
  1672. };
  1673. jQuery.inArray = function( elem, arr, i ) {
  1674. /// <summary>
  1675. /// Search for a specified value within an array and return its index (or -1 if not found).
  1676. /// </summary>
  1677. /// <param name="elem" type="Object">
  1678. /// The value to search for.
  1679. /// </param>
  1680. /// <param name="arr" type="Array">
  1681. /// An array through which to search.
  1682. /// </param>
  1683. /// <param name="i" type="Number">
  1684. /// The index of the array at which to begin the search. The default is 0, which will search the whole array.
  1685. /// </param>
  1686. /// <returns type="Number" />
  1687. var len;
  1688. if ( arr ) {
  1689. if ( core_indexOf ) {
  1690. return core_indexOf.call( arr, elem, i );
  1691. }
  1692. len = arr.length;
  1693. i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
  1694. for ( ; i < len; i++ ) {
  1695. // Skip accessing in sparse arrays
  1696. if ( i in arr && arr[ i ] === elem ) {
  1697. return i;
  1698. }
  1699. }
  1700. }
  1701. return -1;
  1702. };
  1703. jQuery.isEmptyObject = function( obj ) {
  1704. /// <summary>
  1705. /// Check to see if an object is empty (contains no properties).
  1706. /// </summary>
  1707. /// <param name="obj" type="Object">
  1708. /// The object that will be checked to see if it's empty.
  1709. /// </param>
  1710. /// <returns type="Boolean" />
  1711. var name;
  1712. for ( name in obj ) {
  1713. return false;
  1714. }
  1715. return true;
  1716. };
  1717. jQuery.isFunction = function( obj ) {
  1718. /// <summary>
  1719. /// Determine if the argument passed is a Javascript function object.
  1720. /// </summary>
  1721. /// <param name="obj" type="Object">
  1722. /// Object to test whether or not it is a function.
  1723. /// </param>
  1724. /// <returns type="boolean" />
  1725. return jQuery.type(obj) === "function";
  1726. };
  1727. jQuery.isNumeric = function( obj ) {
  1728. /// <summary>
  1729. /// Determines whether its argument is a number.
  1730. /// </summary>
  1731. /// <param name="obj" type="Object">
  1732. /// The value to be tested.
  1733. /// </param>
  1734. /// <returns type="Boolean" />
  1735. return !isNaN( parseFloat(obj) ) && isFinite( obj );
  1736. };
  1737. jQuery.isPlainObject = function( obj ) {
  1738. /// <summary>
  1739. /// Check to see if an object is a plain object (created using "{}" or "new Object").
  1740. /// </summary>
  1741. /// <param name="obj" type="Object">
  1742. /// The object that will be checked to see if it's a plain object.
  1743. /// </param>
  1744. /// <returns type="Boolean" />
  1745. var key;
  1746. // Must be an Object.
  1747. // Because of IE, we also have to check the presence of the constructor property.
  1748. // Make sure that DOM nodes and window objects don't pass through, as well
  1749. if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  1750. return false;
  1751. }
  1752. try {
  1753. // Not own constructor property must be Object
  1754. if ( obj.constructor &&
  1755. !core_hasOwn.call(obj, "constructor") &&
  1756. !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
  1757. return false;
  1758. }
  1759. } catch ( e ) {
  1760. // IE8,9 Will throw exceptions on certain host objects #9897
  1761. return false;
  1762. }
  1763. // Support: IE<9
  1764. // Handle iteration over inherited properties before own properties.
  1765. if ( jQuery.support.ownLast ) {
  1766. for ( key in obj ) {
  1767. return core_hasOwn.call( obj, key );
  1768. }
  1769. }
  1770. // Own properties are enumerated firstly, so to speed up,
  1771. // if last one is own, then all properties are own.
  1772. for ( key in obj ) {}
  1773. return key === undefined || core_hasOwn.call( obj, key );
  1774. };
  1775. jQuery.isReady = true;
  1776. jQuery.isWindow = function( obj ) {
  1777. /// <summary>
  1778. /// Determine whether the argument is a window.
  1779. /// </summary>
  1780. /// <param name="obj" type="Object">
  1781. /// Object to test whether or not it is a window.
  1782. /// </param>
  1783. /// <returns type="boolean" />
  1784. /* jshint eqeqeq: false */
  1785. return obj != null && obj == obj.window;
  1786. };
  1787. jQuery.isXMLDoc = function( elem ) {
  1788. /// <summary>
  1789. /// Check to see if a DOM node is within an XML document (or is an XML document).
  1790. /// </summary>
  1791. /// <param name="elem" domElement="true">
  1792. /// The DOM node that will be checked to see if it's in an XML document.
  1793. /// </param>
  1794. /// <returns type="Boolean" />
  1795. // documentElement is verified for cases where it doesn't yet exist
  1796. // (such as loading iframes in IE - #4833)
  1797. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  1798. return documentElement ? documentElement.nodeName !== "HTML" : false;
  1799. };
  1800. jQuery.lastModified = {};
  1801. jQuery.makeArray = function( arr, results ) {
  1802. /// <summary>
  1803. /// Convert an array-like object into a true JavaScript array.
  1804. /// </summary>
  1805. /// <param name="arr" type="Object">
  1806. /// Any object to turn into a native Array.
  1807. /// </param>
  1808. /// <returns type="Array" />
  1809. var ret = results || [];
  1810. if ( arr != null ) {
  1811. if ( isArraylike( Object(arr) ) ) {
  1812. jQuery.merge( ret,
  1813. typeof arr === "string" ?
  1814. [ arr ] : arr
  1815. );
  1816. } else {
  1817. core_push.call( ret, arr );
  1818. }
  1819. }
  1820. return ret;
  1821. };
  1822. jQuery.map = function( elems, callback, arg ) {
  1823. /// <summary>
  1824. /// Translate all items in an array or object to new array of items.
  1825. /// &#10;1 - jQuery.map(array, callback(elementOfArray, indexInArray))
  1826. /// &#10;2 - jQuery.map(arrayOrObject, callback( value, indexOrKey ))
  1827. /// </summary>
  1828. /// <param name="elems" type="Array">
  1829. /// The Array to translate.
  1830. /// </param>
  1831. /// <param name="callback" type="Function">
  1832. /// The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object.
  1833. /// </param>
  1834. /// <returns type="Array" />
  1835. var value,
  1836. i = 0,
  1837. length = elems.length,
  1838. isArray = isArraylike( elems ),
  1839. ret = [];
  1840. // Go through the array, translating each of the items to their
  1841. if ( isArray ) {
  1842. for ( ; i < length; i++ ) {
  1843. value = callback( elems[ i ], i, arg );
  1844. if ( value != null ) {
  1845. ret[ ret.length ] = value;
  1846. }
  1847. }
  1848. // Go through every key on the object,
  1849. } else {
  1850. for ( i in elems ) {
  1851. value = callback( elems[ i ], i, arg );
  1852. if ( value != null ) {
  1853. ret[ ret.length ] = value;
  1854. }
  1855. }
  1856. }
  1857. // Flatten any nested arrays
  1858. return core_concat.apply( [], ret );
  1859. };
  1860. jQuery.merge = function( first, second ) {
  1861. /// <summary>
  1862. /// Merge the contents of two arrays together into the first array.
  1863. /// </summary>
  1864. /// <param name="first" type="Array">
  1865. /// The first array to merge, the elements of second added.
  1866. /// </param>
  1867. /// <param name="second" type="Array">
  1868. /// The second array to merge into the first, unaltered.
  1869. /// </param>
  1870. /// <returns type="Array" />
  1871. var l = second.length,
  1872. i = first.length,
  1873. j = 0;
  1874. if ( typeof l === "number" ) {
  1875. for ( ; j < l; j++ ) {
  1876. first[ i++ ] = second[ j ];
  1877. }
  1878. } else {
  1879. while ( second[j] !== undefined ) {
  1880. first[ i++ ] = second[ j++ ];
  1881. }
  1882. }
  1883. first.length = i;
  1884. return first;
  1885. };
  1886. jQuery.noConflict = function( deep ) {
  1887. /// <summary>
  1888. /// Relinquish jQuery's control of the $ variable.
  1889. /// </summary>
  1890. /// <param name="deep" type="Boolean">
  1891. /// A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).
  1892. /// </param>
  1893. /// <returns type="Object" />
  1894. if ( window.$ === jQuery ) {
  1895. window.$ = _$;
  1896. }
  1897. if ( deep && window.jQuery === jQuery ) {
  1898. window.jQuery = _jQuery;
  1899. }
  1900. return jQuery;
  1901. };
  1902. jQuery.noData = { "applet": true,
  1903. "embed": true,
  1904. "object": 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' };
  1905. jQuery.nodeName = function( elem, name ) {
  1906. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  1907. };
  1908. jQuery.noop = function() {
  1909. /// <summary>
  1910. /// An empty function.
  1911. /// </summary>
  1912. /// <returns type="Function" />
  1913. };
  1914. jQuery.now = function() {
  1915. /// <summary>
  1916. /// Return a number representing the current time.
  1917. /// </summary>
  1918. /// <returns type="Number" />
  1919. return ( new Date() ).getTime();
  1920. };
  1921. jQuery.offset = {};
  1922. jQuery.param = function( a, traditional ) {
  1923. /// <summary>
  1924. /// Create a serialized representation of an array or object, suitable for use in a URL query string or Ajax request.
  1925. /// &#10;1 - jQuery.param(obj)
  1926. /// &#10;2 - jQuery.param(obj, traditional)
  1927. /// </summary>
  1928. /// <param name="a" type="Object">
  1929. /// An array or object to serialize.
  1930. /// </param>
  1931. /// <param name="traditional" type="Boolean">
  1932. /// A Boolean indicating whether to perform a traditional "shallow" serialization.
  1933. /// </param>
  1934. /// <returns type="String" />
  1935. var prefix,
  1936. s = [],
  1937. add = function( key, value ) {
  1938. // If value is a function, invoke it and return its value
  1939. value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
  1940. s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
  1941. };
  1942. // Set traditional to true for jQuery <= 1.3.2 behavior.
  1943. if ( traditional === undefined ) {
  1944. traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
  1945. }
  1946. // If an array was passed in, assume that it is an array of form elements.
  1947. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  1948. // Serialize the form elements
  1949. jQuery.each( a, function() {
  1950. add( this.name, this.value );
  1951. });
  1952. } else {
  1953. // If traditional, encode the "old" way (the way 1.3.2 or older
  1954. // did it), otherwise encode params recursively.
  1955. for ( prefix in a ) {
  1956. buildParams( prefix, a[ prefix ], traditional, add );
  1957. }
  1958. }
  1959. // Return the resulting serialization
  1960. return s.join( "&" ).replace( r20, "+" );
  1961. };
  1962. jQuery.parseHTML = function( data, context, keepScripts ) {
  1963. if ( !data || typeof data !== "string" ) {
  1964. return null;
  1965. }
  1966. if ( typeof context === "boolean" ) {
  1967. keepScripts = context;
  1968. context = false;
  1969. }
  1970. context = context || document;
  1971. var parsed = rsingleTag.exec( data ),
  1972. scripts = !keepScripts && [];
  1973. // Single tag
  1974. if ( parsed ) {
  1975. return [ context.createElement( parsed[1] ) ];
  1976. }
  1977. parsed = jQuery.buildFragment( [ data ], context, scripts );
  1978. if ( scripts ) {
  1979. jQuery( scripts ).remove();
  1980. }
  1981. return jQuery.merge( [], parsed.childNodes );
  1982. };
  1983. jQuery.parseJSON = function( data ) {
  1984. /// <summary>
  1985. /// Takes a well-formed JSON string and returns the resulting JavaScript object.
  1986. /// </summary>
  1987. /// <param name="data" type="String">
  1988. /// The JSON string to parse.
  1989. /// </param>
  1990. /// <returns type="Object" />
  1991. // Attempt to parse using the native JSON parser first
  1992. if ( window.JSON && window.JSON.parse ) {
  1993. return window.JSON.parse( data );
  1994. }
  1995. if ( data === null ) {
  1996. return data;
  1997. }
  1998. if ( typeof data === "string" ) {
  1999. // Make sure leading/trailing whitespace is removed (IE can't handle it)
  2000. data = jQuery.trim( data );
  2001. if ( data ) {
  2002. // Make sure the incoming data is actual JSON
  2003. // Logic borrowed from http://json.org/json2.js
  2004. if ( rvalidchars.test( data.replace( rvalidescape, "@" )
  2005. .replace( rvalidtokens, "]" )
  2006. .replace( rvalidbraces, "")) ) {
  2007. return ( new Function( "return " + data ) )();
  2008. }
  2009. }
  2010. }
  2011. jQuery.error( "Invalid JSON: " + data );
  2012. };
  2013. jQuery.parseXML = function( data ) {
  2014. /// <summary>
  2015. /// Parses a string into an XML document.
  2016. /// </summary>
  2017. /// <param name="data" type="String">
  2018. /// a well-formed XML string to be parsed
  2019. /// </param>
  2020. /// <returns type="XMLDocument" />
  2021. var xml, tmp;
  2022. if ( !data || typeof data !== "string" ) {
  2023. return null;
  2024. }
  2025. try {
  2026. if ( window.DOMParser ) { // Standard
  2027. tmp = new DOMParser();
  2028. xml = tmp.parseFromString( data , "text/xml" );
  2029. } else { // IE
  2030. xml = new ActiveXObject( "Microsoft.XMLDOM" );
  2031. xml.async = "false";
  2032. xml.loadXML( data );
  2033. }
  2034. } catch( e ) {
  2035. xml = undefined;
  2036. }
  2037. if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
  2038. jQuery.error( "Invalid XML: " + data );
  2039. }
  2040. return xml;
  2041. };
  2042. jQuery.post = function( url, data, callback, type ) {
  2043. /// <summary>
  2044. /// Load data from the server using a HTTP POST request.
  2045. /// </summary>
  2046. /// <param name="url" type="String">
  2047. /// A string containing the URL to which the request is sent.
  2048. /// </param>
  2049. /// <param name="data" type="String">
  2050. /// A map or string that is sent to the server with the request.
  2051. /// </param>
  2052. /// <param name="callback" type="Function">
  2053. /// A callback function that is executed if the request succeeds.
  2054. /// </param>
  2055. /// <param name="type" type="String">
  2056. /// The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).
  2057. /// </param>
  2058. // shift arguments if data argument was omitted
  2059. if ( jQuery.isFunction( data ) ) {
  2060. type = type || callback;
  2061. callback = data;
  2062. data = undefined;
  2063. }
  2064. return jQuery.ajax({
  2065. url: url,
  2066. type: method,
  2067. dataType: type,
  2068. data: data,
  2069. success: callback
  2070. });
  2071. };
  2072. jQuery.prop = function( elem, name, value ) {
  2073. var ret, hooks, notxml,
  2074. nType = elem.nodeType;
  2075. // don't get/set properties on text, comment and attribute nodes
  2076. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  2077. return;
  2078. }
  2079. notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
  2080. if ( notxml ) {
  2081. // Fix name and attach hooks
  2082. name = jQuery.propFix[ name ] || name;
  2083. hooks = jQuery.propHooks[ name ];
  2084. }
  2085. if ( value !== undefined ) {
  2086. return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
  2087. ret :
  2088. ( elem[ name ] = value );
  2089. } else {
  2090. return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
  2091. ret :
  2092. elem[ name ];
  2093. }
  2094. };
  2095. jQuery.propFix = { "for": 'htmlFor',
  2096. "class": 'className',
  2097. "tabindex": {},
  2098. "readonly": {},
  2099. "maxlength": {},
  2100. "cellspacing": {},
  2101. "cellpadding": {},
  2102. "rowspan": {},
  2103. "colspan": {},
  2104. "usemap": {},
  2105. "frameborder": {},
  2106. "contenteditable": {} };
  2107. jQuery.propHooks = { "tabIndex": {},
  2108. "selected": {} };
  2109. jQuery.proxy = function( fn, context ) {
  2110. /// <summary>
  2111. /// Takes a function and returns a new one that will always have a particular context.
  2112. /// &#10;1 - jQuery.proxy(function, context)
  2113. /// &#10;2 - jQuery.proxy(context, name)
  2114. /// </summary>
  2115. /// <param name="fn" type="Function">
  2116. /// The function whose context will be changed.
  2117. /// </param>
  2118. /// <param name="context" type="Object">
  2119. /// The object to which the context (this) of the function should be set.
  2120. /// </param>
  2121. /// <returns type="Function" />
  2122. var args, proxy, tmp;
  2123. if ( typeof context === "string" ) {
  2124. tmp = fn[ context ];
  2125. context = fn;
  2126. fn = tmp;
  2127. }
  2128. // Quick check to determine if target is callable, in the spec
  2129. // this throws a TypeError, but we will just return undefined.
  2130. if ( !jQuery.isFunction( fn ) ) {
  2131. return undefined;
  2132. }
  2133. // Simulated bind
  2134. args = core_slice.call( arguments, 2 );
  2135. proxy = function() {
  2136. return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
  2137. };
  2138. // Set the guid of unique handler to the same of original handler, so it can be removed
  2139. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  2140. return proxy;
  2141. };
  2142. jQuery.queue = function( elem, type, data ) {
  2143. /// <summary>
  2144. /// 1: Show the queue of functions to be executed on the matched element.
  2145. /// &#10; 1.1 - jQuery.queue(element, queueName)
  2146. /// &#10;2: Manipulate the queue of functions to be executed on the matched element.
  2147. /// &#10; 2.1 - jQuery.queue(element, queueName, newQueue)
  2148. /// &#10; 2.2 - jQuery.queue(element, queueName, callback())
  2149. /// </summary>
  2150. /// <param name="elem" domElement="true">
  2151. /// A DOM element where the array of queued functions is attached.
  2152. /// </param>
  2153. /// <param name="type" type="String">
  2154. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  2155. /// </param>
  2156. /// <param name="data" type="Array">
  2157. /// An array of functions to replace the current queue contents.
  2158. /// </param>
  2159. /// <returns type="jQuery" />
  2160. var queue;
  2161. if ( elem ) {
  2162. type = ( type || "fx" ) + "queue";
  2163. queue = jQuery._data( elem, type );
  2164. // Speed up dequeue by getting out quickly if this is just a lookup
  2165. if ( data ) {
  2166. if ( !queue || jQuery.isArray(data) ) {
  2167. queue = jQuery._data( elem, type, jQuery.makeArray(data) );
  2168. } else {
  2169. queue.push( data );
  2170. }
  2171. }
  2172. return queue || [];
  2173. }
  2174. };
  2175. jQuery.ready = function( wait ) {
  2176. // Abort if there are pending holds or we're already ready
  2177. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  2178. return;
  2179. }
  2180. // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
  2181. if ( !document.body ) {
  2182. return setTimeout( jQuery.ready );
  2183. }
  2184. // Remember that the DOM is ready
  2185. jQuery.isReady = true;
  2186. // If a normal DOM Ready event fired, decrement, and wait if need be
  2187. if ( wait !== true && --jQuery.readyWait > 0 ) {
  2188. return;
  2189. }
  2190. // If there are functions bound, to execute
  2191. readyList.resolveWith( document, [ jQuery ] );
  2192. // Trigger any bound ready events
  2193. if ( jQuery.fn.trigger ) {
  2194. jQuery( document ).trigger("ready").off("ready");
  2195. }
  2196. };
  2197. jQuery.readyWait = 0;
  2198. jQuery.removeAttr = function( elem, value ) {
  2199. var name, propName,
  2200. i = 0,
  2201. attrNames = value && value.match( core_rnotwhite );
  2202. if ( attrNames && elem.nodeType === 1 ) {
  2203. while ( (name = attrNames[i++]) ) {
  2204. propName = jQuery.propFix[ name ] || name;
  2205. // Boolean attributes get special treatment (#10870)
  2206. if ( jQuery.expr.match.bool.test( name ) ) {
  2207. // Set corresponding property to false
  2208. if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
  2209. elem[ propName ] = false;
  2210. // Support: IE<9
  2211. // Also clear defaultChecked/defaultSelected (if appropriate)
  2212. } else {
  2213. elem[ jQuery.camelCase( "default-" + name ) ] =
  2214. elem[ propName ] = false;
  2215. }
  2216. // See #9699 for explanation of this approach (setting first, then removal)
  2217. } else {
  2218. jQuery.attr( elem, name, "" );
  2219. }
  2220. elem.removeAttribute( getSetAttribute ? name : propName );
  2221. }
  2222. }
  2223. };
  2224. jQuery.removeData = function( elem, name ) {
  2225. /// <summary>
  2226. /// Remove a previously-stored piece of data.
  2227. /// </summary>
  2228. /// <param name="elem" domElement="true">
  2229. /// A DOM element from which to remove data.
  2230. /// </param>
  2231. /// <param name="name" type="String">
  2232. /// A string naming the piece of data to remove.
  2233. /// </param>
  2234. /// <returns type="jQuery" />
  2235. return internalRemoveData( elem, name );
  2236. };
  2237. jQuery.removeEvent = function( elem, type, handle ) {
  2238. if ( elem.removeEventListener ) {
  2239. elem.removeEventListener( type, handle, false );
  2240. }
  2241. };
  2242. jQuery.sibling = function( n, elem ) {
  2243. var r = [];
  2244. for ( ; n; n = n.nextSibling ) {
  2245. if ( n.nodeType === 1 && n !== elem ) {
  2246. r.push( n );
  2247. }
  2248. }
  2249. return r;
  2250. };
  2251. jQuery.speed = function( speed, easing, fn ) {
  2252. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  2253. complete: fn || !fn && easing ||
  2254. jQuery.isFunction( speed ) && speed,
  2255. duration: speed,
  2256. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  2257. };
  2258. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  2259. opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
  2260. // normalize opt.queue - true/undefined/null -> "fx"
  2261. if ( opt.queue == null || opt.queue === true ) {
  2262. opt.queue = "fx";
  2263. }
  2264. // Queueing
  2265. opt.old = opt.complete;
  2266. opt.complete = function() {
  2267. if ( jQuery.isFunction( opt.old ) ) {
  2268. opt.old.call( this );
  2269. }
  2270. if ( opt.queue ) {
  2271. jQuery.dequeue( this, opt.queue );
  2272. }
  2273. };
  2274. return opt;
  2275. };
  2276. jQuery.style = function( elem, name, value, extra ) {
  2277. // Don't set styles on text and comment nodes
  2278. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  2279. return;
  2280. }
  2281. // Make sure that we're working with the right name
  2282. var ret, type, hooks,
  2283. origName = jQuery.camelCase( name ),
  2284. style = elem.style;
  2285. name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
  2286. // gets hook for the prefixed version
  2287. // followed by the unprefixed version
  2288. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  2289. // Check if we're setting a value
  2290. if ( value !== undefined ) {
  2291. type = typeof value;
  2292. // convert relative number strings (+= or -=) to relative numbers. #7345
  2293. if ( type === "string" && (ret = rrelNum.exec( value )) ) {
  2294. value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
  2295. // Fixes bug #9237
  2296. type = "number";
  2297. }
  2298. // Make sure that NaN and null values aren't set. See: #7116
  2299. if ( value == null || type === "number" && isNaN( value ) ) {
  2300. return;
  2301. }
  2302. // If a number was passed in, add 'px' to the (except for certain CSS properties)
  2303. if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
  2304. value += "px";
  2305. }
  2306. // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
  2307. // but it would mean to define eight (for every problematic property) identical functions
  2308. if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
  2309. style[ name ] = "inherit";
  2310. }
  2311. // If a hook was provided, use that value, otherwise just set the specified value
  2312. if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
  2313. // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
  2314. // Fixes bug #5509
  2315. try {
  2316. style[ name ] = value;
  2317. } catch(e) {}
  2318. }
  2319. } else {
  2320. // If a hook was provided get the non-computed value from there
  2321. if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
  2322. return ret;
  2323. }
  2324. // Otherwise just get the value from the style object
  2325. return style[ name ];
  2326. }
  2327. };
  2328. jQuery.support = { "getSetAttribute": true,
  2329. "leadingWhitespace": true,
  2330. "tbody": true,
  2331. "htmlSerialize": true,
  2332. "style": true,
  2333. "hrefNormalized": true,
  2334. "opacity": true,
  2335. "cssFloat": true,
  2336. "checkOn": true,
  2337. "optSelected": false,
  2338. "enctype": true,
  2339. "html5Clone": true,
  2340. "inlineBlockNeedsLayout": false,
  2341. "shrinkWrapBlocks": false,
  2342. "pixelPosition": true,
  2343. "deleteExpando": true,
  2344. "noCloneEvent": true,
  2345. "reliableMarginRight": true,
  2346. "boxSizingReliable": false,
  2347. "noCloneChecked": false,
  2348. "optDisabled": true,
  2349. "input": true,
  2350. "radioValue": false,
  2351. "appendChecked": true,
  2352. "checkClone": true,
  2353. "submitBubbles": true,
  2354. "changeBubbles": true,
  2355. "focusinBubbles": true,
  2356. "clearCloneStyle": false,
  2357. "ownLast": false,
  2358. "cors": true,
  2359. "ajax": true,
  2360. "reliableHiddenOffsets": true,
  2361. "boxSizing": true };
  2362. jQuery.swap = function( elem, options, callback, args ) {
  2363. var ret, name,
  2364. old = {};
  2365. // Remember the old values, and insert the new ones
  2366. for ( name in options ) {
  2367. old[ name ] = elem.style[ name ];
  2368. elem.style[ name ] = options[ name ];
  2369. }
  2370. ret = callback.apply( elem, args || [] );
  2371. // Revert the old values
  2372. for ( name in options ) {
  2373. elem.style[ name ] = old[ name ];
  2374. }
  2375. return ret;
  2376. };
  2377. jQuery.text = function( elem ) {
  2378. var node,
  2379. ret = "",
  2380. i = 0,
  2381. nodeType = elem.nodeType;
  2382. if ( !nodeType ) {
  2383. // If no nodeType, this is expected to be an array
  2384. for ( ; (node = elem[i]); i++ ) {
  2385. // Do not traverse comment nodes
  2386. ret += getText( node );
  2387. }
  2388. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  2389. // Use textContent for elements
  2390. // innerText usage removed for consistency of new lines (see #11153)
  2391. if ( typeof elem.textContent === "string" ) {
  2392. return elem.textContent;
  2393. } else {
  2394. // Traverse its children
  2395. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  2396. ret += getText( elem );
  2397. }
  2398. }
  2399. } else if ( nodeType === 3 || nodeType === 4 ) {
  2400. return elem.nodeValue;
  2401. }
  2402. // Do not include comment or processing instruction nodes
  2403. return ret;
  2404. };
  2405. jQuery.trim = function( text ) {
  2406. /// <summary>
  2407. /// Remove the whitespace from the beginning and end of a string.
  2408. /// </summary>
  2409. /// <param name="text" type="String">
  2410. /// The string to trim.
  2411. /// </param>
  2412. /// <returns type="String" />
  2413. return text == null ?
  2414. "" :
  2415. core_trim.call( text );
  2416. };
  2417. jQuery.type = function( obj ) {
  2418. /// <summary>
  2419. /// Determine the internal JavaScript [[Class]] of an object.
  2420. /// </summary>
  2421. /// <param name="obj" type="Object">
  2422. /// Object to get the internal JavaScript [[Class]] of.
  2423. /// </param>
  2424. /// <returns type="String" />
  2425. if ( obj == null ) {
  2426. return String( obj );
  2427. }
  2428. return typeof obj === "object" || typeof obj === "function" ?
  2429. class2type[ core_toString.call(obj) ] || "object" :
  2430. typeof obj;
  2431. };
  2432. jQuery.unique = function( results ) {
  2433. /// <summary>
  2434. /// Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers.
  2435. /// </summary>
  2436. /// <param name="results" type="Array">
  2437. /// The Array of DOM elements.
  2438. /// </param>
  2439. /// <returns type="Array" />
  2440. var elem,
  2441. duplicates = [],
  2442. j = 0,
  2443. i = 0;
  2444. // Unless we *know* we can detect duplicates, assume their presence
  2445. hasDuplicate = !support.detectDuplicates;
  2446. sortInput = !support.sortStable && results.slice( 0 );
  2447. results.sort( sortOrder );
  2448. if ( hasDuplicate ) {
  2449. while ( (elem = results[i++]) ) {
  2450. if ( elem === results[ i ] ) {
  2451. j = duplicates.push( i );
  2452. }
  2453. }
  2454. while ( j-- ) {
  2455. results.splice( duplicates[ j ], 1 );
  2456. }
  2457. }
  2458. return results;
  2459. };
  2460. jQuery.valHooks = { "option": {},
  2461. "select": {},
  2462. "radio": {},
  2463. "checkbox": {} };
  2464. jQuery.when = function( subordinate /* , ..., subordinateN */ ) {
  2465. /// <summary>
  2466. /// Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events.
  2467. /// </summary>
  2468. /// <param name="subordinate/*" type="Deferred">
  2469. /// One or more Deferred objects, or plain JavaScript objects.
  2470. /// </param>
  2471. /// <returns type="Promise" />
  2472. var i = 0,
  2473. resolveValues = core_slice.call( arguments ),
  2474. length = resolveValues.length,
  2475. // the count of uncompleted subordinates
  2476. remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
  2477. // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
  2478. deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
  2479. // Update function for both resolve and progress values
  2480. updateFunc = function( i, contexts, values ) {
  2481. return function( value ) {
  2482. contexts[ i ] = this;
  2483. values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
  2484. if( values === progressValues ) {
  2485. deferred.notifyWith( contexts, values );
  2486. } else if ( !( --remaining ) ) {
  2487. deferred.resolveWith( contexts, values );
  2488. }
  2489. };
  2490. },
  2491. progressValues, progressContexts, resolveContexts;
  2492. // add listeners to Deferred subordinates; treat others as resolved
  2493. if ( length > 1 ) {
  2494. progressValues = new Array( length );
  2495. progressContexts = new Array( length );
  2496. resolveContexts = new Array( length );
  2497. for ( ; i < length; i++ ) {
  2498. if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
  2499. resolveValues[ i ].promise()
  2500. .done( updateFunc( i, resolveContexts, resolveValues ) )
  2501. .fail( deferred.reject )
  2502. .progress( updateFunc( i, progressContexts, progressValues ) );
  2503. } else {
  2504. --remaining;
  2505. }
  2506. }
  2507. }
  2508. // if we're not waiting on anything, resolve the master
  2509. if ( !remaining ) {
  2510. deferred.resolveWith( resolveContexts, resolveValues );
  2511. }
  2512. return deferred.promise();
  2513. };
  2514. jQuery.Event.prototype.isDefaultPrevented = function returnFalse() {
  2515. /// <summary>
  2516. /// Returns whether event.preventDefault() was ever called on this event object.
  2517. /// </summary>
  2518. /// <returns type="Boolean" />
  2519. return false;
  2520. };
  2521. jQuery.Event.prototype.isImmediatePropagationStopped = function returnFalse() {
  2522. /// <summary>
  2523. /// Returns whether event.stopImmediatePropagation() was ever called on this event object.
  2524. /// </summary>
  2525. /// <returns type="Boolean" />
  2526. return false;
  2527. };
  2528. jQuery.Event.prototype.isPropagationStopped = function returnFalse() {
  2529. /// <summary>
  2530. /// Returns whether event.stopPropagation() was ever called on this event object.
  2531. /// </summary>
  2532. /// <returns type="Boolean" />
  2533. return false;
  2534. };
  2535. jQuery.Event.prototype.preventDefault = function() {
  2536. /// <summary>
  2537. /// If this method is called, the default action of the event will not be triggered.
  2538. /// </summary>
  2539. /// <returns type="undefined" />
  2540. var e = this.originalEvent;
  2541. this.isDefaultPrevented = returnTrue;
  2542. if ( !e ) {
  2543. return;
  2544. }
  2545. // If preventDefault exists, run it on the original event
  2546. if ( e.preventDefault ) {
  2547. e.preventDefault();
  2548. // Support: IE
  2549. // Otherwise set the returnValue property of the original event to false
  2550. } else {
  2551. e.returnValue = false;
  2552. }
  2553. };
  2554. jQuery.Event.prototype.stopImmediatePropagation = function() {
  2555. /// <summary>
  2556. /// Keeps the rest of the handlers from being executed and prevents the event from bubbling up the DOM tree.
  2557. /// </summary>
  2558. this.isImmediatePropagationStopped = returnTrue;
  2559. this.stopPropagation();
  2560. };
  2561. jQuery.Event.prototype.stopPropagation = function() {
  2562. /// <summary>
  2563. /// Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
  2564. /// </summary>
  2565. var e = this.originalEvent;
  2566. this.isPropagationStopped = returnTrue;
  2567. if ( !e ) {
  2568. return;
  2569. }
  2570. // If stopPropagation exists, run it on the original event
  2571. if ( e.stopPropagation ) {
  2572. e.stopPropagation();
  2573. }
  2574. // Support: IE
  2575. // Set the cancelBubble property of the original event to true
  2576. e.cancelBubble = true;
  2577. };
  2578. jQuery.prototype.add = function( selector, context ) {
  2579. /// <summary>
  2580. /// Add elements to the set of matched elements.
  2581. /// &#10;1 - add(selector)
  2582. /// &#10;2 - add(elements)
  2583. /// &#10;3 - add(html)
  2584. /// &#10;4 - add(jQuery object)
  2585. /// &#10;5 - add(selector, context)
  2586. /// </summary>
  2587. /// <param name="selector" type="String">
  2588. /// A string representing a selector expression to find additional elements to add to the set of matched elements.
  2589. /// </param>
  2590. /// <param name="context" domElement="true">
  2591. /// The point in the document at which the selector should begin matching; similar to the context argument of the $(selector, context) method.
  2592. /// </param>
  2593. /// <returns type="jQuery" />
  2594. var set = typeof selector === "string" ?
  2595. jQuery( selector, context ) :
  2596. jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
  2597. all = jQuery.merge( this.get(), set );
  2598. return this.pushStack( jQuery.unique(all) );
  2599. };
  2600. jQuery.prototype.addBack = function( selector ) {
  2601. return this.add( selector == null ?
  2602. this.prevObject : this.prevObject.filter(selector)
  2603. );
  2604. };
  2605. jQuery.prototype.addClass = function( value ) {
  2606. /// <summary>
  2607. /// Adds the specified class(es) to each of the set of matched elements.
  2608. /// &#10;1 - addClass(className)
  2609. /// &#10;2 - addClass(function(index, currentClass))
  2610. /// </summary>
  2611. /// <param name="value" type="String">
  2612. /// One or more class names to be added to the class attribute of each matched element.
  2613. /// </param>
  2614. /// <returns type="jQuery" />
  2615. var classes, elem, cur, clazz, j,
  2616. i = 0,
  2617. len = this.length,
  2618. proceed = typeof value === "string" && value;
  2619. if ( jQuery.isFunction( value ) ) {
  2620. return this.each(function( j ) {
  2621. jQuery( this ).addClass( value.call( this, j, this.className ) );
  2622. });
  2623. }
  2624. if ( proceed ) {
  2625. // The disjunction here is for better compressibility (see removeClass)
  2626. classes = ( value || "" ).match( core_rnotwhite ) || [];
  2627. for ( ; i < len; i++ ) {
  2628. elem = this[ i ];
  2629. cur = elem.nodeType === 1 && ( elem.className ?
  2630. ( " " + elem.className + " " ).replace( rclass, " " ) :
  2631. " "
  2632. );
  2633. if ( cur ) {
  2634. j = 0;
  2635. while ( (clazz = classes[j++]) ) {
  2636. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  2637. cur += clazz + " ";
  2638. }
  2639. }
  2640. elem.className = jQuery.trim( cur );
  2641. }
  2642. }
  2643. }
  2644. return this;
  2645. };
  2646. jQuery.prototype.after = function() {
  2647. /// <summary>
  2648. /// Insert content, specified by the parameter, after each element in the set of matched elements.
  2649. /// &#10;1 - after(content, content)
  2650. /// &#10;2 - after(function(index))
  2651. /// </summary>
  2652. /// <param name="" type="jQuery">
  2653. /// HTML string, DOM element, or jQuery object to insert after each element in the set of matched elements.
  2654. /// </param>
  2655. /// <param name="" type="jQuery">
  2656. /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.
  2657. /// </param>
  2658. /// <returns type="jQuery" />
  2659. return this.domManip( arguments, function( elem ) {
  2660. if ( this.parentNode ) {
  2661. this.parentNode.insertBefore( elem, this.nextSibling );
  2662. }
  2663. });
  2664. };
  2665. jQuery.prototype.ajaxComplete = function( fn ){
  2666. /// <summary>
  2667. /// Register a handler to be called when Ajax requests complete. This is an Ajax Event.
  2668. /// </summary>
  2669. /// <param name="fn" type="Function">
  2670. /// The function to be invoked.
  2671. /// </param>
  2672. /// <returns type="jQuery" />
  2673. return this.on( type, fn );
  2674. };
  2675. jQuery.prototype.ajaxError = function( fn ){
  2676. /// <summary>
  2677. /// Register a handler to be called when Ajax requests complete with an error. This is an Ajax Event.
  2678. /// </summary>
  2679. /// <param name="fn" type="Function">
  2680. /// The function to be invoked.
  2681. /// </param>
  2682. /// <returns type="jQuery" />
  2683. return this.on( type, fn );
  2684. };
  2685. jQuery.prototype.ajaxSend = function( fn ){
  2686. /// <summary>
  2687. /// Attach a function to be executed before an Ajax request is sent. This is an Ajax Event.
  2688. /// </summary>
  2689. /// <param name="fn" type="Function">
  2690. /// The function to be invoked.
  2691. /// </param>
  2692. /// <returns type="jQuery" />
  2693. return this.on( type, fn );
  2694. };
  2695. jQuery.prototype.ajaxStart = function( fn ){
  2696. /// <summary>
  2697. /// Register a handler to be called when the first Ajax request begins. This is an Ajax Event.
  2698. /// </summary>
  2699. /// <param name="fn" type="Function">
  2700. /// The function to be invoked.
  2701. /// </param>
  2702. /// <returns type="jQuery" />
  2703. return this.on( type, fn );
  2704. };
  2705. jQuery.prototype.ajaxStop = function( fn ){
  2706. /// <summary>
  2707. /// Register a handler to be called when all Ajax requests have completed. This is an Ajax Event.
  2708. /// </summary>
  2709. /// <param name="fn" type="Function">
  2710. /// The function to be invoked.
  2711. /// </param>
  2712. /// <returns type="jQuery" />
  2713. return this.on( type, fn );
  2714. };
  2715. jQuery.prototype.ajaxSuccess = function( fn ){
  2716. /// <summary>
  2717. /// Attach a function to be executed whenever an Ajax request completes successfully. This is an Ajax Event.
  2718. /// </summary>
  2719. /// <param name="fn" type="Function">
  2720. /// The function to be invoked.
  2721. /// </param>
  2722. /// <returns type="jQuery" />
  2723. return this.on( type, fn );
  2724. };
  2725. jQuery.prototype.andSelf = function( selector ) {
  2726. /// <summary>
  2727. /// Add the previous set of elements on the stack to the current set.
  2728. /// </summary>
  2729. /// <returns type="jQuery" />
  2730. return this.add( selector == null ?
  2731. this.prevObject : this.prevObject.filter(selector)
  2732. );
  2733. };
  2734. jQuery.prototype.animate = function( prop, speed, easing, callback ) {
  2735. /// <summary>
  2736. /// Perform a custom animation of a set of CSS properties.
  2737. /// &#10;1 - animate(properties, duration, easing, complete)
  2738. /// &#10;2 - animate(properties, options)
  2739. /// </summary>
  2740. /// <param name="prop" type="Object">
  2741. /// A map of CSS properties that the animation will move toward.
  2742. /// </param>
  2743. /// <param name="speed" type="Number">
  2744. /// A string or number determining how long the animation will run.
  2745. /// </param>
  2746. /// <param name="easing" type="String">
  2747. /// A string indicating which easing function to use for the transition.
  2748. /// </param>
  2749. /// <param name="callback" type="Function">
  2750. /// A function to call once the animation is complete.
  2751. /// </param>
  2752. /// <returns type="jQuery" />
  2753. var empty = jQuery.isEmptyObject( prop ),
  2754. optall = jQuery.speed( speed, easing, callback ),
  2755. doAnimation = function() {
  2756. // Operate on a copy of prop so per-property easing won't be lost
  2757. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  2758. doAnimation.finish = function() {
  2759. anim.stop( true );
  2760. };
  2761. // Empty animations, or finishing resolves immediately
  2762. if ( empty || jQuery._data( this, "finish" ) ) {
  2763. anim.stop( true );
  2764. }
  2765. };
  2766. doAnimation.finish = doAnimation;
  2767. return empty || optall.queue === false ?
  2768. this.each( doAnimation ) :
  2769. this.queue( optall.queue, doAnimation );
  2770. };
  2771. jQuery.prototype.append = function() {
  2772. /// <summary>
  2773. /// Insert content, specified by the parameter, to the end of each element in the set of matched elements.
  2774. /// &#10;1 - append(content, content)
  2775. /// &#10;2 - append(function(index, html))
  2776. /// </summary>
  2777. /// <param name="" type="jQuery">
  2778. /// DOM element, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
  2779. /// </param>
  2780. /// <param name="" type="jQuery">
  2781. /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.
  2782. /// </param>
  2783. /// <returns type="jQuery" />
  2784. return this.domManip( arguments, function( elem ) {
  2785. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  2786. var target = manipulationTarget( this, elem );
  2787. target.appendChild( elem );
  2788. }
  2789. });
  2790. };
  2791. jQuery.prototype.appendTo = function( selector ) {
  2792. /// <summary>
  2793. /// Insert every element in the set of matched elements to the end of the target.
  2794. /// </summary>
  2795. /// <param name="selector" type="jQuery">
  2796. /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the end of the element(s) specified by this parameter.
  2797. /// </param>
  2798. /// <returns type="jQuery" />
  2799. var elems,
  2800. i = 0,
  2801. ret = [],
  2802. insert = jQuery( selector ),
  2803. last = insert.length - 1;
  2804. for ( ; i <= last; i++ ) {
  2805. elems = i === last ? this : this.clone(true);
  2806. jQuery( insert[i] )[ original ]( elems );
  2807. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  2808. core_push.apply( ret, elems.get() );
  2809. }
  2810. return this.pushStack( ret );
  2811. };
  2812. jQuery.prototype.attr = function( name, value ) {
  2813. /// <summary>
  2814. /// 1: Get the value of an attribute for the first element in the set of matched elements.
  2815. /// &#10; 1.1 - attr(attributeName)
  2816. /// &#10;2: Set one or more attributes for the set of matched elements.
  2817. /// &#10; 2.1 - attr(attributeName, value)
  2818. /// &#10; 2.2 - attr(map)
  2819. /// &#10; 2.3 - attr(attributeName, function(index, attr))
  2820. /// </summary>
  2821. /// <param name="name" type="String">
  2822. /// The name of the attribute to set.
  2823. /// </param>
  2824. /// <param name="value" type="Number">
  2825. /// A value to set for the attribute.
  2826. /// </param>
  2827. /// <returns type="jQuery" />
  2828. return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
  2829. };
  2830. jQuery.prototype.before = function() {
  2831. /// <summary>
  2832. /// Insert content, specified by the parameter, before each element in the set of matched elements.
  2833. /// &#10;1 - before(content, content)
  2834. /// &#10;2 - before(function)
  2835. /// </summary>
  2836. /// <param name="" type="jQuery">
  2837. /// HTML string, DOM element, or jQuery object to insert before each element in the set of matched elements.
  2838. /// </param>
  2839. /// <param name="" type="jQuery">
  2840. /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements.
  2841. /// </param>
  2842. /// <returns type="jQuery" />
  2843. return this.domManip( arguments, function( elem ) {
  2844. if ( this.parentNode ) {
  2845. this.parentNode.insertBefore( elem, this );
  2846. }
  2847. });
  2848. };
  2849. jQuery.prototype.bind = function( types, data, fn ) {
  2850. /// <summary>
  2851. /// Attach a handler to an event for the elements.
  2852. /// &#10;1 - bind(eventType, eventData, handler(eventObject))
  2853. /// &#10;2 - bind(eventType, eventData, preventBubble)
  2854. /// &#10;3 - bind(events)
  2855. /// </summary>
  2856. /// <param name="types" type="String">
  2857. /// A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
  2858. /// </param>
  2859. /// <param name="data" type="Object">
  2860. /// A map of data that will be passed to the event handler.
  2861. /// </param>
  2862. /// <param name="fn" type="Function">
  2863. /// A function to execute each time the event is triggered.
  2864. /// </param>
  2865. /// <returns type="jQuery" />
  2866. return this.on( types, null, data, fn );
  2867. };
  2868. jQuery.prototype.blur = function( data, fn ) {
  2869. /// <summary>
  2870. /// Bind an event handler to the "blur" JavaScript event, or trigger that event on an element.
  2871. /// &#10;1 - blur(handler(eventObject))
  2872. /// &#10;2 - blur(eventData, handler(eventObject))
  2873. /// &#10;3 - blur()
  2874. /// </summary>
  2875. /// <param name="data" type="Object">
  2876. /// A map of data that will be passed to the event handler.
  2877. /// </param>
  2878. /// <param name="fn" type="Function">
  2879. /// A function to execute each time the event is triggered.
  2880. /// </param>
  2881. /// <returns type="jQuery" />
  2882. return arguments.length > 0 ?
  2883. this.on( name, null, data, fn ) :
  2884. this.trigger( name );
  2885. };
  2886. jQuery.prototype.change = function( data, fn ) {
  2887. /// <summary>
  2888. /// Bind an event handler to the "change" JavaScript event, or trigger that event on an element.
  2889. /// &#10;1 - change(handler(eventObject))
  2890. /// &#10;2 - change(eventData, handler(eventObject))
  2891. /// &#10;3 - change()
  2892. /// </summary>
  2893. /// <param name="data" type="Object">
  2894. /// A map of data that will be passed to the event handler.
  2895. /// </param>
  2896. /// <param name="fn" type="Function">
  2897. /// A function to execute each time the event is triggered.
  2898. /// </param>
  2899. /// <returns type="jQuery" />
  2900. return arguments.length > 0 ?
  2901. this.on( name, null, data, fn ) :
  2902. this.trigger( name );
  2903. };
  2904. jQuery.prototype.children = function( until, selector ) {
  2905. /// <summary>
  2906. /// Get the children of each element in the set of matched elements, optionally filtered by a selector.
  2907. /// </summary>
  2908. /// <param name="until" type="String">
  2909. /// A string containing a selector expression to match elements against.
  2910. /// </param>
  2911. /// <returns type="jQuery" />
  2912. var ret = jQuery.map( this, fn, until );
  2913. if ( name.slice( -5 ) !== "Until" ) {
  2914. selector = until;
  2915. }
  2916. if ( selector && typeof selector === "string" ) {
  2917. ret = jQuery.filter( selector, ret );
  2918. }
  2919. if ( this.length > 1 ) {
  2920. // Remove duplicates
  2921. if ( !guaranteedUnique[ name ] ) {
  2922. ret = jQuery.unique( ret );
  2923. }
  2924. // Reverse order for parents* and prev-derivatives
  2925. if ( rparentsprev.test( name ) ) {
  2926. ret = ret.reverse();
  2927. }
  2928. }
  2929. return this.pushStack( ret );
  2930. };
  2931. jQuery.prototype.clearQueue = function( type ) {
  2932. /// <summary>
  2933. /// Remove from the queue all items that have not yet been run.
  2934. /// </summary>
  2935. /// <param name="type" type="String">
  2936. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  2937. /// </param>
  2938. /// <returns type="jQuery" />
  2939. return this.queue( type || "fx", [] );
  2940. };
  2941. jQuery.prototype.click = function( data, fn ) {
  2942. /// <summary>
  2943. /// Bind an event handler to the "click" JavaScript event, or trigger that event on an element.
  2944. /// &#10;1 - click(handler(eventObject))
  2945. /// &#10;2 - click(eventData, handler(eventObject))
  2946. /// &#10;3 - click()
  2947. /// </summary>
  2948. /// <param name="data" type="Object">
  2949. /// A map of data that will be passed to the event handler.
  2950. /// </param>
  2951. /// <param name="fn" type="Function">
  2952. /// A function to execute each time the event is triggered.
  2953. /// </param>
  2954. /// <returns type="jQuery" />
  2955. return arguments.length > 0 ?
  2956. this.on( name, null, data, fn ) :
  2957. this.trigger( name );
  2958. };
  2959. jQuery.prototype.clone = function( dataAndEvents, deepDataAndEvents ) {
  2960. /// <summary>
  2961. /// Create a deep copy of the set of matched elements.
  2962. /// &#10;1 - clone(withDataAndEvents)
  2963. /// &#10;2 - clone(withDataAndEvents, deepWithDataAndEvents)
  2964. /// </summary>
  2965. /// <param name="dataAndEvents" type="Boolean">
  2966. /// A Boolean indicating whether event handlers and data should be copied along with the elements. The default value is false. *In jQuery 1.5.0 the default value was incorrectly true; it was changed back to false in 1.5.1 and up.
  2967. /// </param>
  2968. /// <param name="deepDataAndEvents" type="Boolean">
  2969. /// A Boolean indicating whether event handlers and data for all children of the cloned element should be copied. By default its value matches the first argument's value (which defaults to false).
  2970. /// </param>
  2971. /// <returns type="jQuery" />
  2972. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  2973. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  2974. return this.map( function () {
  2975. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  2976. });
  2977. };
  2978. jQuery.prototype.closest = function( selectors, context ) {
  2979. /// <summary>
  2980. /// 1: Get the first element that matches the selector, beginning at the current element and progressing up through the DOM tree.
  2981. /// &#10; 1.1 - closest(selector)
  2982. /// &#10; 1.2 - closest(selector, context)
  2983. /// &#10; 1.3 - closest(jQuery object)
  2984. /// &#10; 1.4 - closest(element)
  2985. /// &#10;2: Gets an array of all the elements and selectors matched against the current element up through the DOM tree.
  2986. /// &#10; 2.1 - closest(selectors, context)
  2987. /// </summary>
  2988. /// <param name="selectors" type="String">
  2989. /// A string containing a selector expression to match elements against.
  2990. /// </param>
  2991. /// <param name="context" domElement="true">
  2992. /// A DOM element within which a matching element may be found. If no context is passed in then the context of the jQuery set will be used instead.
  2993. /// </param>
  2994. /// <returns type="jQuery" />
  2995. var cur,
  2996. i = 0,
  2997. l = this.length,
  2998. ret = [],
  2999. pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
  3000. jQuery( selectors, context || this.context ) :
  3001. 0;
  3002. for ( ; i < l; i++ ) {
  3003. for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
  3004. // Always skip document fragments
  3005. if ( cur.nodeType < 11 && (pos ?
  3006. pos.index(cur) > -1 :
  3007. // Don't pass non-elements to Sizzle
  3008. cur.nodeType === 1 &&
  3009. jQuery.find.matchesSelector(cur, selectors)) ) {
  3010. cur = ret.push( cur );
  3011. break;
  3012. }
  3013. }
  3014. }
  3015. return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
  3016. };
  3017. jQuery.prototype.constructor = function( selector, context ) {
  3018. // The jQuery object is actually just the init constructor 'enhanced'
  3019. return new jQuery.fn.init( selector, context, rootjQuery );
  3020. };
  3021. jQuery.prototype.contents = function( until, selector ) {
  3022. /// <summary>
  3023. /// Get the children of each element in the set of matched elements, including text and comment nodes.
  3024. /// </summary>
  3025. /// <returns type="jQuery" />
  3026. var ret = jQuery.map( this, fn, until );
  3027. if ( name.slice( -5 ) !== "Until" ) {
  3028. selector = until;
  3029. }
  3030. if ( selector && typeof selector === "string" ) {
  3031. ret = jQuery.filter( selector, ret );
  3032. }
  3033. if ( this.length > 1 ) {
  3034. // Remove duplicates
  3035. if ( !guaranteedUnique[ name ] ) {
  3036. ret = jQuery.unique( ret );
  3037. }
  3038. // Reverse order for parents* and prev-derivatives
  3039. if ( rparentsprev.test( name ) ) {
  3040. ret = ret.reverse();
  3041. }
  3042. }
  3043. return this.pushStack( ret );
  3044. };
  3045. jQuery.prototype.contextmenu = function( data, fn ) {
  3046. return arguments.length > 0 ?
  3047. this.on( name, null, data, fn ) :
  3048. this.trigger( name );
  3049. };
  3050. jQuery.prototype.css = function( name, value ) {
  3051. /// <summary>
  3052. /// 1: Get the value of a style property for the first element in the set of matched elements.
  3053. /// &#10; 1.1 - css(propertyName)
  3054. /// &#10;2: Set one or more CSS properties for the set of matched elements.
  3055. /// &#10; 2.1 - css(propertyName, value)
  3056. /// &#10; 2.2 - css(propertyName, function(index, value))
  3057. /// &#10; 2.3 - css(map)
  3058. /// </summary>
  3059. /// <param name="name" type="String">
  3060. /// A CSS property name.
  3061. /// </param>
  3062. /// <param name="value" type="Number">
  3063. /// A value to set for the property.
  3064. /// </param>
  3065. /// <returns type="jQuery" />
  3066. return jQuery.access( this, function( elem, name, value ) {
  3067. var len, styles,
  3068. map = {},
  3069. i = 0;
  3070. if ( jQuery.isArray( name ) ) {
  3071. styles = getStyles( elem );
  3072. len = name.length;
  3073. for ( ; i < len; i++ ) {
  3074. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  3075. }
  3076. return map;
  3077. }
  3078. return value !== undefined ?
  3079. jQuery.style( elem, name, value ) :
  3080. jQuery.css( elem, name );
  3081. }, name, value, arguments.length > 1 );
  3082. };
  3083. jQuery.prototype.data = function( key, value ) {
  3084. /// <summary>
  3085. /// 1: Store arbitrary data associated with the matched elements.
  3086. /// &#10; 1.1 - data(key, value)
  3087. /// &#10; 1.2 - data(obj)
  3088. /// &#10;2: Returns value at named data store for the first element in the jQuery collection, as set by data(name, value).
  3089. /// &#10; 2.1 - data(key)
  3090. /// &#10; 2.2 - data()
  3091. /// </summary>
  3092. /// <param name="key" type="String">
  3093. /// A string naming the piece of data to set.
  3094. /// </param>
  3095. /// <param name="value" type="Object">
  3096. /// The new data value; it can be any Javascript type including Array or Object.
  3097. /// </param>
  3098. /// <returns type="jQuery" />
  3099. var attrs, name,
  3100. data = null,
  3101. i = 0,
  3102. elem = this[0];
  3103. // Special expections of .data basically thwart jQuery.access,
  3104. // so implement the relevant behavior ourselves
  3105. // Gets all values
  3106. if ( key === undefined ) {
  3107. if ( this.length ) {
  3108. data = jQuery.data( elem );
  3109. if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
  3110. attrs = elem.attributes;
  3111. for ( ; i < attrs.length; i++ ) {
  3112. name = attrs[i].name;
  3113. if ( name.indexOf("data-") === 0 ) {
  3114. name = jQuery.camelCase( name.slice(5) );
  3115. dataAttr( elem, name, data[ name ] );
  3116. }
  3117. }
  3118. jQuery._data( elem, "parsedAttrs", true );
  3119. }
  3120. }
  3121. return data;
  3122. }
  3123. // Sets multiple values
  3124. if ( typeof key === "object" ) {
  3125. return this.each(function() {
  3126. jQuery.data( this, key );
  3127. });
  3128. }
  3129. return arguments.length > 1 ?
  3130. // Sets one value
  3131. this.each(function() {
  3132. jQuery.data( this, key, value );
  3133. }) :
  3134. // Gets one value
  3135. // Try to fetch any internally stored data first
  3136. elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
  3137. };
  3138. jQuery.prototype.dblclick = function( data, fn ) {
  3139. /// <summary>
  3140. /// Bind an event handler to the "dblclick" JavaScript event, or trigger that event on an element.
  3141. /// &#10;1 - dblclick(handler(eventObject))
  3142. /// &#10;2 - dblclick(eventData, handler(eventObject))
  3143. /// &#10;3 - dblclick()
  3144. /// </summary>
  3145. /// <param name="data" type="Object">
  3146. /// A map of data that will be passed to the event handler.
  3147. /// </param>
  3148. /// <param name="fn" type="Function">
  3149. /// A function to execute each time the event is triggered.
  3150. /// </param>
  3151. /// <returns type="jQuery" />
  3152. return arguments.length > 0 ?
  3153. this.on( name, null, data, fn ) :
  3154. this.trigger( name );
  3155. };
  3156. jQuery.prototype.delay = function( time, type ) {
  3157. /// <summary>
  3158. /// Set a timer to delay execution of subsequent items in the queue.
  3159. /// </summary>
  3160. /// <param name="time" type="Number">
  3161. /// An integer indicating the number of milliseconds to delay execution of the next item in the queue.
  3162. /// </param>
  3163. /// <param name="type" type="String">
  3164. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  3165. /// </param>
  3166. /// <returns type="jQuery" />
  3167. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  3168. type = type || "fx";
  3169. return this.queue( type, function( next, hooks ) {
  3170. var timeout = setTimeout( next, time );
  3171. hooks.stop = function() {
  3172. clearTimeout( timeout );
  3173. };
  3174. });
  3175. };
  3176. jQuery.prototype.delegate = function( selector, types, data, fn ) {
  3177. /// <summary>
  3178. /// Attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.
  3179. /// &#10;1 - delegate(selector, eventType, handler(eventObject))
  3180. /// &#10;2 - delegate(selector, eventType, eventData, handler(eventObject))
  3181. /// &#10;3 - delegate(selector, events)
  3182. /// </summary>
  3183. /// <param name="selector" type="String">
  3184. /// A selector to filter the elements that trigger the event.
  3185. /// </param>
  3186. /// <param name="types" type="String">
  3187. /// A string containing one or more space-separated JavaScript event types, such as "click" or "keydown," or custom event names.
  3188. /// </param>
  3189. /// <param name="data" type="Object">
  3190. /// A map of data that will be passed to the event handler.
  3191. /// </param>
  3192. /// <param name="fn" type="Function">
  3193. /// A function to execute at the time the event is triggered.
  3194. /// </param>
  3195. /// <returns type="jQuery" />
  3196. return this.on( types, selector, data, fn );
  3197. };
  3198. jQuery.prototype.dequeue = function( type ) {
  3199. /// <summary>
  3200. /// Execute the next function on the queue for the matched elements.
  3201. /// </summary>
  3202. /// <param name="type" type="String">
  3203. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  3204. /// </param>
  3205. /// <returns type="jQuery" />
  3206. return this.each(function() {
  3207. jQuery.dequeue( this, type );
  3208. });
  3209. };
  3210. jQuery.prototype.detach = function( selector ) {
  3211. /// <summary>
  3212. /// Remove the set of matched elements from the DOM.
  3213. /// </summary>
  3214. /// <param name="selector" type="String">
  3215. /// A selector expression that filters the set of matched elements to be removed.
  3216. /// </param>
  3217. /// <returns type="jQuery" />
  3218. return this.remove( selector, true );
  3219. };
  3220. jQuery.prototype.domManip = function( args, callback, allowIntersection ) {
  3221. // Flatten any nested arrays
  3222. args = core_concat.apply( [], args );
  3223. var first, node, hasScripts,
  3224. scripts, doc, fragment,
  3225. i = 0,
  3226. l = this.length,
  3227. set = this,
  3228. iNoClone = l - 1,
  3229. value = args[0],
  3230. isFunction = jQuery.isFunction( value );
  3231. // We can't cloneNode fragments that contain checked, in WebKit
  3232. if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
  3233. return this.each(function( index ) {
  3234. var self = set.eq( index );
  3235. if ( isFunction ) {
  3236. args[0] = value.call( this, index, self.html() );
  3237. }
  3238. self.domManip( args, callback, allowIntersection );
  3239. });
  3240. }
  3241. if ( l ) {
  3242. fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, !allowIntersection && this );
  3243. first = fragment.firstChild;
  3244. if ( fragment.childNodes.length === 1 ) {
  3245. fragment = first;
  3246. }
  3247. if ( first ) {
  3248. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  3249. hasScripts = scripts.length;
  3250. // Use the original fragment for the last item instead of the first because it can end up
  3251. // being emptied incorrectly in certain situations (#8070).
  3252. for ( ; i < l; i++ ) {
  3253. node = fragment;
  3254. if ( i !== iNoClone ) {
  3255. node = jQuery.clone( node, true, true );
  3256. // Keep references to cloned scripts for later restoration
  3257. if ( hasScripts ) {
  3258. jQuery.merge( scripts, getAll( node, "script" ) );
  3259. }
  3260. }
  3261. callback.call( this[i], node, i );
  3262. }
  3263. if ( hasScripts ) {
  3264. doc = scripts[ scripts.length - 1 ].ownerDocument;
  3265. // Reenable scripts
  3266. jQuery.map( scripts, restoreScript );
  3267. // Evaluate executable scripts on first document insertion
  3268. for ( i = 0; i < hasScripts; i++ ) {
  3269. node = scripts[ i ];
  3270. if ( rscriptType.test( node.type || "" ) &&
  3271. !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
  3272. if ( node.src ) {
  3273. // Hope ajax is available...
  3274. jQuery._evalUrl( node.src );
  3275. } else {
  3276. jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
  3277. }
  3278. }
  3279. }
  3280. }
  3281. // Fix #11809: Avoid leaking memory
  3282. fragment = first = null;
  3283. }
  3284. }
  3285. return this;
  3286. };
  3287. jQuery.prototype.each = function( callback, args ) {
  3288. /// <summary>
  3289. /// Iterate over a jQuery object, executing a function for each matched element.
  3290. /// </summary>
  3291. /// <param name="callback" type="Function">
  3292. /// A function to execute for each matched element.
  3293. /// </param>
  3294. /// <returns type="jQuery" />
  3295. return jQuery.each( this, callback, args );
  3296. };
  3297. jQuery.prototype.empty = function() {
  3298. /// <summary>
  3299. /// Remove all child nodes of the set of matched elements from the DOM.
  3300. /// </summary>
  3301. /// <returns type="jQuery" />
  3302. var elem,
  3303. i = 0;
  3304. for ( ; (elem = this[i]) != null; i++ ) {
  3305. // Remove element nodes and prevent memory leaks
  3306. if ( elem.nodeType === 1 ) {
  3307. jQuery.cleanData( getAll( elem, false ) );
  3308. }
  3309. // Remove any remaining nodes
  3310. while ( elem.firstChild ) {
  3311. elem.removeChild( elem.firstChild );
  3312. }
  3313. // If this is a select, ensure that it displays empty (#12336)
  3314. // Support: IE<9
  3315. if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
  3316. elem.options.length = 0;
  3317. }
  3318. }
  3319. return this;
  3320. };
  3321. jQuery.prototype.end = function() {
  3322. /// <summary>
  3323. /// End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.
  3324. /// </summary>
  3325. /// <returns type="jQuery" />
  3326. return this.prevObject || this.constructor(null);
  3327. };
  3328. jQuery.prototype.eq = function( i ) {
  3329. /// <summary>
  3330. /// Reduce the set of matched elements to the one at the specified index.
  3331. /// &#10;1 - eq(index)
  3332. /// &#10;2 - eq(-index)
  3333. /// </summary>
  3334. /// <param name="i" type="Number">
  3335. /// An integer indicating the 0-based position of the element.
  3336. /// </param>
  3337. /// <returns type="jQuery" />
  3338. var len = this.length,
  3339. j = +i + ( i < 0 ? len : 0 );
  3340. return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
  3341. };
  3342. jQuery.prototype.error = function( data, fn ) {
  3343. /// <summary>
  3344. /// Bind an event handler to the "error" JavaScript event.
  3345. /// &#10;1 - error(handler(eventObject))
  3346. /// &#10;2 - error(eventData, handler(eventObject))
  3347. /// </summary>
  3348. /// <param name="data" type="Object">
  3349. /// A map of data that will be passed to the event handler.
  3350. /// </param>
  3351. /// <param name="fn" type="Function">
  3352. /// A function to execute each time the event is triggered.
  3353. /// </param>
  3354. /// <returns type="jQuery" />
  3355. return arguments.length > 0 ?
  3356. this.on( name, null, data, fn ) :
  3357. this.trigger( name );
  3358. };
  3359. jQuery.prototype.extend = function() {
  3360. var src, copyIsArray, copy, name, options, clone,
  3361. target = arguments[0] || {},
  3362. i = 1,
  3363. length = arguments.length,
  3364. deep = false;
  3365. // Handle a deep copy situation
  3366. if ( typeof target === "boolean" ) {
  3367. deep = target;
  3368. target = arguments[1] || {};
  3369. // skip the boolean and the target
  3370. i = 2;
  3371. }
  3372. // Handle case when target is a string or something (possible in deep copy)
  3373. if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  3374. target = {};
  3375. }
  3376. // extend jQuery itself if only one argument is passed
  3377. if ( length === i ) {
  3378. target = this;
  3379. --i;
  3380. }
  3381. for ( ; i < length; i++ ) {
  3382. // Only deal with non-null/undefined values
  3383. if ( (options = arguments[ i ]) != null ) {
  3384. // Extend the base object
  3385. for ( name in options ) {
  3386. src = target[ name ];
  3387. copy = options[ name ];
  3388. // Prevent never-ending loop
  3389. if ( target === copy ) {
  3390. continue;
  3391. }
  3392. // Recurse if we're merging plain objects or arrays
  3393. if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
  3394. if ( copyIsArray ) {
  3395. copyIsArray = false;
  3396. clone = src && jQuery.isArray(src) ? src : [];
  3397. } else {
  3398. clone = src && jQuery.isPlainObject(src) ? src : {};
  3399. }
  3400. // Never move original objects, clone them
  3401. target[ name ] = jQuery.extend( deep, clone, copy );
  3402. // Don't bring in undefined values
  3403. } else if ( copy !== undefined ) {
  3404. target[ name ] = copy;
  3405. }
  3406. }
  3407. }
  3408. }
  3409. // Return the modified object
  3410. return target;
  3411. };
  3412. jQuery.prototype.fadeIn = function( speed, easing, callback ) {
  3413. /// <summary>
  3414. /// Display the matched elements by fading them to opaque.
  3415. /// &#10;1 - fadeIn(duration, callback)
  3416. /// &#10;2 - fadeIn(duration, easing, callback)
  3417. /// </summary>
  3418. /// <param name="speed" type="Number">
  3419. /// A string or number determining how long the animation will run.
  3420. /// </param>
  3421. /// <param name="easing" type="String">
  3422. /// A string indicating which easing function to use for the transition.
  3423. /// </param>
  3424. /// <param name="callback" type="Function">
  3425. /// A function to call once the animation is complete.
  3426. /// </param>
  3427. /// <returns type="jQuery" />
  3428. return this.animate( props, speed, easing, callback );
  3429. };
  3430. jQuery.prototype.fadeOut = function( speed, easing, callback ) {
  3431. /// <summary>
  3432. /// Hide the matched elements by fading them to transparent.
  3433. /// &#10;1 - fadeOut(duration, callback)
  3434. /// &#10;2 - fadeOut(duration, easing, callback)
  3435. /// </summary>
  3436. /// <param name="speed" type="Number">
  3437. /// A string or number determining how long the animation will run.
  3438. /// </param>
  3439. /// <param name="easing" type="String">
  3440. /// A string indicating which easing function to use for the transition.
  3441. /// </param>
  3442. /// <param name="callback" type="Function">
  3443. /// A function to call once the animation is complete.
  3444. /// </param>
  3445. /// <returns type="jQuery" />
  3446. return this.animate( props, speed, easing, callback );
  3447. };
  3448. jQuery.prototype.fadeTo = function( speed, to, easing, callback ) {
  3449. /// <summary>
  3450. /// Adjust the opacity of the matched elements.
  3451. /// &#10;1 - fadeTo(duration, opacity, callback)
  3452. /// &#10;2 - fadeTo(duration, opacity, easing, callback)
  3453. /// </summary>
  3454. /// <param name="speed" type="Number">
  3455. /// A string or number determining how long the animation will run.
  3456. /// </param>
  3457. /// <param name="to" type="Number">
  3458. /// A number between 0 and 1 denoting the target opacity.
  3459. /// </param>
  3460. /// <param name="easing" type="String">
  3461. /// A string indicating which easing function to use for the transition.
  3462. /// </param>
  3463. /// <param name="callback" type="Function">
  3464. /// A function to call once the animation is complete.
  3465. /// </param>
  3466. /// <returns type="jQuery" />
  3467. // show any hidden elements after setting opacity to 0
  3468. return this.filter( isHidden ).css( "opacity", 0 ).show()
  3469. // animate to the value specified
  3470. .end().animate({ opacity: to }, speed, easing, callback );
  3471. };
  3472. jQuery.prototype.fadeToggle = function( speed, easing, callback ) {
  3473. /// <summary>
  3474. /// Display or hide the matched elements by animating their opacity.
  3475. /// </summary>
  3476. /// <param name="speed" type="Number">
  3477. /// A string or number determining how long the animation will run.
  3478. /// </param>
  3479. /// <param name="easing" type="String">
  3480. /// A string indicating which easing function to use for the transition.
  3481. /// </param>
  3482. /// <param name="callback" type="Function">
  3483. /// A function to call once the animation is complete.
  3484. /// </param>
  3485. /// <returns type="jQuery" />
  3486. return this.animate( props, speed, easing, callback );
  3487. };
  3488. jQuery.prototype.filter = function( selector ) {
  3489. /// <summary>
  3490. /// Reduce the set of matched elements to those that match the selector or pass the function's test.
  3491. /// &#10;1 - filter(selector)
  3492. /// &#10;2 - filter(function(index))
  3493. /// &#10;3 - filter(element)
  3494. /// &#10;4 - filter(jQuery object)
  3495. /// </summary>
  3496. /// <param name="selector" type="String">
  3497. /// A string containing a selector expression to match the current set of elements against.
  3498. /// </param>
  3499. /// <returns type="jQuery" />
  3500. return this.pushStack( winnow(this, selector || [], false) );
  3501. };
  3502. jQuery.prototype.find = function( selector ) {
  3503. /// <summary>
  3504. /// Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
  3505. /// &#10;1 - find(selector)
  3506. /// &#10;2 - find(jQuery object)
  3507. /// &#10;3 - find(element)
  3508. /// </summary>
  3509. /// <param name="selector" type="String">
  3510. /// A string containing a selector expression to match elements against.
  3511. /// </param>
  3512. /// <returns type="jQuery" />
  3513. var i,
  3514. ret = [],
  3515. self = this,
  3516. len = self.length;
  3517. if ( typeof selector !== "string" ) {
  3518. return this.pushStack( jQuery( selector ).filter(function() {
  3519. for ( i = 0; i < len; i++ ) {
  3520. if ( jQuery.contains( self[ i ], this ) ) {
  3521. return true;
  3522. }
  3523. }
  3524. }) );
  3525. }
  3526. for ( i = 0; i < len; i++ ) {
  3527. jQuery.find( selector, self[ i ], ret );
  3528. }
  3529. // Needed because $( selector, context ) becomes $( context ).find( selector )
  3530. ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
  3531. ret.selector = this.selector ? this.selector + " " + selector : selector;
  3532. return ret;
  3533. };
  3534. jQuery.prototype.finish = function( type ) {
  3535. if ( type !== false ) {
  3536. type = type || "fx";
  3537. }
  3538. return this.each(function() {
  3539. var index,
  3540. data = jQuery._data( this ),
  3541. queue = data[ type + "queue" ],
  3542. hooks = data[ type + "queueHooks" ],
  3543. timers = jQuery.timers,
  3544. length = queue ? queue.length : 0;
  3545. // enable finishing flag on private data
  3546. data.finish = true;
  3547. // empty the queue first
  3548. jQuery.queue( this, type, [] );
  3549. if ( hooks && hooks.cur && hooks.cur.finish ) {
  3550. hooks.cur.finish.call( this );
  3551. }
  3552. // look for any active animations, and finish them
  3553. for ( index = timers.length; index--; ) {
  3554. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  3555. timers[ index ].anim.stop( true );
  3556. timers.splice( index, 1 );
  3557. }
  3558. }
  3559. // look for any animations in the old queue and finish them
  3560. for ( index = 0; index < length; index++ ) {
  3561. if ( queue[ index ] && queue[ index ].finish ) {
  3562. queue[ index ].finish.call( this );
  3563. }
  3564. }
  3565. // turn off finishing flag
  3566. delete data.finish;
  3567. });
  3568. };
  3569. jQuery.prototype.first = function() {
  3570. /// <summary>
  3571. /// Reduce the set of matched elements to the first in the set.
  3572. /// </summary>
  3573. /// <returns type="jQuery" />
  3574. return this.eq( 0 );
  3575. };
  3576. jQuery.prototype.focus = function( data, fn ) {
  3577. /// <summary>
  3578. /// Bind an event handler to the "focus" JavaScript event, or trigger that event on an element.
  3579. /// &#10;1 - focus(handler(eventObject))
  3580. /// &#10;2 - focus(eventData, handler(eventObject))
  3581. /// &#10;3 - focus()
  3582. /// </summary>
  3583. /// <param name="data" type="Object">
  3584. /// A map of data that will be passed to the event handler.
  3585. /// </param>
  3586. /// <param name="fn" type="Function">
  3587. /// A function to execute each time the event is triggered.
  3588. /// </param>
  3589. /// <returns type="jQuery" />
  3590. return arguments.length > 0 ?
  3591. this.on( name, null, data, fn ) :
  3592. this.trigger( name );
  3593. };
  3594. jQuery.prototype.focusin = function( data, fn ) {
  3595. /// <summary>
  3596. /// Bind an event handler to the "focusin" event.
  3597. /// &#10;1 - focusin(handler(eventObject))
  3598. /// &#10;2 - focusin(eventData, handler(eventObject))
  3599. /// </summary>
  3600. /// <param name="data" type="Object">
  3601. /// A map of data that will be passed to the event handler.
  3602. /// </param>
  3603. /// <param name="fn" type="Function">
  3604. /// A function to execute each time the event is triggered.
  3605. /// </param>
  3606. /// <returns type="jQuery" />
  3607. return arguments.length > 0 ?
  3608. this.on( name, null, data, fn ) :
  3609. this.trigger( name );
  3610. };
  3611. jQuery.prototype.focusout = function( data, fn ) {
  3612. /// <summary>
  3613. /// Bind an event handler to the "focusout" JavaScript event.
  3614. /// &#10;1 - focusout(handler(eventObject))
  3615. /// &#10;2 - focusout(eventData, handler(eventObject))
  3616. /// </summary>
  3617. /// <param name="data" type="Object">
  3618. /// A map of data that will be passed to the event handler.
  3619. /// </param>
  3620. /// <param name="fn" type="Function">
  3621. /// A function to execute each time the event is triggered.
  3622. /// </param>
  3623. /// <returns type="jQuery" />
  3624. return arguments.length > 0 ?
  3625. this.on( name, null, data, fn ) :
  3626. this.trigger( name );
  3627. };
  3628. jQuery.prototype.get = function( num ) {
  3629. /// <summary>
  3630. /// Retrieve the DOM elements matched by the jQuery object.
  3631. /// </summary>
  3632. /// <param name="num" type="Number">
  3633. /// A zero-based integer indicating which element to retrieve.
  3634. /// </param>
  3635. /// <returns type="Array" />
  3636. return num == null ?
  3637. // Return a 'clean' array
  3638. this.toArray() :
  3639. // Return just the object
  3640. ( num < 0 ? this[ this.length + num ] : this[ num ] );
  3641. };
  3642. jQuery.prototype.has = function( target ) {
  3643. /// <summary>
  3644. /// Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
  3645. /// &#10;1 - has(selector)
  3646. /// &#10;2 - has(contained)
  3647. /// </summary>
  3648. /// <param name="target" type="String">
  3649. /// A string containing a selector expression to match elements against.
  3650. /// </param>
  3651. /// <returns type="jQuery" />
  3652. var i,
  3653. targets = jQuery( target, this ),
  3654. len = targets.length;
  3655. return this.filter(function() {
  3656. for ( i = 0; i < len; i++ ) {
  3657. if ( jQuery.contains( this, targets[i] ) ) {
  3658. return true;
  3659. }
  3660. }
  3661. });
  3662. };
  3663. jQuery.prototype.hasClass = function( selector ) {
  3664. /// <summary>
  3665. /// Determine whether any of the matched elements are assigned the given class.
  3666. /// </summary>
  3667. /// <param name="selector" type="String">
  3668. /// The class name to search for.
  3669. /// </param>
  3670. /// <returns type="Boolean" />
  3671. var className = " " + selector + " ",
  3672. i = 0,
  3673. l = this.length;
  3674. for ( ; i < l; i++ ) {
  3675. if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
  3676. return true;
  3677. }
  3678. }
  3679. return false;
  3680. };
  3681. jQuery.prototype.height = function( margin, value ) {
  3682. /// <summary>
  3683. /// 1: Get the current computed height for the first element in the set of matched elements.
  3684. /// &#10; 1.1 - height()
  3685. /// &#10;2: Set the CSS height of every matched element.
  3686. /// &#10; 2.1 - height(value)
  3687. /// &#10; 2.2 - height(function(index, height))
  3688. /// </summary>
  3689. /// <param name="margin" type="Number">
  3690. /// An integer representing the number of pixels, or an integer with an optional unit of measure appended (as a string).
  3691. /// </param>
  3692. /// <returns type="jQuery" />
  3693. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  3694. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  3695. return jQuery.access( this, function( elem, type, value ) {
  3696. var doc;
  3697. if ( jQuery.isWindow( elem ) ) {
  3698. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  3699. // isn't a whole lot we can do. See pull request at this URL for discussion:
  3700. // https://github.com/jquery/jquery/pull/764
  3701. return elem.document.documentElement[ "client" + name ];
  3702. }
  3703. // Get document width or height
  3704. if ( elem.nodeType === 9 ) {
  3705. doc = elem.documentElement;
  3706. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  3707. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  3708. return Math.max(
  3709. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  3710. elem.body[ "offset" + name ], doc[ "offset" + name ],
  3711. doc[ "client" + name ]
  3712. );
  3713. }
  3714. return value === undefined ?
  3715. // Get width or height on the element, requesting but not forcing parseFloat
  3716. jQuery.css( elem, type, extra ) :
  3717. // Set width or height on the element
  3718. jQuery.style( elem, type, value, extra );
  3719. }, type, chainable ? margin : undefined, chainable, null );
  3720. };
  3721. jQuery.prototype.hide = function( speed, easing, callback ) {
  3722. /// <summary>
  3723. /// Hide the matched elements.
  3724. /// &#10;1 - hide()
  3725. /// &#10;2 - hide(duration, callback)
  3726. /// &#10;3 - hide(duration, easing, callback)
  3727. /// </summary>
  3728. /// <param name="speed" type="Number">
  3729. /// A string or number determining how long the animation will run.
  3730. /// </param>
  3731. /// <param name="easing" type="String">
  3732. /// A string indicating which easing function to use for the transition.
  3733. /// </param>
  3734. /// <param name="callback" type="Function">
  3735. /// A function to call once the animation is complete.
  3736. /// </param>
  3737. /// <returns type="jQuery" />
  3738. return speed == null || typeof speed === "boolean" ?
  3739. cssFn.apply( this, arguments ) :
  3740. this.animate( genFx( name, true ), speed, easing, callback );
  3741. };
  3742. jQuery.prototype.hover = function( fnOver, fnOut ) {
  3743. /// <summary>
  3744. /// 1: Bind two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.
  3745. /// &#10; 1.1 - hover(handlerIn(eventObject), handlerOut(eventObject))
  3746. /// &#10;2: Bind a single handler to the matched elements, to be executed when the mouse pointer enters or leaves the elements.
  3747. /// &#10; 2.1 - hover(handlerInOut(eventObject))
  3748. /// </summary>
  3749. /// <param name="fnOver" type="Function">
  3750. /// A function to execute when the mouse pointer enters the element.
  3751. /// </param>
  3752. /// <param name="fnOut" type="Function">
  3753. /// A function to execute when the mouse pointer leaves the element.
  3754. /// </param>
  3755. /// <returns type="jQuery" />
  3756. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  3757. };
  3758. jQuery.prototype.html = function( value ) {
  3759. /// <summary>
  3760. /// 1: Get the HTML contents of the first element in the set of matched elements.
  3761. /// &#10; 1.1 - html()
  3762. /// &#10;2: Set the HTML contents of each element in the set of matched elements.
  3763. /// &#10; 2.1 - html(htmlString)
  3764. /// &#10; 2.2 - html(function(index, oldhtml))
  3765. /// </summary>
  3766. /// <param name="value" type="String">
  3767. /// A string of HTML to set as the content of each matched element.
  3768. /// </param>
  3769. /// <returns type="jQuery" />
  3770. return jQuery.access( this, function( value ) {
  3771. var elem = this[0] || {},
  3772. i = 0,
  3773. l = this.length;
  3774. if ( value === undefined ) {
  3775. return elem.nodeType === 1 ?
  3776. elem.innerHTML.replace( rinlinejQuery, "" ) :
  3777. undefined;
  3778. }
  3779. // See if we can take a shortcut and just use innerHTML
  3780. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  3781. ( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
  3782. ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
  3783. !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
  3784. value = value.replace( rxhtmlTag, "<$1></$2>" );
  3785. try {
  3786. for (; i < l; i++ ) {
  3787. // Remove element nodes and prevent memory leaks
  3788. elem = this[i] || {};
  3789. if ( elem.nodeType === 1 ) {
  3790. jQuery.cleanData( getAll( elem, false ) );
  3791. elem.innerHTML = value;
  3792. }
  3793. }
  3794. elem = 0;
  3795. // If using innerHTML throws an exception, use the fallback method
  3796. } catch(e) {}
  3797. }
  3798. if ( elem ) {
  3799. this.empty().append( value );
  3800. }
  3801. }, null, value, arguments.length );
  3802. };
  3803. jQuery.prototype.index = function( elem ) {
  3804. /// <summary>
  3805. /// Search for a given element from among the matched elements.
  3806. /// &#10;1 - index()
  3807. /// &#10;2 - index(selector)
  3808. /// &#10;3 - index(element)
  3809. /// </summary>
  3810. /// <param name="elem" type="String">
  3811. /// A selector representing a jQuery collection in which to look for an element.
  3812. /// </param>
  3813. /// <returns type="Number" />
  3814. // No argument, return index in parent
  3815. if ( !elem ) {
  3816. return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
  3817. }
  3818. // index in selector
  3819. if ( typeof elem === "string" ) {
  3820. return jQuery.inArray( this[0], jQuery( elem ) );
  3821. }
  3822. // Locate the position of the desired element
  3823. return jQuery.inArray(
  3824. // If it receives a jQuery object, the first element is used
  3825. elem.jquery ? elem[0] : elem, this );
  3826. };
  3827. jQuery.prototype.init = function( selector, context, rootjQuery ) {
  3828. var match, elem;
  3829. // HANDLE: $(""), $(null), $(undefined), $(false)
  3830. if ( !selector ) {
  3831. return this;
  3832. }
  3833. // Handle HTML strings
  3834. if ( typeof selector === "string" ) {
  3835. if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
  3836. // Assume that strings that start and end with <> are HTML and skip the regex check
  3837. match = [ null, selector, null ];
  3838. } else {
  3839. match = rquickExpr.exec( selector );
  3840. }
  3841. // Match html or make sure no context is specified for #id
  3842. if ( match && (match[1] || !context) ) {
  3843. // HANDLE: $(html) -> $(array)
  3844. if ( match[1] ) {
  3845. context = context instanceof jQuery ? context[0] : context;
  3846. // scripts is true for back-compat
  3847. jQuery.merge( this, jQuery.parseHTML(
  3848. match[1],
  3849. context && context.nodeType ? context.ownerDocument || context : document,
  3850. true
  3851. ) );
  3852. // HANDLE: $(html, props)
  3853. if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
  3854. for ( match in context ) {
  3855. // Properties of context are called as methods if possible
  3856. if ( jQuery.isFunction( this[ match ] ) ) {
  3857. this[ match ]( context[ match ] );
  3858. // ...and otherwise set as attributes
  3859. } else {
  3860. this.attr( match, context[ match ] );
  3861. }
  3862. }
  3863. }
  3864. return this;
  3865. // HANDLE: $(#id)
  3866. } else {
  3867. elem = document.getElementById( match[2] );
  3868. // Check parentNode to catch when Blackberry 4.6 returns
  3869. // nodes that are no longer in the document #6963
  3870. if ( elem && elem.parentNode ) {
  3871. // Handle the case where IE and Opera return items
  3872. // by name instead of ID
  3873. if ( elem.id !== match[2] ) {
  3874. return rootjQuery.find( selector );
  3875. }
  3876. // Otherwise, we inject the element directly into the jQuery object
  3877. this.length = 1;
  3878. this[0] = elem;
  3879. }
  3880. this.context = document;
  3881. this.selector = selector;
  3882. return this;
  3883. }
  3884. // HANDLE: $(expr, $(...))
  3885. } else if ( !context || context.jquery ) {
  3886. return ( context || rootjQuery ).find( selector );
  3887. // HANDLE: $(expr, context)
  3888. // (which is just equivalent to: $(context).find(expr)
  3889. } else {
  3890. return this.constructor( context ).find( selector );
  3891. }
  3892. // HANDLE: $(DOMElement)
  3893. } else if ( selector.nodeType ) {
  3894. this.context = this[0] = selector;
  3895. this.length = 1;
  3896. return this;
  3897. // HANDLE: $(function)
  3898. // Shortcut for document ready
  3899. } else if ( jQuery.isFunction( selector ) ) {
  3900. return rootjQuery.ready( selector );
  3901. }
  3902. if ( selector.selector !== undefined ) {
  3903. this.selector = selector.selector;
  3904. this.context = selector.context;
  3905. }
  3906. return jQuery.makeArray( selector, this );
  3907. };
  3908. jQuery.prototype.innerHeight = function( margin, value ) {
  3909. /// <summary>
  3910. /// Get the current computed height for the first element in the set of matched elements, including padding but not border.
  3911. /// </summary>
  3912. /// <returns type="Number" />
  3913. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  3914. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  3915. return jQuery.access( this, function( elem, type, value ) {
  3916. var doc;
  3917. if ( jQuery.isWindow( elem ) ) {
  3918. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  3919. // isn't a whole lot we can do. See pull request at this URL for discussion:
  3920. // https://github.com/jquery/jquery/pull/764
  3921. return elem.document.documentElement[ "client" + name ];
  3922. }
  3923. // Get document width or height
  3924. if ( elem.nodeType === 9 ) {
  3925. doc = elem.documentElement;
  3926. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  3927. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  3928. return Math.max(
  3929. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  3930. elem.body[ "offset" + name ], doc[ "offset" + name ],
  3931. doc[ "client" + name ]
  3932. );
  3933. }
  3934. return value === undefined ?
  3935. // Get width or height on the element, requesting but not forcing parseFloat
  3936. jQuery.css( elem, type, extra ) :
  3937. // Set width or height on the element
  3938. jQuery.style( elem, type, value, extra );
  3939. }, type, chainable ? margin : undefined, chainable, null );
  3940. };
  3941. jQuery.prototype.innerWidth = function( margin, value ) {
  3942. /// <summary>
  3943. /// Get the current computed width for the first element in the set of matched elements, including padding but not border.
  3944. /// </summary>
  3945. /// <returns type="Number" />
  3946. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  3947. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  3948. return jQuery.access( this, function( elem, type, value ) {
  3949. var doc;
  3950. if ( jQuery.isWindow( elem ) ) {
  3951. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  3952. // isn't a whole lot we can do. See pull request at this URL for discussion:
  3953. // https://github.com/jquery/jquery/pull/764
  3954. return elem.document.documentElement[ "client" + name ];
  3955. }
  3956. // Get document width or height
  3957. if ( elem.nodeType === 9 ) {
  3958. doc = elem.documentElement;
  3959. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  3960. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  3961. return Math.max(
  3962. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  3963. elem.body[ "offset" + name ], doc[ "offset" + name ],
  3964. doc[ "client" + name ]
  3965. );
  3966. }
  3967. return value === undefined ?
  3968. // Get width or height on the element, requesting but not forcing parseFloat
  3969. jQuery.css( elem, type, extra ) :
  3970. // Set width or height on the element
  3971. jQuery.style( elem, type, value, extra );
  3972. }, type, chainable ? margin : undefined, chainable, null );
  3973. };
  3974. jQuery.prototype.insertAfter = function( selector ) {
  3975. /// <summary>
  3976. /// Insert every element in the set of matched elements after the target.
  3977. /// </summary>
  3978. /// <param name="selector" type="jQuery">
  3979. /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted after the element(s) specified by this parameter.
  3980. /// </param>
  3981. /// <returns type="jQuery" />
  3982. var elems,
  3983. i = 0,
  3984. ret = [],
  3985. insert = jQuery( selector ),
  3986. last = insert.length - 1;
  3987. for ( ; i <= last; i++ ) {
  3988. elems = i === last ? this : this.clone(true);
  3989. jQuery( insert[i] )[ original ]( elems );
  3990. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  3991. core_push.apply( ret, elems.get() );
  3992. }
  3993. return this.pushStack( ret );
  3994. };
  3995. jQuery.prototype.insertBefore = function( selector ) {
  3996. /// <summary>
  3997. /// Insert every element in the set of matched elements before the target.
  3998. /// </summary>
  3999. /// <param name="selector" type="jQuery">
  4000. /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted before the element(s) specified by this parameter.
  4001. /// </param>
  4002. /// <returns type="jQuery" />
  4003. var elems,
  4004. i = 0,
  4005. ret = [],
  4006. insert = jQuery( selector ),
  4007. last = insert.length - 1;
  4008. for ( ; i <= last; i++ ) {
  4009. elems = i === last ? this : this.clone(true);
  4010. jQuery( insert[i] )[ original ]( elems );
  4011. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  4012. core_push.apply( ret, elems.get() );
  4013. }
  4014. return this.pushStack( ret );
  4015. };
  4016. jQuery.prototype.is = function( selector ) {
  4017. /// <summary>
  4018. /// Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments.
  4019. /// &#10;1 - is(selector)
  4020. /// &#10;2 - is(function(index))
  4021. /// &#10;3 - is(jQuery object)
  4022. /// &#10;4 - is(element)
  4023. /// </summary>
  4024. /// <param name="selector" type="String">
  4025. /// A string containing a selector expression to match elements against.
  4026. /// </param>
  4027. /// <returns type="Boolean" />
  4028. return !!winnow(
  4029. this,
  4030. // If this is a positional/relative selector, check membership in the returned set
  4031. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  4032. typeof selector === "string" && rneedsContext.test( selector ) ?
  4033. jQuery( selector ) :
  4034. selector || [],
  4035. false
  4036. ).length;
  4037. };
  4038. jQuery.prototype.keydown = function( data, fn ) {
  4039. /// <summary>
  4040. /// Bind an event handler to the "keydown" JavaScript event, or trigger that event on an element.
  4041. /// &#10;1 - keydown(handler(eventObject))
  4042. /// &#10;2 - keydown(eventData, handler(eventObject))
  4043. /// &#10;3 - keydown()
  4044. /// </summary>
  4045. /// <param name="data" type="Object">
  4046. /// A map of data that will be passed to the event handler.
  4047. /// </param>
  4048. /// <param name="fn" type="Function">
  4049. /// A function to execute each time the event is triggered.
  4050. /// </param>
  4051. /// <returns type="jQuery" />
  4052. return arguments.length > 0 ?
  4053. this.on( name, null, data, fn ) :
  4054. this.trigger( name );
  4055. };
  4056. jQuery.prototype.keypress = function( data, fn ) {
  4057. /// <summary>
  4058. /// Bind an event handler to the "keypress" JavaScript event, or trigger that event on an element.
  4059. /// &#10;1 - keypress(handler(eventObject))
  4060. /// &#10;2 - keypress(eventData, handler(eventObject))
  4061. /// &#10;3 - keypress()
  4062. /// </summary>
  4063. /// <param name="data" type="Object">
  4064. /// A map of data that will be passed to the event handler.
  4065. /// </param>
  4066. /// <param name="fn" type="Function">
  4067. /// A function to execute each time the event is triggered.
  4068. /// </param>
  4069. /// <returns type="jQuery" />
  4070. return arguments.length > 0 ?
  4071. this.on( name, null, data, fn ) :
  4072. this.trigger( name );
  4073. };
  4074. jQuery.prototype.keyup = function( data, fn ) {
  4075. /// <summary>
  4076. /// Bind an event handler to the "keyup" JavaScript event, or trigger that event on an element.
  4077. /// &#10;1 - keyup(handler(eventObject))
  4078. /// &#10;2 - keyup(eventData, handler(eventObject))
  4079. /// &#10;3 - keyup()
  4080. /// </summary>
  4081. /// <param name="data" type="Object">
  4082. /// A map of data that will be passed to the event handler.
  4083. /// </param>
  4084. /// <param name="fn" type="Function">
  4085. /// A function to execute each time the event is triggered.
  4086. /// </param>
  4087. /// <returns type="jQuery" />
  4088. return arguments.length > 0 ?
  4089. this.on( name, null, data, fn ) :
  4090. this.trigger( name );
  4091. };
  4092. jQuery.prototype.last = function() {
  4093. /// <summary>
  4094. /// Reduce the set of matched elements to the final one in the set.
  4095. /// </summary>
  4096. /// <returns type="jQuery" />
  4097. return this.eq( -1 );
  4098. };
  4099. jQuery.prototype.length = 0;
  4100. jQuery.prototype.load = function( url, params, callback ) {
  4101. /// <summary>
  4102. /// 1: Bind an event handler to the "load" JavaScript event.
  4103. /// &#10; 1.1 - load(handler(eventObject))
  4104. /// &#10; 1.2 - load(eventData, handler(eventObject))
  4105. /// &#10;2: Load data from the server and place the returned HTML into the matched element.
  4106. /// &#10; 2.1 - load(url, data, complete(responseText, textStatus, XMLHttpRequest))
  4107. /// </summary>
  4108. /// <param name="url" type="String">
  4109. /// A string containing the URL to which the request is sent.
  4110. /// </param>
  4111. /// <param name="params" type="String">
  4112. /// A map or string that is sent to the server with the request.
  4113. /// </param>
  4114. /// <param name="callback" type="Function">
  4115. /// A callback function that is executed when the request completes.
  4116. /// </param>
  4117. /// <returns type="jQuery" />
  4118. if ( typeof url !== "string" && _load ) {
  4119. return _load.apply( this, arguments );
  4120. }
  4121. var selector, response, type,
  4122. self = this,
  4123. off = url.indexOf(" ");
  4124. if ( off >= 0 ) {
  4125. selector = url.slice( off, url.length );
  4126. url = url.slice( 0, off );
  4127. }
  4128. // If it's a function
  4129. if ( jQuery.isFunction( params ) ) {
  4130. // We assume that it's the callback
  4131. callback = params;
  4132. params = undefined;
  4133. // Otherwise, build a param string
  4134. } else if ( params && typeof params === "object" ) {
  4135. type = "POST";
  4136. }
  4137. // If we have elements to modify, make the request
  4138. if ( self.length > 0 ) {
  4139. jQuery.ajax({
  4140. url: url,
  4141. // if "type" variable is undefined, then "GET" method will be used
  4142. type: type,
  4143. dataType: "html",
  4144. data: params
  4145. }).done(function( responseText ) {
  4146. // Save response for use in complete callback
  4147. response = arguments;
  4148. self.html( selector ?
  4149. // If a selector was specified, locate the right elements in a dummy div
  4150. // Exclude scripts to avoid IE 'Permission Denied' errors
  4151. jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
  4152. // Otherwise use the full result
  4153. responseText );
  4154. }).complete( callback && function( jqXHR, status ) {
  4155. self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
  4156. });
  4157. }
  4158. return this;
  4159. };
  4160. jQuery.prototype.map = function( callback ) {
  4161. /// <summary>
  4162. /// Pass each element in the current matched set through a function, producing a new jQuery object containing the return values.
  4163. /// </summary>
  4164. /// <param name="callback" type="Function">
  4165. /// A function object that will be invoked for each element in the current set.
  4166. /// </param>
  4167. /// <returns type="jQuery" />
  4168. return this.pushStack( jQuery.map(this, function( elem, i ) {
  4169. return callback.call( elem, i, elem );
  4170. }));
  4171. };
  4172. jQuery.prototype.mousedown = function( data, fn ) {
  4173. /// <summary>
  4174. /// Bind an event handler to the "mousedown" JavaScript event, or trigger that event on an element.
  4175. /// &#10;1 - mousedown(handler(eventObject))
  4176. /// &#10;2 - mousedown(eventData, handler(eventObject))
  4177. /// &#10;3 - mousedown()
  4178. /// </summary>
  4179. /// <param name="data" type="Object">
  4180. /// A map of data that will be passed to the event handler.
  4181. /// </param>
  4182. /// <param name="fn" type="Function">
  4183. /// A function to execute each time the event is triggered.
  4184. /// </param>
  4185. /// <returns type="jQuery" />
  4186. return arguments.length > 0 ?
  4187. this.on( name, null, data, fn ) :
  4188. this.trigger( name );
  4189. };
  4190. jQuery.prototype.mouseenter = function( data, fn ) {
  4191. /// <summary>
  4192. /// Bind an event handler to be fired when the mouse enters an element, or trigger that handler on an element.
  4193. /// &#10;1 - mouseenter(handler(eventObject))
  4194. /// &#10;2 - mouseenter(eventData, handler(eventObject))
  4195. /// &#10;3 - mouseenter()
  4196. /// </summary>
  4197. /// <param name="data" type="Object">
  4198. /// A map of data that will be passed to the event handler.
  4199. /// </param>
  4200. /// <param name="fn" type="Function">
  4201. /// A function to execute each time the event is triggered.
  4202. /// </param>
  4203. /// <returns type="jQuery" />
  4204. return arguments.length > 0 ?
  4205. this.on( name, null, data, fn ) :
  4206. this.trigger( name );
  4207. };
  4208. jQuery.prototype.mouseleave = function( data, fn ) {
  4209. /// <summary>
  4210. /// Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element.
  4211. /// &#10;1 - mouseleave(handler(eventObject))
  4212. /// &#10;2 - mouseleave(eventData, handler(eventObject))
  4213. /// &#10;3 - mouseleave()
  4214. /// </summary>
  4215. /// <param name="data" type="Object">
  4216. /// A map of data that will be passed to the event handler.
  4217. /// </param>
  4218. /// <param name="fn" type="Function">
  4219. /// A function to execute each time the event is triggered.
  4220. /// </param>
  4221. /// <returns type="jQuery" />
  4222. return arguments.length > 0 ?
  4223. this.on( name, null, data, fn ) :
  4224. this.trigger( name );
  4225. };
  4226. jQuery.prototype.mousemove = function( data, fn ) {
  4227. /// <summary>
  4228. /// Bind an event handler to the "mousemove" JavaScript event, or trigger that event on an element.
  4229. /// &#10;1 - mousemove(handler(eventObject))
  4230. /// &#10;2 - mousemove(eventData, handler(eventObject))
  4231. /// &#10;3 - mousemove()
  4232. /// </summary>
  4233. /// <param name="data" type="Object">
  4234. /// A map of data that will be passed to the event handler.
  4235. /// </param>
  4236. /// <param name="fn" type="Function">
  4237. /// A function to execute each time the event is triggered.
  4238. /// </param>
  4239. /// <returns type="jQuery" />
  4240. return arguments.length > 0 ?
  4241. this.on( name, null, data, fn ) :
  4242. this.trigger( name );
  4243. };
  4244. jQuery.prototype.mouseout = function( data, fn ) {
  4245. /// <summary>
  4246. /// Bind an event handler to the "mouseout" JavaScript event, or trigger that event on an element.
  4247. /// &#10;1 - mouseout(handler(eventObject))
  4248. /// &#10;2 - mouseout(eventData, handler(eventObject))
  4249. /// &#10;3 - mouseout()
  4250. /// </summary>
  4251. /// <param name="data" type="Object">
  4252. /// A map of data that will be passed to the event handler.
  4253. /// </param>
  4254. /// <param name="fn" type="Function">
  4255. /// A function to execute each time the event is triggered.
  4256. /// </param>
  4257. /// <returns type="jQuery" />
  4258. return arguments.length > 0 ?
  4259. this.on( name, null, data, fn ) :
  4260. this.trigger( name );
  4261. };
  4262. jQuery.prototype.mouseover = function( data, fn ) {
  4263. /// <summary>
  4264. /// Bind an event handler to the "mouseover" JavaScript event, or trigger that event on an element.
  4265. /// &#10;1 - mouseover(handler(eventObject))
  4266. /// &#10;2 - mouseover(eventData, handler(eventObject))
  4267. /// &#10;3 - mouseover()
  4268. /// </summary>
  4269. /// <param name="data" type="Object">
  4270. /// A map of data that will be passed to the event handler.
  4271. /// </param>
  4272. /// <param name="fn" type="Function">
  4273. /// A function to execute each time the event is triggered.
  4274. /// </param>
  4275. /// <returns type="jQuery" />
  4276. return arguments.length > 0 ?
  4277. this.on( name, null, data, fn ) :
  4278. this.trigger( name );
  4279. };
  4280. jQuery.prototype.mouseup = function( data, fn ) {
  4281. /// <summary>
  4282. /// Bind an event handler to the "mouseup" JavaScript event, or trigger that event on an element.
  4283. /// &#10;1 - mouseup(handler(eventObject))
  4284. /// &#10;2 - mouseup(eventData, handler(eventObject))
  4285. /// &#10;3 - mouseup()
  4286. /// </summary>
  4287. /// <param name="data" type="Object">
  4288. /// A map of data that will be passed to the event handler.
  4289. /// </param>
  4290. /// <param name="fn" type="Function">
  4291. /// A function to execute each time the event is triggered.
  4292. /// </param>
  4293. /// <returns type="jQuery" />
  4294. return arguments.length > 0 ?
  4295. this.on( name, null, data, fn ) :
  4296. this.trigger( name );
  4297. };
  4298. jQuery.prototype.next = function( until, selector ) {
  4299. /// <summary>
  4300. /// Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.
  4301. /// </summary>
  4302. /// <param name="until" type="String">
  4303. /// A string containing a selector expression to match elements against.
  4304. /// </param>
  4305. /// <returns type="jQuery" />
  4306. var ret = jQuery.map( this, fn, until );
  4307. if ( name.slice( -5 ) !== "Until" ) {
  4308. selector = until;
  4309. }
  4310. if ( selector && typeof selector === "string" ) {
  4311. ret = jQuery.filter( selector, ret );
  4312. }
  4313. if ( this.length > 1 ) {
  4314. // Remove duplicates
  4315. if ( !guaranteedUnique[ name ] ) {
  4316. ret = jQuery.unique( ret );
  4317. }
  4318. // Reverse order for parents* and prev-derivatives
  4319. if ( rparentsprev.test( name ) ) {
  4320. ret = ret.reverse();
  4321. }
  4322. }
  4323. return this.pushStack( ret );
  4324. };
  4325. jQuery.prototype.nextAll = function( until, selector ) {
  4326. /// <summary>
  4327. /// Get all following siblings of each element in the set of matched elements, optionally filtered by a selector.
  4328. /// </summary>
  4329. /// <param name="until" type="String">
  4330. /// A string containing a selector expression to match elements against.
  4331. /// </param>
  4332. /// <returns type="jQuery" />
  4333. var ret = jQuery.map( this, fn, until );
  4334. if ( name.slice( -5 ) !== "Until" ) {
  4335. selector = until;
  4336. }
  4337. if ( selector && typeof selector === "string" ) {
  4338. ret = jQuery.filter( selector, ret );
  4339. }
  4340. if ( this.length > 1 ) {
  4341. // Remove duplicates
  4342. if ( !guaranteedUnique[ name ] ) {
  4343. ret = jQuery.unique( ret );
  4344. }
  4345. // Reverse order for parents* and prev-derivatives
  4346. if ( rparentsprev.test( name ) ) {
  4347. ret = ret.reverse();
  4348. }
  4349. }
  4350. return this.pushStack( ret );
  4351. };
  4352. jQuery.prototype.nextUntil = function( until, selector ) {
  4353. /// <summary>
  4354. /// Get all following siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object passed.
  4355. /// &#10;1 - nextUntil(selector, filter)
  4356. /// &#10;2 - nextUntil(element, filter)
  4357. /// </summary>
  4358. /// <param name="until" type="String">
  4359. /// A string containing a selector expression to indicate where to stop matching following sibling elements.
  4360. /// </param>
  4361. /// <param name="selector" type="String">
  4362. /// A string containing a selector expression to match elements against.
  4363. /// </param>
  4364. /// <returns type="jQuery" />
  4365. var ret = jQuery.map( this, fn, until );
  4366. if ( name.slice( -5 ) !== "Until" ) {
  4367. selector = until;
  4368. }
  4369. if ( selector && typeof selector === "string" ) {
  4370. ret = jQuery.filter( selector, ret );
  4371. }
  4372. if ( this.length > 1 ) {
  4373. // Remove duplicates
  4374. if ( !guaranteedUnique[ name ] ) {
  4375. ret = jQuery.unique( ret );
  4376. }
  4377. // Reverse order for parents* and prev-derivatives
  4378. if ( rparentsprev.test( name ) ) {
  4379. ret = ret.reverse();
  4380. }
  4381. }
  4382. return this.pushStack( ret );
  4383. };
  4384. jQuery.prototype.not = function( selector ) {
  4385. /// <summary>
  4386. /// Remove elements from the set of matched elements.
  4387. /// &#10;1 - not(selector)
  4388. /// &#10;2 - not(elements)
  4389. /// &#10;3 - not(function(index))
  4390. /// &#10;4 - not(jQuery object)
  4391. /// </summary>
  4392. /// <param name="selector" type="String">
  4393. /// A string containing a selector expression to match elements against.
  4394. /// </param>
  4395. /// <returns type="jQuery" />
  4396. return this.pushStack( winnow(this, selector || [], true) );
  4397. };
  4398. jQuery.prototype.off = function( types, selector, fn ) {
  4399. /// <summary>
  4400. /// Remove an event handler.
  4401. /// &#10;1 - off(events, selector, handler(eventObject))
  4402. /// &#10;2 - off(events-map, selector)
  4403. /// </summary>
  4404. /// <param name="types" type="String">
  4405. /// One or more space-separated event types and optional namespaces, or just namespaces, such as "click", "keydown.myPlugin", or ".myPlugin".
  4406. /// </param>
  4407. /// <param name="selector" type="String">
  4408. /// A selector which should match the one originally passed to .on() when attaching event handlers.
  4409. /// </param>
  4410. /// <param name="fn" type="Function">
  4411. /// A handler function previously attached for the event(s), or the special value false.
  4412. /// </param>
  4413. /// <returns type="jQuery" />
  4414. var handleObj, type;
  4415. if ( types && types.preventDefault && types.handleObj ) {
  4416. // ( event ) dispatched jQuery.Event
  4417. handleObj = types.handleObj;
  4418. jQuery( types.delegateTarget ).off(
  4419. handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
  4420. handleObj.selector,
  4421. handleObj.handler
  4422. );
  4423. return this;
  4424. }
  4425. if ( typeof types === "object" ) {
  4426. // ( types-object [, selector] )
  4427. for ( type in types ) {
  4428. this.off( type, selector, types[ type ] );
  4429. }
  4430. return this;
  4431. }
  4432. if ( selector === false || typeof selector === "function" ) {
  4433. // ( types [, fn] )
  4434. fn = selector;
  4435. selector = undefined;
  4436. }
  4437. if ( fn === false ) {
  4438. fn = returnFalse;
  4439. }
  4440. return this.each(function() {
  4441. jQuery.event.remove( this, types, fn, selector );
  4442. });
  4443. };
  4444. jQuery.prototype.offset = function( options ) {
  4445. /// <summary>
  4446. /// 1: Get the current coordinates of the first element in the set of matched elements, relative to the document.
  4447. /// &#10; 1.1 - offset()
  4448. /// &#10;2: Set the current coordinates of every element in the set of matched elements, relative to the document.
  4449. /// &#10; 2.1 - offset(coordinates)
  4450. /// &#10; 2.2 - offset(function(index, coords))
  4451. /// </summary>
  4452. /// <param name="options" type="Object">
  4453. /// An object containing the properties top and left, which are integers indicating the new top and left coordinates for the elements.
  4454. /// </param>
  4455. /// <returns type="jQuery" />
  4456. if ( arguments.length ) {
  4457. return options === undefined ?
  4458. this :
  4459. this.each(function( i ) {
  4460. jQuery.offset.setOffset( this, options, i );
  4461. });
  4462. }
  4463. var docElem, win,
  4464. box = { top: 0, left: 0 },
  4465. elem = this[ 0 ],
  4466. doc = elem && elem.ownerDocument;
  4467. if ( !doc ) {
  4468. return;
  4469. }
  4470. docElem = doc.documentElement;
  4471. // Make sure it's not a disconnected DOM node
  4472. if ( !jQuery.contains( docElem, elem ) ) {
  4473. return box;
  4474. }
  4475. // If we don't have gBCR, just use 0,0 rather than error
  4476. // BlackBerry 5, iOS 3 (original iPhone)
  4477. if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
  4478. box = elem.getBoundingClientRect();
  4479. }
  4480. win = getWindow( doc );
  4481. return {
  4482. top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
  4483. left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
  4484. };
  4485. };
  4486. jQuery.prototype.offsetParent = function() {
  4487. /// <summary>
  4488. /// Get the closest ancestor element that is positioned.
  4489. /// </summary>
  4490. /// <returns type="jQuery" />
  4491. return this.map(function() {
  4492. var offsetParent = this.offsetParent || docElem;
  4493. while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
  4494. offsetParent = offsetParent.offsetParent;
  4495. }
  4496. return offsetParent || docElem;
  4497. });
  4498. };
  4499. jQuery.prototype.on = function( types, selector, data, fn, /*INTERNAL*/ one ) {
  4500. /// <summary>
  4501. /// Attach an event handler function for one or more events to the selected elements.
  4502. /// &#10;1 - on(events, selector, data, handler(eventObject))
  4503. /// &#10;2 - on(events-map, selector, data)
  4504. /// </summary>
  4505. /// <param name="types" type="String">
  4506. /// One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
  4507. /// </param>
  4508. /// <param name="selector" type="String">
  4509. /// A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
  4510. /// </param>
  4511. /// <param name="data" type="Anything">
  4512. /// Data to be passed to the handler in event.data when an event is triggered.
  4513. /// </param>
  4514. /// <param name="fn" type="Function">
  4515. /// A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
  4516. /// </param>
  4517. /// <returns type="jQuery" />
  4518. var type, origFn;
  4519. // Types can be a map of types/handlers
  4520. if ( typeof types === "object" ) {
  4521. // ( types-Object, selector, data )
  4522. if ( typeof selector !== "string" ) {
  4523. // ( types-Object, data )
  4524. data = data || selector;
  4525. selector = undefined;
  4526. }
  4527. for ( type in types ) {
  4528. this.on( type, selector, data, types[ type ], one );
  4529. }
  4530. return this;
  4531. }
  4532. if ( data == null && fn == null ) {
  4533. // ( types, fn )
  4534. fn = selector;
  4535. data = selector = undefined;
  4536. } else if ( fn == null ) {
  4537. if ( typeof selector === "string" ) {
  4538. // ( types, selector, fn )
  4539. fn = data;
  4540. data = undefined;
  4541. } else {
  4542. // ( types, data, fn )
  4543. fn = data;
  4544. data = selector;
  4545. selector = undefined;
  4546. }
  4547. }
  4548. if ( fn === false ) {
  4549. fn = returnFalse;
  4550. } else if ( !fn ) {
  4551. return this;
  4552. }
  4553. if ( one === 1 ) {
  4554. origFn = fn;
  4555. fn = function( event ) {
  4556. // Can use an empty set, since event contains the info
  4557. jQuery().off( event );
  4558. return origFn.apply( this, arguments );
  4559. };
  4560. // Use same guid so caller can remove using origFn
  4561. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  4562. }
  4563. return this.each( function() {
  4564. jQuery.event.add( this, types, fn, data, selector );
  4565. });
  4566. };
  4567. jQuery.prototype.one = function( types, selector, data, fn ) {
  4568. /// <summary>
  4569. /// Attach a handler to an event for the elements. The handler is executed at most once per element.
  4570. /// &#10;1 - one(events, data, handler(eventObject))
  4571. /// &#10;2 - one(events, selector, data, handler(eventObject))
  4572. /// &#10;3 - one(events-map, selector, data)
  4573. /// </summary>
  4574. /// <param name="types" type="String">
  4575. /// One or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
  4576. /// </param>
  4577. /// <param name="selector" type="String">
  4578. /// A selector string to filter the descendants of the selected elements that trigger the event. If the selector is null or omitted, the event is always triggered when it reaches the selected element.
  4579. /// </param>
  4580. /// <param name="data" type="Anything">
  4581. /// Data to be passed to the handler in event.data when an event is triggered.
  4582. /// </param>
  4583. /// <param name="fn" type="Function">
  4584. /// A function to execute when the event is triggered. The value false is also allowed as a shorthand for a function that simply does return false.
  4585. /// </param>
  4586. /// <returns type="jQuery" />
  4587. return this.on( types, selector, data, fn, 1 );
  4588. };
  4589. jQuery.prototype.outerHeight = function( margin, value ) {
  4590. /// <summary>
  4591. /// Get the current computed height for the first element in the set of matched elements, including padding, border, and optionally margin. Returns an integer (without "px") representation of the value or null if called on an empty set of elements.
  4592. /// </summary>
  4593. /// <param name="margin" type="Boolean">
  4594. /// A Boolean indicating whether to include the element's margin in the calculation.
  4595. /// </param>
  4596. /// <returns type="Number" />
  4597. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  4598. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  4599. return jQuery.access( this, function( elem, type, value ) {
  4600. var doc;
  4601. if ( jQuery.isWindow( elem ) ) {
  4602. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  4603. // isn't a whole lot we can do. See pull request at this URL for discussion:
  4604. // https://github.com/jquery/jquery/pull/764
  4605. return elem.document.documentElement[ "client" + name ];
  4606. }
  4607. // Get document width or height
  4608. if ( elem.nodeType === 9 ) {
  4609. doc = elem.documentElement;
  4610. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  4611. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  4612. return Math.max(
  4613. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  4614. elem.body[ "offset" + name ], doc[ "offset" + name ],
  4615. doc[ "client" + name ]
  4616. );
  4617. }
  4618. return value === undefined ?
  4619. // Get width or height on the element, requesting but not forcing parseFloat
  4620. jQuery.css( elem, type, extra ) :
  4621. // Set width or height on the element
  4622. jQuery.style( elem, type, value, extra );
  4623. }, type, chainable ? margin : undefined, chainable, null );
  4624. };
  4625. jQuery.prototype.outerWidth = function( margin, value ) {
  4626. /// <summary>
  4627. /// Get the current computed width for the first element in the set of matched elements, including padding and border.
  4628. /// </summary>
  4629. /// <param name="margin" type="Boolean">
  4630. /// A Boolean indicating whether to include the element's margin in the calculation.
  4631. /// </param>
  4632. /// <returns type="Number" />
  4633. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  4634. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  4635. return jQuery.access( this, function( elem, type, value ) {
  4636. var doc;
  4637. if ( jQuery.isWindow( elem ) ) {
  4638. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  4639. // isn't a whole lot we can do. See pull request at this URL for discussion:
  4640. // https://github.com/jquery/jquery/pull/764
  4641. return elem.document.documentElement[ "client" + name ];
  4642. }
  4643. // Get document width or height
  4644. if ( elem.nodeType === 9 ) {
  4645. doc = elem.documentElement;
  4646. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  4647. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  4648. return Math.max(
  4649. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  4650. elem.body[ "offset" + name ], doc[ "offset" + name ],
  4651. doc[ "client" + name ]
  4652. );
  4653. }
  4654. return value === undefined ?
  4655. // Get width or height on the element, requesting but not forcing parseFloat
  4656. jQuery.css( elem, type, extra ) :
  4657. // Set width or height on the element
  4658. jQuery.style( elem, type, value, extra );
  4659. }, type, chainable ? margin : undefined, chainable, null );
  4660. };
  4661. jQuery.prototype.parent = function( until, selector ) {
  4662. /// <summary>
  4663. /// Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
  4664. /// </summary>
  4665. /// <param name="until" type="String">
  4666. /// A string containing a selector expression to match elements against.
  4667. /// </param>
  4668. /// <returns type="jQuery" />
  4669. var ret = jQuery.map( this, fn, until );
  4670. if ( name.slice( -5 ) !== "Until" ) {
  4671. selector = until;
  4672. }
  4673. if ( selector && typeof selector === "string" ) {
  4674. ret = jQuery.filter( selector, ret );
  4675. }
  4676. if ( this.length > 1 ) {
  4677. // Remove duplicates
  4678. if ( !guaranteedUnique[ name ] ) {
  4679. ret = jQuery.unique( ret );
  4680. }
  4681. // Reverse order for parents* and prev-derivatives
  4682. if ( rparentsprev.test( name ) ) {
  4683. ret = ret.reverse();
  4684. }
  4685. }
  4686. return this.pushStack( ret );
  4687. };
  4688. jQuery.prototype.parents = function( until, selector ) {
  4689. /// <summary>
  4690. /// Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.
  4691. /// </summary>
  4692. /// <param name="until" type="String">
  4693. /// A string containing a selector expression to match elements against.
  4694. /// </param>
  4695. /// <returns type="jQuery" />
  4696. var ret = jQuery.map( this, fn, until );
  4697. if ( name.slice( -5 ) !== "Until" ) {
  4698. selector = until;
  4699. }
  4700. if ( selector && typeof selector === "string" ) {
  4701. ret = jQuery.filter( selector, ret );
  4702. }
  4703. if ( this.length > 1 ) {
  4704. // Remove duplicates
  4705. if ( !guaranteedUnique[ name ] ) {
  4706. ret = jQuery.unique( ret );
  4707. }
  4708. // Reverse order for parents* and prev-derivatives
  4709. if ( rparentsprev.test( name ) ) {
  4710. ret = ret.reverse();
  4711. }
  4712. }
  4713. return this.pushStack( ret );
  4714. };
  4715. jQuery.prototype.parentsUntil = function( until, selector ) {
  4716. /// <summary>
  4717. /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or jQuery object.
  4718. /// &#10;1 - parentsUntil(selector, filter)
  4719. /// &#10;2 - parentsUntil(element, filter)
  4720. /// </summary>
  4721. /// <param name="until" type="String">
  4722. /// A string containing a selector expression to indicate where to stop matching ancestor elements.
  4723. /// </param>
  4724. /// <param name="selector" type="String">
  4725. /// A string containing a selector expression to match elements against.
  4726. /// </param>
  4727. /// <returns type="jQuery" />
  4728. var ret = jQuery.map( this, fn, until );
  4729. if ( name.slice( -5 ) !== "Until" ) {
  4730. selector = until;
  4731. }
  4732. if ( selector && typeof selector === "string" ) {
  4733. ret = jQuery.filter( selector, ret );
  4734. }
  4735. if ( this.length > 1 ) {
  4736. // Remove duplicates
  4737. if ( !guaranteedUnique[ name ] ) {
  4738. ret = jQuery.unique( ret );
  4739. }
  4740. // Reverse order for parents* and prev-derivatives
  4741. if ( rparentsprev.test( name ) ) {
  4742. ret = ret.reverse();
  4743. }
  4744. }
  4745. return this.pushStack( ret );
  4746. };
  4747. jQuery.prototype.position = function() {
  4748. /// <summary>
  4749. /// Get the current coordinates of the first element in the set of matched elements, relative to the offset parent.
  4750. /// </summary>
  4751. /// <returns type="Object" />
  4752. if ( !this[ 0 ] ) {
  4753. return;
  4754. }
  4755. var offsetParent, offset,
  4756. parentOffset = { top: 0, left: 0 },
  4757. elem = this[ 0 ];
  4758. // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
  4759. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  4760. // we assume that getBoundingClientRect is available when computed position is fixed
  4761. offset = elem.getBoundingClientRect();
  4762. } else {
  4763. // Get *real* offsetParent
  4764. offsetParent = this.offsetParent();
  4765. // Get correct offsets
  4766. offset = this.offset();
  4767. if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
  4768. parentOffset = offsetParent.offset();
  4769. }
  4770. // Add offsetParent borders
  4771. parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
  4772. parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
  4773. }
  4774. // Subtract parent offsets and element margins
  4775. // note: when an element has margin: auto the offsetLeft and marginLeft
  4776. // are the same in Safari causing offset.left to incorrectly be 0
  4777. return {
  4778. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  4779. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
  4780. };
  4781. };
  4782. jQuery.prototype.prepend = function() {
  4783. /// <summary>
  4784. /// Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
  4785. /// &#10;1 - prepend(content, content)
  4786. /// &#10;2 - prepend(function(index, html))
  4787. /// </summary>
  4788. /// <param name="" type="jQuery">
  4789. /// DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
  4790. /// </param>
  4791. /// <param name="" type="jQuery">
  4792. /// One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
  4793. /// </param>
  4794. /// <returns type="jQuery" />
  4795. return this.domManip( arguments, function( elem ) {
  4796. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4797. var target = manipulationTarget( this, elem );
  4798. target.insertBefore( elem, target.firstChild );
  4799. }
  4800. });
  4801. };
  4802. jQuery.prototype.prependTo = function( selector ) {
  4803. /// <summary>
  4804. /// Insert every element in the set of matched elements to the beginning of the target.
  4805. /// </summary>
  4806. /// <param name="selector" type="jQuery">
  4807. /// A selector, element, HTML string, or jQuery object; the matched set of elements will be inserted at the beginning of the element(s) specified by this parameter.
  4808. /// </param>
  4809. /// <returns type="jQuery" />
  4810. var elems,
  4811. i = 0,
  4812. ret = [],
  4813. insert = jQuery( selector ),
  4814. last = insert.length - 1;
  4815. for ( ; i <= last; i++ ) {
  4816. elems = i === last ? this : this.clone(true);
  4817. jQuery( insert[i] )[ original ]( elems );
  4818. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  4819. core_push.apply( ret, elems.get() );
  4820. }
  4821. return this.pushStack( ret );
  4822. };
  4823. jQuery.prototype.prev = function( until, selector ) {
  4824. /// <summary>
  4825. /// Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.
  4826. /// </summary>
  4827. /// <param name="until" type="String">
  4828. /// A string containing a selector expression to match elements against.
  4829. /// </param>
  4830. /// <returns type="jQuery" />
  4831. var ret = jQuery.map( this, fn, until );
  4832. if ( name.slice( -5 ) !== "Until" ) {
  4833. selector = until;
  4834. }
  4835. if ( selector && typeof selector === "string" ) {
  4836. ret = jQuery.filter( selector, ret );
  4837. }
  4838. if ( this.length > 1 ) {
  4839. // Remove duplicates
  4840. if ( !guaranteedUnique[ name ] ) {
  4841. ret = jQuery.unique( ret );
  4842. }
  4843. // Reverse order for parents* and prev-derivatives
  4844. if ( rparentsprev.test( name ) ) {
  4845. ret = ret.reverse();
  4846. }
  4847. }
  4848. return this.pushStack( ret );
  4849. };
  4850. jQuery.prototype.prevAll = function( until, selector ) {
  4851. /// <summary>
  4852. /// Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.
  4853. /// </summary>
  4854. /// <param name="until" type="String">
  4855. /// A string containing a selector expression to match elements against.
  4856. /// </param>
  4857. /// <returns type="jQuery" />
  4858. var ret = jQuery.map( this, fn, until );
  4859. if ( name.slice( -5 ) !== "Until" ) {
  4860. selector = until;
  4861. }
  4862. if ( selector && typeof selector === "string" ) {
  4863. ret = jQuery.filter( selector, ret );
  4864. }
  4865. if ( this.length > 1 ) {
  4866. // Remove duplicates
  4867. if ( !guaranteedUnique[ name ] ) {
  4868. ret = jQuery.unique( ret );
  4869. }
  4870. // Reverse order for parents* and prev-derivatives
  4871. if ( rparentsprev.test( name ) ) {
  4872. ret = ret.reverse();
  4873. }
  4874. }
  4875. return this.pushStack( ret );
  4876. };
  4877. jQuery.prototype.prevUntil = function( until, selector ) {
  4878. /// <summary>
  4879. /// Get all preceding siblings of each element up to but not including the element matched by the selector, DOM node, or jQuery object.
  4880. /// &#10;1 - prevUntil(selector, filter)
  4881. /// &#10;2 - prevUntil(element, filter)
  4882. /// </summary>
  4883. /// <param name="until" type="String">
  4884. /// A string containing a selector expression to indicate where to stop matching preceding sibling elements.
  4885. /// </param>
  4886. /// <param name="selector" type="String">
  4887. /// A string containing a selector expression to match elements against.
  4888. /// </param>
  4889. /// <returns type="jQuery" />
  4890. var ret = jQuery.map( this, fn, until );
  4891. if ( name.slice( -5 ) !== "Until" ) {
  4892. selector = until;
  4893. }
  4894. if ( selector && typeof selector === "string" ) {
  4895. ret = jQuery.filter( selector, ret );
  4896. }
  4897. if ( this.length > 1 ) {
  4898. // Remove duplicates
  4899. if ( !guaranteedUnique[ name ] ) {
  4900. ret = jQuery.unique( ret );
  4901. }
  4902. // Reverse order for parents* and prev-derivatives
  4903. if ( rparentsprev.test( name ) ) {
  4904. ret = ret.reverse();
  4905. }
  4906. }
  4907. return this.pushStack( ret );
  4908. };
  4909. jQuery.prototype.promise = function( type, obj ) {
  4910. /// <summary>
  4911. /// Return a Promise object to observe when all actions of a certain type bound to the collection, queued or not, have finished.
  4912. /// </summary>
  4913. /// <param name="type" type="String">
  4914. /// The type of queue that needs to be observed.
  4915. /// </param>
  4916. /// <param name="obj" type="Object">
  4917. /// Object onto which the promise methods have to be attached
  4918. /// </param>
  4919. /// <returns type="Promise" />
  4920. var tmp,
  4921. count = 1,
  4922. defer = jQuery.Deferred(),
  4923. elements = this,
  4924. i = this.length,
  4925. resolve = function() {
  4926. if ( !( --count ) ) {
  4927. defer.resolveWith( elements, [ elements ] );
  4928. }
  4929. };
  4930. if ( typeof type !== "string" ) {
  4931. obj = type;
  4932. type = undefined;
  4933. }
  4934. type = type || "fx";
  4935. while( i-- ) {
  4936. tmp = jQuery._data( elements[ i ], type + "queueHooks" );
  4937. if ( tmp && tmp.empty ) {
  4938. count++;
  4939. tmp.empty.add( resolve );
  4940. }
  4941. }
  4942. resolve();
  4943. return defer.promise( obj );
  4944. };
  4945. jQuery.prototype.prop = function( name, value ) {
  4946. /// <summary>
  4947. /// 1: Get the value of a property for the first element in the set of matched elements.
  4948. /// &#10; 1.1 - prop(propertyName)
  4949. /// &#10;2: Set one or more properties for the set of matched elements.
  4950. /// &#10; 2.1 - prop(propertyName, value)
  4951. /// &#10; 2.2 - prop(map)
  4952. /// &#10; 2.3 - prop(propertyName, function(index, oldPropertyValue))
  4953. /// </summary>
  4954. /// <param name="name" type="String">
  4955. /// The name of the property to set.
  4956. /// </param>
  4957. /// <param name="value" type="Boolean">
  4958. /// A value to set for the property.
  4959. /// </param>
  4960. /// <returns type="jQuery" />
  4961. return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
  4962. };
  4963. jQuery.prototype.pushStack = function( elems ) {
  4964. /// <summary>
  4965. /// Add a collection of DOM elements onto the jQuery stack.
  4966. /// &#10;1 - pushStack(elements)
  4967. /// &#10;2 - pushStack(elements, name, arguments)
  4968. /// </summary>
  4969. /// <param name="elems" type="Array">
  4970. /// An array of elements to push onto the stack and make into a new jQuery object.
  4971. /// </param>
  4972. /// <param name="" type="String">
  4973. /// The name of a jQuery method that generated the array of elements.
  4974. /// </param>
  4975. /// <param name="" type="Array">
  4976. /// The arguments that were passed in to the jQuery method (for serialization).
  4977. /// </param>
  4978. /// <returns type="jQuery" />
  4979. // Build a new jQuery matched element set
  4980. var ret = jQuery.merge( this.constructor(), elems );
  4981. // Add the old object onto the stack (as a reference)
  4982. ret.prevObject = this;
  4983. ret.context = this.context;
  4984. // Return the newly-formed element set
  4985. return ret;
  4986. };
  4987. jQuery.prototype.queue = function( type, data ) {
  4988. /// <summary>
  4989. /// 1: Show the queue of functions to be executed on the matched elements.
  4990. /// &#10; 1.1 - queue(queueName)
  4991. /// &#10;2: Manipulate the queue of functions to be executed on the matched elements.
  4992. /// &#10; 2.1 - queue(queueName, newQueue)
  4993. /// &#10; 2.2 - queue(queueName, callback( next ))
  4994. /// </summary>
  4995. /// <param name="type" type="String">
  4996. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  4997. /// </param>
  4998. /// <param name="data" type="Array">
  4999. /// An array of functions to replace the current queue contents.
  5000. /// </param>
  5001. /// <returns type="jQuery" />
  5002. var setter = 2;
  5003. if ( typeof type !== "string" ) {
  5004. data = type;
  5005. type = "fx";
  5006. setter--;
  5007. }
  5008. if ( arguments.length < setter ) {
  5009. return jQuery.queue( this[0], type );
  5010. }
  5011. return data === undefined ?
  5012. this :
  5013. this.each(function() {
  5014. var queue = jQuery.queue( this, type, data );
  5015. // ensure a hooks for this queue
  5016. jQuery._queueHooks( this, type );
  5017. if ( type === "fx" && queue[0] !== "inprogress" ) {
  5018. jQuery.dequeue( this, type );
  5019. }
  5020. });
  5021. };
  5022. jQuery.prototype.ready = function( fn ) {
  5023. /// <summary>
  5024. /// Specify a function to execute when the DOM is fully loaded.
  5025. /// </summary>
  5026. /// <param name="fn" type="Function">
  5027. /// A function to execute after the DOM is ready.
  5028. /// </param>
  5029. /// <returns type="jQuery" />
  5030. // Add the callback
  5031. jQuery.ready.promise().done( fn );
  5032. return this;
  5033. };
  5034. jQuery.prototype.remove = function( selector, keepData ) {
  5035. /// <summary>
  5036. /// Remove the set of matched elements from the DOM.
  5037. /// </summary>
  5038. /// <param name="selector" type="String">
  5039. /// A selector expression that filters the set of matched elements to be removed.
  5040. /// </param>
  5041. /// <returns type="jQuery" />
  5042. var elem,
  5043. elems = selector ? jQuery.filter( selector, this ) : this,
  5044. i = 0;
  5045. for ( ; (elem = elems[i]) != null; i++ ) {
  5046. if ( !keepData && elem.nodeType === 1 ) {
  5047. jQuery.cleanData( getAll( elem ) );
  5048. }
  5049. if ( elem.parentNode ) {
  5050. if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
  5051. setGlobalEval( getAll( elem, "script" ) );
  5052. }
  5053. elem.parentNode.removeChild( elem );
  5054. }
  5055. }
  5056. return this;
  5057. };
  5058. jQuery.prototype.removeAttr = function( name ) {
  5059. /// <summary>
  5060. /// Remove an attribute from each element in the set of matched elements.
  5061. /// </summary>
  5062. /// <param name="name" type="String">
  5063. /// An attribute to remove; as of version 1.7, it can be a space-separated list of attributes.
  5064. /// </param>
  5065. /// <returns type="jQuery" />
  5066. return this.each(function() {
  5067. jQuery.removeAttr( this, name );
  5068. });
  5069. };
  5070. jQuery.prototype.removeClass = function( value ) {
  5071. /// <summary>
  5072. /// Remove a single class, multiple classes, or all classes from each element in the set of matched elements.
  5073. /// &#10;1 - removeClass(className)
  5074. /// &#10;2 - removeClass(function(index, class))
  5075. /// </summary>
  5076. /// <param name="value" type="String">
  5077. /// One or more space-separated classes to be removed from the class attribute of each matched element.
  5078. /// </param>
  5079. /// <returns type="jQuery" />
  5080. var classes, elem, cur, clazz, j,
  5081. i = 0,
  5082. len = this.length,
  5083. proceed = arguments.length === 0 || typeof value === "string" && value;
  5084. if ( jQuery.isFunction( value ) ) {
  5085. return this.each(function( j ) {
  5086. jQuery( this ).removeClass( value.call( this, j, this.className ) );
  5087. });
  5088. }
  5089. if ( proceed ) {
  5090. classes = ( value || "" ).match( core_rnotwhite ) || [];
  5091. for ( ; i < len; i++ ) {
  5092. elem = this[ i ];
  5093. // This expression is here for better compressibility (see addClass)
  5094. cur = elem.nodeType === 1 && ( elem.className ?
  5095. ( " " + elem.className + " " ).replace( rclass, " " ) :
  5096. ""
  5097. );
  5098. if ( cur ) {
  5099. j = 0;
  5100. while ( (clazz = classes[j++]) ) {
  5101. // Remove *all* instances
  5102. while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
  5103. cur = cur.replace( " " + clazz + " ", " " );
  5104. }
  5105. }
  5106. elem.className = value ? jQuery.trim( cur ) : "";
  5107. }
  5108. }
  5109. }
  5110. return this;
  5111. };
  5112. jQuery.prototype.removeData = function( key ) {
  5113. /// <summary>
  5114. /// Remove a previously-stored piece of data.
  5115. /// &#10;1 - removeData(name)
  5116. /// &#10;2 - removeData(list)
  5117. /// </summary>
  5118. /// <param name="key" type="String">
  5119. /// A string naming the piece of data to delete.
  5120. /// </param>
  5121. /// <returns type="jQuery" />
  5122. return this.each(function() {
  5123. jQuery.removeData( this, key );
  5124. });
  5125. };
  5126. jQuery.prototype.removeProp = function( name ) {
  5127. /// <summary>
  5128. /// Remove a property for the set of matched elements.
  5129. /// </summary>
  5130. /// <param name="name" type="String">
  5131. /// The name of the property to set.
  5132. /// </param>
  5133. /// <returns type="jQuery" />
  5134. name = jQuery.propFix[ name ] || name;
  5135. return this.each(function() {
  5136. // try/catch handles cases where IE balks (such as removing a property on window)
  5137. try {
  5138. this[ name ] = undefined;
  5139. delete this[ name ];
  5140. } catch( e ) {}
  5141. });
  5142. };
  5143. jQuery.prototype.replaceAll = function( selector ) {
  5144. /// <summary>
  5145. /// Replace each target element with the set of matched elements.
  5146. /// </summary>
  5147. /// <param name="selector" type="String">
  5148. /// A selector expression indicating which element(s) to replace.
  5149. /// </param>
  5150. /// <returns type="jQuery" />
  5151. var elems,
  5152. i = 0,
  5153. ret = [],
  5154. insert = jQuery( selector ),
  5155. last = insert.length - 1;
  5156. for ( ; i <= last; i++ ) {
  5157. elems = i === last ? this : this.clone(true);
  5158. jQuery( insert[i] )[ original ]( elems );
  5159. // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
  5160. core_push.apply( ret, elems.get() );
  5161. }
  5162. return this.pushStack( ret );
  5163. };
  5164. jQuery.prototype.replaceWith = function() {
  5165. /// <summary>
  5166. /// Replace each element in the set of matched elements with the provided new content.
  5167. /// &#10;1 - replaceWith(newContent)
  5168. /// &#10;2 - replaceWith(function)
  5169. /// </summary>
  5170. /// <param name="" type="jQuery">
  5171. /// The content to insert. May be an HTML string, DOM element, or jQuery object.
  5172. /// </param>
  5173. /// <returns type="jQuery" />
  5174. var
  5175. // Snapshot the DOM in case .domManip sweeps something relevant into its fragment
  5176. args = jQuery.map( this, function( elem ) {
  5177. return [ elem.nextSibling, elem.parentNode ];
  5178. }),
  5179. i = 0;
  5180. // Make the changes, replacing each context element with the new content
  5181. this.domManip( arguments, function( elem ) {
  5182. var next = args[ i++ ],
  5183. parent = args[ i++ ];
  5184. if ( parent ) {
  5185. // Don't use the snapshot next if it has moved (#13810)
  5186. if ( next && next.parentNode !== parent ) {
  5187. next = this.nextSibling;
  5188. }
  5189. jQuery( this ).remove();
  5190. parent.insertBefore( elem, next );
  5191. }
  5192. // Allow new content to include elements from the context set
  5193. }, true );
  5194. // Force removal if there was no new content (e.g., from empty arguments)
  5195. return i ? this : this.remove();
  5196. };
  5197. jQuery.prototype.resize = function( data, fn ) {
  5198. /// <summary>
  5199. /// Bind an event handler to the "resize" JavaScript event, or trigger that event on an element.
  5200. /// &#10;1 - resize(handler(eventObject))
  5201. /// &#10;2 - resize(eventData, handler(eventObject))
  5202. /// &#10;3 - resize()
  5203. /// </summary>
  5204. /// <param name="data" type="Object">
  5205. /// A map of data that will be passed to the event handler.
  5206. /// </param>
  5207. /// <param name="fn" type="Function">
  5208. /// A function to execute each time the event is triggered.
  5209. /// </param>
  5210. /// <returns type="jQuery" />
  5211. return arguments.length > 0 ?
  5212. this.on( name, null, data, fn ) :
  5213. this.trigger( name );
  5214. };
  5215. jQuery.prototype.scroll = function( data, fn ) {
  5216. /// <summary>
  5217. /// Bind an event handler to the "scroll" JavaScript event, or trigger that event on an element.
  5218. /// &#10;1 - scroll(handler(eventObject))
  5219. /// &#10;2 - scroll(eventData, handler(eventObject))
  5220. /// &#10;3 - scroll()
  5221. /// </summary>
  5222. /// <param name="data" type="Object">
  5223. /// A map of data that will be passed to the event handler.
  5224. /// </param>
  5225. /// <param name="fn" type="Function">
  5226. /// A function to execute each time the event is triggered.
  5227. /// </param>
  5228. /// <returns type="jQuery" />
  5229. return arguments.length > 0 ?
  5230. this.on( name, null, data, fn ) :
  5231. this.trigger( name );
  5232. };
  5233. jQuery.prototype.scrollLeft = function( val ) {
  5234. /// <summary>
  5235. /// 1: Get the current horizontal position of the scroll bar for the first element in the set of matched elements.
  5236. /// &#10; 1.1 - scrollLeft()
  5237. /// &#10;2: Set the current horizontal position of the scroll bar for each of the set of matched elements.
  5238. /// &#10; 2.1 - scrollLeft(value)
  5239. /// </summary>
  5240. /// <param name="val" type="Number">
  5241. /// An integer indicating the new position to set the scroll bar to.
  5242. /// </param>
  5243. /// <returns type="jQuery" />
  5244. return jQuery.access( this, function( elem, method, val ) {
  5245. var win = getWindow( elem );
  5246. if ( val === undefined ) {
  5247. return win ? (prop in win) ? win[ prop ] :
  5248. win.document.documentElement[ method ] :
  5249. elem[ method ];
  5250. }
  5251. if ( win ) {
  5252. win.scrollTo(
  5253. !top ? val : jQuery( win ).scrollLeft(),
  5254. top ? val : jQuery( win ).scrollTop()
  5255. );
  5256. } else {
  5257. elem[ method ] = val;
  5258. }
  5259. }, method, val, arguments.length, null );
  5260. };
  5261. jQuery.prototype.scrollTop = function( val ) {
  5262. /// <summary>
  5263. /// 1: Get the current vertical position of the scroll bar for the first element in the set of matched elements.
  5264. /// &#10; 1.1 - scrollTop()
  5265. /// &#10;2: Set the current vertical position of the scroll bar for each of the set of matched elements.
  5266. /// &#10; 2.1 - scrollTop(value)
  5267. /// </summary>
  5268. /// <param name="val" type="Number">
  5269. /// An integer indicating the new position to set the scroll bar to.
  5270. /// </param>
  5271. /// <returns type="jQuery" />
  5272. return jQuery.access( this, function( elem, method, val ) {
  5273. var win = getWindow( elem );
  5274. if ( val === undefined ) {
  5275. return win ? (prop in win) ? win[ prop ] :
  5276. win.document.documentElement[ method ] :
  5277. elem[ method ];
  5278. }
  5279. if ( win ) {
  5280. win.scrollTo(
  5281. !top ? val : jQuery( win ).scrollLeft(),
  5282. top ? val : jQuery( win ).scrollTop()
  5283. );
  5284. } else {
  5285. elem[ method ] = val;
  5286. }
  5287. }, method, val, arguments.length, null );
  5288. };
  5289. jQuery.prototype.select = function( data, fn ) {
  5290. /// <summary>
  5291. /// Bind an event handler to the "select" JavaScript event, or trigger that event on an element.
  5292. /// &#10;1 - select(handler(eventObject))
  5293. /// &#10;2 - select(eventData, handler(eventObject))
  5294. /// &#10;3 - select()
  5295. /// </summary>
  5296. /// <param name="data" type="Object">
  5297. /// A map of data that will be passed to the event handler.
  5298. /// </param>
  5299. /// <param name="fn" type="Function">
  5300. /// A function to execute each time the event is triggered.
  5301. /// </param>
  5302. /// <returns type="jQuery" />
  5303. return arguments.length > 0 ?
  5304. this.on( name, null, data, fn ) :
  5305. this.trigger( name );
  5306. };
  5307. jQuery.prototype.serialize = function() {
  5308. /// <summary>
  5309. /// Encode a set of form elements as a string for submission.
  5310. /// </summary>
  5311. /// <returns type="String" />
  5312. return jQuery.param( this.serializeArray() );
  5313. };
  5314. jQuery.prototype.serializeArray = function() {
  5315. /// <summary>
  5316. /// Encode a set of form elements as an array of names and values.
  5317. /// </summary>
  5318. /// <returns type="Array" />
  5319. return this.map(function(){
  5320. // Can add propHook for "elements" to filter or add form elements
  5321. var elements = jQuery.prop( this, "elements" );
  5322. return elements ? jQuery.makeArray( elements ) : this;
  5323. })
  5324. .filter(function(){
  5325. var type = this.type;
  5326. // Use .is(":disabled") so that fieldset[disabled] works
  5327. return this.name && !jQuery( this ).is( ":disabled" ) &&
  5328. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  5329. ( this.checked || !manipulation_rcheckableType.test( type ) );
  5330. })
  5331. .map(function( i, elem ){
  5332. var val = jQuery( this ).val();
  5333. return val == null ?
  5334. null :
  5335. jQuery.isArray( val ) ?
  5336. jQuery.map( val, function( val ){
  5337. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  5338. }) :
  5339. { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  5340. }).get();
  5341. };
  5342. jQuery.prototype.show = function( speed, easing, callback ) {
  5343. /// <summary>
  5344. /// Display the matched elements.
  5345. /// &#10;1 - show()
  5346. /// &#10;2 - show(duration, callback)
  5347. /// &#10;3 - show(duration, easing, callback)
  5348. /// </summary>
  5349. /// <param name="speed" type="Number">
  5350. /// A string or number determining how long the animation will run.
  5351. /// </param>
  5352. /// <param name="easing" type="String">
  5353. /// A string indicating which easing function to use for the transition.
  5354. /// </param>
  5355. /// <param name="callback" type="Function">
  5356. /// A function to call once the animation is complete.
  5357. /// </param>
  5358. /// <returns type="jQuery" />
  5359. return speed == null || typeof speed === "boolean" ?
  5360. cssFn.apply( this, arguments ) :
  5361. this.animate( genFx( name, true ), speed, easing, callback );
  5362. };
  5363. jQuery.prototype.siblings = function( until, selector ) {
  5364. /// <summary>
  5365. /// Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
  5366. /// </summary>
  5367. /// <param name="until" type="String">
  5368. /// A string containing a selector expression to match elements against.
  5369. /// </param>
  5370. /// <returns type="jQuery" />
  5371. var ret = jQuery.map( this, fn, until );
  5372. if ( name.slice( -5 ) !== "Until" ) {
  5373. selector = until;
  5374. }
  5375. if ( selector && typeof selector === "string" ) {
  5376. ret = jQuery.filter( selector, ret );
  5377. }
  5378. if ( this.length > 1 ) {
  5379. // Remove duplicates
  5380. if ( !guaranteedUnique[ name ] ) {
  5381. ret = jQuery.unique( ret );
  5382. }
  5383. // Reverse order for parents* and prev-derivatives
  5384. if ( rparentsprev.test( name ) ) {
  5385. ret = ret.reverse();
  5386. }
  5387. }
  5388. return this.pushStack( ret );
  5389. };
  5390. jQuery.prototype.size = function() {
  5391. /// <summary>
  5392. /// Return the number of elements in the jQuery object.
  5393. /// </summary>
  5394. /// <returns type="Number" />
  5395. return this.length;
  5396. };
  5397. jQuery.prototype.slice = function() {
  5398. /// <summary>
  5399. /// Reduce the set of matched elements to a subset specified by a range of indices.
  5400. /// </summary>
  5401. /// <param name="" type="Number">
  5402. /// An integer indicating the 0-based position at which the elements begin to be selected. If negative, it indicates an offset from the end of the set.
  5403. /// </param>
  5404. /// <param name="" type="Number">
  5405. /// An integer indicating the 0-based position at which the elements stop being selected. If negative, it indicates an offset from the end of the set. If omitted, the range continues until the end of the set.
  5406. /// </param>
  5407. /// <returns type="jQuery" />
  5408. return this.pushStack( core_slice.apply( this, arguments ) );
  5409. };
  5410. jQuery.prototype.slideDown = function( speed, easing, callback ) {
  5411. /// <summary>
  5412. /// Display the matched elements with a sliding motion.
  5413. /// &#10;1 - slideDown(duration, callback)
  5414. /// &#10;2 - slideDown(duration, easing, callback)
  5415. /// </summary>
  5416. /// <param name="speed" type="Number">
  5417. /// A string or number determining how long the animation will run.
  5418. /// </param>
  5419. /// <param name="easing" type="String">
  5420. /// A string indicating which easing function to use for the transition.
  5421. /// </param>
  5422. /// <param name="callback" type="Function">
  5423. /// A function to call once the animation is complete.
  5424. /// </param>
  5425. /// <returns type="jQuery" />
  5426. return this.animate( props, speed, easing, callback );
  5427. };
  5428. jQuery.prototype.slideToggle = function( speed, easing, callback ) {
  5429. /// <summary>
  5430. /// Display or hide the matched elements with a sliding motion.
  5431. /// &#10;1 - slideToggle(duration, callback)
  5432. /// &#10;2 - slideToggle(duration, easing, callback)
  5433. /// </summary>
  5434. /// <param name="speed" type="Number">
  5435. /// A string or number determining how long the animation will run.
  5436. /// </param>
  5437. /// <param name="easing" type="String">
  5438. /// A string indicating which easing function to use for the transition.
  5439. /// </param>
  5440. /// <param name="callback" type="Function">
  5441. /// A function to call once the animation is complete.
  5442. /// </param>
  5443. /// <returns type="jQuery" />
  5444. return this.animate( props, speed, easing, callback );
  5445. };
  5446. jQuery.prototype.slideUp = function( speed, easing, callback ) {
  5447. /// <summary>
  5448. /// Hide the matched elements with a sliding motion.
  5449. /// &#10;1 - slideUp(duration, callback)
  5450. /// &#10;2 - slideUp(duration, easing, callback)
  5451. /// </summary>
  5452. /// <param name="speed" type="Number">
  5453. /// A string or number determining how long the animation will run.
  5454. /// </param>
  5455. /// <param name="easing" type="String">
  5456. /// A string indicating which easing function to use for the transition.
  5457. /// </param>
  5458. /// <param name="callback" type="Function">
  5459. /// A function to call once the animation is complete.
  5460. /// </param>
  5461. /// <returns type="jQuery" />
  5462. return this.animate( props, speed, easing, callback );
  5463. };
  5464. jQuery.prototype.stop = function( type, clearQueue, gotoEnd ) {
  5465. /// <summary>
  5466. /// Stop the currently-running animation on the matched elements.
  5467. /// &#10;1 - stop(clearQueue, jumpToEnd)
  5468. /// &#10;2 - stop(queue, clearQueue, jumpToEnd)
  5469. /// </summary>
  5470. /// <param name="type" type="String">
  5471. /// The name of the queue in which to stop animations.
  5472. /// </param>
  5473. /// <param name="clearQueue" type="Boolean">
  5474. /// A Boolean indicating whether to remove queued animation as well. Defaults to false.
  5475. /// </param>
  5476. /// <param name="gotoEnd" type="Boolean">
  5477. /// A Boolean indicating whether to complete the current animation immediately. Defaults to false.
  5478. /// </param>
  5479. /// <returns type="jQuery" />
  5480. var stopQueue = function( hooks ) {
  5481. var stop = hooks.stop;
  5482. delete hooks.stop;
  5483. stop( gotoEnd );
  5484. };
  5485. if ( typeof type !== "string" ) {
  5486. gotoEnd = clearQueue;
  5487. clearQueue = type;
  5488. type = undefined;
  5489. }
  5490. if ( clearQueue && type !== false ) {
  5491. this.queue( type || "fx", [] );
  5492. }
  5493. return this.each(function() {
  5494. var dequeue = true,
  5495. index = type != null && type + "queueHooks",
  5496. timers = jQuery.timers,
  5497. data = jQuery._data( this );
  5498. if ( index ) {
  5499. if ( data[ index ] && data[ index ].stop ) {
  5500. stopQueue( data[ index ] );
  5501. }
  5502. } else {
  5503. for ( index in data ) {
  5504. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  5505. stopQueue( data[ index ] );
  5506. }
  5507. }
  5508. }
  5509. for ( index = timers.length; index--; ) {
  5510. if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
  5511. timers[ index ].anim.stop( gotoEnd );
  5512. dequeue = false;
  5513. timers.splice( index, 1 );
  5514. }
  5515. }
  5516. // start the next in the queue if the last step wasn't forced
  5517. // timers currently will call their complete callbacks, which will dequeue
  5518. // but only if they were gotoEnd
  5519. if ( dequeue || !gotoEnd ) {
  5520. jQuery.dequeue( this, type );
  5521. }
  5522. });
  5523. };
  5524. jQuery.prototype.submit = function( data, fn ) {
  5525. /// <summary>
  5526. /// Bind an event handler to the "submit" JavaScript event, or trigger that event on an element.
  5527. /// &#10;1 - submit(handler(eventObject))
  5528. /// &#10;2 - submit(eventData, handler(eventObject))
  5529. /// &#10;3 - submit()
  5530. /// </summary>
  5531. /// <param name="data" type="Object">
  5532. /// A map of data that will be passed to the event handler.
  5533. /// </param>
  5534. /// <param name="fn" type="Function">
  5535. /// A function to execute each time the event is triggered.
  5536. /// </param>
  5537. /// <returns type="jQuery" />
  5538. return arguments.length > 0 ?
  5539. this.on( name, null, data, fn ) :
  5540. this.trigger( name );
  5541. };
  5542. jQuery.prototype.text = function( value ) {
  5543. /// <summary>
  5544. /// 1: Get the combined text contents of each element in the set of matched elements, including their descendants.
  5545. /// &#10; 1.1 - text()
  5546. /// &#10;2: Set the content of each element in the set of matched elements to the specified text.
  5547. /// &#10; 2.1 - text(textString)
  5548. /// &#10; 2.2 - text(function(index, text))
  5549. /// </summary>
  5550. /// <param name="value" type="String">
  5551. /// A string of text to set as the content of each matched element.
  5552. /// </param>
  5553. /// <returns type="jQuery" />
  5554. return jQuery.access( this, function( value ) {
  5555. return value === undefined ?
  5556. jQuery.text( this ) :
  5557. this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
  5558. }, null, value, arguments.length );
  5559. };
  5560. jQuery.prototype.toArray = function() {
  5561. /// <summary>
  5562. /// Retrieve all the DOM elements contained in the jQuery set, as an array.
  5563. /// </summary>
  5564. /// <returns type="Array" />
  5565. return core_slice.call( this );
  5566. };
  5567. jQuery.prototype.toggle = function( speed, easing, callback ) {
  5568. /// <summary>
  5569. /// 1: Bind two or more handlers to the matched elements, to be executed on alternate clicks.
  5570. /// &#10; 1.1 - toggle(handler(eventObject), handler(eventObject), handler(eventObject))
  5571. /// &#10;2: Display or hide the matched elements.
  5572. /// &#10; 2.1 - toggle(duration, callback)
  5573. /// &#10; 2.2 - toggle(duration, easing, callback)
  5574. /// &#10; 2.3 - toggle(showOrHide)
  5575. /// </summary>
  5576. /// <param name="speed" type="Function">
  5577. /// A function to execute every even time the element is clicked.
  5578. /// </param>
  5579. /// <param name="easing" type="Function">
  5580. /// A function to execute every odd time the element is clicked.
  5581. /// </param>
  5582. /// <param name="callback" type="Function">
  5583. /// Additional handlers to cycle through after clicks.
  5584. /// </param>
  5585. /// <returns type="jQuery" />
  5586. return speed == null || typeof speed === "boolean" ?
  5587. cssFn.apply( this, arguments ) :
  5588. this.animate( genFx( name, true ), speed, easing, callback );
  5589. };
  5590. jQuery.prototype.toggleClass = function( value, stateVal ) {
  5591. /// <summary>
  5592. /// Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.
  5593. /// &#10;1 - toggleClass(className)
  5594. /// &#10;2 - toggleClass(className, switch)
  5595. /// &#10;3 - toggleClass(switch)
  5596. /// &#10;4 - toggleClass(function(index, class, switch), switch)
  5597. /// </summary>
  5598. /// <param name="value" type="String">
  5599. /// One or more class names (separated by spaces) to be toggled for each element in the matched set.
  5600. /// </param>
  5601. /// <param name="stateVal" type="Boolean">
  5602. /// A Boolean (not just truthy/falsy) value to determine whether the class should be added or removed.
  5603. /// </param>
  5604. /// <returns type="jQuery" />
  5605. var type = typeof value,
  5606. isBool = typeof stateVal === "boolean";
  5607. if ( jQuery.isFunction( value ) ) {
  5608. return this.each(function( i ) {
  5609. jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
  5610. });
  5611. }
  5612. return this.each(function() {
  5613. if ( type === "string" ) {
  5614. // toggle individual class names
  5615. var className,
  5616. i = 0,
  5617. self = jQuery( this ),
  5618. state = stateVal,
  5619. classNames = value.match( core_rnotwhite ) || [];
  5620. while ( (className = classNames[ i++ ]) ) {
  5621. // check each className given, space separated list
  5622. state = isBool ? state : !self.hasClass( className );
  5623. self[ state ? "addClass" : "removeClass" ]( className );
  5624. }
  5625. // Toggle whole class name
  5626. } else if ( type === core_strundefined || type === "boolean" ) {
  5627. if ( this.className ) {
  5628. // store className if set
  5629. jQuery._data( this, "__className__", this.className );
  5630. }
  5631. // If the element has a class name or if we're passed "false",
  5632. // then remove the whole classname (if there was one, the above saved it).
  5633. // Otherwise bring back whatever was previously saved (if anything),
  5634. // falling back to the empty string if nothing was stored.
  5635. this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
  5636. }
  5637. });
  5638. };
  5639. jQuery.prototype.trigger = function( type, data ) {
  5640. /// <summary>
  5641. /// Execute all handlers and behaviors attached to the matched elements for the given event type.
  5642. /// &#10;1 - trigger(eventType, extraParameters)
  5643. /// &#10;2 - trigger(event)
  5644. /// </summary>
  5645. /// <param name="type" type="String">
  5646. /// A string containing a JavaScript event type, such as click or submit.
  5647. /// </param>
  5648. /// <param name="data" type="Object">
  5649. /// Additional parameters to pass along to the event handler.
  5650. /// </param>
  5651. /// <returns type="jQuery" />
  5652. return this.each(function() {
  5653. jQuery.event.trigger( type, data, this );
  5654. });
  5655. };
  5656. jQuery.prototype.triggerHandler = function( type, data ) {
  5657. /// <summary>
  5658. /// Execute all handlers attached to an element for an event.
  5659. /// </summary>
  5660. /// <param name="type" type="String">
  5661. /// A string containing a JavaScript event type, such as click or submit.
  5662. /// </param>
  5663. /// <param name="data" type="Array">
  5664. /// An array of additional parameters to pass along to the event handler.
  5665. /// </param>
  5666. /// <returns type="Object" />
  5667. var elem = this[0];
  5668. if ( elem ) {
  5669. return jQuery.event.trigger( type, data, elem, true );
  5670. }
  5671. };
  5672. jQuery.prototype.unbind = function( types, fn ) {
  5673. /// <summary>
  5674. /// Remove a previously-attached event handler from the elements.
  5675. /// &#10;1 - unbind(eventType, handler(eventObject))
  5676. /// &#10;2 - unbind(eventType, false)
  5677. /// &#10;3 - unbind(event)
  5678. /// </summary>
  5679. /// <param name="types" type="String">
  5680. /// A string containing a JavaScript event type, such as click or submit.
  5681. /// </param>
  5682. /// <param name="fn" type="Function">
  5683. /// The function that is to be no longer executed.
  5684. /// </param>
  5685. /// <returns type="jQuery" />
  5686. return this.off( types, null, fn );
  5687. };
  5688. jQuery.prototype.undelegate = function( selector, types, fn ) {
  5689. /// <summary>
  5690. /// Remove a handler from the event for all elements which match the current selector, based upon a specific set of root elements.
  5691. /// &#10;1 - undelegate()
  5692. /// &#10;2 - undelegate(selector, eventType)
  5693. /// &#10;3 - undelegate(selector, eventType, handler(eventObject))
  5694. /// &#10;4 - undelegate(selector, events)
  5695. /// &#10;5 - undelegate(namespace)
  5696. /// </summary>
  5697. /// <param name="selector" type="String">
  5698. /// A selector which will be used to filter the event results.
  5699. /// </param>
  5700. /// <param name="types" type="String">
  5701. /// A string containing a JavaScript event type, such as "click" or "keydown"
  5702. /// </param>
  5703. /// <param name="fn" type="Function">
  5704. /// A function to execute at the time the event is triggered.
  5705. /// </param>
  5706. /// <returns type="jQuery" />
  5707. // ( namespace ) or ( selector, types [, fn] )
  5708. return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
  5709. };
  5710. jQuery.prototype.unload = function( data, fn ) {
  5711. /// <summary>
  5712. /// Bind an event handler to the "unload" JavaScript event.
  5713. /// &#10;1 - unload(handler(eventObject))
  5714. /// &#10;2 - unload(eventData, handler(eventObject))
  5715. /// </summary>
  5716. /// <param name="data" type="Object">
  5717. /// A map of data that will be passed to the event handler.
  5718. /// </param>
  5719. /// <param name="fn" type="Function">
  5720. /// A function to execute each time the event is triggered.
  5721. /// </param>
  5722. /// <returns type="jQuery" />
  5723. return arguments.length > 0 ?
  5724. this.on( name, null, data, fn ) :
  5725. this.trigger( name );
  5726. };
  5727. jQuery.prototype.unwrap = function() {
  5728. /// <summary>
  5729. /// Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
  5730. /// </summary>
  5731. /// <returns type="jQuery" />
  5732. return this.parent().each(function() {
  5733. if ( !jQuery.nodeName( this, "body" ) ) {
  5734. jQuery( this ).replaceWith( this.childNodes );
  5735. }
  5736. }).end();
  5737. };
  5738. jQuery.prototype.val = function( value ) {
  5739. /// <summary>
  5740. /// 1: Get the current value of the first element in the set of matched elements.
  5741. /// &#10; 1.1 - val()
  5742. /// &#10;2: Set the value of each element in the set of matched elements.
  5743. /// &#10; 2.1 - val(value)
  5744. /// &#10; 2.2 - val(function(index, value))
  5745. /// </summary>
  5746. /// <param name="value" type="String">
  5747. /// A string of text or an array of strings corresponding to the value of each matched element to set as selected/checked.
  5748. /// </param>
  5749. /// <returns type="jQuery" />
  5750. var ret, hooks, isFunction,
  5751. elem = this[0];
  5752. if ( !arguments.length ) {
  5753. if ( elem ) {
  5754. hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  5755. if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
  5756. return ret;
  5757. }
  5758. ret = elem.value;
  5759. return typeof ret === "string" ?
  5760. // handle most common string cases
  5761. ret.replace(rreturn, "") :
  5762. // handle cases where value is null/undef or number
  5763. ret == null ? "" : ret;
  5764. }
  5765. return;
  5766. }
  5767. isFunction = jQuery.isFunction( value );
  5768. return this.each(function( i ) {
  5769. var val;
  5770. if ( this.nodeType !== 1 ) {
  5771. return;
  5772. }
  5773. if ( isFunction ) {
  5774. val = value.call( this, i, jQuery( this ).val() );
  5775. } else {
  5776. val = value;
  5777. }
  5778. // Treat null/undefined as ""; convert numbers to string
  5779. if ( val == null ) {
  5780. val = "";
  5781. } else if ( typeof val === "number" ) {
  5782. val += "";
  5783. } else if ( jQuery.isArray( val ) ) {
  5784. val = jQuery.map(val, function ( value ) {
  5785. return value == null ? "" : value + "";
  5786. });
  5787. }
  5788. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  5789. // If set returns undefined, fall back to normal setting
  5790. if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
  5791. this.value = val;
  5792. }
  5793. });
  5794. };
  5795. jQuery.prototype.width = function( margin, value ) {
  5796. /// <summary>
  5797. /// 1: Get the current computed width for the first element in the set of matched elements.
  5798. /// &#10; 1.1 - width()
  5799. /// &#10;2: Set the CSS width of each element in the set of matched elements.
  5800. /// &#10; 2.1 - width(value)
  5801. /// &#10; 2.2 - width(function(index, width))
  5802. /// </summary>
  5803. /// <param name="margin" type="Number">
  5804. /// An integer representing the number of pixels, or an integer along with an optional unit of measure appended (as a string).
  5805. /// </param>
  5806. /// <returns type="jQuery" />
  5807. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  5808. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  5809. return jQuery.access( this, function( elem, type, value ) {
  5810. var doc;
  5811. if ( jQuery.isWindow( elem ) ) {
  5812. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  5813. // isn't a whole lot we can do. See pull request at this URL for discussion:
  5814. // https://github.com/jquery/jquery/pull/764
  5815. return elem.document.documentElement[ "client" + name ];
  5816. }
  5817. // Get document width or height
  5818. if ( elem.nodeType === 9 ) {
  5819. doc = elem.documentElement;
  5820. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
  5821. // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
  5822. return Math.max(
  5823. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  5824. elem.body[ "offset" + name ], doc[ "offset" + name ],
  5825. doc[ "client" + name ]
  5826. );
  5827. }
  5828. return value === undefined ?
  5829. // Get width or height on the element, requesting but not forcing parseFloat
  5830. jQuery.css( elem, type, extra ) :
  5831. // Set width or height on the element
  5832. jQuery.style( elem, type, value, extra );
  5833. }, type, chainable ? margin : undefined, chainable, null );
  5834. };
  5835. jQuery.prototype.wrap = function( html ) {
  5836. /// <summary>
  5837. /// Wrap an HTML structure around each element in the set of matched elements.
  5838. /// &#10;1 - wrap(wrappingElement)
  5839. /// &#10;2 - wrap(function(index))
  5840. /// </summary>
  5841. /// <param name="html" type="jQuery">
  5842. /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements.
  5843. /// </param>
  5844. /// <returns type="jQuery" />
  5845. var isFunction = jQuery.isFunction( html );
  5846. return this.each(function(i) {
  5847. jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
  5848. });
  5849. };
  5850. jQuery.prototype.wrapAll = function( html ) {
  5851. /// <summary>
  5852. /// Wrap an HTML structure around all elements in the set of matched elements.
  5853. /// </summary>
  5854. /// <param name="html" type="jQuery">
  5855. /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the matched elements.
  5856. /// </param>
  5857. /// <returns type="jQuery" />
  5858. if ( jQuery.isFunction( html ) ) {
  5859. return this.each(function(i) {
  5860. jQuery(this).wrapAll( html.call(this, i) );
  5861. });
  5862. }
  5863. if ( this[0] ) {
  5864. // The elements to wrap the target around
  5865. var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
  5866. if ( this[0].parentNode ) {
  5867. wrap.insertBefore( this[0] );
  5868. }
  5869. wrap.map(function() {
  5870. var elem = this;
  5871. while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
  5872. elem = elem.firstChild;
  5873. }
  5874. return elem;
  5875. }).append( this );
  5876. }
  5877. return this;
  5878. };
  5879. jQuery.prototype.wrapInner = function( html ) {
  5880. /// <summary>
  5881. /// Wrap an HTML structure around the content of each element in the set of matched elements.
  5882. /// &#10;1 - wrapInner(wrappingElement)
  5883. /// &#10;2 - wrapInner(function(index))
  5884. /// </summary>
  5885. /// <param name="html" type="String">
  5886. /// An HTML snippet, selector expression, jQuery object, or DOM element specifying the structure to wrap around the content of the matched elements.
  5887. /// </param>
  5888. /// <returns type="jQuery" />
  5889. if ( jQuery.isFunction( html ) ) {
  5890. return this.each(function(i) {
  5891. jQuery(this).wrapInner( html.call(this, i) );
  5892. });
  5893. }
  5894. return this.each(function() {
  5895. var self = jQuery( this ),
  5896. contents = self.contents();
  5897. if ( contents.length ) {
  5898. contents.wrapAll( html );
  5899. } else {
  5900. self.append( html );
  5901. }
  5902. });
  5903. };
  5904. jQuery.fn = jQuery.prototype;
  5905. jQuery.fn.init.prototype = jQuery.fn;
  5906. window.jQuery = window.$ = jQuery;
  5907. })(window);