PageRenderTime 59ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 2ms

/BlogEngine/BlogEngine.NET/Scripts/jQuery/jquery-1.5-vsdoc.js

#
JavaScript | 6574 lines | 3408 code | 897 blank | 2269 comment | 1132 complexity | 5d3a3682e1ba1b76d495104ddf89f0ac MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0, BSD-3-Clause

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

  1. /*
  2. * This file has been generated to support Visual Studio IntelliSense.
  3. * You should not use this file at runtime inside the browser--it is only
  4. * intended to be used only for design-time IntelliSense. Please use the
  5. * standard jQuery library for all production use.
  6. *
  7. * Comment version: 1.5
  8. */
  9. /*!
  10. * jQuery JavaScript Library v1.5
  11. * http://jquery.com/
  12. *
  13. * Distributed in whole under the terms of the MIT
  14. *
  15. * Copyright 2010, John Resig
  16. *
  17. * Permission is hereby granted, free of charge, to any person obtaining
  18. * a copy of this software and associated documentation files (the
  19. * "Software"), to deal in the Software without restriction, including
  20. * without limitation the rights to use, copy, modify, merge, publish,
  21. * distribute, sublicense, and/or sell copies of the Software, and to
  22. * permit persons to whom the Software is furnished to do so, subject to
  23. * the following conditions:
  24. *
  25. * The above copyright notice and this permission notice shall be
  26. * included in all copies or substantial portions of the Software.
  27. *
  28. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  29. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  30. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  31. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  32. * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  33. * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  34. * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  35. *
  36. * Includes Sizzle.js
  37. * http://sizzlejs.com/
  38. * Copyright 2010, The Dojo Foundation
  39. * Released under the MIT and BSD Licenses.
  40. */
  41. (function (window, undefined) {
  42. var jQuery = function (selector, context) {
  43. /// <summary>
  44. /// 1: Accepts a string containing a CSS selector which is then used to match a set of elements.
  45. /// 1.1 - $(selector, context)
  46. /// 1.2 - $(element)
  47. /// 1.3 - $(elementArray)
  48. /// 1.4 - $(jQuery object)
  49. /// 1.5 - $()
  50. /// 2: Creates DOM elements on the fly from the provided string of raw HTML.
  51. /// 2.1 - $(html, ownerDocument)
  52. /// 2.2 - $(html, props)
  53. /// 3: Binds a function to be executed when the DOM has finished loading.
  54. /// 3.1 - $(callback)
  55. /// </summary>
  56. /// <param name="selector" type="String">
  57. /// A string containing a selector expression
  58. /// </param>
  59. /// <param name="context" type="jQuery">
  60. /// A DOM Element, Document, or jQuery to use as context
  61. /// </param>
  62. /// <returns type="jQuery" />
  63. // The jQuery object is actually just the init constructor 'enhanced'
  64. return new jQuery.fn.init(selector, context, rootjQuery);
  65. };
  66. jQuery.Deferred = function (func) {
  67. var deferred = jQuery._Deferred(),
  68. failDeferred = jQuery._Deferred(),
  69. promise;
  70. // Add errorDeferred methods, then and promise
  71. jQuery.extend(deferred, {
  72. then: function (doneCallbacks, failCallbacks) {
  73. deferred.done(doneCallbacks).fail(failCallbacks);
  74. return this;
  75. },
  76. fail: failDeferred.done,
  77. rejectWith: failDeferred.resolveWith,
  78. reject: failDeferred.resolve,
  79. isRejected: failDeferred.isResolved,
  80. // Get a promise for this deferred
  81. // If obj is provided, the promise aspect is added to the object
  82. promise: function (obj, i /* internal */) {
  83. if (obj == null) {
  84. if (promise) {
  85. return promise;
  86. }
  87. promise = obj = {};
  88. }
  89. i = promiseMethods.length;
  90. while (i--) {
  91. obj[promiseMethods[i]] = deferred[promiseMethods[i]];
  92. }
  93. return obj;
  94. }
  95. });
  96. // Make sure only one callback list will be used
  97. deferred.then(failDeferred.cancel, deferred.cancel);
  98. // Unexpose cancel
  99. delete deferred.cancel;
  100. // Call given func if any
  101. if (func) {
  102. func.call(deferred, deferred);
  103. }
  104. return deferred;
  105. };
  106. jQuery.Event = function (src) {
  107. // Allow instantiation without the 'new' keyword
  108. if (!this.preventDefault) {
  109. return new jQuery.Event(src);
  110. }
  111. // Event object
  112. if (src && src.type) {
  113. this.originalEvent = src;
  114. this.type = src.type;
  115. // Events bubbling up the document may have been marked as prevented
  116. // by a handler lower down the tree; reflect the correct value.
  117. this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false ||
  118. src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse;
  119. // Event type
  120. } else {
  121. this.type = src;
  122. }
  123. // timeStamp is buggy for some events on Firefox(#3843)
  124. // So we won't rely on the native value
  125. this.timeStamp = jQuery.now();
  126. // Mark it as fixed
  127. this[jQuery.expando] = true;
  128. };
  129. jQuery._Deferred = function () {
  130. var // callbacks list
  131. callbacks = [],
  132. // stored [ context , args ]
  133. fired,
  134. // to avoid firing when already doing so
  135. firing,
  136. // flag to know if the deferred has been cancelled
  137. cancelled,
  138. // the deferred itself
  139. deferred = {
  140. // done( f1, f2, ...)
  141. done: function () {
  142. if (!cancelled) {
  143. var args = arguments,
  144. i,
  145. length,
  146. elem,
  147. type,
  148. _fired;
  149. if (fired) {
  150. _fired = fired;
  151. fired = 0;
  152. }
  153. for (i = 0, length = args.length; i < length; i++) {
  154. elem = args[i];
  155. type = jQuery.type(elem);
  156. if (type === "array") {
  157. deferred.done.apply(deferred, elem);
  158. } else if (type === "function") {
  159. callbacks.push(elem);
  160. }
  161. }
  162. if (_fired) {
  163. deferred.resolveWith(_fired[0], _fired[1]);
  164. }
  165. }
  166. return this;
  167. },
  168. // resolve with given context and args
  169. resolveWith: function (context, args) {
  170. if (!cancelled && !fired && !firing) {
  171. firing = 1;
  172. try {
  173. while (callbacks[0]) {
  174. callbacks.shift().apply(context, args);
  175. }
  176. }
  177. finally {
  178. fired = [context, args];
  179. firing = 0;
  180. }
  181. }
  182. return this;
  183. },
  184. // resolve with this as context and given arguments
  185. resolve: function () {
  186. deferred.resolveWith(jQuery.isFunction(this.promise) ? this.promise() : this, arguments);
  187. return this;
  188. },
  189. // Has this deferred been resolved?
  190. isResolved: function () {
  191. return !!(firing || fired);
  192. },
  193. // Cancel
  194. cancel: function () {
  195. cancelled = 1;
  196. callbacks = [];
  197. return this;
  198. }
  199. };
  200. return deferred;
  201. };
  202. jQuery._data = function (elem, name, data) {
  203. return jQuery.data(elem, name, data, true);
  204. };
  205. jQuery.acceptData = function (elem) {
  206. if (elem.nodeName) {
  207. var match = jQuery.noData[elem.nodeName.toLowerCase()];
  208. if (match) {
  209. return !(match === true || elem.getAttribute("classid") !== match);
  210. }
  211. }
  212. return true;
  213. };
  214. jQuery.access = function (elems, key, value, exec, fn, pass) {
  215. var length = elems.length;
  216. // Setting many attributes
  217. if (typeof key === "object") {
  218. for (var k in key) {
  219. jQuery.access(elems, k, key[k], exec, fn, value);
  220. }
  221. return elems;
  222. }
  223. // Setting one attribute
  224. if (value !== undefined) {
  225. // Optionally, function values get executed if exec is true
  226. exec = !pass && exec && jQuery.isFunction(value);
  227. for (var i = 0; i < length; i++) {
  228. fn(elems[i], key, exec ? value.call(elems[i], i, fn(elems[i], key)) : value, pass);
  229. }
  230. return elems;
  231. }
  232. // Getting an attribute
  233. return length ? fn(elems[0], key) : undefined;
  234. };
  235. jQuery.active = 0;
  236. jQuery.ajax = function (url, options) {
  237. /// <summary>
  238. /// Perform an asynchronous HTTP (Ajax) request.
  239. /// 1 - jQuery.ajax(url, settings)
  240. /// 2 - jQuery.ajax(settings)
  241. /// </summary>
  242. /// <param name="url" type="String">
  243. /// A string containing the URL to which the request is sent.
  244. /// </param>
  245. /// <param name="options" type="Object">
  246. /// 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.
  247. /// </param>
  248. // If options is not an object,
  249. // we simulate pre-1.5 signature
  250. if (typeof options !== "object") {
  251. options = url;
  252. url = undefined;
  253. }
  254. // Force options to be an object
  255. options = options || {};
  256. var // Create the final options object
  257. s = jQuery.extend(true, {}, jQuery.ajaxSettings, options),
  258. // Callbacks contexts
  259. // We force the original context if it exists
  260. // or take it from jQuery.ajaxSettings otherwise
  261. // (plain objects used as context get extended)
  262. callbackContext =
  263. (s.context = ("context" in options ? options : jQuery.ajaxSettings).context) || s,
  264. globalEventContext = callbackContext === s ? jQuery.event : jQuery(callbackContext),
  265. // Deferreds
  266. deferred = jQuery.Deferred(),
  267. completeDeferred = jQuery._Deferred(),
  268. // Status-dependent callbacks
  269. statusCode = s.statusCode || {},
  270. // Headers (they are sent all at once)
  271. requestHeaders = {},
  272. // Response headers
  273. responseHeadersString,
  274. responseHeaders,
  275. // transport
  276. transport,
  277. // timeout handle
  278. timeoutTimer,
  279. // Cross-domain detection vars
  280. loc = document.location,
  281. protocol = loc.protocol || "http:",
  282. parts,
  283. // The jXHR state
  284. state = 0,
  285. // Loop variable
  286. i,
  287. // Fake xhr
  288. jXHR = {
  289. readyState: 0,
  290. // Caches the header
  291. setRequestHeader: function (name, value) {
  292. if (state === 0) {
  293. requestHeaders[name.toLowerCase()] = value;
  294. }
  295. return this;
  296. },
  297. // Raw string
  298. getAllResponseHeaders: function () {
  299. return state === 2 ? responseHeadersString : null;
  300. },
  301. // Builds headers hashtable if needed
  302. getResponseHeader: function (key) {
  303. var match;
  304. if (state === 2) {
  305. if (!responseHeaders) {
  306. responseHeaders = {};
  307. while ((match = rheaders.exec(responseHeadersString))) {
  308. responseHeaders[match[1].toLowerCase()] = match[2];
  309. }
  310. }
  311. match = responseHeaders[key.toLowerCase()];
  312. }
  313. return match || null;
  314. },
  315. // Cancel the request
  316. abort: function (statusText) {
  317. statusText = statusText || "abort";
  318. if (transport) {
  319. transport.abort(statusText);
  320. }
  321. done(0, statusText);
  322. return this;
  323. }
  324. };
  325. // Callback for when everything is done
  326. // It is defined here because jslint complains if it is declared
  327. // at the end of the function (which would be more logical and readable)
  328. function done(status, statusText, responses, headers) {
  329. // Called once
  330. if (state === 2) {
  331. return;
  332. }
  333. // State is "done" now
  334. state = 2;
  335. // Clear timeout if it exists
  336. if (timeoutTimer) {
  337. clearTimeout(timeoutTimer);
  338. }
  339. // Dereference transport for early garbage collection
  340. // (no matter how long the jXHR object will be used)
  341. transport = undefined;
  342. // Cache response headers
  343. responseHeadersString = headers || "";
  344. // Set readyState
  345. jXHR.readyState = status ? 4 : 0;
  346. var isSuccess,
  347. success,
  348. error,
  349. response = responses ? ajaxHandleResponses(s, jXHR, responses) : undefined,
  350. lastModified,
  351. etag;
  352. // If successful, handle type chaining
  353. if (status >= 200 && status < 300 || status === 304) {
  354. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  355. if (s.ifModified) {
  356. if ((lastModified = jXHR.getResponseHeader("Last-Modified"))) {
  357. jQuery.lastModified[s.url] = lastModified;
  358. }
  359. if ((etag = jXHR.getResponseHeader("Etag"))) {
  360. jQuery.etag[s.url] = etag;
  361. }
  362. }
  363. // If not modified
  364. if (status === 304) {
  365. statusText = "notmodified";
  366. isSuccess = true;
  367. // If we have data
  368. } else {
  369. try {
  370. success = ajaxConvert(s, response);
  371. statusText = "success";
  372. isSuccess = true;
  373. } catch (e) {
  374. // We have a parsererror
  375. statusText = "parsererror";
  376. error = e;
  377. }
  378. }
  379. } else {
  380. // We extract error from statusText
  381. // then normalize statusText and status for non-aborts
  382. error = statusText;
  383. if (status) {
  384. statusText = "error";
  385. if (status < 0) {
  386. status = 0;
  387. }
  388. }
  389. }
  390. // Set data for the fake xhr object
  391. jXHR.status = status;
  392. jXHR.statusText = statusText;
  393. // Success/Error
  394. if (isSuccess) {
  395. deferred.resolveWith(callbackContext, [success, statusText, jXHR]);
  396. } else {
  397. deferred.rejectWith(callbackContext, [jXHR, statusText, error]);
  398. }
  399. // Status-dependent callbacks
  400. jXHR.statusCode(statusCode);
  401. statusCode = undefined;
  402. if (s.global) {
  403. globalEventContext.trigger("ajax" + (isSuccess ? "Success" : "Error"),
  404. [jXHR, s, isSuccess ? success : error]);
  405. }
  406. // Complete
  407. completeDeferred.resolveWith(callbackContext, [jXHR, statusText]);
  408. if (s.global) {
  409. globalEventContext.trigger("ajaxComplete", [jXHR, s]);
  410. // Handle the global AJAX counter
  411. if (!(--jQuery.active)) {
  412. jQuery.event.trigger("ajaxStop");
  413. }
  414. }
  415. }
  416. // Attach deferreds
  417. deferred.promise(jXHR);
  418. jXHR.success = jXHR.done;
  419. jXHR.error = jXHR.fail;
  420. jXHR.complete = completeDeferred.done;
  421. // Status-dependent callbacks
  422. jXHR.statusCode = function (map) {
  423. if (map) {
  424. var tmp;
  425. if (state < 2) {
  426. for (tmp in map) {
  427. statusCode[tmp] = [statusCode[tmp], map[tmp]];
  428. }
  429. } else {
  430. tmp = map[jXHR.status];
  431. jXHR.then(tmp, tmp);
  432. }
  433. }
  434. return this;
  435. };
  436. // Remove hash character (#7531: and string promotion)
  437. // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
  438. // We also use the url parameter if available
  439. s.url = ("" + (url || s.url)).replace(rhash, "").replace(rprotocol, protocol + "//");
  440. // Extract dataTypes list
  441. s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().split(rspacesAjax);
  442. // Determine if a cross-domain request is in order
  443. if (!s.crossDomain) {
  444. parts = rurl.exec(s.url.toLowerCase());
  445. s.crossDomain = !!(parts &&
  446. (parts[1] != protocol || parts[2] != loc.hostname ||
  447. (parts[3] || (parts[1] === "http:" ? 80 : 443)) !=
  448. (loc.port || (protocol === "http:" ? 80 : 443)))
  449. );
  450. }
  451. // Convert data if not already a string
  452. if (s.data && s.processData && typeof s.data !== "string") {
  453. s.data = jQuery.param(s.data, s.traditional);
  454. }
  455. // Apply prefilters
  456. inspectPrefiltersOrTransports(prefilters, s, options, jXHR);
  457. // Uppercase the type
  458. s.type = s.type.toUpperCase();
  459. // Determine if request has content
  460. s.hasContent = !rnoContent.test(s.type);
  461. // Watch for a new set of requests
  462. if (s.global && jQuery.active++ === 0) {
  463. jQuery.event.trigger("ajaxStart");
  464. }
  465. // More options handling for requests with no content
  466. if (!s.hasContent) {
  467. // If data is available, append data to url
  468. if (s.data) {
  469. s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
  470. }
  471. // Add anti-cache in url if needed
  472. if (s.cache === false) {
  473. var ts = jQuery.now(),
  474. // try replacing _= if it is there
  475. ret = s.url.replace(rts, "$1_=" + ts);
  476. // if nothing was replaced, add timestamp to the end
  477. s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
  478. }
  479. }
  480. // Set the correct header, if data is being sent
  481. if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
  482. requestHeaders["content-type"] = s.contentType;
  483. }
  484. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  485. if (s.ifModified) {
  486. if (jQuery.lastModified[s.url]) {
  487. requestHeaders["if-modified-since"] = jQuery.lastModified[s.url];
  488. }
  489. if (jQuery.etag[s.url]) {
  490. requestHeaders["if-none-match"] = jQuery.etag[s.url];
  491. }
  492. }
  493. // Set the Accepts header for the server, depending on the dataType
  494. requestHeaders.accept = s.dataTypes[0] && s.accepts[s.dataTypes[0]] ?
  495. s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", */*; q=0.01" : "") :
  496. s.accepts["*"];
  497. // Check for headers option
  498. for (i in s.headers) {
  499. requestHeaders[i.toLowerCase()] = s.headers[i];
  500. }
  501. // Allow custom headers/mimetypes and early abort
  502. if (s.beforeSend && (s.beforeSend.call(callbackContext, jXHR, s) === false || state === 2)) {
  503. // Abort if not done already
  504. done(0, "abort");
  505. // Return false
  506. jXHR = false;
  507. } else {
  508. // Install callbacks on deferreds
  509. for (i in { success: 1, error: 1, complete: 1 }) {
  510. jXHR[i](s[i]);
  511. }
  512. // Get transport
  513. transport = inspectPrefiltersOrTransports(transports, s, options, jXHR);
  514. // If no transport, we auto-abort
  515. if (!transport) {
  516. done(-1, "No Transport");
  517. } else {
  518. // Set state as sending
  519. state = jXHR.readyState = 1;
  520. // Send global event
  521. if (s.global) {
  522. globalEventContext.trigger("ajaxSend", [jXHR, s]);
  523. }
  524. // Timeout
  525. if (s.async && s.timeout > 0) {
  526. timeoutTimer = setTimeout(function () {
  527. jXHR.abort("timeout");
  528. }, s.timeout);
  529. }
  530. try {
  531. transport.send(requestHeaders, done);
  532. } catch (e) {
  533. // Propagate exception as error if not done
  534. if (status < 2) {
  535. done(-1, e);
  536. // Simply rethrow otherwise
  537. } else {
  538. jQuery.error(e);
  539. }
  540. }
  541. }
  542. }
  543. return jXHR;
  544. };
  545. jQuery.ajaxPrefilter = function (dataTypeExpression, func) {
  546. if (typeof dataTypeExpression !== "string") {
  547. func = dataTypeExpression;
  548. dataTypeExpression = "*";
  549. }
  550. if (jQuery.isFunction(func)) {
  551. var dataTypes = dataTypeExpression.toLowerCase().split(rspacesAjax),
  552. i = 0,
  553. length = dataTypes.length,
  554. dataType,
  555. list,
  556. placeBefore;
  557. // For each dataType in the dataTypeExpression
  558. for (; i < length; i++) {
  559. dataType = dataTypes[i];
  560. // We control if we're asked to add before
  561. // any existing element
  562. placeBefore = /^\+/.test(dataType);
  563. if (placeBefore) {
  564. dataType = dataType.substr(1) || "*";
  565. }
  566. list = structure[dataType] = structure[dataType] || [];
  567. // then we add to the structure accordingly
  568. list[placeBefore ? "unshift" : "push"](func);
  569. }
  570. }
  571. };
  572. jQuery.ajaxSettings = { "url": 'http://localhost:25812/',
  573. "global": true,
  574. "type": 'GET',
  575. "contentType": 'application/x-www-form-urlencoded',
  576. "processData": true,
  577. "async": true,
  578. "accepts": {},
  579. "contents": {},
  580. "responseFields": {},
  581. "converters": {},
  582. "jsonp": 'callback'
  583. };
  584. jQuery.ajaxSetup = function (settings) {
  585. /// <summary>
  586. /// Set default values for future Ajax requests.
  587. /// </summary>
  588. /// <param name="settings" type="Object">
  589. /// A set of key/value pairs that configure the default Ajax request. All options are optional.
  590. /// </param>
  591. jQuery.extend(true, jQuery.ajaxSettings, settings);
  592. if (settings.context) {
  593. jQuery.ajaxSettings.context = settings.context;
  594. }
  595. };
  596. jQuery.ajaxTransport = function (dataTypeExpression, func) {
  597. if (typeof dataTypeExpression !== "string") {
  598. func = dataTypeExpression;
  599. dataTypeExpression = "*";
  600. }
  601. if (jQuery.isFunction(func)) {
  602. var dataTypes = dataTypeExpression.toLowerCase().split(rspacesAjax),
  603. i = 0,
  604. length = dataTypes.length,
  605. dataType,
  606. list,
  607. placeBefore;
  608. // For each dataType in the dataTypeExpression
  609. for (; i < length; i++) {
  610. dataType = dataTypes[i];
  611. // We control if we're asked to add before
  612. // any existing element
  613. placeBefore = /^\+/.test(dataType);
  614. if (placeBefore) {
  615. dataType = dataType.substr(1) || "*";
  616. }
  617. list = structure[dataType] = structure[dataType] || [];
  618. // then we add to the structure accordingly
  619. list[placeBefore ? "unshift" : "push"](func);
  620. }
  621. }
  622. };
  623. jQuery.attr = function (elem, name, value, pass) {
  624. // don't get/set attributes on text, comment and attribute nodes
  625. if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || elem.nodeType === 2) {
  626. return undefined;
  627. }
  628. if (pass && name in jQuery.attrFn) {
  629. return jQuery(elem)[name](value);
  630. }
  631. var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc(elem),
  632. // Whether we are setting (or getting)
  633. set = value !== undefined;
  634. // Try to normalize/fix the name
  635. name = notxml && jQuery.props[name] || name;
  636. // Only do all the following if this is a node (faster for style)
  637. if (elem.nodeType === 1) {
  638. // These attributes require special treatment
  639. var special = rspecialurl.test(name);
  640. // Safari mis-reports the default selected property of an option
  641. // Accessing the parent's selectedIndex property fixes it
  642. if (name === "selected" && !jQuery.support.optSelected) {
  643. var parent = elem.parentNode;
  644. if (parent) {
  645. parent.selectedIndex;
  646. // Make sure that it also works with optgroups, see #5701
  647. if (parent.parentNode) {
  648. parent.parentNode.selectedIndex;
  649. }
  650. }
  651. }
  652. // If applicable, access the attribute via the DOM 0 way
  653. // 'in' checks fail in Blackberry 4.7 #6931
  654. if ((name in elem || elem[name] !== undefined) && notxml && !special) {
  655. if (set) {
  656. // We can't allow the type property to be changed (since it causes problems in IE)
  657. if (name === "type" && rtype.test(elem.nodeName) && elem.parentNode) {
  658. jQuery.error("type property can't be changed");
  659. }
  660. if (value === null) {
  661. if (elem.nodeType === 1) {
  662. elem.removeAttribute(name);
  663. }
  664. } else {
  665. elem[name] = value;
  666. }
  667. }
  668. // browsers index elements by id/name on forms, give priority to attributes.
  669. if (jQuery.nodeName(elem, "form") && elem.getAttributeNode(name)) {
  670. return elem.getAttributeNode(name).nodeValue;
  671. }
  672. // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
  673. // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  674. if (name === "tabIndex") {
  675. var attributeNode = elem.getAttributeNode("tabIndex");
  676. return attributeNode && attributeNode.specified ?
  677. attributeNode.value :
  678. rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href ?
  679. 0 :
  680. undefined;
  681. }
  682. return elem[name];
  683. }
  684. if (!jQuery.support.style && notxml && name === "style") {
  685. if (set) {
  686. elem.style.cssText = "" + value;
  687. }
  688. return elem.style.cssText;
  689. }
  690. if (set) {
  691. // convert the value to a string (all browsers do this but IE) see #1070
  692. elem.setAttribute(name, "" + value);
  693. }
  694. // Ensure that missing attributes return undefined
  695. // Blackberry 4.7 returns "" from getAttribute #6938
  696. if (!elem.attributes[name] && (elem.hasAttribute && !elem.hasAttribute(name))) {
  697. return undefined;
  698. }
  699. var attr = !jQuery.support.hrefNormalized && notxml && special ?
  700. // Some attributes require a special call on IE
  701. elem.getAttribute(name, 2) :
  702. elem.getAttribute(name);
  703. // Non-existent attributes return null, we normalize to undefined
  704. return attr === null ? undefined : attr;
  705. }
  706. // Handle everything which isn't a DOM element node
  707. if (set) {
  708. elem[name] = value;
  709. }
  710. return elem[name];
  711. };
  712. jQuery.attrFn = { "val": true,
  713. "css": true,
  714. "html": true,
  715. "text": true,
  716. "data": true,
  717. "width": true,
  718. "height": true,
  719. "offset": true,
  720. "blur": true,
  721. "focus": true,
  722. "focusin": true,
  723. "focusout": true,
  724. "load": true,
  725. "resize": true,
  726. "scroll": true,
  727. "unload": true,
  728. "click": true,
  729. "dblclick": true,
  730. "mousedown": true,
  731. "mouseup": true,
  732. "mousemove": true,
  733. "mouseover": true,
  734. "mouseout": true,
  735. "mouseenter": true,
  736. "mouseleave": true,
  737. "change": true,
  738. "select": true,
  739. "submit": true,
  740. "keydown": true,
  741. "keypress": true,
  742. "keyup": true,
  743. "error": true
  744. };
  745. jQuery.bindReady = function () {
  746. if (readyBound) {
  747. return;
  748. }
  749. readyBound = true;
  750. // Catch cases where $(document).ready() is called after the
  751. // browser event has already occurred.
  752. if (document.readyState === "complete") {
  753. // Handle it asynchronously to allow scripts the opportunity to delay ready
  754. return setTimeout(jQuery.ready, 1);
  755. }
  756. // Mozilla, Opera and webkit nightlies currently support this event
  757. if (document.addEventListener) {
  758. // Use the handy event callback
  759. document.addEventListener("DOMContentLoaded", DOMContentLoaded, false);
  760. // A fallback to window.onload, that will always work
  761. window.addEventListener("load", jQuery.ready, false);
  762. // If IE event model is used
  763. } else if (document.attachEvent) {
  764. // ensure firing before onload,
  765. // maybe late but safe also for iframes
  766. document.attachEvent("onreadystatechange", DOMContentLoaded);
  767. // A fallback to window.onload, that will always work
  768. window.attachEvent("onload", jQuery.ready);
  769. // If IE and not a frame
  770. // continually check to see if the document is ready
  771. var toplevel = false;
  772. try {
  773. toplevel = window.frameElement == null;
  774. } catch (e) { }
  775. if (document.documentElement.doScroll && toplevel) {
  776. doScrollCheck();
  777. }
  778. }
  779. };
  780. jQuery.boxModel = true;
  781. jQuery.browser = { "webkit": true,
  782. "version": '534.13',
  783. "safari": true
  784. };
  785. jQuery.buildFragment = function (args, nodes, scripts) {
  786. var fragment, cacheable, cacheresults,
  787. doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
  788. // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
  789. // Cloning options loses the selected state, so don't cache them
  790. // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
  791. // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
  792. if (args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
  793. args[0].charAt(0) === "<" && !rnocache.test(args[0]) && (jQuery.support.checkClone || !rchecked.test(args[0]))) {
  794. cacheable = true;
  795. cacheresults = jQuery.fragments[args[0]];
  796. if (cacheresults) {
  797. if (cacheresults !== 1) {
  798. fragment = cacheresults;
  799. }
  800. }
  801. }
  802. if (!fragment) {
  803. fragment = doc.createDocumentFragment();
  804. jQuery.clean(args, doc, fragment, scripts);
  805. }
  806. if (cacheable) {
  807. jQuery.fragments[args[0]] = cacheresults ? fragment : 1;
  808. }
  809. return { fragment: fragment, cacheable: cacheable };
  810. };
  811. jQuery.cache = {};
  812. jQuery.camelCase = function (string) {
  813. return string.replace(rdashAlpha, fcamelCase);
  814. };
  815. jQuery.clean = function (elems, context, fragment, scripts) {
  816. context = context || document;
  817. // !context.createElement fails in IE with an error but returns typeof 'object'
  818. if (typeof context.createElement === "undefined") {
  819. context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
  820. }
  821. var ret = [];
  822. for (var i = 0, elem; (elem = elems[i]) != null; i++) {
  823. if (typeof elem === "number") {
  824. elem += "";
  825. }
  826. if (!elem) {
  827. continue;
  828. }
  829. // Convert html string into DOM nodes
  830. if (typeof elem === "string" && !rhtml.test(elem)) {
  831. elem = context.createTextNode(elem);
  832. } else if (typeof elem === "string") {
  833. // Fix "XHTML"-style tags in all browsers
  834. elem = elem.replace(rxhtmlTag, "<$1></$2>");
  835. // Trim whitespace, otherwise indexOf won't work as expected
  836. var tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(),
  837. wrap = wrapMap[tag] || wrapMap._default,
  838. depth = wrap[0],
  839. div = context.createElement("div");
  840. // Go to html and back, then peel off extra wrappers
  841. div.innerHTML = wrap[1] + elem + wrap[2];
  842. // Move to the right depth
  843. while (depth--) {
  844. div = div.lastChild;
  845. }
  846. // Remove IE's autoinserted <tbody> from table fragments
  847. if (!jQuery.support.tbody) {
  848. // String was a <table>, *may* have spurious <tbody>
  849. var hasBody = rtbody.test(elem),
  850. tbody = tag === "table" && !hasBody ?
  851. div.firstChild && div.firstChild.childNodes :
  852. // String was a bare <thead> or <tfoot>
  853. wrap[1] === "<table>" && !hasBody ?
  854. div.childNodes :
  855. [];
  856. for (var j = tbody.length - 1; j >= 0; --j) {
  857. if (jQuery.nodeName(tbody[j], "tbody") && !tbody[j].childNodes.length) {
  858. tbody[j].parentNode.removeChild(tbody[j]);
  859. }
  860. }
  861. }
  862. // IE completely kills leading whitespace when innerHTML is used
  863. if (!jQuery.support.leadingWhitespace && rleadingWhitespace.test(elem)) {
  864. div.insertBefore(context.createTextNode(rleadingWhitespace.exec(elem)[0]), div.firstChild);
  865. }
  866. elem = div.childNodes;
  867. }
  868. if (elem.nodeType) {
  869. ret.push(elem);
  870. } else {
  871. ret = jQuery.merge(ret, elem);
  872. }
  873. }
  874. if (fragment) {
  875. for (i = 0; ret[i]; i++) {
  876. if (scripts && jQuery.nodeName(ret[i], "script") && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript")) {
  877. scripts.push(ret[i].parentNode ? ret[i].parentNode.removeChild(ret[i]) : ret[i]);
  878. } else {
  879. if (ret[i].nodeType === 1) {
  880. ret.splice.apply(ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))));
  881. }
  882. fragment.appendChild(ret[i]);
  883. }
  884. }
  885. }
  886. return ret;
  887. };
  888. jQuery.cleanData = function (elems) {
  889. var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
  890. deleteExpando = jQuery.support.deleteExpando;
  891. for (var i = 0, elem; (elem = elems[i]) != null; i++) {
  892. if (elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) {
  893. continue;
  894. }
  895. id = elem[jQuery.expando];
  896. if (id) {
  897. data = cache[id] && cache[id][internalKey];
  898. if (data && data.events) {
  899. for (var type in data.events) {
  900. if (special[type]) {
  901. jQuery.event.remove(elem, type);
  902. // This is a shortcut to avoid jQuery.event.remove's overhead
  903. } else {
  904. jQuery.removeEvent(elem, type, data.handle);
  905. }
  906. }
  907. // Null the DOM reference to avoid IE6/7/8 leak (#7054)
  908. if (data.handle) {
  909. data.handle.elem = null;
  910. }
  911. }
  912. if (deleteExpando) {
  913. delete elem[jQuery.expando];
  914. } else if (elem.removeAttribute) {
  915. elem.removeAttribute(jQuery.expando);
  916. }
  917. delete cache[id];
  918. }
  919. }
  920. };
  921. jQuery.clone = function (elem, dataAndEvents, deepDataAndEvents) {
  922. var clone = elem.cloneNode(true),
  923. srcElements,
  924. destElements,
  925. i;
  926. if (!jQuery.support.noCloneEvent && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
  927. // IE copies events bound via attachEvent when using cloneNode.
  928. // Calling detachEvent on the clone will also remove the events
  929. // from the original. In order to get around this, we use some
  930. // proprietary methods to clear the events. Thanks to MooTools
  931. // guys for this hotness.
  932. // Using Sizzle here is crazy slow, so we use getElementsByTagName
  933. // instead
  934. srcElements = elem.getElementsByTagName("*");
  935. destElements = clone.getElementsByTagName("*");
  936. // Weird iteration because IE will replace the length property
  937. // with an element if you are cloning the body and one of the
  938. // elements on the page has a name or id of "length"
  939. for (i = 0; srcElements[i]; ++i) {
  940. cloneFixAttributes(srcElements[i], destElements[i]);
  941. }
  942. cloneFixAttributes(elem, clone);
  943. }
  944. // Copy the events from the original to the clone
  945. if (dataAndEvents) {
  946. cloneCopyEvent(elem, clone);
  947. if (deepDataAndEvents && "getElementsByTagName" in elem) {
  948. srcElements = elem.getElementsByTagName("*");
  949. destElements = clone.getElementsByTagName("*");
  950. if (srcElements.length) {
  951. for (i = 0; srcElements[i]; ++i) {
  952. cloneCopyEvent(srcElements[i], destElements[i]);
  953. }
  954. }
  955. }
  956. }
  957. // Return the cloned set
  958. return clone;
  959. };
  960. jQuery.contains = function (a, b) {
  961. /// <summary>
  962. /// Check to see if a DOM node is within another DOM node.
  963. /// </summary>
  964. /// <param name="a" domElement="true">
  965. /// The DOM element that may contain the other element.
  966. /// </param>
  967. /// <param name="b" domElement="true">
  968. /// The DOM node that may be contained by the other element.
  969. /// </param>
  970. /// <returns type="Boolean" />
  971. return a !== b && (a.contains ? a.contains(b) : true);
  972. };
  973. jQuery.css = function (elem, name, extra) {
  974. // Make sure that we're working with the right name
  975. var ret, origName = jQuery.camelCase(name),
  976. hooks = jQuery.cssHooks[origName];
  977. name = jQuery.cssProps[origName] || origName;
  978. // If a hook was provided get the computed value from there
  979. if (hooks && "get" in hooks && (ret = hooks.get(elem, true, extra)) !== undefined) {
  980. return ret;
  981. // Otherwise, if a way to get the computed value exists, use that
  982. } else if (curCSS) {
  983. return curCSS(elem, name, origName);
  984. }
  985. };
  986. jQuery.cssHooks = { "opacity": {},
  987. "height": {},
  988. "width": {}
  989. };
  990. jQuery.cssNumber = { "zIndex": true,
  991. "fontWeight": true,
  992. "opacity": true,
  993. "zoom": true,
  994. "lineHeight": true
  995. };
  996. jQuery.cssProps = { "float": 'cssFloat' };
  997. jQuery.curCSS = function (elem, name, extra) {
  998. // Make sure that we're working with the right name
  999. var ret, origName = jQuery.camelCase(name),
  1000. hooks = jQuery.cssHooks[origName];
  1001. name = jQuery.cssProps[origName] || origName;
  1002. // If a hook was provided get the computed value from there
  1003. if (hooks && "get" in hooks && (ret = hooks.get(elem, true, extra)) !== undefined) {
  1004. return ret;
  1005. // Otherwise, if a way to get the computed value exists, use that
  1006. } else if (curCSS) {
  1007. return curCSS(elem, name, origName);
  1008. }
  1009. };
  1010. jQuery.data = function (elem, name, data, pvt /* Internal Use Only */) {
  1011. /// <summary>
  1012. /// 1: Store arbitrary data associated with the specified element.
  1013. /// 1.1 - jQuery.data(element, key, value)
  1014. /// 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.
  1015. /// 2.1 - jQuery.data(element, key)
  1016. /// 2.2 - jQuery.data(element)
  1017. /// </summary>
  1018. /// <param name="elem" domElement="true">
  1019. /// The DOM element to associate with the data.
  1020. /// </param>
  1021. /// <param name="name" type="String">
  1022. /// A string naming the piece of data to set.
  1023. /// </param>
  1024. /// <param name="data" type="Object">
  1025. /// The new data value.
  1026. /// </param>
  1027. /// <returns type="jQuery" />
  1028. if (!jQuery.acceptData(elem)) {
  1029. return;
  1030. }
  1031. var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
  1032. // We have to handle DOM nodes and JS objects differently because IE6-7
  1033. // can't GC object references properly across the DOM-JS boundary
  1034. isNode = elem.nodeType,
  1035. // Only DOM nodes need the global jQuery cache; JS object data is
  1036. // attached directly to the object so GC can occur automatically
  1037. cache = isNode ? jQuery.cache : elem,
  1038. // Only defining an ID for JS objects if its cache already exists allows
  1039. // the code to shortcut on the same path as a DOM node with no cache
  1040. id = isNode ? elem[jQuery.expando] : elem[jQuery.expando] && jQuery.expando;
  1041. // Avoid doing any more work than we need to when trying to get data on an
  1042. // object that has no data at all
  1043. if ((!id || (pvt && id && !cache[id][internalKey])) && getByName && data === undefined) {
  1044. return;
  1045. }
  1046. if (!id) {
  1047. // Only DOM nodes need a new unique ID for each element since their data
  1048. // ends up in the global cache
  1049. if (isNode) {
  1050. elem[jQuery.expando] = id = ++jQuery.uuid;
  1051. } else {
  1052. id = jQuery.expando;
  1053. }
  1054. }
  1055. if (!cache[id]) {
  1056. cache[id] = {};
  1057. }
  1058. // An object can be passed to jQuery.data instead of a key/value pair; this gets
  1059. // shallow copied over onto the existing cache
  1060. if (typeof name === "object") {
  1061. if (pvt) {
  1062. cache[id][internalKey] = jQuery.extend(cache[id][internalKey], name);
  1063. } else {
  1064. cache[id] = jQuery.extend(cache[id], name);
  1065. }
  1066. }
  1067. thisCache = cache[id];
  1068. // Internal jQuery data is stored in a separate object inside the object's data
  1069. // cache in order to avoid key collisions between internal data and user-defined
  1070. // data
  1071. if (pvt) {
  1072. if (!thisCache[internalKey]) {
  1073. thisCache[internalKey] = {};
  1074. }
  1075. thisCache = thisCache[internalKey];
  1076. }
  1077. if (data !== undefined) {
  1078. thisCache[name] = data;
  1079. }
  1080. // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
  1081. // not attempt to inspect the internal events object using jQuery.data, as this
  1082. // internal data object is undocumented and subject to change.
  1083. if (name === "events" && !thisCache[name]) {
  1084. return thisCache[internalKey] && thisCache[internalKey].events;
  1085. }
  1086. return getByName ? thisCache[name] : thisCache;
  1087. };
  1088. jQuery.dequeue = function (elem, type) {
  1089. /// <summary>
  1090. /// Execute the next function on the queue for the matched element.
  1091. /// </summary>
  1092. /// <param name="elem" domElement="true">
  1093. /// A DOM element from which to remove and execute a queued function.
  1094. /// </param>
  1095. /// <param name="type" type="String">
  1096. /// A string containing the name of the queue. Defaults to fx, the standard effects queue.
  1097. /// </param>
  1098. /// <returns type="jQuery" />
  1099. type = type || "fx";
  1100. var queue = jQuery.queue(elem, type),
  1101. fn = queue.shift();
  1102. // If the fx queue is dequeued, always remove the progress sentinel
  1103. if (fn === "inprogress") {
  1104. fn = queue.shift();
  1105. }
  1106. if (fn) {
  1107. // Add a progress sentinel to prevent the fx queue from being
  1108. // automatically dequeued
  1109. if (type === "fx") {
  1110. queue.unshift("inprogress");
  1111. }
  1112. fn.call(elem, function () {
  1113. jQuery.dequeue(elem, type);
  1114. });
  1115. }
  1116. if (!queue.length) {
  1117. jQuery.removeData(elem, type + "queue", true);
  1118. }
  1119. };
  1120. jQuery.dir = function (elem, dir, until) {
  1121. var matched = [],
  1122. cur = elem[dir];
  1123. while (cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery(cur).is(until))) {
  1124. if (cur.nodeType === 1) {
  1125. matched.push(cur);
  1126. }
  1127. cur = cur[dir];
  1128. }
  1129. return matched;
  1130. };
  1131. jQuery.each = function (object, callback, args) {
  1132. /// <summary>
  1133. /// 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.
  1134. /// </summary>
  1135. /// <param name="object" type="Object">
  1136. /// The object or array to iterate over.
  1137. /// </param>
  1138. /// <param name="callback" type="Function">
  1139. /// The function that will be executed on every object.
  1140. /// </param>
  1141. /// <returns type="Object" />
  1142. var name, i = 0,
  1143. length = object.length,
  1144. isObj = length === undefined || jQuery.isFunction(object);
  1145. if (args) {
  1146. if (isObj) {
  1147. for (name in object) {
  1148. if (callback.apply(object[name], args) === false) {
  1149. break;
  1150. }
  1151. }
  1152. } else {
  1153. for (; i < length; ) {
  1154. if (callback.apply(object[i++], args) === false) {
  1155. break;
  1156. }
  1157. }
  1158. }
  1159. // A special, fast, case for the most common use of each
  1160. } else {
  1161. if (isObj) {
  1162. for (name in object) {
  1163. if (callback.call(object[name], name, object[name]) === false) {
  1164. break;
  1165. }
  1166. }
  1167. } else {
  1168. for (var value = object[0];
  1169. i < length && callback.call(value, i, value) !== false; value = object[++i]) { }
  1170. }
  1171. }
  1172. return object;
  1173. };
  1174. jQuery.easing = {};
  1175. jQuery.error = function (msg) {
  1176. /// <summary>
  1177. /// Takes a string and throws an exception containing it.
  1178. /// </summary>
  1179. /// <param name="msg" type="String">
  1180. /// The message to send out.
  1181. /// </param>
  1182. throw msg;
  1183. };
  1184. jQuery.etag = {};
  1185. jQuery.event = { "global": {},
  1186. "props": ['altKey', 'attrChange', 'attrName', 'bubbles', 'button', 'cancelable', 'charCode', 'clientX', 'clientY', 'ctrlKey', 'currentTarget', 'data', 'detail', 'eventPhase', 'fromElement', 'handler', 'keyCode', 'layerX', 'layerY', 'metaKey', 'newValue', 'offsetX', 'offsetY', 'pageX', 'pageY', 'prevV…

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