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.

7024 lines
264 KiB

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