Compare commits

...

2416 commits

Author SHA1 Message Date
Denis Knauf bb7d98f018 input type=datetime-local support for ajax. 2011-07-07 12:13:10 +02:00
jaubourg e6f8951983 Fixes #9632. Adds res:// protocol to the list of local protocols. 2011-07-01 02:18:05 +02:00
jaubourg e83fcdcb02 Fixes #9682. Removes data from the options for request with no content so that it is not used again in case of a retry. Unit test added. 2011-07-01 02:11:26 +02:00
jaubourg 139135a98a Fixes #9446. Context is properly propagated using pipe. If context was the original deferred, then context is updated to next deferred in the chain. Unit tests added. 2011-07-01 01:51:50 +02:00
jaubourg 5b92a5f5ec Replaces typo (status instead of state) as observed in #9585. 2011-07-01 00:16:34 +02:00
John Resig e2ab2ba1d5 Updating the source version to 1.6.3pre 2011-06-30 14:17:44 -04:00
John Resig aa6f8c8cd3 Tagging the 1.6.2 release. 2011-06-30 14:16:56 -04:00
timmywil ab1504f14f Set timerId to true instead of a number so that intervals set to 1 are not accidentally cleared when stopped. Fixes #9678.
- Adding a working test case would not be possible in this case, but all tests pass.
2011-06-28 11:46:03 -04:00
timmywil 96501d38a9 Allow similarly named classes (regression from 9499) and switch class retrieval to property when passing class to value functions. Fixes #9617. 2011-06-19 18:58:47 -04:00
Mike Sherov 124817e668 Landing pull request 413. Move border/padding checks to after width validation to avoid unnecessary fallbacks. Fixes #9598.
More Details:
 - https://github.com/jquery/jquery/pull/413
 - http://bugs.jquery.com/ticket/9300
 - http://bugs.jquery.com/ticket/9441
 - http://bugs.jquery.com/ticket/9598
2011-06-17 17:33:29 -04:00
John Resig d59b0f3e27 Re-updating QUnit, oops. 2011-06-14 15:06:28 -07:00
John Resig d269e426e0 Updating version in release notes script. 2011-06-14 15:05:27 -07:00
John Resig 138d5b7b81 Updating the source version to 1.6.2pre 2011-06-14 14:55:14 -07:00
John Resig d443e533aa Tagging the 1.6.2rc1 release. 2011-06-14 14:54:23 -07:00
Schalk Neethling 8a532d1575 Landing pull request 378. Comment typo in core.js.
More Details:
 - https://github.com/jquery/jquery/pull/378
2011-06-14 16:01:50 -04:00
rwldrn 5eef5917fd Landing pull request 409. Adds fillOpacity to internal cssNumber. Fixes #9548.
More Details:
 - https://github.com/jquery/jquery/pull/409
 - http://bugs.jquery.com/ticket/9548
2011-06-14 15:59:22 -04:00
Greg Hazel 13ceb0f56b Landing pull request 410. Moves jQuery attachment comment to outro.
More Details:
 - https://github.com/jquery/jquery/pull/410
2011-06-14 15:51:03 -04:00
rwldrn 6926247bf4 Landing pull request 397. withinElement rewrite in event. Fixes #6234, #9357, #9447.
More Details:
 - https://github.com/jquery/jquery/pull/397
 - http://bugs.jquery.com/ticket/6234
 - http://bugs.jquery.com/ticket/9357
 - http://bugs.jquery.com/ticket/9447
2011-06-14 15:38:46 -04:00
timmywil 641ad80211 Attribute hooks do not need to be attached in XML docs. Fixes #9568. 2011-06-13 10:02:13 -04:00
timmywil 39a2f29c29 Revert "Add catch block to try/finally in deferred. Fixes #9033. Test case needed." Line of exception was lost when debugging.
This reverts commit 0a80be67f4.
2011-06-08 10:55:52 -04:00
timmywil db437be6e3 Check classes passed for duplicates. Fixes #9499. 2011-06-07 21:00:44 -04:00
timmywil 0a80be67f4 Add catch block to try/finally in deferred. Fixes #9033. Test case needed. 2011-06-07 20:55:17 -04:00
timmywil d66c3b6d84 Remove fellback in width/height cssHook 2011-06-07 00:04:17 -04:00
rwldrn 6490c10c75 Landing pull request 401. Nulling all elements created in support.js; Fixes #9471.
More Details:
 - https://github.com/jquery/jquery/pull/401
 - http://bugs.jquery.com/ticket/9471
2011-06-06 23:54:17 -04:00
timmywil 75203de743 Optimize width/height retrieval (moved logic to getWH, removed adjustWH). Supplements #9441, #9300. 2011-06-06 23:35:16 -04:00
Mike Sherov 80ad14bd14 Add margin after checking width. Add tests. Fixes #9441. Fixes #9300. 2011-06-06 23:13:37 -04:00
rwldrn 0742056645 Landing pull request 403. Check for both camelized and hyphenated data property names; Fixes #9301.
More Details:
 - https://github.com/jquery/jquery/pull/403
 - http://bugs.jquery.com/ticket/9301
2011-06-06 20:18:36 -04:00
rwldrn c3c001cf5b Landing pull request 404. Removes unused hasOwn var declaration. Fixes #9510.
More Details:
 - https://github.com/jquery/jquery/pull/404
 - http://bugs.jquery.com/ticket/9510
2011-06-06 20:16:14 -04:00
timmywil 71d2e657d0 Update QUnit. 2011-06-06 20:15:16 -04:00
timmywil 1d202c6afc Move the value attrHook to the main attrHooks object to save bytes 2011-05-26 16:51:41 -04:00
timmywil 9d4033d629 Add test for appending an xml element to another. Supplements #9370. 2011-05-25 20:48:59 -04:00
timmywil bdce86dc2e Move window/document test to dimensions for consistency 2011-05-25 19:59:29 -04:00
timmywil edb2286544 Return null for outer/inner width/height calls on window/document. Fixes #7557. 2011-05-25 19:49:50 -04:00
timmywil 1d1cb582c0 elem.getElementsByTagName calls the function in IE6/7. Fixes #9370. 2011-05-25 19:35:52 -04:00
Scott Hughes 287156197f Landing pull request 389. Null elements in clone to avoid memory leak in IE. Fixes #9341.
More Details:
 - https://github.com/jquery/jquery/pull/389
 - http://bugs.jquery.com/ticket/9341
2011-05-25 15:18:13 -04:00
rwldrn 408c98fb4b Landing pull request 383. Relocating jQuery.camelCase to core; Fixes #9368.
More Details:
 - https://github.com/jquery/jquery/pull/383
 - http://bugs.jquery.com/ticket/9368
2011-05-25 15:10:49 -04:00
timmywil b8fc9d14a1 detachEvent is unnecessary since we're nulling div. Fixes #8873. 2011-05-25 15:08:37 -04:00
timmywil 657b197c19 Null created elements in support to avoid leaks in IE. Tested IE6-8. Leaks are contained to the byte. Fixes #9294. 2011-05-25 14:30:46 -04:00
timmywil a5396bde70 Attach background data to divs as well 2011-05-25 14:01:33 -04:00
timmywil e5457a5a1f Remove unnecessary background setting in support now that we have the div reversion. Test added. 2011-05-25 13:58:05 -04:00
Mathias Bynens b43910a496 Landing pull request 352. Slightly improved defaultDisplay() and Throbber of Doom. Fixes #8994.
More Details:
 - https://github.com/jquery/jquery/pull/352
 - http://bugs.jquery.com/ticket/8994
2011-05-20 11:22:52 -04:00
rwldrn f82b9dddc4 Landing pull request 382. Adds support for number values (meter,progress); Fixes #9319.
More Details:
 - https://github.com/jquery/jquery/pull/382
 - http://bugs.jquery.com/ticket/9319
2011-05-20 11:03:33 -04:00
timmywil a1545b5079 Unnecessary var removed. 2011-05-18 11:59:21 -04:00
timmywil 25118e22a2 Handle unset value attributes consistently depending on property existence. Supplements #9328. 2011-05-18 11:46:22 -04:00
timmywil ba90af0dc5 Make the value hook less obtrusive for elements which do not inherently have a value property. Fixes #9328. 2011-05-18 11:29:25 -04:00
timmywil 7d3ba9f89e Switched title attribute to getAttributeNode for IE6/7. Fixes #9329. 2011-05-18 11:05:20 -04:00
Rick Waldron c17f589ec9 Landing pull request 377. Check custom data != null(undefined), allows zero; Fixes #9285.
More Details:
 - https://github.com/jquery/jquery/pull/377
 - http://bugs.jquery.com/ticket/9285
2011-05-16 10:38:36 -04:00
timmywil a5cf257a8a Use getAttributeNode for ^on attributes in IE6/7 to avoid anonymous function wrapper. Fixes #9298. 2011-05-16 10:17:50 -04:00
timmywil 6171e0a923 Retrieve the class attribute on a form in IE6/7. Fixes 9286. 2011-05-14 12:07:40 -04:00
timmywil cf702496ee Removing unnecessary argument type check for boolean hook 2011-05-13 13:47:44 -04:00
timmywil bc82ff0ff9 Make sure setting boolean attributes to the same name sets the property to a boolean type 2011-05-13 13:39:38 -04:00
timmywil 6f676e692d Use prop to retrieve boolean properties (so the selected hook will be used) 2011-05-13 13:33:43 -04:00
Rick Waldron ec829431fe Landing pull request 365. jQuery.buildFragment, ensure doc is a document; Fixes #8950.
More Details:
 - https://github.com/jquery/jquery/pull/365
 - http://bugs.jquery.com/ticket/8950
2011-05-13 12:26:17 -04:00
timmywil a5b7c0fa33 Style edits for pull request 375 2011-05-13 12:14:31 -04:00
avaly cbbd7d28e1 Landing pull request 375. Added test case to support #9237 Fixes #9237.
More Details:
 - https://github.com/jquery/jquery/pull/375
 - http://bugs.jquery.com/ticket/9237
2011-05-13 12:09:49 -04:00
timmywil 3486365062 Animation callbacks keep their place in the queue stack. Fixes #9220. 2011-05-13 11:56:55 -04:00
jaubourg 0f81cf8991 Adds iframe code for #9239. 2011-05-13 17:50:57 +02:00
jaubourg ceba855c01 Fixes #9239. If the body is already present in the DOM, use a div within it to perform boxModel-related support tests. Unit test added. 2011-05-13 17:43:53 +02:00
John Resig b60c8560ce Updating the source version to 1.6.2pre 2011-05-12 15:04:51 -04:00
John Resig 9fd37b2c8a Tagging the 1.6.1 release. 2011-05-12 15:04:36 -04:00
timmywil 01c5b7f7f5 JR don't want my QUnit. 2011-05-11 12:02:41 -04:00
John Resig f794f48f02 Adding in test case to support #9211. 2011-05-11 11:43:37 -04:00
jaubourg 391398cf23 Fixes #9221. Wraps openings of html comments and CDATA blocks found at the beginning of inserted script elements into a javascript block comment so that the new implementation of globalEval will not throw an exception in IE (execScript being less lenient than eval). Unit tests added. 2011-05-11 14:13:07 +02:00
timmywil 3a1c27b508 Revert "Updating QUnit." This commit actually reverted QUnit.
This reverts commit f9cccd05b6.
2011-05-10 13:58:50 -04:00
John Resig 68d980bbb4 Updating the source version to 1.6.1pre 2011-05-10 13:50:49 -04:00
John Resig 344af56868 Tagging the 1.6.1rc1 release. 2011-05-10 13:50:35 -04:00
John Resig f9cccd05b6 Updating QUnit. 2011-05-10 13:50:21 -04:00
John Resig 2812a87da7 Updating Sizzle. 2011-05-10 13:37:05 -04:00
John Resig c42360b5be More formatting tweaking. 2011-05-10 12:57:55 -04:00
John Resig d2fea6123f Merge branch 'master' of github.com:jquery/jquery 2011-05-10 12:54:41 -04:00
John Resig c8374fafe5 Update sizzle. 2011-05-10 12:54:29 -04:00
timmywil d75c61a5bd Update QUnit 2011-05-10 12:46:55 -04:00
John Resig 1ec003f10c Fix tabs in delegate test. 2011-05-10 12:43:34 -04:00
John Resig a5e407cafb Make sure that data properties with hyphens are always accessed/set using camelCase. Fixes #9124. 2011-05-10 11:56:42 -04:00
John Resig 419b5e5e2a Make sure that mouseenter/mouseleave fire on the correct element when doing delegation. Fixes #9069. 2011-05-10 11:49:32 -04:00
louisremi 521ae562da Landing pull request 374. .animate() Callbacks should fire in correct order (unit test included). Fixes #9100.
More Details:
 - https://github.com/jquery/jquery/pull/374
 - https://github.com/jquery/jquery/issues/9100
2011-05-10 11:22:12 -04:00
Sahab Yazdani 304dd618b7 Landing pull request 370. Fixes #8763.
More Details:
 - https://github.com/jquery/jquery/pull/370
 - https://github.com/jquery/jquery/issues/8763
2011-05-10 11:20:22 -04:00
jaubourg 38de389a8e Adds unit/support.js to unit tests. Still have to test for #8763 has to be done in its own file however, since Firefox refuses to notify global errors in the iframe (attachEvent, window.onerror and script.onerror all fail). 2011-05-10 12:24:36 +02:00
louisremi 966c2fe46a oops console 2011-05-10 12:18:40 +02:00
timmywil 4526c8b0a0 Add fallback to prop for the window and document. Switch value to use the property instead of the attribute for back compat. 2011-05-10 00:28:02 -04:00
louisremi f34a90b3f7 oops unit test 2011-05-09 17:46:00 +02:00
louisremi 076c347605 .animate() Callbacks should fire in correct order (fix #9100 + unit test) 2011-05-09 17:35:51 +02:00
jaubourg 8c13cfa805 Fixes #9104. Returning null or undefined in a pipe callback shouldn't end up throwing an exception. Silly, silly, me. 2011-05-09 10:01:20 +02:00
jaubourg efd0fce7a1 Fixes #9109. When jQuery is loaded in the body, then the fake body element used in support has to be inserted before the document's body for boxModel to be properly detected (got the hint by looking at the code in jQuery mobile). Test page added so that we can keep checking this. 2011-05-09 09:48:23 +02:00
timmywil 18b1cf2942 Remove value check from formHook; other elements can use value hook 2011-05-07 22:01:10 -04:00
timmywil 90f37aaf7a Call extend on prop to avoid changing original properties so that per-property easing is not lost in multiple animations with the same props 2011-05-07 21:26:02 -04:00
timmywil 8bb6e95b66 Set val before hide/show check and fix easing setting; also update attributes test for autofocus
- The object passed should not change so it can be used in future animates, updated src and tests accordingly.
2011-05-07 20:46:38 -04:00
Daniel Pihlstrom 3d1c27d52e Fix per-property easing. Fixes #9067 2011-05-07 19:28:07 -04:00
gnarf 31268449b9 Landing pull request 372. Test for numeric properties was using wrong variable. Fixes #9074.
More Details:
 - https://github.com/jquery/jquery/pull/372
2011-05-07 19:18:52 -04:00
timmywil c085563270 Reduce the boolean list only to those that have corresponding IDLs that don't require being added to propFix; only set the IDL if it exists
- See http://jsfiddle.net/timmywil/u5NLn/ for how boolean attributes are handled in every browser.
2011-05-07 14:49:04 -04:00
timmywil 09c0cf995b Global found in valHook for select(get) 2011-05-07 11:48:42 -04:00
timmywil c864455ccf Global found in dataAttr function 2011-05-06 14:54:47 -04:00
timmywil c72b0f3256 Check empty string instead of specified as specified is inconsistent on the name attribute. Fixes #9148. 2011-05-06 13:49:20 -04:00
timmywil f7f8450041 tmp was global in the new fn.promise. Fixes #9147. 2011-05-06 12:10:16 -04:00
timmywil a257e07ae4 Reduce boolean attribute list to only content attributes
- Removed IDL-only boolean attributes as well as officially deprecated attributes that we've not supported before
2011-05-06 10:53:05 -04:00
timmywil f30cd4155e Update boolean attribute list to contain all boolean attributes listed in w3c 2011-05-05 14:37:59 -04:00
timmywil cccf9ad91d Add support for the contenteditable attribute 2011-05-05 12:52:04 -04:00
timmywil 5097e6d1c6 Construct boolHook and rboolean regex to deal with boolean attributes. Fixes #9129. Fixes #9123.
- Construct regex for all attributes which are boolean attributes by specification.

  + This allows us to do what users expect with enumerated attributes and allows us to no longer complicate the issue.

  + People are just too confused with passing "true" instead of true when they should, so we won't have to worry about that anymore.

- Modularize code for dealing with boolean attributes into a separate hook to keep attr short and fast.
2011-05-05 12:17:08 -04:00
timmywil 5195335cf4 Set the property corresponding to a boolean attribute when setting to true. Fixes #9103.
- Once boolean properties had been modified natively, setting the attribute no longer set the current value
2011-05-04 15:53:00 -04:00
timmywil 3ed4b22073 Run property names through propFix in removeProp 2011-05-04 11:40:46 -04:00
timmywil 480b88ca37 Set corresponding property to false when removing boolean attributes. Fixes #9094 2011-05-04 11:29:38 -04:00
timmywil 97144424cc Update boolean check to avoid crashes, add all name fixes to propFix (properties are case-sensitive in all browsers), add tests for prop 2011-05-04 00:31:01 -04:00
John Resig a9d9f8c542 If no hook is provided, and a boolean property exists, use that to return an attribute-style value for boolean attributes. Fixes #9079. 2011-05-03 21:44:42 -04:00
John Resig bfad45fe45 Fix problem with appending multiple string arguments in IE 6. Fixes #9072. 2011-05-03 15:02:26 -04:00
John Resig 3cdffce19f Updating release note script. 2011-05-03 15:01:29 -04:00
timmywil 4ac2fdda2c Fix setting value attributes on option elements. Fixes #9071. 2011-05-03 14:48:36 -04:00
timmywil 6d2fd57f45 Fix QUnit Header links 2011-05-02 18:14:12 -04:00
timmywil ea24cd106b Avoid changing html in two places; add minified jQuery as an option to the main test page 2011-05-02 17:53:55 -04:00
timmywil 3dbd7b54de Add a test page for running the test suite against a fully built and compressed jQuery. Fixes #7650. 2011-05-02 16:56:39 -04:00
John Resig 89fd9dffad Less aggressive semicolon insertion for the minified file. 2011-05-02 16:36:16 -04:00
John Resig f8a112f08e Ensure that an endline is in place at the end of the minified jQuery file. 2011-05-02 16:32:02 -04:00
John Resig f4b5d3fc51 Update the UglifyJS code. 2011-05-02 16:25:36 -04:00
John Resig c0d993903b Fix bug with handling minor releases after major releases in the build script. 2011-05-02 16:25:20 -04:00
John Resig 53f275034a Updating the source version to 1.6.1pre 2011-05-02 13:50:33 -04:00
John Resig eae7c4111c Tagging the 1.6 release. 2011-05-02 13:50:00 -04:00
John Resig ca338dc749 Check for #8984 wasn't strong enough, enhanced. 2011-05-02 13:31:23 -04:00
John Resig 6c449fd5df Make sure that empty nodelists continue to map properly. Fixes #8993. 2011-05-02 13:25:53 -04:00
John Resig 86aa764f0b Change check for skipping the initial quickExpr RegExp check. Fixes #8984. 2011-05-02 13:14:13 -04:00
timmywil f1392d8208 Set background to none on our mock body and remove its contents to avoid a crash in IE when removing it. Fixes #9028. 2011-05-02 11:57:01 -04:00
timmywil 24a8ffb3ea Test for a colon in attribute names for IE6/7. Fixes #1591. 2011-05-01 17:09:50 -04:00
Rick Waldron 0c2d1aee54 jQuery.buildFragment, ensure doc is a document; Includes comments; Adds unit test. Fixes #8950 2011-04-30 10:42:36 -04:00
Dave Methvin e2bace8fa1 Merged pull request #361 from rwldrn/9008a.
Restored /g flag to rspaces; Adds unit tests; Supplements #9008
2011-04-29 07:36:31 -07:00
Rick Waldron bf678fd9d6 Restores var names to satisfy the crock-machine. Supplements #9008 2011-04-28 22:26:34 -04:00
Rick Waldron ca367674c1 Restored /g flag to rspaces; Adds unit tests; Supplements #9008 2011-04-28 21:15:45 -04:00
Dave Methvin e5f4ec846c Merged pull request #360 from xavierm02/patch-3.
Javascript -> JavaScript
2011-04-28 16:18:05 -07:00
MONTILLET Xavier ebf2faca1e Javascript -> JavaScript except if it was intentional to avoid letting newbies think it's Java. 2011-04-28 14:56:52 -07:00
timmywil b8a9c2ba34 Syntax in testrunner 2011-04-28 16:31:51 -04:00
rwldrn 57f56be04f Make cached rspaces regex definitions consistent. Fixes #9008 2011-04-28 16:06:13 -04:00
rwldrn 632cd6c4ba Landing pull request 357. Update unit tests for widows & orphans. Supplements #8971 Fixes #8971.
More Details:
 - https://github.com/jquery/jquery/pull/357
 - http://bugs.jquery.com/ticket/8971
2011-04-28 15:56:02 -04:00
Rick Waldron ebac797ac2 Landing pull request 354. Adds QUnit Aliases to testrunner.js. Fixes #8991.
More Details:
 - https://github.com/jquery/jquery/pull/354
 - http://bugs.jquery.com/ticket/8991
2011-04-28 15:28:01 -04:00
timmywil c0450f3c2a Correct the attachment of the p tag in the widows/orphans tests. Fixes test suite in IE8 2011-04-27 16:33:12 -04:00
John Resig b5772da087 Add a simple script for generating the release notes of a pre-release. 2011-04-27 00:56:08 -04:00
John Resig a8988e3cd1 Adding a Node-based release management script for pushing new releases to the CDN. 2011-04-26 16:23:09 -04:00
John Resig fd11df1ec4 Updating the source version to 1.6pre 2011-04-26 16:22:07 -04:00
John Resig 455edf197a Tagging the 1.6rc1 release. 2011-04-26 16:21:45 -04:00
Julian Aubourg 742e15c638 Merged pull request #348 from rwldrn/8978.
jQuery.support core style guide correction. Fixes #8978
2011-04-26 07:08:14 -07:00
Rick Waldron 08f52d69bd jQuery.support core style guide correction. Fixes #8978 2011-04-26 09:45:27 -04:00
timmywil fb65ba418a Merged pull request #345 from rwldrn/8971.
No need to test for widows & orphans values in IE6-8. Fixes #8971
2011-04-25 12:53:43 -07:00
rwldrn 86d5d3e809 No need to test for widows & orphans values in IE6-8. Fixes #8971 2011-04-25 13:13:57 -04:00
timmywil 5165033883 Add tests data- and aria- attributes and the autofocus boolean attribute and some style updates in jQuery.attr 2011-04-25 12:41:12 -04:00
aFarkas 83e9ce95d7 handle data- and aria- special 2011-04-25 12:41:12 -04:00
aFarkas 9559b1a294 dealing with boolean content attribute 2011-04-25 12:41:12 -04:00
Jordan Boesch 02ad0aa3b6 Landing pull request 344. using jQuery.nodeName where applicable.
More Details:
 - https://github.com/jquery/jquery/pull/344
2011-04-23 17:58:56 -04:00
timmywil 15ccae91db Switch the form nodeName check in attr to use jQuery.nodeName for consistency 2011-04-23 13:56:51 -04:00
John Resig 9b00827ac9 Disabling .add(form.elements) unit test. 2011-04-22 00:51:23 -04:00
timmywil bc7bb0df28 Merge branch 'master' of github.com:jquery/jquery 2011-04-22 00:28:11 -04:00
timmywil 2942be780f Combine the support tests for radioValue and appendChecked 2011-04-22 00:27:52 -04:00
Rick Waldron 3d9445e3fc Landing pull request 340. Adds widows, orphans to cssNumber hash; includes tests. Fixes #8936.
More Details:
 - https://github.com/jquery/jquery/pull/340
 - http://bugs.jquery.com/ticket/8936
2011-04-22 00:02:08 -04:00
Dave Methvin 16312c6b06 Merge branch 'master' of github.com:jquery/jquery into fix-8790a-quicker-trigger 2011-04-21 22:15:21 -04:00
timmywil d274b7b9f7 Landing pull request 332. Appending disconnected radio or checkbox inputs and keeping checked setting Fixes #8060, #8500.
More Details:
 - https://github.com/jquery/jquery/pull/332
 - http://bugs.jquery.com/ticket/8060
 - http://bugs.jquery.com/ticket/8500
2011-04-21 21:51:23 -04:00
timmywil 3ac9eb7ce3 Landing pull request [337](https://github.com/jquery/jquery/pull/337). Value of radio inputs resets when type is set after the value in all IEs. Fixes #8570 ([bug](http://bugs.jquery.com/ticket/8570)). 2011-04-21 21:33:09 -04:00
timmywil dbe966aa57 Update Sizzle and QUnit 2011-04-21 13:03:19 -04:00
jaubourg a28eadff48 Makes sure no unload handler is bound when not in IE. Also simplifies the whole "on unload abort" code. Also avoids the declaration of yet another variables in the jQuery main closure for the temporary XHR used to assess support properties. 2011-04-21 18:43:40 +02:00
jeresig 60cfab3d19 Updating Sizzle and QUnit. 2011-04-20 19:08:29 -04:00
timmywil 103d325887 Follow w3c standard for setting the common boolean attributes to the same name(selected, checked, readOnly, and disabled) 2011-04-19 17:48:07 -04:00
timmywil 8d2d94cfba Fix test suite fails for hiding text nodes in F4 and IE9. Update for #6135. 2011-04-19 13:45:01 -04:00
timmywil 825d3d96ce Only use getAttributeNode on buttons when setting value 2011-04-19 13:17:38 -04:00
jaubourg 3a3842c669 (Re) Fixes #8884 in a way that keeps the format of the headers map sent to transports natural. 2011-04-19 00:29:20 -07:00
Rick Waldron 8d3754751d DRY out #6514 2011-04-17 15:29:49 -07:00
timmywil fb5ef2c4ec Merge branch 'master' of github.com:jquery/jquery 2011-04-17 18:18:40 -04:00
timmywil 34d80709ce Fix value attribute and val for value on button elements. Fixes #1954 2011-04-17 18:17:31 -04:00
John Resig 15da298f72 Remove unnecessary usage of Function.prototype.bind (#7783) but maintain API. Also fix bug with proxy failing when a name is provided. Fixes #8893. 2011-04-17 18:17:31 -04:00
John Resig 2a71493447 Updating UglifyJS. 2011-04-17 18:17:31 -04:00
Brian Brennan 3cb9c1835c Fix live mouseenter and mouseleave binding so they can be activated by triggers. Fixes #6514. 2011-04-17 18:17:31 -04:00
John Resig f408aa4314 Remove unnecessary usage of Function.prototype.bind (#7783) but maintain API. Also fix bug with proxy failing when a name is provided. Fixes #8893. 2011-04-17 14:11:40 -07:00
John Resig 2786a11053 Updating UglifyJS. 2011-04-17 13:28:36 -07:00
John Resig 7a8fac57eb Merge branch 'master' of github.com:jquery/jquery 2011-04-17 11:58:58 -07:00
Brian Brennan d46042e050 Fix live mouseenter and mouseleave binding so they can be activated by triggers. Fixes #6514. 2011-04-17 11:58:20 -07:00
timmywil 230a50ff1c Update Sizzle - qunit-fixture changes 2011-04-17 14:25:16 -04:00
timmywil 3aa46725ed Merge branch 'qunit_fixture' 2011-04-17 14:12:31 -04:00
timmywil 68cc3ad730 Update QUnit, fix visibility of #dl and pass JSLint in effects.js 2011-04-17 14:12:05 -04:00
John Resig 21c0be8496 Make sure that hide or show don't fail when operating on non-Element nodes. Fixes #6135. 2011-04-17 11:07:42 -07:00
John Resig 728a70c036 Make sure that forms and selects are added to a jQuery set correctly. Fixes #6912. 2011-04-17 10:51:24 -07:00
Gilmore Davidson a9b81d759a Added check for live mouseenter/mouseleave events if bound to nested elements with the same selector. Fixes #5884. 2011-04-17 10:34:38 -07:00
John Resig adef5c3550 Make sure that there isn't an error if no event object exists. Fixes #8755. 2011-04-17 10:21:46 -07:00
timmywil ecf6a3c383 Switch QUnit div from depreceted #main to #qunit-fixture 2011-04-17 02:43:57 -04:00
Dave Methvin 235080e125 Follow-up to #8790. Delay the creation of a jQuery.Event until we know it will need to be triggered. 2011-04-16 20:48:27 -04:00
John Resig 5d70c6d797 Add in unit tests for #6993. 2011-04-16 17:39:30 -07:00
John Resig 6e3b596514 Allow function to be passed in as a data object to bind and one. Fixes #6993. 2011-04-16 17:37:35 -07:00
John Resig 94ee3e9743 Cache references to navigator and location. Fixes #6690. 2011-04-16 14:18:56 -07:00
John Resig 5b197b6c5f Merge branch 'cellpadding_support' of https://github.com/timmywil/jquery into timmywil-cellpadding_support 2011-04-16 09:17:34 -07:00
John Resig 8312e2d852 Merge branch 'effectsCleanup' of https://github.com/louisremi/jquery into louisremi-effectsCleanup 2011-04-16 09:16:45 -07:00
John Resig ce7b311b92 Backing out fix for #6481. 2011-04-16 09:12:53 -07:00
jaubourg a519129e99 Removes now unnecessary regexp and companion function. Fixes some spacing issues. Shortens field names. 2011-04-15 14:16:43 -07:00
Sam Bisbee 4d3cb7d7ee Fixing code styling typo. 2011-04-15 16:45:45 -04:00
Sam Bisbee a9a79ccc6e Continuing to map request headers using their name in uppercase for the index, but we now map to an object with an unmodified name and value: { name: "", value: "" }. This prevents overwriting of the user's supplied headers, which many applications parse with case sensitivity, because we no longer use the modified, uppercase index when building the request. 2011-04-15 16:36:43 -04:00
Jordan Boesch 35d9425969 removing regex 2011-04-15 08:53:37 -06:00
louisremi bcc8187b05 undefined should be as good as null here 2011-04-15 16:33:21 +02:00
Jordan Boesch c4d0cccecf revert to old code, bug is invalid 2011-04-15 07:48:50 -06:00
louisremi 7bc8227d29 typo 2011-04-15 15:30:19 +02:00
louisremi 7666c3ef9a remove more useless code. feels good. 2011-04-15 15:18:21 +02:00
louisremi eccf15be6c - merge master
- move private functions at the bottom
- remove duplicate code
- move more var at the top of their scope
- rewrite a loop to be more efficient
2011-04-15 14:44:55 +02:00
timmywil b6d21592cb Add support for setting the cellPadding attribute in IE6/7 2011-04-14 23:11:49 -04:00
jeresig 8e1467f97e Updating the source version to 1.6pre. 2011-04-14 16:29:22 -04:00
jeresig 19ceebd0f4 Tagging the 1.6b1 release. 2011-04-14 16:29:14 -04:00
timmywil d4b31a15ff Adds box-sizing check for IE9 inputs and buttons 2011-04-14 16:26:20 -04:00
jeresig 1dda994c46 Merge branch '8099' of https://github.com/rwldrn/jquery. Fixes #8099.
Conflicts:
	test/data/testsuite.css
2011-04-14 15:57:47 -04:00
jeresig 84712bd624 Fix formatting of pull 325. Fixes #4146. 2011-04-14 15:49:15 -04:00
jeresig cdb02d09f1 Merge branch 'bug_4146_v2' of https://github.com/jboesch/jquery into jboesch-bug_4146_v2 2011-04-14 15:44:58 -04:00
louisremi 7dc7070426 reduce function calls
simplify easing resolution code
+ some code cleanup
2011-04-14 15:21:08 +02:00
louisremi 8806435a77 Merge branch 'master' of http://github.com/jquery/jquery into effectsCleanup 2011-04-14 11:46:29 +02:00
timmywil 38d6d9f6e0 Adjust the unit tests in traversing - is(jQuery) to avoid long-running script alerts 2011-04-14 00:46:10 -04:00
Jordan Boesch e64d3d4e57 fixing bug 4146 - round 2! 2011-04-13 22:30:30 -06:00
timmywil ca5bc202ac IE9's support for SVG elements unfortunately does not extend to clearAttributes. Checks for its presence before proceeding. 2011-04-13 23:45:58 -04:00
timmywil 149a040794 Fix test suite fail in IE6/7 on event:undelegate - was failing an if where it shouldn't 2011-04-13 23:14:14 -04:00
jeresig 72ddc8c645 Merge branch 'master' of github.com:jquery/jquery 2011-04-13 16:42:20 -04:00
jeresig 42e20269ec Updating Sizzle. 2011-04-13 16:41:55 -04:00
rwldrn a76decc476 Ticket #8099 Performance tweaking, credits 2011-04-13 15:43:15 -04:00
rwldrn 59240d31c0 Ticket #8099 Updates per review 2011-04-13 13:58:17 -04:00
rwldrn 4fde550cb6 Ticket #8099 Conditional iframe approache, caches both iframe and iframedoc for reuse 2011-04-13 13:43:52 -04:00
jaubourg 4ad9b44dea Ensures callback placeholders are tested for and eventually replaced in data only when contentType is application/x-www-form-urlencoded and data is a string. Removes json to jsonp promotion when jsonp or jsonpCallback options are present. Uses new Deferred.always method to bind cleanUp function. 2011-04-13 19:27:19 +02:00
jaubourg 4344d08417 Fixes #8635 again (fix was lost in rewrite). Also removes unnecessary "manual" garbage collection. 2011-04-13 18:35:38 +02:00
Dave Methvin f7f4ef91cf Merge branch 'fix_suite_fails' of https://github.com/timmywil/jquery into timmywil-fix_suite_fails 2011-04-12 19:42:35 -04:00
Dave Methvin 0032e30f75 Merge branch 'jslint_function_in_loop' of https://github.com/timmywil/jquery into timmywil-jslint_function_in_loop 2011-04-12 19:39:53 -04:00
timmywil 69866fd2e5 VML.type test was causing multiple test suite fails, fix attributes.js fail in IE6 where the val(String/Number) tests were interfering with the val(Function) tests 2011-04-12 19:32:18 -04:00
Dave Methvin bebd8bc01e Followup to #8753. Modify new Event constructor signature to jQuery.event(type, props), which can be exploited by jQuery.event.trigger as well. 2011-04-12 19:29:09 -04:00
rwldrn 81de96af74 Fixes #8099 using iframe to capture an element's real default display; suggested by lrbabe/louisremi 2011-04-12 18:57:14 -04:00
Dave Methvin 6d49e84daf Merge branch 'fix-8790-quick-trigger'
Conflicts:
	src/event.js
2011-04-12 18:46:21 -04:00
Dave Methvin 9e71ad1b12 Explicitly set event.type in case we chopped out a namespace or exclusive flag. 2011-04-12 18:32:23 -04:00
timmywil 73f9ab6705 JSLint failed due to function created within for loop 2011-04-12 18:30:21 -04:00
Dave Methvin 352715bd08 Use explicit "new jQuery.Event" to avoid double-function-call overhead. 2011-04-12 17:46:15 -04:00
John Firebaugh 0d8b247cab Accessing the 'type' property on VML elements fails on IE. Fixes #7071. 2011-04-12 16:48:22 -04:00
John Resig 3418f32387 Merge branch 'master' of https://github.com/rjgotten/jquery into rjgotten-master. Also added in unit tests covering the case. Fixes #6180.
Conflicts:
	src/manipulation.js
2011-04-12 16:39:30 -04:00
John Resig 122514a8da Merge branch 'master' of https://github.com/jclain/jquery into jclain-master 2011-04-12 16:26:41 -04:00
John Resig f1d75edec7 Merge branch 'bug_7931' of https://github.com/Xavi-/jquery into Xavi--bug_7931
Conflicts:
	src/offset.js
2011-04-12 16:13:56 -04:00
John Resig 978c065555 Merge branch 'Sub_Naming' of https://github.com/timmywil/jquery into timmywil-Sub_Naming
Conflicts:
	src/core.js
	src/css.js
	src/event.js
2011-04-12 16:05:40 -04:00
John Resig e7787cd098 More formatting tweaks. 2011-04-12 15:54:30 -04:00
John Resig 34adda3c88 Fixing some minor formatting problems. 2011-04-12 14:58:55 -04:00
John Resig b05d631b30 Merge branch 'fix-8790-quick-trigger' of https://github.com/dmethvin/jquery into dmethvin-fix-8790-quick-trigger 2011-04-12 14:57:30 -04:00
rwldrn 885b64d4e6 Fixes #8099 using iframe to capture an element's real default display; suggested by lrbabe/louisremi 2011-04-12 13:50:15 -04:00
rwldrn 7164615f67 Ticket 8099, Reattempt with iframe 2011-04-12 11:48:07 -04:00
louisremi f19a74f10b revert last commit 2011-04-12 13:12:58 +02:00
louisremi 01a2b51b26 switch double quotes with single quotes 2011-04-12 13:07:38 +02:00
louisremi 02e0047e92 resolve more conflicts 2011-04-12 11:39:21 +02:00
louisremi a5604aedb7 merge with master and resolve more conflicts 2011-04-12 11:29:25 +02:00
louisremi 8547b34f92 resolve conflict 2011-04-12 11:18:44 +02:00
louisremi f42010b657 third batch 2011-04-12 10:47:46 +02:00
jeresig 312df0441b Revert "QUnit test for overriding important css declarations, references #4427"
This reverts commit 1299e89dcd.

Conflicts:

	test/unit/css.js
2011-04-12 00:54:12 -04:00
jeresig 0ff4c69929 Some minor code cleanup. 2011-04-12 00:38:48 -04:00
jeresig db80ad94d5 Merge branch 'fix_8402' of https://github.com/lrbabe/jquery into lrbabe-fix_8402 2011-04-12 00:37:51 -04:00
jeresig 430d9e0b06 Merge branch 'fix_8403' of https://github.com/lrbabe/jquery into lrbabe-fix_8403 2011-04-12 00:35:51 -04:00
jeresig 7bfb6a7dd3 Removing un-needed frameElement check as discussed in #8018. Fixes #8108. 2011-04-12 00:29:52 -04:00
jeresig 0d755dff13 Merge branch 'master' of https://github.com/inukshuk/jquery into inukshuk-master
Conflicts:
	test/unit/offset.js
2011-04-12 00:25:36 -04:00
jeresig ea6987e078 Merge branch 'master' of https://github.com/azatoth/jquery 2011-04-12 00:18:12 -04:00
Azatoth 1299e89dcd QUnit test for overriding important css declarations, references #4427 2011-04-12 00:17:07 -04:00
jeresig 31b3c44db3 Merge branch 'bug_4366' of https://github.com/jboesch/jquery into jboesch-bug_4366 2011-04-12 00:12:27 -04:00
jeresig 2d27ac4d29 Merge branch 'master' of https://github.com/robmorgan/jquery into robmorgan-master 2011-04-12 00:09:46 -04:00
jeresig 0fa0f4cf02 Merge branch 'attr_remove_list_check' of https://github.com/timmywil/jquery into timmywil-attr_remove_list_check 2011-04-12 00:05:21 -04:00
timmywil 98da6b13bc Fixes unit/css.js test fail in Safari 5. support.js test was passing erroneously due to the body to which the div was attached having a width of 0 2011-04-11 23:59:12 -04:00
timmywil cb659c6054 retrieving list with getAttribute is fine, no need to add list here anymore 2011-04-11 19:30:20 -04:00
jaubourg 2b70893928 Bug fixes in queue.js: type in dequeue could be undefined which lead to a wrong data key, which would then have undesirable data left dangling on elements. Also adds missing semicolon in effects unit. 2011-04-12 01:09:35 +02:00
jaubourg f6f1cc77f4 Merge branch 'master' of github.com:jquery/jquery 2011-04-12 00:27:51 +02:00
louisremi 11adde5127 second batch 2011-04-11 22:33:29 +02:00
jeresig e9905b15d4 Merge branch '2773_firefox_opera_fix' of https://github.com/timmywil/jquery into timmywil-2773_firefox_opera_fix 2011-04-11 16:00:34 -04:00
louisremi 581fa82420 double quotes, again 2011-04-11 21:44:29 +02:00
louisremi cccd092fe0 first batch 2011-04-11 21:43:43 +02:00
louisremi 930731ba0f Double quote is the new simple quote 2011-04-11 21:33:15 +02:00
louisremi d710442201 the expected number of assertions shouldn't contain a condition 2011-04-11 21:14:41 +02:00
louisremi 6ddc3816dd limit this test to browsers not supporting opacity 2011-04-11 21:05:15 +02:00
louisremi 272b8d69dc replace cssPropsAware branch 2011-04-11 20:33:52 +02:00
Dave Methvin 7fa6de0ec1 Merge branch 'master' of github.com:jquery/jquery into fix-8790-quick-trigger 2011-04-11 13:25:57 -04:00
Dave Methvin a5071d49ba Shave some time off array setup in trigger/handle 2011-04-11 13:19:00 -04:00
louisremi 780b7983d0 Group all local functions at the top of the file and add comments 2011-04-11 19:01:04 +02:00
timmywil a564a0b1ec Run order problem when running full test suite in Opera 11, removed failing test as it passed by itself and there are others just like it 2011-04-11 12:24:31 -04:00
jeresig 094c48e0c5 Merge branch '8777' of https://github.com/rwldrn/jquery into rwldrn-8777
Conflicts:
	src/event.js
2011-04-11 12:13:04 -04:00
timmywil eb857e2b71 Fix unit tests in firefox 4 and opera 11, passing null or undefined to indexOf was throwing an error in those browsers 2011-04-11 11:54:55 -04:00
Dave Methvin 7957516671 Merge branch 'master' of github.com:jquery/jquery into fix-8790-quick-trigger
Conflicts:
	src/event.js
2011-04-11 11:44:26 -04:00
Rick Waldon 868e1e28ce Ticket #8753 Always set event type explicitly 2011-04-11 11:32:23 -04:00
Dave Methvin 1cca0817a0 Merge branch 'master' of github.com:jquery/jquery into fix-8790-quick-trigger 2011-04-11 11:25:27 -04:00
jeresig 6591f6dd9d Fix broken merge. 2011-04-11 11:22:52 -04:00
Dave Methvin 530c915553 Move initialization of event until we determine if anyone wants it. 2011-04-11 11:15:00 -04:00
jaubourg 4c3aba9a15 Merge branch 'master' of github.com:jquery/jquery 2011-04-11 13:41:17 +02:00
jaubourg 3411d47a6a Adds _mark and _unmark as a mean to keep track of ongoing non-queued animations in fn.promise. 2011-04-11 13:40:14 +02:00
Rob Morgan 91d0398813 Adding a full-stop 2011-04-11 12:32:45 +08:00
Rob Morgan 467747d55f Fixing typos in the README.md file 2011-04-11 12:24:38 +08:00
Dave Methvin bb52010442 Merge branch 'master' of github.com:jquery/jquery into fix-8790-quick-trigger 2011-04-10 17:40:31 -04:00
jeresig 56ffad2dad Merge branch '8101_lrbabe_requestAnimationFrame' of https://github.com/timmywil/jquery into timmywil-8101_lrbabe_requestAnimationFrame
Conflicts:
	src/effects.js
2011-04-10 17:27:34 -04:00
timmywil 791402b453 Separate raf function definition from passing it to requestAnimationFrame 2011-04-10 17:17:34 -04:00
jeresig 92dfb53314 Merge branch 'attrhooks.1.6v2' of https://github.com/timmywil/jquery 2011-04-10 17:11:35 -04:00
timmywil 215c507f79 Added back support.js test for getSetAttribute and removed some duplicate code that crept into attributes.js 2011-04-10 17:08:18 -04:00
jeresig f89edbc6e4 Merge branch 'modest_val_proposal' of https://github.com/timmywil/jquery into timmywil-modest_val_proposal
Conflicts:
	src/attributes.js
2011-04-10 16:56:56 -04:00
jeresig 14ecd9a992 Merge branch 'proxy-native-bind' of https://github.com/gf3/jquery into gf3-proxy-native-bind 2011-04-10 16:51:22 -04:00
jeresig 909a6ff60a Merge branch 'bug_7369' of https://github.com/timmywil/jquery into timmywil-bug_7369 2011-04-10 16:48:02 -04:00
jeresig 247363b9a7 Merge branch 'map-object.1.6' of https://github.com/danheberden/jquery into danheberden-map-object.1.6 2011-04-10 16:46:14 -04:00
jeresig 523db95de2 Merge branch '2773_find_closest' of https://github.com/timmywil/jquery into timmywil-2773_find_closest
Conflicts:
	test/unit/traversing.js
2011-04-10 16:37:09 -04:00
jeresig 52f31054fd Fix formatting. 2011-04-10 16:32:40 -04:00
jeresig b8fd1f03a6 Merge branch 'bug_2773' of https://github.com/timmywil/jquery into timmywil-bug_2773 2011-04-10 16:31:10 -04:00
jeresig 83dc078055 Bringing in the latest Sizzle code. 2011-04-10 16:28:44 -04:00
jeresig 2c74ee46ee Merge branch 'eventprops.1.6final' of https://github.com/rwldrn/jquery into rwldrn-eventprops.1.6final
Conflicts:
	test/unit/event.js
2011-04-10 16:28:15 -04:00
timmywil c10a76ec71 Merge branch 'master' into attrhooks.1.6v2 2011-04-10 16:26:39 -04:00
jeresig 7fb95ebe8f Merge branch 'attrhooks.1.6'
Conflicts:
	src/core.js
	src/support.js
2011-04-10 15:49:17 -04:00
jeresig b92d2f0bc9 Merge branch 'attrhooks.1.6v2' of https://github.com/timmywil/jquery into timmywil-attrhooks.1.6v2
Conflicts:
	src/attributes.js
2011-04-10 15:41:51 -04:00
timmywil da89d8768c Had some stale code in test/unit/attributes.js 2011-04-10 15:40:49 -04:00
jeresig 9ed5c774e4 Pulling in latest Sizzle. 2011-04-10 15:38:54 -04:00
Dave Methvin a019fc9ff3 Merge branch 'git_for_dummies' of https://github.com/azatoth/jquery into land-git-readme 2011-04-10 15:26:30 -04:00
Alexis Abril 8c318bf414 Fixes #7328. When getting data- attributes, after-cap any embedded dashes per the W3C HTML5 spec. 2011-04-10 15:17:00 -04:00
Rick Waldron 8c40c00fac Fixes #8814. Clean up inArray. 2011-04-10 14:31:31 -04:00
timmywil 3a1b4661f5 #8150 - When removing the width and height attributes in IE6/7, setting to "" actually sets to 0 instead of auto
- Having fixed this automatically with the use of removeAttribute in browsers that support it, this will fix it for IE6/7 as well.

- This has no effect on width/height styles set elsewhere( test added to removeAttr )

- With this addition, I need to call attr in removeAttr for IE6/7, which means boolean calls like .attr("checked", "") will no longer remove the attribute, which I think is fine.  .attr("checked", false) will still remove.  If I had left it, it would have gone in an infinite loop since setting to empty string is the only way to remove it in these browsers.

- The hrefNormalized hooks were returning null if they weren't present.  Added the null check to the getter.

- Now that the style support fails in IE8 as well due to uppercasing everything, no need to have style included with the hrefNormalized hooks
2011-04-09 17:25:06 -04:00
timmywil 17afd80d48 IE8 testing for lowercasing the css properties on retrieving style; had assumed the style support check failed in IE8, which it now does 2011-04-09 15:56:35 -04:00
Carl Fürstenberg 5dde3eb441 Git for dummies
Per request, here is an simple git for dummies quick sheet, with some
useful commands.
2011-04-08 22:09:53 +02:00
jaubourg f182b7b921 Adds a default falsy value for focusinBubbles + minor style consistency regarding test expression in support map initialization. 2011-04-08 18:24:25 +02:00
jaubourg 2594a935de Applies exception in Style Guidelines regarding objects and functions when they are the last argument of a function call. 2011-04-08 17:41:14 +02:00
jaubourg 7a1c6beab0 Renames chain as pipe. 2011-04-08 17:35:08 +02:00
Dave Methvin 98d83ef85f Fixes #8722. Remove try/catch used by #3533 to fix the IE Table Colon Blow bug, and instead check for colon in the event name. Thanks to daguej for scoping this out -- a colonoscopy you might say. 2011-04-07 22:52:15 -04:00
Dave Methvin c470db6950 Merge branch 'master' of github.com:jquery/jquery 2011-04-07 11:30:26 -04:00
Dave Methvin 14193e449e Create jQuery.holdReady(true/false) method to encapsulate jQuery.readyWait++ / jQuery.ready(true) logic. Fix problem where jQuery.ready may trigger twice, causing the (unsupported) document.onready to run twice. Fixes #8803 . 2011-04-07 11:26:42 -04:00
jaubourg 6832595ccd Merge branch 'master' of github.com:jquery/jquery
Conflicts:
	src/support.js
2011-04-07 06:56:19 +02:00
jaubourg c1dcad6942 Rewrite of the support module. We use a temporary body element in order not to have to wait for the document to be ready for boxModel-related support tests. 2011-04-07 06:51:37 +02:00
jaubourg f3c6077da0 Rewrite of globalEval. Uses window.execScript or window.eval with a trick to ensure proper context. Unit tests added. 2011-04-07 06:47:15 +02:00
jaubourg 4552d135f4 Adds fn.promise as a mean to observe the completion of animations on a set of elements. Only queued animations are handled for now, non-queued animations support coming soon. Effects unit tests updated to test the feature (needs more testing though). 2011-04-07 06:00:52 +02:00
jaubourg bb99899ca0 Adds always and chain methods to deferreds. 2011-04-07 05:49:32 +02:00
Dave Methvin 2f11ba7c98 Allow specific custom events to exit trigger early if there are no handlers bound for that type. 2011-04-06 23:41:47 -04:00
jaubourg 75a4bc4a4e Makes sure each animation tick has the same timestamp for all animations in the batch. 2011-04-07 05:07:20 +02:00
Dave Methvin bbd9c776ea Fix #8732. Change feature detect for focusin event support, so IE9 won't have duplicate events. 2011-04-06 23:06:52 -04:00
Dave Methvin b7dd8404c5 Fixes #8712. Bubble custom events to the window when they are triggered. Ride that, Cowboy! 2011-04-06 22:11:58 -04:00
Dave Methvin 879be3d812 Fix some spacing and comment issues that crept in with the rebase. 2011-04-06 11:34:41 -04:00
Dave Methvin 29386db319 Sadly, we still have to bubble the event so inline handlers will work. 2011-04-06 10:57:09 -04:00
Dave Methvin 246757bacd Only bubble a triggered event if we have attached a jQuery handler, but check the current element for an inline handler regardless. Make some other size optimizations as well. 2011-04-06 10:57:07 -04:00
Dave Methvin bfa32317d2 Switch from recursion to iteration for event triggering. Move event-name namespace processing out of event handler, since it has to always go through trigger. 2011-04-06 10:50:31 -04:00
carpie e0856738e6 Skip id regex check when large html strings are passed to the jQuery constructor (#7990). 2011-04-05 23:18:35 -04:00
Dave Methvin ceaf093942 Merge branch 'cssrelative.1.6' of https://github.com/danheberden/jquery into danheberden-cssrelative.1.6 2011-04-05 22:40:59 -04:00
timmywil d47c0ae422 Performance testing: localize val to each block and only set val to value when not a function 2011-04-05 22:40:12 -04:00
Dave Methvin 0fbadbcced Merge branch 'domready' of https://github.com/cowboy/jquery 2011-04-05 22:24:40 -04:00
Dave Methvin 1e85027dee Merge branch '4321' of https://github.com/rwldrn/jquery into rwldrn-4321 2011-04-05 22:04:05 -04:00
Dave Methvin c1316a4cb1 Shorten up the code and do event cleanup on test cases. 2011-04-05 21:59:09 -04:00
Dave Methvin b5c7c507c1 Merge branch 'ticket_7883' of https://github.com/rwldrn/jquery into rwldrn-ticket_7883 2011-04-05 21:42:58 -04:00
rwldrn 4b0c26f0af Ticket #8777 undelegate by namespace 2011-04-05 18:55:07 -04:00
rwldrn 92a4d59c32 Remove this.type assignment 2011-04-05 16:32:42 -04:00
timmywil 9db18ddd84 Per rwaldron's request, added oRequestAnimationFrame as a possibility 2011-04-05 16:28:25 -04:00
rwldrn b1b2e83394 Move this.type setting to after prop set; avoid setting twice 2011-04-05 16:20:55 -04:00
rwldrn 23a411b6bc Ticket #8753 Allow special properties to explicitly defined on jQuery.Event objects 2011-04-05 15:55:40 -04:00
Dan Heberden c0389e3e37 Add missing var declaration for 2011-04-05 08:33:14 -07:00
Dan Heberden 3609bed9e7 Remove extra else in parseJSON 2011-04-05 07:20:58 -07:00
Dan Heberden a7e7dbd978 Bug 7587; Enhancement/1.6 Feature: Bypass regexp filter on $.parseJSON and use native thrown exceptions if window.JSON.parse is available 2011-04-05 01:43:14 -07:00
Dan Heberden c72371f714 Improve speed of $.map with object support (-5% previous speed) and improve .length detection 2011-04-04 23:59:54 -07:00
Dan Heberden 44a3b5839e Improve relative string performance in .css and some code cleanup 2011-04-04 16:48:24 -07:00
timmywil fe3203bb5b Some adjustments and style edits on lrbabe's pull for requestAnimationFrame
- Moved support.js check to effects.js.  This is just an assignment to the function if it exists.  Removed string concatenations.

  + Still need to do the checks on window, but after that, window is no longer needed.

- Switched ternary to an if statmenet

- assigned timerId to a number rather than the function. I did perf tests to check which is faster.
2011-04-04 19:25:12 -04:00
louisremi 5b0369366a shorten requestAnimationFrame test 2011-04-04 15:47:19 -04:00
louisremi c95ab2a39c first tick should not occur immediatly; no tick should happen after a stop()
+ comments
2011-04-04 15:46:37 -04:00
louisremi 15e34d1f07 reduce impact of requestAnimationFrame on incompatible browsers by minimizing number of lookups 2011-04-04 15:46:37 -04:00
louisremi 03e6f7235b there was no way to 'manually' stop an animation 2011-04-04 15:46:37 -04:00
louisremi 6de29b24b1 timerId has to be set to true, to avoid starting multiple animation queues 2011-04-04 15:46:37 -04:00
louisremi 933ea8c5fa 'this' is the window 2011-04-04 15:46:37 -04:00
louisremi 9dc6397187 omitting 'window.' was causing undefined errors 2011-04-04 15:46:37 -04:00
louisremi f7ccec1b70 use requestAnimationFrame instead of setInterval for animations, when available. 2011-04-04 15:46:37 -04:00
timmywil 94fff6ff62 Remove the unused radiocheck regex 2011-04-04 14:22:58 -04:00
Dan Heberden 123dd72e80 Bug 7345; Add support for explicit/relative string values in .css - modified from original pull req by brandonaron #78 2011-04-04 11:21:15 -07:00
jaubourg 2ed81b44be Fixes #8744. Makes sure script transport abort method actually removes the script tag even if readyState exists. 2011-04-04 17:41:30 +02:00
timmywil 6f79bee3e3 Normalize css property names to lowercase for comparisons on a .attr('style') call since IE uppercases everything 2011-04-03 19:13:41 -04:00
timmywil ad2b3bc9f9 Found a problem removing the style attribute in IE
- Style is now a special case in IE6/7 to set cssText.  My goal is to avoid calling attr again for the performance benefit, and at this point it would also cause an infinite loop for the boolean attributes hooks such as selected & checked.  Nevertheless, style seems to be the only one requiring a special call.
2011-04-03 19:13:41 -04:00
timmywil 2a8a2b6148 Move the if statement in jQuery.fn.removeAttr to jQuery.removeAttr
- Extra testing on removeAttr and IE form weirdness( all good )
2011-04-03 19:13:41 -04:00
timmywil ff75767558 Minor adjustments and cleanup, including normalizing the value to a string when setting( list of changes below )
- Normalize set value to string to synchronize return type cross-browser

- Add style attrHook to propHooks to support style getting in all browsers for both attr and prop

- Extend the selected propHook instead of overriding a possible set function

- Remove selected propHook TODO since there is no selected content attribute and it should return null
2011-04-03 19:13:41 -04:00
timmywil 8cbf551a48 #5413 - Much shorter solution for getting width/height in ie6
- #8255 Added support for the list attribute in browsers that support it (it is automatically readonly, but can be set if using getAttribute( name, 2)
2011-04-03 19:13:41 -04:00
timmywil 5fc2281fcc - Added a hook to swap display none for width and height in browsers that do not sufficiently support get/setAttribute 2011-04-03 19:13:41 -04:00
timmywil 1e9b3ef3d8 Move the check for the name attribute out of attr and down to the formHook definition 2011-04-03 19:13:41 -04:00
timmywil fa4373c11b Add style attribute support tests to $.attr 2011-04-03 19:13:41 -04:00
timmywil a4d44979c6 Shorten the logic for hooks, ternary was unnecessary 2011-04-03 19:13:41 -04:00
timmywil 217a7abc43 Add name to prop hooks as well 2011-04-03 19:13:41 -04:00
timmywil 11c97bb066 Add attribute name to paramaters for hooks 2011-04-03 19:13:40 -04:00
timmywil 03da4c7ca7 Style formatting 2011-04-03 19:13:40 -04:00
timmywil 448111cbd4 No longer need to check for objects or string of null with the special form treatment and updates to removeAttr 2011-04-03 19:13:40 -04:00
timmywil 5caf7d8376 Clean up 2011-04-03 19:13:40 -04:00
timmywil 56014a1a00 Shorten even further 2011-04-03 19:13:40 -04:00
timmywil 479b28fb6a Modularize special form code for IE6/7 and clean up attr again 2011-04-03 19:13:40 -04:00
timmywil e0900a686d Fix issue where non-existant attributes on forms in IE6/7 were throwing errors 2011-04-03 19:13:40 -04:00
timmywil 3892df207d Add test for bug #3116 2011-04-03 19:13:40 -04:00
timmywil 47c80c2050 Add test for bug#3685, remove added html and add dynamicly to avoid global test suite errors 2011-04-03 19:13:40 -04:00
timmywil 9e05a0a37f Fix #6562, tighten up the special code for form objects, add name attrHook for IE6/7, and don't check for undefined with getting hook'd attr 2011-04-03 19:13:40 -04:00
timmywil 102053abd8 Fix #7472 and added test for #3113
- Forms with an input that has either name="action" or name="some-other-attr-on-the-form" caused problems in IE6/7.  This is fixed.

- Changed check in $.attr for ret === null to typeof ret === "object" to catch any inputs that are accidentally retrieved in IE6/7, since attributes cannot be set to objects and typeof null === "object"
2011-04-03 19:13:39 -04:00
timmywil 11cfdb2394 Non-existent attribute for jQuery.attr no longer needs to check for "undefined"
- Remove an unnecessary var

- Use variable in removeAttr for better minification
2011-04-03 19:13:39 -04:00
timmywil dfeeb872d6 Performance enhancement switching nodeType to a var 2011-04-03 19:13:39 -04:00
timmywil d28922bc03 Pass jslint, 2 missing semicolons 2011-04-03 19:13:39 -04:00
timmywil 2580420b7e Test description 2011-04-03 19:13:39 -04:00
timmywil 5ac6ca3fa5 Restored 6 tests that I had commented to come back to later to split up between prop and attr. All tests still pass in all browsers.
- I should make it clear that I have not removed any tests, but only moved some attr tests to prop where I thought it was appropriate.
2011-04-03 19:13:39 -04:00
timmywil dbe3b7a9d0 Style edits according to comments from John and rwaldron. 2011-04-03 19:13:39 -04:00
timmywil f578e0f997 Don't use extend when setting the action attrHook for IE6/7 2011-04-03 19:13:39 -04:00
timmywil 77c559c3cb No, don't return this. 2011-04-03 19:13:39 -04:00
timmywil b85d2cd8a5 Simplify jQuery.removeAttr and return this 2011-04-03 19:13:39 -04:00
timmywil 9f88fa9165 Full test suite now passes in all browsers! There are probably some tweaks we can make to shorten and simplify.
- removeAttr now only uses setAttribute if camelCase setAttribute is not supported

  + Might want to rename jQuery.support.getSetAttribute

- tabIndex is a special case now for hooks where undefined should be returned.

  + Should we be checking if hooks returns undefined?  undefined might be the desired return value in future hooks.
    As of now, tabIndex is the only one that needs it, but the test suite will still pass if we don't check if hooks are undefined.
2011-04-03 19:13:39 -04:00
timmywil 8cd30c62d8 Continuing IE7 testing, conditional attr fixes and hooks with feature testing. Will figure out a way to shorten after the test suite passes. 2011-04-03 19:13:39 -04:00
timmywil ebb8e8e300 Fix feature test, accidentally got rid of closure end 2011-04-03 19:13:39 -04:00
timmywil 00abeaee17 Didn't actually need the hooks anymore 2011-04-03 19:13:38 -04:00
timmywil 4baa213d88 First proposed solution for IE6/7 get/setAttribute quirks. Needs more testing, but solves some issues 2011-04-03 19:13:38 -04:00
timmywil 607210e010 Speed up hasAttr a little 2011-04-03 19:13:38 -04:00
timmywil 5eecb13fa3 Now passes in IE8, changed around $.hasAttr and switched the attrHook for selected to be a propHook 2011-04-03 19:13:38 -04:00
timmywil de79e8c7e0 Make the new attr/prop changes pass the test suite (in Webkit). There are still errors in IE.
+ Added hooks for selected, checked, readonly, disabled to removeAttr if set to falsey

+ Removed all attrs from attrFix, these aren't needed for setAttribute

+ If prop is used for class, do we want a propFix for class?

  - We could just assume the user should know to use className with prop.  I've done the latter for now.

+ Created tests for $.fn.prop and $.fn.removeProp

  - Actually all I did was change broken attr tests to prop where it made sense.
2011-04-03 19:13:38 -04:00
jeresig ab4e300919 Very crude first pass at splitting apart the attr/prop logic. Also adding in attrHooks/propHooks. All of it is completely untested. 2011-04-03 19:13:38 -04:00
timmywil 64a0005a3b A more modest valHooks proposal
- The main difference is that this does not allow arbitrarily adding hooks to any collection of elements.

- Modularizes val into a set of easily maintainable and conditional hooks.

- valHooks is placed at jQuery.valHooks

  + This could technically be extended, but I do not see it being used except in very rare cases since you can only apply valHooks to nodeNames and input types, and not a collection of elements as before. We could theoretically privatize valHooks taking it off of jQuery and only use it internally for our own convenience, but again, I do not believe this patch carries with it the dangers of the first proposal.

- Slightly improved performance of val on radios and checkboxes for browsers that support checkOn, given the conditional attachment of its hook.
2011-04-02 17:05:04 -04:00
John Resig fcc112f406 Updating the source version to 1.6pre. 2011-03-31 15:28:33 -04:00
John Resig a507f719ab Tagging the 1.5.2 release. 2011-03-31 15:28:23 -04:00
Ben Alman de0c25bef4 Updated DOM ready unit tests. 2011-03-31 13:36:16 -04:00
Ben Alman 368bfc0fe0 DOM Ready unit tests (but not the supporting fixed code). 2011-03-31 11:37:48 -04:00
Dave Methvin ff06d411d2 Merge branch 'bug_8316' of https://github.com/timmywil/jquery into timmywil-bug_8316 2011-03-31 10:25:59 -04:00
Dave Methvin 459bd7f89d Followup commit for #7340 test case; make sure second test fires properly on IE by focusing to another element rather than blurring off the first. 2011-03-31 09:10:30 -04:00
timmywil f9cc5597a4 Fix test cases for bug #8316 fix.
- Removed special page, just needed another test in the fixed offset tests

- Checks it's position related to scrolling
2011-03-31 02:55:16 -04:00
timmywil a807451a23 Fixes #7369 - Using an attribute selector for a non-existent attribute raised an exception on disconnected nodes 2011-03-30 23:39:19 -04:00
timmywil 1a16776730 Remove test for bug #7369 to move the fix to a separate branch for a sooner pull 2011-03-30 23:23:38 -04:00
Dave Methvin 6c28a394c2 Remove crossDomain:null comment, it's not needed since undefined==null below. 2011-03-30 21:59:38 -04:00
timmywil 6da3885cc3 Merge branch 'master' of git://github.com/jquery/jquery into 2773_find_closest 2011-03-30 21:52:09 -04:00
Dave Methvin adbe5e95f3 Merge branch 'crossDomain' of https://github.com/JessThrysoee/jquery into JessThrysoee-crossDomain 2011-03-30 21:52:04 -04:00
Dave Methvin ad4152709c Fixes #8203. Remove some misguided nulling of elements done in the name of IE memory cleanup. Based on a patch by davidmurdoch in pull 226. 2011-03-30 21:21:49 -04:00
John Resig 8cdafe7704 Merge branch 'makefile_fixes' of https://github.com/azatoth/jquery into azatoth-makefile_fixes 2011-03-30 15:23:31 -04:00
John Resig b89b66657c Merge branch 'fix_8346' of https://github.com/lrbabe/jquery into lrbabe-fix_8346 2011-03-30 14:54:52 -04:00
Jordan Boesch 926884bf1f Bug 4366; removing extra space 2011-03-30 11:26:20 -06:00
Jordan Boesch 3296116041 Bug 4366; fixing $.each(document.styleSheets) from throwing errors in IE 2011-03-30 11:17:48 -06:00
jaubourg f2ce87df8e Fixes #8692. Strange FF4 bug: values changed onto the arguments object sometimes end up as undefined values outside the $.when method. Cloning the object into a fresh array solves the issue. 2011-03-30 18:54:32 +02:00
John Resig 2555a5a232 Update the Sizzle location to point to the newly-moved repo. 2011-03-28 13:10:12 -04:00
rwldrn ef0157d191 Bug #8635 Firefox uncaught exception 2011-03-28 12:31:03 -04:00
timmywil e93ca40aa7 Bug #7369: Check non-existent attribute as well to be sure 2011-03-25 23:52:36 -04:00
timmywil e6da0fa6a9 Bug #7369: Add test for disconnected node in closest when passing attribute selector; this was recently fixed in 1.5.2rc 2011-03-25 23:46:29 -04:00
jeresig ee81d4da92 Merge branch 'bug-3333' of https://github.com/rdworth/jquery 2011-03-24 22:10:38 -04:00
jeresig 23e8cc5608 Updating the source version to 1.5.2pre. 2011-03-24 20:12:40 -04:00
jeresig 2d80710ab0 Tagging the 1.5.2rc1 release. 2011-03-24 20:12:31 -04:00
jeresig d86c48679a Land new sizzle commit. 2011-03-24 20:08:40 -04:00
Richard Worth 735a949a06 Further fix for #3333, refactored marginRight css hook to use jQuery.swap and computed. Thanks timmywil 2011-03-24 19:55:55 -04:00
jeresig 7b985c4ca0 Oops, that test file for bug #8316 was needed - was also missing an include and was causing errors. 2011-03-24 19:52:45 -04:00
jeresig 5ee4eefb9e Updating Sizzle submodule to bring in the latest commit. 2011-03-24 19:40:09 -04:00
jeresig 53697d10ef Fix missing semicolon. 2011-03-24 19:36:38 -04:00
Michael Murray e8f4629b92 Offset setter for fixed position elements in Webkit. Fixes #8316. 2011-03-24 19:02:38 -04:00
jeresig 1912ded3ee Merge branch 'bug-3333' of https://github.com/rdworth/jquery into rdworth-bug-3333 2011-03-24 18:58:20 -04:00
Richard Worth c3c507e900 Added css hook to work around bug in WebKit computed margin-right. Fixes #3333 - .css("marginRight") is incorrect in WebKit 2011-03-24 15:41:46 -04:00
timmywil 85232c97bf Traversing unit tests: added tests for passing invalid arguments to $.fn.not (should have no effect on existing object rather than return an empty object as filter does) 2011-03-23 16:04:12 -04:00
timmywil d2eafa0bb8 Merge branch 'master' of git://github.com/jquery/jquery into bug_2773 2011-03-23 15:59:33 -04:00
timmywil b8013581ce Closest unit tests: add one for passing a jQuery collection with multiple elements 2011-03-23 15:56:05 -04:00
Carl Fürstenberg 50e8837207 Makefile: pull_submodules cleaning
Empirical testing confirms that pulling the url again is enough
2011-03-22 23:18:15 +01:00
Carl Fürstenberg 07392bb090 Merge branch 'master' into makefile_fixes 2011-03-22 21:55:49 +01:00
timmywil e09d8898d8 Add node and jQuery object support to $.fn.closest 2011-03-21 20:59:20 -04:00
Dan Heberden 00dd6013b6 Clean up tab spacing 2011-03-21 12:24:53 -07:00
Dan Heberden d832f4f71e jQuery.map to iterate over objects with a .length property 2011-03-21 12:12:31 -07:00
Dan Heberden e38f074d14 jQuery.map to conform with style guidelines - improved size/DRY code 2011-03-21 08:39:53 -07:00
Dan Heberden 2407690ef9 Fixes 2616; Pull in #252 by jboesch: jQuery.map with object support 2011-03-21 08:10:27 -07:00
Dan Heberden f0e7d28e83 Merge branch 'bug_2616' of https://github.com/jboesch/jquery into map-object.1.6
* 'bug_2616' of https://github.com/jboesch/jquery:
  Bug 2616; Adding object support to jQuery.map
2011-03-21 08:04:35 -07:00
jeresig 7705c35b14 Merge branch 'fix-8456-lost-mouseenter' of https://github.com/dmethvin/jquery into dmethvin-fix-8456-lost-mouseenter 2011-03-21 10:53:57 -04:00
jeresig 5c79f82ec2 Merge branch 'fix-7340-focusin-focusout-bubble' of https://github.com/dmethvin/jquery into dmethvin-fix-7340-focusin-focusout-bubble 2011-03-21 10:53:18 -04:00
Carl Fürstenberg 8a1156da9b merge doesn't work when init
sadly the merge strategy doesn't work when doing an initial clone,
circumvent that
2011-03-18 17:59:16 +01:00
Carl Fürstenberg e2dd8916ee Adding core target
Adding core target to do jquery, minimization and lint
2011-03-18 17:59:09 +01:00
Carl Fürstenberg b4acb7ae81 updating phony rules 2011-03-17 20:23:20 +01:00
Carl Fürstenberg 4f9e78616e Change makefile order to only update submodules on 'all' target
insterad of always update the submodules, now only "make all" will run
that, thus an "make jquery" will not update them
2011-03-17 20:21:32 +01:00
Carl Fürstenberg 22738e0e4b Remove jq target
remove obsolete jq target
2011-03-17 20:20:02 +01:00
Carl Fürstenberg a2faed347d Merge when updating submodules on make
When  running make, the submodule update will remove all local changes.
Adding flag --rebase or --merge does solve the issue. rebase will
probably make it cleaner, but it might stop on conflict, thus --merge
will result in fewer (probably none).
2011-03-17 19:50:53 +01:00
timmywil eb1497c1fb Merge branch 'master' of git://github.com/jquery/jquery into 2773_find_closest 2011-03-16 14:44:31 -04:00
timmywil 929792834f Organizing vars 2011-03-16 14:41:26 -04:00
timmywil 7a69e34a5c 2773: first pass adding node/jQuery object support to jQuery.fn.find; unit tests added 2011-03-16 01:16:32 -04:00
Carl Fürstenberg 51abb3dc07 Changing dependice order for minify to prevent reminify
unless jquery.js has been updated, no minification should occur

closes: #8519
2011-03-16 01:44:05 +01:00
John Resig 0cf336d2c9 Merge branch 'bug_6158' of https://github.com/jboesch/jquery into jboesch-bug_6158 2011-03-15 17:06:24 -04:00
Carl Fürstenberg bd4468886d adding pull command 2011-03-15 21:42:58 +01:00
Carl Fürstenberg cd2ca7b591 pull submodules make command
Adding an helper funciton to pull the latest from all registered
submodules
2011-03-15 21:25:51 +01:00
Carl Fürstenberg 150d3decb5 Introduce submodules, closes #8536
Instead of the manual clone of sizzle and qunit, use git submodules
instead. this will ensure that all future releases can be recreated by
checking out an tag.
2011-03-15 20:16:09 +01:00
jaubourg 714ae379db Fixes #8509. Makes URL regexp less overzealous and ensures it recognizes URL schemes which do not contain a conformant hierarchical structure ( as per section 2.1.2 of http://www.ietf.org/rfc/rfc2718.txt ). Also adds about: and adobe air's app: and app-storage: to the list of local protocols and provides a failover in case document.location is illformed. Unit test added. 2011-03-15 19:20:03 +01:00
Jordan Boesch 124acbfbc5 removing parens 2011-03-14 14:17:02 -06:00
timmywil 8246347b71 Starting with adding the test 2011-03-13 21:12:10 -04:00
JessThrysoee 11c26b3cc9 no need to specifically initialize crossDomain to null 2011-03-11 17:46:59 +01:00
JessThrysoee 515c56f9c6 Make it possible to force the Ajax crossDomain option to false. 2011-03-11 00:17:38 +01:00
Dave Methvin 2ac4067a63 Fixes #8456. Make sure parent is not null before crawling into its lap, so mouseenter is triggered on a mouseover event. 2011-03-09 22:38:26 -05:00
louisremi c6b891fb1c Adding unit tests for #8403 2011-03-07 14:43:08 +01:00
jeresig d4e4414451 Very crude first pass at splitting apart the attr/prop logic. Also adding in attrHooks/propHooks. All of it is completely untested. 2011-03-06 22:47:40 -05:00
jaubourg 6c124d3dd4 Fixes #8423. Never set X-Requested-With header automagically for cross-domain requests. 2011-03-07 00:42:09 +01:00
Jordan Boesch dd100bf5ac bug 6158; fixing replaceWith from throwing errors on non existant elements; fixing semicolon 2011-03-05 09:59:25 -06:00
Jordan Boesch c9ef09c800 bug 6158; fixing replaceWith from throwing errors on non existant elements 2011-03-05 09:46:12 -06:00
Jordan Boesch 5c2d70979c bug 6158; fixing replaceWith from throwing errors on empty elements 2011-03-05 09:30:29 -06:00
Dave Methvin 55ec6a71d2 Fixes #7340. Use a single capturing handler to simulate bubbling focusin/focusout event on non-IE browsers. Allow native DOM methods to fire events other than the currently active one back into jQuery. 2011-03-04 21:16:40 -05:00
jaubourg 2d0bc7ce72 Moves Deferred-related code into a separate module. Context handling has been simplified in _Deferred.resolve and jQuery.when has been refactored for clarity (and minor optimization). 2011-03-03 19:38:06 +01:00
jaubourg c1279895f3 Fix for #8421. Makes sure resolveWith can be called with only one parameter. 2011-03-03 15:16:47 +01:00
louisremi 025f2c63e4 fixing both #8403 and #8401: jQuery \"bulldozes\" other IE filters when setting opacity 2011-03-01 00:54:15 +01:00
Jordan Boesch c8a887af06 Bug 2616; Adding object support to jQuery.map 2011-02-27 12:47:35 -06:00
timmywil 9e5ec378e3 Merge branch 'master' of git://github.com/jquery/jquery into bug_2773 2011-02-26 18:53:25 -05:00
gnarf 71bd828d9f Grouped up the test 2011-02-24 13:21:05 -06:00
gnarf 14e9da51f9 A quick change to detect AIR urls 2011-02-24 13:10:33 -06:00
jaubourg 58faec7cb7 Removes unnecessary parenthesis from regular expression. 2011-02-24 06:37:37 +01:00
jaubourg 5d9db486c7 Revert "Fixes #8353. Adds a catch block in resolveWith so that the finally block gets executed in IE7 and IE6."
This reverts commit cacea6f7e7.
2011-02-24 00:32:30 +01:00
jeresig 83d1a1fd56 Updating the source version to 1.5.2pre. 2011-02-23 13:55:45 -05:00
jeresig 2defcf96e5 Tagging the 1.5.1 release. 2011-02-23 13:55:29 -05:00
jeresig 292acd97a2 Make a new jQuery.support.noCloneChecked - splitting apart the previous feature detect relating to clone in IE, fixes the last remaining issue with IE 9 RC. Fixes #8365. 2011-02-23 13:18:44 -05:00
louisremi e27fcf42ce comments for workarounds are always welcome. 2011-02-23 15:55:13 +01:00
louisremi c5264ce196 fix the regular expression that turns camel-case properties to lower-case ones for IE9. Fixes #8346 2011-02-23 15:53:29 +01:00
jaubourg 3663836b01 Refactors jQuery.when to avoid unnecessary recursion and limit function calls as much as possible. 2011-02-23 08:00:27 +01:00
jaubourg cacea6f7e7 Fixes #8353. Adds a catch block in resolveWith so that the finally block gets executed in IE7 and IE6. 2011-02-23 02:50:27 +01:00
jaubourg e405419fb7 Makes the promise method of Deferreds a bit more readable by not using the variable declared as parameter trick anymore. 2011-02-22 00:44:22 +01:00
jeresig d5f7711ce0 Updating the source version to 1.5.1pre. 2011-02-18 13:57:32 -05:00
jeresig 13e1198754 Tagging the 1.5.1rc1 release. 2011-02-18 13:57:25 -05:00
Dan Heberden 47abe5e1da Bug #6911 - Prevent action on disabled elements, both triggering and bound via .live() 2011-02-18 10:09:07 -08:00
jaubourg a43a5ca9cf Revert "Adds an invert method to promises that returns a "inverted" promise that is resolved when the underlying deferred is rejected and rejected when the underlying deferred is resolved."
This reverts commit 4e97543051.
2011-02-18 18:06:26 +01:00
Alex Sexton 752db8fffe A temporary workaround for #8018 that avoids any chance of compatibility-breaking changes until a proper fix can be landed in 1.6. 2011-02-17 18:01:30 -06:00
Anton M 4b91b918a3 Fix a some inaccuracies in the original test case for #7912.
- Use fresh div instead of one outside the test-fixture
- make sure the empty string test tests actually that (not 0% 0%)
- actually test for < -10000 (#7193)
- fixed some whitespace issues
2011-02-17 19:14:46 +01:00
louisremi 85d9343271 Fixes #7912. Make sure .cur() only returns 0 as fallback value when it needs to ("", auto, undefined, null).
This change makes .cur() more .cssHooks friendly. .cur() now returns the unmodified value by
.css() if it isn't a number, number-alike or a value that needs a fallback to 0.
This way fx.start doesn't need to be recalculated for complex values.
2011-02-17 17:26:23 +01:00
Dave Methvin b9f5e2b974 Only perpetrate the .toJSON hack on data caches when they are attached to a plain Javascript object. Part of the continuing saga of #8108. 2011-02-17 17:09:56 +01:00
jaubourg 5b38439011 Fixes #8297. Makes sure response headers with empty values are handled properly and do not prevent proper parsing of the entire response headers string. Unit test amended. 2011-02-17 17:03:09 +01:00
Anton M faa6fe32f7 Revert "Merge branch '8099' of https://github.com/rwldrn/jquery into rwldrn-8099"
This reverts commit bb9408516a, reversing
changes made to 3ad8dd242a.

Conflicts:

	src/effects.js
2011-02-15 22:30:34 +01:00
Anton M 6b08d88d04 Fix some whitespace issues. 2011-02-15 22:09:09 +01:00
Dave Methvin 12c0e1a692 Fixes #7922. Copy the donor event when simulating a bubbling submit in IE so that we don't accidentally stop propagation on it. Remove a bunch of return statements that could also cancel the event. DRY out the liveFired change from #6359 by moving it to the trigger() function. 2011-02-15 22:08:39 +01:00
jaubourg 1ddfdabbb9 Fixes #8277. Sets data to undefined rather than null when it is not provided in ajax helpers so that it won't revent data set in ajaxSettings from being used. Unit test added. 2011-02-15 21:53:38 +01:00
Anton M 8e40a84c24 Fix some unscoped tests which failed after recent changes to QUnit. 2011-02-15 21:03:34 +01:00
Colin Snover 2cc03a86fc Update jQuery.data to use jQuery.noop for toJSON hack instead of an additional superfluous function. 2011-02-14 16:30:18 -06:00
Colin Snover 2ed81708bd Hide metadata when serializing JS objects using JSON.stringify via a toJSON hack. Fixes #8108. 2011-02-14 16:22:23 -06:00
Anton M 217a9919c3 Add missing semicolon. 2011-02-14 22:38:19 +01:00
jeresig bb9408516a Merge branch '8099' of https://github.com/rwldrn/jquery into rwldrn-8099 2011-02-14 12:36:49 -05:00
jeresig 3ad8dd242a Merge branch 'fix8033' of https://github.com/SlexAxton/jquery into SlexAxton-fix8033 2011-02-14 12:35:27 -05:00
Anton M 659773348f Fix breaking test in Chrome. 2011-02-14 00:37:07 +01:00
Anton M c5edf982d5 Don't add "px" to unit-less properties when animating them. Fixes #4966. 2011-02-13 23:17:58 +01:00
Anton M dba8c20b4b Clean up whitespace in test/unit/effects.js 2011-02-13 23:17:35 +01:00
Anton M 3930afa3ad Follow up to fbf79c0b49.
Fix stupid error.
2011-02-13 01:48:48 +01:00
Anton M fbf79c0b49 Remove old cruft from test folder. Change "polluted" test suite loader to use CDN hosted libraries. 2011-02-13 01:34:31 +01:00
jrburke d99268a4b7 Add readyWait tests. Fixes #8145.
Adds tests for the fix to #6781.
2011-02-12 13:53:05 +01:00
awgy 2862f589db Remove sed from post-build code, due to portability issues between GNU and BSD versions.
Follow up to ba43d37394 which apparently
didn't fix the problem completly on Mac OS X.
2011-02-12 13:53:04 +01:00
David Murdoch 3548ffaee2 Remove unnecessary "script.type = text/javascript;". Fixes #8198.
Follow up to 462bb1f66a.
2011-02-12 13:53:03 +01:00
David Murdoch f099907672 Unexpose $.support._scriptEval as it's not needed. Use a private var instead. Fixes #8200. 2011-02-12 13:53:02 +01:00
jaubourg d4790116b8 Enhances ajaxSetup so that it can take an optional target option, in which case target will be updated instead of ajaxSettings. That way, fields that shouldn't be deep extended can be listed and dealt with in one place. jQuery.ajax now makes use of ajaxSetup with target to create its internal settings object. Fixes #7531 in IE9RC. 2011-02-12 03:59:46 +01:00
jaubourg 081562cebc Pulls out the callback function in setRequestHeader. Also renames the regexp so that what it's meant to do is a bit more obvious. 2011-02-12 01:08:24 +01:00
jaubourg ea3e10a492 Minor changes to enforce JQuery Core Style Guidelines. 2011-02-12 00:14:11 +01:00
Anton M 481d940e79 Remove duplicate test. 2011-02-11 11:59:42 +01:00
jaubourg 066304edf0 Adds missing crossDomain test. 2011-02-11 07:39:46 +01:00
jaubourg f2e0ae1a39 Fixes #8245. Ajax now ensures header names are capitalized so that non-compliant xhr implementations don't override them. 2011-02-11 07:07:06 +01:00
jaubourg 3a1d7a3c7c Simplifies status normalization in xhr transport. Local file test modified for clarity. 2011-02-11 07:02:11 +01:00
rwldrn 43a41ba7ec Make sure .val() works after form.reset() in IE. Fixes #2551. 2011-02-10 23:50:02 +01:00
Anton M 78fc79fad4 Make sure .clone(true) correctly clones namespaced events. Fixes #4537. 2011-02-10 22:20:48 +01:00
Anton M 4490f4285c Fix some whitespace issues. Improve and correct an events test. 2011-02-10 22:20:47 +01:00
John Resig 3f036281dd No need to duplicate Sizzle tests, just run them directly from Sizzle. 2011-02-10 16:19:35 -05:00
Anton M f56b4a22a6 Pull over tests from Sizzle. "Remove backslashes from tag name filter. Fixes #8220." 2011-02-10 01:29:18 +01:00
jaubourg 6f4b36ed17 Replaces jQuery.each loop for headers with a foreach loop. 2011-02-09 17:50:45 +01:00
jaubourg f6e173437e Fixes #8219. Introduces the mimeType option to override content-type header in conversion (and in native xhr when possible). Adds companion overrideMimeType method on jqXHR object (it simply sets the option). Unit test added. 2011-02-09 17:47:33 +01:00
jaubourg 806d9ce811 Makes local filesystem test for ajax more insightful. 2011-02-09 15:27:50 +01:00
jaubourg 2953d0481a Makes sure statusText always defaults to "error". 2011-02-09 15:26:34 +01:00
Colin Snover d92dc2902c Revert portions of 7acb141ed7 that attempt to use a function to hide jQuery metadata from JSON.stringify since this does not work reliably cross-browser (fails in Fx3.5, O11, Saf4). 2011-02-08 12:13:27 -06:00
Anton M b46dff39c3 Make sure that mousing over Chrome "internal div" doesn't trigger a mouseleave. Fixes #8209.
Follow up to 4a828c93d4
which was stupid and got reversed.
2011-02-08 17:15:55 +01:00
Anton M 944e0e6498 Revert "Make sure that mousing over Chrome "internal div" elements results in no trigger of a mouseleave."
This reverts commit 4a828c93d4.
2011-02-08 17:08:25 +01:00
Anton M 4a828c93d4 Make sure that mousing over Chrome "internal div" elements results in no trigger of a mouseleave. Fixes #8209. 2011-02-08 16:57:06 +01:00
Colin Snover 534dbd660e Update jQuery.support.noCloneEvent test to function properly in IE9. Fixes #8052. 1.5-stable 2011-02-07 10:56:48 -06:00
Colin Snover 8805f1373d Merge branch 'master' of github.com:jquery/jquery into jquery-master 2011-02-07 10:52:33 -06:00
Colin Snover 7acb141ed7 Update $.data to use a function instead of an object when attaching to JS objects in order to hide attached metadata from JSON.stringify. Remove event.js code that was doing this before specifically for events, which is now redundant. Fixes #8108. 1.5-stable 2011-02-07 10:48:38 -06:00
jaubourg 5b421fed00 Adds jQuery collection to objects that will be used as global events context if provided in the ajax options. 2011-02-07 17:09:47 +01:00
jaubourg a2dbdc1f54 Fixes a bug that prevented headers from being set in an ajaxSend callback. Unit test modified. 2011-02-07 16:35:32 +01:00
jaubourg 0c21c83e96 Makes sure xhrs are actually aborted on unload in IE. Simplifies active xhrs caching in the process. 2011-02-07 06:11:52 +01:00
Timmy Willison 82626799ca Changed $.sub internals to match sub naming, added some more spacing in some areas for readability 2011-02-06 19:34:57 -05:00
jaubourg d6fbbe1080 Fixes #8177. XHR transport now considers 304 Not Modified responses as 200 OK if no conditional request header was provided (as per the XMLHttpRequest specification). 2011-02-05 03:08:35 +01:00
jaubourg 2c77704b14 Fixes a typo in the title of the load() unit test. 2011-02-05 03:06:21 +01:00
Anton M 08fcde6a59 Remove an invalid ajax test and some code that is no longer used by any test. 2011-02-05 00:20:23 +01:00
jaubourg 8f8961de90 Reformats logic for early abort in beforeSend to limit block imbrication. 2011-02-04 22:29:10 +01:00
jaubourg 03bad0a960 Fixes abort in prefilter. No global event will be fired in that case even if the global option is set to true. Unit test added. 2011-02-04 22:19:23 +01:00
jaubourg d66cc55316 Disables dataType redirection while selecting transport. 2011-02-04 21:50:18 +01:00
jaubourg 7eba4b76df Adds widget as the list of local protocols. 2011-02-03 18:23:02 +01:00
jaubourg 4d808a3345 Don't use a local copy of jQuery.ajaxSettings.isLocal anymore but use the current value so that it is possible to set isLocal to true for protocols unknown to jQuery. 2011-02-03 18:22:37 +01:00
jaubourg 0736db64a2 Adds support for more complex protocol by having the url regexp closer to rfc1738. 2011-02-03 17:17:56 +01:00
jaubourg ee22a59129 Stores jQuery.ajaxSettings.isLocal locally at load time so that any change to it won't affect the transport. Fixes the url parsing regexp to deal with empty domains. Adds informative text into test/localfile.html and handles Opera's failure. Revises the way xhr are created by doing all tests at load time and normalizes all the xhr creation functions so that none of them may throw an exception. 2011-02-03 06:12:47 +01:00
jaubourg 50e950a96e Fixes #7653. Changes regexp to detect local protocol so that it will accept any protocol finishing by -extension. 2011-02-03 05:19:15 +01:00
jaubourg 823eecab90 Fixes #8146. Custom fields in xhrFields are now set after the XMLHttpRequest object has been opened. 2011-02-03 03:02:11 +01:00
jaubourg d77a2a2274 Fixes #8152 by applying the same special cases for protocol "chrome-extension:" as were for "file:" (needs tests). Re-organizes and fixes the handling of special cases for HTTP status code in the xhr transport. Also re-organizes the handling of document.location in ajax.js. 2011-02-03 02:53:10 +01:00
jaubourg 5ef7ddc4c5 Fixes #8146 by introducing the xhrFields option with is a map of fieldName/fieldValue to set on the native xhr. Can be used to set withCredentials to true for cross-domain requests if needed. 2011-02-02 21:16:26 +01:00
jaubourg e3cc440934 Fixes #8138. Access to document.location is made only once at load time and if it fails (throwing an exception in IE when document.domain is already set), we use the href of an A element instead. 2011-02-02 20:52:26 +01:00
jaubourg b90369e8cb Fixes #8135. Makes sure any exception thrown by Firefox when trying to access an XMLHttpRequest property when a network error occured is caught and notified as an error. Added test/networkerror.html to test the behavior. 2011-02-02 13:33:31 +01:00
Mathias Bynens 462bb1f66a Fixes #8098. Use the fast document.head when available. Don't set unneeded "script.type = text/javascript". 2011-02-02 00:59:00 +01:00
Anton Kovalyov fdd4101fe9 Fixes #7945. Make jQuery.param() serialize plain objects with a property named jquery correctly. 2011-02-02 00:32:29 +01:00
rwldrn fa4c90987f Fixes #8129. Fix cloning multiple selected options in IE8. 2011-02-02 00:09:51 +01:00
jaubourg cb85da7b62 Fixes #8125. Status is set to 200 for requests with status 0 when location.protocol if "file:". Added test/localfile.html to control it works. 2011-02-01 17:22:01 +01:00
jaubourg cb49b4a1b6 Fixes #8115. Renames all references to jXHR with jqXHR in the code (like was done in the doc). 2011-02-01 16:00:53 +01:00
jeresig 375b787838 The default for .clone() is to not clone any events. Fixes #8123. 2011-02-01 08:57:18 -05:00
jaubourg eb5aab9952 Places multiple signature test after all primary callbacks tests. 2011-02-01 09:30:52 +01:00
Dan Heberden af70dee88e Improve $.ajax method signature unit test and placement 2011-02-01 00:22:22 -08:00
Dan Heberden 31949fa528 Bug 8107; Fix argument handling for $.ajax for multiple method signatues and add test case 2011-01-31 19:37:28 -08:00
rwldrn c67867ad0c Bug #8099 - Updates per review 2011-01-31 14:50:03 -05:00
rwldrn 0d2e4796dc Bug #8099 - Always restore to correct display value based on element's expected default display 2011-01-31 14:31:15 -05:00
jaubourg f43572d3b8 Fixes #8095. Properly handles the case where browser cache needs to be bypassed while server-side logic still delivers proper 304 responses. Unit test added. 2011-01-31 19:59:53 +01:00
jaubourg e0b1bb8e3d Script dataType now supports ecmascript mimetypes. 2011-01-31 19:14:06 +01:00
jaubourg f286a716d5 Makes sure jsonp callback is not left in the global namespace in case of an early abort (beforeSend). Unit test added. 2011-01-31 18:53:44 +01:00
jaubourg 7c9a5e6016 Makes sure all converters keys are lowercased before any conversion is taking place: dataTypes' names are now truly case insensitive. Unit test edited. 2011-01-31 17:40:27 +01:00
jaubourg 485fa0c42a Makes sure options.context is used as the context for global ajax events only if it's a DOM node. 2011-01-31 17:40:26 +01:00
Anton M 389c099df6 Fixes #7568. Follow-up fix for #5862. Objects with a length property weren't serialized properly by jQuery.param. 2011-01-31 15:58:27 +01:00
jaubourg 4e97543051 Adds an invert method to promises that returns a "inverted" promise that is resolved when the underlying deferred is rejected and rejected when the underlying deferred is resolved. 2011-01-31 14:49:14 +01:00
jeresig d753a7a117 Updating the source version to 1.5.1pre. 2011-01-31 08:31:36 -05:00
jeresig 8d8db3f2b3 Tagging the 1.5 release. 2011-01-31 08:31:29 -05:00
jeresig 749d41f7de Rename jQuery.subclass() to jQuery.sub(). 2011-01-31 08:21:42 -05:00
jaubourg d2384ad03a Removed errorThrown test for 404 responses seeing as Safari 3.x XHR sets the statusText as "OK" rather than "Not Found". 2011-01-31 11:14:38 +01:00
jaubourg 91ca71daaa Ensures dataTypeExpressions are lowercased for prefilters and transports registrations. 2011-01-31 10:13:54 +01:00
jaubourg 945ac0d0b1 Simplifies the unit test for #8082. 2011-01-29 03:08:18 +01:00
jaubourg 85a195c6d5 Fixes #8082. Text to script converter now returns text. Unit test added. 2011-01-29 01:39:22 +01:00
jaubourg b9f2131a9d Fixes potential collisions between jsonp requests from different jQuery instances by prefixing the jsonp callback name with the jQuery expando rather than with "jsonp". 2011-01-29 01:25:27 +01:00
Colin Snover 0a0cff9d29 Use the original element/fragment as the last item to be appended to the document instead of the first in order to prevent missing elements when appending to multiple elements. Fixes #8070. 2011-01-28 10:55:39 -06:00
jaubourg bbd3f4f3fe Compatibility fixes in ajax: exceptions are no longer promoted to strings before being given to callbacks. Updated misleading comment in conversion code. 2011-01-28 17:08:46 +01:00
Anton M 1e4f3c07c7 Pull over tests from Sizzle. Fixes #3729. Fixes #6428. 2011-01-28 01:50:39 +01:00
Digitalxero e00f74c43b Make sure subclass is a proper subclass not just subclassing the fn methods. Fixes #7979. 2011-01-27 13:35:06 -05:00
jaubourg 7f95a730e5 Merge branch 'master' of github.com:jquery/jquery 2011-01-27 00:59:11 +01:00
jaubourg 7d75ea950e Actually does what bab8079593 promised: passes the jXHR as the third argument of prefilters and transport factories. Comitted for completness even if if backs this out in the end and only land in 1.5.1. 2011-01-27 00:58:31 +01:00
gnarf ab1d9a8a2c Remove unneeded and confusing variable definition for better readability. 2011-01-27 00:23:08 +01:00
Anton M ba43d37394 Fix Makefile to use plain sed agin. Remove unicode trickery. Thanks to danheberden and gnarf for figuring out why it previously faild on Mac OS X. 2011-01-26 22:50:15 +01:00
jeresig 6344821f1b Merge branch 'master' of github.com:jquery/jquery 2011-01-26 16:36:51 -05:00
jeresig 2c290709d8 Make sure that init is run before jquery is built (avoiding weird warnings when running 'make jquery' or 'make min'). Additionally only attempt to run JSLint or the minifier if NodeJS is installed (avoiding a weird warning when you first run 'make' or 'make all'). 2011-01-26 16:36:33 -05:00
jaubourg bab8079593 Passes jXHR object as third argument of prefilters and transport factories. 2011-01-26 17:37:08 +01:00
jaubourg d7d64713a7 Fixes #5866. Issue number in previous commit was wrong both in comments and commit message. See 0e5b341cc0 for previous commit. 2011-01-26 01:45:00 +01:00
jaubourg 0e5b341cc0 Fixes #5856. Adds document protocol at the beginning of URLs without protocol (thanks go to skrings for the initial pull request). Simplifies cross-domain detection regexp and logic as a consequence. Also took the opportunity to remove an unused variable. Unit test added. 2011-01-26 01:36:05 +01:00
jaubourg 325dcdc2ab Fixes #8054 by reverting feature enhancement 5812 (4920). Regexps no longer searches for %3F in url or data to find jsonp callback placeholders. 2011-01-26 00:55:39 +01:00
jaubourg 5ca8f0617f Reworks how values of parameters passed to error callbacks are determined. Fixes #8050. 2011-01-25 16:08:19 +01:00
Rick Waldron 8d050558d3 #8044 Removes unnec. rnonword var 2011-01-25 03:52:17 +01:00
jeresig 294df4fdcb Updating the source version to 1.5pre. 2011-01-24 17:14:11 -05:00
jeresig 9d306bd73b Tagging the 1.5rc1 release. 2011-01-24 17:14:04 -05:00
jeresig 9604a0321a Bring back in #main prefix on adjacent selectors. 2011-01-24 17:01:31 -05:00
jeresig 98234b0f93 Backing out disconnected + and ~ tests as they're not something that we actively support. 2011-01-24 16:58:56 -05:00
jeresig 6fb3998681 Updating the year in the header. 2011-01-24 16:45:29 -05:00
Timmy Willison ed48787ec5 Fix bug #2773, jQuery.fn.is to accept JQuery and node objects, and a small fix for winnow getting an undefined selector 2011-01-24 16:18:19 -05:00
jeresig 6c18a1becb Revert "Fix Makefile to use plain sed. Remove unicode trickery"
This reverts commit 6d358c0cdd.
2011-01-24 14:14:55 -05:00
Anton M 6d358c0cdd Fix Makefile to use plain sed. Remove unicode trickery 2011-01-24 20:01:25 +01:00
jaubourg 33de9c5597 Makes prefilters and transport inspection more robust and uses better variable names for readability. 2011-01-24 04:22:46 +01:00
Alex Sexton c50b74372c Moved jQuery global leak to end of file so accidental gEBCN overrides in prototype don't get caught up in confusion. Fixed tests to reference jQuery variable instead of $ (best practice). Fixes #8033 2011-01-23 21:19:33 -06:00
jaubourg 02ca45573b Revised internal implementation of ajaxPrefilter() and ajaxTransport(). Everything is shorter and more efficient now. Also fixes a couple spacing issues that remained. 2011-01-23 22:03:24 +01:00
jaubourg ee22c8b34b More code style fixes. 2011-01-23 20:46:09 +01:00
jaubourg dd5bf42122 Apply JQuery Core Style Guidelines to ajax.js and ajax/*.js, 2011-01-23 05:51:41 +01:00
jaubourg 30082d9eba Fixes some coding style issues in core.js. In jQuery.fn.ready(), simplifies the whole code (for better backward compatibility) and removes redefinition of the function itself (in order not to clash with proxying). Also, in jQuery.when(), removes unnecessary closure and early rejection test and makes use of then instead of done/fail (better interoperability). 2011-01-23 05:01:36 +01:00
jaubourg bea4815294 Re-organizes ajax.js: prefilters and transports are no longer stored in ajaxSettings (their structure is not handled correctly by extend() and was causing some overhead when constructing the final options map in ajax()); base function for ajaxPrefilter and ajaxTransport has been renamed and split in two (one for inspection, one for addition); response/dataType determination and data conversion logics have been externalized from the ajax() internal callback; data conversion no longer sets responseXXX fields; some minor re-formatting and simplifications. 2011-01-22 04:45:20 +01:00
Anton M 4413c2fd93 Fix selector scope on some tests, so they don't fail on testswarm. 2011-01-22 01:12:18 +01:00
rwldrn f1bd0cfc4d Merge branch '8017lint' of https://github.com/rwldrn/jquery into 8017lint 2011-01-22 00:41:42 +01:00
jeresig 1922f311a3 Merge branch 'fix-7398-frameset-docs' of https://github.com/dmethvin/jquery into dmethvin-fix-7398-frameset-docs 2011-01-21 11:22:55 -05:00
jeresig 61e80c55df Merge branch '8013p' of https://github.com/rwldrn/jquery into rwldrn-8013p 2011-01-21 11:20:05 -05:00
rwldrn 33a67ffa9d Basic unit tests; This patch relies on the 51 existing clone() tests 2011-01-21 11:08:15 -05:00
Gianni Chiappetta 574ae3b1be added: Backcompatibility with old proxy syntax. 2011-01-21 10:33:50 -05:00
Gianni Chiappetta a03f040dbf Merge branch 'master' into proxy-native-bind
* master: (194 commits)
  Revert "Make sure that focusin/focusout bubbles in non-IE browsers." This was causing problems with the focusin event, see: #7340.
  Replaces "text in-between" technique with a full-fledged one-level transitive search for converters (unit tests added). Also cleans up auto dataType determination and adds converter checks in order to guess the best dataType possible.
  Moves determineResponse logic into main ajax callback. Puts responseXXX fields definitions into ajaxSettings.
  Removes misleading comment.
  Bring jQuery('#id') and jQuery('body') logic back into core (while leaving it in Sizzle at the same time). Was causing too much of a performance hit to leave it all to Sizzle.
  Renames Deferred's fire and fireReject methods as resolveWith and rejectWith respectively.
  Fix typo in regex tweak from previous commit.
  Renames determineDataType as determineResponse. Makes it more generic as a first step into integrating the logic into the main ajax done callback. Also fixes some comments in ajax/xhr.js.
  Move jQuery(...) selector speed-up logic into Sizzle(...) qSA handling. Additionally add in a new catch for Sizzle('.class') (avoid using qSA and use getElementsByClassName instead, where applicable).
  Revises the way arguments are handled in ajax.
  Makes sure statusCode callbacks are ordered in the same way success and error callbacks are. Unit tests added.
  Cleans up and simplifies code shared by ajaxPrefilter and ajaxTransport. Removes chainability of ajaxSetup, ajaxPrefilter and ajaxTransport. Also makes sure context is handled properly by ajaxSetup (unit test added).
  Rework unit tests to check actual result elements.
  Moves active counter test after all other ajax tests where it should be.
  Revised the Nokia support fallback. It turns out that Nokia supports the documentElement property but does not define document.compatMode. Adding this third fallback allows Nokia to run jQuery error-free and return proper values for window width and height.
  Moves things around to make jsLint happier.
  Fixes crossDomain test so that it assumes port to be 80 for http and 443 for https when it is not provided.
  Moves determineDataType into ajaxSettings so that it is accessible to transports without the need for a second argument and so that we can now pass the original options to the transport instead. Also ensures the original options are actually propagated to prefilters (they were not).
  Re-adds hastily removed variable and simplifies statusCode based callbacks handling.
  Use undefined instead of 0 to deference transport for clarity.
  ...

Conflicts:
	src/event.js
2011-01-21 09:58:55 -05:00
Dave Methvin ad0ebf00ab Don't do body-related feature tests on frameset docs that have no body. Fixes #7398. 2011-01-21 09:51:30 -05:00
jeresig 328a86f9a0 Revert "Make sure that focusin/focusout bubbles in non-IE browsers." This was causing problems with the focusin event, see: #7340.
This reverts commit 88068f82c1.

Conflicts:

	src/event.js
	test/unit/event.js
2011-01-21 09:24:09 -05:00
jaubourg dc2e7317a9 Replaces "text in-between" technique with a full-fledged one-level transitive search for converters (unit tests added). Also cleans up auto dataType determination and adds converter checks in order to guess the best dataType possible. 2011-01-21 03:58:28 +01:00
rwldrn 6458885881 Cleaned up; fixes per review 2011-01-20 15:25:04 -05:00
John Resig 2e2d5e9db5 Merge branch 'fix-7853-add-context' of https://github.com/dmethvin/jquery into dmethvin-fix-7853-add-context 2011-01-20 14:51:30 -05:00
John Resig c97b6ee36a Merge branch 'master' of https://github.com/scottjehl/jquery into scottjehl-master 2011-01-20 14:39:57 -05:00
John Resig 35875acd03 Merge branch 'make_fix' of https://github.com/danheberden/jquery into danheberden-make_fix 2011-01-20 14:39:28 -05:00
rwldrn 49cd9c66bf cloneCopyEvent; jQuery.clone() review 2011-01-20 14:27:02 -05:00
jaubourg 3dbd600e19 Moves determineResponse logic into main ajax callback. Puts responseXXX fields definitions into ajaxSettings. 2011-01-20 19:40:51 +01:00
jaubourg 8ad2b31ff6 Removes misleading comment. 2011-01-20 18:50:47 +01:00
jeresig ea5ce8c2a9 Merge branch 'master' of github.com:jquery/jquery 2011-01-20 11:58:52 -05:00
jeresig e4d0168893 Bring jQuery('#id') and jQuery('body') logic back into core (while leaving it in Sizzle at the same time). Was causing too much of a performance hit to leave it all to Sizzle. 2011-01-20 11:58:44 -05:00
jaubourg f2b0c77dc8 Merge branch 'master' of github.com:jquery/jquery 2011-01-20 17:52:10 +01:00
jaubourg a7cb93bee5 Renames Deferred's fire and fireReject methods as resolveWith and rejectWith respectively. 2011-01-20 17:51:57 +01:00
jeresig 0f6c7830ce Fix typo in regex tweak from previous commit. 2011-01-20 11:46:50 -05:00
jaubourg ef86694ada Renames determineDataType as determineResponse. Makes it more generic as a first step into integrating the logic into the main ajax done callback. Also fixes some comments in ajax/xhr.js. 2011-01-20 17:38:21 +01:00
jeresig c475222bfb Move jQuery(...) selector speed-up logic into Sizzle(...) qSA handling. Additionally add in a new catch for Sizzle('.class') (avoid using qSA and use getElementsByClassName instead, where applicable). 2011-01-20 11:34:35 -05:00
jaubourg 3e1d3d0f21 Revises the way arguments are handled in ajax. 2011-01-20 16:22:36 +01:00
jaubourg 9ab00a712f Makes sure statusCode callbacks are ordered in the same way success and error callbacks are. Unit tests added. 2011-01-20 15:39:30 +01:00
jaubourg 64e1cdbb95 Cleans up and simplifies code shared by ajaxPrefilter and ajaxTransport. Removes chainability of ajaxSetup, ajaxPrefilter and ajaxTransport. Also makes sure context is handled properly by ajaxSetup (unit test added). 2011-01-20 04:12:15 +01:00
Dave Methvin 948c0dfffc Rework unit tests to check actual result elements. 2011-01-19 21:02:46 -05:00
jaubourg 96b00a4935 Moves active counter test after all other ajax tests where it should be. 2011-01-19 18:44:21 +01:00
scottjehl 2b64b1db68 Revised the Nokia support fallback. It turns out that Nokia supports the documentElement property but does not define document.compatMode. Adding this third fallback allows Nokia to run jQuery error-free and return proper values for window width and height. 2011-01-19 12:40:32 -05:00
jaubourg 44f3a1b405 Moves things around to make jsLint happier. 2011-01-19 18:36:42 +01:00
jaubourg 7d89d3c072 Fixes crossDomain test so that it assumes port to be 80 for http and 443 for https when it is not provided. 2011-01-19 18:35:40 +01:00
scottjehl cb1f7eeac5 Merge remote branch 'upstream/master' 2011-01-19 12:32:57 -05:00
jaubourg 1cecfa1ece Moves determineDataType into ajaxSettings so that it is accessible to transports without the need for a second argument and so that we can now pass the original options to the transport instead. Also ensures the original options are actually propagated to prefilters (they were not). 2011-01-19 18:16:29 +01:00
jaubourg 3ea366401f Re-adds hastily removed variable and simplifies statusCode based callbacks handling. 2011-01-19 17:51:33 +01:00
jaubourg 7947cd77e4 Use undefined instead of 0 to deference transport for clarity. 2011-01-19 17:24:56 +01:00
jaubourg d343bfe528 Removes unnecessary test and ensures getResponseHeader returns null if the header does not exist. 2011-01-19 17:21:51 +01:00
jaubourg bd6eb849ee Revised how context is determined and removed unnecessary "parameter as variable" trick. 2011-01-19 17:06:33 +01:00
jaubourg 92c3d87a9c Moved ajaxSettings.xhr definition together with support.ajax and support.cors determination into ajax/xhr.js. 2011-01-19 16:55:26 +01:00
Dan Heberden 74dfc7f2a9 Revert uglify.js to original and handle build changes in make file 2011-01-19 02:11:43 -08:00
Anton M 265cf0efa7 Remove an unused regex and optimize character escape regex usage. 2011-01-19 00:15:28 +01:00
John Resig fc7bd61200 Merge branch 'master' of https://github.com/mathiasbynens/jquery into mathiasbynens-master 2011-01-18 18:11:54 -05:00
John Resig 40f48ef6be Merge branch 'chrome-slice-comment' of https://github.com/ajpiano/jquery into ajpiano-chrome-slice-comment 2011-01-18 18:07:37 -05:00
John Resig be6ef80f8a Weird, not sure why I got an exec error before - doesn't seem to be needed. 2011-01-18 18:06:44 -05:00
Mathias Bynens c5ec1cb3e5 Add missing line break after copyright header and trailing semicolon at the end of the minified version. 2011-01-18 23:14:32 +01:00
John Resig 80928cc6fb Make sure that the UglifyJS file is executable. 2011-01-18 16:40:42 -05:00
John Resig 9c763ad39d Add another tweak for handling CSP - we need to make sure that we don't trigger any eval on load (not sure if it's the best tweak, definitely not ideal). Add a test page as well so that it's easier to catch problem. 2011-01-18 15:13:09 -05:00
John Resig c1d719b580 Merge branch 'master' of https://github.com/russtacular/jquery into russtacular-master 2011-01-18 14:20:05 -05:00
Xavi 135a384cf3 Bug 7931; cleaned up white space in accordance to style guide 2011-01-18 12:40:07 -05:00
Xavi 0942b3b3f5 Merge branch 'master' of git://github.com/jquery/jquery into bug_7931 2011-01-18 12:06:05 -05:00
Colin Snover 3d0aa196c5 Clarify cygwin instructions slightly and swap the order of arguments to which in Makefile because of a bug in current versions of MSYS that causes only the first argument to /bin/which to be searched. 2011-01-17 21:06:57 -06:00
Colin Snover 9ae837a167 Update Makefile to use either nodejs or node, whichever exists (Debian uses nodejs). 2011-01-17 19:04:32 -06:00
rwldrn 35aeac1336 Update unit test for #7608 which was leaking timers. 2011-01-17 18:55:40 -06:00
Colin Snover d503845d0c Replace build system with a faster new one that uses Node and UglifyJS and generates smaller minified files. Also removes builds through rake/ant since having 3 different build systems was too much to maintain (make was the only one consistently kept up-to-date). Fixes #7973. 2011-01-17 18:49:24 -06:00
jeresig 9c76ac4f6d Disabled a broken test for now, until WebKit browsers become more current. 2011-01-17 18:12:42 -05:00
jeresig e01e8d434d Accidentally removed the module teardown code. 2011-01-17 18:08:51 -05:00
jeresig 3ab7b72919 Opera was falling back to undefined, which it didn't appreciate. 2011-01-17 18:07:52 -05:00
jeresig 733eb5e253 Merge branch 'master' of github.com:jquery/jquery 2011-01-17 17:44:54 -05:00
jeresig 0c1ffe3cb3 Fixed a couple issues with escaping of attribute values in selectors. Fixes #6093. 2011-01-17 17:44:42 -05:00
adam j. sontag d9660e1bf4 Fix tabs vs spaces in initial workaround commit 2011-01-17 17:20:37 -05:00
adam j. sontag 78be517727 shorten the SHA 2011-01-17 17:08:44 -05:00
adam j. sontag 4058881784 Add link to chrome issue ticket 2011-01-17 17:03:45 -05:00
Colin Snover 0cbe4cb8bd Merge branch 'master' of github.com:jquery/jquery into jquery-master 2011-01-17 15:32:57 -06:00
Colin Snover e78d3a7e2d Merge in data_nocollide branch. Fixes #6968, improves unit testing framework checks for leaky stuff. 2011-01-17 15:31:43 -06:00
Brandon Sterne 220a0ce162 Defer scriptEval test until first use to prevent Content Security Policy inline-script violations from occuring. Fixes #7371. 2011-01-17 16:31:12 -05:00
Colin Snover 57cc182a40 Introduce a temporary hack to allow jQuery.fn.data("events") to continue to work. This will be going away in 1.6. More information will be available in the 1.5 release notes. 2011-01-17 15:22:49 -06:00
adam j. sontag 28a1bad7b1 Add a comment to explain (and enforce the temporary-ness of) an extra line of code added to workaround a Chrome 10 bug 2011-01-17 16:10:14 -05:00
jeresig f01ef93aab Merge branch '7608' of https://github.com/rwldrn/jquery into rwldrn-7608 2011-01-17 15:50:20 -05:00
jeresig 987c44bee4 Merging pull request 183 for #7793. 2011-01-17 15:45:07 -05:00
jaubourg ac2e731b2d Added unit tests to check and demonstrate new jQuery.Deferred() works. 2011-01-17 17:52:30 +01:00
jaubourg 5798446b98 Put the split to get the list of promise methods out of the promise method itself and also switched from jQuery.each to a while loop to remove as much overhead as possible. Thanks go to scott_gonzalez for reminding me of this. 2011-01-16 18:33:32 +01:00
jaubourg c272f5f7da Implements joined jQuery.when statements. Makes it so calling jQuery.when with no parameter returns a resolved promise. Ensures promise method on promises supports the promise(obj) signature. Ensures a deferred and its promise always return the same promise (itself for the promise). Unit tests provided. 2011-01-16 17:41:39 +01:00
jaubourg cfca6d3836 Fixed the ajax test regarding the jsonp option set to false and added a test to control the prefilter actually does not tamper with the url. 2011-01-16 05:36:20 +01:00
jaubourg 0e93b2e24c Revised jsonp unit tests and added a test for when the jsonp option is set to false. 2011-01-16 05:27:16 +01:00
jaubourg 158fa822de Setting the jsonp option to false now inhibits any url manipulation regarding the callback. 2011-01-16 05:26:46 +01:00
jaubourg f74b844989 The script prefilter now forces cross-domain requests type to GET. 2011-01-16 05:25:45 +01:00
jaubourg 914aa3d66b Makes it so a prefilter can change the type of a request. 2011-01-16 05:24:14 +01:00
jaubourg 21143c3b21 Removed internal dataTypes option and added headers & crossDomain options into commented out options of ajaxSettings. 2011-01-16 03:05:03 +01:00
jaubourg 8ab23aec2c Fixes #2994. Not finding a transport now fires the error callbacks and doesn't make ajax return false. Had to revise how jsonp and script prefilters & transports work (better separation of concerns). Also took the opportunity to revise jXHR getRequestHeader and abort methods and enabled early transport garbage collection when the request completes. 2011-01-16 02:57:39 +01:00
Dave Methvin 007e2d152e Update test case to feature-detect Opera's lack of defaultPrevented and skip the test for it. 2011-01-15 10:24:13 -05:00
Sylvester Keil 75655e5758 Use parseFloat instead of parseInt to read CSS values.
This fixes #7730 and #7885.
2011-01-15 13:56:20 +01:00
jeresig d9cb69873c Updating the source version to 1.5pre. 2011-01-14 14:56:37 -05:00
jeresig bcdd4f8173 Tagging the 1.5b1 release. 2011-01-14 14:56:21 -05:00
jeresig cf7ddcf79a Revert "Revert fb4445070c which is no longer necessary with the release of Opera 11. Fixes #7608." We will be continuing to support Opera 10.6 in jQuery 1.5.
This reverts commit 012f0c3b4b.
2011-01-14 14:12:29 -05:00
wycats f4add19759 So embarrassing :( 2011-01-14 12:46:22 -05:00
jeresig a7ab491a5d Merge branch 'master' of https://github.com/scottgonzalez/jquery 2011-01-14 11:23:05 -05:00
wycats 52a02383fa Fix a strange Chrome issue 2011-01-14 11:21:45 -05:00
wycats fa45f25d1c Fix a failing subclass test due to a change in master 2011-01-14 11:17:32 -05:00
wycats 3716f2d041 Overwrite CRLF with LF 2011-01-14 10:39:06 -05:00
Jared Grippe d483ce0a9c added jQuery.subclass 2011-01-14 10:38:32 -05:00
Scott González e5ee89ec9a Avoid running jQuery.unique() for methods that are guaranteed to produce a unique result set. Fixes #7964 - Some traversal methods perform an unnecessary uniqueness check. 2011-01-14 09:55:40 -05:00
scottjehl 73d060b522 set name to lowercase, since it's passed as initial caps 2011-01-13 14:20:00 -05:00
scottjehl 610ab137da Merge branch 'master' of https://github.com/jquery/jquery 2011-01-13 14:14:04 -05:00
jaubourg a8fa5f2ec1 Moved jQuery.ajax.prefilter and jQuery.ajax.transport to jQuery.ajaxPrefilter and jQuery.ajaxTransport so that proxying the ajax method doesn't turn into a nightmare. Thanks go to scott_gonzalez and DaveMethvin for pointing out the issue. Also made ajaxSetup return "this" to enable chainable definitions -- jQuery.ajaxSetup(...).ajaxPrefilter(...).ajaxTransport(...). 2011-01-13 18:33:24 +01:00
jaubourg 44fc87f66c Fixes #4964. Adds a statusCode object together with a new statusCode method on the jXHR object (deferred behaviour). They accept a map of statusCode/callback(s). Callbacks are fired when the status code of the response correponds to the key (as a success or an error callback depending on how the request completed). Unit tests added. 2011-01-13 17:01:25 +01:00
jaubourg 57956152d8 Removed xhr pooling since failing cross-domain requests leaves the xhr object in an undefined state in Firefox. Also rewrote comments related to the active xhr list so that they make sense. 2011-01-13 16:58:16 +01:00
jaubourg 667a3b31e6 Reworked script and xhr abort logic to take advantage of the fact jXHR.abort will complete the request itself if not done already. 2011-01-13 02:05:39 +01:00
jaubourg b07d43c649 Cleans up statusText handling and simplifies 304 notmodified logic. 2011-01-13 01:43:42 +01:00
jaubourg 97b244312e Removes unnecessary variables and adds much needed comments into the data conversion logic in ajax. 2011-01-13 01:18:46 +01:00
jaubourg ed1144816b Fixes a regression by calling dataFilter with the second argument set as the dataType. 2011-01-13 00:49:58 +01:00
jaubourg e9fb7d5be6 Gets rid of a var statement by moving variable declarations up. 2011-01-13 00:41:10 +01:00
jaubourg e221d39e98 Script transport now uses ajaxSetup to define script dataType. 2011-01-12 18:54:15 +01:00
jaubourg 14b07ec5de AjaxSetup now uses deep extend internally to accomodate map structured options. 2011-01-12 18:53:00 +01:00
jaubourg 0c51e9d55f Fixes #4897. Added ?? as a context-insensitive placeholder for the callback name of a JSONP request. Unit tests provided. 2011-01-12 18:36:00 +01:00
jaubourg f83cdc3c4c Yet another missing semicolon! 2011-01-11 23:43:02 +01:00
jaubourg 6504d4f700 Fixes #6230. Added a unit test to control that, since the ajax rewrite, setting the Accept header actually replaced the previous value and didn't append to it (tested in Safari 4.0.4 for which the problem was specifically reported). 2011-01-11 23:01:18 +01:00
jaubourg 5a721cf31b Fixes 4825. jQuery.fn.load: use the jXHR's Promise interface to get the actual response in case ajaxSettings contains a dataFilter. Unit test added. 2011-01-11 20:02:33 +01:00
rwldrn 9bd9d270f6 whitespace fixes in unit tests 2011-01-10 13:17:08 -05:00
Xavi b78e3fc39f Bug 7931; Inverted logic in scrollTop/Left (i.e. made 2011-01-09 20:51:20 -05:00
Xavi bed64e65cc Bug 7931; Added unit tests for scrollTop/Left. 2011-01-09 20:39:23 -05:00
Xavi 8d28f41f66 Bug 7931; Replaced with and 2011-01-09 20:34:15 -05:00
Xavi 628bacc3ce Bug 7931; Added missing semicolon and replaced '!=' with '!==' to allow null through 2011-01-09 20:16:18 -05:00
Colin Snover c5c1f18adb Merge branch 'master' of github.com:jquery/jquery into jquery-master 2011-01-09 18:41:15 -06:00
Colin Snover b14f02899e Ensure that buildFragment clones elements properly in all browsers. Fixes #3879, #6655. Also improves form element clone tests and fixes bugs in $.fn.clone exposed by these new test cases related to the values of checkboxes and radio buttons in IE. 2011-01-09 18:38:44 -06:00
Xavi d03d2e9f26 Bug 7931; Fixed bug that caused scrollTop and scrollLeft setters to return null when called on an empty jquery object 2011-01-09 19:11:05 -05:00
jaubourg 84319aa4a3 Fixes a race condition in JSONP Local test. 2011-01-10 00:52:20 +01:00
Colin Snover 012f0c3b4b Revert fb4445070c which is no longer necessary with the release of Opera 11. Fixes #7608. 2011-01-09 17:34:58 -06:00
Dave Methvin fcf623786a Ensure that the DOM element ref in an event handler is removed by cleanData to avoid an IE6/7/8 memory leak. Fixes #7054. 2011-01-09 16:25:44 -06:00
Dave Methvin 4e86766d54 Change embedded regexp to a variable (for #6876). 2011-01-09 16:22:11 -06:00
Colin Snover e2941d5a98 Update unit tests with a leak detection mechanism for the various jQuery globals and fix all leaks in the tests. 2011-01-09 15:58:47 -06:00
Colin Snover 80af46e8ff Fix jQuery.queue leaks empty queues. 2011-01-09 15:58:23 -06:00
Colin Snover 885d06c8ef Fix domManip leaks the first element when appending elements to multiple other elements. 2011-01-09 15:56:40 -06:00
Colin Snover 8e59a99e0a Change the way jQuery.data works so that there is no longer a chance of collision between user data and internal data. Fixes #6968. 2011-01-09 15:52:33 -06:00
jaubourg 1d1d4fe112 Moved unload abort code so that the event is only bound if the xhr transport is used. Fixes #5280. 2011-01-09 22:20:58 +01:00
jaubourg 8c8bd3bf6a Fixes #5812. =? will be detected even when it has been escaped during data serialization. 2011-01-09 21:48:52 +01:00
jaubourg 62a1a1a8fa Fixes #5803. Reworked jsonp prefilter so that it sets the dataType as jsonp and recognizes requests with originalSettings having jsonp or jsonpCallback to be jsonp. Moved default jsonp option value into ajaxSettings. Attached the transport to "jsonp" which avoids unnecessary testing. Transport factory sets dataType back to json for proper data conversion. 2011-01-09 21:19:27 +01:00
jaubourg 0f28835ee9 Make it so prefilters get access to the original settings. 2011-01-09 20:31:15 +01:00
jaubourg 7bc5386230 Simplified cross-domain detection tests. 2011-01-09 17:27:29 +01:00
jaubourg 5a5f67800b Fixes #5955. Option crossDomain now forces ajax to consider a request as cross-domain even when it is not. Useful for when servers issue redirects to cross-domain urls. Unit test added. 2011-01-09 16:50:13 +01:00
jaubourg c55a76a23f Make sure prefilters have been called and transport has been selected before sending any global event (in case the "global" option has been changed). 2011-01-09 16:32:51 +01:00
jaubourg 63487505c6 Added a test for retrying a request on error using jQuery.ajax(this). Works as intended. Fixes #7461. 2011-01-09 06:19:27 +01:00
jaubourg afefb4f3d2 Fixes #7465. Reworked the regexp and associated test for cross-domain detection so that it now includes ports. Added cross-domain detection tests for protocol, hostname and port. 2011-01-09 06:01:00 +01:00
jaubourg d515068ee8 Fixes #7868. ResponseText is now properly propagated for error callbacks. 2011-01-09 04:53:29 +01:00
jaubourg 69497c3fd7 Fixes #7881. Setting contentType to false will prevent the Content-Type header from being sent. Unit test added. 2011-01-09 04:28:42 +01:00
jaubourg 98c6c4b2b0 Added a simple cache for xhr objects in the xhr transport. 2011-01-09 04:03:00 +01:00
jaubourg 368f2441f6 Added missing commas. 2011-01-07 15:52:58 +01:00
jaubourg 1ca82ccd94 Renamed "complete" to "done" in order to avoid conflicts with jXHR.complete. 2011-01-06 01:26:06 +01:00
jaubourg 47e4cc1a0f Fixed mixing of tabs & spaces to make JSLint happier. 2011-01-06 01:18:03 +01:00
jaubourg c43b078c69 Renamed src/transports to src/ajax (in case we need prefilters in the future and to avoid a separate prefilters directory). 2011-01-06 01:17:31 +01:00
Colin Snover e56de77df9 Cleaning up trailing whitespace again. 2011-01-05 15:44:07 -06:00
wycats ae6655bcb6 Revert "Register as a CommonJS async module if in that kind of environment. Fixes #7102."
This reverts commit 6ffa730721.

Conflicts:

	src/core.js
2011-01-05 13:26:05 -08:00
rwldrn 8099cdce80 Bug #7608 elem.runtimeStyle throws exception in Opera 2011-01-05 13:32:59 -05:00
jaubourg cbf591152c "then" renamed "complete" and new "then" method defined using "complete" and "fail" internally. The API is still symetrical (complete/fail), still promotes AOP but is also now Promise/A compliant. Changed unit tests and ajax module accordingly. 2011-01-05 04:29:30 +01:00
jeresig 4ab94a578e Updating year to 2011. 2011-01-04 06:52:26 -08:00
rwldrn 5f52e61d74 4321 jQuery('#') returns empty jquery object 2011-01-01 17:18:47 -05:00
rwldrn 037d6bd5c3 4321 returns empty jquery object 2011-01-01 17:13:04 -05:00
rwldrn 612a908514 #7883 .delegate and .live should accept false as the fn arg, like bind 2011-01-01 13:49:59 -05:00
Dave Methvin eed3803c98 When serializing text, encode all line breaks as CRLF pairs per the application/x-www-form-urlencoded specification. Fixes #6876. 2010-12-31 13:56:51 -06:00
jaubourg 7e2810fa95 Merge branch 'deferred' of github.com:jquery/jquery into deferred
Conflicts:
	Rakefile
	src/ajax.js
2010-12-31 04:21:08 +01:00
jaubourg 6fb9759a75 Simplified the way a Promise is tested for (removed promiseMarker). Removed isCancelled helper method from _Deferred, wasn't used nor tested. Reworked jQuery.Deferred and removed unnecessary variables. Also ensured a Promise will return itself when asked for a Promise. Finally, the jQuery.when tests have been revamped. 2010-12-31 04:15:15 +01:00
jaubourg 3c6f1380fa Revised conversion logic to handle converter equal to true properly. 2010-12-31 04:15:12 +01:00
jaubourg 6dbffb8596 Introduced a new promise method on deferreds that returns an immutable object (exposing then, fail, isResolved, isRejected and promise itself only). Remove $.isDeferred and moved logic directly into $.when. Made sure $.when returns a promise by using promise(). Used promise() in ajax code too. 2010-12-31 04:15:11 +01:00
jaubourg 6165cc45b7 Renamed several ajaxSettings options. Removed cors test, fixed failing cors test. 2010-12-31 04:15:09 +01:00
jaubourg 2a5c16f217 Revised logic in data conversion to account for when dataFilter modifies the dataTypes list. 2010-12-31 04:13:42 +01:00
jaubourg 981d1e08eb Removed re-usability from jXHR object (no more open, send & onreadystatechange support). Streamlined the implementation and put it back into ajax.js (removed xhr.js in the process). Went back to a more simple & direct approach to options handling (keeping much room to further minification-related optimizations). Code is cleaner, smaller & faster. Removed & edited unit tests accordingly. All build files have had xhr.js removed. 2010-12-31 04:13:40 +01:00
jaubourg 6f53be1839 Removed dataCheckers, added true as possible value for dataConverters indicating dataType equivalence (ie. no conversion has to be performed). 2010-12-31 04:05:58 +01:00
unknown 240d8b681e Removed custom method in isDeferred and when. 2010-12-31 04:05:56 +01:00
unknown 23d455b446 Deferred cannot be cancelled by returning false in a callback. Exception in the callback are still propagated and execution of remaining callbacks is still possible. 2010-12-31 04:05:55 +01:00
unknown fd63416ab1 Removed a console.log :/ 2010-12-31 04:05:54 +01:00
unknown 2d4001b82c Capitalized Deferred & _Deferred to clearly mark them as new types, like Event. 2010-12-31 04:05:53 +01:00
unknown 22e28b01e6 Changed dataConverters key format. 2010-12-31 04:05:52 +01:00
unknown 524bf39400 jQuery.parseXML extracted from ajax & added to core, needs unit testing. 2010-12-31 04:05:50 +01:00
jaubourg 5bfbe7eaf6 Removed NFE to make old Safari happy and avoid leaks in IE (as per David Murdoch's warning). 2010-12-31 04:05:49 +01:00
jaubourg d5bb001b9a Rewrote the data conversion logic in ajax. Should be cleaner and faster. 2010-12-31 04:05:48 +01:00
jaubourg e29ebbc199 Renamed jQuery.xhr.bindTransport as jQuery.xhr.transport. Generalized the implementation and made prefilters use the same logic. Cleaned up code and removed as many loops and each as possible. 2010-12-31 04:05:46 +01:00
jaubourg 2fec5dbecd Fixed a loop that only worked in webkit. 2010-12-31 04:02:33 +01:00
jaubourg 39d96ab8c5 Added deferred to core. Used internally for DOM readyness and ajax callbacks. 2010-12-31 04:01:39 +01:00
jaubourg 43828b7482 Removed NFE to make old Safari happy and avoid leaks in IE (as per David Murdoch's warning). 2010-12-31 03:56:11 +01:00
jaubourg fef0f63526 Rewrote the data conversion logic in ajax. Should be cleaner and faster. 2010-12-31 03:56:10 +01:00
jaubourg 4c49c87d4d Renamed jQuery.xhr.bindTransport as jQuery.xhr.transport. Generalized the implementation and made prefilters use the same logic. Cleaned up code and removed as many loops and each as possible. 2010-12-31 03:53:00 +01:00
jaubourg c072dbd4e2 Fixed a loop that only worked in webkit. 2010-12-31 03:49:23 +01:00
jaubourg 5bacb53866 Added deferred to core. Used internally for DOM readyness and ajax callbacks. 2010-12-31 03:49:22 +01:00
jaubourg 7b1e873cd9 Simplified the way a Promise is tested for (removed promiseMarker). Removed isCancelled helper method from _Deferred, wasn't used nor tested. Reworked jQuery.Deferred and removed unnecessary variables. Also ensured a Promise will return itself when asked for a Promise. Finally, the jQuery.when tests have been revamped. 2010-12-30 17:06:53 +01:00
Jonas Pfenniger c1625f6b79 Update Rakefile to remove module wrappers (feature parity with make and ant). Update Makefile to avoid rebuilding jquery.js when it is not necessary to do so. 2010-12-30 01:38:28 -06:00
Colin Snover 4eeae8b0bc Remove patch for very early versions of Opera 9 that made it impossible to animate values smaller than -10000. Fixes #7193. Thanks to igorw for initial patch & test case. 2010-12-30 01:23:08 -06:00
Colin Snover 3e0cc81504 Clean trailing whitespace from all files. 2010-12-30 00:34:48 -06:00
Colin Snover 429b078dc7 Merge branch 'fix7762' into jquery master. Fixes #7762. 2010-12-30 00:02:56 -06:00
Colin Snover 9029dc02a2 Update CommonJS module registration to check to see if define is a function instead of just not undefined. 2010-12-29 23:58:03 -06:00
jaubourg 64902e0345 Merge branch 'master' of github.com:jquery/jquery into deferred 2010-12-30 04:43:31 +01:00
jaubourg dfa5707306 Fix for #7865. Scripts onload handler passes event as first parameter so statusText is now passed as second argument for aborts. 2010-12-30 04:41:52 +01:00
jaubourg 7490eb4f8e Revised conversion logic to handle converter equal to true properly. 2010-12-29 18:44:45 +01:00
Dave Methvin c27d5ca6f5 By default, use document root rather than current selection's context when add()ing elements. Fixes #7853. 2010-12-28 21:07:04 -05:00
jaubourg 54d965ffa5 Introduced a new promise method on deferreds that returns an immutable object (exposing then, fail, isResolved, isRejected and promise itself only). Remove $.isDeferred and moved logic directly into $.when. Made sure $.when returns a promise by using promise(). Used promise() in ajax code too. 2010-12-28 04:13:44 +01:00
jaubourg 8c9d32723a Renamed several ajaxSettings options. Removed cors test, fixed failing cors test. 2010-12-28 02:30:51 +01:00
jaubourg 97b32d7830 Merge branch 'master' of github.com:jquery/jquery into deferred 2010-12-28 02:02:31 +01:00
Dave Methvin 5fd21fc02b Don't cache non-html strings in buildFragment to avoid possible collision with the names of Object methods like toString. Also makes the unit tests 0.5% to 8% faster. Fixes #6779. 2010-12-27 13:43:52 -06:00
Dave Methvin 64ee5581af When a native browser event is bubbling up the DOM, make sure that the correct isDefaultPrevented value is reflected by jQuery's Event object. Fixes #7793. 2010-12-27 13:30:05 -06:00
jrburke 6ffa730721 Register as a CommonJS async module if in that kind of environment. Fixes #7102. 2010-12-27 13:03:27 -06:00
Dave Methvin b8931f7448 Test for standard createEvent before IE-specific click method.
Don't fallback to fake click; let's see which browsers fail, if any.
2010-12-27 12:43:48 -05:00
Colin Snover 01cba2ecaa Merge SlexAxton/jquery:master into jquery/jquery:master. 2010-12-26 22:12:56 -06:00
Alex Sexton faabb2c318 Changed the expando string to use a random number instead of the time, so collisions become less likely. Also added jQuery version to instantly differentiate separate versions of jQuery (a common use case for noConflict, etc, when two jQuery instances are on the page). Fixes #6842. 2010-12-26 22:07:46 -06:00
Colin Snover 4443371dba DRY out $.get and $.post. Fixes #7847. Thanks to cowboy for the patch. 2010-12-26 20:56:20 -06:00
Ben Alman 78a6f5b152 Removed unnecessary upper/lowercase, it's all just lowercase now (since $.ajax will uppercase as-needed). 2010-12-26 22:49:01 +00:00
Colin Snover 37d297c67f Clearing event handlers on unload is no longer necessary in any version of IE. This issue causing memory leaks between pages was fixed in MS07-033. 2010-12-26 14:28:49 -06:00
Colin Snover a939ade9c6 Fix whitespace in event.js 2010-12-26 14:28:13 -06:00
Ben Alman 1830db4226 WETness getting you down? Fear not, the $.get and $.post methods are now 866% DRYer. This fixes #7847. 2010-12-26 18:52:27 +00:00
Colin Snover 52b1709b94 Fix reliableHiddenOffsets test was not working properly when table cells have borders, causing unnecessary slowness in some browsers. Thanks to matjas for his $.support test page. 2010-12-26 10:35:14 -06:00
jaubourg 85f0dda562 Revised logic in data conversion to account for when dataFilter modifies the dataTypes list. 2010-12-25 23:00:25 +01:00
jaubourg f7ed2aca56 Removed re-usability from jXHR object (no more open, send & onreadystatechange support). Streamlined the implementation and put it back into ajax.js (removed xhr.js in the process). Went back to a more simple & direct approach to options handling (keeping much room to further minification-related optimizations). Code is cleaner, smaller & faster. Removed & edited unit tests accordingly. All build files have had xhr.js removed. 2010-12-25 18:54:37 +01:00
jaubourg 00fb8a9ad6 Removed dataCheckers, added true as possible value for dataConverters indicating dataType equivalence (ie. no conversion has to be performed). 2010-12-25 15:38:33 +01:00
unknown 5237b09602 Removed custom method in isDeferred and when. 2010-12-25 12:52:53 +01:00
unknown 846c52d1f8 Deferred cannot be cancelled by returning false in a callback. Exception in the callback are still propagated and execution of remaining callbacks is still possible. 2010-12-25 01:29:04 +01:00
unknown e3f3f18927 Removed a console.log :/ 2010-12-25 01:27:40 +01:00
unknown 1e1a9c7eb0 Capitalized Deferred & _Deferred to clearly mark them as new types, like Event. 2010-12-24 18:53:55 +01:00
unknown d303687815 Changed dataConverters key format. 2010-12-24 18:02:45 +01:00
unknown 11642ba20c jQuery.parseXML extracted from ajax & added to core, needs unit testing. 2010-12-24 18:02:00 +01:00
Dave Methvin c9e8a95709 Simplify the check for isDefaultPrevented. 2010-12-24 09:53:39 -05:00
unknown 8ece429d12 Merge branch 'deferred' of github.com:jquery/jquery into deferred 2010-12-24 13:03:06 +01:00
jaubourg 76102f4d8b Removed NFE to make old Safari happy and avoid leaks in IE (as per David Murdoch's warning). 2010-12-24 12:59:03 +01:00
jaubourg 38101be048 Rewrote the data conversion logic in ajax. Should be cleaner and faster. 2010-12-24 12:59:02 +01:00
jaubourg 0daf7223d0 Renamed jQuery.xhr.bindTransport as jQuery.xhr.transport. Generalized the implementation and made prefilters use the same logic. Cleaned up code and removed as many loops and each as possible. 2010-12-24 12:59:01 +01:00
jaubourg 56628c7adf Fixed a loop that only worked in webkit. 2010-12-24 12:55:47 +01:00
jaubourg 116c82b027 Added deferred to core. Used internally for DOM readyness and ajax callbacks. 2010-12-24 12:55:46 +01:00
Dave Methvin 0b6afcedd2 When a native browser event is bubbling up the DOM, make sure that the correct isDefaultPrevented value is reflected by jQuery's Event object. Fixes #7793. 2010-12-23 19:59:23 -05:00
Colin Snover 1f92edee20 Fix fix for #6481 introduced at 7862c45ad2 which did not like it when Array.prototype was modified on empty arrays. 2010-12-22 18:54:22 -06:00
Colin Snover 82ac384b49 Don't use for-in loops on Arrays. Fixes #7817. Thanks to dmethvin.
Conflicts:
	src/manipulation.js
2010-12-22 18:32:33 -06:00
Colin Snover f28c774f2c Update cloneCopyEvent so that it does not create superfluous data objects when cloning elements. Exposes a new method, $.hasData. Fixes #7165. Thanks to DaveMethvin and iliakan for their help. 2010-12-22 18:19:30 -06:00
Colin Snover a2bf7ab3c0 Code style fix 2010-12-22 18:17:58 -06:00
Colin Snover e199ead4cb More unit tests and a $.hasData that works for JS objects too. 2010-12-22 15:03:01 -06:00
Colin Snover f5d4bf8920 Update jQuery.hasData to always return a boolean, with unit tests. 2010-12-22 14:54:37 -06:00
Colin Snover 445fdf720c Remove code for ticket #7717 which has been marked WONTFIX to match existing $.data functionality and to prevent infinite loops caused by circular references. 2010-12-22 14:43:17 -06:00
scottjehl 18fa1fd9da Getting window dimensions currently fails in Nokia browsers, causing JS error (and consequently making jQuery Mobile fail to render the page). Based on a tip from Ben Nolan, this fix returns window.screen[width|height] if the other attempts at getting window dimensions fail. On mobile at least, it seems to make sense, and on desktop (assuming this issue would ever show up on desktop), this might be better than returning false or undefined. 2010-12-22 15:24:07 -05:00
Colin Snover 2a47ceae5b Fix a potential error in the previous commit caused by the use of a separate index variable. Thanks to dmethvin for the review. 2010-12-22 09:16:30 -06:00
Colin Snover 5607bd8d53 Fix a potential error in the previous commit caused by the use of a separate index variable. Thanks to dmethvin for the review. 2010-12-22 09:14:53 -06:00
Colin Snover 7f617e0c9f Fix a potential error in the previous commit caused by the use of a separate index variable. 2010-12-22 09:13:28 -06:00
jaubourg c810c62a67 Removed NFE to make old Safari happy and avoid leaks in IE (as per David Murdoch's warning). 2010-12-21 17:04:07 +01:00
jaubourg 1db2f02cc7 Rewrote the data conversion logic in ajax. Should be cleaner and faster. 2010-12-21 16:58:52 +01:00
Dave Methvin acab4ab0e5 Use for loop instead of for/in loop to protect sanctity of Array.prototype. Fixes #7817. Test case for this commit is shared with the fix for #6355, https://github.com/jquery/jquery/pull/140 . 2010-12-21 10:00:49 -05:00
jaubourg 91d32e8f96 Renamed jQuery.xhr.bindTransport as jQuery.xhr.transport. Generalized the implementation and made prefilters use the same logic. Cleaned up code and removed as many loops and each as possible. 2010-12-21 13:06:41 +01:00
Dave Methvin 4424bda377 Use a for loop rather than for/in loop when copying events, so that code will work with an augmented Array.prototype. Fixes 7809. 2010-12-20 22:23:59 -05:00
jaubourg 9e3f053c65 Fixed a loop that only worked in webkit. 2010-12-21 00:56:00 +01:00
jaubourg 88d97deb77 Added deferred to core. Used internally for DOM readyness and ajax callbacks. 2010-12-20 19:09:15 +01:00
Colin Snover faefbb1ad0 Fix #7717 and #7165. Thanks to dmethvin and iliakan for their help fixing these issues. 2010-12-19 15:33:53 -06:00
Gianni Chiappetta ade531cfaa Noted which browsers don't support Function#bind. 2010-12-18 19:26:36 -05:00
Gianni Chiappetta 6bc9fc7c10 Perf. improvement based on fearphage's suggestion (direct vs call vs apply). 2010-12-18 19:17:37 -05:00
Gianni Chiappetta 1ebb5ab3e1 Added list of browsers that currently support Function#bind. 2010-12-16 16:04:23 -05:00
Colin Snover 291b1edf44 Address some code style issues in the clone fix. 2010-12-16 01:29:06 -06:00
Gianni Chiappetta 5b1b57850c Add a quick test to $.support for native bind.
As per the suggestion by ajpiano: 9f8cd6c499 (commitcomment-218658)
2010-12-15 18:31:10 -05:00
Gianni Chiappetta 9f8cd6c499 Fixing $.proxy to work like (and use) Function.prototype.bind (ticket #7783)
http://bugs.jquery.com/ticket/7783
2010-12-14 21:53:04 -05:00
Colin Snover 2defa4863a Fixes #7397. 2010-12-14 00:40:28 -06:00
Colin Snover efcf1a7921 Merge branch 'bug_7397' of https://github.com/rwldrn/jquery into rwldrn-bug_7397 2010-12-14 00:37:11 -06:00
Colin Snover c9c9057c4d More specific version numbers. 2010-12-12 20:01:47 -06:00
Colin Snover 1a3fd3329d Speed up & compatibility improvements for new clone mechanism in IE. 2010-12-12 19:23:22 -06:00
Colin Snover 8b33e23ea0 Return test comments to ASCII space 2010-12-12 13:37:00 -06:00
Colin Snover 4fae75d575 Merge branch 'bug5566' into csnover-bug5566. Fixes #4386, #5566, #6997.
Conflicts:
	src/manipulation.js
	test/unit/manipulation.js
2010-12-12 02:39:06 -06:00
Colin Snover 7481a3645a Fix the clone method to be a little less insane in IE, which fixes the new event-cloning clone() as well as probably a bunch of IE-related clone bugs. 2010-12-12 02:20:31 -06:00
jaubourg 974637d639 Simplified headers tests: removed multiline headers (support is far too servers & browsers dependant) and made all the tests in a single request. 2010-12-11 02:41:39 +01:00
jaubourg 0b0889ceaa Tweaked the headers test to be apache independent and actually work. 2010-12-11 02:21:54 +01:00
jaubourg 9d3a4a2b40 Removed bind/unbind from xhr emulation: success/error/complete are deferred not events so these methods didn't really make sense in the first place. 2010-12-11 02:04:13 +01:00
jaubourg 8ab5e1e45c Added the regexp to remove module closures to the ant build file to be on par with the Makefile. 2010-12-11 01:56:29 +01:00
jaubourg 2e129759b4 More variable renaming to avoid conflicts when module closures are removed. 2010-12-11 01:35:46 +01:00
jaubourg 9fa9a57076 Changed document.location to window.location per Ben Alman advice. 2010-12-10 07:00:06 +01:00
jaubourg a500d33c5d Renamed variables to avoid conflicts when Makefile removes internal closures. 2010-12-10 04:16:56 +01:00
jaubourg ab74d8e6a0 Fix the closure in ajax.js too. 2010-12-10 03:16:50 +01:00
jaubourg 3c641bd134 Fixed function closures so that Makefile can do its magic. 2010-12-10 03:14:03 +01:00
jaubourg ac80ca2883 Replaced spaces with a tab in Makefile. 2010-12-10 02:55:43 +01:00
jaubourg 9b9d270e3d Removed non-standard (and not that useful) xhr emulation methods & reworked the headers test as a consequence. 2010-12-10 02:45:08 +01:00
jaubourg 317888464d Added xhr.js and transports/*.js to Rakefile and build.xml (in sync with Makefile). 2010-12-10 02:43:41 +01:00
jaubourg ab3ba4a812 Rewrite of the Ajax module by Julian Aubourg. Some (dated) details can be found here: http://oksoclap.com/6Y26bm1ZsB more details are forthcoming. Fixes #7195. 2010-12-09 13:34:28 -05:00
jeresig 29616e60c8 Backing out cec68e2b00, was causing serialize tests to fail. Un-fixes #5566. 2010-12-09 13:27:52 -05:00
jeresig b4bb6e1126 Backing out fb6c038bf0, was causing jQuery.param tests to fail - unfixes #7413. 2010-12-09 13:07:44 -05:00
jeresig bc05cb9d80 Merge branch 'explain-map-concat' of https://github.com/ajpiano/jquery into ajpiano-explain-map-concat 2010-12-09 12:51:14 -05:00
rwldrn a59bb30d0a Whitespace correction 2010-12-09 12:50:01 -05:00
rwldrn 1cdd9f8cab Whitespace correction 2010-12-09 12:48:52 -05:00
rwldrn 5b2408147b Whitespace correction 2010-12-09 12:47:53 -05:00
rwldrn 00f1dfdd57 Reorders condition at L65 for efficiency 2010-12-09 12:44:52 -05:00
jeresig cec68e2b00 Merge branch 'bug5566' of https://github.com/csnover/jquery into csnover-bug5566 2010-12-09 12:44:30 -05:00
jeresig b2ea79c401 Merge branch 'attrFollowupFix' of https://github.com/jitter/jquery into jitter-attrFollowupFix 2010-12-09 12:43:10 -05:00
jeresig a13089d5b4 Merge branch 'rfxnum' of https://github.com/lrbabe/jquery into lrbabe-rfxnum 2010-12-09 12:37:30 -05:00
jeresig b67154fd10 Merge branch 'support_6897' of https://github.com/rwldrn/jquery into rwldrn-support_6897 2010-12-09 12:33:26 -05:00
jeresig fb6c038bf0 Merge branch 'bug_7413' of https://github.com/rwldrn/jquery into rwldrn-bug_7413 2010-12-09 12:32:15 -05:00
louisremi 796d25cf07 Precising the unit part of rfxnum regex 2010-12-09 10:23:45 +01:00
Anton M cc9dbd06e5 Fix attr() problems in IE with attribute nodes. Followup to commit b50f41a2.
IE can't add properties on an attribute-node element, thus we handle it
like text-/comment-nodes.
2010-12-07 03:17:42 +01:00
Colin Snover e4900df838 Clone fragments in domManip using jQuery.clone instead of DocumentFragment.cloneNode in order to carry over event data. Fixes #5566, #6997. 2010-12-06 19:37:16 -06:00
Colin Snover c8be9461ee Clean up empty lines with whitespace in manipulation.js 2010-12-06 19:36:42 -06:00
John Resig 8943b427f6 Merge branch 'bug7524' of https://github.com/csnover/jquery into csnover-bug7524 2010-12-06 17:24:13 -05:00
John Resig 9759e9f6bb Merge branch 'bug6242' of https://github.com/csnover/jquery into csnover-bug6242 2010-12-06 17:23:08 -05:00
John Resig 6c68124928 Merge branch 'bug7531' of https://github.com/csnover/jquery into csnover-bug7531 2010-12-06 17:22:02 -05:00
John Resig b00ab56160 Merge branch 't6398' of https://github.com/jitter/jquery into jitter-t6398 2010-12-06 17:19:30 -05:00
John Resig 0276b9de7e Merge branch 't4386' of https://github.com/jitter/jquery into jitter-t4386 2010-12-06 17:14:20 -05:00
John Resig 54a68fa973 Merge branch 't7578' of https://github.com/jitter/jquery into jitter-t7578 2010-12-06 17:06:26 -05:00
John Resig df3441bac7 Merge branch 't5476' of https://github.com/jitter/jquery into jitter-t5476 2010-12-06 17:05:02 -05:00
John Resig d4a9d45527 Merge branch 'restrictAttr' of https://github.com/jitter/jquery into jitter-restrictAttr 2010-12-06 17:02:00 -05:00
John Resig e56d6f676b Merge branch 't7673' of https://github.com/jitter/jquery into jitter-t7673 2010-12-06 16:57:41 -05:00
John Resig 21d08eb008 Merge branch 'jquery145' of https://github.com/danheberden/jquery into danheberden-jquery145 2010-12-06 16:38:51 -05:00
Colin Snover 11e52bdaea Only try to get data attributes for a jQuery-wrapped object if it is actually an Element node. Fixes #7524. 2010-12-03 01:19:39 -06:00
Colin Snover 238ac5a0aa Fix memory leaks in IE caused by the custom abort function of $.ajax. Fixes bug #6242. 2010-12-03 00:12:52 -06:00
Anton M df0a3fb853 Handle carriage return characters in className property. Fixes #7673. 2010-12-01 21:31:22 +01:00
adam j. sontag 34bf1a2a7d Add a comment explaining that jQuery.map flattens arrays 2010-11-27 17:15:33 -05:00
Anton M a2c2d68d7f Add unit test for fix to #7578. 2010-11-24 23:35:26 +01:00
Russell Holbrook 50170e6180 jQuery.fn.offset no longer returns ClientRect object for disconnected elements
Instead of returning box, which is a ClientRect, we take the top and left box
values and place them into a generic object.
2010-11-22 18:26:46 -05:00
Jephte CLAIN 596f9a1f21 Merge branch 'master' of https://github.com/jclain/jquery 2010-11-22 08:31:17 +04:00
Jephte CLAIN dd79199a08 fix to follow current source style 2010-11-22 08:30:17 +04:00
Jephte CLAIN 1ac7b459a4 respect source guidelines 2010-11-22 08:12:12 +04:00
danheberden 3e6e3c5eb8 Fix for #6911 - prevent disabled elements in liveHandler 2010-11-21 16:54:56 -08:00
Anton M 89b771daef Make sure custom events named "submit" can be bound to non DOM elements in IE too. Fixes 6398. 2010-11-21 04:31:04 +01:00
Anton M ab2a70e6cf Make sure IE clones body elements correctly. Fixes 4386. 2010-11-21 01:58:46 +01:00
Anton M 8259efe734 Set cache to false as default for script or json requests. Fixes 7578. 2010-11-19 23:14:24 +01:00
Anton M 5c0b5d2560 Improve performance of get() for negative indices. Fixes #5476. 2010-11-19 12:28:13 +01:00
Colin Snover c04500a834 Optimize for size instead of speed. 2010-11-17 14:50:05 -06:00
Colin Snover 2a0c7d702b Coerce s.url to string before calling replace, since replace is also a method of a Location object. Fixes #7531. 2010-11-17 00:59:24 -06:00
Anton M b50f41a2e3 Make sure attr() works on non DOM element nodes. Fixes #7202, #7451, #7500.
Also added some tests for this attr(name), attr(name, value) and removeAttr(name).
2010-11-13 14:39:28 +01:00
Henri Wiechers e1d6edf822 Convert test/data/text.php to use lf line endings. 2010-11-12 07:45:24 +02:00
Henri Wiechers 4190059c76 Convert test/delegatetest.html to use lf line endings. 2010-11-12 07:42:53 +02:00
Henri Wiechers 866ba43d0a Mark *.jar files as binary. 2010-11-12 07:41:44 +02:00
Henri Wiechers 4a1559e127 Changed crlf attribute to newer eol one. 2010-11-12 07:40:19 +02:00
John Resig 0838bdf52c Updating the source version to 1.4.5pre. 2010-11-11 19:05:10 -05:00
John Resig 902cc7947c Tagging the 1.4.4 release. 2010-11-11 19:04:53 -05:00
jeresig 648b0513fa Updating the source version to 1.4.4pre. 2010-11-10 11:15:02 -05:00
jeresig 50708c0707 Tagging the 1.4.4rc3 release. 2010-11-10 11:14:53 -05:00
rwldrn 2a23650a19 Updating #7397 unit tests to correctly test for a persisted display value 2010-11-10 10:23:48 -05:00
jeresig 86cf820d36 Backing out commit 795e880bba - errors popping up in IE 6/7/8. 2010-11-09 23:42:05 -05:00
jeresig efaf375e56 Need to also handle the case where 'auto' is being returned, as in Firefox. Follow-up to #7395. 2010-11-09 23:33:18 -05:00
jeresig 3394d32ea7 Maintain returning 0px from width/height for disconnected nodes for backwards compat, for now. Fixes #7395. 2010-11-09 23:29:26 -05:00
rwldrn 795e880bba Fixes #7397; Adds 4 supporting unit tests. 2010-11-09 23:18:16 -05:00
Anton M 49f088f2db Partially revert commit a64dc04050.
Removing the conditional was too liberal as now attr() would even work
on plain javascript objects. Keeping a check to make sure it is at least
a DOM Node is appropriate. Using nodeName as in the commit which introduced
the nodeType === 1 check seems plausible.
2010-11-10 00:36:53 +01:00
rwldrn 8f2667f4c0 Clean #7397; Removed unnec. var declaration 2010-11-09 18:20:27 -05:00
rwldrn 118c8c4600 Fixes #7397; 4 supporting unit tests 2010-11-09 18:06:33 -05:00
rwldrn e2d0671f4c Support unit test for #6897 2010-11-09 16:31:52 -05:00
rwldrn fc563cc42a Fixes #7413; isEmptyObject() check to see if obj passes isPlainObject 2010-11-09 16:14:11 -05:00
Colin Snover a64dc04050 Remove conditional that prevents attr from working on non-Element nodes. Fixes #7451. 2010-11-09 15:52:20 -05:00
John Resig d1a88b2e58 Merge branch 'fixAdjacentTests' of https://github.com/jitter/jquery into jitter-fixAdjacentTests 2010-11-09 15:49:07 -05:00
John Resig b0e1e83aa9 Ensure that unquoted attribute selectors are quoted (allowing them to go into qSA/matchesSelector properly). Fixes #7216. 2010-11-09 14:03:11 -05:00
John Resig 983548f8eb Make sure that if an additional load event is triggered (such as an iframe being dynamically injected in DOM ready) the ready event isn't triggered twice. Fixes #7352. 2010-11-09 13:44:06 -05:00
John Resig aa74396976 Merge branch 'bug7422' of https://github.com/csnover/jquery into csnover-bug7422 2010-11-09 12:40:55 -05:00
Anton M a42f7a2590 Fix selector tests broken by newer version of Qunit. 2010-11-09 18:13:39 +01:00
John Resig fb48ae8e6c Make sure that when multiple variables are being declared that assignments are each done on their own line. 2010-11-09 11:09:07 -05:00
John Resig b5b3c73db3 We don't do end of line comments, move them above. 2010-11-09 10:34:32 -05:00
Colin Snover e57b73a0ac Ensure that AJAX requests are actually aborted in all browsers. Fix #7422. 2010-11-06 13:52:30 -05:00
jeresig a4df6945b8 Merge branch 'master' of github.com:jquery/jquery 2010-11-03 19:00:05 -04:00
jeresig d9478954b9 Limit the scope of the CSS 'auto' change to just height/width. Fixes #7393. 2010-11-03 18:59:55 -04:00
jeresig 3e38a861fe Limit the scope of the CSS 'auto' change to just height/width. Fixes #7293. 2010-11-03 18:57:22 -04:00
jeresig 335e0a33e1 Updating the source version to 1.4.4pre. 2010-11-03 15:46:40 -04:00
jeresig 4d7f7453dc Tagging the 1.4.4rc2 release. 2010-11-03 15:46:31 -04:00
jeresig fb4445070c Opera doesn't give height/width of display: none elements with getComputedStyle but does with currentStyle - fall back to that if it exists. 2010-11-03 15:39:28 -04:00
jeresig 62c83a764c Only change ID on nodes that don't already have an ID for rooted qSA. Fixes #7212. 2010-11-01 19:29:11 -04:00
jeresig 9d1bfeb7ff Make sure that accessing computed CSS for elements returns 'auto' instead of '' consistently. Fixes #7337. 2010-11-01 19:04:59 -04:00
John Resig e377621eaf Fix quotes in comment. 2010-10-28 15:59:58 -04:00
Brandon Aaron 6020b6bb38 Fix tab spacing. 2010-10-28 11:58:03 -05:00
jeresig 6e7a4e73a2 Calling .hide().show() on a stylesheet-hidden element wasn't bringing it back. Fixes #7331. 2010-10-27 14:35:26 -04:00
Karl Swedberg 6ab402dced For .show() with no arguments, only set display of elements in the second loop if they don't have style.display already set or if style.display isn't none. Fixes #7315. 2010-10-26 14:37:44 -07:00
John Resig 7066bb384b Temporarily backing out commit bd474799bf. 2010-10-25 20:26:19 -07:00
John Resig a68a85ad09 Merge branch 'jquery_dev' of http://github.com/danheberden/jquery into danheberden-jquery_dev 2010-10-25 20:25:25 -07:00
John Resig de58db0cdf Backing out fix for #5803 from 3b50eaca2c. 2010-10-25 17:54:27 -07:00
danheberden bd474799bf Prevent IE from firing live/delegate events on disabled elements. (#6911) 2010-10-25 14:07:44 -07:00
John Resig 9b97599fa4 Updating the source version to 1.4.4pre. 2010-10-25 13:26:07 -07:00
John Resig c22623602e Tagging the 1.4.4rc1 release. 2010-10-25 13:25:10 -07:00
John Resig a4fc842019 Merge branch 'jquerymaster' of http://github.com/SlexAxton/jquery into SlexAxton-jquerymaster 2010-10-25 13:06:55 -07:00
John Resig 7e4f88e206 Merge branch '6897' of http://github.com/SlexAxton/jquery into SlexAxton-6897 2010-10-25 13:06:23 -07:00
dmethvin 09022e0b09 Allow DELETE requests to have a content body, and properly serialize data to the url for HEAD requests. Fixes #7285. 2010-10-25 13:06:02 -07:00
dmethvin 974b5aeab7 Honor stopImmediatePropagation for live/delegate event handlers. Fixes #7217. 2010-10-25 13:05:31 -07:00
John Resig ee845c4975 Merge branch 'master' of http://github.com/rwldrn/jquery 2010-10-25 13:05:11 -07:00
John Resig 36143ce633 Merge branch 'unusedTrue' of http://github.com/lrbabe/jquery into lrbabe-unusedTrue 2010-10-25 12:36:40 -07:00
lrbabe 1a2400de08 .cur() doesn't take any boolean parameter since 1.4.3 2010-10-25 17:19:45 +02:00
Alex Sexton 086822e641 Moved jQuery.props to attributes since it was only used in support. Fixes #6897 - suggestion by dmethvin 2010-10-25 02:31:19 -05:00
rwldrn 3b50eaca2c Fixes #7229 and #5803 2010-10-24 12:18:33 -04:00
John Resig 9bd9ebdd73 Allow for versions with spaces in them, in the Makefile. 2010-10-23 00:35:09 -04:00
jeresig 53396b879b Make sure that .width()/.height() don't return NaN also standardize on returning instead of auto for default values (which is what we do elsewhere in .css() as well). Fixes #7225. 2010-10-22 02:39:06 -04:00
jeresig 7e02cee5ff Make sure that the correct height/width of the elements is retreived. Fixes #7225. 2010-10-22 02:16:14 -04:00
jeresig d9a3e0080a Fix broken selector code from last commit. 2010-10-22 01:48:32 -04:00
jeresig 424500bcf0 Make sure that +, >, ~ leading, rooted, selectors go to the old engine. Thanks to @rkatic for the catch! Fixes #7220. 2010-10-22 01:18:58 -04:00
jeresig 6bc30425f6 Make sure that we don't use matchesSelector on XML Documents (same as with qSA). Fixes #7219. 2010-10-22 00:40:06 -04:00
jeresig 4fc86d5eb1 Make sure that we aren't reading one of the bad expandos. Fixes #7212. 2010-10-22 00:36:07 -04:00
jeresig 8b129ccd49 Be sure to clean up the previous test. 2010-10-22 00:29:52 -04:00
jeresig e4a38670b1 Make sure that height/width getters work on hidden inputs and disconnected elements. Fixes #7225. 2010-10-22 00:28:33 -04:00
jeresig 3df41db036 Make sure that the ready event doesn't double-fire when .bind(ready) is used. Fixes #7247. 2010-10-22 00:08:34 -04:00
jeresig 9be7461c3c Adding another test for an issue in Gecko's matchesSelector implementation. Fixes #7243. 2010-10-21 23:46:21 -04:00
jeresig 0174518a49 Only need to declare the data once. 2010-10-21 23:18:47 -04:00
Alex Sexton a58f8f22d1 Forces lower case comparison of protocol and host when determining whether the request is remote or local. Fixes #6908 2010-10-20 21:12:47 -07:00
Anton M 4fcfee4369 Update number of expected assertions in attribute tests
Followup to commit 97dfa0d5a8 which
had the side effect to break some attribute unit tests
2010-10-19 11:14:07 +02:00
Jephte CLAIN 689d63f487 Return control of $ and jQuery only if it is really necessary. This make
jQuery.noConflict() callable anytime.
2010-10-19 09:32:13 +04:00
John Resig 008e971943 Add some more tests to make sure that pulling in data- properties on an element with no data set, works. 2010-10-17 14:48:24 -04:00
Paul Irish 97dfa0d5a8 fadeToggle(). as suggested by Karl Swedberg in his jQcon talk. patched live! omg 2010-10-17 14:26:32 -04:00
John Resig 8a5df39045 Make sure that .data() (no args) returns a list of all the data- properties as well. Also make sure that accessing a data- property via .data() doesn't cause it to change again at a later time (it should be static). Fixes #7222, #7223. 2010-10-17 11:42:53 -04:00
rjgotten df7dfc2404 Check against the type attribute of script elements retrieved through getElementsByTagName() so that only those elements of type "text/javascript" are handled by 'clean'.
Fixes #6180: jQuery.clean should not touch script tags that are not of type text/javascript
2010-10-17 08:30:05 -07:00
John Resig a7d0b0b9e8 Var wasn't being explicitly declared. Fixes #7226. 2010-10-17 10:58:01 -04:00
John Resig e1b940d748 We removed deleteExpando after 1.4.2, for some reason. This caused problems with removeData() (no arguments). Fixes #7209. 2010-10-17 10:56:01 -04:00
John Resig 25828768d7 Handle the case where JSLint complains about arguments in try/catch already being defined (we use the name 'e' consistently for catch(e) - will work to standardize on that now). 2010-10-17 10:50:17 -04:00
John Resig 497fc9849e Bringing back the change from 80a4178af9, adapted to handle both the function collision and the issue mentioned in #7196. 2010-10-15 01:29:38 -04:00
jeresig 091c481aca Updating the source version to 1.4.4pre. 2010-10-14 23:10:19 -04:00
jeresig 2d201873ff Tagging the 1.4.3 release. 2010-10-14 23:10:06 -04:00
jeresig 0564553bf1 Fix the number of change tests and remove textarea tests. 2010-10-14 22:37:56 -04:00
jeresig 21d389ccea Testing *, * was unnecessary - especially in slower browsers. 2010-10-14 22:06:27 -04:00
jeresig 40aa95c320 Don't test inline-block in browsers that don't support it (or an approximation of it, like IE). 2010-10-14 21:48:03 -04:00
jeresig 2d5f8666ac Use prepend for the focuin test (to avoid making the test suite jump). 2010-10-14 21:40:35 -04:00
jeresig f009fb2f86 Test visible on inline elements. 2010-10-14 21:31:36 -04:00
jeresig c8e5d0bca0 Getting weird results for font size tests across platforms - easier to test something else (the exact property isn't important for this test). 2010-10-14 21:15:20 -04:00
jeresig 80a4178af9 Reverting commit 39addc87a3 after a report of problems. Fixes #7196. 2010-10-14 20:55:40 -04:00
John Resig 8576570e6e Forgot to update the Rakefile and build.xml files from the previous commit. Thanks to @jitter for the catch. 2010-10-14 16:57:12 -04:00
John Resig ae772e7422 Updating the copy of Google Closure Compiler. 2010-10-14 16:35:35 -04:00
John Resig ea507b3e99 Make sure that we don't attempt to handle scrolling when the node is disconnected from the document. Fixes #7190. 2010-10-14 14:52:31 -04:00
jeresig d490bcfa7c Oops, still have jQuery.ajax.* on the brain. 2010-10-13 21:25:23 -04:00
jeresig cd8f4917ba Change font size to 15px in the test to fix a false negative. Thanks @jitter for the catch in 73e4ef27f0. 2010-10-13 14:27:44 -04:00
Justin Meyer f3d610e064 beforedeactivate will fire before focusout - use that to our advantage when working with the change event. 2010-10-13 10:38:29 -04:00
Justin Meyer 88068f82c1 Make sure that focusin/focusout bubbles in non-IE browsers. 2010-10-13 10:35:28 -04:00
Pinhook 39addc87a3 Handle issue with two concurrent JSONP requests that use the same callback name. 2010-10-13 10:30:19 -04:00
jeresig 8fb4d9af74 We want to make sure that we only run the MSIE-specific filter tests if opacity is explicitly not supported. 2010-10-13 00:42:05 -04:00
jeresig 73e4ef27f0 Test CSS test on font size instead of padding. 2010-10-13 00:32:52 -04:00
jeresig 9ede46b004 IE 9 preserves the case of the Alpha filter - maintain it in the test as well. 2010-10-13 00:10:32 -04:00
jeresig ec462a33af Fix broken Ajax test after recent revert to jQuery.ajax namespace. 2010-10-13 00:07:52 -04:00
John Resig 2ef8da0924 Merge branch 'bug7150' of http://github.com/csnover/jquery 2010-10-12 21:51:44 -04:00
John Resig 783bb2a85f Fix some gaps in the handling of event data properties. Thanks to @jitter in ff6ceadbfd for the catches. 2010-10-12 20:56:46 -04:00
Colin Snover 1518ae1aed Fix patch for #7150, which was not deleting the events object properly on plain JS objects. Thanks to jitter for catching it. 2010-10-12 18:49:37 -05:00
John Resig 9ced9f288c Updating the source version to 1.4.3pre. 2010-10-12 15:44:53 -04:00
John Resig 3e5520fbdc Tagging the 1.4.3rc2 release. 2010-10-12 15:44:36 -04:00
John Resig b85f8673d9 Tagging the 1.4.3rc2 release. 2010-10-12 15:38:15 -04:00
John Resig 478fa8fdb3 Forgot to remove the child selector in the previous commit. 2010-10-12 10:56:02 -04:00
John Resig 085de84959 The child selector-prefix branch doesn't work with selectors that have a larger depth. Removing for now - will need to re-evaluate in the future. 2010-10-12 10:13:00 -04:00
John Resig 5200194f51 Make sure that .find() with multiple direct child selectors is handled correctly. Fixes #7144. 2010-10-12 09:19:49 -04:00
Colin Snover ff6ceadbfd Use a key name less likely to result in collisions for events on plain JS objects. Fixes bug #7150. 2010-10-11 23:35:18 -05:00
John Resig 6245ecb2b9 The world isn't ready for moving the Ajax methods to jQuery.ajax.*. Hope to move them there some day. Fixes #7146. 2010-10-11 18:29:52 -04:00
John Resig 1df5084c97 Handle some edge cases with binding events to the window object (which is also a plain object - causing some confusion). Fixes #7143. 2010-10-11 18:20:57 -04:00
John Resig c00a6ff1f1 Add some resize event tests. 2010-10-11 18:03:54 -04:00
John Resig 1dee0d2ed8 Added some more tests relating to attaching data to a window. 2010-10-11 17:52:00 -04:00
John Resig d23f63b13e Merge branch 'animateHooks' of http://github.com/lrbabe/jquery into lrbabe-animateHooks 2010-10-11 16:44:12 -04:00
John Resig 5f30ae3b6f Merge branch 'bug7141' of http://github.com/csnover/jquery into csnover-bug7141 2010-10-11 16:40:10 -04:00
Colin Snover 5646a4feee Fix olddisplay was inappropriately set when calling hide on an already hidden element. Fixes #7141. 2010-10-11 15:22:43 -05:00
Scott González 22ccbf82c8 Fixed getting styles from disconnected nodes. Fixes #7148. 2010-10-11 15:11:03 -04:00
lrbabe aa9e4db1ab Make $.fn.animate compatible with jQuery.cssHooks 2010-10-11 16:08:38 +02:00
Ryan W Tenney 2866f16c09 Removed trailing \x0A from version.txt which caused a problem with the build (at least in ant) 2010-10-11 08:45:18 -04:00
John Resig 385ca2aa89 Make sure closest works on disconnected DOM nodes. Fixes #7142. 2010-10-11 07:45:15 -04:00
jeresig 2c04035cd1 Fix broken min file header generation. 2010-10-10 23:28:30 -04:00
jeresig 71a58263ec Updating the source version to 1.4.3. 2010-10-10 23:09:07 -04:00
jeresig 66a788ab83 Tagging the 1.4.3rc1 release. 2010-10-10 23:09:04 -04:00
jeresig 19b4ba35c4 Return the zeroed-out bounding box instead of passing it on. 2010-10-10 18:54:30 -04:00
jeresig 26db3f0933 Disable 304/Not Modified Ajax tests in Opera due to lack of suitable workaround. See: http://gist.github.com/599419 2010-10-10 18:46:32 -04:00
jeresig 884de15fb9 Make sure that the unload event doesn't leak in IE - use jQuery's binding mechanism to make that happen. 2010-10-10 18:01:59 -04:00
jeresig bb0b9b8958 Adding some rooted-find perf tests. 2010-10-10 16:06:33 -04:00
jeresig fac7e61f16 Tweaking some formatting of the closest changes. 2010-10-10 15:42:56 -04:00
jeresig ba149e78a9 Switch back to using Sizzle.matchesSelector. 2010-10-10 15:36:02 -04:00
jeresig eb67d99416 Use the new Sizzle matches functionality. 2010-10-10 15:14:23 -04:00
jeresig 1f7bbd8939 Also test for single element filtering. 2010-10-10 14:51:11 -04:00
jeresig f2b028f736 Adding a basic filter perf test suite. 2010-10-10 14:16:35 -04:00
jeresig 63c892b1ed Make some more tweaks to the closest perf test suite. 2010-10-10 13:39:06 -04:00
jeresig 6f0b06aa9b Fix formatting and switch to using the new matchesSelector method in Sizzle. 2010-10-10 13:37:36 -04:00
jeresig 96d8c481b8 Some improvements to the closest perf tests - works in all browsers now. 2010-10-10 13:22:39 -04:00
wycats 0ca35de311 Should improve performance of closest considerably. Benchmark proof in speed/closest.html 2010-10-09 21:33:02 -07:00
jeresig cbf9d874e5 Change event did not fire in IE when an explicit .focus() was used. Fixes #6374. 2010-10-09 19:04:15 -04:00
jeresig 79305ed146 Fix the case where live change was breaking if a live click was bound ahead of time. Very similar to #6359. Fixes #6505. 2010-10-09 18:16:08 -04:00
John Resig 10065a8deb Merge branch 'master' of http://github.com/petersendidit/jquery into petersendidit-master 2010-10-09 18:04:54 -04:00
John Resig 4a0759dc79 Merge branch 'bug7123' of http://github.com/csnover/jquery into csnover-bug7123 2010-10-09 16:27:59 -04:00
John Resig 9b655a176b Merge branch 'bug7018' of http://github.com/csnover/jquery into csnover-bug7018 2010-10-09 16:25:55 -04:00
John Resig b0dcc1746f Merge branch 'animate-nonblock' of http://github.com/csnover/jquery into csnover-animate-nonblock 2010-10-09 16:21:02 -04:00
jeresig da597bcf90 Name the try/catch arg to satisfy JSLint - thanks to @rwldrn in 873c28425f for the catch. 2010-10-09 12:26:44 -04:00
jeresig 51283d9643 Added some more tests to make sure that replaceWith is working correctly. Follow-up to the comment on 2a6de9ab66. 2010-10-09 11:41:58 -04:00
jeresig 2ae872c594 Make sure null/NaN values aren't set in .css(). Fixes #7116. 2010-10-09 10:52:53 -04:00
Colin Snover 2ca3659895 Prevent IE from throwing errors when setting RGBA values. Fixes #5509. 2010-10-09 10:42:01 -04:00
Colin Snover b03416954d Coerce all array values to strings before comparison in val(). Fixes bug #7123. 2010-10-08 22:48:06 -05:00
Colin Snover 543db64412 Fixed code convention issues. Reduced size of overflow reset code. Fixed broken show() test cases. 2010-10-08 20:29:41 -05:00
David Petersen 3bd737e81a Merge branch 'master' of git://github.com/jquery/jquery 2010-10-07 20:55:47 -04:00
Colin Snover d2e64979bf Fix bug #7018. 2010-10-06 03:03:28 -05:00
Colin Snover 91028794d5 Update $.fn.animate to only keep overflow set to hidden after an animation in IE6 when it is needed (width/height change) and update unit tests to reflect when overflow does not get reset. 2010-10-05 15:20:44 -05:00
Colin Snover 5057ff9f43 IE6 will shrink-wrap elements with layout instead of allowing content to flow outside of the border-box. Add a test for this and do not remove the overflow property after an animation in IE6. 2010-10-05 14:53:35 -05:00
Colin Snover 329b750af6 Tiny cleanup to remove some superfluous code that was left in from before I decided not to reset the display of inline elements after animation finishes (since this just causes it to jump back once complete). 2010-10-05 13:38:19 -05:00
Colin Snover 69e4f2535b Update $.fn.animate to restore overflow-x and overflow-y separately. Fixes #7111. 2010-10-05 13:32:07 -05:00
Colin Snover 0cdcef5b36 Update $.fn.animate to change display mode only when necessary (inline, non-floated elements), and to use a more proper display mode for those elements. Fixes #2185. 2010-10-05 13:28:43 -05:00
Colin Snover 0229b83f7e Fix :visible does not work properly when display:none is set directly on an element in IE8. Fixes #4512. 2010-10-05 13:23:10 -05:00
rwldrn a2aefbf3b1 Fixes acceptData defining in the global scope. 2010-10-05 10:32:57 -04:00
John Resig 57c046f91c Tweak broken serialize tests from commit 879799fe95. Thanks to @jaubourg for the catch. 2010-09-30 15:40:30 -07:00
Colin Snover 06c505d851 Make sure setting opacity does not clobber other inline filters. Fixes #7101. 2010-09-30 11:24:59 -07:00
David Petersen 60744e8abd Set event.LiveFired to undefined in specialSubmit handler so that click events bound before the submit won't prevent the submit to fire. Fixes #6359 2010-09-30 13:46:36 -04:00
Dave Reed cb811c04b0 Using data() on JavaScript objects sets fields directly on the object. Note that events are now a property of a function (to avoid JSON serialization - and only in the case of JavaScript objects, not DOM nodes). Fixes #6807. 2010-09-29 06:46:25 -07:00
John Resig ec7ea3fba1 Adjust fallback top/left to just be 0 for disconnected DOM nodes. Follow-up to cf672a2e7a, thanks to @jitter for the catch. 2010-09-29 05:45:52 -07:00
John Resig 49f6f34181 Fix number of expected select tests from commit 879799fe95. Thanks to @jitter for the catch. 2010-09-29 05:41:27 -07:00
John Resig ab77451843 Fix mis-type in commit e3c4e57897. Thanks to @jdalton for the catch. 2010-09-28 20:13:40 -07:00
John Resig f1f6bc3ec4 Handle child selectors in particular - away from the selector engine. Fixes #7029. 2010-09-28 10:33:21 -07:00
John Resig 873c28425f Make sure we have a fallback when XMLHttpRequest is manually disabled. Fixes #6298. 2010-09-28 10:12:33 -07:00
John Resig 0368606c08 Make sure that the contents of the element is still in place when html(Function) is called. Fixes #6733. 2010-09-28 09:50:44 -07:00
John Resig e3c4e57897 Tweak the logic for fixing event.which. Fixes #2338. 2010-09-28 09:07:57 -07:00
John Resig 9190d4fd60 Make sure that mixed case alpha filters are handled correctly in IE. Fixes #5632. 2010-09-28 08:57:20 -07:00
John Resig 558d96b42a Make setting .css(name, undefined) a no-op. Fixes #4388. 2010-09-28 08:53:09 -07:00
John Resig 879799fe95 Make sure that ambiguous val() selection works correctly. 2010-09-28 08:36:28 -07:00
John Resig c7c0677230 Make .attr(name, null) equivalent to removeAttr(name). (Was roughly this before - but is now consistent across platforms). Fixes #6341. 2010-09-28 11:12:13 -04:00
John Resig cf672a2e7a Make sure that .offset() doesn't fail against disconnected DOM nodes. Fixes #4996. 2010-09-28 10:55:48 -04:00
jeresig 7be11207b9 Removing unique check on closest(Array) (it wasn't appropriate there and broke functionality elsewhere) - follow-up to commit 8c41325a08. Also added another test for closest(Array) after a discussion with @jitter in 26b0e913dd. 2010-09-27 20:59:42 -04:00
jeresig 8c41325a08 Merge branch 'closestbug-6700' of http://github.com/ajpiano/jquery into ajpiano-closestbug-6700 2010-09-27 15:45:02 -04:00
jeresig e63fa8beb8 Merge branch 'master' of http://github.com/aakoch/jquery into aakoch-master 2010-09-27 14:49:13 -04:00
jeresig ea6a4813b7 Allow 304/Not Modified tests to complete in Opera. 2010-09-27 12:10:00 -04:00
jeresig 0be7f4eb4f Make sure that opacity is being reset properly on a show animation. Additionally expose jQuery.isNaN from the data module. 2010-09-27 11:51:01 -04:00
jeresig 0da700a4d0 We can just use isNaN for this check in the IE opacity code. 2010-09-27 10:53:29 -04:00
jeresig 6dd2dc4270 Make sure the currentStyle property exists before attempting to access it. 2010-09-27 10:38:13 -04:00
jeresig 88fc523c59 Adjust manipulation test to handle whitespace RegExp issue in older WebKits. Fixes #7082. 2010-09-27 10:28:35 -04:00
jeresig d558e9eb6f Some minor cleanup of the last commit. 2010-09-27 10:21:50 -04:00
jeresig 97d468fbf0 Add a feature test for options inside a disabled select. Follow-up to 157a383dae. 2010-09-27 10:19:55 -04:00
jeresig a384d840d6 Only do the hasAttribute check if the method exists - IE falls back to the === null check below which allows this to still work. Follow-up to cb40495b21 - thanks to @jitter for the catch. 2010-09-27 09:19:21 -04:00
jeresig 157a383dae Bug fix for commit 2c4b20809e - technique wasn't working as expected in WebKit browsers. Thanks to @jitter for the bug fix. 2010-09-27 09:07:54 -04:00
John Resig 42aa714fb7 Removing the old cow image from the effects tests - it's no longer needed. Fixes #7086. 2010-09-26 20:47:19 -04:00
jeresig 83b261c976 Merge branch 'master' of github.com:jquery/jquery 2010-09-24 18:02:39 -04:00
Dave Methvin adff8e45e2 If an inline handler returns false, call event.preventDefault(). Fixes #6337. 2010-09-24 18:02:31 -04:00
dmethvin 0636dffc24 Make .val(undefined) == .val("") and chainable; fixes #4130.
Ensure .val(null) sets an empty string on IE6/7; fixes #5163.
2010-09-25 05:57:14 +08:00
Dave Methvin c4e653237f Make sure that requests without a body don't set contentType, and a zero-length body is sent rather than null. Possible fix for #6811 and #6674. 2010-09-24 17:56:03 -04:00
Dave Methvin 1130beb72b Report correct Error object to handleError. Part of the fix for #6677. 2010-09-24 17:47:37 -04:00
dmethvin 69994211b0 Don't copy event.originalTarget, it's a Netscape-specific property. Fixes #2814. 2010-09-24 17:44:48 -04:00
Dave Methvin 2c4b20809e Don't have .val() return selected-but-disabled options, or selected options inside a disabled optgroup. Doesn't change the .val() returned for a disabled select. Fixes #3240, adapted from Nathan Hammond's patch there. 2010-09-24 17:26:22 -04:00
jeresig 700ff05af0 Merge branch 'master' of github.com:jquery/jquery 2010-09-24 17:05:28 -04:00
Dave Methvin 395a032ad8 Use origSettings.context unless it's undefined; for that case use merged settings as context for backcompat with jQuery <1.3. Fixes #6727. 2010-09-24 17:04:54 -04:00
dmethvin c8c8f8458a For JSON and script requests, set the scriptCharset before the url so IE won't interpret it the wrong way; fixes #4855. 2010-09-25 05:01:31 +08:00
Heungsub Lee 033a4c41e0 Added a default quality of */* for content negotiation. 2010-09-25 05:00:18 +08:00
temp01 7862c45ad2 Serialize keys with empty arrays/object values in jQuery.param(). Fixes #6481. 2010-09-24 16:57:25 -04:00
jeresig 515efbdc71 Make sure that undefined is always returned for missing data properties. Follow-up to #6304. 2010-09-24 16:30:57 -04:00
jeresig 76db8a9822 Allow data to be bound to Flash objects (but still stopping short of attaching to applets. Fixes #6121. 2010-09-24 16:24:07 -04:00
jeresig f10057bc48 Make sure that a clone of the animate speed properties are used to avoid recursion problems. Fixes #3583. 2010-09-24 15:57:51 -04:00
jeresig e0a9615f82 Make sure that the body element exists before doing the body selector optimization. Fixes #6529. 2010-09-24 15:53:38 -04:00
unknown a088751a1b Removing the second capture group. After the changes suggested by Jeff Roberson, the second capture group is no longer needed. See
http://stackoverflow.com/questions/3771105/can-someone-tell-me-the-purpose-of-the-second-capture-group-in-the-jquery-rts-reg
2010-09-24 09:37:03 -05:00
J. Ryan Stinnett 5c055040d3 Allow named animation speed to be 0. Fixes #6579. 2010-09-24 10:13:00 -04:00
lrbabe 5d45448e71 Make the interval between two animations tick public: jQuery.fx.interval. Fixes #6276. 2010-09-24 10:11:05 -04:00
jeresig a220c81eb9 Increase the speed of the single setTimeout calls for the ready event. 2010-09-24 10:06:36 -04:00
jeresig 6dfdb14753 Merge branch 'master' of github.com:jquery/jquery 2010-09-23 12:09:49 -04:00
Robert Katic 894bd02a06 Test jQuery.type also with document. 2010-09-23 12:08:54 -04:00
Robert Katic 484cc6e220 Made jQuery.type more consistent with host objects. 2010-09-23 12:08:41 -04:00
Robert Katic 7367b524ec Ensure that selector is not broken. 2010-09-23 12:08:29 -04:00
Robert Katic dc4c9abc39 Correcting some imperfections in test added in previous commit. 2010-09-23 12:08:15 -04:00
Robert Katic da5706c974 Added support for map of events in live, die, delegate and undelegate. Fixes #6282. 2010-09-23 12:07:42 -04:00
Robert Katic 97b42492bb Added some tests for #5991. 2010-09-23 12:07:22 -04:00
Robert Katic 694b625c92 Ensured that arrays are not considered same as plain object on deep extending. Fixes #5991. 2010-09-23 12:07:06 -04:00
jeresig e270d804b4 Delay the result of the readyState check to give scripts the opportunity to delay ready, as described by @jrburke in 747ba7defd. 2010-09-23 11:38:22 -04:00
jeresig 2f603359fe Discovered that another effects bug was fixed with the recent CSS changes (namely that show animations always went to auto, even if they weren't supposed to). Test suite adjusted accordingly. 2010-09-22 23:43:55 -04:00
jeresig 6a1d4f1a80 e3463946e1 actually fixed a previously undicovered but with setting auto, adjust the effects test suite accordingly. Thanks to @bugbegone for the catch. 2010-09-22 23:28:57 -04:00
jeresig a7aa86d0b1 Fix missing var. Thanks to @jeff-themovie for the catch. 2010-09-22 16:56:48 -04:00
jeresig d7a6e75241 Add some tests for jQuery.isWindow and make sure that we're operating against an object before testing. 2010-09-22 16:50:38 -04:00
jeresig c8dd49f756 Unify the means of detecting a window across the library. Fixes jQuery UI bug #5438 and jQuery bugs #6575 and 6088. 2010-09-22 16:41:51 -04:00
jeresig ab454d9526 Allow # urls to contain #. Thanks to @alvopass in f9f9ee52e1 for the catch. 2010-09-22 14:58:07 -04:00
John Resig f9f9ee52e1 Make sure that #... are trimmed from Ajax request URLs. Fixes #4987. 2010-09-22 12:52:44 -04:00
John Resig a32f4d7b6c Fixed the number of expected class tests from a previous commit. Thanks to @bugbegone in 1f667aa035 for the catch. 2010-09-22 12:35:42 -04:00
jeresig 0b4b3ee8a5 Make .data(Object) extend the existing data object. Fixes #6692. 2010-09-22 11:52:32 -04:00
Jacob Wright 626624a19a Fix bug when accessing .data() on an empty set. Return null rather than throwing exception. 2010-09-22 11:38:37 -04:00
Karl Swedberg 1f667aa035 Added full support for easing in all shorthand effects methods (hide, show, toggle, fadeTo, slideUp, etc.). Previously, these methods could only be used with two of the three (speed, easing, callback) arguments, or, in the case of fadeTo, 3 of the 4 (speed, opacity, easing, callback) arguments. Added three more sets of tests to the series of "Chain" tests. Fixes #7014 2010-09-22 11:30:54 -04:00
Carl Fürstenberg 06883449d6 Makefile: cleanup
* updating init to either pull or clone, not do both
* make sure it building only when it needs to
* make some variables overridable
* use variables when they should be used instead of direct text
* add V verbosity variable
2010-09-22 11:21:59 -04:00
jeresig 8e1d369710 Some minor lint fixes for the RegExp. 2010-09-22 09:46:21 -04:00
jeresig 9dc6e0c572 Applied the RegExp issues reported by Jeff Robinson here: http://jmrware.com/articles/2010/jqueryregex/jQueryRegexes.html Additionally broke out all remaining inline RegExp. Fixes #7062. 2010-09-22 09:16:28 -04:00
jeresig 19b5d9e874 Re-work the document scoping. 2010-09-22 08:08:45 -04:00
jeresig 9ad7c21e70 Make sure the data- number has at least one number in it before passing to isNaN. Thanks to @cms in 8ebb9b22df for a heads-up. 2010-09-22 07:34:31 -04:00
John Resig e3463946e1 Make sure that non-px values aren't manipulated before input to height/width. 2010-09-21 17:12:42 -04:00
John Resig 1ac3713e7f Fix bug with the readyWait DOM ready addition. 2010-09-21 16:26:36 -04:00
John Resig dc8491defe Scratch that, just punting on Opera and 304s for now - there may not be a good solution here. Fixes #6060. 2010-09-21 16:13:50 -04:00
John Resig ba9e0fc177 Use a different workaround for detecting when Opera finds a status 304 page. Fixes #6060. 2010-09-21 15:22:34 -04:00
jeresig 3a0a352883 Escape RegExp braces to sooth JSLint's temper. 2010-09-21 08:53:34 -04:00
jeresig 8ebb9b22df Switch to using isNaN instead of RegExp for data-. 2010-09-21 08:31:55 -04:00
jeresig e0b24306a8 Handle some additional data- number edge cases. 2010-09-21 08:30:12 -04:00
jeresig 1f8a5e4bbc Make sure that the data- import also supports arrays. 2010-09-21 08:20:31 -04:00
John Resig e7c2d3b45b Added in support for basic JSON object parsing of data- attributes. 2010-09-21 00:51:45 -04:00
John Resig ae9df1412c Make sure that undefined is returned for not found data- attributes, not null. 2010-09-21 00:44:47 -04:00
John Resig d5d4e4df65 Tweaked the data number RegExp some to handle some other edge cases. 2010-09-21 00:38:26 -04:00
jeresig 4a46f3d7fb Fixing the problem with data-* based numbers as mention by @jasonwebster in 20673d7. 2010-09-20 20:08:57 -04:00
John Resig 653c04acb8 Merge remote branch 'RedWolves/master' 2010-09-20 18:10:34 -04:00
John Resig 20673d7e58 Pull data-* attributes into .data(). Original code by Andrée Hasson and Paul Irish. Fixes #6921. 2010-09-20 17:47:41 -04:00
John Resig 747ba7defd Allow plugins to delay the exeuction of the ready event. Delay the ready event by calling: jQuery.readyWait++ and force the event to fire by doing: jQuery.ready(true). Fixes #6781. 2010-09-20 14:53:29 -04:00
jeresig 5b92cdd048 Removing extra arg. 2010-09-20 10:41:58 -04:00
jeresig be59693037 No need to set returnValue if preventDefault exists. Thanks kangax for the catch. 2010-09-20 10:16:36 -04:00
John Resig 7350e2e1cc Added in some .css() setter perf tests as well. 2010-09-17 18:26:21 -04:00
John Resig 2d70dc9c43 Derp, had parseInt on the brain. Thanks karbassi in 6541eb9d80. 2010-09-17 17:02:03 -04:00
Ralph Whitbeck 7c5fd489ee Updated the Questions? section with the forum information. 2010-09-17 12:40:04 -07:00
John Resig 9dd70a44ad Adding a simple file for doing .css() performance testing. 2010-09-17 15:38:27 -04:00
John Resig 8691a826c0 Fix trailing arg. 2010-09-17 14:58:50 -04:00
John Resig 77e310b906 Simplifying the camelCase logic used in the CSS and Effects modules. 2010-09-17 14:53:10 -04:00
John Resig 6541eb9d80 Cleaning up some un-needed CSS code and adding back a temporary (deprecated) curCSS method. 2010-09-17 14:41:28 -04:00
John Resig 51d258074c Merge branch 'csshooks' 2010-09-17 14:32:43 -04:00
John Resig 192bab8ed6 jQuery.css() returns a string value - handle this properly in the animation code. 2010-09-17 14:30:30 -04:00
John Resig d1f3dc9a04 Make sure that empty height/width values are still set. 2010-09-17 13:51:12 -04:00
John Resig 99fcf3babb Fixed some sloppy checks in the effects test suite, makes it more apparent where issues are happening. 2010-09-17 13:38:13 -04:00
John Resig fc5b69fc70 Bringing in the rdashAlpha/fcamelCase private var tweaks from the csshooks branch. 2010-09-17 13:18:39 -04:00
jeresig 37b607d281 Split apart jQuery.css into jQuery.css (computed values) and jQuery.style (currently set values). 2010-09-16 10:00:56 -04:00
jeresig 492a2e2c53 Wrap the core return in parens to fix a confused JSLint. 2010-09-14 09:57:26 -04:00
jeresig 2131e1a7ad Removing leftover debug code. 2010-09-14 09:52:13 -04:00
John Resig 959c20f768 Add a flag to verify if a browser supports some form of XHR request. Fixes #7030. 2010-09-13 18:02:33 -04:00
John Resig 2bda99c18a Making some more adjustments to handle auto CSS properties. 2010-09-13 18:00:28 -04:00
jeresig 8b7015987c Only set height/width if it's a non-negative number (don't set it to 0). 2010-09-09 16:34:15 -04:00
jeresig cb3a9c14f1 Make sure that height/width methods return numbers instead of strings. 2010-09-09 16:33:05 -04:00
jeresig c168c30a6a Another logic bug caught by furf in ad950c8c59. 2010-09-09 16:29:26 -04:00
jeresig c36596ea58 Make sure that the CSS hook getter isn't called if a forced computed style is done. 2010-09-09 16:26:30 -04:00
jeresig 70377a65e2 Make sure that effect tests no longer reference the old CSS methods. 2010-09-09 15:48:28 -04:00
jeresig a166860a19 Adding in a couple private variables to effects.js that were in css.js. 2010-09-09 15:45:24 -04:00
jeresig 7c8588530a Make sure that string values are returned from the height/width CSS properties. 2010-09-09 15:42:38 -04:00
jeresig 194c93eca2 Merge branch 'master' into csshooks
Conflicts:
	src/css.js
2010-09-09 15:35:18 -04:00
jeresig ad950c8c59 Landing a bunch of bug fixes from furf's pull request at eefcbaebb31b89b5eb360cd5ec6165b89c84e75f. 2010-09-09 15:33:06 -04:00
jeresig 1ed405176b Trim out the module wrappers during the build process. Follow-up to #7011. 2010-09-09 10:34:21 -04:00
jeresig 82b35a4f2c Removing extraneous argument. 2010-09-09 10:20:32 -04:00
jeresig 2663041924 Make sure that jQuery is being exposed outside of core (this will be stripped during the build process). Follow-up to #7011. 2010-09-09 08:23:10 -04:00
jeresig acb162a697 Make sure that the removeEvent and buildFragment private functions are exposed (to help with access across modules). The final API for each of these is very much in flux and will likely change before the final release. Fixes #7011. 2010-09-08 18:13:35 -04:00
jeresig bca5765502 Make sure that jQuery works even when the individual modules are loaded separately AND jQuery.noConflict(true) is used. Fixes #7011. 2010-09-08 13:54:33 -04:00
jeresig ca3b18ca53 Merge branch 'master' of github.com:jquery/jquery into csshooks 2010-09-08 13:47:56 -04:00
jeresig a44ec40277 Make sure that jQuery works even when the individual modules are loaded separately AND jQuery.noConflict(true) is used. Fixes #7011. 2010-09-08 12:00:29 -04:00
Karl Swedberg 116f3b7c72 added "#main" ancestor selector to an "Only Child" and "Last Child" test to fix broken tests caused by QUnit commit abfab1713ccb588aa87136b199a9ddc8d1b56c4b (Aug 29, 2010) 2010-09-07 08:53:06 -04:00
John Resig b920f0aeb4 Broke more of the property-specific CSS logic out of the jQuery.css() function. 2010-09-05 11:01:27 -04:00
John Resig 920099b29c First pass at unifying the various CSS methods in jQuery (jQuery.style, jQuery.curCSS, and jQuery.css are now all under jQuery.css). 2010-09-05 10:17:18 -04:00
John Resig 2912f8ab95 Broke apart some of the browser-specific logic for CSS handling. 2010-09-05 00:04:37 -04:00
John Resig 426045cc74 Some more minor formatting tweaks. 2010-09-04 23:34:52 -04:00
John Resig 1970154c3b Tweaking the formatting from the previous commit. 2010-09-04 23:28:17 -04:00
Brandon Aaron 65b24861bc First look at css hooks. These hooks provide a way to change how jQuery handles getting and setting certain css properties. This means normalizing properties like background-position can easily be done via plugins.
They are similar in concept to the special event hooks. Return false from the hook to revert control back to jQuery's normal processes for getting and setting certain css properties.
2010-09-02 21:06:40 -05:00
John Resig 97cbd76695 Fix the order of the element test arguments. 2010-09-02 16:15:54 -04:00
John Resig 90a4abd511 Tweaked the name unit tests to specify the exact nodes from which to test against. 2010-09-02 15:13:10 -04:00
John Resig d48db1f440 Remove cases of :contains() where quotes are used - not using quotes follows more closely with the CSS Selector recommendation. 2010-09-02 14:56:32 -04:00
Brandon Aaron 8d04ffec16 Add .width() and .height() unit test for empty sets. Fix .height() test that was masquerading as a .width() test. Made sure .width() and .height() tests were in-sync (testing the same things). 2010-09-01 11:05:35 -05:00
Brandon Aaron a2e1051fb4 Increase max number of JSLint errors. This is necessary because we have several error messages that we choose to ignore. 2010-09-01 10:48:19 -05:00
John Resig 13f27fcd05 Switched to use 'in' for the setInterval/window check as it also skirts around the Safari 2 NodeList crasher. See the discussion in 94f35d0519 for more details. 2010-08-27 18:17:07 -04:00
John Resig 1ead20c2ed Blackberry 4.6 is capable of finding elements that are no longer in the DOM via getElementById. It only appears to happen when the node has been inside of a cloned Document Fragment. Fixes #6963. 2010-08-27 15:14:30 -04:00
John Resig 43fbe3b33a Handle two more cases where comments were missing in the test case, in Blackberry 4.6. 2010-08-27 14:16:27 -04:00
John Resig ea8b1584b1 Use the native isArray whenever possible. See perf test by jdalton here: http://jsperf.com/isarray-vs-other Fixes #6825. 2010-08-27 13:15:48 -04:00
John Resig 7f18d29287 Simplify the logic in $.type, thanks to jdalton for the suggesiton in 5d2be7e299. 2010-08-27 07:03:30 -07:00
John Resig 5d2be7e299 Added some tweaks to $.type to handle null and undefined. Added a bunch of unit tests as well. 2010-08-27 06:10:52 -07:00
John Resig 9ce1d09a0a Blackberry 4.6 doesn't maintain comment nodes in the DOM, ignore them in our test cases. 2010-08-26 15:36:44 -04:00
John Resig 1e9d6e1255 Fixed mistake with tweaked iframe manipulation test. 2010-08-26 15:26:30 -04:00
John Resig c5382ad7c1 Tweak some more jQuery set results in the manipulation tests. Also fixed the order of the expected test results. 2010-08-26 15:21:01 -04:00
John Resig c0fe98f028 Tweak more element orders in the manipulation tests. Also differentiate between iframe test failing and the inability to access iframe internals (as in the case of Blackberry). 2010-08-26 14:57:23 -04:00
John Resig 3b76b58815 Tweaked manipulation test to ignore order of elements from selector (not important to the test). 2010-08-26 14:37:58 -04:00
John Resig 5673e4bc3a Only attempt to use the IE technique for setting opacity if the filter property exists (otherwise fallback to the standards-compatible technique). 2010-08-26 12:51:37 -04:00
John Resig dc060f08cd Tweaked anchor test to work better on Blackberry 4.7. 2010-08-26 12:36:50 -04:00
John Resig 94f35d0519 Adding in a jQuery.type(obj) method (a simple map to using Object.prototype.toString.call). Fixes #3330. 2010-08-25 09:57:34 -07:00
John Resig 18dad47489 Tweaked logic for working around Blackberry 4.7 makeArray(RegExp) issue. Fixes #6930. 2010-08-25 09:27:30 -07:00
John Resig cb40495b21 Make sure that missing attributes return undefined in Blackberry 4.7. Fixes #6938. 2010-08-24 07:28:47 -07:00
John Resig 1bdcffba8e Simplifying some of the .val() test code. 2010-08-23 14:23:13 -07:00
John Resig 392174431a .val() on empty options returns the text value rather than the value in Blackberry 4.7. Fixes #6932. 2010-08-23 14:10:39 -07:00
John Resig 396dd21273 Fixing getting/setting classes and makeArray(RegExp) for Blackberry 4.7. Fixes #6930, #6931. 2010-08-23 12:38:55 -07:00
jzaefferer 6f031c1015 Replace usage of the removed global reset() method with QUnit.reset(). 2010-07-28 17:19:01 +02:00
John Resig c4b4df4691 Make sure that .data() events don't bubble, per the discussion in 2e10af143b. Fixes #6832. 2010-07-27 13:45:32 -04:00
jzaefferer 646fbea561 Moving jQuery-core specific resets from QUnit to core. 2010-07-27 12:50:08 +02:00
Dave Reed 2084e01780 Fix for issues discussed in 9faab0b74f. Goes towards fixing #6808. 2010-07-23 11:25:31 -04:00
InfinitiesLoop 266facc08a Ticket 6808. Updated per code review comments by jeresig 2010-07-23 03:52:02 +08:00
InfinitiesLoop 9faab0b74f Ticket #6808. Changes data() so on plain objects, it uses a function to contain the cache ID to avoid it being JSON serialized. 2010-07-23 03:52:01 +08:00
Richard D. Worth ef9fb80cab Fixed ant build to be more consistent with Makefile. Now has all same targets (see README.md) and
* generates an identical jquery.js to that of make
 * generates a min file
 * runs jslint.
 * cleans more thoroughly
 * can be passed a PREFIX property
2010-07-21 22:47:13 +08:00
Richard D. Worth bb0f1a97fb Whitespace (spaces to tabs) 2010-07-21 22:47:13 +08:00
Richard D. Worth 6803bf1fe5 Minor fix to Makefile so that 'make clean' doesn't fail when run immediately after 'make clean' 2010-07-21 22:47:13 +08:00
Richard D. Worth 4ec1b743a8 Simplified getting the commit date using git log --pretty. Fixed missing date in ant build. 2010-07-21 22:47:13 +08:00
InfinitiesLoop 2e10af143b Ticket #6804. Adds a changeData event. 2010-07-20 10:12:40 +08:00
adam j. sontag a2bd8a53f3 .closest() should return a unique set of elements, not duplicates of the same ancestor. Fixes #6700 2010-06-21 14:18:06 -04:00
wycats 6a0942c9d5 Merge branch 'doug' 2010-06-19 22:29:55 -07:00
Douglas Neiner cecd1d8735 Slight optmization on the Rakefile 2010-06-19 22:29:49 -07:00
Douglas Neiner e61d7d12e2 Edits to README after Karl's review 2010-06-19 22:29:49 -07:00
Douglas Neiner c2976e68ff Minor changes to README 2010-06-19 22:29:49 -07:00
Douglas Neiner 4e337f504e Updated README file with updated information for the Rake addtions
Also changed the default Rake task to "all" instead of "jquery"
to parallel the Makefile.
2010-06-19 22:29:49 -07:00
Douglas Neiner ab2537a7ec Fixed spelling on QUnit pull message 2010-06-19 22:29:49 -07:00
Douglas Neiner ad849eb5a4 Updated Rakefile to remove use of *nix specific commands
Only `sh` statements left are either 'java' or 'git' commands,
which should work on Windows, though I still need to test
2010-06-19 22:29:48 -07:00
Douglas Neiner 3e1ac2aaac Updated Rakefile to mirror the functionality of the Makefile
The Rakefile now supports all the functionality of the Makefile
including only rebuilding files when dependent files change.

To see availible tasks, run:

    rake -T
2010-06-19 22:29:48 -07:00
John Resig ef8df7f55c Expose jQuery.uuid (use with caution) and make sure the expando property is used in the events module. 2010-06-19 22:29:48 -07:00
jeresig 23699bc783 Removed extra semicolon leftover from recent tweaking. 2010-06-19 22:29:48 -07:00
jeresig 9568866aad Mobile WebKit browsers don't support accessing the scroll position of the document/window. 2010-06-19 22:29:48 -07:00
jeresig dc886a83f5 Need to expose the isLocal change globally as well. 2010-06-19 22:29:48 -07:00
jeresig ac670f3954 Temporarily disable ajax tests when running in TestSwam. 2010-06-19 22:29:48 -07:00
jeresig d54014ed91 Use custom events for testing unbind instead of the, potentially conflicting, error event. 2010-06-19 22:29:48 -07:00
jeresig d4aff802da Adjust isPlainObject test to run in an iframe. 2010-06-19 22:29:47 -07:00
jeresig 568db29c2b Make sure the offset tests work without a built jQuery file. 2010-06-19 22:29:47 -07:00
jeresig 83a97f5c21 Update other remote test URLs as well. 2010-06-19 22:29:47 -07:00
jeresig 31cfe62ed4 Strip off filename and query string for JSONP Remote test. 2010-06-19 22:29:47 -07:00
jeresig f502d118d1 Update the TestSwarm URL to point to the new jQuery swarm location. 2010-06-19 22:29:47 -07:00
jeresig 4e5e31f29e Changed the order of the tests to run in the same order in which they're specified in the Makefile (fixed a dimensions test bug that popped up as a result). 2010-06-19 22:29:47 -07:00
jeresig b64a51e136 Handle auto-running of the TestSwarm injection script in the test suite. 2010-06-19 22:29:47 -07:00
jeresig b3ccf2f288 Made it so that you no longer need to build jQuery in order to run the test suite (but you'll still need a checkout of QUnit and Sizzle, at least). 2010-06-19 22:29:47 -07:00
jeresig c90d609c0d Fixing request data param issue. Thanks to mislav for the patch. Fixes #5123. 2010-06-14 23:08:28 -04:00
jeresig c34a62f8ab Tweak spacing from last commit. 2010-06-14 23:05:01 -04:00
malsup d1931a8241 Fix for http://dev.jquery.com/ticket/6451 2010-06-15 11:02:26 +08:00
John Resig 1533bf7c77 Expose jQuery.uuid (use with caution) and make sure the expando property is used in the events module. 2010-04-24 14:16:27 -07:00
jeresig 4a64f9a5b8 Removed extra semicolon leftover from recent tweaking. 2010-03-31 14:36:24 -04:00
Brandon Aaron d6f03aa0df Merge branch 'master' of github.com:jquery/jquery 2010-03-27 18:58:55 -05:00
jeresig dab1d74677 Mobile WebKit browsers don't support accessing the scroll position of the document/window. 2010-03-25 17:30:13 -04:00
jeresig 298c81a844 Need to expose the isLocal change globally as well. 2010-03-24 16:16:13 -04:00
jeresig 59124f92b5 Temporarily disable ajax tests when running in TestSwam. 2010-03-24 16:04:10 -04:00
jeresig 1ba2df02d6 Use custom events for testing unbind instead of the, potentially conflicting, error event. 2010-03-24 15:39:58 -04:00
jeresig 3b221da8b0 Adjust isPlainObject test to run in an iframe. 2010-03-24 15:18:11 -04:00
Brandon Aaron efea0f23f9 Merge branch 'master' of github.com:jquery/jquery 2010-03-23 22:40:38 -05:00
jeresig 96ea3d615e Make sure the offset tests work without a built jQuery file. 2010-03-23 16:37:40 -04:00
jeresig 273822c138 Update other remote test URLs as well. 2010-03-23 16:24:51 -04:00
jeresig 0fbac16dbe Strip off filename and query string for JSONP Remote test. 2010-03-23 16:22:09 -04:00
jeresig 2301e2a1c3 Update the TestSwarm URL to point to the new jQuery swarm location. 2010-03-23 15:21:42 -04:00
jeresig fa80693c4a Changed the order of the tests to run in the same order in which they're specified in the Makefile (fixed a dimensions test bug that popped up as a result). 2010-03-23 12:31:40 -04:00
jeresig f6a50cacd8 Handle auto-running of the TestSwarm injection script in the test suite. 2010-03-23 12:19:47 -04:00
jeresig 8effe3a7de Made it so that you no longer need to build jQuery in order to run the test suite (but you'll still need a checkout of QUnit and Sizzle, at least). 2010-03-23 12:12:16 -04:00
Brandon Aaron 656fe92178 Fixed an issue with setting offset of absolutely positioned element that has no position values ("auto"). Fixes #5781. 2010-03-22 20:11:37 -04:00
Brandon Aaron 08cf82e88e Fix setting only one property at a time in .offset({}) 2010-03-22 20:05:08 -04:00
Brandon Aaron 1844f95c5b Added unit tests for setting offset one property at a time and added radix to parseInt calls 2010-03-22 18:50:17 -04:00
jeresig ba8938d444 Switch to using String.prototype.trim from String.trim as it's more-widely available. 2010-03-11 10:49:19 -05:00
jeresig da26d0eb4e Rewrote the live/delegate submit tests to be more generic. 2010-03-09 14:08:33 -05:00
jeresig f68b46d7ab Make sure that special remove and teardown events get called when .die() is used. Additionally made sure that default actions are triggered when namespaced events are used. Fixes #6202 and #6250. 2010-03-09 12:22:25 -05:00
jeresig 2fbe3fbf68 Removing the mention of buliding the docs from the README. Thanks to 'phihag' in the forum for the heads-up. 2010-03-09 09:16:35 -05:00
jeresig 141ad3c3e2 Landing a faster trim method. Based upon the work by Travis Hardiman and DBJDBJ. More details here: http://forum.jquery.com/topic/faster-jquery-trim Fixes #2279, #4452, and #4835. 2010-03-09 09:14:27 -05:00
jeresig 0a307b332e No need to use .call() anymore since we switched from .apply() for appendTo, etc. Thanks to Robert in 2c08004f6d for the heads-up. 2010-03-05 09:59:58 -05:00
jeresig 145f2f0459 I take that back! It was a bug, but the cache had to be triggered and a collection of cached nodes had to be passed in (an odd case to be sure). Fixes #6227. 2010-03-05 00:14:47 -05:00
jeresig 2c08004f6d Attempted to fix #6227, not entirely sure if it's a problem as I'm having a hard time reproducing it. Regardless, the change is harmless and potentially even speeds up appendTo, etc. slightly. 2010-03-05 00:07:57 -05:00
jeresig 9584e908a2 Added in Ben Alman's proposed event.namespace property (the property holds the namespaces specified in a call to trigger). Additionally fixes namespaces with .live(). Fixes #6208 and #6209. 2010-03-02 17:34:12 -05:00
jeresig 04e31ff058 Make sure that we don't try to remove data from an applet. Re-Fixes #1675. 2010-03-02 13:56:15 -05:00
jeresig ad103c8e6a Add in the new level information to the closest(Array) test. 2010-03-02 10:53:54 -05:00
jeresig 5c111a028a We no longer support globally-triggered events on plain objects. This is a trade-off to having good garbage collection on the objects. 2010-03-02 10:51:31 -05:00
jeresig 86ace44fbb Moving more properties onto jQuery.ajax, also copy them back to the jQuery object for backwards compatibility. 2010-03-02 10:44:48 -05:00
jeresig a33d01a7b0 Remove the need for the return in sizzle-jquery and just remove the attempt to expose Sizzle completely. jQuery is 100% passing JSLint ('make lint') now. 2010-03-01 21:56:08 -05:00
jeresig 950b5d64a2 Added in integrated JSLint checking against the jQuery source. Just run 'make lint' to see the result. 2010-03-01 21:51:44 -05:00
jeresig dcf0fa5048 More changes to get jQuery in line with JSLint. 2010-03-01 21:24:49 -05:00
jeresig 8c8f685a91 We don't want to increment the Ajax counter if there isn't a global event. 2010-03-01 19:31:13 -05:00
jeresig a4043cdcbf Land some additional tweaks related to running through JSLint. 2010-03-01 18:19:29 -05:00
jeresig fc08d0ea8d Fixed some cases where expression, expression was used and shouldn't be. 2010-03-01 16:26:57 -05:00
jeresig a18f682012 Made some code tweaks related to running jQuery through JSLint (thanks to Lorin Larson for the JSLint run). 2010-03-01 12:44:56 -05:00
brandonaaron 5353c6bcc3 Adding unit tests to make sure .scrollTop() and .scrollLeft() work cross-frame. 2010-02-28 10:55:59 -06:00
brandonaaron 1d352084c4 Use correct window reference in offset to work properly cross-frame. Fixes #6190. 2010-02-27 19:43:23 -06:00
jeresig 36faab439a No reason to double-bind the beforeunload event. Fixes #6113. 2010-02-27 10:03:43 -05:00
jeresig a49e6b6313 Attach data directly to plain objects, no reason to use the central jQuery.cache. Fixes #6189. 2010-02-27 09:49:58 -05:00
jeresig 42568db4c4 Merge branch 'master' of github.com:jquery/jquery 2010-02-27 09:02:18 -05:00
jeresig a45372a4c5 Adding in .bind(name, false), .unbind(name, false) support - an easy way to just stop bubbling and the default action on an element. Fixes #6188. 2010-02-27 09:02:13 -05:00
brandonaaron 7d5da0ee03 Make sure events exist before trying to access them in jQuery.event.handle and removed unnecessary var statement. Fixes #6163. 2010-02-27 01:31:33 -06:00
jeresig ba7195e3f9 Make it so that you can pass in event data to .click(), et. al. Fixes #6187. 2010-02-26 20:01:19 -05:00
jeresig 9e06903a99 Make sure that undefined is always returned for undefined data properties. Fixes #6166. 2010-02-26 12:35:04 -05:00
jeresig 7f5179b654 Make sure that unbinding on a plain javascript object works correctly. Fixes #6184. 2010-02-26 11:32:12 -05:00
jeresig 28b489bfc8 Make sure that the correct type is set for live mouseenter/mouseleave events. Fixes #6169. 2010-02-26 11:23:49 -05:00
jeresig 26b0e913dd Make sure that live events bubble unless explicitly told not to, like a normal event. Fixes #6182. 2010-02-26 09:26:14 -05:00
jeresig 7e6b20e2e8 Updating the source version to 1.4.3pre. 2010-02-13 22:33:57 -05:00
jeresig efe51cdf20 Tagging the 1.4.2 release. 2010-02-13 22:33:48 -05:00
jeresig 437ddb931d No need to run trim on every class iteration in addClass, thanks for the heads-up Leeoniya. 2010-02-13 14:30:27 -05:00
jeresig 053af95294 Adapt the nbsp entity test for Opera (output isn't as important as the fact that it's getting converted. 2010-02-13 07:05:39 -05:00
jeresig a6f3757d50 Found a better detect for deleting an expando, added back in removeAttribute as it does work in IE. 2010-02-13 06:57:58 -05:00
jeresig 9195107dbb Clean up expando removal code - only try to delete the expando from an element if it's possible. 2010-02-13 06:32:20 -05:00
jeresig da966573c3 Make sure that elements that have been removed also have their special events cleaned up. Fixes #6084. 2010-02-13 06:10:43 -05:00
jeresig 6a82f2ae63 Make sure that mousing over XUL elements results in no trigger of a mouseleave. Fixes #6013. 2010-02-13 05:45:48 -05:00
jeresig dd5c26304a Make sure that live focus and blur events also bind to the regular events, to handle triggered events. Fixes #6055. 2010-02-13 05:37:17 -05:00
jeresig 467063a2e2 When binding a change directly to a file input just passthrough to the normal bind. A temporary fix for #5997, needs more investigation. 2010-02-13 04:40:26 -05:00
jeresig c1ac9fdf45 Don't inject style elements using innerHTML as they will go away in IE. Fixes #5977. 2010-02-13 03:30:45 -05:00
jeresig 14e1200d59 Added some tests to test repeated injected of scripts. Was fixed when fixing #5094. 2010-02-13 03:25:27 -05:00
jeresig 99e7560808 Make sure that we don't try to use a detached node (that was in a fragment) as a fragment in IE. Fixes #5829. 2010-02-13 03:14:00 -05:00
jeresig 726fda08be Make sure the fragment isn't used if it's not the same set we're working with. Fixes #6068. 2010-02-13 02:49:04 -05:00
jeresig a7dc66b832 Rename internal .getText to maintain parity between it and the primary .text(). Fixes #6094. 2010-02-13 02:26:50 -05:00
jeresig abcc1a76ee If .attr() is run on no elements undefined should be returned (as should be the case when no attribute is found). Fixes #6012. 2010-02-13 02:23:38 -05:00
jeresig 83a044f1b5 Make sure that no extra whitespace is leftover after an addClass. Fixes #6050. 2010-02-13 02:18:38 -05:00
jeresig 94d925cd46 Make sure leading whitespace is trimmed for parseJSON. Fixes #6031. 2010-02-13 02:14:23 -05:00
jeresig 8b86004f9c Make sure that fragments containing options aren't cached. 2010-02-13 01:50:19 -05:00
jeresig 7a467ed936 Remove the need for the internal setArray method, it was only really used by pushStack anyway. Fixes #6003. 2010-02-13 01:45:09 -05:00
jeresig 8404ad6070 Make sure that there are some live events before continuing on. 2010-02-12 19:38:57 -05:00
jeresig 5d36fe3210 Make sure that live mouseenter/mouseleave work properly. Fixes #6077. 2010-02-11 16:50:26 -05:00
John Resig 021b809ace Make sure that the teardown is called after all the handlers of a type are removed. Fixes #6065. 2010-02-11 01:42:51 -05:00
John Resig 639f4931b0 No reason to expose the temporary _load method. 2010-02-11 01:23:13 -05:00
Iraê Carvalho d3d497f900 Ignore potential error codes from Github in doing a clone. Fixes #6049. 2010-02-10 16:40:48 -05:00
jeresig 35c379075c Simplify the special change/submit event removal logic, per Scott's suggestion in 5267824aa3. 2010-02-10 15:56:53 -05:00
jeresig 5267824aa3 Updated formatting for the change/submit special event logic. Also switched the function declarations to statements. Thanks to Garrett for the recommendation. 2010-02-08 23:28:15 -05:00
jeresig fec02aa5cb Merge branch 'master' of github.com:jquery/jquery 2010-02-08 11:31:13 -05:00
jeresig 75bb2d6e51 Fix in logic for handling exclusive namespace testing. Fixes #6048. 2010-02-08 11:31:01 -05:00
Ben Alman 3c5b1ca03b Ok, this should actually fix #6041 :) 2010-02-06 11:46:44 +08:00
tomviner 8a66a30fec spelling mistake (insead) 2010-02-06 10:50:57 +08:00
jeresig d743899971 Make sure that &#...; entities are encoded properly. Fixes #6042. 2010-02-05 19:58:08 -05:00
jeresig 54bd004e53 Make sure that we don't try to double-encode params using the traditional style. Fixes #6041. 2010-02-05 19:43:31 -05:00
jeresig 43b3ed086d Update special events to work with the internal event system changes. Also fixes #5967. 2010-02-05 11:02:56 -05:00
jeresig 6f7adb95c1 Add in a test for testing the performance of event handling. 2010-02-04 22:43:23 -05:00
jeresig 9118828a59 Update benchmark basis file to jQuery 1.3.2. 2010-02-04 22:03:32 -05:00
jeresig 5d2e0efd7c Reformat benchamrk function. 2010-02-04 22:02:27 -05:00
jeresig be2407e233 Rewrote the live event handling to use the new event logic. Also added in support for live namespaced events. Fixes #5945. 2010-02-04 21:36:32 -05:00
jeresig 104757705a Added some more tests for checking the execution order of events (from last night's changes - routes around Chrome's busted object looping abilities). 2010-02-04 09:23:50 -05:00
Justin Meyer e177465a6b Forgot to land Justin's tests for the event fixes. 2010-02-04 00:49:46 -05:00
jeresig e7912805d6 A large refactor of the event handling logic. Data and namespace information is maintained in a separate object now, no longer on the event handler. Proxy functions are no longer needed, as a result. Additionally execution order of the handlers is maintained, fixing #4261, and the execution of handlers is maintained even while they're being removed. Live events will be refactored separately. 2010-02-04 00:20:52 -05:00
jeresig 8a4b2102ff Removed extraneous nodeName check from f95147f465 commit. 2010-02-01 21:56:11 -05:00
Neeraj Singh 532bec4c69 Adding in some more replaceWith tests for #5917. 2010-02-01 21:53:31 -05:00
Noah Sloan 8660ea1ab6 Only detach the incoming elements to replaceWith if they're DOM nodes. Fixes #5986. 2010-02-01 21:48:05 -05:00
jeresig e76ba32ceb Make sure the resulting className from removeClass is nicely trimmed. Fixes #5988. 2010-02-01 21:33:58 -05:00
jeresig f95147f465 Fix for problem in IE 8 where deserialized (then reserialized) form markup was getting malformed. Thanks IE. Fixes #5998. 2010-02-01 21:26:47 -05:00
jeresig f9417b9da9 Same problem happens with plain embed elements as well. Follow-up fix to #5904. 2010-02-01 18:52:12 -05:00
jeresig 1b28bba4d2 Make sure that injection of object elements continues to work in IE 6. Really hard to unit test this in a meanigful manner (the result is a visually broken plugin). Will need to be diligent about watching for this in the future. Fixes #5094. 2010-02-01 18:22:48 -05:00
jeresig 31432e048f Add .delegate() and .undelegate(). An alternative to using .live() which goes from a single root and filters by the specified selectors. Should be used like do: .delegate(td, hover, someFn);. Fixes #6005. 2010-02-01 18:06:03 -05:00
jeresig cb65daa399 The context for 'body' should still be document, in this case. 2010-01-29 15:04:26 -05:00
jeresig 4f2e209b85 Make sure fragment caching is only happening on nodes in the main document. Fixes #5978. 2010-01-29 00:22:20 -05:00
jeresig 388a00fe91 Skip around inserting a fragment when possible (insert the node directly). 2010-01-28 17:18:27 -05:00
jeresig b8076a914b Landing some minor perf optimization to jQuery(). 2010-01-28 17:17:51 -05:00
jeresig 0db207da23 Optimize for the case where a fragment-bound element is being injected into one other element. 2010-01-28 16:30:37 -05:00
jeresig 98c7248518 Further optimize the empty/remove/cleanData logic. 2010-01-28 15:25:52 -05:00
jeresig 0252b78201 Provide a way to simulate default browser actions. Fixes #5973. 2010-01-28 14:34:09 -05:00
jeresig 31f1e99500 Add a new build mode to the Makefile that doesn't try to pull from external sources (assumes that they're already built and not changing frequently). 2010-01-28 14:18:20 -05:00
jeresig e9092e9954 Make sure namespaces is always an array, when passed to the remove special. Follow-up to eed69eccc5. 2010-01-28 14:16:52 -05:00
jeresig eed69eccc5 Make sure that jQuery.data( elem ) always returns a data object, fixes #5971. Improve the performance of .bind() and .unbind(), fixes #5972. 2010-01-28 14:12:44 -05:00
jeresig 942f8f7f75 No reason to limit the initial change data store to just radio elements. Fixes #5851. 2010-01-27 10:06:50 -05:00
jeresig 7a3afc3194 Updating the source version to 1.4.2pre. 2010-01-25 19:43:40 -05:00
jeresig a08ee9a9af Tagging the 1.4.1 release. 2010-01-25 19:43:33 -05:00
jeresig 0b3165fd23 Make sure that the correct context is being passed in for replaceWith(fn). Fixes #5798. 2010-01-25 19:22:28 -05:00
jeresig 9f17e70ae9 Make work wrapInner(fn) work consistently. Fixes #5799. 2010-01-25 19:16:23 -05:00
Robert Katic 55a64cf095 Filtering elements only. Fixed #5920 2010-01-26 07:51:44 +08:00
Mike Alup ca90ffb332 Provided detailed message for JSON parse errors. Fixes #4435. 2010-01-25 18:48:52 -05:00
Michael Monteleone bed759c95c Make sure that checked state is cloned properly. Based upon the patch by Michael, required better test cases and in doing so found more edge cases. Introduced a new check into jQuery.support as a result. Fixes #5929. 2010-01-25 18:43:33 -05:00
jeresig 390186b902 Make sure that special.add actually copies over event namespaces and data. Fixes #5779 and #5834. 2010-01-25 17:01:07 -05:00
jeresig 0474917c9d Make sure multiple bound events have their namespaces and data maintained. Fixes #3549. 2010-01-25 16:45:39 -05:00
jeresig e01ff6cda1 Cleaned up divs that should've been removed after a test run. 2010-01-25 15:18:51 -05:00
jeresig d24443fb55 Make sure that it's possible to preventDefault natively-triggered (submit, focus, blur, click) events. Fixes #5695. 2010-01-25 13:45:07 -05:00
jeresig 323270f6dc Update the license URL in the header. 2010-01-25 09:31:40 -05:00
John Resig 1a14a38ff7 Make sure original context is maintained and not the deep extended one. Fixes #5924. 2010-01-25 01:08:24 -05:00
John Resig f91b944cab Objects with length properties weren't getting serialized properly by jQuery.param(). Fixes #5862. 2010-01-25 00:46:03 -05:00
John Resig 76236a1506 Use alternative technique for triggering an abort, preventing an exception from being thrown in Firefox. Fixes #5923. 2010-01-24 22:13:52 -05:00
John Resig c639405c4d Don't set the context in .load() as it stops the global ajax events from firing. Fixes #5922. 2010-01-24 21:58:32 -05:00
John Resig 6a3d0996ed Make sure that XHTML-style HTML is purified in .html(). Fixes #5845. 2010-01-24 21:37:05 -05:00
jeresig f06e0e5575 Expose cleanData, make sure that all bound event handlers are properly cleaned up after html/empty/remove. Fixes #5856 and #5906. 2010-01-23 21:20:19 -05:00
jeresig 4f9aa62a85 Added in .height(fn) and .width(fn) support. Fixes #5915. 2010-01-23 20:49:59 -05:00
jeresig 781fe8b80d Make empty strings (and other non-string values) simply return null from parseJSON. Also added some parseJSON tests. Fixes #5859. 2010-01-23 17:08:26 -05:00
jeresig ea9e0ed841 Moved add() tests from core to traversing. 2010-01-23 16:54:24 -05:00
jeresig 0912109ffc Expose the JSON parsing logic. Fixes #5914. 2010-01-23 16:51:51 -05:00
jeresig a6ef036bb6 Centralize the logic for throwing exceptions. Fixes #5913. 2010-01-23 16:48:47 -05:00
jeresig 3e286440d5 Make sure that .die() with no args works. Fixes #5789. 2010-01-23 16:37:12 -05:00
jeresig 8ea634fd07 Merge branch 'master' of github.com:jquery/jquery 2010-01-23 12:52:39 -05:00
Matt Curry f6ec9d54d1 Select (with a selected) fired change on first focus in IE. Fixes #5869. 2010-01-23 12:52:32 -05:00
Karl Swedberg 2c28f229e5 fixed offset(coordinates) returns null when no matching elements in jQuery object (fixes ticket #5888) 2010-01-24 01:26:35 +08:00
Karl Swedberg a63754aa4e added tests for show/hide with falsy, non-zero values 2010-01-24 01:25:22 +08:00
Karl Swedberg 21441b1cbc Made .show() and .hide() use .animate() only if speed argument is truthy or 0. 2010-01-24 01:25:22 +08:00
Ben Alman 28ce15979f fixed jQuery.dir regression introduced with 1.4 *untils patch that errored when traversing XHTML text nodes with an until test 2010-01-24 01:20:53 +08:00
Ben Alman 09ef5b7598 Simplification of uaMatch, based upon the patch by Ben Alman. 2010-01-23 12:13:46 -05:00
Irae Brasil 01f72026ec Added support for multiple live event handlers, live hover, and live focus/blur (mapped to focusin/focusout). Fixes #5804, #5801, #5852. 2010-01-23 11:56:24 -05:00
Irae Brasil b9ca157998 Make sure that live handlers don't stop inline scripts from executing. Fixes #5835. 2010-01-23 11:14:29 -05:00
Irae Brasil 150e44cdda Make sure non-left-click events don't bubble. Fixes #3861. 2010-01-23 11:12:26 -05:00
jeresig 8eef3a4f2c Updating the date in MIT-LICENSE.txt. Thanks @mathias for the heads-up. 2010-01-21 09:07:19 -05:00
jeresig 435772e29b Adding in the change recommended by Alexander Farkas to fix some bugs in the change delegation logic. Fixes #5851. 2010-01-18 17:52:36 -05:00
jeresig 257a4693f4 Fix missing var declaration for the length iterator. 2010-01-18 17:19:44 -05:00
John Resig 155ecf42a0 Make sure regular settings object is set as context for all Ajax requests, if none is specified. Fixes #5838. 2010-01-16 10:11:01 -05:00
John Resig 6618ff0b0a Removed some dead code from buildFragment. Thanks to Sean Catchpole for the suggestion. 2010-01-15 17:46:33 -05:00
John Resig 199a721103 Expose the proxy object on the object, for the benefit of plugin authors (Thanks to Justin Meyer for the suggestion). 2010-01-15 15:41:09 -05:00
John Resig eb496f757a The inArray declaration was accidentally duplicated. 2010-01-15 10:49:18 -05:00
John Resig 201816d8c5 Merge branch 'master' of git@github.com:jquery/jquery 2010-01-14 01:42:37 -05:00
John Resig 4397f0fd41 Removed extraneous thisObject references. Thanks to Matt Dunlap for the heads-up. 2010-01-14 01:42:08 -05:00
Yehuda Katz 37b909de69 wrapAll(Function) doesn't actually make sense. That's why I couldn't figure out how to test it! 2010-01-14 00:45:29 -05:00
jeresig 812a247dc9 Updating the source version to 1.4.1pre. 2010-01-13 15:25:28 -05:00
jeresig d431519d61 We only care that some of the html return value is escaped, not necessarily all of it (as is the case in Safari 3.x). 2010-01-13 15:23:05 -05:00
jeresig 1960f28c0b Make sure no exception is thrown if no event handler is found (which is the case for applets, objects, and embeds). 2010-01-13 11:24:54 -05:00
jeresig 05aaa33957 Make sure that null params aren't traversed. Fixes #5794. 2010-01-13 09:29:01 -05:00
jeresig 23492fdf9f Send data if a DELETE Ajax request is done. Fixes #5752. 2010-01-13 00:42:22 -05:00
jeresig 5d49335eac Make sure that disconnected nodes aren't sorted/uniqued. Fixes #5791. 2010-01-13 00:12:18 -05:00
jeresig 8e53f7b5d6 Fixed typo in logic, also disabled function setters in this case to allow the functions to passthrough and bind. 2010-01-12 21:54:06 -05:00
jeresig b5f077ae6a Make sure that the xhr object still exists after the abort is called. 2010-01-12 21:44:37 -05:00
jeresig 1d8b3a9af2 Make sure that the focusin and focusout easy-bind methods are exposed. 2010-01-12 17:03:34 -05:00
jeresig 61983cbf17 Make sure oldAbort is only called if the xhr object still exists. 2010-01-12 16:50:59 -05:00
jeresig 6776920301 Updating the source version to 1.4. 2010-01-12 11:06:40 -05:00
jeresig 857d8afd69 Tagging the 1.4rc1 release. 2010-01-12 11:06:32 -05:00
jeresig dd45c324ec Simplified some of the logic for handling the ajax aborts, making sure that ajaxStop isn't called twice. 2010-01-12 10:59:50 -05:00
jeresig d60b197810 ajaxStop was getting called too many times, separated some of the logic into the abort method itself. 2010-01-12 10:47:00 -05:00
jeresig c320e4f3c2 Accidentally removed the init from the Makefile selector build. 2010-01-12 10:33:04 -05:00
jeresig 7afe6dcc08 Make sure that Opera fires events after an aborted Ajax attempt. Fixes #5787. 2010-01-12 10:31:51 -05:00
jeresig 4151ddef9d Bringing some selector tests back from Sizzle. 2010-01-11 23:55:02 -05:00
jeresig 6114565ab5 Merge branch 'master' of github.com:jquery/jquery 2010-01-11 23:32:33 -05:00
jeresig 2c8af19a06 Some more touching up of the replaceWith tests. 2010-01-11 23:32:11 -05:00
Paul Irish 7be5ec1248 browser version detection revised for opera >= 10, which was reporting itself as 9.8 due to their new policy 2010-01-12 11:42:31 +08:00
Paul Irish f14fadef73 adding extra useragents from trac tickets. correcting opera version 2010-01-12 11:42:30 +08:00
Neeraj Singh 8d7965a607 fixed typo in comments 2010-01-12 11:42:22 +08:00
jeresig 31252b1e47 Did some reorganizing of the recently added replaceWith tests. 2010-01-11 17:29:48 -05:00
jeresig 44e6beb103 Make sure we do the malformed JSON check for all both JSON.parse and new Function (this helps to create uniformity between browser implementations of JSON.parse - like where Chrome allows some malformed strings. Thanks to DBJDBJ for the heads-up. 2010-01-11 16:43:21 -05:00
jeresig 23d600c66d Make sure that wrapInner works on elements that have no contents. Fixes #3552. 2010-01-11 16:31:31 -05:00
jeresig 3e9ef6f5c0 Final pass at fixing #5785. Need to make sure that inner-nodes are detached before the remove() occurs (and it should still occur, the nodes are being obliterated. 2010-01-11 16:25:01 -05:00
jeresig cb4880ee83 Made some additional tests for #5785. 2010-01-11 16:08:39 -05:00
jeresig 36a98b95c2 Make sure we use detach instead of remove in replaceWith. Fixes #5785. 2010-01-11 15:57:45 -05:00
jeresig 366039a6f0 Revert "Adding in backwards-compatiblity support for jQuery().bind/unbind/trigger - and immediately deprecating it. Please explicitly use jQuery(document) in your code."
This reverts commit e9d5947b4a.
2010-01-11 13:48:40 -05:00
jeresig 5a0ac24e35 Make sure that submit event is still bound for regular form submit events. Thanks to Mark Gibson for the fix suggestion. 2010-01-11 12:26:28 -05:00
jeresig d6d5ed4c68 Merge branch 'setterargs' 2010-01-07 14:26:06 -05:00
jeresig 0e5370b89c Re-ordering the args to setOffset() in case people were relying upon the old order (doubtful). 2010-01-07 14:08:32 -05:00
jeresig 4fa00369f0 Added in support for .offset(Function). 2010-01-07 14:07:21 -05:00
jeresig ebaf374f2a Add .css(Function) incoming value tests. 2010-01-07 13:52:20 -05:00
jeresig 0bb4fd0af7 No need for the try/finally logic in the css tests, won't even work as expected. 2010-01-07 13:44:53 -05:00
jeresig 22ff8e9ea4 Added manipulation tests for setter function args. 2010-01-07 13:34:16 -05:00
jeresig 8fa9e9d6d0 Make sure that .html(Function) gets the correct previous value. 2010-01-07 13:33:30 -05:00
jeresig a9665bbe9b Make sure the exception has some level of parity with the error from json2.js. 2010-01-07 12:25:50 -05:00
jeresig 308d6cdad0 Make sure that a parsererror is thrown whenever malformed JSON comes back from a server (so that the Ajax error handler is called). Makes it uniform across browsers that do and don't have JSON.parse support. 2010-01-07 12:21:58 -05:00
jeresig c14fa516ae Back out the try/catch logic from around JSON.parse. We should always try to use it, otherwise security will suffer. 2010-01-07 11:54:26 -05:00
jeresig cc1a34852f Added some .text(Function) tests. 2010-01-07 11:51:48 -05:00
jeresig f126f1ce85 Added tests for attribute function setters. 2010-01-07 11:15:40 -05:00
jeresig 21e15219be Removed .removeAttr(Function), it didn't really make sense. 2010-01-07 11:14:56 -05:00
jeresig d36b29fa8e Make sure the state is passed in to the toggleClass attribute function. 2010-01-07 11:04:21 -05:00
jeresig c68fbc2071 There's enough logic going on in jQuery.ajaxSettings.xhr to warrant splitting the function based upon the functionality. 2010-01-07 10:00:55 -05:00
jeresig 12e8f07e34 Moved the val() tests from manipulation into attributes. 2010-01-07 09:55:15 -05:00
jeresig 4681216c4b Fixed some bugs relating to the setter arg change in val and html. Also optimized the code in val a bit. 2010-01-07 09:53:16 -05:00
jeresig 2526e29353 Fixing some bugs in the re-tooling of toggleClass, adding in some performance optimizations. 2010-01-06 15:23:30 -05:00
jeresig 600d314538 A first pass at making sure that all the setter function arguments receive the index of the element and a relevant value to work with. Fixes #5763. 2010-01-06 15:08:07 -05:00
jeresig 84dd82eb1a Add some abort() Ajax tests. Verifies that #3984 works. 2010-01-06 12:13:56 -05:00
jeresig e424e01c47 Merge branch 'master' of github.com:jquery/jquery 2010-01-06 11:32:39 -05:00
jeresig e9d5947b4a Adding in backwards-compatiblity support for jQuery().bind/unbind/trigger - and immediately deprecating it. Please explicitly use jQuery(document) in your code. 2010-01-06 11:32:29 -05:00
Filipe Fortes 0d1a2c1b11 Make sure to do a deep copy on arrays. #5750 2010-01-07 00:11:22 +08:00
jeresig 6861b5d4eb Added in support for content-type sniffing for scripts. Fixes #5718. 2010-01-06 10:19:38 -05:00
Rick Waldron 787f271052 Detect JSON Ajax requests by the response content-type (like is done with XML). Fixes #5709. 2010-01-05 19:48:16 -05:00
jeresig 230614b4df Merging in jQuery.proxy() branch. 2010-01-05 19:18:39 -05:00
jeresig 8db0dd2c64 Added in a holdover jQuery.event.guid for back-compat (two plugins use it: mousewheel and a datepicker). Plugin authors should work to stop using jQuery.event.guid and jQuery.event.proxy ASAP. 2010-01-05 19:17:28 -05:00
jeresig 0645b71ee6 Merge branch 'useragent' 2010-01-05 19:10:42 -05:00
jeresig ff3645ee05 Try to use the native JSON parser in all cases and fallback to the old technique otherwise. This allows us to also handle cases where the JSON parser is unable to parse JSON-like strings correctly (e.g. {foo:bar}) which is something that worked before but would stop working with the switch to the new parser. 2010-01-05 17:33:41 -05:00
jeresig ffb1867a43 Rewrite of jQuery.browser to become engine-centric, rather than browser-centric. Also attempt to determine the engine version in a smarter fashion, less prone to error. Finally, enhanced the test suite with 255 useragent strings from http://user-agent-string.info/download for testing. jQuery.browser.safari is now deprecated, use jQuery.browser.webkit instead. 2010-01-05 17:01:20 -05:00
jeresig 3f648c4e3a Make sure that the ActiveX exception is caught if it's unable to be loaded. Fixes #2849. 2010-01-05 11:35:11 -05:00
jeresig b2289f3ec1 Try to use XMLHttpRequest in more cases in IE 7. Thanks to Matt Kruse and Sam Collett for the suggestions. Fixes #3623, #2849, #5338, and #5529. 2010-01-05 10:57:30 -05:00
John Resig 25ee9cee26 Update the copyright from 2009 to 2010. 2010-01-03 20:04:24 -05:00
jeresig 3d35a97247 Oops, Rakefile was generating the wrong file. 2010-01-03 12:54:41 -05:00
jeresig 1d2b1a57da Added in jQuery.proxy(obj, name), like the method described in Secrets of the JavaScript Ninja and in Dojo's Hitch, and added in some unit tests. 2009-12-31 15:17:52 -05:00
jeresig a5dbca4a06 Moved jQuery.proxy() into core. 2009-12-31 15:06:45 -05:00
jeresig 40ce7f9830 Merge branch 'bug-5735' 2009-12-31 14:49:01 -05:00
jeresig 6cf981eea2 Allow the Makefile to be more resiliant to broken builds and handle redirecting the output better in more shells. Thanks to 'candlerb' on jquery-dev for the suggestion. 2009-12-31 09:59:16 -05:00
jeresig 6cb2945837 Rather than declaring empty anonymous functions all around, introduce and use a single empty function. Thanks to Matt Kruse for the suggestion. 2009-12-31 09:50:49 -05:00
jeresig ea5d514008 When .bind('unload') was called it accidentally went recursive, from 1bac61655b. Fixes #5688. 2009-12-31 00:49:53 -05:00
jeresig 66975de2d2 Remove the .bind(name, fn, thisObject) and promote jQuery.event.proxy() to jQuery.proxy() as alternative to handling scoping on callbacks. Fixes #5736. 2009-12-31 00:37:23 -05:00
jeresig fe6c86d530 Experiment switching to using onreadystatechange rather than a setInterval for Ajax requests. Fixes #5735. 2009-12-30 23:53:06 -05:00
jeresig a00e63ea5a Make a feature detect for the attribute selected code. Fixes #5702. 2009-12-22 15:46:54 -05:00
jeresig 7b0b348419 The option isn't, necessarily, hidden when this occurs. 2009-12-22 15:06:27 -05:00
jeresig 4729f4d443 Make sure that selected works in Safari on options in optgroups. Fixes #5701. 2009-12-22 15:02:52 -05:00
jeresig baff0b0c85 Merge branch 'master' of github.com:jquery/jquery 2009-12-22 13:53:04 -05:00
jeresig 9360cccc9e Forgot to make sure that oldData actually had data in it before the copy attempt. 2009-12-22 13:28:46 -05:00
Ben Alman 3951894504 Moved jQuery.param "traditional" flag into jQuery.ajaxSettings, can now be overridden via 2nd argument to jQuery.param 2009-12-23 01:49:53 +08:00
jeresig 7d0c18034e Explicitly re-bind the events on clone. Copying over the data isn't enough. Fixes #5681. 2009-12-22 12:04:17 -05:00
jeresig 1ea539b4f0 Add some extra tests to make sure we can get the value of hyphenated CSS properties, for #3732. 2009-12-22 11:54:54 -05:00
jeresig e87b090cb7 The logic for specified option values was already handled by .val(), removed the unnecessary code. 2009-12-22 02:03:41 -05:00
jeresig 1e64d58183 Make sure that the correct value is being pulled from checkboxes in Webkit. Fixes #5699. 2009-12-22 02:00:46 -05:00
jeresig 1b67aaee74 Make sure that the correct value is retreived for options that have no value specified, in IE 6. Continues to fix #5697. 2009-12-22 01:28:37 -05:00
jeresig f298cce100 Made sure that the .val() logic for setting radios and checkboxes was correct. Fixes #5698. 2009-12-22 01:18:49 -05:00
jeresig 261b7efb5f Fixed the issue where getting an empty value was impossible. Fixes #5697. 2009-12-22 00:24:23 -05:00
jeresig c97e914d40 Updated the README to reference the Closure Compiler instead of YUI Min. Thanks for the heads-up @_carumba. 2009-12-21 23:23:03 -05:00
jeresig 7e69fdbad4 Fixed spelling mistake noted in dc6b7ce3469eaadb37a151d449e8d36571d1894. 2009-12-21 20:19:49 -05:00
jeresig 3776cbe314 Standardize on using double-quotes for string literals. 2009-12-21 20:13:16 -05:00
jeresig 61e37d4149 Made a number of spacing changes to bring the code more-inline with the jQuery Core Style Guideline. 2009-12-21 19:58:13 -05:00
jeresig 36c99dc0c7 Tweaked the syntax of withinElement a bit. 2009-12-21 18:06:23 -05:00
jeresig e083d15fc7 Tweaked a couple cases where == was used instead of ===. 2009-12-21 18:02:02 -05:00
Alexander Farkas 209751fcbd Make sure that the beforeactivate event isn't accidentally prevented. 2009-12-21 16:24:03 -05:00
Jörn Zaefferer 03481a52c7 Stop trying to emulate the focus/blur event in IE, doesn't work as one might expect, anyway. Instead, implement the focusin/focusout events in all other browsers - which creates a much better parity across all browsers. Uses event capturing instead of bubbling to make it happen. Thanks to Alexander for the recommendation and to Joern Zaefferer for the original focus/blur delegation code. 2009-12-21 16:10:21 -05:00
Alexander Farkas 5dc6b7ce34 Used the patch from Alexander as the basis for a rewrite of the IE change event logic. Now has full parity with the regular change event in other browsers: Works with regular bind, works better with multiple selects, works as a regular change event (note test suite changes), works with readonly/disabled inputs, and much more. The original patch had a number of problems, including firing the change event too many times, not bubblinb properly, and not handling clicks on multi-selects properly - that should all be fixed now. Thanks Alexander for the patch pushing in the right direction. 2009-12-21 15:32:32 -05:00
jeresig d7a00234ab Make sure we use instead of in the delegate test. 2009-12-21 12:54:39 -05:00
jeresig 0d5bd17461 Moved logic for handling .animate({}), doesn't queue anymore. Fixes #5459. 2009-12-21 11:11:03 -05:00
John Resig f0505c6d75 Bringing Sizzle test suite changes back in. 2009-12-19 17:50:56 -05:00
jeresig 1feb92afb4 Make sure that we don't bind the onunload event in Opera. 2009-12-18 22:35:02 -05:00
jeresig 3fd62eae9d Switched from using YUI Compressor to Google Compiler. Minified and Gzipped filesize reduced to 22,839 bytes from 26,169 bytes (13% decrease in filesize). Sizzle copyright was merged into the main header (since it's removed automatically). Still passes all unit tests. 2009-12-18 21:23:26 -05:00
jeresig 42f8c3add3 No need to use the conditional comment for binding the onunload event in IE. 2009-12-18 20:29:22 -05:00
jeresig 0d06f3997b Updating the source version to 1.4b1pre. 2009-12-18 19:58:15 -05:00
jeresig f745357bae Tagging the 1.4a2 release. 2009-12-18 19:58:11 -05:00
jeresig a0af1a8f88 Updating the source version to 1.4b1pre. 2009-12-18 19:50:24 -05:00
jeresig 92d6ce5aa0 Tagging the 1.4a2 release. 2009-12-18 19:50:20 -05:00
jeresig 1c7d3155f0 Move the test results list above the test HTML to avoid test suite layout weirdness. 2009-12-18 19:47:53 -05:00
jeresig 298bfb79e6 The constructor check for isPlainObject was redundant, everything still passes without it. 2009-12-18 19:43:04 -05:00
jeresig 67b3be24e1 Added additional checks for DOM nodes and window to isPlainObject, IE 8 was still letting those pass through. Fixes #5669. 2009-12-18 19:36:35 -05:00
jeresig 5e811146ee Temporarily disabling test for bug #4299. 2009-12-18 19:24:19 -05:00
jeresig c05712f0a5 Fixed the spacing from the last commit. 2009-12-18 12:43:35 -05:00
jeresig d40083c866 Disabled the passthrough .attr(method_name) functionality. You can now use it if you do: .attr({method_name: value}, true) OR as an easy initialization method: jQuery('<div/>', {html: '...', id: 'test'}). 2009-12-18 12:41:53 -05:00
Robert Katic 148fb7ba8e Made isPlainObject() supporting null, undefined, and window values on IE too. Also added some related tests. Fixes #5669. 2009-12-19 01:19:34 +08:00
jeresig 27d65b59f9 Backing out the change from 841f9ff7a1, it was ineffectual in Internet Explorer. Keeping the broken test case, for now, so that we can check into the issue some more. 2009-12-18 11:30:04 -05:00
jeresig f036630692 Brought the attributes module more inline with the jQuery style guidelines. 2009-12-18 11:27:56 -05:00
jeresig 99d83fbd6d Bringing the effects module closer to being inline with the style guideline. 2009-12-18 11:16:26 -05:00
jeresig b70872f70d Renamed the 'fx' module to 'effects'. Should've been done a long time ago. 2009-12-18 11:01:19 -05:00
jeresig 9368b188c0 Removed jQuery.fn.contains - didn't match the :contains() selector and confused things. Thanks ajpiano for the tip. 2009-12-18 10:54:34 -05:00
Dave Methvin fe7e2fee16 Ignore case of script tags to make sure they're removed. Fixes #5668. Thanks to Motty/Fudgey for the report and Jitter for the patch! 2009-12-18 04:06:54 +08:00
Dave Methvin b31b9bd756 Add new html5 input types to list of serializable types. Older browers handle these as type="text" so they should be consistently serialized on both old and new browsers. Fixes #5667. 2009-12-18 04:05:45 +08:00
jeresig 6bc222e7a1 Removed 'abbr' from self-closing tags list. Fixes #5167. 2009-12-17 15:04:07 -05:00
Dave Methvin d85d366fbf Default callbackContext to the $.extended ajax options for 1.3.2 compatibility, per #5654. 2009-12-18 04:01:39 +08:00
Ben Alman 04b92e7831 Reorganized param code slightly to once again define buildParams as a named function expression, as moving it outside the param closure would necessitate moving and rewriting the add function as well. 2009-12-18 04:01:05 +08:00
Ben Alman 927e1966de Further modified jQuery 1.4 .param() method to serialize arrays containing non-scalar values. PHP and jQuery BBQ can both deserialize these structures, while rack (as of 1.0.0) cannot. 2009-12-18 04:01:05 +08:00
Karl Swedberg aa81bb5e45 added a couple missing semicolons and fixed a typo in the comments 2009-12-18 03:58:16 +08:00
jeresig 1d921e2171 Follow-up to 100ed68642, forgot to remove one of the tests. 2009-12-17 14:18:15 -05:00
jeresig ed5731dcc4 Revert the changes from 65ebf57c1e, they were ineffectual against IE's insanity: http://ejohn.org/files/bugs/fragment/ Used a different tactic instead (just don't return a fragment from .parent()). Fixes #5638. 2009-12-17 14:17:05 -05:00
jeresig ba86cc0294 Reworked some more of the selector tests as well to clean up after themselves. 2009-12-17 13:34:38 -05:00
jeresig 3a4bcf8a9c Added some more tests around the name tests to catch possible regressions. 2009-12-17 13:23:39 -05:00
jeresig 892fb55547 Make sure that the node exists before attempting to clone. 2009-12-17 13:15:12 -05:00
jeresig 100ed68642 Stick with just getter/setters in attrFn. 2009-12-17 12:23:04 -05:00
jeresig 9a0174b057 Moved readyList check. 2009-12-16 23:09:55 -05:00
jeresig de65985933 Make sure that some height/width is set for the nothiddendiv before checking. 2009-12-16 17:08:10 -05:00
jeresig f078e930ed Reverted accidental commit in 5197ac9fc8. 2009-12-16 16:54:21 -05:00
jeresig 9997620420 Retooled the arguments.callee-related changes in 98ce35d52b to avoid re-declarations where possible. 2009-12-16 16:45:00 -05:00
jeresig fe9333cc79 No need to use jQuery's event system for binding the onunload event in IE. 2009-12-16 15:42:03 -05:00
Batiste Bieler 649024909d Enforce that hasClass and removeClass work even with tabs and endlines in class attributes. Fixes #5505. 2009-12-14 16:24:28 -05:00
jeresig b4b30cc683 Disable getting values using the .attr() function shortcut until the full implications of which can be explored. 2009-12-14 01:15:02 -05:00
John Resig 5b51cc92fc Merge branch 'master' of git@github.com:jquery/jquery 2009-12-11 12:53:17 -08:00
John Resig 253e73af51 Fixed typo from commit 542099a278. 2009-12-11 12:49:22 -08:00
John Resig 974b0007f6 Merge branch 'master' of git@github.com:jquery/jquery 2009-12-11 12:47:55 -08:00
John Resig 638c093b85 Fixed typo from commit 542099a278. 2009-12-11 12:47:41 -08:00
John Resig 5197ac9fc8 Fixed typo from commit 542099a278. 2009-12-11 11:46:38 -08:00
John Resig 65ebf57c1e Make sure that dynamically-created elements don't have a parent. Fixes #5638. 2009-12-10 17:01:04 -08:00
Karl Swedberg 1bac61655b combined jQuery.bind() and jQuery.one() to make them more DRY 2009-12-10 14:44:30 -08:00
John Resig 0ab118ae0d Removed .attr(removeClass) and .attr(each) tests as they don't really make sense. 2009-12-10 14:40:11 -08:00
John Resig ecdcda870c Missed the case of bind in the new attr multi-setter. 2009-12-10 14:03:24 -08:00
John Resig 474d814076 Moved some methods around inbetween core.js and traversing.js. Core methods shouldn't rely upon other modules (e.g. the selector engine) wherever possible. 2009-12-10 09:25:25 -08:00
John Resig ede2f2c4f7 Made some minor formatting changes to the access function. 2009-12-10 09:07:19 -08:00
John Resig 80913618b0 Made the licensing verbiage a little more explicit. Thanks to Dan Montgomery for the suggestion. 2009-12-09 23:56:47 -08:00
John Resig 616aceef84 Adding .DS_Store to Git ignore. 2009-12-09 23:49:13 -08:00
John Resig 5473b041c0 Ignore html files living in the main directory (likely being used for testing). 2009-12-09 23:45:56 -08:00
John Resig 88572ee692 Make sure that the correct args are passed in to the filter callback (and by extension, the not callback). Fixes #5594. 2009-12-09 22:03:14 -08:00
John Resig a5f8a14411 Make sure that calling .width(num) or .height(num) on an empty set returns the empty set. Fixes #5600. 2009-12-09 21:58:29 -08:00
John Resig 715d1c5a30 Rewrote .merge() (faster and less obtuse now). Fixed #5610. 2009-12-09 21:43:20 -08:00
John Resig f25eedf32a Restrict the attr quick setters to only methods that specifically ask for the functionality. Fixes #5612. 2009-12-09 21:28:33 -08:00
Yehuda Katz 1a4d1904ae Fix up whitespace and a couple of glitches. 2009-12-09 21:17:10 -08:00
John Resig b3cee01820 Merge branch 'master' of git@github.com:jquery/jquery 2009-12-09 20:59:12 -08:00
John Resig cf72fba64f Make sure that the defaultView exists before attempting to get at the computedStyle (makes it easier to hide items that don't have a view). Fixes #5619. 2009-12-09 20:58:49 -08:00
Yehuda Katz da51cd0e43 Add function values to addClass, removeClass, toggleClass, text, and removeAttr 2009-12-09 20:57:53 -08:00
John Resig 4e9fed3b16 Made sure that css('width') and height returned string values, not numerical values. Fixes #5627. 2009-12-09 20:51:58 -08:00
John Resig 6bec6199c2 Work around a weird computed number issue in WebKit. Fixes #5145. 2009-12-09 20:37:14 -08:00
John Resig 04524287d3 Switched jQuery() to represent jQuery([]) instead of jQuery(document). 2009-12-09 20:36:07 -08:00
John Resig b846ad4ca0 Add a try/catch to handle the exception thrown by unloaded iframes in IE. Fixes #4280. 2009-12-09 16:00:59 -08:00
John Resig 9d8bd161b6 Clarified the use of jQuery.browser and enforced jQuery.browser.firefox matching Firefox, after the discussion in 17791c9a3e. 2009-12-09 15:07:16 -08:00
John Resig 3ec2f1aef6 Make sure that we don't try to trigger non-existant native events on applets, embed, objects, etc. as it'll cause an exception with Java applets. Fixes #2414. 2009-12-09 14:49:31 -08:00
John Resig 1052792bb2 Fixed problems with removing live events. Fixes #4894. 2009-12-09 14:43:53 -08:00
John Resig 86bbf9cf87 We have to access the native event handlers/triggers directly, otherwise they won't execute in most modern browsers. Fixes #5124. 2009-12-09 13:53:07 -08:00
John Resig 5e2163085c Make sure that document ready events, inside a document ready, are added to the queue rather than executing immediately. Fixes #5261. 2009-12-09 13:45:06 -08:00
John Resig 4b70f006f5 Made .clone(true) also copy over element data. Fixes #4191. 2009-12-09 13:28:58 -08:00
John Resig f6a0bf6816 Added support for .data(Object), overwriting the existing data object. Fixes #4284. 2009-12-09 13:16:18 -08:00
Yehuda Katz 4e27f17007 Landing in jQuery.contains, jQuery.fn.contains, and jQuery.fn.has support. Fixes #4101. 2009-12-09 12:43:13 -08:00
John Resig 9e60fec46b Make sure that an actual timeout is triggered (and not accidentally triggered from a setInterval). Fixes #5609. 2009-12-09 08:09:41 -08:00
John Resig 17791c9a3e Added in jQuery.browser.firefox, deprecated jQuery.browser.mozilla. 2009-12-08 22:52:32 -08:00
David Petersen 841f9ff7a1 Handle changing form attributes correctly when there is a child element with the same name. Fixes #4299 2009-12-09 14:43:55 +08:00
Dave Methvin d3dc2d1234 Get browser version rather than rendering engine version.
Don't recognize Chrome as Safari.
See results of different userAgent strings here:
http://spreadsheets.google.com/ccc?key=0Aj5JJFjq9rZDdHdxXzRLVnY0SzFpRTBOUDc4VmhzRVE
2009-12-09 14:43:18 +08:00
jzaefferer 8d73fbd788 Further cleanups on ant build 2009-12-08 22:22:49 +01:00
unknown fde95fb5cc Merge branch 'master' of github.com:jquery/jquery 2009-12-08 22:09:49 +01:00
unknown 5778a35abd Fixed ant build by cloning or pulling qunit and sizzle submodules, similar to the make build 2009-12-08 22:03:22 +01:00
unknown b3acfa5240 Further cleanup on ant build: Revision is gone 2009-12-08 21:27:27 +01:00
unknown 93adf60811 Further cleanup on ant build 2009-12-08 21:22:15 +01:00
unknown 1d8f7f790d Further cleanup on ant build 2009-12-08 21:17:26 +01:00
unknown d2d17705a0 Cleaning up build.xml in prepartion to get it running again 2009-12-08 20:59:05 +01:00
John Resig f5b649fafb Make sure that events are cloned for wrap, fixes #2977. 2009-12-08 11:21:24 -08:00
John Resig 77510fec02 Fixed extra p in Rakefile. 2009-12-07 18:07:15 -08:00
John Resig 98ce35d52b Removed uses of arguments.callee from jQuery. 2009-12-07 16:42:25 -08:00
John Resig 00a0abb751 Moved .ready() to core.js from event.js. 2009-12-07 16:34:55 -08:00
John Resig 872d18c10e Check Sizzle or jQuery. 2009-12-07 15:33:14 -08:00
John Resig 813886a4df Only run the visibility selectors if the filter exists. 2009-12-07 15:31:25 -08:00
John Resig 15f9d91c78 Fixed other nodeNode mistake, sigh. 2009-12-07 15:08:06 -08:00
John Resig ed93204e10 This is why you don't do commits when you're tired. Fixing bugs from 5980292856. 2009-12-07 07:48:15 -08:00
John Resig afaae84a7a support.js needs to come before event.js (also placed in a temporary setTimeout to delay the introduction of the ready in support - will remove when ready is moved to core.js, likely later today). 2009-12-07 07:45:20 -08:00
John Resig 97323d192f Oops, missed a closing } from 7d36ccfa8e. 2009-12-07 07:38:16 -08:00
James Padolsey 93fdbeb963 Added support for per-property easing 2009-12-07 16:11:46 +08:00
John Resig 62a34450c0 Added an extra function check to prevent crashes in Safari 2. Fixes #3039. 2009-12-06 20:20:49 -08:00
John Resig 5980292856 Make sure that expando properties aren't set on embed, applet, or object elements. An uncatchable exception is thrown and we must avoid it. Fixes #1675 and #2349. 2009-12-06 20:00:31 -08:00
John Resig 7d36ccfa8e Broke out the logic for the bubbling change/submit events so that they aren't bound if they aren't used. 2009-12-06 18:20:08 -08:00
John Resig 542099a278 Make sure that we're doing proper focus bubble testing. Also simplified the logic for the IE focusin/focusout handling. 2009-12-06 18:02:58 -08:00
John Resig 19ad49e607 Use the isXML function from Sizzle. 2009-12-06 17:52:31 -08:00
John Resig 3f7fc25494 Use the getText utility function provided by Sizzle. 2009-12-06 17:47:41 -08:00
John Resig 2092789155 Added in support for injecting area elements into map elements. Fixes #4484. 2009-12-06 17:26:39 -08:00
John Resig fbc73d45b4 Added in support for $.ajax jsonpCallback (allowing you to specify the name of the callback method - and allowing you to avoid skipping the cache). Fixes #4206. 2009-12-06 17:17:14 -08:00
John Resig aea5b09195 Adding in cross-browser onbeforeunload support. Fixes #4106. 2009-12-06 16:55:08 -08:00
John Resig 1fe9ff5482 Merge branch 'master' of git@github.com:jquery/jquery 2009-12-06 15:51:15 -08:00
John Resig ebad701751 Split the queue code out from data.js into a dedicated queue.js file (also split tests accordingly). 2009-12-06 17:19:33 -05:00
John Resig 87ba780c69 Renamed isObjectLiteral to isPlainObject (makes more sense, per the suggestion of Michael Geary). 2009-12-06 17:11:51 -05:00
Dave Methvin abbd2f4c3c Fix regexp for $.trim so it doesn't whack embedded spaces. 2009-12-06 10:31:57 +08:00
Dave Methvin 628e1564c4 Fix for #4011, crash when two text nodes are appended in IE. 2009-12-06 10:31:57 +08:00
jeresig 3c89e38fc2 Make sure that animated show resets the display correctly. Fixes #5130. 2009-12-05 21:06:14 -05:00
lrbabe 2d27e053a0 Fix inverted 'orig' and 'fix' event in mouseenter/mouseleave special events. 2009-12-06 09:13:57 +08:00
Karl Swedberg 3afc6533e2 added semicolons to end of 2 statements (and fixed a misspelled word in comment) 2009-12-06 08:55:54 +08:00
jeresig 9c1db29a06 Adding in an extra check, per the comments in 25b0ba9f96. 2009-12-05 18:06:27 -05:00
jeresig 2a6de9ab66 Make sure that the previous element is removed from the page before the next is inserted, in replaceWith. Using a variation of the patch by snaury. Fixes #2697. 2009-12-05 15:30:36 -05:00
jeresig aae0617c83 Made sure that css() in IE handles negative non-px values correctly. Fixes #3331. 2009-12-05 15:12:02 -05:00
jeresig 6071e939c7 Minor syntactical changes to :visible and :hidden. 2009-12-05 15:02:45 -05:00
jeresig b776e2b79a Made sure that a null speed doesn't get passed around. Patch from daltonlp. Fixes #5557. 2009-12-05 14:33:40 -05:00
John Resig b24da33f52 Make sure that width or height don't animate to a negative value. Fixes #3881. 2009-12-05 00:10:19 -05:00
John Resig 8d1efee316 Retooled the native triggering code, simplifying it. 2009-12-04 23:18:05 -05:00
John Resig 25b0ba9f96 Allow the user to explicitly set a content-type header even when there's no data being sent to the server. Fixes #1900. 2009-12-04 21:20:58 -05:00
Yehuda Katz d684122be0 Fixes a bug I introduced 2009-12-04 18:18:43 -08:00
Yehuda Katz c7d640f000 Added a test for bug 1095 for animations (animations don't clear check boxes) 2009-12-04 18:18:43 -08:00
jeresig 74f457d880 Updating the source version to 1.4a2pre. 2009-12-04 12:53:09 -05:00
jeresig c90a1cb61b Tagging the 1.4a1 release. 2009-12-04 12:51:47 -05:00
jeresig 39a77c2d02 Switched to using slice instead of join to get the correct results. 2009-12-04 12:36:24 -05:00
Ben Alman 2b481b93cf Landing Ben Alman's patch to add nextUntil, prevUntil, and parentsUntil. Also adds some tests for prevAll and nextAll, and fixes an test edge case in parents. 2009-12-04 12:28:47 -05:00
jeresig bbd933cbfe Added in the .delay() method for delaying the execution of queued functions and animations. 2009-12-04 12:06:47 -05:00
Justin Meyer d42afd0f65 Adding in support for bubbling submit and change events, thanks to the patch by Justin Meyer. Includes a delegation test suite for manually testing to see if the events work as intended. 2009-12-04 11:28:50 -05:00
jeresig c6a0211e57 Minor syntax changes to the winnow function. 2009-12-03 14:20:06 -05:00
jeresig c2ebd09826 Use now() in support.js instead of getTime. 2009-12-03 13:59:19 -05:00
jeresig 8a33a855b5 Tweaked a CSS test to handle differences in font-size % support in browsers. 2009-12-03 12:34:27 -05:00
jeresig 9d6c4d8413 Removed broken hidden/visible test. 2009-12-03 12:26:25 -05:00
jeresig 47293ebe15 Removing unnecessary parens from :hidden. 2009-12-03 11:59:59 -05:00
jeresig 0f0fd1aee3 Re-arranged many of the selector tests, breaking them into smaller test groups and into more-appropriate sections. 2009-12-03 11:45:38 -05:00
jeresig f0c32278b4 Just restore window.JSON in the getJSON test, don't try to delete the value. 2009-12-03 11:28:49 -05:00
jeresig c3b2aa9928 Landed the rest of the liveHandler rewrite that takes advantage of the new closest multi-selector signature (sorry, accidentally committed some of it in the wrong commit: 4daae7a79f). 2009-12-03 11:15:26 -05:00
jeresig 24e96ba22c Re-worked the closest no-duplicate-selector code again to be more efficient. 2009-12-03 11:14:10 -05:00
jeresig 525bb27bc0 Prevent duplicate selectors from having to match in closest. 2009-12-03 11:05:12 -05:00
jeresig 4daae7a79f No need to do the closest match if no selectors are passed in. 2009-12-03 10:51:04 -05:00
jeresig e534a310c7 Added in the new .closest(Array) method, will be used to improve the performance of live filtering. 2009-12-02 19:05:51 -05:00
jeresig 62436f4b29 Extracted the logic for copying events from one jQuery set to another, makes it easier to work with disconnected DOM nodes. 2009-12-02 17:15:09 -05:00
jeresig 391f83b2a2 Fixed logic error in html method - support.leadingWhitespace shouldn't have been negated. 2009-12-02 15:20:33 -05:00
jeresig bfc15b57ef Removed debug statements from manipulation tests, was causing errors in IE. 2009-12-02 15:14:48 -05:00
jeresig ad4f28631a Make sure that a DOM node isn't getting passed through (as is the case in IE, it has a toString of [object Object]. 2009-12-02 14:59:19 -05:00
jeresig b8d0c0711f Added some isObjectLiteral tests. 2009-12-02 14:57:13 -05:00
Yehuda Katz e277e6ed21 Adding a test that a new option can be selected with val(N) 2009-12-01 14:11:32 -08:00
Yehuda Katz 64e4a879f9 Fix css("opacity") to not clobber other filters in IE. Closes #4707. 2009-12-01 11:40:28 -08:00
jeresig 839e97199c Updated the Rakefile to use the correct init code. 2009-11-30 15:56:40 -05:00
jeresig 5480cd3fa1 Shortened the build messages in the Makefile and added test/qunit and src/sizzle to the cleanup. 2009-11-30 15:54:14 -05:00
jeresig d605b8ee56 Don't try to run the clone code if the directory already exists. 2009-11-30 15:52:41 -05:00
jeresig 6798df54f4 Switched from using Git Submodules to just doing a straight clone of the QUnit and Sizzle directories. Works much better for what we want. 2009-11-30 15:45:16 -05:00
jeresig e514e67cd2 Bringing Sizzle and QUnit up to date. 2009-11-30 15:09:50 -05:00
jeresig 918cf68dfd Don't do the update after the pull - forces the submodules up to date. 2009-11-30 15:08:55 -05:00
jeresig 1a26e41917 Use .add() to merge two test groups together for .unwrap(). 2009-11-30 14:39:34 -05:00
jeresig 122e5dcf14 Changed the style attribute test to handle hex colors (as that's what Opera returns, in this case. 2009-11-30 14:31:32 -05:00
jeresig 3ec9f4990c Made .show(null/undefined) and .hide(null/undefined) work the same as .show() and .hide(). 2009-11-30 14:28:09 -05:00
jeresig 25c188b6d2 Fixed a problem with animations with a duration of 0 not working properly for hide and show. 2009-11-30 14:22:24 -05:00
jeresig 21dead4691 Simplified a selector in the .live() tests. 2009-11-30 14:02:03 -05:00
jeresig 6e5a6a26a7 Tweaked the live test to be a bit simpler. 2009-11-30 13:50:25 -05:00
jeresig c7407bd4fc Fixed wrap test that was looking for comment values from .text(). 2009-11-30 13:46:14 -05:00
jeresig df6e02a4a7 Merge branch 'master' of github.com:jquery/jquery 2009-11-30 13:42:26 -05:00
jeresig 90ba57ce6d Fixed bug with singleTag matching in core.js. 2009-11-30 13:42:19 -05:00
Yehuda Katz 17955cacf4 Fixes $.trim for &nbsp; closes #4980 2009-11-30 10:22:18 -08:00
jeresig 84857abefc Ignore diff and patch files. 2009-11-30 13:00:06 -05:00
jeresig 2b7c38f80c Merge branch 'master' of github.com:jquery/jquery 2009-11-29 16:22:08 -05:00
jeresig e00be67f32 Adding a Rakefile to build jQuery core, for those that need it. 2009-11-29 16:21:54 -05:00
Karl Swedberg 255068da33 added missing semicolons 2009-11-28 04:09:14 +08:00
Karl Swedberg a5efe9d3a6 added missing radix parameter for parseInt() 2009-11-28 04:09:14 +08:00
Karl Swedberg ddb86f8d5b added curly braces around all if/else statements 2009-11-28 04:09:14 +08:00
jeresig 1879e8cbee Force endlines to be just LF (any CRLF is auto-converted to LF by Git). 2009-11-27 11:23:19 -05:00
John Resig a7678267d8 Disable the X-Requested-With header to avoid preflighting remote POST requests. Fixes #4601. 2009-11-25 13:29:34 -05:00
John Resig 0f6e9a8c69 Fixed spacing on the modified Ajax code. 2009-11-25 13:24:24 -05:00
Mark Gibson ef819c91b9 Fixing endlines. 2009-11-25 12:09:53 -05:00
Robert Katic 0bb3998a6a Re-adding zeros removed from slice calls in last commit. 2009-11-26 00:58:39 +08:00
Robert Katic 04dbdb7525 Corrected RegExp to match event namespaces. Fixes #5303. 2009-11-26 00:58:39 +08:00
Robert Katic ac00fe5bbb Generic jQuery.merge and safer jQuery.makeArray(nodeList).
* Made jQuery.marge more generic supporting null and undefined values, and supporting array like objects as results. Fixes #5527.

* Made jQuery.makeArray(nodeList) more safer using jQuery.merge internally. Fixes #5528.

* Added a second "results" argument to jQuery.makeArray for internal usage to avoid intermediary arrays in init.
2009-11-26 00:56:49 +08:00
John Resig b30af34f28 Added support for .text() on text nodes. Fixes #5525. 2009-11-17 14:52:08 -05:00
John Resig c08474580c Re-wrote context Ajax test to use an element instead of an object (a more realistic test and works with the new jQuery.extend logic for cloning object literals). 2009-11-17 14:36:10 -05:00
John Resig b33f37c22c Re-adding the QUnit submodule file. 2009-11-17 14:25:14 -05:00
Andrea Giammarchi 3a23a5c17d Changed the === undefined ready event check to == null since frameElement is usually null and was skipping the normal line of checks. 2009-11-17 10:45:01 -05:00
John Resig 0a7232cc39 Hide the .settings file in the gitignore. 2009-11-15 00:27:06 -05:00
Kim Dalsgaard d338b1a1e7 Ignoring src/selector.js (build) and Emacs backup files 2009-11-15 12:14:31 +08:00
Scott Gonzalez 8cb8ae27d8 Added test for passing null to .show() 2009-11-13 12:23:39 +08:00
Scott Gonzalez 9cd5866a29 Allowing falsy values to be passed as a speed for hide(). 2009-11-13 12:23:39 +08:00
Scott Gonzalez 231c875678 Allowing falsy values to be passed as a speed for show(). 2009-11-13 12:23:39 +08:00
Robert Katic ee9192d103 Corrected some minor errors made by me (rkatic) in last commits. 2009-11-13 08:09:46 +08:00
Robert Katic 7b26e3bcc8 Forgotten to update the number of jQuery.extend related tests. 2009-11-12 21:59:48 +08:00
Robert Katic 93be758de9 Made jQuery.extend(true, ...) to extend recursively only 'object literal' values. 2009-11-12 21:59:47 +08:00
Robert Katic 990d9ca1b0 Made isObjectLiteral to work correctly with custom objects with empty prototypes. 2009-11-12 21:59:47 +08:00
John Resig 1ce92e022d Make sure that the submodules are pulling from the right location. 2009-11-11 18:08:07 -05:00
lrbabe c07d15d5a2 Use array.indexOf if available (speeds up modern browsers). Thanks to lrbabe and Andrea for the patch. Fixes #5160. 2009-11-11 15:15:58 -05:00
John Resig 5ac2e0837c Added useMap and frameBorder IE support to attr. Fixes #4561. 2009-11-11 15:11:58 -05:00
John Resig 357e2ae989 Added a check to make sure that a load request isn't done if the element doesn't exist. Fixes #4235. 2009-11-11 14:55:32 -05:00
John Resig c2101245c0 Pass in the XHR object as the third argument to the success callback (which helps $.get, $.post, and load). Fixes #3363. 2009-11-11 14:29:01 -05:00
John Resig 7c4144fab3 Fixed the case where HTML that contained entities was being inserted as text strings instead of HTML. Thanks to dmethvin for the test case! Fixes #5483. 2009-11-11 14:23:56 -05:00
John Resig 449e099b97 Landing tweak from 'haruka' that fixes non-pixel fontSize values in IE. Fixes #760. 2009-11-11 14:17:16 -05:00
Rich Dougherty bf71575bb4 Land Rich's fix for not using window.top to do frame detection. Fixes #4787. 2009-11-11 13:56:39 -05:00
John Resig c4c820efff Made jQuery('<div/>') and jQuery('<div></div>') use the same code path (making the second one faster). Fixes #5293. 2009-11-11 13:49:29 -05:00
John Resig d933e9c26d Opera 9.2 was interpreting .5 as 0.50, changing it to .55 lets the result be the same in all browsers: 0.55. Fixes #5344. 2009-11-11 13:45:03 -05:00
John Resig dee8e45ef3 Removed the use of this.length++ as it makes it hard to use the init method directly. Fixes #4955. 2009-11-11 13:42:50 -05:00
Damian Janowski ca8a9e8c30 Add QUnit as a submodule. 2009-11-12 02:33:42 +08:00
Damian Janowski 6035913e25 Remove symlink to John Resig's filesystem. 2009-11-12 02:33:42 +08:00
Mr Speaker 5cb1163469 Making sure that you can bind multiple toggles to a single element without problems. Thanks to 'Mr Speaker' for the original patch. Fixes #5274. 2009-11-11 09:46:24 -05:00
John Resig 4b55e94d08 Renamed isObject to isObjectLiteral to be more specific. 2009-11-10 23:07:05 -05:00
John Resig a8b089a020 Force the submodules to keep up to date. 2009-11-10 02:13:58 +01:00
John Resig 262fcf7b7b Require that, at least, document.body exists before firing the ready event. This may stop jQuery from working on pages that don't create a document.body (such as Safari, when no body exists) but considering that we've required a document.body since 1.3 and haven't broken any pages, this doesn't appear to be a pressing issue. Used the test case written by dmethvin to verify the bug and the fix. Fixes #4320. 2009-11-09 13:47:53 +01:00
John Resig 24e18d4cae Backing out commit 81bfd9b870, read the ticket incorrectly - and seeing some of the other earlier tickets it's obvious that a more generic solution is needed. Thanks jdalton for the catch. 2009-11-09 13:30:33 +01:00
John Resig 4fd730dca7 Merge branch 'master' of git@github.com:jquery/jquery 2009-11-09 13:01:10 +01:00
lrbabe d251809912 Making mouseenter and mouseleave work with .live(). 2009-11-09 12:59:54 +01:00
lrbabe 9a69b2cf08 Cleanup bubbling focus and blur events
- Use cached event instead of jQuery.event
- Do not cache event.special if you use it only once
2009-11-09 19:41:43 +08:00
Robert Katić e03aee1aa6 Made the closest method evaluate the selector with appropriate context. 2009-11-09 12:39:29 +01:00
rkatic b256a3a266 Added a method to myKlass.
If an object's prototype is "empty", then isObject returns true!
2009-11-09 19:32:24 +08:00
rkatic c2bbcd8833 Added comments to isObject. 2009-11-09 19:32:24 +08:00
John Resig 76f6f0d39d Fixing spacing problems from rkatic's patches. 2009-11-07 17:40:47 +01:00
rkatic 3dc5bc5a8b Make liveHandler to use jQuery.lastCloser and speed up internal sorting. 2009-11-08 00:37:05 +08:00
rkatic 0f03c7489f Store last closer value to jQuery.lastCloser instead of using data API. 2009-11-08 00:36:44 +08:00
John Resig 3106039aa8 Made sure that animate callbacks get executed even when no properties are passed in. Fixes #5459. 2009-11-07 17:22:35 +01:00
John Resig b0fe380cf8 Make .add() take an optional context and - if a context is specified in the root selector - use that as the base context. 2009-11-07 16:43:31 +01:00
John Resig ef05f44cce Comment nodes are discarded from a merge, for no apparent reason. Fixes #5438. 2009-11-07 16:15:33 +01:00
John Resig 6a722e251d jQuery.ajax modified the passed-in object only to help test the code - this shouldn't occur. Fixes #5439. 2009-11-07 16:08:07 +01:00
John Resig 1a94a46826 A typechange for test/qunit. 2009-11-07 16:03:16 +01:00
John Resig 81bfd9b870 Make sure that document.body exists, at least, in IE before the ready event is fired. Fixes #5443. 2009-11-07 16:00:43 +01:00
John Resig 513053d62b The complete event wasn't getting called on local file 404s. Thanks to 'mrspeaker' for the patch. Fixes #5468. 2009-11-07 14:59:47 +01:00
John Resig 9a371e2d93 Fixed the case where getComputedStyled was assumed to exist if getBoundingClientRect did (which isn't the case on the Playstation 3). Fixes #5467. 2009-11-07 14:57:27 +01:00
John Resig 339708cda9 Removing some of the SVN-specific stuff from the Ant build file (should probably be updated to use the new Git functionality. 2009-11-07 14:55:14 +01:00
Michael Bensoussan 10068d5fd0 changed the extension of the README from .markdown to .md 2009-11-03 10:01:03 +08:00
Michael Bensoussan 044ad9052a update the README title with a direct link 2009-11-03 10:01:03 +08:00
Michael Bensoussan fbc162b9a3 update the README for more readbility 2009-11-03 10:01:03 +08:00
Michael Bensoussan a1bb3ee44d from txt to markdown 2009-11-03 10:01:02 +08:00
visionmedia 50cf4351a6 Consistant splits using " " instead of ","
This was used in several other areas, and IMO is easier to read
and since nothing is multi-word then we misewell use " "
2009-10-27 08:40:59 +08:00
John Resig 81f65ce339 Pull in the Sizzle library dynamically using a submodule and make it part of the jQuery build process. 2009-10-26 18:23:31 -04:00
John Resig bbffc99f7c Moved a bunch of methods out of the jQuery-specific Sizzle code into more-appropriate files, in jQuery itself. 2009-10-26 18:07:57 -04:00
Jon Evans b7ccc58afe fix sed statement used to extract the date 2009-10-23 23:13:47 +08:00
John Resig bcbd06b66f Removed the revision info and fixed the date pull to work against git log instead of SVN. 2009-10-23 03:25:40 -04:00
John Resig c7006d2fa5 Removing the old speed perf directory (the current one is in the main 'speed' directory). 2009-10-22 22:06:20 -04:00
John Resig 04ab794410 Only need Java if you want to build a minified version of jQuery. 2009-10-22 21:57:45 -04:00
John Resig b2e9680116 Removed the 'lite' build option (no longer used) and updated the README. 2009-10-22 21:56:49 -04:00
John Resig cd05cac37f Cleaned out the build directory - a lot of old files that weren't being used anymore. 2009-10-22 21:54:34 -04:00
John Resig 1ef930b384 Removing some old text files. 2009-10-22 21:45:36 -04:00
John Resig 4c85dec058 Added the submodule init/update to the Makefile for 'make test' and updated the README to be more current. 2009-10-22 21:44:44 -04:00
John Resig 920238d485 Pull in QUnit using a submodule. In order to build jQuery (and run the tests) you'll need to do 'git submodule init' and 'git submodule update' after checkout. 2009-10-22 21:39:41 -04:00
John Resig 4a51b12b95 We don't want to filter out the qunit file. 2009-10-22 21:26:28 -04:00
John Resig 098a2bb4d0 Fixed the cleaning method to support namespaced elements. Thanks to einaros for the patch recommendation. Fixes #5358. 2009-10-12 16:26:01 +00:00
John Resig 4b5a680f77 Fixed == change in ready. 2009-10-08 18:13:07 +00:00
John Resig 805832afc7 Updated the jQuery suite to use the updated QUnit CSS styling. 2009-09-29 22:48:25 +00:00
John Resig 3b5de9df40 Updated the jQuery test suite to use the new QUnit file names. 2009-09-29 22:25:02 +00:00
John Resig 0256edbd6f Moved the jQuery-specific test suite CSS into a separate file. 2009-09-29 22:09:21 +00:00
John Resig b996026e38 Adapted the jQuery test suite to handle the toolbar moving inline. 2009-09-29 21:40:17 +00:00
John Resig b0306cc3a6 Updated the jQuery suite to use the new 'qunit-' prefix on specific elements. 2009-09-29 21:34:12 +00:00
John Resig dfeb8140fa Fixed the q() method to use same instead of isSet. 2009-09-29 21:22:35 +00:00
John Resig 4bda398e6a Switched from using QUnit's isObj/isSet to the more robust same method. 2009-09-29 19:49:43 +00:00
John Resig f8b7d391e6 Moved some jQuery-specific test methods into the core module. 2009-09-29 18:11:10 +00:00
John Resig 8df82d2b04 Moved the init test script off into a separate file. 2009-09-29 18:06:16 +00:00
John Resig 69e6e53555 Adding in .unwrap() support, thanks to Ben Alman! Fixes #5191. 2009-09-25 21:41:21 +00:00
John Resig 70b9aed422 Removed the trailing endline from the version. 2009-09-25 21:36:40 +00:00
John Resig 79ba722e6e Full steam ahead! We're going for 1.4. 2009-09-25 18:21:02 +00:00
John Resig 67d445a703 A follow-up to [6578] (which stopped adding expandos to elements that didn't have data). That broke jQuery.unique() (so we're now using the unique from Sizzle). Using Sizzle's unique (which also sorts in document order) changed how add, andSelf, parents, nextAll, prevAll, and siblings work. after and before were changed to not use .add() (in order to guarantee their position in the jQuery set). Also, jQuery.data(elem) was updated to return that element's data object (instead of its ID).
$("<div/>").after("<span/>")
=> [ div, span ]
(calling after on a disconnected DOM node adds the nodes to the end of the jQuery set)

$("<div/>").before("<span/>")
=> [ span, div ]
(calling before on a disconnected DOM node adds the nodes to the beginning of the jQuery set)

$("div").add("span")
=> [ div, span, span, div, span ]
(results now come out in document order)

$("div").find("code").andSelf();
=> [ div, code, code ]
(results now come out in document order)

Same goes for .parents(), .nextAll(), .prevAll(), and .siblings().

Exception: .parents() will still return the results in reverse document order.

jQuery.data(elem)
=> { object of data }
(no longer returns the unique ID assigned to the node)
2009-09-25 17:55:20 +00:00
Yehuda Katz 67089eedf6 Getting $.param working well; Patch by ben_alman 2009-09-17 22:37:19 +00:00
Yehuda Katz 45dfa3b0fc Probably not the optimal solution, but tests pass. 2009-09-16 08:33:00 +00:00
Ariel Flesler 9ebb2fc654 jquery event: closes #5250. bind(), unbind() and one() support Object Literals (needs some refactor though) 2009-09-16 02:19:18 +00:00
Brandon Aaron 97e134fe80 data should not add expando unless actually adding data 2009-09-15 21:14:08 +00:00
John Resig 24ffc395a7 Missing a var on a for loop, caused a variable to be leaked. 2009-09-15 21:09:46 +00:00
John Resig e907b8769f Missing a var on a for loop, caused a variable to be leaked. 2009-09-15 21:01:00 +00:00
Brandon Aaron daffb954e3 offset is now a setter 2009-09-15 19:15:04 +00:00
Jörn Zaefferer f55fb36e54 remove globals in tests for compability with ?noglobals, to be enabled by default 2009-09-15 17:51:38 +00:00
Jörn Zaefferer 0b36b26259 fixed global variables introduced in for loop with missing var-keyword (detected via QUnit's no ?noglobals) 2009-09-15 17:39:21 +00:00
Ariel Flesler 5550356a12 jquery attributes: closes #5234. attr() supports jQuery.fn methods. 2009-09-15 17:23:26 +00:00
Ariel Flesler 8356871a55 testrunner: focus & blur events could fail if the window isn't focused 2009-09-15 17:11:15 +00:00
John Resig fc4c691534 Adding some fixes for commit [6537]. If there's leading whitespace, or if an exception is thrown by innerHTML, we need to use the old style method. 2009-09-15 16:46:15 +00:00
Ariel Flesler cf8c1249d1 jquery ajax: addition for #2452. Wasn't working correctly in some cases. 2009-09-15 16:45:37 +00:00
John Resig 7638fc5835 Fix for SVN rev [6537]. Events weren't being unbound correctly in Internet Explorer (cleanData wasn't handling malformed NodeList results correctly). 2009-09-15 15:56:18 +00:00
Ariel Flesler 5b9214e7d8 jquery ajax: closes #2452. get() and post() weren't shifting all arguments correctly. 2009-09-15 15:28:28 +00:00
Ariel Flesler 183f37e4b4 jquery ajax: closes #4994. Adding 'context' setting to $.ajax 2009-09-15 15:19:58 +00:00
Yehuda Katz c4f144eeff avoid creating a new data cache if we don't need one. Also, short-circuit the case where $.data is used to get the cache id 2009-09-15 07:59:53 +00:00
Ariel Flesler 19cd84cf32 jquery data: adding missing semicolons 2009-09-15 01:02:18 +00:00
Yehuda Katz 9b20eb4c85 Make jQuery.winnow a local function 2009-09-15 00:35:35 +00:00
Ariel Flesler 321267dcec jquery fx: closes #2542. show/hide(0, fn) wasn't calling the callback. 2009-09-15 00:32:13 +00:00
Ariel Flesler 5e0da8c036 testrunner: resetting the scroll position after focusing a field 2009-09-14 23:28:21 +00:00
John Resig 3eb56b09b8 Another fix for [6537] - make sure that .innerHTML isn't used on non-HTML documents and that we only attempt to use .innerHTML on DOM Elements. 2009-09-14 23:20:23 +00:00
John Resig 766635e862 Fixed a bug introduced in SVN rev [6537] that caused XML-based fragment creation to fail, in IE. 2009-09-14 23:12:06 +00:00
Ariel Flesler 681f4fd3cd jquery event: misc removal 2009-09-14 22:58:20 +00:00
Ariel Flesler a273120291 jquery data: closes #5224. Exposing the expando. 2009-09-14 22:34:04 +00:00
John Resig 173c1477ae Added support for .before(), .after(), and .replaceWith() on disconnected DOM nodes. Fixes bug #3940. 2009-09-14 22:09:42 +00:00
Ariel Flesler bca8225413 jquery event: fixes #4989. blur and focus events now bubble and can be handled using live(). 2009-09-14 22:04:22 +00:00
Brandon Aaron f3474c00cd fix for #5198, event memory leak limited to IE only via conditional compilation 2009-09-14 21:14:15 +00:00
Brandon Aaron 4a3c4c86c9 fix for #5017 2009-09-14 20:55:40 +00:00
Brandon Aaron b539b6e1d9 remove and detach unit tests were not cleaning up, causing selector tests to fail 2009-09-14 20:45:58 +00:00
Ariel Flesler 36ebb4f75e jquery ajax: Misc rename 2009-09-14 19:57:49 +00:00
Ariel Flesler 0790989eb6 jquery core: Fixed #5202. Fixing selector generation when a manipulation function receives a jQuery object. 2009-09-14 18:03:18 +00:00
Ariel Flesler 66c58e9db6 jquery core: removing the body optimization, as it is then handled by $("TAG"). 2009-09-14 17:33:15 +00:00
Ariel Flesler 9e1a955aab jquery core: commenting the new access function. 2009-09-11 17:47:40 +00:00
Ariel Flesler d1285504fb jquery core: Closes #5189. Added a generic function to handle getting/setting key-value/setting a hash. 2009-09-09 21:14:28 +00:00
Ariel Flesler aadc268abf jquery core: fixes 5187. getElementsByTagName optimization was breaking $('div').live() 2009-09-09 16:50:58 +00:00
Ariel Flesler bf230ffb6a jquery core: closes #5186. getElementsByTagName optimization was breaking the selector attribute. 2009-09-09 16:33:16 +00:00
John Resig 9de120e6d7 Added support for .eq(-N), .first(), and .last(). Fixes #2164 and #4188. 2009-09-09 00:21:21 +00:00
John Resig 4ea4fad090 Optimize jQuery() for the case $("TAG"). 2009-09-08 04:26:47 +00:00
John Resig 1e750a00e9 Use the native Array indexOf method if it exists, for jQuery.inArray. 2009-09-08 01:45:11 +00:00
John Resig 96dd06ea50 Removed jQuery.className.(has|remove|add) in favor of .addClass/removeClass/hasClass. Also rewrote the functions for additional performance. 2009-09-08 01:07:50 +00:00
John Resig 520f1a2684 Broke the logic for .clean() wrap out into a separate, static, data structure. Also improved the performance of .html() looking for the case where .innerHTML can be used without problems. Also tweaked some cases where cleanData() was used, no need to use jQuery selectors in these cases. 2009-09-07 20:55:36 +00:00
John Resig 9d8d74569c Split out the fragment-building code from domManip. Switched core.js to using that instead. Also moved the standalone tag detection to $(...) for performance. 2009-09-07 18:58:01 +00:00
John Resig b7d4e0e46c Added an optimization for the case where $("body") is used. 2009-09-07 17:20:38 +00:00
Yehuda Katz 50d78e7658 Adds nested param serialization; Closes #4201 (by merbjedi) 2009-09-02 05:16:21 +00:00
John Resig 569c8b45c0 Fixed a bug with the isXMLDoc test - also made sure that isXMLDoc was handling the case where documentElement is undefined (which only occurs on HTML documents in IE). 2009-08-27 20:07:45 +00:00
John Resig 957cd6fb2a Tweaked the isXMLDoc iframe test case to test the document, not the body element (which doesn't exist in IE). Also made the isXMLDoc code handle cases where elem is null, undefined, etc. 2009-08-27 19:22:48 +00:00
John Resig f52c4a3d5f If the XHR object no longer exists assume that the request was aborted. 2009-08-26 17:39:52 +00:00
John Resig a64ad8b4e9 Temporarily disabled some tests for Opera 10 - a variety of problems with input elements and selectors exist. 2009-08-26 16:29:46 +00:00
John Resig bddd1837bb Moved exposing window.jQuery and window.$ to the end of the jQuery file (helps some compatibility cases with older version of Prototype). Fixes ticket #4834. 2009-08-10 21:22:31 +00:00
John Resig d6991fa273 Added support for .closest(filter, DOMElement). Fixes #4072. 2009-07-28 12:28:59 +00:00
John Resig 61b18c866c Backing out commit #6507 - causes too many problems. 2009-07-28 12:22:10 +00:00
John Resig b7a3b220a8 Fix some missing braces in core.js. 2009-07-27 20:48:42 +00:00
John Resig 18a6fbbb6a Added an improvement to quickExpr and some more tests for jQuery('html'). Fixes #4979. 2009-07-27 20:47:32 +00:00
John Resig 8c18dcdeb0 Make sure payload is sent for PUT requests. (Thanks alx). Fixes #4971. 2009-07-27 19:02:40 +00:00
John Resig 255a293cda Shortened the isXMLDoc code, based upon recommendation from Andrea. 2009-07-27 13:21:19 +00:00
John Resig 2cd9ee3510 Added an extra documentElement check to isXMLDoc for IE - and added a number of unit tests for isXMLDoc. Fixes #4833. 2009-07-27 13:02:41 +00:00
John Resig cae93c39eb Implemented support for .context limited .closest() calls. Fixes #4072. 2009-07-25 21:31:59 +00:00
John Resig 343b0936a4 Fix for animating hyphenated CSS properties. Fixes #4156. 2009-07-25 20:56:15 +00:00
Brandon Aaron fd0bf5d6ed Fix for #4972. Dreamweaver CS4 crashes on offset module. Thanks mike.helgeson 2009-07-25 16:08:18 +00:00
Brandon Aaron 3d8ceaf2f2 revision 6494 accidentally reverted some changes to offset module 2009-07-25 16:04:30 +00:00
Brandon Aaron cafd392af0 add scrollTop/Left tests and fix for IE 2009-07-24 22:32:53 +00:00
Ariel Flesler cf7a0cfdc1 speed: adding a benchmark() function 2009-07-24 01:50:41 +00:00
Ariel Flesler 0d389c066a speed: misc changes to the top comment 2009-07-24 00:58:24 +00:00
Ariel Flesler 6a85898d13 speed: committing a failing experiment of concat vs slice 2009-07-24 00:57:27 +00:00
John Resig 26eda09892 Changed .get(-Number) to use .slice() instead of .toArray() (which doesn't take any arguments). Follow-up from commit [6484]. 2009-07-23 22:38:29 +00:00
John Resig 9c9dd7cede Fix for incorrect options being selected (noticed same problem with radio/checkbox and fixed it there, as well). Fixes #4962. 2009-07-23 22:16:29 +00:00
John Resig 0a6c5205d2 Make sure that at least one argument is provided to .slice(), in accordance with the spec. Fixes jQuery bug #4942. 2009-07-23 13:22:55 +00:00
John Resig b964e56946 Optimizing isXMLDoc. 2009-07-22 17:30:17 +00:00
John Resig 6fc57be843 Support dynamically loaded copies of jQuery using document ready. Fixes #4889. 2009-07-22 15:03:23 +00:00
John Resig fe80b5af45 Make sure that the script is removed only if it's actually in the page still. Fixes #4934. 2009-07-22 14:38:21 +00:00
John Resig 4e8f0c935e Completely disable the flaky fx queue test. 2009-07-21 20:48:29 +00:00
John Resig 6649ae2903 Exaggerate the times for the localtimeout ajax test. 2009-07-21 20:24:12 +00:00
John Resig 66c98419aa Retool the fx test again, making it more apparent which order the queue tests will complete in. 2009-07-21 20:16:44 +00:00
John Resig db82262296 Made a tweak to the fx queue test (was randomly failing in its current incarnation). 2009-07-21 20:06:05 +00:00
John Resig 7e06b9b70f Tweaked the detach addition in commit [6474]. 2009-07-21 15:57:51 +00:00
Yehuda Katz 7a67f8897d Adds detach() 2009-07-21 09:17:33 +00:00
John Resig 29ff710c9b Made some syntax tweaks to core.js. 2009-07-19 19:55:21 +00:00
John Resig b953c1d50a Saved some references to native methods, instead of re-referencing them on every call. 2009-07-19 19:50:45 +00:00
John Resig 03de2cb5e7 Moved some RegExp in core.js, goes toward #4111. 2009-07-19 19:47:30 +00:00
John Resig eaca153aea Moved the RegExp in ajax.js out from inline, goes towards ticket #4111. 2009-07-19 19:44:15 +00:00
John Resig 5272ed28bc Made a number of syntax tweaks to ajax.js. 2009-07-19 19:37:11 +00:00
John Resig fa2d663639 Did some cleaning up of ajax.js and fixed a bug from commit [6457]. 2009-07-19 19:03:18 +00:00
John Resig 81985c7878 Fixed a typo with commit [6457]. 2009-07-19 17:02:01 +00:00
John Resig 7175b2ffab Removing extraneous closing ). Fix for [6463]. 2009-07-19 16:21:08 +00:00
John Resig 627a32cea2 Broke out some of the inline RegExp from css.js. Goes towards fixing #4111. 2009-07-19 16:13:45 +00:00
John Resig 4d1f15c351 Fixed various formatting issues in css.js. 2009-07-19 16:08:17 +00:00
John Resig f57d93bf18 Move cases of .replace(re, Function) out from inline (to avoid being redeclared on every use). Fixes #4114. 2009-07-19 15:57:43 +00:00
John Resig 0ac9898d6b Fixed typo in commit #6461. 2009-07-19 15:51:00 +00:00
John Resig 6d23f2fd81 Made more formatting changes to manipulation.js. Also moved all inline RegExp into a top declaration. 2009-07-19 15:48:30 +00:00
John Resig ec7fdf3723 Tweaked formatting of src/manipulation.js. 2009-07-19 15:29:03 +00:00
John Resig 48e9a39995 Standardize on using .nodeName in place of .tagName. Fixes jQuery bug #4923. 2009-07-19 13:32:53 +00:00
John Resig 0d5c3a68a0 Standardizing on .test() and .exec() - moving away from using .match() for RegExp. Fixes jQuery bug #4113. 2009-07-19 13:21:51 +00:00
John Resig a3b8ac413f Rewrote .offsetParent() to work against the full jQuery set, added tests. Fixes #4922. 2009-07-19 13:04:18 +00:00
John Resig f0681d98fe Made a number of stylistic changes to the offset code (braces, declarations, etc.). 2009-07-19 12:53:39 +00:00
John Resig 9d46c0ebb4 Switching to use a better check for if the node is a document. 2009-07-18 19:44:15 +00:00
Brandon Aaron d828ff75a4 removing ambiguous offset tests for now... results are different due to rendering differences but are correct for the given browser 2009-07-17 22:20:26 +00:00
Brandon Aaron 6504751006 integrated offset tests into main test suite. offset tests now use iframes instead of popups 2009-07-17 22:15:37 +00:00
Brandon Aaron 4edbff9fc1 fix for #4906 2009-07-17 21:08:13 +00:00
Yehuda Katz 1a7f72e7fe Add test for jQuery(jQueryObj) cloning and simplify new get() code 2009-07-17 17:33:44 +00:00
Yehuda Katz 88bd74c732 jQuery objects have a default length of 0. Simplifies $() some. 2009-07-17 01:47:26 +00:00
Ariel Flesler a38a5cd531 jquery core: Simplifying isEmptyObject() and adding tests. 2009-07-16 15:16:44 +00:00
Yehuda Katz 991d039b62 Refactor queueing system to allow auto-dequeuing to use dequeue directly and
therefore require dequeue to always leave the element it has dequeued on
the queue.

  - In the fx queue, a progress sentinel is added when a queue element
    is dequeued.
  - The sentinel is ignored when dequeue is called explicitly
  - When adding a new element to the fx queue, queue() checks if
    the progress sentinel is present. If not, it calls dequeue()
2009-07-16 07:32:39 +00:00
Yehuda Katz 190812c3be Refactor jQuery.data a bit to reduce property lookups
- Also added jQuery.isEmptyObject
2009-07-16 07:32:31 +00:00
Yehuda Katz d36d224cc5 Implemented .data() to get the entire data object. Closes #4284 2009-07-16 07:32:25 +00:00
Yehuda Katz 8e54b167cf Add a test for index() 2009-07-16 07:32:17 +00:00
Yehuda Katz 87869b8b81 Unify .not and .filter (resolves #4200).
- Both now support Function, Element, Selector, and Arrayish (including jQuery object)
2009-07-16 07:32:11 +00:00
Yehuda Katz c10f87120f jQuery.extend(true, Object, Object) copies custom objects correctly.
- Also update jQuery.isObject to handle this case correctly
2009-07-16 07:32:03 +00:00
Yehuda Katz 8d52c27808 jQuery.extend(true, Object, Object) copies objects with length keys correctly 2009-07-16 07:31:55 +00:00
Yehuda Katz 6b912beb7b Clear some dangling whitespace 2009-07-16 07:31:47 +00:00
Yehuda Katz e532dfe522 Add support for .get(-Number) Closes #4188 2009-07-16 07:31:41 +00:00
Yehuda Katz e124fec5e9 Make toArray an alias for .get(). Closes #3999 2009-07-16 07:31:32 +00:00
Yehuda Katz 0e2f4a0fe3 Added gitignore for people using git-svn 2009-07-16 07:31:22 +00:00
John Resig c5315f6687 Scope 'document' locally (also useful for sandboxing). Patch from Andrea Giammarchi. Fixes bug #4905. 2009-07-15 12:35:57 +00:00
John Resig 7a04d1da54 We only support wrapping the first element around an element (all others are ignored). Fixes ticket #4903. 2009-07-14 23:43:58 +00:00
John Resig 991dafae16 Fixed wrapping of elements that hold text nodes. Thanks to David Flanagan for the patch. Fixes #4902. 2009-07-14 23:28:07 +00:00
John Resig ad5ba1a72e Fixed spelling mistake in Ajax tests. 2009-07-14 21:20:16 +00:00
John Resig c3c94823f2 Fixed the handling of .status == 304 in Opera (it always returns 0). Also silently "pass" in Opera 9.6 (which is unable to send the correct headers with setRequestHeader). Follow-up to bug #4764. 2009-07-14 21:13:23 +00:00
Yehuda Katz 89dc1e0143 clearQueue and next should now work with default fx on all browsers 2009-07-13 22:21:40 +00:00
Yehuda Katz 7cfec99858 Uses the more stable font-size as a sentinel 2009-07-13 21:50:58 +00:00
Yehuda Katz c0802e5d21 Test Tweak to normalize the CSS results across browsers 2009-07-13 19:48:08 +00:00
Yehuda Katz 72bb9dfe28 Fix dangling comma of death in data.js 2009-07-13 19:24:44 +00:00
Yehuda Katz 4ae7234736 Updates css() tests to use hex rather than color names 2009-07-13 19:24:23 +00:00
Yehuda Katz 3595102154 Add tests for replaceAll(fn) and wrap(fn) -- mark wrapAll and wrapWithin as TODO 2009-07-12 21:08:54 +00:00
Yehuda Katz 7d7a960035 Support for .foo(Function) and testing. TODO: More tests 2009-07-12 20:19:43 +00:00
Yehuda Katz e8eff25f3b Added test for css(String, Function) and css(Object) where values are Functions; fixed css(Object) 2009-07-12 18:31:26 +00:00
Yehuda Katz d857315967 Add clearQueue for clearing non-fx queues 2009-07-12 15:14:01 +00:00
Yehuda Katz 89b4bc53ca Added a next() shortcut for queues 2009-07-12 14:31:32 +00:00
John Resig 5b84c7c45c IE doesn't seem to like caching fragments that have options in them. Ticket #4883. 2009-07-11 15:23:18 +00:00
John Resig 0c4418bbc4 Limit domManip caching to strings < 512 characters long. Ticket #4883. 2009-07-11 14:50:59 +00:00
John Resig 2a268f5f4b Fixes regression in .attr(), patch by David Flanagan. Fixes #4884. 2009-07-11 13:57:38 +00:00
John Resig 8db967e9d5 Added caching to domManip. Fixes #4883. 2009-07-11 13:49:46 +00:00
John Resig fd2a2fed84 Optimized jQuery(Element) to not call jQuery() twice. 2009-07-11 13:44:44 +00:00
Brandon Aaron bbf3334db1 reverting sizzle updates from previous commit, appears i had an outdated version 2009-06-23 18:14:57 +00:00
Brandon Aaron de07ebc1a0 fix for #4512 and minor sizzle updates 2009-06-23 18:11:09 +00:00
Ariel Flesler c6b9654ea8 jquery core: Closes #2827. jQuery.each iterates over functions 2009-06-20 15:51:19 +00:00
Brandon Aaron ee34b6982a fix for #3533, triggering an event with a colon in the name on a table no longer throws an error in IE 2009-06-17 02:31:45 +00:00
John Resig 739644dce5 Minor tab-spacing tweak. 2009-06-15 13:40:10 +00:00
John Resig 28ab4d3224 Adding support for etags in $.ajax() - and simplified the if-modified-since implementation. Thanks to Lawrence for the patch! Closes ticket #4764. 2009-06-15 13:36:12 +00:00
Jörn Zaefferer 030ae67715 jquery core: removed the version.txt newline; please keep it that way, otherwise that ant replacement fails, it inserts the file content wherever it finds @VERSION 2009-06-04 17:36:23 +00:00
Ariel Flesler 6faf75fb98 jquery fx: Exposing the ticking function 2009-06-02 02:14:58 +00:00
John Resig 89d2f1e851 Reverting accidental test suite corruption from the Sizzle merge. 2009-05-20 21:59:24 +00:00
John Resig 45729831b1 Removed some cases of strict errors. 2009-05-20 21:52:47 +00:00
John Resig 90a87c03b4 Switched to using new Function instead of eval for handling JSON parsing (Fixes bug #4680). Added support for JSON.parse, if it exists (Fixes bug #4429). 2009-05-20 21:28:48 +00:00
John Resig a0451f162e Did some light reordering of the jQuery definition. Moved window and undefined to exist in intro/outro. 2009-05-20 21:12:08 +00:00
Brandon Aaron b97b886fcd fix :hidden and :visible selectors. fixes #4512 2009-05-18 15:36:36 +00:00
Brandon Aaron e10e625bf4 fix for #4183 2009-05-16 20:23:58 +00:00
Brandon Aaron 29411a4405 error case for an ajax test 2009-05-16 20:22:47 +00:00
Brandon Aaron 4a99fcf6e4 fix remove and empty to work properly in IE when an element with the id of length exists. fixes ajax event hanlders in test suite from firing multiple times because they did not get cleaned up. 2009-05-16 19:32:16 +00:00
Brandon Aaron a4a58a3836 prevent fx test html from showing in IE 2009-05-16 17:39:22 +00:00
Brandon Aaron a073ee8596 unit tests for setting cellspacing, rowspan, and colspan 2009-05-16 15:10:24 +00:00
Brandon Aaron fd281e493d fix for #4397 2009-05-16 14:45:46 +00:00
Brandon Aaron ed087197ce tidy up fix for #3981, thanks matt kruse 2009-05-14 18:46:58 +00:00
Brandon Aaron ec3ebd3e8a opacity is now retrieved from stylesheet in IE. fixes #3981 2009-05-14 14:44:31 +00:00
Brandon Aaron b763cc6602 fix regression in removing live events caused by r6324 2009-05-12 15:43:51 +00:00
Ariel Flesler d075072768 jquery event: misc change 2009-05-10 14:38:35 +00:00
Brandon Aaron 09b59038a0 unused, left-over code from r6344 2009-05-07 18:09:17 +00:00
Brandon Aaron c41fab1eb0 another unit test for index method 2009-05-07 16:59:35 +00:00
Brandon Aaron 811891785f .bind() now accepts an optional thisObject as the last argument which is used to change the value of this in event callbacks. fixes #3699 2009-05-07 00:50:28 +00:00
Brandon Aaron 8f042d8be3 fix for #4234. hover can take one function to use for both enter and leave. 2009-05-06 02:17:24 +00:00
Brandon Aaron 3a9c827bf8 fix for #3286 2009-05-06 01:24:22 +00:00
Brandon Aaron 4460d5ad59 unit tests for using jQuery events on non-dom elements. fixes #3439. thanks morgan 2009-05-04 04:54:09 +00:00
Brandon Aaron 31b573185b fix :hidden selector that was accidentally reverted in previous commit, also fixed tests for :hidden selector in IE6 2009-05-04 00:19:57 +00:00
Brandon Aaron d72b8307de fix memory leak in IE 2009-05-04 00:05:04 +00:00
Ariel Flesler c6b59263b5 testrunner: Updating an orphaned test 2009-05-03 17:02:56 +00:00
Ariel Flesler 3a80de1c7a jquery core: $() -> $(document) and $(undefined) -> $([]). Removed a duplicated block. 2009-05-03 15:57:25 +00:00
Brandon Aaron e45b41602f make sure toggleClass does not delete classNames when forcefully removing classes and they are already removed 2009-05-02 22:35:39 +00:00
Brandon Aaron 5e6e53835e toggleClass can now toggle multiple classNames (space seperated list) and toggle the whole className. fixes #3825. 2009-05-02 21:14:38 +00:00
Brandon Aaron d415e0adb8 actually should be 6330, not 6329 2009-05-02 19:23:53 +00:00
Brandon Aaron ffd457d456 index now works in reverse when passed a selector or undefined. fixes #3971 2009-05-02 19:22:55 +00:00
Brandon Aaron cbda6c541b fix global event triggering that i broke in r6323 2009-05-01 00:59:27 +00:00
Brandon Aaron 96fd5f18d4 special event refactor left over code 2009-05-01 00:36:21 +00:00
Brandon Aaron c6db93c373 fix for #2620 2009-05-01 00:21:29 +00:00
Brandon Aaron a4b8fed8ad only copy guid from handler to modifiedHandler if it does not already have one 2009-05-01 00:02:51 +00:00
Brandon Aaron aef1989ba7 live event handlers now receive data from trigger, fixes #4532, thanks nbubna 2009-04-30 21:50:15 +00:00
Brandon Aaron 71efbdd3b2 refactor specialAll into add and remove hooks for existing special events, live now accepts optional data param like bind, fixes #4612 and #4613, thanks to Mike Helgeson 2009-04-30 21:44:25 +00:00
Brandon Aaron 287ecdbf67 event clean up 2009-04-30 01:26:09 +00:00
Brandon Aaron 45b8d2531e enable test for binding events cross-frame that was fixed in r6316 2009-04-29 22:04:41 +00:00
Brandon Aaron 851846aabe .unbind() without any arguments now also unbinds namespaced events. fixes #4609 and #4241 2009-04-29 21:45:58 +00:00
Brandon Aaron 1bd4325cb9 fixing a few more memory leaks in IE 2009-04-22 20:00:30 +00:00
Brandon Aaron 432ea4ca6c offset returns null for window and document elements. fixes #4136 again 2009-04-22 05:29:01 +00:00
Brandon Aaron 6a049246a1 fix for #4216. css now ignores negative numbers for width and height when passed an object of props and vals. 2009-04-22 05:23:53 +00:00
Brandon Aaron 8be5792975 fix for #3546. css now works with other windows than just the one it was loaded in. 2009-04-22 04:39:44 +00:00
Brandon Aaron f5690995dd fix for #4268. bind now works with iframe windows. thanks tr4nslator 2009-04-22 04:18:53 +00:00
Brandon Aaron 3715d73f79 fix for #2911 2009-04-22 02:31:29 +00:00
Brandon Aaron 6a12363f29 remove radix param for parseFloat calls 2009-04-22 01:34:13 +00:00
Brandon Aaron 2adb9b2a0f width, height, scrollLeft, and scrollTop now work with windows and documents other than just the one it was loaded in (like iframes and popups) 2009-04-22 00:55:44 +00:00
Brandon Aaron a0d079f430 clean up offset. #4456 thanks pbcomm 2009-04-21 19:19:28 +00:00
Brandon Aaron 17841ea244 actually don't need to null out as much as i thought i did to fix that memory leak 2009-04-21 19:09:47 +00:00
Brandon Aaron 92a076cb2f fixing memory leaks in IE 2009-04-21 18:46:39 +00:00
John Resig 4130319e97 Added explicit module names to the new unit tests. 2009-04-20 17:05:18 +00:00
John Resig 2764127335 Unified the formatting of core.js. === or !== are used wherever appropriate, syntax has been normalized, braces are added in all cases, and jQuery() now returns an empty set. 2009-03-31 17:35:20 +00:00
Brandon Aaron 2937d645cb fix for #4439, offset.initialize can cause the page to jump 2009-03-30 07:59:31 +00:00
Brandon Aaron 611d24086c fix for #4378, base tag causes javascript error in IE when loading cross-domain JS via ajax 2009-03-27 18:20:57 +00:00
Brandon Aaron f8ef75eb91 remove trailing spaces 2009-03-23 01:55:17 +00:00
Brandon Aaron e06da1724c moving dimension related unit tests to dimensions test module 2009-03-22 23:25:58 +00:00
Brandon Aaron d7d908b05a decoupling styles retrieval from the attr method 2009-03-22 23:25:03 +00:00
Brandon Aaron 9476530fa1 moving some vars from manipulations.js to attributes.js 2009-03-22 15:06:58 +00:00
Brandon Aaron a974b255c3 fix for #4399, removing unused variables 2009-03-22 04:24:40 +00:00
Brandon Aaron 30e760b63f fix for #4189, live/die now work with contexts other than just document 2009-03-20 03:10:07 +00:00
John Resig dae96f552e Added some more information to the unload event cleanup. 2009-03-19 15:16:02 +00:00
Brandon Aaron 10303c37a1 fix for #4115 2009-03-19 03:17:38 +00:00
Brandon Aaron c0cdbf8b94 fix for #4263, better support for nested fixed position elements 2009-03-19 02:54:57 +00:00
Brandon Aaron 7c04a64016 breaking jquery out into smaller modules. added attributes.js, manipulation.js, and traversing.js 2009-03-18 21:15:38 +00:00
Brandon Aaron 2c31a1624f fix for #4374, gap in :hidden, :visible logic 2009-03-18 17:55:07 +00:00
Brandon Aaron 62a251a0cf fix for #4204, fadeTo shows hidden elements before animating 2009-03-18 14:58:06 +00:00
Brandon Aaron ace13387c8 fix for #4074, pass context to jQuery.clean for jQuery.clone 2009-03-18 02:48:32 +00:00
Brandon Aaron e73990a566 fix for #3688, setting type attribute on button causes IE to throw error 2009-03-17 22:27:25 +00:00
Brandon Aaron aabf635cfe using parseFloat for offset and position methods and removed num helper method 2009-03-17 21:07:11 +00:00
Brandon Aaron a37cccc882 return null when no matched elements exist for offset and position 2009-03-17 20:50:17 +00:00
Brandon Aaron 36b4a9ba33 some clean up in the offset method 2009-03-17 20:43:46 +00:00
John Resig 26731d475b Backed out commit [6260], was causing too many problems. We'll have to bite the bullet and assume that the incoming result set has array methods. Un-fixes jQuery bug #4250. 2009-03-17 20:39:29 +00:00
Ariel Flesler 2d4755a0fb jquery dimensions: removed redundant code 2009-03-06 04:23:44 +00:00
Ariel Flesler ece001f139 jquery core: Fixed a typo in a comment, closes #4294. 2009-03-05 13:36:12 +00:00
John Resig 6914fc2969 Removed the objectAll check from jQuery.support, was causing problems with broken ActiveX controls. Fixes bug #4017. 2009-02-28 20:28:45 +00:00
John Resig f1f5cd9f6a Simplified the structure of the .css() and .attr() methods (reducing the number of calls). Need to optimize $.css/$.curCSS/$.attr still. Fixes #4269. 2009-02-28 20:23:48 +00:00
John Resig 1c8c3883a9 Moved to a generic solution for copying methods over for querySelectorAll-using browsers. 2009-02-27 15:20:59 +00:00
John Resig 985856b823 No longer use arguments.callee or RegExp (use new RegExp, instead) for ES 3.1 and Caja compatibility. Fixes jQuery bug #4251. 2009-02-26 18:00:41 +00:00
John Resig 410e13b400 As it turns out, the context was being started at a higher root than needed - fixing this speeds up > selectors. 2009-02-26 01:15:54 +00:00
John Resig 58235cc38e Removed the need for the results set to have array methods. Resolves jQuery bug #4250. 2009-02-25 18:41:29 +00:00
John Resig f094c803de Made some changes to how .find() works, inlined the duplicate check - should change other methods to act similarly. Goes towards fixing #4240. 2009-02-25 18:29:18 +00:00
John Resig 4bbb70b4eb Simplified the isXML function, no need to use recursion. 2009-02-25 15:37:09 +00:00
John Resig 1c5db3baba Expose the sort/unique code from Sizzle as Sizzle.uniqueSort(). 2009-02-25 15:19:08 +00:00
John Resig 85e0945718 Cut down on some more function calls for jQuery(...). Everything points back to the same root jQuery(document) object now. Going towards ticket #4240. 2009-02-25 14:23:25 +00:00
John Resig 041fd5f2b5 Reduced the number of function calls required for .find() (single element root), optimized some calls to jQuery() as well. Goes towards fixing #4240. 2009-02-25 04:57:00 +00:00
John Resig 9c0ddfa2ad Landed some improvements for improving the performance of ID-rooted queries (e.g. '#foo p'). Fixes jQuery bug #4236. 2009-02-25 04:08:04 +00:00
John Resig cb3f842c88 Overhauled the .remove() and .empty() methods to be much more efficient. Fixes bug #4222. 2009-02-23 16:32:45 +00:00
Ariel Flesler 48164ee603 jquery event: Fixing event.currentTarget for live(). 2009-02-23 13:27:48 +00:00
John Resig 883450b702 Tagged the Sizzle 1.0 release. 2009-02-20 19:52:38 +00:00
John Resig a37ca9e905 Made sure that .remove now uses multiFilter. Fixes bug #4205. 2009-02-20 19:45:29 +00:00
John Resig db62240fcf Bumping the version up to 1.3.3pre. 2009-02-19 22:41:33 +00:00
John Resig fef476def3 Tagging the 1.3.2 release. 2009-02-19 22:34:21 +00:00
John Resig db8623ebc8 Fixed one of the selector tests that was reporting incorrectly in browsers that actually supported type="search" inputs. 2009-02-19 21:35:33 +00:00
John Resig 2a600c13ef Disabled some of the animation tests that were being flaky. 2009-02-19 21:30:25 +00:00
John Resig 3e6c7f083c Missed an other search-related test. 2009-02-18 21:57:46 +00:00
John Resig 481171a3f8 Fixed some tests that were changed (fixed!) by fixing #3966. 2009-02-18 19:59:51 +00:00
John Resig ca79d866fe Made it so that search input elements are now serialized. Fixes bug #4107. 2009-02-18 19:43:14 +00:00
John Resig 75a973da35 Made it so that appendTo, etc. return the inserted elements (thus using pushStack, as well). Fixes bugs #3966 and #4182. 2009-02-18 16:29:43 +00:00
John Resig 3e46bce751 A speedup for .remove() (which also speeds up .html()). Fixes #4178. 2009-02-18 02:40:55 +00:00
John Resig 1ac087f6f9 Updated the show() tests to work without the use of jQuery.browser (the test suite now passes 100% in IE8). 2009-02-17 22:22:05 +00:00
John Resig b536d2ac67 Reorganized and disabled some of the height/width tests. Need to look in to better abornormal-padding/margin/border support at some point. 2009-02-17 22:15:42 +00:00
John Resig 1a65eb2a09 Updated the JAR Makefile command to support UTF-8. 2009-02-17 21:56:42 +00:00
John Resig b1a40c9bfd Disable building the lite and packed versions of jQuery by default (no longer needed). 2009-02-17 21:56:13 +00:00
John Resig d8b3bd700f Switch to using createRange for element comparision instead of Array indexOf checks - thanks for the tip, Ioseb. 2009-02-17 17:51:50 +00:00
John Resig 4b7e1c906f Brought back the compareDocumentPosition code. While it is redundant in Firefox it's much faster than using indexOf. 2009-02-17 17:43:05 +00:00
John Resig 8d9aa015c1 Changed the currentTarget test - no need to test the native event triggering for this test. 2009-02-17 17:22:59 +00:00
John Resig 80782d958c Changed some of the fx/stop tests to handle the new test markup. 2009-02-17 16:39:33 +00:00
John Resig 4a4d049df9 Made the div showing a little more explicit - making sure that it doesn't affect the fx tests. 2009-02-17 16:22:41 +00:00
John Resig f20c974644 Tweaked some of the selector tests to handle some of the test page changes. 2009-02-17 15:58:11 +00:00
John Resig f89f5eb61f Reorganized some of the animation tests to work with the new hide/show changes. 2009-02-17 15:54:27 +00:00
John Resig 7b5cfb78ec Disabled one of the ordering tests that was taking a while to run. 2009-02-17 14:13:39 +00:00
John Resig 10ab08de43 Fixed some more CSS/visibility tests. 2009-02-17 14:08:11 +00:00
John Resig ad7577a084 Changed a bunch of the DOM tests to work in Document Order. 2009-02-17 14:05:25 +00:00
John Resig 6bd6a4e059 Updated some of the display/visible/hidden tests to work on an appropriate element. 2009-02-17 13:57:28 +00:00
Ariel Flesler 63f8bb7027 testrunner: Misc 2009-02-17 12:42:46 +00:00
Ariel Flesler 0a1b0db347 jquery event: closes #4033. e.currentTarget wasn't being enforced for native events (IE doesn't have it) 2009-02-17 12:38:16 +00:00
Brandon Aaron 72cf42bcbd fix show issue in IE 6. "olddisplay" is sometimes undefined and IE 6 does not like setting style.display to undefined. also second for loop was mistakenly nested within the first for loop. 2009-02-16 21:20:51 +00:00
John Resig f93df73a76 Bumping the version up to 1.3.2pre. 2009-02-16 18:25:37 +00:00
John Resig 048fc4555f Added support for class selectors and class attribute selectors on XML documents. Fixes jQuery bug #4167. 2009-02-16 18:23:59 +00:00
John Resig 8533da939d Fixed an issue with :nth-child selectors embedded in :not() filters. Fixes jQuery bug #4156. 2009-02-16 17:58:33 +00:00
John Resig a720bb31ab Changed the jQuery hidden/visible selectors to be a little more precise. 2009-02-16 15:55:06 +00:00
John Resig e25c4a132f Change the behavior of how :visible and :hidden work. :hidden is when an element is display none, a parent element is display none, or the element has a width of 0. :visible is when the element is not display none and all of its ancesotrs are not display none and its width is larger than 0. Fixes jQuery bugs #1349, #3265, and #3895. 2009-02-16 15:52:15 +00:00
John Resig 5586fedf29 Fixed a bug with certain + selectors failing (Fixes jQuery bug #4023). Also tweaked the + and > functions a little bit. 2009-02-16 15:36:42 +00:00
John Resig f0189d6181 Fixed the issue where weird characters were being used in ID selectors. Fixes jQuery bug #3913. 2009-02-15 22:46:54 +00:00
John Resig 22c9c9b9d3 Make sure that [name=FOO] searches actually have the specified name (IE includes elements that have the ID, as well). 2009-02-15 22:33:19 +00:00
John Resig 20827707a9 Added fixes for two different :not() bugs. One with p:not(p.foo) failing and another with a weird combination of multiple selectors and filters. Fixes jQuery bug #4101. 2009-02-15 21:13:33 +00:00
John Resig f9a7cfacf7 Updated the copy of jQuery and added some more context tests. 2009-02-15 18:20:01 +00:00
John Resig 87b3ea4bc9 Added some extra methods for making result set merging easier. 2009-02-15 18:09:34 +00:00
John Resig 21dde30348 Provide a graceful failover for [name=foo] queries that are looking for non-input/iframe/form elements. Fixes jQuery bug #4081. 2009-02-14 22:24:55 +00:00
John Resig 782b4af76e The compareDocumentPosition check was extraneous - indexOf works in all the other browsers that we need to support. 2009-02-14 22:18:02 +00:00
John Resig 6f4b08cdf9 Added support for sorting in Safari - when querySelectorAll isn't able to be used. 2009-02-14 18:10:45 +00:00
John Resig d75c899fe7 Duplication checks are now handled directly in Sizzle, no need to do extra work in .find(). 2009-02-14 17:25:33 +00:00
John Resig 868f262eed Disabled expando selector tests - they don't work in all browsers. 2009-02-14 17:13:08 +00:00
John Resig 7421f34284 Oops, the sourceIndex of the documentElement in IE is 1, not 0. 2009-02-14 17:06:30 +00:00
John Resig e16c7fe0f8 Make sure that elements are returned in document order - and that the results are unique. 2009-02-14 16:59:10 +00:00
John Resig 848c45ea17 Added some significant speed-ups to height/width checks, thanks to some code and investigation by Mike Helgeson. Fixes #3082. 2009-02-13 22:58:57 +00:00
John Resig 7f1eb1c14f Landing a fix for a case where the animation timer wasn't getting stopped (thanks Arrix). Fixes bug #4001. 2009-02-13 16:15:23 +00:00
John Resig 831b15b06c Merging a bunch of changes back from Sizzle, by LosTFx. 2009-02-10 00:28:38 +00:00
John Resig 9aa0c69c43 Fixed bubbling of live events (if an inner element handles an event first - and stops progatation - then the parent event doesn't encounter the event). Thanks to Irae for the patch. Fixes bug #3980. 2009-02-09 23:29:57 +00:00
John Resig 0ae78024c2 Added a performance improvement to .hide()/.show() that helps to prevent constant reflows from occurring. Fixes #4038. 2009-02-09 15:58:12 +00:00
John Resig 136a459f4c Optimized the clean() code to no longer use .trim() (speeds up working against long HTML in IE). Fixes #4037. 2009-02-09 15:41:50 +00:00
John Resig 6b938e1c16 Removed use of .trim() in globalEval, fixes #4036. 2009-02-09 15:35:33 +00:00
John Resig b16da9d762 Reworked the attribute selection code to be able to select false-y values - and added some tests to verify that they work well against expandos. 2009-02-09 15:18:07 +00:00
John Resig ab74ce7b57 match[4] is already saved in check - thanks Balazs. 2009-02-09 15:01:23 +00:00
John Resig ce90accc58 Reworked the .clone() function in IE. Fixes jQuery bugs #3500 (jQuery expandos were causing extra elements to appear from using .html() cloning), #3254 (Mis-match in clone result length causes problem), and #2845 (Cloning an <object/> causes exceptions to be thrown). 2009-02-09 14:48:15 +00:00
John Resig f38648c7cd Added a fix for empty attribute selection values. Fixes jQuery bug #3990. 2009-02-07 17:41:30 +00:00
John Resig 31597b7b3c Adding a tweak to prevent layout breaks in the boxModel check on IE 6. Fixes bug #4014. 2009-02-07 17:15:01 +00:00
John Resig a894c60489 Stopped a memory leak on getScript calls. Fixes #3962. 2009-02-07 16:57:59 +00:00
John Resig 2b7642cff0 Added logic for not using getElementsByClassName in different failure states. Fixes jQuery bugs #4058 and #4042. 2009-02-07 16:54:11 +00:00
John Resig ce00f88ae2 Added a fix, suggested by Diego, for IE firing the ready event too late. Fixes bug #3988. 2009-01-28 22:38:00 +00:00
John Resig d1a34f7908 Made the getAttribute check more explicit - comment nodes don't have getAttribute in XUL documents. Fixes jQuery bug #3870. 2009-01-23 19:36:59 +00:00
John Resig 2ff3e49279 Tagging the 1.3.1 release. 2009-01-22 01:42:16 +00:00
John Resig 8b79ea1365 Tagging the 1.3.1rc1 release. 2009-01-22 00:30:13 +00:00
John Resig 5143ecbc58 Bumping Sizzle version to 0.9.3. 2009-01-22 00:29:04 +00:00
John Resig b438d83916 Tweaked one of the selector tests. 2009-01-22 00:11:11 +00:00
John Resig 68b49cf427 Added some additional checks to make sure that the correct methods are being used in IE on XML documents. 2009-01-21 23:56:15 +00:00
John Resig 58a17e6e6d Bumping the version of Sizzle up to 0.9.2. 2009-01-21 23:33:01 +00:00
John Resig d45f193948 A follow-up for bug #3945. ID selectors don't work in querySelectorAll on XML documents, so we just fall back to the normal engine. 2009-01-21 23:31:29 +00:00
John Resig 7d9d210540 Make sure that [name=foo] and #id selectors don't use the native methods on XML documents (since id and name attributes may not be defined by a DTD and will return nothing instead. Fixes jQuery bug #3945. 2009-01-21 23:19:30 +00:00
John Resig f9a5849723 Now handle the case where Safari's querySelectorAll fails on uppercase characters in quirks mode. Added a test to check for it and re-worked some of the existing tests to better handle document order issues. Fixes jQuery bug #3840. 2009-01-21 22:57:07 +00:00
John Resig 9b3804a8ec After discussing it with a number of users I've decided to revert the change to [name!=value]. It is now equal to :not([attr!=value]). Attempting to switch it to [attr]:not([attr!=value]) produced some really non-obvious results and confused users. Fixes jQuery bug #3884. 2009-01-21 22:36:21 +00:00
John Resig 626961c4a5 CHILD positions were being cached improperly. Tweaked it and added a test to make sure it doesn't happen again. Fixes jQuery bug #3924. 2009-01-21 22:01:50 +00:00
John Resig 00b70c7527 Landed a fix for timeouts not being aborted properly. Fixes jQuery bug #3874. 2009-01-21 21:46:53 +00:00
John Resig db10da345e Fixed a missing semicolon. Fixes jQuery bug #3927. 2009-01-20 19:58:19 +00:00
John Resig 0468e31bf7 Added a performance improvement to preFilter.CLASS from LosT on the Sizzle.js mailing list. 2009-01-20 19:47:15 +00:00
John Resig aa7616cf9a Added support for a[name^='foo['] style selectors. Fies jQuery bug #3928. 2009-01-20 19:44:08 +00:00
John Resig cd28922b78 Made sure that .removeClass(null) doesn't throw an exception. Fixes #3847. 2009-01-20 17:33:25 +00:00
John Resig a78557472c Focused support of .live(). stopPropagation and stopImmediatePropagation are not supported - and do not do what the use would expect. 2009-01-20 17:25:37 +00:00
John Resig 28a1f02223 Re-worked the logic for where .selector and .context are added for ID selectors (especially ones that aren't found). Fixes jQuery bug #3833. 2009-01-20 16:00:48 +00:00
John Resig 7647cebc39 Added some missing spaces - helps to calm XHTML error messages in Safari. 2009-01-20 15:46:40 +00:00
John Resig 4e7d565e50 Added two more tweaks for XHTML core tests. 2009-01-19 23:33:46 +00:00
John Resig 9db710a156 Made some tweaks to the core tests so that they'll run better under XHTML. 2009-01-19 23:22:25 +00:00
John Resig 04977b8ea2 Brought the logic for handling isXMLDoc over from Sizzle. 2009-01-19 23:17:30 +00:00
John Resig 6799982835 Made sure that a child element exists before the check is done, fixes jQuery bug #3870. 2009-01-19 23:04:03 +00:00
Ariel Flesler 735d44f6df jquery event: closes #3843. Some events' timeStamp are wrong on Firefox, we don't rely on the native value anymore. timeStamp reflects object creation, not last event triggered. 2009-01-19 22:20:25 +00:00
John Resig 82e8d11c12 Re-worked the logic for handling isXML detection. 2009-01-19 21:57:18 +00:00
John Resig 96152559e0 Landing a fix for non-link anchor tabIndex (from scott.gonzalez). Fixes ticket #3916. 2009-01-19 21:40:23 +00:00
John Resig d6e541426d Fixed the logic for determining if an XML file is being used. Fixes jQuery bug #3896. 2009-01-19 18:56:02 +00:00
John Resig 1d513efd3c Added a way to run the test suite as an XHTML page. 2009-01-19 18:14:51 +00:00
John Resig 8e8d7ade43 Merged some recent fixes in from Sizzle. 2009-01-19 18:09:11 +00:00
Jörn Zaefferer cde93dc547 core: ant build - add Date and Revision to to header (just like make build) 2009-01-18 13:30:09 +00:00
Jörn Zaefferer 2f536b3d4d core: replaced version.js build script in ant build; wasn't used in make anymore anyway 2009-01-18 13:04:32 +00:00
John Resig f3e5e9a3d5 Updated License Year, fixes #3871. 2009-01-17 22:25:18 +00:00
John Resig c2fad371f1 Made the IE frameElement check more explicit. Fixes #3880. 2009-01-17 22:04:23 +00:00
Ariel Flesler 34a9f8a210 jquery fx: sync animations were being left on jQuery.timers (double callback)
jQuery.timerId is now a local var and it's not null'ed anymore.
2009-01-14 23:09:52 +00:00
Jörn Zaefferer f649acd8ab core: Ant target to generate openAjaxMetadata; uses http://www.exfer.net/jquery/createjQueryXMLDocs.py to get the data from the wiki, and transforms it using xslt (see build/style.xsl) 2009-01-14 22:43:55 +00:00
Jörn Zaefferer 82958c79ff core: removed newline from version.txt, easier to use it via Ant then 2009-01-14 22:42:55 +00:00
Jörn Zaefferer 9155d298ae core: removed outdated docs target from makefile 2009-01-14 22:42:21 +00:00
John Resig 263efad50f Updating the version to 1.3.1pre. 2009-01-13 17:52:45 +00:00
John Resig 9988e3877b Tagging the 1.3 release. 2009-01-13 17:50:31 +00:00
John Resig 6dc30ae7f6 Merged Sizzle changes back into jQuery. 2009-01-13 16:40:19 +00:00
John Resig d5858c7cb8 Added a trailing / in the innerHTML support test to allow it to not
throw an error in XHTML documents. Fixes #3829.
2009-01-13 15:08:11 +00:00
John Resig 9c029f1687 Updated the benchmarking utility to use the Yahoo homepage and a bunch of new selectors. 2009-01-12 18:22:44 +00:00
John Resig 944484c3fe Merged in from Sizzle - a change to child filter selector logic. 2009-01-12 16:02:55 +00:00
John Resig 95094d1685 Merged in a fix from Sizzle for :not(:first). 2009-01-12 14:45:58 +00:00
John Resig ea78377760 Only try to wrap the element if it's not disconnected, fixed #3828. 2009-01-12 14:07:14 +00:00
John Resig 0c97178553 Fixed an issue with parentNode being accessed in attr() on disconnected DOM elements. 2009-01-12 14:00:35 +00:00
John Resig af1b9994a4 Updating the source version to 1.3rc2. 2009-01-12 02:08:37 +00:00
John Resig 869afc46cd Tagging the 1.3rc1 release. 2009-01-12 02:05:50 +00:00
John Resig aa29b8e3bc Had to remove the global variable tricks (especially the delete window calls) as they cause
exceptions in IE. Also fixed a faulty test that assumed the order of Ajax function callbacks 
would be consistent.
2009-01-12 01:12:58 +00:00
John Resig 7623702565 Tweaked the benchmark tests. 2009-01-12 00:24:36 +00:00
John Resig 1eae1541b8 Made a note about the push method. 2009-01-12 00:24:16 +00:00
John Resig fa615bedd4 Made the case specific of the type attribute. 2009-01-11 21:22:37 +00:00
John Resig 2e42c5b044 Merging the latest from Sizzle. 2009-01-11 19:45:04 +00:00
John Resig 73ff49ac9a Prevented non-script <script> blocks from executing, fixing #3733. 2009-01-11 19:33:01 +00:00
John Resig 9d997a81e2 Forgot to change the build.xml file as well. 2009-01-11 16:19:11 +00:00
John Resig 7346a476cc Fixed boxModel support - is now computed with feature detection, rather than sniffing. 2009-01-11 16:17:20 +00:00
John Resig 0066ba3f82 .closest() with positional selectors wasn't worked as expected. 2009-01-10 20:30:03 +00:00
John Resig b1018cad12 Landed a fix for when a DOM element gets accidentally removed by another live event handler. Thanks to Irae for the patches. Fixed #3820. 2009-01-10 19:57:07 +00:00
John Resig 29bf601f34 Fixed an issue with script nodes being removed incorrectly, fixes #3737. 2009-01-10 01:07:59 +00:00
Ariel Flesler afb05081c0 testrunner: Putting back the global variables used for ajax tests. I added many calls to delete though. The global namespace must be cleaned up before calling start() again. 2009-01-10 00:16:48 +00:00
Ariel Flesler d62875fb01 testrunner: Removing every global variable leaked within (and outside) tests. Some were deleted and some saved within the jQuery namespace. 2009-01-09 23:49:18 +00:00
John Resig ec7baf230d Didn't get specific enough with the proxy guid, fixes #3787. 2009-01-09 22:14:48 +00:00
John Resig d12e8a34e6 Made it so that you can bind a single function to multiple .live() selectors. Additionally, simplified the proxy code to provide a default proxy function.
Fixes #3787.
2009-01-09 22:10:42 +00:00
Ariel Flesler eced38a30d testrunner: refactored unbind's tests. Including one for #3538, passing since last commit. 2009-01-08 22:22:33 +00:00
Ariel Flesler 6898cd6d2a jquery event: Fixes #3538. unbind on many events was failing. 2009-01-08 22:21:16 +00:00
John Resig c6f189ac73 Selector state wasn't being passed along on a cloned jQuery object. 2009-01-08 21:41:58 +00:00
Scott González 49d0d5b7a3 Fixed tabindex normalization so that elements that natively support tabbing, but don't have a tabindex explicitly set return 0 instead of undefined.
Removed jQuery.support.tabindex since we're only normalizing non-XML right now and all browsers support tabIndex for HTML documents.
2009-01-07 14:36:30 +00:00
John Resig f9e0b1ed7a Merged in a missing argument from Sizzle. 2009-01-07 14:31:28 +00:00
John Resig d8706c5ac9 Landed a number of improvements to the selector engine. Results are auto-merged onto the jQuery
object, class filtering is now done inline, and not filtering is more efficient.
2009-01-07 00:13:57 +00:00
John Resig ef661a50b9 Removed all uses of @ in the benchmarker and added a couple :not() tests. 2009-01-06 20:23:44 +00:00
John Resig dcbec1f498 Cleaned up the benchmarking utility (using a newer version of jQuery and fixing the runner). 2009-01-06 16:19:55 +00:00
John Resig cc70e03ec7 Made the .unqiue() within .find() optional (speeds up calls). 2009-01-06 16:17:50 +00:00
John Resig c786f1097e Tagging the 1.3b2 release. 2009-01-05 23:33:56 +00:00
Ariel Flesler 2a81c359d5 jquery selector: Replacing {0,1} for ? in a regex. 2009-01-05 23:19:58 +00:00
John Resig b1e161466c Disabled an extra event binding. 2009-01-05 23:06:57 +00:00
John Resig 1822939000 Switched back to the old style of running embedded scripts (users who have duplicate runs will
have to deal with it another way).
2009-01-05 22:58:02 +00:00
John Resig 45b3a884d5 Timeout test appears to be flaky - disabling, for now. 2009-01-05 22:14:26 +00:00
John Resig 60226c8a30 The timeout test was waiting for 10 seconds - unnecessary, lowered it to 1 second. 2009-01-05 22:05:59 +00:00
John Resig 4503457616 Oops, order of operations. 2009-01-05 22:02:20 +00:00
John Resig 089da4ea77 Brought in a fix from Sizzle - IE doesn't have .contains on XML elements. 2009-01-05 21:59:07 +00:00
John Resig d3141dcdba Simplified the XML clone test. 2009-01-05 21:56:35 +00:00
John Resig c6de039bb1 Simplified the XML selector test (save the result). 2009-01-05 21:04:15 +00:00
John Resig f796ad14fd Fixed an issue with how broken selector tests were handled in IE (the exception was misdirected). 2009-01-05 20:43:58 +00:00
John Resig 69e86d4f98 The triggered flag was being set too early, which was preventing bubbling form working when a
native event existed.
2009-01-05 20:43:24 +00:00
John Resig ebd9205fdb Make sure that if no ownerDocument is available that we fall back to the node itself (likely the document). 2009-01-05 19:22:25 +00:00
John Resig 122b672f70 Landed cross-browser support for tabIndex, by Scott, closes ticket #3649. 2009-01-05 17:34:42 +00:00
Ariel Flesler 42c99472cc jquery event: Removed a needless if (old code) 2009-01-05 13:31:21 +00:00
Ariel Flesler 0c1653249a jquery intro: looks nicer when built 2009-01-05 12:09:04 +00:00
Ariel Flesler e216243a03 jquery fx: Shortening the code additions on [6037]. 2009-01-05 12:05:38 +00:00
John Resig 558d03f24c Merging from Sizzle (fixed a bug when querySelectorAll is used. 2009-01-05 02:45:20 +00:00
John Resig 4694e537bc Forgot to merge in some of the new tests from Sizzle. 2009-01-05 01:24:14 +00:00
John Resig cc66e6affe Made hide, show, toggle, slideUp, slideDown, and slideToggle animate margins and paddings in addition to height, width, and opacity (results in a much-smoother animation). 2009-01-05 01:14:36 +00:00
John Resig 19a3ea2c7f Accidentally left in an extra echo statement in the Makefile. 2009-01-05 00:34:40 +00:00
John Resig 989667c9fd Synced with the Sizzle repository. 2009-01-05 00:21:13 +00:00
John Resig d1146aa7bf .live("div div") was failing due to the extra space in the selector (which conflicted with multiple event binding in .bind). 2009-01-04 23:58:43 +00:00
John Resig 192d6cd4a3 Moved the copyright to the intro file, added a ! so that it passes through YUIMin untouched, and changed the Date and Revision so that they're now generated automatically based upon all of jQuery rather than just the core file. 2009-01-04 23:34:18 +00:00
Ariel Flesler 9472728bce jquery event: event.stopImmediatePropagation() stops live handlers as well. 2009-01-04 22:32:18 +00:00
Ariel Flesler 83be3dca69 jquery core: Misc file size optimizations. 2009-01-04 22:25:46 +00:00
Ariel Flesler ddec4fdc34 jquery ajax: File size optimization for compressed code. 2009-01-04 21:15:02 +00:00
Ariel Flesler 0eaead0b91 jquery core: Allowing whitespaces within the [6026] addition. 2009-01-04 21:09:03 +00:00
John Resig 12166e9bb2 Changed build.xml to use YUICompressor, fixes #3779. 2009-01-04 17:21:00 +00:00
John Resig 434b87b8a2 Moved from the old JSMin to using YUIMin for compressing the jQuery source. Additionally landed some improvements from #3770 which dramatically reduce the filesize. The final minifed + gzipped size of jQuery went from 19817 bytes to 18063 bytes. 2009-01-04 15:29:27 +00:00
John Resig c0294278db Landed a proper fix for #3255 - which involves doing createElement instead of going through the normal clean method. 2009-01-03 00:51:07 +00:00
John Resig cff37cc835 Hid an issue where Safari through an exception when a colgroup was created in jQuery.clean. Not completely sure what the cause is, yet. 2009-01-03 00:19:02 +00:00
Ariel Flesler 303ad32c74 jquery event: Misc, removed a commented line from last commit. 2009-01-02 23:44:06 +00:00
John Resig b2583a7526 Fixed an issue that was introduced by [5743] (which didn't have a test case, either - that has been resolved). This fixed #3739. 2009-01-02 23:32:10 +00:00
Ariel Flesler b2552e6ea3 jquery event: Now using an internal argument to detect if bubbling on $.event.trigger. The other would fail when it receives an event object with target. Also, the target isn't nulled anymore.
In addition, there was a lot of code running O(n) during bubbling while not needed.
2009-01-02 23:07:16 +00:00
Ariel Flesler 989e3f61f7 jquery event: closes #3772. The extra function on $.event.trigger isn't supported anymore. 2009-01-02 22:23:52 +00:00
John Resig d20e7fede1 Disabled testing of em-defined borders, need to look back into this issue. 2009-01-02 19:25:54 +00:00
John Resig c59bf424a1 The exact escaping of the text() test isn't important - as long as < is escaped. 2009-01-02 19:23:12 +00:00
John Resig 6a3d1a1e28 Fixed an issue with .not("#foo, bar") not working correctly, closes #3757. 2008-12-31 19:21:24 +00:00
Ariel Flesler c7a14f1391 jquery event: event.timeStamp wasn't being created when passing just the type to the constructor.
Misc: Simplified the readyList execution code.
2008-12-31 03:36:51 +00:00
Ariel Flesler c0446c70d5 jquery event:
* event objects have isDefaultPrevented, isPropagationStopped and isImmediatePropagationStopped methods.
* Removed donative and dohandlers from $.trigger
* event.result carries the last returned data from a handler(not undefined).
* $.trigger doesn't keep bubbling if stopPropagation() is called.
* Same event object is used all along for global trigger
* Fixed the bug where target doesn't change when triggering on many elements.
* The data array on $.trigger was accumulating objects as it bubbles.
testrunner: adding more tests
2008-12-31 02:58:13 +00:00
Ariel Flesler 0a846e5be6 jquery event: removed the argument dohandlers from $.trigger. Uses another approach. 2008-12-30 23:29:14 +00:00
Ariel Flesler 7138cf0ce0 build: Closes #3760. Adding the data module to the build file. Thanks Cloudream. 2008-12-30 22:05:45 +00:00
John Resig 4f7441910f Made sure that return false works in .live() along with the event object being passed in as the first argument. 2008-12-30 20:45:33 +00:00
Ariel Flesler a1ca9427ec jquery data: Fixed a weird patch merging issue from [6011] 2008-12-30 02:43:14 +00:00
Ariel Flesler a09dac4406 jquery data: Oops.. forgot to commit the new data module. This is part of [6010]. 2008-12-30 02:40:04 +00:00
Ariel Flesler 4afa608351 jquery data: Closes #3539. Exposed jQuery.queue. Moved all the data and queue functions to their own module. Made the dequeue function more generic(designed to be used on functions). Closes #3748. Reverted a previous modification. 2008-12-30 02:31:26 +00:00
Ariel Flesler 1b0276dc57 jquery support: Closes #3758, fixes a memory leak on IE. Thanks Choan Galvez. 2008-12-29 22:05:02 +00:00
Ariel Flesler 4f99e793fa jquery event: jQuery.Event can be instantiated without the 'new' keyword. 2008-12-29 21:57:29 +00:00
Ariel Flesler d37aeceb69 jquery core: Removed an orphaned line. Thanks mose. 2008-12-27 18:21:54 +00:00
Ariel Flesler 51428a3c9e jquery core: Fixed a global var leak introduced by me on a recent commit. 2008-12-26 15:48:04 +00:00
Ariel Flesler 4ca4ce52f7 jquery event: Closes #3662. Adds a jQuery.Event class. Makes trigger and fix simpler. Adds currentTarget attribute to event objects. Event object isn't passed as part of data. 2008-12-25 21:44:54 +00:00
Ariel Flesler 8cd50a398d jquery core: Closes #3737. Fixed a possible null dereference. 2008-12-25 21:20:41 +00:00
Ariel Flesler eff400e44f jquery selector: Removed a needless line (related to [5992]). 2008-12-25 21:09:08 +00:00
Ariel Flesler e4d8365ec7 jquery fx: Fixed redundant code 2008-12-25 21:00:08 +00:00
Ariel Flesler 654d946ead jquery fx: Closes #3219. jQuery.fn.toggle can accept a boolean argument indicating show/hide. 2008-12-25 20:13:42 +00:00
Ariel Flesler 0a8f96ac3d jquery core: Closes #1681. jQuery.fn.toggleClass can accept a boolean argument indicating add/remove. 2008-12-25 20:12:18 +00:00
Ariel Flesler 0e3e470edc jquery core: Closes #3255. The div used in jQuery.clean is emptied in the end. Cleaning the parentNode's properties of the elements. 2008-12-25 19:47:56 +00:00
Ariel Flesler 4b25b147ab jquery core: Closes #3641. jQuery.merge stopped looping once a 0 was found. 2008-12-25 19:25:30 +00:00
Ariel Flesler 5459180728 jquery core: Closes #3666. Removed old code. 2008-12-25 17:37:58 +00:00
John Resig 53e9fb9496 Bumped the version number to 1.3b2pre. 2008-12-22 17:34:34 +00:00
John Resig df1f656aae Tagging the 1.3b1 release. 2008-12-22 17:31:22 +00:00
John Resig 47aed822a4 Synced with Sizzle codebase (which removed the use of the caching code). 2008-12-22 16:41:14 +00:00
John Resig 77477d5634 Disabled native event triggering (and, thus, bubbling) for global events. 2008-12-22 14:47:34 +00:00
John Resig c03a280155 Added a new liveQuery/event delegation hybrid method: .live and .die. Easily adapts event delegation to the jQuery style. $("div").live("click", fn); $("div > #foo").live("submit", fn); $("div").die("click"); 2008-12-22 04:59:34 +00:00
John Resig 67ded9a36a Made sure that the correct event.taget is being used in event bubbling. 2008-12-22 02:02:05 +00:00
John Resig 25885e07b2 Added support for bubbling triggered events. 2008-12-22 01:57:06 +00:00
John Resig 6b09032864 Added support for the new .closest() method (very useful for event delegation). 2008-12-22 00:52:53 +00:00
John Resig c9dd5d9972 Oops, forgot to commit support.js. 2008-12-21 23:06:42 +00:00
John Resig b850ab2b8e Added the new jQuery.support object and removed all uses of jQuery.browser from within jQuery itself (while simultaneously deprecating the use of jQuery.browser). 2008-12-21 21:22:44 +00:00
John Resig 8ee1708ea9 Fixed an issue with domManip where the incorrect document was being used to create the document fragment. 2008-12-21 21:18:40 +00:00
John Resig 6048e40a45 Syncing Sizzle codebase. 2008-12-20 22:45:11 +00:00
John Resig 6f2f1830a4 Added a missing semicolon. 2008-12-20 14:39:36 +00:00
John Resig c85243dfc4 Landing the new Sizzle selector engine. There'll need to be some later tweaks (to make the tests a little more pragmatic - especially for document order elements). But it appears to be passing well and that's enough. Closes #3563. 2008-12-20 01:19:17 +00:00
John Resig 5c1725d689 Rewrote the hide and show methods to fix the issue with Safari not hiding distached elements. Fixed #1239, #2233, #3038, #3343, #3395. They're also faster now, as well. 2008-12-19 18:21:12 +00:00
John Resig 18ee5a93a2 Fixed an issue with domManip where the incorrect clone fragments were being used for elements. 2008-12-19 06:58:18 +00:00
John Resig 80a6a91347 Fixed a problem with multi-namespaced events not targetting the correct functions for execution. 2008-12-19 06:49:44 +00:00
John Resig 62bd7e6817 Fixed an issue with how .data() was expecting output (trigger now returns exact output - or null if none is provided, which was tripping it up). 2008-12-19 06:49:03 +00:00
John Resig 46ee77bcc3 Fixed line-ending issue. 2008-12-19 05:43:37 +00:00
John Resig 3963fcb30d Tweaked mis-numbered makeArray test. 2008-12-19 05:42:15 +00:00
John Resig 132b8de614 Switched to using DOM Fragments in domManip. 2008-12-19 04:37:54 +00:00
John Resig 2875460f63 Added selector path logging (creates a trail that plugins can use). 2008-12-19 04:37:10 +00:00
John Resig 0935f4a0b1 Removing remaining strict-mode warnings. 2008-12-19 04:36:28 +00:00
John Resig 77344f4c50 Added support for multiple-namespaced events (in bind, trigger, and unbind). 2008-12-19 04:34:12 +00:00
John Resig 4c1e12e889 Simplifying the DOM ready code, no longer attempting to handle stylesheet loading. Closes #2614. 2008-12-19 04:29:48 +00:00
Jörn Zaefferer ba4453def2 core: cleanup of build - build.js isn't used anywhere 2008-12-18 16:43:39 +00:00
Ariel Flesler e611289a79 testrunner: re adding the test for a function within isFunction. 2008-12-16 00:05:04 +00:00
Ariel Flesler 475f89b651 testrunner: adding tests for $.fn.hasClass. 2008-12-16 00:02:17 +00:00
John Resig 615a4ce1b4 IE doesn't care for boolean checks of .createElement - reverted back to using typeof instead. 2008-11-29 01:14:02 +00:00
John Resig d1f089952e Made a mistake in the patch for #3618, landing fix. 2008-11-18 06:00:34 +00:00
John Resig d81dfbcccf The code for handling Ajax timeouts was broken (the abort was being called too early). Fixing this allows the test suite to work again. 2008-11-18 04:53:34 +00:00
John Resig ab551c2b14 Standardized the type checks across core. isFunction and isArray now use Object.prototype.toString to verify the type, .constructor use was removed in favor of typeof, typeof checks now use ===, undefined checks use === undefined. All of this is outlined in the new style guidelines: http://docs.jquery.com/JQuery_Core_Style_Guidelines#Type_Checks. Fixes bug #3618. 2008-11-17 16:32:05 +00:00
John Resig 0aa8d40cdf Landing fixes for tickets #2935 and #2688 (Aborting ajax doesn't stop the setInterval, ajaxStop event isn't getting triggered). 2008-11-14 04:16:00 +00:00
Brandon Aaron 464535e096 fix the long standing 2px offset issue in QuirksMode in IE 2008-11-13 02:35:02 +00:00
John Resig 3b1cf91fa4 Landed the patch, by Diego, that 1) Removes browser sniffing from the ready code and 2) Provides some form of fallback DOM Ready for Iframes in IE. Closes #2614. 2008-11-12 13:18:47 +00:00
Brandon Aaron 5c21e44fce new offset method, faster and no more browser detection 2008-11-10 02:39:03 +00:00
Paul Bakaus b64d60940d core: height() method wasn't working reliably in Opera - rather than returning the actual client height when called on window, it returned the document's height through document.body.clientHeight. The right value to work with is html.clientHeight 2008-11-07 15:44:33 +00:00
Ariel Flesler 325755d4b3 jquery core: closes #3541. Added isArray. 2008-10-29 02:01:22 +00:00
Ariel Flesler 77cfd696ec jquery core: forgot to remove a deprecated warning. 2008-10-29 01:15:47 +00:00
Ariel Flesler 61784e1581 jquery core: improves #3248. Functions are supported by isFunction. 2008-10-29 01:12:27 +00:00
Jörn Zaefferer 12bb969411 core: tests cleanup for compability with qunit updates: stop() now actually accepts an argument (ajax.js); selectors should be confined to fixture(event.js) 2008-10-24 14:40:58 +00:00
Ariel Flesler 30751dd9f1 jquery fx: closes #3496. $.fx.off = true; turns off animations. 2008-10-22 15:23:37 +00:00
Ariel Flesler ad54d14ae5 jquery event: extra for #3498. Using the new mouse(enter|leave) shortcuts in $.fn.hover. 2008-10-22 10:06:54 +00:00
Ariel Flesler 69cbcf8637 jquery event: closes #3498, adding $.fn.mouseenter & $.fn.mouseleave. 2008-10-21 01:49:11 +00:00
Ariel Flesler b860c30b82 test runner: Commented 2 tests that jam the suite. 2008-10-21 01:48:23 +00:00
Ariel Flesler 4add9fa989 jquery fx: closes #3495. Animations are synchronous when duration is 0. 2008-10-18 23:27:43 +00:00
Ariel Flesler aa9236e5ea jquery event: closes #3355. Added stopImmediatePropagation() to events. 2008-10-18 22:46:04 +00:00
Ariel Flesler 63bfe1ded1 jquery core: closes #3485. Fixing a memory leak on IE. 2008-10-18 22:22:08 +00:00
Ariel Flesler 96e8f355da testrunner: fixing tests that were broken due to recent updates to qunit. 2008-10-18 21:59:09 +00:00
John Resig 0865b073f8 A test was using the old / child selector syntax - updating to the new style. 2008-08-21 17:08:50 +00:00
Ariel Flesler b69dc841ff jquery core: fix for [5828]. Put 'function' instead of 'string'. 2008-08-14 14:03:05 +00:00
Ariel Flesler ec146fc73d jquery core: closes #3154. makeArray uses typeof instead of attribute sniffing for strings. 2008-08-13 18:16:14 +00:00
Ariel Flesler 5dc7bb7233 jquery ajax: closes #3249. Slight modification on serializeArray, shorter and faster code, and allows a custom form object. 2008-08-13 01:44:36 +00:00
Ariel Flesler 1023cf1d72 jquery core: closes #3248, #3079, #3026, #3176, #3202, #3129. jQuery.makeArray doesn't support functions anymore. Voiding the conflict with Scriptaculous 1.7.x. 2008-08-12 19:34:30 +00:00
Ariel Flesler c9c024280a jquery ajax: misc optimization for $.fn.load(). 2008-08-11 01:35:23 +00:00
Ariel Flesler db076b06f5 jquery core: closes #3241. The 'length' property isn't set to jQuery's prototype anymore. 2008-08-11 00:54:05 +00:00
Ariel Flesler fc38ead4dc jquery core: small size optimizations for val(). 2008-08-10 23:59:01 +00:00
Jörn Zaefferer db63af1068 core/test: replaced local qunit copy with qunit via svn:externals; inlined styles specific to polluted.php; kept testrunner.js with just the noConflict call 2008-08-08 17:42:52 +00:00
Jörn Zaefferer c66aa57029 core: deleted useless test/fix.html 2008-08-08 17:21:42 +00:00
Ariel Flesler bf6f7e7a63 jquery ajax: closes #3231. The ajax setting 'dataFilter' can also parse the response. 2008-08-07 20:41:05 +00:00
Ariel Flesler 9d9c4d2a51 jquery ajax: extends #3087. The xhr factory is now an ajax setting called 'xhr' instead of a method (jQuery.getAjaxTransport). 2008-08-07 13:07:21 +00:00
Ariel Flesler b8ceedbe2b jquery ajax: closes #3087, #2167, #2128. The ajax transport creation process is exposed to allow overriding. 2008-08-04 14:18:06 +00:00
Ariel Flesler 31293063fa jquery event: closes #3127. jQuery.event.special built-in methods were optimized. The mouse(enter|leave) special case is only added for non-IE browsers.Thanks to Mike Helgeson for his help. 2008-07-28 18:31:25 +00:00
Ariel Flesler a3e97062d4 jquery selector: closes #3023. The attribute filter accepts ':'. 2008-07-28 16:34:46 +00:00
Ariel Flesler 23eeaf3854 jquery selector: closes #2939. $('[style]') wasn't being handled well. 2008-07-28 16:23:23 +00:00
Ariel Flesler a27b5d0468 jquery core: closes #2652. val() supports option elements, also simplified the code. 2008-07-23 17:00:32 +00:00
Ariel Flesler 69212c501f jquery core: closes #2968. Simplified isFunction, dropping support for DOM methods and functions like alert() on IE. 2008-07-23 16:18:05 +00:00
Ariel Flesler 43c4b64f32 jquery core: closes #3179. Fallback browser version for non supported browsers. 2008-07-23 15:21:27 +00:00
Ariel Flesler fa13d6009d test runner: adding scriptaculous 1.7.0 for the polluted test runner. It fails, but 1.8.x doesn't fail anymore. 2008-07-22 02:12:08 +00:00
Ariel Flesler a33f85e691 jquery core: closes #3159. remove() would unbind form.elements instead of a form. 2008-07-15 15:58:01 +00:00
Ariel Flesler b36fe4686c jquery event: closes #3112. It wasn't possible to bind 'data' to special events. 2008-07-09 21:38:28 +00:00
Ariel Flesler 6eb2bfe6ae general: adding reminder.txt to write down things to remember for future releases. 2008-07-09 19:26:41 +00:00
Ariel Flesler e132d6bc53 jquery core: Closes #3033. Removed support for .. selector on jQuery.find. 2008-07-09 19:23:19 +00:00
Ariel Flesler aacdeeb48d jquery fx: closes #3128. Saved some bytes when creating custom animations, using macros. Thanks Mike Helgeson. 2008-07-03 22:54:12 +00:00
Ariel Flesler 112f7b15ae jquery event: Optimization to global unbinding on window unload. Thanks Mike Helgeson. 2008-07-01 02:50:38 +00:00
Ariel Flesler cf78e396db jquery event: closes #3107. Optimization to global event triggering. Thanks Mike Helgeson. 2008-07-01 02:25:55 +00:00
Ariel Flesler 28937ded0e test runner: optimizing a test for speed. 2008-07-01 02:08:45 +00:00
Ariel Flesler a23e4361fc test runner: recloses #3102. Adding one test for $().eq("1") 2008-07-01 02:05:46 +00:00
Ariel Flesler 96e4006b74 jquery core: closes #3102, #3051. $.fn.eq() accepts a stringified integer. 2008-06-30 16:17:44 +00:00
Ariel Flesler 18d3e75945 jquery event: fixed a typo in a comment. 2008-06-27 14:17:28 +00:00
Paul Bakaus d1210a5a88 core: revertd last change, breaks width/height logic in css() 2008-06-24 16:16:15 +00:00
Paul Bakaus 201f1b66cc core: changed jQuery.css to num (uses curCSS) in the height/width methods with dramatically increases performance for height/width 2008-06-24 15:55:50 +00:00
Paul Bakaus b5d65d4e49 fx: 1) patch from Ariel removes the need of adding properties like scrollTop and scrollLeft specifically to fx.step - The priority order is style[prop] ? style[prop] : elem[prop], 2) fixed the height/width case - it wasn't possible to animate obj.height/obj.width if there wasn't a style attr. 2008-06-24 10:00:42 +00:00
Jörn Zaefferer 4812446594 core: set version.txt to 1.2.7-pre 2008-06-20 21:52:06 +00:00
Ariel Flesler dee02e5755 Set version number to 1.2.7a. 2008-06-20 21:18:40 +00:00
Ariel Flesler faa502cbc0 jquery ajax: renamed $.fx.speeds.def to _default to match $.fx.step._default naming convention. 2008-06-20 16:56:25 +00:00
Ariel Flesler 6159593520 jquery ajax: making Paul's last change([5735]) shorter. 2008-06-20 16:20:20 +00:00
Paul Bakaus 91a84d233d fx: animate() can now animate any property on a generic object or native wrapper (i.e. window.outerWidth) 2008-06-20 09:02:48 +00:00
Ariel Flesler bf14ac1236 jquery ajax: added a comment explaining the last commit. 2008-06-17 21:31:57 +00:00
Ariel Flesler 35b8157507 jquery ajax: closes #3052. Additional check on httpData() to keep compatibility with older code (form plugin). 2008-06-17 21:03:20 +00:00
Ariel Flesler 335b8816c2 jquery ajax: Fixes #3045. The protocol wasn't being checked to see if a script is required for cross domain requests. 2008-06-17 20:32:15 +00:00
Ariel Flesler febe463cc2 test runner: closes #3048. The text from the tests, is html-escaped. 2008-06-17 20:11:47 +00:00
Ariel Flesler 21d669135d test runner: 2 tests for [5728]. 2008-06-17 19:59:16 +00:00
Ariel Flesler 5e50079b14 jquery core: closes #3053. clean() wasn't parsing 0's. So html( 0 ) was failing failing. 2008-06-17 19:57:42 +00:00
Ariel Flesler 2f2602ed15 jquery core: closes #3034. Ids with '-' weren't handled by quickExpr. 2008-06-13 18:42:54 +00:00
Scott González fa48ad1d1b core: fixed #2993: .offsetParent() will now return the body element in all browsers for fixed position elements. 2008-06-06 00:28:33 +00:00
Ariel Flesler c90fe0283b jquery ajax: passing the settings object to httpData instead of just the dataFilter, so that when called it retains the object as "this". 2008-06-05 20:00:50 +00:00
Scott González 24eb176f0c ajax tests: Replaced $ with jQuery. 2008-06-05 18:11:29 +00:00
Ariel Flesler 1e9593646f test runner: adding 2 tests for .val( Number ).
Removed a silly test.
2008-05-29 00:03:45 +00:00
Ariel Flesler 9e48649729 test runner: the changes are:
- Replaced all the $ for jQuery in the tests and suite.
- Added a noConflict to testrunner.js.
- Modified the test for noConflict() so that it still work.
- Added jQuery 1.2.1 and 1.2.3 to otherlibs.
2008-05-28 23:18:25 +00:00
Ariel Flesler abb055bb49 jquery event: caching the props array and fixing the loop that goes thru it. It was accessing an invalid index. 2008-05-28 20:43:13 +00:00
Ariel Flesler 52fbe5d2a8 test runner: adding a new test page called 'polluted'. Where one can choose to pre-include other libraries and run the test suite with them. 2008-05-28 20:19:18 +00:00
Ariel Flesler 6bf51eea04 test runner: Adding type="text/javascript" to a script tag (trivial). 2008-05-28 18:46:38 +00:00
Ariel Flesler 11761def42 jquery ajax: small (misc) improvement to $.param. 2008-05-28 02:50:38 +00:00
Ariel Flesler c6e88b16e9 test runner: a test for load() with a hash of data, and another for load() with a string of data (#1516).
It includes a php that dumps all the GET and POST vars to html elements, where the key makes the id, and the value the text.
2008-05-27 22:46:28 +00:00
Ariel Flesler 7ec772374d jquery ajax: Closes #1516. load() can get a string of data (not only a hash) and it'll be a GET request. 2008-05-27 22:44:06 +00:00
Ariel Flesler e87d2c7a58 jquery core: adding rowSpan to jQuery.props. 2008-05-27 19:17:26 +00:00
Paul Bakaus 6141984b71 core: fixed offset method for FF3 - FF3 seems to have problems reporting the correct values with getBoundingClientRect on the body element 2008-05-25 13:18:01 +00:00
Ariel Flesler 042e51e731 jquery ajax: changing a set of &&/|| for ?/:. 2008-05-25 03:20:13 +00:00
Ariel Flesler 3c5c3dffaa test runner: A test was failing on Opera 9.50. Not a bug, just made the test less specific and it passed. 2008-05-24 21:27:12 +00:00
John Resig 895df76146 Tagging the 1.2.6 release. 2008-05-24 18:22:17 +00:00
Ariel Flesler 0e63c789e3 test runner: adding more tests for attr(). Related to [5574] and [5683]. 2008-05-24 18:11:55 +00:00
Ariel Flesler cff5323a1d jquery core: closes #2930. Normalizing attr() to return undefined, even when getting DOM attributes. 2008-05-24 18:09:21 +00:00
Ariel Flesler 7f27816d30 jquery core: casting numbers received by val() to string. 2008-05-24 17:57:45 +00:00
Ariel Flesler ec075266e9 jquery core: saving some bytes and fixing indentation inside jQuery.prop. 2008-05-23 00:54:59 +00:00
John Resig 456d8a62cc Tagging the 1.2.5 release. 2008-05-21 03:14:54 +00:00
John Resig 2db27efd66 Tagging the 1.2.4 release. 2008-05-18 20:19:46 +00:00
Ariel Flesler 3b81847f35 jquery fx: removing a needless comment after the last commit. 2008-05-16 20:00:16 +00:00
Ariel Flesler 6b535eb79f jquery fx: removing 2 unnecessary isFunction calls, options.complete is ALWAYS a function. 2008-05-16 19:51:34 +00:00
Ariel Flesler d44c5025c4 jquery core: Closes #2709, avoiding a bug on IE 6 when using globalEval and a base node is found. 2008-05-16 18:37:11 +00:00
Ariel Flesler 3a7b09e5c7 jquery core: saving some bytes in $.fn.val by using $.makeArray. 2008-05-16 18:32:03 +00:00
Ariel Flesler da76a723e1 jquery core: updating a comment, thanks to Scott for spotting it. 2008-05-16 16:41:12 +00:00
Ariel Flesler afc2ebde14 jquery ajax: Closes #2567, additional setting for $.ajax called 'dataFilter'. It's an optional function that receives the ajax response, and returns the sanitized version. 2008-05-16 16:39:27 +00:00
Brandon Aaron 2c2a6253e3 Updating unit tests for offset 2008-05-15 23:36:06 +00:00
Ariel Flesler c5f4d70e2b jqueryjquery ajax: closes #1289. Renamed 'xml' and 'r' to 'xhr'. 2008-05-15 21:03:31 +00:00
Brandon Aaron 82ba3709ee Reverted back to using the num helper method in offset.js 2008-05-15 20:29:52 +00:00
Brandon Aaron de6520b50e Added some unit tests for position method. Fixed issue with position in IE. 2008-05-15 19:38:00 +00:00
Ariel Flesler 9a7652260b jquery core: SHOULD fix #2802. Caching document.defaultView, instead of defaultView.getComputedStyle as it fails on Safari 2. 2008-05-15 14:45:29 +00:00
Ariel Flesler 54867a9803 jquery ajax: caching repetive conversions/checks for settings.type in $.ajax. 2008-05-15 14:16:19 +00:00
Ariel Flesler 31f22f244b jquery ajax: fixed #2865 and #2570. Not passing username to xml.open if it's null, or it open a login popup on some Opera's. 2008-05-15 13:45:09 +00:00
Ariel Flesler 5a92ec263d jquery dimensions & offset: moving the local function 'num' to core, so it can be safely used by both modules. 2008-05-15 12:53:07 +00:00
Ariel Flesler 1382ea8d98 test runner: improved the shown message of 4 isFunction tests. 2008-05-14 21:18:46 +00:00
Ariel Flesler b13a961ff5 jquery core: closes #1480, isFunction is even tougher. 2008-05-14 20:10:39 +00:00
Ariel Flesler d524c7eecc jquery ajax: closes #2842. 2008-05-14 19:50:24 +00:00
Ariel Flesler 69f72761fa jquery core: fixed deep extend of objects. Closes #1562 & #2820. 2008-05-14 19:45:31 +00:00
Ariel Flesler 831625c43e jquery offset: reducing more the code size. 2008-05-14 18:06:59 +00:00
Ariel Flesler ac324c97e3 jquery offset: reducing the code size. 2008-05-14 17:54:54 +00:00
Ariel Flesler f717260eea jquery dimensions: reducing the code size. 2008-05-14 17:23:44 +00:00
John Resig 44a6f5d0cb Tagging the 1.2.4b release. 2008-05-14 04:53:25 +00:00
Ariel Flesler 06eb4d3223 jquery ajax: renaming jQuery.ajax.re to remote. 2008-05-13 19:58:00 +00:00
Ariel Flesler 5c0aea3bfe jquery ajax: absolute urls were assumed to be cross domain. Closes #2816. 2008-05-13 19:47:39 +00:00
Brandon Aaron bf802496c6 Updating outerWidth unit test to use absolute position 2008-05-13 18:56:56 +00:00
Ariel Flesler 28182b4320 Closes #2510 2008-05-13 02:20:08 +00:00
Ariel Flesler 3f5ff3097c jquery: removing unnecessary trailing and leading spaces & tabs. 2008-05-13 01:45:58 +00:00
Ariel Flesler 20a7bff401 jquery event & fx: tidying some comments. 2008-05-13 01:42:35 +00:00
Ariel Flesler 70b5e670ca jquery core: don't let .attr() set style for xml. 2008-05-13 00:42:12 +00:00
Ariel Flesler e9b2781d30 jquery core: #2548, #2170, #2188, #2099, #1170, #2558, #2521, #2119, #1271, #2453, #2537.
mass refactoring of $.attr (#2548)

* Changes
- undefined was returned for falsy values.
- expando attributes are used when possible.
- one $.isXmlDoc instead of 2.
- $.attr( style, ... ) goes thru less useless checks.
- reduced code size of recurrent accessed variables/checks.
- $.props doesn't need redundant sets of key value anymore.
- added cellSpacing to $.props (#2521)
2008-05-13 00:37:30 +00:00
Ariel Flesler 37394598cb test runner: improved a test and added a missing semicolon 2008-05-12 22:59:58 +00:00
Ariel Flesler 16f6b3684d test runner: when errors are thrown in a test, the message is successfully show on all browsers. 2008-05-12 22:31:27 +00:00
Ariel Flesler 99101e02f9 jquery fx & event: replaced the use of .apply(), where .call() could had been used. 2008-05-12 19:45:02 +00:00
Ariel Flesler 440c08d768 jquery core: Applied #1318 to jQuery.grep 2008-05-12 01:21:50 +00:00
Ariel Flesler 1762dc24d6 jquery core: declared undefined locally, to speed up references, and allow munging all their names. 2008-05-11 20:59:24 +00:00
Ed Engelhardt 6aa4200a8c fix small typo in comment 2008-05-11 10:17:11 +00:00
Jörn Zaefferer aec0dad980 jquery core: reverted qunit introduction until build scripts are updated 2008-05-08 21:42:40 +00:00
Jörn Zaefferer b6bb0d46b6 jquery testsuite: switch to qunit 2008-05-08 19:33:49 +00:00
Ariel Flesler 0a794ed5fc test runner: added 2 tests for [5500] 2008-05-08 17:16:49 +00:00
Ariel Flesler 6a9b73c7b9 test runner: extra tests for $.fn.add enabled by [5503] and a small fix for an html() test. 2008-05-08 17:11:03 +00:00
Ariel Flesler 487567e82f jquery core: closes #2811, $.fn.add now calls $.unique internally, also it was failing for array-like f.e: window. 2008-05-08 17:08:59 +00:00
Ariel Flesler 407c5eb430 test runner: extra test case, [5501] 2008-05-08 16:25:12 +00:00
Ariel Flesler a56317ea3a jquery event: fixed $.fn.load, closes #2819. 2008-05-08 16:23:43 +00:00
Ariel Flesler 858d56fc8e jquery core: closes #2771
$.inArray now makes a === check because of IE.
$.inArray is used in $.fn.index, this is shorter, and breaks the loop when possible.
$.fn.index can receive a jquery object, and the first element is used
2008-05-08 16:14:49 +00:00
Ariel Flesler ca73ba5668 jquery event: removing 3 unnecessary lines since the addition of $.event.proxy. 2008-05-08 16:10:47 +00:00
Ariel Flesler 9f0c0cfec5 test runner: making 2 tests more flexible because they yield a slightly different result on Safari 3, but still acceptable. 2008-05-08 16:04:01 +00:00
Brandon Aaron 4b970deacd Making sure originalTarget gets copied over from the original event object 2008-05-07 13:21:16 +00:00
Scott González 5311565223 ajax test: Removed test for extending with null. 2008-05-07 01:16:54 +00:00
Ariel Flesler 96ca83d150 test runner: extra test for makeArray, related to [5481] 2008-05-07 00:46:14 +00:00
Ariel Flesler 4d41c71d3d jquery core: Reverting the changes added at [5480] 2008-05-07 00:07:44 +00:00
Ariel Flesler a584f82aef jquery core: makeArray was parsing forms into array of elements. 2008-05-06 23:28:21 +00:00
Ariel Flesler 69d9abff2c jquery core: removing needless 'else' and 'new' in $.fn.init. 2008-05-06 22:36:30 +00:00
Jörn Zaefferer 46931d3146 jquery ajax: support for dynamic data arguments, see #2806; added test/data/echoQuery.php for easier testing of sent query strings 2008-05-06 22:21:43 +00:00
Jörn Zaefferer 1753ab3d82 jquery testrunner: reset $.ajaxSettings after each run to prevent sideeffects between tests 2008-05-06 19:39:58 +00:00
Ariel Flesler ba48be3ada test runner: translated all the ok() with '==' to equals(), as it gives more information on failures. 2008-05-06 18:56:02 +00:00
Ariel Flesler e5e24bd33f jquery core: enhancements to jquery.map, closes #2803 2008-05-06 14:54:53 +00:00
Ariel Flesler 789ad4f769 jquery core: small code reduction. 2008-05-06 01:29:13 +00:00
Ariel Flesler eeab071790 jquery core: code reduction at $.each and $.curCSS. 2008-05-06 00:54:59 +00:00
Ariel Flesler 6fc2c67581 test runner: adding some tests that were missing for the $ constructor. 2008-05-06 00:42:59 +00:00
Ariel Flesler e6fccd7103 jquery selector: reverting [5343], check #1960. 2008-05-06 00:13:20 +00:00
Jörn Zaefferer d726a96b1f jquery testrunner: reset global events after each run, speeds up a test run for ajax from 16s to 10s (test/?ajax), kudos to Ariel 2008-05-05 23:29:28 +00:00
Scott González f8698395ac core: Fixed #2605: .data() now accepts null as a value. 2008-05-03 01:51:55 +00:00
Scott González ad3c49d1b6 core: Fixed #2605: .data() now accepts null as a value. 2008-05-03 01:39:27 +00:00
Scott González 35c68b4578 core: Fixed #2600: jQuery.extend no longer skips over null properties. 2008-05-02 19:49:41 +00:00
Ariel Flesler 87758bbe69 jquery fx: adding jQuery.fx.def as default speed for animations 2008-05-02 14:12:26 +00:00
Ariel Flesler 42161a1e34 jquery selector: removed needless check in jQuery.sibling. 2008-05-02 14:03:02 +00:00
Scott González ec06b7213d jQuery src: set svn:eol-style to native 2008-05-01 20:54:35 +00:00
Scott González bd41548792 core: make sure all source files end with a single blank line. 2008-04-30 19:35:17 +00:00
Ariel Flesler cd455eeba7 jquery core: extend() now supports deep + extending jquery itself
cached some vars and it proved to be faster.
2008-04-30 00:09:55 +00:00
Ariel Flesler 17b1e407d1 mainly made the code shorter:
- removed some needless if's
- replace multiple "var x" for one, comma separated declaration.
- added a local fn called now() for the (new Date)s
- fixed the indentation of a block, and a typo in a comment.
- used fn instead of prototype where possible
- jquery fx: exposed the speeds hash as jQuery.fx.speeds.

Also fixed (again) line endings
2008-04-29 23:34:50 +00:00
Scott González ea44348fdb core: Adding missing radix for paresInt. 2008-04-29 23:26:53 +00:00
Scott González 2977f3df60 Fixed line endings. 2008-04-29 22:52:36 +00:00
Ariel Flesler d822c0c214 test runner: adding a test case for $.fn._toggle with more than 2 functions. 2008-04-29 22:20:02 +00:00
Ariel Flesler aaff17be42 jquery event: from #2249, adding $.event.proxy to link event handlers, and implementing it on $.event.add, $.fn._toggle and $.fn.one.
It also fixes a bug in $.fn.one that was unbinding ALL the existing handlers.
2008-04-29 22:06:54 +00:00
Ariel Flesler 08836acc30 jquery event: adding some whitespaces to the last change. 2008-04-29 21:37:41 +00:00
Ariel Flesler c3cbc5bf98 jquery event: jQuery.toggle can accept more than 2 functions, closes #2378 2008-04-29 21:35:35 +00:00
Ariel Flesler e9c620794f jquery core: in $.makeArray, improved array-like detection, Safari reports nodelists as 'function', so I got back to attribute sniffing. 2008-04-29 20:58:22 +00:00
Ariel Flesler f54d277df4 test runner: voided the failing tests for jQuery.map, that belong to an unapproved proposal(#2616). 2008-04-29 20:54:30 +00:00
Ariel Flesler 5ca908d3b6 test runner: added another test for makeArray. 2008-04-29 20:52:48 +00:00
Brandon Aaron aea452f162 Merged dimensions with core 2008-04-29 03:26:06 +00:00
Brandon Aaron f3f3238c53 jQuery.event.fix performance boost. An example: click event was previously ~3ms and is now < 1ms. jQuery.event.trigger also got another small boost in performance. 2008-04-28 21:09:27 +00:00
Jörn Zaefferer 4d652ca520 jquery core: fix for #1960, delegating to document.getElementsByName for [name=...] selectors (not in combination with :not) 2008-04-28 14:11:35 +00:00
Jörn Zaefferer ab756ceab0 jquery core: tests for #2616 2008-04-28 14:00:27 +00:00
Brandon Aaron b84b997ea4 Prevent a single event object from being fixed more than once 2008-04-27 23:08:31 +00:00
Brandon Aaron 77bb2c505f Optimization for jQuery.event.fix ... don't send fake event through jQuery.event.fix 2008-04-27 20:37:58 +00:00
Ariel Flesler 508b1e2432 jquery core: fixed makeArray to recognize the window (has length)
test runner: updated the tests for makeArray
2008-04-25 03:48:07 +00:00
Ariel Flesler 25f9974cee jquery core: simplified the code using the new jQuery.makeArray from [5314] where possible. 2008-04-24 21:46:22 +00:00
Ariel Flesler ba391eccf9 - Adding the enhancements to the test runner, to accept multiple(and negative) filters from the GET variables, as specified in the ticket #2738. 2008-04-24 21:32:35 +00:00
Jörn Zaefferer f8e5fd6fef jquery core: Patch from #2619 applied, making makeArray more flexible and faster; removed hint to ticket from (previously failing) test 2008-04-24 21:23:36 +00:00
Jörn Zaefferer f12d94a628 testrunner: refactored url-test-filter, still regex based 2008-04-24 20:08:50 +00:00
Brandon Aaron 2efd0b4cc5 Fixed regression with 5276 where return false in first handler of multiple handlers was ignored. And 5276 log message says 200% but I meant 20%. 2008-04-23 18:57:17 +00:00
Ariel Flesler 291f071eff - adding the tests for the changes to $.makeArray, proposed at #2619 2008-04-22 23:07:35 +00:00
Jörn Zaefferer f861c88b1b jquery testrunner: accept regexp to select tests, eg. /test/?^core|^selector to run both core and selector module 2008-04-22 22:43:18 +00:00
Jörn Zaefferer d3d8f3561b jquery.ajax: fix for beforeSend-cancelling-sideeffects 2008-04-22 22:18:11 +00:00
Jörn Zaefferer e454e8305d jquery.ajax: improvement for #2688, added test 2008-04-22 22:07:17 +00:00
Jörn Zaefferer 32b1cb3a5c jquery.event: Patch for #2708 2008-04-22 21:59:40 +00:00
Brandon Aaron 6d28ebff85 Some small optimizations to the event module. jQuery.event.trigger over 200% faster in IE and less code. Thanks in large to Ariel Flesler. 2008-04-22 05:23:55 +00:00
Brandon Aaron 9de35ce3e7 Small optimization to offset (thanks Ariel Flesler) 2008-04-21 22:54:46 +00:00
Brandon Aaron 3e285bd60d Small optimization to jQuery.curCSS (thanks Ariel Flesler) 2008-04-21 22:54:25 +00:00
Brandon Aaron 5d033dba02 Trigger onclick handlers of links 2008-04-21 20:39:17 +00:00
Yehuda Katz a9fe9a2a5f Closes #2688 2008-04-14 18:16:01 +00:00
John Resig 1ba2865b08 Tagging the 1.2.4a release. 2008-04-10 01:17:07 +00:00
Sean Catchpole 4515aba79c $.extend deep now copies children's children, ect... 2008-04-08 16:40:03 +00:00
Jörn Zaefferer dc7f8cfca6 jquery core: updated version pre-1.2.4 2008-03-17 10:53:00 +00:00
John Resig d44ddef720 Made outerHeight/outerWidth accept .outerWidth(true) to include the margin. If any options are passed in it's assumed that you want the margin included. 2008-03-15 19:00:07 +00:00
John Resig 8f14ee1dd5 Imported the innerHeight and outerHeight methods from the Dimensions plugin. 2008-03-15 18:53:40 +00:00
John Resig a19a123d89 Fixed issue with typeof check - "array" isn't a valid type. 2008-02-17 15:05:55 +00:00
John Resig f43516f209 Landed a fix for bug #2037. 2008-02-06 05:18:25 +00:00
John Resig e71e4a47f3 Landed a minor fix for AIR (in the offset method). 2008-02-06 03:48:22 +00:00
John Resig 80568d29cb Tagging the 1.2.3 release. 2008-02-06 01:03:40 +00:00
Scott González 75cb0d8d05 Fixed .unbind('.namespace'). 2008-02-05 19:32:00 +00:00
143 changed files with 36697 additions and 16346 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
* eol=lf
*.jar binary

8
.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
src/selector.js
dist
.settings
*~
*.diff
*.patch
/*.html
.DS_Store

6
.gitmodules vendored Normal file
View file

@ -0,0 +1,6 @@
[submodule "src/sizzle"]
path = src/sizzle
url = git://github.com/jquery/sizzle.git
[submodule "test/qunit"]
path = test/qunit
url = git://github.com/jquery/qunit.git

View file

@ -1,98 +0,0 @@
== jQuery ChangeLog ==
== 1.2.2 ==
* show is now element aware (uses default display type instead of just forcing block)
* New special events api: jQuery.events.special
* ready is now a real event and can be bound, unbound and triggered.
* mouseenter and mouseleave now work on all supported browsers
* The hover helper method now uses the mouseenter and mouseleave events
* New offset test suite test/offset.html (requires your pop-up blocker to be disabled)
* Refactored the width and height methods (fixes lots of bugs)
* Fixed event memory leaks in IE (html, remove, empty also no longer leak memory)
* Fixed window/document width/height values
* Fixed event.pageX and event.pageY in IE
== 1.2 ==
=== 1.1.3 ===
* Always create an ActiveXObject when it is available instead of the XMLHttpRequest, even in IE7
* Removed XMLHttpRequest shadowing, may break code that relies on existence of that function for browser checking
* ...
=== 1.1.2 ===
* Event handlers (like element.onclick) are now removed when no more functions are bound to the event.
* Fixed DOM Manipulations for form elements.
* Fixed jQuery.isFunction to return false on nodes.
* Fixed jQuery.className.has, escaping regex characters in className (for metadata)
* Fixed an issue in IE where an event on a cloned element is fired during a .clone() inside of an event handler.
* Fixed IE ID selectors selecting by the name attribute.
* Change: Events are now internally stored in elem.$events rather than elem.events (due to a nasty bug relating to DOM 0 expandos).
* .attr('href') is now consistent in all browsers.
* @href is now consistent in all browsers.
* Fixed the slideDown flickering bug.
* Having a \r endline in $("...") caused a never-ending loop.
* Fixed IE6 AJAX memory leak
* Fixed bug in pushStack, reporting an element at [0] in a jQuery object with length 0
=== 1.1.1 ===
* Setting the numerical value of a css property failed, for example: .css("opacity",0.5) (also occurred with zIndex, fontWeight)
* Calling $(..., jqobj) with a context of a jQuery object failed.
* Accessing a property on an element that doesn't exist caused an error, for example: $("#foobar").attr("id")
* Calling .load() without a callback caused an error.
* You couldn't cancel an event that was triggered using .trigger() or .click() (for example).
* .add()ing a single DOM element to a jQuery object was broken.
* Passing in undefined values to a $.post() caused weird errors to occur.
* Accessing child nodes within an xml document didn't work properly.
* jQuery.isFunction() was unable to reliably determine a function, in a cross-browser way.
* Triggering a .click() failed in IE.
* Triggered click handlers were executed twice in most browsers.
* A newline passed into $(...) caused Firefox to go into a never-ending loop.
* Calling $.post() without any data caused an error.
* Calling a descendant selector after a child selector caused strange results, for example: $("ul > li ul")
* Triggered events did not occur if an event handler was not bound for that event.
== 1.1 ==
* Massive speed-ups (4x-10x) in the selector engine.
* You can now unbind event handlers from within themselves
* Added new .one( "type", fn ) method
* text(String) now escapes HTML
* Added attr(String,Function) to calculate the value
* Performming .click(), .blur(), .focus(), .submit() will actually trigger the browsers default action for those events.
* Added global settings for AJAX (in addition to timeout), use $.ajaxSetup() to modify them
* Implemented a better error handling for ajax requests. Exceptions caused by dropping connections are now handled, too.
* Improved event fixing (Opera provides event.srcElement, must ignore it if target is available; only create pageX if clientX is available)
* Fixed nth-child selectors to start on the right number
* jQuery is no longer destructive. Doing var a = $("a"); a.find("span"); does not change the original "a" variable.
* Fixed synchronous requests
* Fixed ID with context selectors (eg. div #id doesn't ignore "div" anymore)
* Fixed docs for html(): Now mentions that is not available for XML documents
* Improved AJAX docs (eg. more examples for $.ajax)
* Documented filter(Function), a very powerful approach for custom filtering
* Improved docs for FX module, merging method descriptions and marking optional arguments
* Improved docs for append, prepend, before and after, merging the three pairs into one
* Improved show/hide animations to show only hidden and hide only visible elements
* Removed .oneEvent() and .unEvent() helper methods.
* Removed all CSS helper methods.
* Removed most attribute helper methods.
* Removed the (undocumented) .find( "selector", fn ) for all destructive methods.
* $.get, $.getIfModified, $.post, $.getScript and $.getJSON now all pass through the XMLHttpRequest as returned by $.ajax
== 1.0.4 ==
* Tons of bug fixes
* Extensions to $.ajax: $.ajax accepts additonal options: beforeSend, async and processData; returns XMLHttpRequest to allow manual aborting of requests, see docs for details
* AJAX module: the public $.ajax API is now used internally (for $.get/$.post etc.); loading scripts works now much more reliable on all browers except Safari
* New global ajax handler: ajaxSend - called before an ajax request is sent
* Extensions to global ajax handlers: ajaxSend, ajaxSuccess, ajaxError and ajaxComplete get XMLHttpRequest and settings passed as arguments
* Extensions to event handling: pageX and pageY are available x-browser (IE does not provide native pageX/Y)
* Improved docs: $(String) method has now two seperate descriptions, one for selecting elements, one for creating (html on-the-fly)
* FX module: Most inline stlyes added by animations are now removed when the animation is complete, eg. height style when animating height (exception: display styles)
* Added note to attr(String, Object) about issues with setting the name property on input elements
* Seperated internal stuff from get() into set()
* Merged the two API examples for each() into one more precise example
* Improved docs for $.browser and added docs for $.boxModel
* Docs for the jQuery constructor $() were improved: There is now $(String expression[, Object context]) and $(String html)

View file

@ -1,4 +1,4 @@
Copyright (c) 2008 John Resig, http://jquery.com/
Copyright (c) 2011 John Resig, http://jquery.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

208
Makefile
View file

@ -1,166 +1,120 @@
SRC_DIR = src
TEST_DIR = test
BUILD_DIR = build
PREFIX = .
DOCS_DIR = ${PREFIX}/docs
TEST_DIR = ${PREFIX}/test
DIST_DIR = ${PREFIX}/dist
SPEED_DIR = ${PREFIX}/speed
PLUG_DIR = ../plugins
JS_ENGINE ?= `which node nodejs`
COMPILER = ${JS_ENGINE} ${BUILD_DIR}/uglify.js --unsafe
POST_COMPILER = ${JS_ENGINE} ${BUILD_DIR}/post-compile.js
BASE_FILES = ${SRC_DIR}/core.js\
${SRC_DIR}/selector.js\
${SRC_DIR}/deferred.js\
${SRC_DIR}/support.js\
${SRC_DIR}/data.js\
${SRC_DIR}/queue.js\
${SRC_DIR}/attributes.js\
${SRC_DIR}/event.js\
${SRC_DIR}/selector.js\
${SRC_DIR}/traversing.js\
${SRC_DIR}/manipulation.js\
${SRC_DIR}/css.js\
${SRC_DIR}/ajax.js\
${SRC_DIR}/fx.js\
${SRC_DIR}/offset.js
PLUGINS = ${PLUG_DIR}/button/*\
${PLUG_DIR}/center/*\
${PLUG_DIR}/cookie/*\
${PLUG_DIR}/dimensions/*\
${PLUG_DIR}/metadata/*\
${PLUG_DIR}/form/*\
${PLUG_DIR}/greybox/greybox.js\
${PLUG_DIR}/interface/*\
${PLUG_DIR}/pager/*\
${PLUG_DIR}/tablesorter/*\
${PLUG_DIR}/tabs/*\
${PLUG_DIR}/tooltip/jquery.tooltip.js\
${PLUG_DIR}/accordion/jquery.accordion.js
${SRC_DIR}/ajax/jsonp.js\
${SRC_DIR}/ajax/script.js\
${SRC_DIR}/ajax/xhr.js\
${SRC_DIR}/effects.js\
${SRC_DIR}/offset.js\
${SRC_DIR}/dimensions.js
MODULES = ${SRC_DIR}/intro.js\
${BASE_FILES}\
${SRC_DIR}/outro.js
MODULES_WITH_PLUGINS = ${SRC_DIR}/intro.js\
${BASE_FILES}\
${PLUGINS}\
${SRC_DIR}/outro.js
JQ = ${DIST_DIR}/jquery.js
JQ_LITE = ${DIST_DIR}/jquery.lite.js
JQ_MIN = ${DIST_DIR}/jquery.min.js
JQ_PACK = ${DIST_DIR}/jquery.pack.js
JQ_VER = `cat version.txt`
VER = sed s/@VERSION/${JQ_VER}/
SIZZLE_DIR = ${SRC_DIR}/sizzle
JAR = java -jar ${BUILD_DIR}/js.jar
JQ_VER = $(shell cat version.txt)
VER = sed "s/@VERSION/${JQ_VER}/"
all: jquery lite min pack speed
DATE=$(shell git log -1 --pretty=format:%ad)
all: update_submodules core
core: jquery min lint
@@echo "jQuery build complete."
${DIST_DIR}:
@@mkdir -p ${DIST_DIR}
jquery: ${DIST_DIR} ${JQ}
jquery: ${JQ}
${JQ}: ${MODULES}
${JQ}: ${MODULES} | ${DIST_DIR}
@@echo "Building" ${JQ}
@@mkdir -p ${DIST_DIR}
@@cat ${MODULES} | ${VER} > ${JQ};
@@cat ${MODULES} | \
sed 's/.function..jQuery...{//' | \
sed 's/}...jQuery..;//' | \
sed 's/@DATE/'"${DATE}"'/' | \
${VER} > ${JQ};
@@echo ${JQ} "Built"
@@echo
${SRC_DIR}/selector.js: ${SIZZLE_DIR}/sizzle.js
@@echo "Building selector code from Sizzle"
@@sed '/EXPOSE/r src/sizzle-jquery.js' ${SIZZLE_DIR}/sizzle.js | grep -v window.Sizzle > ${SRC_DIR}/selector.js
with_plugins: ${MODULES_WITH_PLUGINS}
@@echo "Building" ${JQ}
lint: jquery
@@if test ! -z ${JS_ENGINE}; then \
echo "Checking jQuery against JSLint..."; \
${JS_ENGINE} build/jslint-check.js; \
else \
echo "You must have NodeJS installed in order to test jQuery against JSLint."; \
fi
@@mkdir -p ${DIST_DIR}
@@cat ${MODULES_WITH_PLUGINS} | ${VER} > ${JQ};
@@echo ${JQ} "Built"
@@echo
lite: ${JQ_LITE}
${JQ_LITE}: ${JQ}
@@echo "Building" ${JQ_LITE}
@@cp ${JQ} ${JQ_LITE}
@@echo ${JQ_LITE} "Built"
@@echo
pack: ${JQ_PACK}
${JQ_PACK}: ${JQ}
@@echo "Building" ${JQ_PACK}
@@echo " - Compressing using Packer"
@@${JAR} ${BUILD_DIR}/build/pack.js ${JQ} ${JQ_PACK}
@@echo ${JQ_PACK} "Built"
@@echo
min: ${JQ_MIN}
min: jquery ${JQ_MIN}
${JQ_MIN}: ${JQ}
@@echo "Building" ${JQ_MIN}
@@if test ! -z ${JS_ENGINE}; then \
echo "Minifying jQuery" ${JQ_MIN}; \
${COMPILER} ${JQ} > ${JQ_MIN}.tmp; \
${POST_COMPILER} ${JQ_MIN}.tmp > ${JQ_MIN}; \
rm -f ${JQ_MIN}.tmp; \
else \
echo "You must have NodeJS installed in order to minify jQuery."; \
fi
@@echo " - Compressing using Minifier"
@@${JAR} ${BUILD_DIR}/build/min.js ${JQ} ${JQ_MIN}
@@echo ${JQ_MIN} "Built"
@@echo
test: ${JQ}
@@echo "Building Test Suite"
@@echo "Test Suite Built"
@@echo
runtest: ${JQ} test
@@echo "Running Automated Test Suite"
@@${JAR} ${BUILD_DIR}/runtest/test.js
@@echo "Test Suite Finished"
@@echo
docs: ${JQ}
@@echo "Building Documentation"
@@echo " - Making Documentation Directory:" ${DOCS_DIR}
@@mkdir -p ${DOCS_DIR}
@@mkdir -p ${DOCS_DIR}/data
@@echo " - Copying over htaccess file."
@@cp -fR ${BUILD_DIR}/docs/.htaccess ${DOCS_DIR}
@@echo " - Copying over script files."
@@cp -fR ${BUILD_DIR}/docs/js ${DOCS_DIR}/js
@@echo " - Copying over style files."
@@cp -fR ${BUILD_DIR}/docs/style ${DOCS_DIR}/style
@@echo " - Extracting ScriptDoc from" ${JQ}
@@${JAR} ${BUILD_DIR}/docs/docs.js ${JQ} ${DOCS_DIR}
@@echo "Documentation Built"
@@echo
speed: ${JQ}
@@echo "Building Speed Test Suite"
@@echo " - Making Speed Test Suite Directory:" ${SPEED_DIR}
@@mkdir -p ${SPEED_DIR}
@@echo " - Copying over script files."
@@cp -f ${BUILD_DIR}/speed/index.html ${SPEED_DIR}
@@cp -f ${BUILD_DIR}/speed/benchmarker.css ${SPEED_DIR}
@@cp -f ${BUILD_DIR}/speed/benchmarker.js ${SPEED_DIR}
@@cp -f ${BUILD_DIR}/speed/jquery-basis.js ${SPEED_DIR}
@@echo "Speed Test Suite Built"
@@echo
clean:
@@echo "Removing Distribution directory:" ${DIST_DIR}
@@rm -rf ${DIST_DIR}
@@echo "Removing Documentation directory:" ${DOCS_DIR}
@@rm -rf ${DOCS_DIR}
@@echo "Removing built copy of Sizzle"
@@rm -f src/selector.js
@@echo "Removing Speed Test Suite directory:" ${SPEED_DIR}
@@rm -rf ${SPEED_DIR}
distclean: clean
@@echo "Removing submodules"
@@rm -rf test/qunit src/sizzle
# change pointers for submodules and update them to what is specified in jQuery
# --merge doesn't work when doing an initial clone, thus test if we have non-existing
# submodules, then do an real update
update_submodules:
@@if [ -d .git ]; then \
if git submodule status | grep -q -E '^-'; then \
git submodule update --init --recursive; \
else \
git submodule update --init --recursive --merge; \
fi; \
fi;
# update the submodules to the latest at the most logical branch
pull_submodules:
@@git submodule foreach "git pull \$$(git config remote.origin.url)"
@@git submodule summary
pull: pull_submodules
@@git pull ${REMOTE} ${BRANCH}
.PHONY: all jquery lint min clean distclean update_submodules pull_submodules pull core

67
README
View file

@ -1,67 +0,0 @@
--------------------------------
jQuery - New Wave Javascript
http://jquery.com/
--------------------------------
What you need to build your own jQuery:
- Make sure that you have Java installed.
If not, go to this page and download "Java Runtime Environment (JRE) 5.0"
http://java.sun.com/javase/downloads/index.jsp
- You now have two options for building jQuery, if you have access to
common UNIX commands (like 'make', 'mkdir', 'rm', 'cat', and 'echo')
then simply type 'make' to build all the components.
- The other option is if you have Ant installed (or are on Windows and
don't have access to make). You can download Ant from here:
http://ant.apache.org/bindownload.cgi
If you do have Ant, everytime (in this README) that I say 'make', do
'ant' instead - it works identically (for all intents and purposes).
How to build your own jQuery:
In the main directory of the distribution (the one that this file is in), type
the following to make all versions of jQuery, the documentation, and the test suite:
make
Here are each of the individual items that are buildable from the Makefile.
make jquery
The standard, uncompressed, jQuery code.
Makes: ./dist/jquery.js
make lite
jQuery without all the additional inline documentation and test cases.
Makes: ./dist/jquery.lite.js
make pack
A compressed version of jQuery (made with Packer).
Makes: ./dist/jquery.pack.js
make docs
Builds a complete copy of the documentation, based upon the jQuery source.
Makes ./docs/
Open this file in your browser:
./docs/index.xml
make test
Builds a complete copy of the test suite, based upon the jQuery source.
Makes ./test/
Open this file in your browser:
./test/index.html
Finally, you can remove all the built files using the command:
make clean
Additionally, if you want to install jQuery to a location that is not this
directory, you can specify the PREFIX directory, for example:
make PREFIX=/home/john/test/
OR
make PREFIX=~/www/ docs
If you have any questions, please feel free to ask them on the jQuery
mailing list, which can be found here:
http://jquery.com/discuss/

147
README.md Normal file
View file

@ -0,0 +1,147 @@
[jQuery](http://jquery.com/) - New Wave JavaScript
==================================================
What you need to build your own jQuery
--------------------------------------
In order to build jQuery, you need to have GNU make 3.8 or later, Node.js 0.2 or later, and git 1.7 or later.
(Earlier versions might work OK, but are not tested.)
Windows users have two options:
1. Install [msysgit](https://code.google.com/p/msysgit/) (Full installer for official Git),
[GNU make for Windows](http://gnuwin32.sourceforge.net/packages/make.htm), and a
[binary version of Node.js](http://node-js.prcn.co.cc/). Make sure all three packages are installed to the same
location (by default, this is C:\Program Files\Git).
2. Install [Cygwin](http://cygwin.com/) (make sure you install the git, make, and which packages), then either follow
the [Node.js build instructions](https://github.com/ry/node/wiki/Building-node.js-on-Cygwin-%28Windows%29) or install
the [binary version of Node.js](http://node-js.prcn.co.cc/).
Mac OS users should install Xcode (comes on your Mac OS install DVD, or downloadable from
[Apple's Xcode site](http://developer.apple.com/technologies/xcode.html)) and
[http://mxcl.github.com/homebrew/](Homebrew). Once Homebrew is installed, run `brew install git` to install git,
and `brew install node` to install Node.js.
Linux/BSD users should use their appropriate package managers to install make, git, and node, or build from source
if you swing that way. Easy-peasy.
How to build your own jQuery
----------------------------
First, clone a copy of the main jQuery git repo by running `git clone git://github.com/jquery/jquery.git`.
Then, to get a complete, minified, jslinted version of jQuery, simply `cd` to the `jquery` directory and type
`make`. If you don't have Node installed and/or want to make a basic, uncompressed, unlinted version of jQuery, use
`make jquery` instead of `make`.
The built version of jQuery will be put in the `dist/` subdirectory.
To remove all built files, run `make clean`.
Building to a different directory
---------------------------------
If you want to build jQuery to a directory that is different from the default location, you can specify the PREFIX
directory: `make PREFIX=/home/jquery/test/ [command]`
With this example, the output files would end up in `/home/jquery/test/dist/`.
Troubleshooting
---------------
Sometimes, the various git repositories get into an inconsistent state where builds don't complete properly
(usually this results in the jquery.js or jquery.min.js being 0 bytes). If this happens, run `make clean`, then
run `make` again.
Git for dummies
---------------
As the source code is handled by the version control system Git, it's useful to know some features used.
### Submodules ###
The repository uses submodules, which normally are handled directly by the Makefile, but sometimes you want to
be able to work with them manually.
Following are the steps to manually get the submodules:
1. `git clone https://github.com/jquery/jquery.git`
2. `git submodule init`
3. `git submodule update`
Or:
1. `git clone https://github.com/jquery/jquery.git`
2. `git submodule update --init`
Or:
1. `git clone --recursive https://github.com/jquery/jquery.git`
If you want to work inside a submodule, it is possible, but first you need to checkout a branch:
1. `cd src/sizzle`
2. `git checkout master`
After you've committed your changes to the submodule, you'll update the jquery project to point to the new commit,
but remember to push the submodule changes before pushing the new jquery commit:
1. `cd src/sizzle`
2. `git push origin master`
3. `cd ..`
4. `git add src/sizzle`
5. `git commit`
The makefile has some targets to simplify submodule handling:
#### `make update_submodules` ####
checks out the commit pointed to by jquery, but merges your local changes, if any. This target is executed
when you are doing a normal `make`.
#### `make pull_submodules` ####
updates the content of the submodules to what is probably the latest upstream code.
#### `make pull` ####
make a `make pull_submodules` and after that a `git pull`. if you have no remote tracking in your master branch, you can
execute this command as `make pull REMOTE=origin BRANCH=master` instead.
### cleaning ###
If you want to purge your working directory back to the status of upstream, following commands can be used (remember everything you've worked on is gone after these):
1. `git reset --hard upstream/master`
2. `git clean -fdx`
### rebasing ###
For feature/topic branches, you should always used the `--rebase` flag to `git pull`, or if you are usually handling many temporary "to be in a github pull request" branches, run following to automate this:
* `git config branch.autosetuprebase local` (see `man git-config` for more information)
### handling merge conflicts ###
If you're getting merge conflicts when merging, instead of editing the conflicted files manually, you can use the feature
`git mergetool`. Even though the default tool `xxdiff` looks awful/old, it's rather useful.
Following are some commands that can be used there:
* `Ctrl + Alt + M` - automerge as much as possible
* `b` - jump to next merge conflict
* `s` - change the order of the conflicted lines
* `u` - undo an merge
* `left mouse button` - mark a block to be the winner
* `middle mouse button` - mark a line to be the winner
* `Ctrl + S` - save
* `Ctrl + Q` - quit
Questions?
----------
If you have any questions, please feel free to ask on the
[Developing jQuery Core forum](http://forum.jquery.com/developing-jquery-core) or in #jquery on irc.freenode.net.

View file

@ -1,88 +0,0 @@
<project name="jQuery" default="jquery" basedir=".">
<!--
To get jQuery even smaller, remove the modules you don't need by removing the fileset elements
in the jquery-target, for example leaving only these:
<fileset dir="${SRC_DIR}" includes="intro.js" />
<fileset dir="${SRC_DIR}" includes="core.js" />
<fileset dir="${SRC_DIR}" includes="selector.js" />
<fileset dir="${SRC_DIR}" includes="event.js" />
<fileset dir="${SRC_DIR}" includes="outro.js" />
That'd remove ajax, fx and offset support, leaving basic selectors, manipulation and event handling.
-->
<!-- SETUP -->
<property description="Source Folder" name="SRC_DIR" value="src" />
<property description="Files for parsing etc." name="BUILD_DIR" value="build" />
<property description="Rhino JS Engine" name="JAR" value="${BUILD_DIR}/js.jar" />
<property description="Folder for jquery, min, lite and packed target" name="DIST_DIR" value="./dist" />
<!-- Files names for distribution -->
<property name="JQ" value="${DIST_DIR}/jquery.js" />
<property name="JQ_LITE" value="${DIST_DIR}/jquery.lite.js" />
<property name="JQ_MIN" value="${DIST_DIR}/jquery.min.js" />
<property name="JQ_PACK" value="${DIST_DIR}/jquery.pack.js" />
<!-- MAIN -->
<target name="jquery" description="Main jquery build, concatenates source files and replaces @VERSION">
<echo message="Building ${JQ}" />
<mkdir dir="${DIST_DIR}" />
<concat destfile="${JQ}">
<fileset dir="${SRC_DIR}" includes="intro.js" />
<fileset dir="${SRC_DIR}" includes="core.js" />
<fileset dir="${SRC_DIR}" includes="selector.js" />
<fileset dir="${SRC_DIR}" includes="event.js" />
<fileset dir="${SRC_DIR}" includes="ajax.js" />
<fileset dir="${SRC_DIR}" includes="fx.js" />
<fileset dir="${SRC_DIR}" includes="offset.js" />
<fileset dir="${SRC_DIR}" includes="outro.js" />
</concat>
<java jar="${JAR}" fork="true">
<arg value="${BUILD_DIR}/build/version.js" />
<arg value="${JQ}" />
</java>
<echo message="${JQ} built." />
</target>
<target name="min" depends="jquery" description="Remove all comments and whitespace, no compression, great in combination with GZip">
<echo message="Building ${JQ_MIN}" />
<java jar="${JAR}" fork="true">
<arg value="${BUILD_DIR}/build/min.js" />
<arg value="${JQ}" />
<arg value="${JQ_MIN}" />
</java>
<echo message="${JQ_MIN} built." />
</target>
<target name="pack" depends="jquery" description="Remove all comments and whitespace and compress">
<echo message="Building ${JQ_PACK}" />
<java jar="${JAR}" fork="true">
<arg value="${BUILD_DIR}/build/pack.js" />
<arg value="${JQ}" />
<arg value="${JQ_PACK}" />
</java>
<echo message="${JQ_PACK} built." />
</target>
<target name="runtest">
<echo message="Running Automated Test Suite" />
<java jar="${JAR}" fork="true">
<arg value="${BUILD_DIR}/runtest/test.js" />
</java>
<echo message="Test Suite Finished" />
</target>
<target name="clean">
<delete dir="${DIST_DIR}" />
</target>
<target name="all" depends="clean,jquery,min,pack">
<echo message="Build complete." />
</target>
</project>

View file

@ -1,5 +0,0 @@
load("build/js/ParseMaster.js", "build/js/pack.js", "build/js/writeFile.js");
var out = readFile( arguments[0] );
writeFile( arguments[1], pack( out, 62, true, false ) );

View file

@ -1,11 +0,0 @@
load("build/js/jsmin.js", "build/js/writeFile.js");
// arguments
var inFile = arguments[0];
var outFile = arguments[1] || inFile.replace(/\.js$/, ".min.js");
var script = readFile(inFile);
var header = script.match(/\/\*(.|\n)*?\*\//)[0];
var minifiedScript = jsmin('', script, 3);
writeFile( outFile, header + minifiedScript );

View file

@ -1,19 +0,0 @@
load("build/js/writeFile.js");
load("build/js/base2.js");
load("build/js/Packer.js");
load("build/js/Words.js");
// arguments
var inFile = arguments[0];
var outFile = arguments[1] || inFile.replace(/\.js$/, ".pack.js");
// options
var base62 = true;
var shrink = true;
var script = readFile(inFile);
var header = script.match(/\/\*(.|\n)*?\*\//)[0];
var packer = new Packer;
var packedScript = packer.pack(script, base62, shrink);
writeFile(outFile, header + "\n" + packedScript);

View file

@ -1,4 +0,0 @@
load("build/js/writeFile.js");
var file = arguments[0];
writeFile(file, readFile(file).replace(new RegExp("@VERSION", "g"), readFile("version.txt").replace( /^\s+|\s+$/g, "" )));

Binary file not shown.

View file

@ -1,209 +0,0 @@
/*
Packer version 3.0 (beta 8) - copyright 2004-2007, Dean Edwards
http://www.opensource.org/licenses/mit-license
*/
eval(base2.namespace);
var IGNORE = RegGrp.IGNORE;
var REMOVE = "";
var SPACE = " ";
var WORDS = /\w+/g;
var Packer = Base.extend({
minify: function(script) {
script = script.replace(Packer.CONTINUE, "");
script = Packer.data.exec(script);
script = Packer.whitespace.exec(script);
script = Packer.clean.exec(script);
return script;
},
pack: function(script, base62, shrink) {
script = this.minify(script + "\n");
if (shrink) script = this._shrinkVariables(script);
if (base62) script = this._base62Encode(script);
return script;
},
_base62Encode: function(script) {
var words = new Words(script);
var encode = function(word) {
return words.fetch(word).encoded;
};
/* build the packed script */
var p = this._escape(script.replace(WORDS, encode));
var a = Math.min(Math.max(words.count(), 2), 62);
var c = words.count();
var k = words;
var e = Packer["ENCODE" + (a > 10 ? a > 36 ? 62 : 36 : 10)];
var r = a > 10 ? "e(c)" : "c";
// the whole thing
return format(Packer.UNPACK, p,a,c,k,e,r);
},
_escape: function(script) {
// single quotes wrap the final string so escape them
// also escape new lines required by conditional comments
return script.replace(/([\\'])/g, "\\$1").replace(/[\r\n]+/g, "\\n");
},
_shrinkVariables: function(script) {
// Windows Scripting Host cannot do regexp.test() on global regexps.
var global = function(regexp) {
// This function creates a global version of the passed regexp.
return new RegExp(regexp.source, "g");
};
var data = []; // encoded strings and regular expressions
var REGEXP = /^[^'"]\//;
var store = function(string) {
var replacement = "#" + data.length;
if (REGEXP.test(string)) {
replacement = string.charAt(0) + replacement;
string = string.slice(1);
}
data.push(string);
return replacement;
};
// Base52 encoding (a-Z)
var encode52 = function(c) {
return (c < 52 ? '' : arguments.callee(parseInt(c / 52))) +
((c = c % 52) > 25 ? String.fromCharCode(c + 39) : String.fromCharCode(c + 97));
};
// identify blocks, particularly identify function blocks (which define scope)
var BLOCK = /(function\s*[\w$]*\s*\(\s*([^\)]*)\s*\)\s*)?(\{([^{}]*)\})/;
var VAR_ = /var\s+/g;
var VAR_NAME = /var\s+[\w$]+/g;
var COMMA = /\s*,\s*/;
var blocks = []; // store program blocks (anything between braces {})
// encoder for program blocks
var encode = function(block, func, args) {
if (func) { // the block is a function block
// decode the function block (THIS IS THE IMPORTANT BIT)
// We are retrieving all sub-blocks and will re-parse them in light
// of newly shrunk variables
block = decode(block);
// create the list of variable and argument names
var vars = match(block, VAR_NAME).join(",").replace(VAR_, "");
var ids = Array2.combine(args.split(COMMA).concat(vars.split(COMMA)));
// process each identifier
var count = 0, shortId;
forEach (ids, function(id) {
id = trim(id);
if (id && id.length > 1) { // > 1 char
id = rescape(id);
// find the next free short name (check everything in the current scope)
do shortId = encode52(count++);
while (new RegExp("[^\\w$.]" + shortId + "[^\\w$:]").test(block));
// replace the long name with the short name
var reg = new RegExp("([^\\w$.])" + id + "([^\\w$:])");
while (reg.test(block)) block = block.replace(global(reg), "$1" + shortId + "$2");
var reg = new RegExp("([^{,])" + id + ":", "g");
block = block.replace(reg, "$1" + shortId + ":");
}
});
}
var replacement = "~" + blocks.length + "~";
blocks.push(block);
return replacement;
};
// decoder for program blocks
var ENCODED = /~(\d+)~/;
var decode = function(script) {
while (ENCODED.test(script)) {
script = script.replace(global(ENCODED), function(match, index) {
return blocks[index];
});
}
return script;
};
// encode strings and regular expressions
script = Packer.data.exec(script, store);
// remove closures (this is for base2 namespaces only)
script = script.replace(/new function\(_\)\s*\{/g, "{;#;");
// encode blocks, as we encode we replace variable and argument names
while (BLOCK.test(script)) {
script = script.replace(global(BLOCK), encode);
}
// put the blocks back
script = decode(script);
// put back the closure (for base2 namespaces only)
script = script.replace(/\{;#;/g, "new function(_){");
// put strings and regular expressions back
script = script.replace(/#(\d+)/g, function(match, index) {
return data[index];
});
return script;
}
}, {
CONTINUE: /\\\r?\n/g,
ENCODE10: "String",
ENCODE36: "function(c){return c.toString(a)}",
ENCODE62: "function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))}",
UNPACK: "eval(function(p,a,c,k,e,r){e=%5;if(!''.replace(/^/,String)){while(c--)r[%6]=k[c]" +
"||%6;k=[function(e){return r[e]}];e=function(){return'\\\\w+'};c=1};while(c--)if(k[c])p=p." +
"replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}('%1',%2,%3,'%4'.split('|'),0,{}))",
init: function() {
this.data = reduce(this.data, function(data, replacement, expression) {
data.store(this.javascript.exec(expression), replacement);
return data;
}, new RegGrp, this);
this.clean = this.data.union(this.clean);
this.whitespace = this.data.union(this.whitespace);
},
clean: {
"\\(\\s*;\\s*;\\s*\\)": "(;;)", // for (;;) loops
"throw[^};]+[};]": IGNORE, // a safari 1.3 bug
";+\\s*([};])": "$1"
},
data: {
// strings
"STRING1": IGNORE,
'STRING2': IGNORE,
"CONDITIONAL": IGNORE, // conditional comments
"(COMMENT1)\\n\\s*(REGEXP)?": "\n$3",
"(COMMENT2)\\s*(REGEXP)?": " $3",
"([\\[(\\^=,{}:;&|!*?])\\s*(REGEXP)": "$1$2"
},
javascript: new RegGrp({
COMMENT1: /(\/\/|;;;)[^\n]*/.source,
COMMENT2: /\/\*[^*]*\*+([^\/][^*]*\*+)*\//.source,
CONDITIONAL: /\/\*@|@\*\/|\/\/@[^\n]*\n/.source,
REGEXP: /\/(\\[\/\\]|[^*\/])(\\.|[^\/\n\\])*\/[gim]*/.source,
STRING1: /'(\\.|[^'\\])*'/.source,
STRING2: /"(\\.|[^"\\])*"/.source
}),
whitespace: {
"(\\d)\\s+(\\.\\s*[a-z\\$_\\[(])": "$1 $2", // http://dean.edwards.name/weblog/2007/04/packer3/#comment84066
"([+-])\\s+([+-])": "$1 $2", // c = a++ +b;
"\\b\\s+\\$\\s+\\b": " $ ", // var $ in
"\\$\\s+\\b": "$ ", // object$ in
"\\b\\s+\\$": " $", // return $object
"\\b\\s+\\b": SPACE,
"\\s+": REMOVE
}
});

View file

@ -1,106 +0,0 @@
/*
ParseMaster, version 1.0.2 (2005-08-19)
Copyright 2005, Dean Edwards
License: http://creativecommons.org/licenses/LGPL/2.1/
*/
/* a multi-pattern parser */
// KNOWN BUG: erroneous behavior when using escapeChar with a replacement value that is a function
function ParseMaster() {
// constants
var $EXPRESSION = 0, $REPLACEMENT = 1, $LENGTH = 2;
// used to determine nesting levels
var $GROUPS = /\(/g, $SUB_REPLACE = /\$\d/, $INDEXED = /^\$\d+$/,
$TRIM = /(['"])\1\+(.*)\+\1\1$/, $$ESCAPE = /\\./g, $QUOTE = /'/,
$$DELETED = /\x01[^\x01]*\x01/g;
var self = this;
// public
this.add = function($expression, $replacement) {
if (!$replacement) $replacement = "";
// count the number of sub-expressions
// - add one because each pattern is itself a sub-expression
var $length = (_internalEscape(String($expression)).match($GROUPS) || "").length + 1;
// does the pattern deal with sub-expressions?
if ($SUB_REPLACE.test($replacement)) {
// a simple lookup? (e.g. "$2")
if ($INDEXED.test($replacement)) {
// store the index (used for fast retrieval of matched strings)
$replacement = parseInt($replacement.slice(1)) - 1;
} else { // a complicated lookup (e.g. "Hello $2 $1")
// build a function to do the lookup
var i = $length;
var $quote = $QUOTE.test(_internalEscape($replacement)) ? '"' : "'";
while (i) $replacement = $replacement.split("$" + i--).join($quote + "+a[o+" + i + "]+" + $quote);
$replacement = new Function("a,o", "return" + $quote + $replacement.replace($TRIM, "$1") + $quote);
}
}
// pass the modified arguments
_add($expression || "/^$/", $replacement, $length);
};
// execute the global replacement
this.exec = function($string) {
_escaped.length = 0;
return _unescape(_escape($string, this.escapeChar).replace(
new RegExp(_patterns, this.ignoreCase ? "gi" : "g"), _replacement), this.escapeChar).replace($$DELETED, "");
};
// clear the patterns collection so that this object may be re-used
this.reset = function() {
_patterns.length = 0;
};
// private
var _escaped = []; // escaped characters
var _patterns = []; // patterns stored by index
var _toString = function(){return "(" + String(this[$EXPRESSION]).slice(1, -1) + ")"};
_patterns.toString = function(){return this.join("|")};
// create and add a new pattern to the patterns collection
function _add() {
arguments.toString = _toString;
// store the pattern - as an arguments object (i think this is quicker..?)
_patterns[_patterns.length] = arguments;
}
// this is the global replace function (it's quite complicated)
function _replacement() {
if (!arguments[0]) return "";
var i = 1, j = 0, $pattern;
// loop through the patterns
while ($pattern = _patterns[j++]) {
// do we have a result?
if (arguments[i]) {
var $replacement = $pattern[$REPLACEMENT];
switch (typeof $replacement) {
case "function": return $replacement(arguments, i);
case "number": return arguments[$replacement + i];
}
var $delete = (arguments[i].indexOf(self.escapeChar) == -1) ? "" :
"\x01" + arguments[i] + "\x01";
return $delete + $replacement;
// skip over references to sub-expressions
} else i += $pattern[$LENGTH];
}
};
// encode escaped characters
function _escape($string, $escapeChar) {
return $escapeChar ? $string.replace(new RegExp("\\" + $escapeChar + "(.)", "g"), function($match, $char) {
_escaped[_escaped.length] = $char;
return $escapeChar;
}) : $string;
};
// decode escaped characters
function _unescape($string, $escapeChar) {
var i = 0;
return $escapeChar ? $string.replace(new RegExp("\\" + $escapeChar, "g"), function() {
return $escapeChar + (_escaped[i++] || "");
}) : $string;
};
function _internalEscape($string) {
return $string.replace($$ESCAPE, "");
};
};
ParseMaster.prototype = {
constructor: ParseMaster,
ignoreCase: false,
escapeChar: ""
};

View file

@ -1,62 +0,0 @@
var Words = Collection.extend({
constructor: function(script) {
this.base();
forEach (script.match(WORDS), this.add, this);
this.encode();
},
add: function(word) {
if (!this.exists(word)) this.base(word);
word = this.fetch(word);
word.count++;
return word;
},
encode: function() {
// sort by frequency
this.sort(function(word1, word2) {
return word2.count - word1.count;
});
eval("var a=62,e=" + Packer.ENCODE62);
var encode = e;
var encoded = new Collection; // a dictionary of base62 -> base10
var count = this.count();
for (var i = 0; i < count; i++) {
encoded.store(encode(i), i);
}
var empty = function() {return ""};
var index = 0;
forEach (this, function(word) {
if (encoded.exists(word)) {
word.index = encoded.fetch(word);
word.toString = empty;
} else {
while (this.exists(encode(index))) index++;
word.index = index++;
}
word.encoded = encode(word.index);
}, this);
// sort by encoding
this.sort(function(word1, word2) {
return word1.index - word2.index;
});
},
toString: function() {
return this.values().join("|");
}
}, {
Item: {
constructor: function(word) {
this.toString = function() {return word};
},
count: 0,
encoded: "",
index: -1
}
});

View file

@ -1,978 +0,0 @@
// timestamp: Tue, 01 May 2007 19:13:00
/*
base2.js - copyright 2007, Dean Edwards
http://www.opensource.org/licenses/mit-license
*/
var base2 = {};
// You know, writing a javascript library is awfully time consuming.
new function(_) { //////////////////// BEGIN: CLOSURE ////////////////////
// =========================================================================
// base2/Base.js
// =========================================================================
// version 1.1
var Base = function() {
// call this method from any other method to invoke that method's ancestor
};
Base.prototype = {
extend: function(source) {
if (arguments.length > 1) { // extending with a name/value pair
var ancestor = this[source];
var value = arguments[1];
if (typeof value == "function" && ancestor && /\bbase\b/.test(value)) {
var method = value;
value = function() { // override
var previous = this.base;
this.base = ancestor;
var returnValue = method.apply(this, arguments);
this.base = previous;
return returnValue;
};
value.method = method;
value.ancestor = ancestor;
}
this[source] = value;
} else if (source) { // extending with an object literal
var extend = Base.prototype.extend;
if (Base._prototyping) {
var key, i = 0, members = ["constructor", "toString", "valueOf"];
while (key = members[i++]) if (source[key] != Object.prototype[key]) {
extend.call(this, key, source[key]);
}
} else if (typeof this != "function") {
// if the object has a customised extend() method then use it
extend = this.extend || extend;
}
// copy each of the source object's properties to this object
for (key in source) if (!Object.prototype[key]) {
extend.call(this, key, source[key]);
}
}
return this;
},
base: Base
};
Base.extend = function(_instance, _static) { // subclass
var extend = Base.prototype.extend;
// build the prototype
Base._prototyping = true;
var proto = new this;
extend.call(proto, _instance);
delete Base._prototyping;
// create the wrapper for the constructor function
var constructor = proto.constructor;
var klass = proto.constructor = function() {
if (!Base._prototyping) {
if (this._constructing || this.constructor == klass) { // instantiation
this._constructing = true;
constructor.apply(this, arguments);
delete this._constructing;
} else { // casting
var object = arguments[0];
if (object != null) {
(object.extend || extend).call(object, proto);
}
return object;
}
}
};
// build the class interface
for (var i in Base) klass[i] = this[i];
klass.ancestor = this;
klass.base = Base.base;
klass.prototype = proto;
klass.toString = this.toString;
extend.call(klass, _static);
// class initialisation
if (typeof klass.init == "function") klass.init();
return klass;
};
// initialise
Base = Base.extend({
constructor: function() {
this.extend(arguments[0]);
}
}, {
ancestor: Object,
base: Base,
implement: function(_interface) {
if (typeof _interface == "function") {
// if it's a function, call it
_interface(this.prototype);
} else {
// add the interface using the extend() method
this.prototype.extend(_interface);
}
return this;
}
});
// =========================================================================
// lang/main.js
// =========================================================================
var Legacy = typeof $Legacy == "undefined" ? {} : $Legacy;
var K = function(k) {return k};
var assert = function(condition, message, Err) {
if (!condition) {
throw new (Err || Error)(message || "Assertion failed.");
}
};
var assertType = function(object, type, message) {
if (type) {
var condition = typeof type == "function" ? instanceOf(object, type) : typeof object == type;
assert(condition, message || "Invalid type.", TypeError);
}
};
var copy = function(object) {
var fn = new Function;
fn.prototype = object;
return new fn;
};
var format = function(string) {
// replace %n with arguments[n]
// e.g. format("%1 %2%3 %2a %1%3", "she", "se", "lls");
// ==> "she sells sea shells"
// only supports nine replacements: %1 - %9
var args = arguments;
return String(string).replace(/%([1-9])/g, function(match, index) {
return index < args.length ? args[index] : match;
});
};
var $instanceOf = Legacy.instanceOf || new Function("o,k", "return o instanceof k");
var instanceOf = function(object, klass) {
assertType(klass, "function", "Invalid 'instanceOf' operand.");
if ($instanceOf(object, klass)) return true;
// handle exceptions where the target object originates from another frame
// this is handy for JSON parsing (amongst other things)
if (object != null) switch (klass) {
case Object:
return true;
case Number:
case Boolean:
case Function:
case String:
return typeof object == typeof klass.prototype.valueOf();
case Array:
// this is the only troublesome one
return !!(object.join && object.splice && !arguments.callee(object, Function));
case Date:
return !!object.getTimezoneOffset;
case RegExp:
return String(object.constructor.prototype) == String(new RegExp);
}
return false;
};
var match = function(string, expression) {
// same as String.match() except that this function will return an empty
// array if there is no match
return String(string).match(expression) || [];
};
var RESCAPE = /([\/()[\]{}|*+-.,^$?\\])/g;
var rescape = function(string) {
// make a string safe for creating a RegExp
return String(string).replace(RESCAPE, "\\$1");
};
var $slice = Array.prototype.slice;
var slice = function(object) {
// slice an array-like object
return $slice.apply(object, $slice.call(arguments, 1));
};
var TRIM = /^\s+|\s+$/g;
var trim = function(string) {
return String(string).replace(TRIM, "");
};
// =========================================================================
// lang/extend.js
// =========================================================================
var base = function(object, args) {
// invoke the base method with all supplied arguments
return object.base.apply(object, args);
};
var extend = function(object) {
assert(object != Object.prototype, "Object.prototype is verboten!");
return Base.prototype.extend.apply(object, slice(arguments, 1));
};
// =========================================================================
// lang/assignID.js
// =========================================================================
var $ID = 1;
var assignID = function(object) {
// assign a unique id
if (!object.base2ID) object.base2ID = "b2_" + $ID++;
return object.base2ID;
};
// =========================================================================
// lang/forEach.js
// =========================================================================
if (typeof StopIteration == "undefined") {
StopIteration = new Error("StopIteration");
}
var forEach = function(object, block, context) {
if (object == null) return;
if (typeof object == "function") {
// functions are a special case
var fn = Function;
} else if (typeof object.forEach == "function" && object.forEach != arguments.callee) {
// the object implements a custom forEach method
object.forEach(block, context);
return;
} else if (typeof object.length == "number") {
// the object is array-like
forEach.Array(object, block, context);
return;
}
forEach.Function(fn || Object, object, block, context);
};
// these are the two core enumeration methods. all other forEach methods
// eventually call one of these two.
forEach.Array = function(array, block, context) {
var i, length = array.length; // preserve
if (typeof array == "string") {
for (i = 0; i < length; i++) {
block.call(context, array.charAt(i), i, array);
}
} else {
for (i = 0; i < length; i++) {
block.call(context, array[i], i, array);
}
}
};
forEach.Function = Legacy.forEach || function(fn, object, block, context) {
// enumerate an object and compare its keys with fn's prototype
for (var key in object) {
if (fn.prototype[key] === undefined) {
block.call(context, object[key], key, object);
}
}
};
// =========================================================================
// base2/Base/forEach.js
// =========================================================================
Base.forEach = function(object, block, context) {
forEach.Function(this, object, block, context);
};
// =========================================================================
// base2/../Function.js
// =========================================================================
// some browsers don't define this
Function.prototype.prototype = {};
// =========================================================================
// base2/../String.js
// =========================================================================
// fix String.replace (Safari/IE5.0)
if ("".replace(/^/, String)) {
extend(String.prototype, "replace", function(expression, replacement) {
if (typeof replacement == "function") { // Safari doesn't like functions
if (instanceOf(expression, RegExp)) {
var regexp = expression;
var global = regexp.global;
if (global == null) global = /(g|gi)$/.test(regexp);
// we have to convert global RexpExps for exec() to work consistently
if (global) regexp = new RegExp(regexp.source); // non-global
} else {
regexp = new RegExp(rescape(expression));
}
var match, string = this, result = "";
while (string && (match = regexp.exec(string))) {
result += string.slice(0, match.index) + replacement.apply(this, match);
string = string.slice(match.index + match[0].length);
if (!global) break;
}
return result + string;
} else {
return base(this, arguments);
}
});
}
// =========================================================================
// base2/Abstract.js
// =========================================================================
var Abstract = Base.extend({
constructor: function() {
throw new TypeError("Class cannot be instantiated.");
}
});
// =========================================================================
// base2/Module.js
// =========================================================================
// based on ruby's Module class and Mozilla's Array generics:
// http://www.ruby-doc.org/core/classes/Module.html
// http://developer.mozilla.org/en/docs/New_in_JavaScript_1.6#Array_and_String_generics
// A Module is used as the basis for creating interfaces that can be
// applied to other classes. *All* properties and methods are static.
// When a module is used as a mixin, methods defined on what would normally be
// the instance interface become instance methods of the target object.
// Modules cannot be instantiated. Static properties and methods are inherited.
var Module = Abstract.extend(null, {
extend: function(_interface, _static) {
// extend a module to create a new module
var module = this.base();
// inherit static methods
forEach (this, function(property, name) {
if (!Module[name] && name != "init") {
extend(module, name, property);
}
});
// implement module (instance AND static) methods
module.implement(_interface);
// implement static properties and methods
extend(module, _static);
// Make the submarine noises Larry!
if (typeof module.init == "function") module.init();
return module;
},
implement: function(_interface) {
// implement an interface on BOTH the instance and static interfaces
var module = this;
if (typeof _interface == "function") {
module.base(_interface);
forEach (_interface, function(property, name) {
if (!Module[name] && name != "init") {
extend(module, name, property);
}
});
} else {
// create the instance interface
Base.forEach (extend({}, _interface), function(property, name) {
// instance methods call the equivalent static method
if (typeof property == "function") {
property = function() {
base; // force inheritance
return module[name].apply(module, [this].concat(slice(arguments)));
};
}
if (!Module[name]) extend(this, name, property);
}, module.prototype);
// add the static interface
extend(module, _interface);
}
return module;
}
});
// =========================================================================
// base2/Enumerable.js
// =========================================================================
var Enumerable = Module.extend({
every: function(object, test, context) {
var result = true;
try {
this.forEach (object, function(value, key) {
result = test.call(context, value, key, object);
if (!result) throw StopIteration;
});
} catch (error) {
if (error != StopIteration) throw error;
}
return !!result; // cast to boolean
},
filter: function(object, test, context) {
return this.reduce(object, function(result, value, key) {
if (test.call(context, value, key, object)) {
result[result.length] = value;
}
return result;
}, new Array2);
},
invoke: function(object, method) {
// apply a method to each item in the enumerated object
var args = slice(arguments, 2);
return this.map(object, (typeof method == "function") ? function(item) {
if (item != null) return method.apply(item, args);
} : function(item) {
if (item != null) return item[method].apply(item, args);
});
},
map: function(object, block, context) {
var result = new Array2;
this.forEach (object, function(value, key) {
result[result.length] = block.call(context, value, key, object);
});
return result;
},
pluck: function(object, key) {
return this.map(object, function(item) {
if (item != null) return item[key];
});
},
reduce: function(object, block, result, context) {
this.forEach (object, function(value, key) {
result = block.call(context, result, value, key, object);
});
return result;
},
some: function(object, test, context) {
return !this.every(object, function(value, key) {
return !test.call(context, value, key, object);
});
}
}, {
forEach: forEach
});
// =========================================================================
// base2/Array2.js
// =========================================================================
// The IArray module implements all Array methods.
// This module is not public but its methods are accessible through the Array2 object (below).
var IArray = Module.extend({
combine: function(keys, values) {
// combine two arrays to make a hash
if (!values) values = keys;
return this.reduce(keys, function(object, key, index) {
object[key] = values[index];
return object;
}, {});
},
copy: function(array) {
return this.concat(array);
},
contains: function(array, item) {
return this.indexOf(array, item) != -1;
},
forEach: forEach.Array,
indexOf: function(array, item, fromIndex) {
var length = array.length;
if (fromIndex == null) {
fromIndex = 0;
} else if (fromIndex < 0) {
fromIndex = Math.max(0, length + fromIndex);
}
for (var i = fromIndex; i < length; i++) {
if (array[i] === item) return i;
}
return -1;
},
insertAt: function(array, item, index) {
this.splice(array, index, 0, item);
return item;
},
insertBefore: function(array, item, before) {
var index = this.indexOf(array, before);
if (index == -1) this.push(array, item);
else this.splice(array, index, 0, item);
return item;
},
lastIndexOf: function(array, item, fromIndex) {
var length = array.length;
if (fromIndex == null) {
fromIndex = length - 1;
} else if (from < 0) {
fromIndex = Math.max(0, length + fromIndex);
}
for (var i = fromIndex; i >= 0; i--) {
if (array[i] === item) return i;
}
return -1;
},
remove: function(array, item) {
var index = this.indexOf(array, item);
if (index != -1) this.removeAt(array, index);
return item;
},
removeAt: function(array, index) {
var item = array[index];
this.splice(array, index, 1);
return item;
}
});
IArray.prototype.forEach = function(block, context) {
forEach.Array(this, block, context);
};
IArray.implement(Enumerable);
forEach ("concat,join,pop,push,reverse,shift,slice,sort,splice,unshift".split(","), function(name) {
IArray[name] = function(array) {
return Array.prototype[name].apply(array, slice(arguments, 1));
};
});
// create a faux constructor that augments the built-in Array object
var Array2 = function() {
return IArray(this.constructor == IArray ? Array.apply(null, arguments) : arguments[0]);
};
// expose IArray.prototype so that it can be extended
Array2.prototype = IArray.prototype;
forEach (IArray, function(method, name, proto) {
if (Array[name]) {
IArray[name] = Array[name];
delete IArray.prototype[name];
}
Array2[name] = IArray[name];
});
// =========================================================================
// base2/Hash.js
// =========================================================================
var HASH = "#" + Number(new Date);
var KEYS = HASH + "keys";
var VALUES = HASH + "values";
var Hash = Base.extend({
constructor: function(values) {
this[KEYS] = new Array2;
this[VALUES] = {};
this.merge(values);
},
copy: function() {
var copy = new this.constructor(this);
Base.forEach (this, function(property, name) {
if (typeof property != "function" && name.charAt(0) != "#") {
copy[name] = property;
}
});
return copy;
},
// ancient browsers throw an error when we use "in" as an operator
// so we must create the function dynamically
exists: Legacy.exists || new Function("k", format("return('%1'+k)in this['%2']", HASH, VALUES)),
fetch: function(key) {
return this[VALUES][HASH + key];
},
forEach: function(block, context) {
forEach (this[KEYS], function(key) {
block.call(context, this.fetch(key), key, this);
}, this);
},
keys: function(index, length) {
var keys = this[KEYS] || new Array2;
switch (arguments.length) {
case 0: return keys.copy();
case 1: return keys[index];
default: return keys.slice(index, length);
}
},
merge: function(values) {
forEach (arguments, function(values) {
forEach (values, function(value, key) {
this.store(key, value);
}, this);
}, this);
return this;
},
remove: function(key) {
var value = this.fetch(key);
this[KEYS].remove(String(key));
delete this[VALUES][HASH + key];
return value;
},
store: function(key, value) {
if (arguments.length == 1) value = key;
// only store the key for a new entry
if (!this.exists(key)) {
this[KEYS].push(String(key));
}
// create the new entry (or overwrite the old entry)
this[VALUES][HASH + key] = value;
return value;
},
toString: function() {
return String(this[KEYS]);
},
union: function(values) {
return this.merge.apply(this.copy(), arguments);
},
values: function(index, length) {
var values = this.map(K);
switch (arguments.length) {
case 0: return values;
case 1: return values[index];
default: return values.slice(index, length);
}
}
});
Hash.implement(Enumerable);
// =========================================================================
// base2/Collection.js
// =========================================================================
// A Hash that is more array-like (accessible by index).
// Collection classes have a special (optional) property: Item
// The Item property points to a constructor function.
// Members of the collection must be an instance of Item.
// e.g.
// var Dates = Collection.extend(); // create a collection class
// Dates.Item = Date; // only JavaScript Date objects allowed as members
// var appointments = new Dates(); // instantiate the class
// appointments.add(appointmentId, new Date); // add a date
// appointments.add(appointmentId, "tomorrow"); // ERROR!
// The static create() method is responsible for all construction of collection items.
// Instance methods that add new items (add, store, insertAt, replaceAt) pass *all* of their arguments
// to the static create() method. If you want to modify the way collection items are
// created then you only need to override this method for custom collections.
var Collection = Hash.extend({
add: function(key, item) {
// Duplicates not allowed using add().
// - but you can still overwrite entries using store()
assert(!this.exists(key), "Duplicate key.");
return this.store.apply(this, arguments);
},
count: function() {
return this[KEYS].length;
},
indexOf: function(key) {
return this[KEYS].indexOf(String(key));
},
insertAt: function(index, key, item) {
assert(!this.exists(key), "Duplicate key.");
this[KEYS].insertAt(index, String(key));
return this.store.apply(this, slice(arguments, 1));
},
item: function(index) {
return this.fetch(this[KEYS][index]);
},
removeAt: function(index) {
return this.remove(this[KEYS][index]);
},
reverse: function() {
this[KEYS].reverse();
return this;
},
sort: function(compare) {
if (compare) {
var self = this;
this[KEYS].sort(function(key1, key2) {
return compare(self.fetch(key1), self.fetch(key2), key1, key2);
});
} else this[KEYS].sort();
return this;
},
store: function(key, item) {
if (arguments.length == 1) item = key;
item = this.constructor.create.apply(this.constructor, arguments);
return this.base(key, item);
},
storeAt: function(index, item) {
//-dean: get rid of this?
assert(index < this.count(), "Index out of bounds.");
arguments[0] = this[KEYS][index];
return this.store.apply(this, arguments);
}
}, {
Item: null, // if specified, all members of the Collection must be instances of Item
create: function(key, item) {
if (this.Item && !instanceOf(item, this.Item)) {
item = new this.Item(key, item);
}
return item;
},
extend: function(_instance, _static) {
var klass = this.base(_instance);
klass.create = this.create;
extend(klass, _static);
if (!klass.Item) {
klass.Item = this.Item;
} else if (typeof klass.Item != "function") {
klass.Item = (this.Item || Base).extend(klass.Item);
}
if (typeof klass.init == "function") klass.init();
return klass;
}
});
// =========================================================================
// base2/RegGrp.js
// =========================================================================
var RegGrp = Collection.extend({
constructor: function(values, flags) {
this.base(values);
if (typeof flags == "string") {
this.global = /g/.test(flags);
this.ignoreCase = /i/.test(flags);
}
},
global: true, // global is the default setting
ignoreCase: false,
exec: function(string, replacement) {
if (arguments.length == 1) {
var keys = this[KEYS];
var values = this[VALUES];
replacement = function(match) {
if (!match) return "";
var offset = 1, i = 0;
// loop through the values
while (match = values[HASH + keys[i++]]) {
// do we have a result?
if (arguments[offset]) {
var replacement = match.replacement;
switch (typeof replacement) {
case "function":
return replacement.apply(null, slice(arguments, offset));
case "number":
return arguments[offset + replacement];
default:
return replacement;
}
// no? then skip over references to sub-expressions
} else offset += match.length + 1;
}
};
}
var flags = (this.global ? "g" : "") + (this.ignoreCase ? "i" : "");
return String(string).replace(new RegExp(this, flags), replacement);
},
test: function(string) {
return this.exec(string) != string;
},
toString: function() {
var length = 0;
return "(" + this.map(function(item) {
// fix back references
var expression = String(item).replace(/\\(\d+)/g, function($, index) {
return "\\" + (1 + Number(index) + length);
});
length += item.length + 1;
return expression;
}).join(")|(") + ")";
}
}, {
IGNORE: "$0",
init: function() {
forEach ("add,exists,fetch,remove,store".split(","), function(name) {
extend(this, name, function(expression) {
if (instanceOf(expression, RegExp)) {
expression = expression.source;
}
return base(this, arguments);
});
}, this.prototype);
}
});
// =========================================================================
// base2/RegGrp/Item.js
// =========================================================================
RegGrp.Item = Base.extend({
constructor: function(expression, replacement) {
var ESCAPE = /\\./g;
var STRING = /(['"])\1\+(.*)\+\1\1$/;
expression = instanceOf(expression, RegExp) ? expression.source : String(expression);
if (typeof replacement == "number") replacement = String(replacement);
else if (replacement == null) replacement = "";
// count the number of sub-expressions
// - add one because each pattern is itself a sub-expression
this.length = match(expression.replace(ESCAPE, "").replace(/\[[^\]]+\]/g, ""), /\(/g).length;
// does the pattern use sub-expressions?
if (typeof replacement == "string" && /\$(\d+)/.test(replacement)) {
// a simple lookup? (e.g. "$2")
if (/^\$\d+$/.test(replacement)) {
// store the index (used for fast retrieval of matched strings)
replacement = parseInt(replacement.slice(1));
} else { // a complicated lookup (e.g. "Hello $2 $1")
// build a function to do the lookup
var i = this.length + 1;
var Q = /'/.test(replacement.replace(ESCAPE, "")) ? '"' : "'";
replacement = replacement.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\$(\d+)/g, Q +
"+(arguments[$1]||" + Q+Q + ")+" + Q);
replacement = new Function("return " + Q + replacement.replace(STRING, "$1") + Q);
}
}
this.replacement = replacement;
this.toString = function() {
return expression || "";
};
},
length: 0,
replacement: ""
});
// =========================================================================
// base2/Namespace.js
// =========================================================================
var Namespace = Base.extend({
constructor: function(_private, _public) {
this.extend(_public);
this.toString = function() {
return format("[base2.%1]", this.name);
};
// initialise
if (typeof this.init == "function") this.init();
if (this.name != "base2") {
this.namespace = format("var %1=base2.%1;", this.name);
}
var namespace = "var base=" + base + ";";
var imports = ("base2,lang," + this.imports).split(",");
_private.imports = Enumerable.reduce(imports, function(namespace, name) {
if (base2[name]) namespace += base2[name].namespace;
return namespace;
}, namespace);
var namespace = format("base2.%1=%1;", this.name);
var exports = this.exports.split(",");
_private.exports = Enumerable.reduce(exports, function(namespace, name) {
if (name) {
this.namespace += format("var %2=%1.%2;", this.name, name);
namespace += format("if(!%1.%2)%1.%2=%2;base2.%2=%1.%2;", this.name, name);
}
return namespace;
}, namespace, this);
if (this.name != "base2") {
base2.namespace += format("var %1=base2.%1;", this.name);
}
},
exports: "",
imports: "",
namespace: "",
name: ""
});
base2 = new Namespace(this, {
name: "base2",
version: "0.8 (alpha)",
exports: "Base,Abstract,Module,Enumerable,Array2,Hash,Collection,RegGrp,Namespace"
});
base2.toString = function() {
return "[base2]";
};
eval(this.exports);
// =========================================================================
// base2/lang/namespace.js
// =========================================================================
var lang = new Namespace(this, {
name: "lang",
version: base2.version,
exports: "K,assert,assertType,assignID,copy,instanceOf,extend,format,forEach,match,rescape,slice,trim",
init: function() {
this.extend = extend;
// add the Enumerable methods to the lang object
forEach (Enumerable.prototype, function(method, name) {
if (!Module[name]) {
this[name] = function() {
return Enumerable[name].apply(Enumerable, arguments);
};
this.exports += "," + name;
}
}, this);
}
});
eval(this.exports);
base2.namespace += lang.namespace;
}; //////////////////// END: CLOSURE /////////////////////////////////////

View file

@ -1,316 +0,0 @@
/* jsmin.js - 2006-08-31
Author: Franck Marcia
This work is an adaptation of jsminc.c published by Douglas Crockford.
Permission is hereby granted to use the Javascript version under the same
conditions as the jsmin.c on which it is based.
jsmin.c
2006-05-04
Copyright (c) 2002 Douglas Crockford (www.crockford.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Update:
add level:
1: minimal, keep linefeeds if single
2: normal, the standard algorithm
3: agressive, remove any linefeed and doesn't take care of potential
missing semicolons (can be regressive)
store stats
jsmin.oldSize
jsmin.newSize
*/
String.prototype.has = function(c) {
return this.indexOf(c) > -1;
};
function jsmin(comment, input, level) {
if (input === undefined) {
input = comment;
comment = '';
level = 2;
} else if (level === undefined || level < 1 || level > 3) {
level = 2;
}
if (comment.length > 0) {
comment += '\n';
}
var a = '',
b = '',
EOF = -1,
LETTERS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
DIGITS = '0123456789',
ALNUM = LETTERS + DIGITS + '_$\\',
theLookahead = EOF;
/* isAlphanum -- return true if the character is a letter, digit, underscore,
dollar sign, or non-ASCII character.
*/
function isAlphanum(c) {
return c != EOF && (ALNUM.has(c) || c.charCodeAt(0) > 126);
}
/* get -- return the next character. Watch out for lookahead. If the
character is a control character, translate it to a space or
linefeed.
*/
function get() {
var c = theLookahead;
if (get.i == get.l) {
return EOF;
}
theLookahead = EOF;
if (c == EOF) {
c = input.charAt(get.i);
++get.i;
}
if (c >= ' ' || c == '\n') {
return c;
}
if (c == '\r') {
return '\n';
}
return ' ';
}
get.i = 0;
get.l = input.length;
/* peek -- get the next character without getting it.
*/
function peek() {
theLookahead = get();
return theLookahead;
}
/* next -- get the next character, excluding comments. peek() is used to see
if a '/' is followed by a '/' or '*'.
*/
function next() {
var c = get();
if (c == '/') {
switch (peek()) {
case '/':
for (;;) {
c = get();
if (c <= '\n') {
return c;
}
}
break;
case '*':
get();
for (;;) {
switch (get()) {
case '*':
if (peek() == '/') {
get();
return ' ';
}
break;
case EOF:
throw 'Error: Unterminated comment.';
}
}
break;
default:
return c;
}
}
return c;
}
/* action -- do something! What you do is determined by the argument:
1 Output A. Copy B to A. Get the next B.
2 Copy B to A. Get the next B. (Delete A).
3 Get the next B. (Delete B).
action treats a string as a single character. Wow!
action recognizes a regular expression if it is preceded by ( or , or =.
*/
function action(d) {
var r = [];
if (d == 1) {
r.push(a);
}
if (d < 3) {
a = b;
if (a == '\'' || a == '"') {
for (;;) {
r.push(a);
a = get();
if (a == b) {
break;
}
if (a <= '\n') {
throw 'Error: unterminated string literal: ' + a;
}
if (a == '\\') {
r.push(a);
a = get();
}
}
}
}
b = next();
if (b == '/' && '(,=:[!&|'.has(a)) {
r.push(a);
r.push(b);
for (;;) {
a = get();
if (a == '/') {
break;
} else if (a =='\\') {
r.push(a);
a = get();
} else if (a <= '\n') {
throw 'Error: unterminated Regular Expression literal';
}
r.push(a);
}
b = next();
}
return r.join('');
}
/* m -- Copy the input to the output, deleting the characters which are
insignificant to JavaScript. Comments will be removed. Tabs will be
replaced with spaces. Carriage returns will be replaced with
linefeeds.
Most spaces and linefeeds will be removed.
*/
function m() {
var r = [];
a = '\n';
r.push(action(3));
while (a != EOF) {
switch (a) {
case ' ':
if (isAlphanum(b)) {
r.push(action(1));
} else {
r.push(action(2));
}
break;
case '\n':
switch (b) {
case '{':
case '[':
case '(':
case '+':
case '-':
r.push(action(1));
break;
case ' ':
r.push(action(3));
break;
default:
if (isAlphanum(b)) {
r.push(action(1));
} else {
if (level == 1 && b != '\n') {
r.push(action(1));
} else {
r.push(action(2));
}
}
}
break;
default:
switch (b) {
case ' ':
if (isAlphanum(a)) {
r.push(action(1));
break;
}
r.push(action(3));
break;
case '\n':
if (level == 1 && a != '\n') {
r.push(action(1));
} else {
switch (a) {
case '}':
case ']':
case ')':
case '+':
case '-':
case '"':
case '\'':
if (level == 3) {
r.push(action(3));
} else {
r.push(action(1));
}
break;
default:
if (isAlphanum(a)) {
r.push(action(1));
} else {
r.push(action(3));
}
}
}
break;
default:
r.push(action(1));
break;
}
}
}
return r.join('');
}
jsmin.oldSize = input.length;
var r = m(input);
jsmin.newSize = r.length;
return comment + r;
}

View file

@ -1,117 +0,0 @@
/*
json.js
2006-04-28
This file adds these methods to JavaScript:
object.toJSONString()
This method produces a JSON text from an object. The
object must not contain any cyclical references.
array.toJSONString()
This method produces a JSON text from an array. The
array must not contain any cyclical references.
string.parseJSON()
This method parses a JSON text to produce an object or
array. It will return false if there is an error.
*/
(function () {
var m = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
},
s = {
array: function (x) {
var a = ['['], b, f, i, l = x.length, v;
for (i = 0; i < l; i += 1) {
v = x[i];
f = s[typeof v];
if (f) {
v = f(v);
if (typeof v == 'string') {
if (b) {
a[a.length] = ',';
}
a[a.length] = v;
b = true;
}
}
}
a[a.length] = ']';
return a.join('');
},
'boolean': function (x) {
return String(x);
},
'null': function (x) {
return "null";
},
number: function (x) {
return isFinite(x) ? String(x) : 'null';
},
object: function (x) {
if (x) {
if (x instanceof Array) {
return s.array(x);
}
var a = ['{'], b, f, i, v;
for (i in x) {
v = x[i];
f = s[typeof v];
if (f) {
v = f(v);
if (typeof v == 'string') {
if (b) {
a[a.length] = ',';
}
a.push(s.string(i), ':', v);
b = true;
}
}
}
a[a.length] = '}';
return a.join('');
}
return 'null';
},
string: function (x) {
if (/["\\\x00-\x1f]/.test(x)) {
x = x.replace(/([\x00-\x1f\\"])/g, function(a, b) {
var c = m[b];
if (c) {
return c;
}
c = b.charCodeAt();
return '\\u00' +
Math.floor(c / 16).toString(16) +
(c % 16).toString(16);
});
}
return '"' + x + '"';
}
};
Object.toJSON = function(obj) {
return s.object(obj);
};
})();
String.prototype.parseJSON = function () {
try {
return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(
this.replace(/"(\\.|[^"\\])*"/g, ''))) &&
eval('(' + this + ')');
} catch (e) {
return false;
}
};

View file

@ -1,316 +0,0 @@
/*
packer, version 2.0.2 (2005-08-19)
Copyright 2004-2005, Dean Edwards
License: http://creativecommons.org/licenses/LGPL/2.1/
*/
function pack(_script, _encoding, _fastDecode, _specialChars) {
// constants
var $IGNORE = "$1";
// validate parameters
_script += "\n";
_encoding = Math.min(parseInt(_encoding), 95);
// apply all parsing routines
function _pack($script) {
var i, $parse;
for (i = 0; ($parse = _parsers[i]); i++) {
$script = $parse($script);
}
return $script;
};
// unpacking function - this is the boot strap function
// data extracted from this packing routine is passed to
// this function when decoded in the target
var _unpack = function($packed, $ascii, $count, $keywords, $encode, $decode) {
while ($count--)
if ($keywords[$count])
$packed = $packed.replace(new RegExp('\\b' + $encode($count) + '\\b', 'g'), $keywords[$count]);
return $packed;
};
// code-snippet inserted into the unpacker to speed up decoding
var _decode = function() {
// does the browser support String.replace where the
// replacement value is a function?
if (!''.replace(/^/, String)) {
// decode all the values we need
while ($count--) $decode[$encode($count)] = $keywords[$count] || $encode($count);
// global replacement function
$keywords = [function($encoded){return $decode[$encoded]}];
// generic match
$encode = function(){return'\\w+'};
// reset the loop counter - we are now doing a global replace
$count = 1;
}
};
// keep a list of parsing functions, they'll be executed all at once
var _parsers = [];
function _addParser($parser) {
_parsers[_parsers.length] = $parser;
};
// zero encoding - just removal of white space and comments
function _basicCompression($script) {
var $parser = new ParseMaster;
// make safe
$parser.escapeChar = "\\";
// protect strings
$parser.add(/'[^'\n\r]*'/, $IGNORE);
$parser.add(/"[^"\n\r]*"/, $IGNORE);
// remove comments
$parser.add(/\/\/[^\n\r]*[\n\r]/, " ");
$parser.add(/\/\*[^*]*\*+([^\/][^*]*\*+)*\//, " ");
// protect regular expressions
$parser.add(/\s+(\/[^\/\n\r\*][^\/\n\r]*\/g?i?)/, "$2"); // IGNORE
$parser.add(/[^\w\x24\/'"*)\?:]\/[^\/\n\r\*][^\/\n\r]*\/g?i?/, $IGNORE);
// remove: ;;; doSomething();
if (_specialChars) $parser.add(/;;;[^\n\r]+[\n\r]/);
// remove redundant semi-colons
$parser.add(/\(;;\)/, $IGNORE); // protect for (;;) loops
$parser.add(/;+\s*([};])/, "$2");
// apply the above
$script = $parser.exec($script);
// remove white-space
$parser.add(/(\b|\x24)\s+(\b|\x24)/, "$2 $3");
$parser.add(/([+\-])\s+([+\-])/, "$2 $3");
$parser.add(/\s+/, "");
// done
return $parser.exec($script);
};
function _encodeSpecialChars($script) {
var $parser = new ParseMaster;
// replace: $name -> n, $$name -> na
$parser.add(/((\x24+)([a-zA-Z$_]+))(\d*)/, function($match, $offset) {
var $length = $match[$offset + 2].length;
var $start = $length - Math.max($length - $match[$offset + 3].length, 0);
return $match[$offset + 1].substr($start, $length) + $match[$offset + 4];
});
// replace: _name -> _0, double-underscore (__name) is ignored
var $regexp = /\b_[A-Za-z\d]\w*/;
// build the word list
var $keywords = _analyze($script, _globalize($regexp), _encodePrivate);
// quick ref
var $encoded = $keywords.$encoded;
$parser.add($regexp, function($match, $offset) {
return $encoded[$match[$offset]];
});
return $parser.exec($script);
};
function _encodeKeywords($script) {
// escape high-ascii values already in the script (i.e. in strings)
if (_encoding > 62) $script = _escape95($script);
// create the parser
var $parser = new ParseMaster;
var $encode = _getEncoder(_encoding);
// for high-ascii, don't encode single character low-ascii
var $regexp = (_encoding > 62) ? /\w\w+/ : /\w+/;
// build the word list
$keywords = _analyze($script, _globalize($regexp), $encode);
var $encoded = $keywords.$encoded;
// encode
$parser.add($regexp, function($match, $offset) {
return $encoded[$match[$offset]];
});
// if encoded, wrap the script in a decoding function
return $script && _bootStrap($parser.exec($script), $keywords);
};
function _analyze($script, $regexp, $encode) {
// analyse
// retreive all words in the script
var $all = $script.match($regexp);
var $$sorted = []; // list of words sorted by frequency
var $$encoded = {}; // dictionary of word->encoding
var $$protected = {}; // instances of "protected" words
if ($all) {
var $unsorted = []; // same list, not sorted
var $protected = {}; // "protected" words (dictionary of word->"word")
var $values = {}; // dictionary of charCode->encoding (eg. 256->ff)
var $count = {}; // word->count
var i = $all.length, j = 0, $word;
// count the occurrences - used for sorting later
do {
$word = "$" + $all[--i];
if (!$count[$word]) {
$count[$word] = 0;
$unsorted[j] = $word;
// make a dictionary of all of the protected words in this script
// these are words that might be mistaken for encoding
$protected["$" + ($values[j] = $encode(j))] = j++;
}
// increment the word counter
$count[$word]++;
} while (i);
// prepare to sort the word list, first we must protect
// words that are also used as codes. we assign them a code
// equivalent to the word itself.
// e.g. if "do" falls within our encoding range
// then we store keywords["do"] = "do";
// this avoids problems when decoding
i = $unsorted.length;
do {
$word = $unsorted[--i];
if ($protected[$word] != null) {
$$sorted[$protected[$word]] = $word.slice(1);
$$protected[$protected[$word]] = true;
$count[$word] = 0;
}
} while (i);
// sort the words by frequency
$unsorted.sort(function($match1, $match2) {
return $count[$match2] - $count[$match1];
});
j = 0;
// because there are "protected" words in the list
// we must add the sorted words around them
do {
if ($$sorted[i] == null) $$sorted[i] = $unsorted[j++].slice(1);
$$encoded[$$sorted[i]] = $values[i];
} while (++i < $unsorted.length);
}
return {$sorted: $$sorted, $encoded: $$encoded, $protected: $$protected};
};
// build the boot function used for loading and decoding
function _bootStrap($packed, $keywords) {
var $ENCODE = _safeRegExp("$encode\\($count\\)", "g");
// $packed: the packed script
$packed = "'" + _escape($packed) + "'";
// $ascii: base for encoding
var $ascii = Math.min($keywords.$sorted.length, _encoding) || 1;
// $count: number of words contained in the script
var $count = $keywords.$sorted.length;
// $keywords: list of words contained in the script
for (var i in $keywords.$protected) $keywords.$sorted[i] = "";
// convert from a string to an array
$keywords = "'" + $keywords.$sorted.join("|") + "'.split('|')";
// $encode: encoding function (used for decoding the script)
var $encode = _encoding > 62 ? _encode95 : _getEncoder($ascii);
$encode = String($encode).replace(/_encoding/g, "$ascii").replace(/arguments\.callee/g, "$encode");
var $inline = "$count" + ($ascii > 10 ? ".toString($ascii)" : "");
// $decode: code snippet to speed up decoding
if (_fastDecode) {
// create the decoder
var $decode = _getFunctionBody(_decode);
if (_encoding > 62) $decode = $decode.replace(/\\\\w/g, "[\\xa1-\\xff]");
// perform the encoding inline for lower ascii values
else if ($ascii < 36) $decode = $decode.replace($ENCODE, $inline);
// special case: when $count==0 there are no keywords. I want to keep
// the basic shape of the unpacking funcion so i'll frig the code...
if (!$count) $decode = $decode.replace(_safeRegExp("($count)\\s*=\\s*1"), "$1=0");
}
// boot function
var $unpack = String(_unpack);
if (_fastDecode) {
// insert the decoder
$unpack = $unpack.replace(/\{/, "{" + $decode + ";");
}
$unpack = $unpack.replace(/"/g, "'");
if (_encoding > 62) { // high-ascii
// get rid of the word-boundaries for regexp matches
$unpack = $unpack.replace(/'\\\\b'\s*\+|\+\s*'\\\\b'/g, "");
}
if ($ascii > 36 || _encoding > 62 || _fastDecode) {
// insert the encode function
$unpack = $unpack.replace(/\{/, "{$encode=" + $encode + ";");
} else {
// perform the encoding inline
$unpack = $unpack.replace($ENCODE, $inline);
}
// pack the boot function too
$unpack = pack($unpack, 0, false, true);
// arguments
var $params = [$packed, $ascii, $count, $keywords];
if (_fastDecode) {
// insert placeholders for the decoder
$params = $params.concat(0, "{}");
}
// the whole thing
return "eval(" + $unpack + "(" + $params + "))\n";
};
// mmm.. ..which one do i need ??
function _getEncoder($ascii) {
return $ascii > 10 ? $ascii > 36 ? $ascii > 62 ? _encode95 : _encode62 : _encode36 : _encode10;
};
// zero encoding
// characters: 0123456789
var _encode10 = function($charCode) {
return $charCode;
};
// inherent base36 support
// characters: 0123456789abcdefghijklmnopqrstuvwxyz
var _encode36 = function($charCode) {
return $charCode.toString(36);
};
// hitch a ride on base36 and add the upper case alpha characters
// characters: 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
var _encode62 = function($charCode) {
return ($charCode < _encoding ? '' : arguments.callee(parseInt($charCode / _encoding))) +
(($charCode = $charCode % _encoding) > 35 ? String.fromCharCode($charCode + 29) : $charCode.toString(36));
};
// use high-ascii values
var _encode95 = function($charCode) {
return ($charCode < _encoding ? '' : arguments.callee($charCode / _encoding)) +
String.fromCharCode($charCode % _encoding + 161);
};
// special _chars
var _encodePrivate = function($charCode) {
return "_" + $charCode;
};
// protect characters used by the parser
function _escape($script) {
return $script.replace(/([\\'])/g, "\\$1");
};
// protect high-ascii characters already in the script
function _escape95($script) {
return $script.replace(/[\xa1-\xff]/g, function($match) {
return "\\x" + $match.charCodeAt(0).toString(16);
});
};
function _safeRegExp($string, $flags) {
return new RegExp($string.replace(/\$/g, "\\$"), $flags);
};
// extract the body of a function
function _getFunctionBody($function) {
with (String($function)) return slice(indexOf("{") + 1, lastIndexOf("}"));
};
// set the global flag on a RegExp (you have to create a new one)
function _globalize($regexp) {
return new RegExp(String($regexp).slice(1, -1), "g");
};
// build the parsing routine
_addParser(_basicCompression);
if (_specialChars) _addParser(_encodeSpecialChars);
if (_encoding) _addParser(_encodeKeywords);
// go!
return _pack(_script);
};

View file

@ -1,105 +0,0 @@
function parse( f ) {
var c = [], bm, m;
var blockMatch = /\/\*\*\s*((.|\n)*?)\s*\*\//g;
var paramMatch = /\@(\S+) *((.|\n)*?)(?=\n\@|!!!)/m;
while ( bm = blockMatch.exec(f) ) {
block = bm[1].replace(/^\s*\* ?/mg,"") + "!!!";
var ret = { params: [], examples: [], tests: [], options: [] };
while ( m = paramMatch.exec( block ) ) {
block = block.replace( paramMatch, "" );
var n = m[1];
var v = m[2]
.replace(/\s*$/g,"")
.replace(/^\s*/g,"")
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
//.replace(/\n/g, "<br/>")
/*.replace(/(\s\s+)/g, function(a){
var ret = "";
for ( var i = 0; i < a.length; i++ )
ret += "&nbsp;";
return ret;
})*/ || 1;
if ( n == 'param' || n == 'option' ) {
var args = v.split(/\s+/);
v = args.slice( 2, args.length );
v = { type: args[0], name: args[1], desc: v.join(' ') };
n = n + "s";
} else if ( n == 'example' ) {
v = { code: v };
n = "examples";
} else if ( n == 'test' ) {
n = "tests";
}
if ( n == 'desc' || n == 'before' || n == 'after' || n == 'result' ) {
ret.examples[ ret.examples.length - 1 ][ n ] = v;
} else {
if ( ret[ n ] ) {
if ( ret[ n ].constructor == Array ) {
ret[ n ].push( v );
} else {
ret[ n ] = [ ret[ n ], v ];
}
} else {
ret[ n ] = v;
}
}
}
ret.desc = block.replace(/\s*!!!$/,"")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;");
//.replace(/\n\n/g, "<br/><br/>")
//.replace(/\n/g, " ");
var m = /^((.|\n)*?(\.|$))/.exec( ret.desc );
if ( m ) ret['short'] = m[1];
if ( ret.name ) c.push( ret );
}
return c;
}
function categorize( json ) {
var obj = { cat: [], method: [] };
for ( var i = 0; i < json.length; i++ ) {
if ( !json[i].cat ) json[i].cat = "";
var cat = json[i].cat.split("/");
var pos = obj;
for ( var j = 0; j < cat.length; j++ ) {
var c = cat[j];
var curCat = null;
// Locate current category
for ( var n = 0; n < pos.cat.length; n++ )
if ( pos.cat[n].value == c )
curCat = pos.cat[n];
// Create current category
if ( !curCat ) {
curCat = { value: c, cat: [], method: [] };
pos.cat.push( curCat )
}
// If we're at the end, add the method
if ( j == cat.length - 1 )
curCat.method.push( json[i] );
// Otherwise, traverse deeper
else
pos = curCat;
}
}
return obj;
}

View file

@ -1,19 +0,0 @@
importPackage(java.io);
function writeFile( file, stream ) {
var buffer = new PrintWriter( new FileWriter( file ) );
buffer.print( stream );
buffer.close();
}
function read( file ) {
var jq = new File(file);
var reader = new BufferedReader(new FileReader(jq));
var line = null;
var buffer = new java.lang.StringBuffer(jq.length());
while( (line = reader.readLine()) != null) {
buffer.append(line);
buffer.append("\n");
}
return buffer.toString();
}

View file

@ -1,25 +0,0 @@
Object.toXML = function( obj, tag ) {
if ( obj.constructor == Array ) {
var ret = "";
for ( var i = 0; i < obj.length; i++ )
ret += Object.toXML( obj[i], tag );
return ret;
} else if ( obj.constructor == Object ) {
var tag = tag || "tmp";
var p = "", child = "";
for ( var i in obj )
if ( ( obj[i].constructor != String && obj[i].constructor != Number ) || /</.test(obj[i] + "") || Object.toXML.force[i] )
child += Object.toXML( obj[i], i );
else
p += " " + i + "='" + (obj[i] + "").replace(/'/g, "&apos;") + "'";
return "<" + tag + p + ( child ? ">\n" + child + "</" + tag + ">\n" : "/>\n" );
} else if ( obj.constructor == String || obj.constructor == Number ) {
return "<" + tag + ">" + obj + "</" + tag + ">\n";
}
return "";
};
Object.toXML.force = {};

36
build/jslint-check.js Normal file
View file

@ -0,0 +1,36 @@
var JSLINT = require("./lib/jslint").JSLINT,
print = require("sys").print,
src = require("fs").readFileSync("dist/jquery.js", "utf8");
JSLINT(src, { evil: true, forin: true, maxerr: 100 });
// All of the following are known issues that we think are 'ok'
// (in contradiction with JSLint) more information here:
// http://docs.jquery.com/JQuery_Core_Style_Guidelines
var ok = {
"Expected an identifier and instead saw 'undefined' (a reserved word).": true,
"Use '===' to compare with 'null'.": true,
"Use '!==' to compare with 'null'.": true,
"Expected an assignment or function call and instead saw an expression.": true,
"Expected a 'break' statement before 'case'.": true,
"'e' is already defined.": true
};
var e = JSLINT.errors, found = 0, w;
for ( var i = 0; i < e.length; i++ ) {
w = e[i];
if ( !ok[ w.reason ] ) {
found++;
print( "\n" + w.evidence + "\n" );
print( " Problem at line " + w.line + " character " + w.character + ": " + w.reason );
}
}
if ( found > 0 ) {
print( "\n" + found + " Error(s) found.\n" );
} else {
print( "JSLint check passed.\n" );
}

5504
build/lib/jslint.js Normal file

File diff suppressed because it is too large Load diff

1315
build/lib/parse-js.js Normal file

File diff suppressed because it is too large Load diff

1666
build/lib/process.js Normal file

File diff suppressed because it is too large Load diff

22
build/lib/squeeze-more.js Normal file
View file

@ -0,0 +1,22 @@
var jsp = require("./parse-js"),
pro = require("./process"),
slice = jsp.slice,
member = jsp.member,
PRECEDENCE = jsp.PRECEDENCE,
OPERATORS = jsp.OPERATORS;
function ast_squeeze_more(ast) {
var w = pro.ast_walker(), walk = w.walk;
return w.with_walkers({
"call": function(expr, args) {
if (expr[0] == "dot" && expr[2] == "toString" && args.length == 0) {
// foo.toString() ==> foo+""
return [ "binary", "+", expr[1], [ "string", "" ]];
}
}
}, function() {
return walk(ast);
});
};
exports.ast_squeeze_more = ast_squeeze_more;

7
build/post-compile.js Normal file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env node
var print = require("sys").print,
src = require("fs").readFileSync(process.argv[2], "utf8");
// Previously done in sed but reimplemented here due to portability issues
print( src.replace( /^(\s*\*\/)(.+)/m, "$1\n$2" ) + ";" );

54
build/release-notes.js Normal file
View file

@ -0,0 +1,54 @@
#!/usr/bin/env node
/*
* jQuery Release Note Generator
*/
var fs = require("fs"),
http = require("http"),
tmpl = require("mustache"),
extract = /<a href="\/ticket\/(\d+)" title="View ticket">(.*?)<[^"]+"component">\s*(\S+)/g;
var opts = {
version: "1.6.2 RC 1",
short_version: "1.6.2rc1",
final_version: "1.6.2",
categories: []
};
http.request({
host: "bugs.jquery.com",
port: 80,
method: "GET",
path: "/query?status=closed&resolution=fixed&component=!web&order=component&milestone=" + opts.final_version
}, function (res) {
var data = [];
res.on( "data", function( chunk ) {
data.push( chunk );
});
res.on( "end", function() {
var match,
file = data.join(""),
cur;
while ( (match = extract.exec( file )) ) {
if ( "#" + match[1] !== match[2] ) {
var cat = match[3];
if ( !cur || cur.name !== cat ) {
cur = { name: match[3], niceName: match[3].replace(/^./, function(a){ return a.toUpperCase(); }), bugs: [] };
opts.categories.push( cur );
}
cur.bugs.push({ ticket: match[1], title: match[2] });
}
}
buildNotes();
});
}).end();
function buildNotes() {
console.log( tmpl.to_html( fs.readFileSync("release-notes.txt", "utf8"), opts ) );
}

27
build/release-notes.txt Normal file
View file

@ -0,0 +1,27 @@
<h2>jQuery {{version}} Released</h2>
<p>This is a preview release of jQuery. We're releasing it so that everyone can start testing the code in their applications, making sure that there are no major problems.</p>
<p>You can get the code from the jQuery CDN:</p>
<ul>
<li><a href="http://code.jquery.com/jquery-{{short_version}}.js">http://code.jquery.com/jquery-{{short_version}}.js</a></li>
</ul>
<p>You can help us by dropping that code into your existing application and letting us know that if anything no longer works. Please <a href="http://bugs.jquery.com/">file a bug</a> and be sure to mention that you're testing against jQuery {{version}}.</p>
<p>We want to encourage everyone from the community to try and <a href="http://docs.jquery.com/Getting_Involved">get involved</a> in contributing back to jQuery core. We've set up a <a href="http://docs.jquery.com/Getting_Involved">full page</a> of information dedicated towards becoming more involved with the team. The team is here and ready to help you help us!</p>
<h2>jQuery {{version}} Change Log</h2>
<p>The current change log of the {{version}} release.</p>
{{#categories}}
<h3>{{niceName}}</h3>
<ul>
{{#bugs}}
<li><a href="http://bugs.jquery.com/ticket/{{ticket}}">#{{ticket}}</a>: {{title}}</li>
{{/bugs}}
</ul>
{{/categories}}

169
build/release.js Normal file
View file

@ -0,0 +1,169 @@
#!/usr/bin/env node
/*
* jQuery Release Management
*/
var fs = require("fs"),
child = require("child_process"),
debug = false;
var scpURL = "jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/",
cdnURL = "http://code.origin.jquery.com/",
version = /^[\d.]+(?:(?:a|b|rc)\d+|pre)?$/,
versionFile = "version.txt",
file = "dist/jquery.js",
minFile = "dist/jquery.min.js",
files = {
"jquery-VER.js": file,
"jquery-VER.min.js": minFile
},
finalFiles = {
"jquery.js": file,
"jquery-latest.js": file,
"jquery.min.js": minFile,
"jquery-latest.min.js": minFile
};
exec( "git pull && git status", function( error, stdout, stderr ) {
if ( /Changes to be committed/i.test( stdout ) ) {
exit( "Please commit changed files before attemping to push a release." );
} else if ( /Changes not staged for commit/i.test( stdout ) ) {
exit( "Please stash files before attempting to push a release." );
} else {
setVersion();
}
});
function setVersion() {
var oldVersion = fs.readFileSync( versionFile, "utf8" );
prompt( "New Version (was " + oldVersion + "): ", function( data ) {
if ( data && version.test( data ) ) {
fs.writeFileSync( versionFile, data );
exec( "git commit -a -m 'Tagging the " + data + " release.' && git push && " +
"git tag " + data + " && git push origin " + data, function() {
make( data );
});
} else {
console.error( "Malformed version number, please try again." );
setVersion();
}
});
}
function make( newVersion ) {
exec( "make clean && make", function( error, stdout, stderr ) {
// TODO: Verify JSLint
Object.keys( files ).forEach(function( oldName ) {
var value = files[ oldName ], name = oldName.replace( /VER/g, newVersion );
copy( value, name );
delete files[ oldName ];
files[ name ] = value;
});
exec( "scp " + Object.keys( files ).join( " " ) + " " + scpURL, function() {
setNextVersion( newVersion );
});
});
}
function setNextVersion( newVersion ) {
var isFinal = false;
if ( /(?:a|b|rc)\d+$/.test( newVersion ) ) {
newVersion = newVersion.replace( /(?:a|b|rc)\d+$/, "pre" );
} else if ( /^\d+\.\d+\.?(\d*)$/.test( newVersion ) ) {
newVersion = newVersion.replace( /^(\d+\.\d+\.?)(\d*)$/, function( all, pre, num ) {
return pre + (pre.charAt( pre.length - 1 ) !== "." ? "." : "") + (num ? parseFloat( num ) + 1 : 1) + "pre";
});
isFinal = true;
}
prompt( "Next Version [" + newVersion + "]: ", function( data ) {
if ( !data ) {
data = newVersion;
}
if ( version.test( data ) ) {
fs.writeFileSync( versionFile, data );
exec( "git commit -a -m 'Updating the source version to " + data + "' && git push", function() {
if ( isFinal ) {
makeFinal( newVersion );
}
});
} else {
console.error( "Malformed version number, please try again." );
setNextVersion( newVersion );
}
});
}
function makeFinal( newVersion ) {
var all = Object.keys( finalFiles );
// Copy all the files
all.forEach(function( name ) {
copy( finalFiles[ name ], name );
});
// Upload files to CDN
exec( "scp " + all.join( " " ) + " " + scpURL, function() {
exec( "curl '" + cdnURL + "{" + all.join( "," ) + "}?reload'", function() {
console.log( "Done." );
});
});
}
function copy( oldFile, newFile ) {
if ( debug ) {
console.log( "Copying " + oldFile + " to " + newFile );
} else {
fs.writeFileSync( newFile, fs.readFileSync( oldFile, "utf8" ) );
}
}
function prompt( msg, callback ) {
process.stdout.write( msg );
process.stdin.resume();
process.stdin.setEncoding( "utf8" );
process.stdin.once( "data", function( chunk ) {
process.stdin.pause();
callback( chunk.replace( /\n*$/g, "" ) );
});
}
function exec( cmd, fn ) {
if ( debug ) {
console.log( cmd );
fn();
} else {
child.exec( cmd, fn );
}
}
function exit( msg ) {
if ( msg ) {
console.error( "\nError: " + msg );
}
process.exit( 1 );
}

View file

@ -1,695 +0,0 @@
/*
* Simulated browser environment for Rhino
* By John Resig <http://ejohn.org/>
* Copyright 2007 John Resig, under the MIT License
*/
// The window Object
var window = this;
(function(){
// Browser Navigator
window.navigator = {
get userAgent(){
return "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3";
}
};
var curLocation = (new java.io.File("./")).toURL();
window.__defineSetter__("location", function(url){
var xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.onreadystatechange = function(){
curLocation = new java.net.URL( curLocation, url );
window.document = xhr.responseXML;
var event = document.createEvent();
event.initEvent("load");
window.dispatchEvent( event );
};
xhr.send();
});
window.__defineGetter__("location", function(url){
return {
get protocol(){
return curLocation.getProtocol() + ":";
},
get href(){
return curLocation.toString();
},
toString: function(){
return this.href;
}
};
});
// Timers
var timers = [];
window.setTimeout = function(fn, time){
var num;
return num = setInterval(function(){
fn();
clearInterval(num);
}, time);
};
window.setInterval = function(fn, time){
var num = timers.length;
timers[num] = new java.lang.Thread(new java.lang.Runnable({
run: function(){
while (true){
java.lang.Thread.currentThread().sleep(time);
fn();
}
}
}));
timers[num].start();
return num;
};
window.clearInterval = function(num){
if ( timers[num] ) {
timers[num].stop();
delete timers[num];
}
};
// Window Events
var events = [{}];
window.addEventListener = function(type, fn){
if ( !this.uuid || this == window ) {
this.uuid = events.length;
events[this.uuid] = {};
}
if ( !events[this.uuid][type] )
events[this.uuid][type] = [];
if ( events[this.uuid][type].indexOf( fn ) < 0 )
events[this.uuid][type].push( fn );
};
window.removeEventListener = function(type, fn){
if ( !this.uuid || this == window ) {
this.uuid = events.length;
events[this.uuid] = {};
}
if ( !events[this.uuid][type] )
events[this.uuid][type] = [];
events[this.uuid][type] =
events[this.uuid][type].filter(function(f){
return f != fn;
});
};
window.dispatchEvent = function(event){
if ( event.type ) {
if ( this.uuid && events[this.uuid][event.type] ) {
var self = this;
events[this.uuid][event.type].forEach(function(fn){
fn.call( self, event );
});
}
if ( this["on" + event.type] )
this["on" + event.type].call( self, event );
}
};
// DOM Document
window.DOMDocument = function(file){
this._file = file;
this._dom = Packages.javax.xml.parsers.
DocumentBuilderFactory.newInstance()
.newDocumentBuilder().parse(file);
if ( !obj_nodes.containsKey( this._dom ) )
obj_nodes.put( this._dom, this );
};
DOMDocument.prototype = {
createTextNode: function(text){
return makeNode( this._dom.createTextNode(
text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")) );
},
createElement: function(name){
return makeNode( this._dom.createElement(name.toLowerCase()) );
},
getElementsByTagName: function(name){
return new DOMNodeList( this._dom.getElementsByTagName(
name.toLowerCase()) );
},
getElementById: function(id){
var elems = this._dom.getElementsByTagName("*");
for ( var i = 0; i < elems.length; i++ ) {
var elem = elems.item(i);
if ( elem.getAttribute("id") == id )
return makeNode(elem);
}
return null;
},
get body(){
return this.getElementsByTagName("body")[0];
},
get documentElement(){
return makeNode( this._dom.getDocumentElement() );
},
get ownerDocument(){
return null;
},
addEventListener: window.addEventListener,
removeEventListener: window.removeEventListener,
dispatchEvent: window.dispatchEvent,
get nodeName() {
return "#document";
},
importNode: function(node, deep){
return makeNode( this._dom.importNode(node._dom, deep) );
},
toString: function(){
return "Document" + (typeof this._file == "string" ?
": " + this._file : "");
},
get innerHTML(){
return this.documentElement.outerHTML;
},
get defaultView(){
return {
getComputedStyle: function(elem){
return {
getPropertyValue: function(prop){
prop = prop.replace(/\-(\w)/g,function(m,c){
return c.toUpperCase();
});
var val = elem.style[prop];
if ( prop == "opacity" && val == "" )
val = "1";
return val;
}
};
}
};
},
createEvent: function(){
return {
type: "",
initEvent: function(type){
this.type = type;
}
};
}
};
function getDocument(node){
return obj_nodes.get(node);
}
// DOM NodeList
window.DOMNodeList = function(list){
this._dom = list;
this.length = list.getLength();
for ( var i = 0; i < this.length; i++ ) {
var node = list.item(i);
this[i] = makeNode( node );
}
};
DOMNodeList.prototype = {
toString: function(){
return "[ " +
Array.prototype.join.call( this, ", " ) + " ]";
},
get outerHTML(){
return Array.prototype.map.call(
this, function(node){return node.outerHTML;}).join('');
}
};
// DOM Node
window.DOMNode = function(node){
this._dom = node;
};
DOMNode.prototype = {
get nodeType(){
return this._dom.getNodeType();
},
get nodeValue(){
return this._dom.getNodeValue();
},
get nodeName() {
return this._dom.getNodeName();
},
cloneNode: function(deep){
return makeNode( this._dom.cloneNode(deep) );
},
get ownerDocument(){
return getDocument( this._dom.ownerDocument );
},
get documentElement(){
return makeNode( this._dom.documentElement );
},
get parentNode() {
return makeNode( this._dom.getParentNode() );
},
get nextSibling() {
return makeNode( this._dom.getNextSibling() );
},
get previousSibling() {
return makeNode( this._dom.getPreviousSibling() );
},
toString: function(){
return '"' + this.nodeValue + '"';
},
get outerHTML(){
return this.nodeValue;
}
};
// DOM Element
window.DOMElement = function(elem){
this._dom = elem;
this.style = {
get opacity(){ return this._opacity; },
set opacity(val){ this._opacity = val + ""; }
};
// Load CSS info
var styles = (this.getAttribute("style") || "").split(/\s*;\s*/);
for ( var i = 0; i < styles.length; i++ ) {
var style = styles[i].split(/\s*:\s*/);
if ( style.length == 2 )
this.style[ style[0] ] = style[1];
}
};
DOMElement.prototype = extend( new DOMNode(), {
get nodeName(){
return this.tagName.toUpperCase();
},
get tagName(){
return this._dom.getTagName();
},
toString: function(){
return "<" + this.tagName + (this.id ? "#" + this.id : "" ) + ">";
},
get outerHTML(){
var ret = "<" + this.tagName, attr = this.attributes;
for ( var i in attr )
ret += " " + i + "='" + attr[i] + "'";
if ( this.childNodes.length || this.nodeName == "SCRIPT" )
ret += ">" + this.childNodes.outerHTML +
"</" + this.tagName + ">";
else
ret += "/>";
return ret;
},
get attributes(){
var attr = {}, attrs = this._dom.getAttributes();
for ( var i = 0; i < attrs.getLength(); i++ )
attr[ attrs.item(i).nodeName ] = attrs.item(i).nodeValue;
return attr;
},
get innerHTML(){
return this.childNodes.outerHTML;
},
set innerHTML(html){
html = html.replace(/<\/?([A-Z]+)/g, function(m){
return m.toLowerCase();
});
var nodes = this.ownerDocument.importNode(
new DOMDocument( new java.io.ByteArrayInputStream(
(new java.lang.String("<wrap>" + html + "</wrap>"))
.getBytes("UTF8"))).documentElement, true).childNodes;
while (this.firstChild)
this.removeChild( this.firstChild );
for ( var i = 0; i < nodes.length; i++ )
this.appendChild( nodes[i] );
},
get textContent(){
return nav(this.childNodes);
function nav(nodes){
var str = "";
for ( var i = 0; i < nodes.length; i++ )
if ( nodes[i].nodeType == 3 )
str += nodes[i].nodeValue;
else if ( nodes[i].nodeType == 1 )
str += nav(nodes[i].childNodes);
return str;
}
},
set textContent(text){
while (this.firstChild)
this.removeChild( this.firstChild );
this.appendChild( this.ownerDocument.createTextNode(text));
},
style: {},
clientHeight: 0,
clientWidth: 0,
offsetHeight: 0,
offsetWidth: 0,
get disabled() {
var val = this.getAttribute("disabled");
return val != "false" && !!val;
},
set disabled(val) { return this.setAttribute("disabled",val); },
get checked() {
var val = this.getAttribute("checked");
return val != "false" && !!val;
},
set checked(val) { return this.setAttribute("checked",val); },
get selected() {
if ( !this._selectDone ) {
this._selectDone = true;
if ( this.nodeName == "OPTION" && !this.parentNode.getAttribute("multiple") ) {
var opt = this.parentNode.getElementsByTagName("option");
if ( this == opt[0] ) {
var select = true;
for ( var i = 1; i < opt.length; i++ )
if ( opt[i].selected ) {
select = false;
break;
}
if ( select )
this.selected = true;
}
}
}
var val = this.getAttribute("selected");
return val != "false" && !!val;
},
set selected(val) { return this.setAttribute("selected",val); },
get className() { return this.getAttribute("class") || ""; },
set className(val) {
return this.setAttribute("class",
val.replace(/(^\s*|\s*$)/g,""));
},
get type() { return this.getAttribute("type") || ""; },
set type(val) { return this.setAttribute("type",val); },
get value() { return this.getAttribute("value") || ""; },
set value(val) { return this.setAttribute("value",val); },
get src() { return this.getAttribute("src") || ""; },
set src(val) { return this.setAttribute("src",val); },
get id() { return this.getAttribute("id") || ""; },
set id(val) { return this.setAttribute("id",val); },
getAttribute: function(name){
return this._dom.hasAttribute(name) ?
new String( this._dom.getAttribute(name) ) :
null;
},
setAttribute: function(name,value){
this._dom.setAttribute(name,value);
},
removeAttribute: function(name){
this._dom.removeAttribute(name);
},
get childNodes(){
return new DOMNodeList( this._dom.getChildNodes() );
},
get firstChild(){
return makeNode( this._dom.getFirstChild() );
},
get lastChild(){
return makeNode( this._dom.getLastChild() );
},
appendChild: function(node){
this._dom.appendChild( node._dom );
},
insertBefore: function(node,before){
this._dom.insertBefore( node._dom, before ? before._dom : before );
},
removeChild: function(node){
this._dom.removeChild( node._dom );
},
getElementsByTagName: DOMDocument.prototype.getElementsByTagName,
addEventListener: window.addEventListener,
removeEventListener: window.removeEventListener,
dispatchEvent: window.dispatchEvent,
click: function(){
var event = document.createEvent();
event.initEvent("click");
this.dispatchEvent(event);
},
submit: function(){
var event = document.createEvent();
event.initEvent("submit");
this.dispatchEvent(event);
},
focus: function(){
var event = document.createEvent();
event.initEvent("focus");
this.dispatchEvent(event);
},
blur: function(){
var event = document.createEvent();
event.initEvent("blur");
this.dispatchEvent(event);
},
get elements(){
return this.getElementsByTagName("*");
},
get contentWindow(){
return this.nodeName == "IFRAME" ? {
document: this.contentDocument
} : null;
},
get contentDocument(){
if ( this.nodeName == "IFRAME" ) {
if ( !this._doc )
this._doc = new DOMDocument(
new java.io.ByteArrayInputStream((new java.lang.String(
"<html><head><title></title></head><body></body></html>"))
.getBytes("UTF8")));
return this._doc;
} else
return null;
}
});
// Helper method for extending one object with another
function extend(a,b) {
for ( var i in b ) {
var g = b.__lookupGetter__(i), s = b.__lookupSetter__(i);
if ( g || s ) {
if ( g )
a.__defineGetter__(i, g);
if ( s )
a.__defineSetter__(i, s);
} else
a[i] = b[i];
}
return a;
}
// Helper method for generating the right
// DOM objects based upon the type
var obj_nodes = new java.util.HashMap();
function makeNode(node){
if ( node ) {
if ( !obj_nodes.containsKey( node ) )
obj_nodes.put( node, node.getNodeType() ==
Packages.org.w3c.dom.Node.ELEMENT_NODE ?
new DOMElement( node ) : new DOMNode( node ) );
return obj_nodes.get(node);
} else
return null;
}
// XMLHttpRequest
// Originally implemented by Yehuda Katz
window.XMLHttpRequest = function(){
this.headers = {};
this.responseHeaders = {};
};
XMLHttpRequest.prototype = {
open: function(method, url, async, user, password){
this.readyState = 1;
if (async)
this.async = true;
this.method = method || "GET";
this.url = url;
this.onreadystatechange();
},
setRequestHeader: function(header, value){
this.headers[header] = value;
},
getResponseHeader: function(header){ },
send: function(data){
var self = this;
function makeRequest(){
var url = new java.net.URL(curLocation, self.url);
if ( url.getProtocol() == "file" ) {
if ( self.method == "PUT" ) {
var out = new java.io.FileWriter(
new java.io.File( new java.net.URI( url.toString() ) ) ),
text = new java.lang.String( data || "" );
out.write( text, 0, text.length() );
out.flush();
out.close();
} else if ( self.method == "DELETE" ) {
var file = new java.io.File( new java.net.URI( url.toString() ) );
file["delete"]();
} else {
var connection = url.openConnection();
connection.connect();
handleResponse();
}
} else {
var connection = url.openConnection();
connection.setRequestMethod( self.method );
// Add headers to Java connection
for (var header in self.headers)
connection.addRequestProperty(header, self.headers[header]);
connection.connect();
// Stick the response headers into responseHeaders
for (var i = 0; ; i++) {
var headerName = connection.getHeaderFieldKey(i);
var headerValue = connection.getHeaderField(i);
if (!headerName && !headerValue) break;
if (headerName)
self.responseHeaders[headerName] = headerValue;
}
handleResponse();
}
function handleResponse(){
self.readyState = 4;
self.status = parseInt(connection.responseCode) || undefined;
self.statusText = connection.responseMessage || "";
var stream = new java.io.InputStreamReader(connection.getInputStream()),
buffer = new java.io.BufferedReader(stream), line;
while ((line = buffer.readLine()) != null)
self.responseText += line;
self.responseXML = null;
if ( self.responseText.match(/^\s*</) ) {
try {
self.responseXML = new DOMDocument(
new java.io.ByteArrayInputStream(
(new java.lang.String(
self.responseText)).getBytes("UTF8")));
} catch(e) {}
}
}
self.onreadystatechange();
}
if (this.async)
(new java.lang.Thread(new java.lang.Runnable({
run: makeRequest
}))).start();
else
makeRequest();
},
abort: function(){},
onreadystatechange: function(){},
getResponseHeader: function(header){
if (this.readyState < 3)
throw new Error("INVALID_STATE_ERR");
else {
var returnedHeaders = [];
for (var rHeader in this.responseHeaders) {
if (rHeader.match(new Regexp(header, "i")))
returnedHeaders.push(this.responseHeaders[rHeader]);
}
if (returnedHeaders.length)
return returnedHeaders.join(", ");
}
return null;
},
getAllResponseHeaders: function(header){
if (this.readyState < 3)
throw new Error("INVALID_STATE_ERR");
else {
var returnedHeaders = [];
for (var header in this.responseHeaders)
returnedHeaders.push( header + ": " + this.responseHeaders[header] );
return returnedHeaders.join("\r\n");
}
},
async: true,
readyState: 0,
responseText: "",
status: 0
};
})();

View file

@ -1,21 +0,0 @@
// Init
load("build/runtest/env.js");
window.location = "test/index.html";
window.onload = function(){
// Load the test runner
load("dist/jquery.js","build/runtest/testrunner.js");
// Load the tests
load(
"test/unit/core.js",
"test/unit/selector.js",
"test/unit/event.js"
//"test/unit/fx.js",
//"test/unit/ajax.js"
);
// Display the results
results();
};

View file

@ -1,197 +0,0 @@
function test(name, fn){
expected = -1;
numTests = 0;
reset();
fn();
if ( expected != -1 && expected != numTests )
log( false, "Wrong number of tests run. " + numTests + " ran, expected " + expected );
}
var orig = document.getElementById('main').innerHTML;
/**
* Resets the test setup. Useful for tests that modify the DOM.
*/
function reset() {
document.getElementById('main').innerHTML = orig;
}
var currentModule = "";
// call on start of module test to prepend name to all tests
function module(moduleName) {
currentModule = moduleName;
}
var expected = -1;
/**
* Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
*/
function expect(asserts) {
expected = asserts;
}
/**
* Asserts true.
* @example ok( $("a").size() > 5, "There must be at least 5 anchors" );
*/
function ok(a, msg) {
log( !!a, msg );
}
/**
* Asserts that two arrays are the same
*/
function isSet(a, b, msg) {
var ret = true;
if ( a && b && a.length != undefined && a.length == b.length ) {
for ( var i = 0; i < a.length; i++ ) {
if ( a[i] != b[i] )
ret = false;
}
} else
ret = false;
if ( !ret )
log( ret, msg + " expected: " + serialArray(b) + " result: " + serialArray(a) );
else
log( ret, msg );
}
/**
* Asserts that two objects are equivalent
*/
function isObj(a, b, msg) {
var ret = true;
if ( a && b ) {
for ( var i in a )
if ( a[i] != b[i] )
ret = false;
for ( i in b )
if ( a[i] != b[i] )
ret = false;
} else
ret = false;
log( ret, msg );
}
function serialArray( a ) {
var r = [];
if ( a && a.length )
for ( var i = 0; i < a.length; i++ ) {
var str = a[i] ? a[i].nodeName : "";
if ( str ) {
str = str.toLowerCase();
if ( a[i].id )
str += "#" + a[i].id;
} else
str = a[i];
r.push( str );
}
return "[ " + r.join(", ") + " ]"
}
/**
* Returns an array of elements with the given IDs, eg.
* @example q("main", "foo", "bar")
* @result [<div id="main">, <span id="foo">, <input id="bar">]
*/
function q() {
var r = [];
for ( var i = 0; i < arguments.length; i++ )
r.push( document.getElementById( arguments[i] ) );
return r;
}
/**
* Asserts that a select matches the given IDs
* @example t("Check for something", "//[a]", ["foo", "baar"]);
* @result returns true if "//[a]" return two elements with the IDs 'foo' and 'baar'
*/
function t(a,b,c) {
var f = jQuery(b);
var s = "";
for ( var i = 0; i < f.length; i++ )
s += (s && ",") + '"' + f[i].id + '"';
isSet(f, q.apply(q,c), a + " (" + b + ")");
}
/**
* Checks that the first two arguments are equal, with an optional message.
* Prints out both expected and actual values on failure.
*
* Prefered to ok( expected == actual, message )
*
* @example equals( "Expected 2 characters.", v.formatMessage("Expected {0} characters.", 2) );
*
* @param Object expected
* @param Object actual
* @param String message (optional)
*/
function equals(expected, actual, message) {
var result = expected == actual;
message = message || (result ? "okay" : "failed");
log( result, result ? message + ": " + expected : message + " expected: " + expected + " actual: " + actual );
}
var numTests = 0, total = 0, pass = 0, fail = 0;
function log(state, msg){
print( (state ? "PASS" : "FAIL") + " (" + (++total) + ") " +
(currentModule ? "[" + currentModule + "] " : "") + msg );
numTests++;
if ( state )
pass++;
else
fail++;
}
function results(){
print( pass + " Passed, " + fail + " Failed" );
}
function start(){}
function stop(){}
/**
* Trigger an event on an element.
*
* @example triggerEvent( document.body, "click" );
*
* @param DOMElement elem
* @param String type
*/
function triggerEvent( elem, type, event ) {
/*
if ( jQuery.browser.mozilla || jQuery.browser.opera ) {
event = document.createEvent("MouseEvents");
event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
elem.dispatchEvent( event );
} else if ( jQuery.browser.msie ) {
elem.fireEvent("on"+type);
}
*/
}
/**
* Add random number to url to stop IE from caching
*
* @example url("data/test.html")
* @result "data/test.html?10538358428943"
*
* @example url("data/test.php?foo=bar")
* @result "data/test.php?foo=bar&10538358345554"
*/
function url(value) {
return value + (/\?/.test(value) ? "&" : "?") + new Date().getTime() + "" + parseInt(Math.random()*100000);
}

View file

@ -1,513 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" debug="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Speed Test</title>
<script src="jquery-basis.js" type="text/javascript"></script>
<script src="../../dist/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
</script>
<link rel="stylesheet" href="benchmarker.css" type="text/css" media="screen" />
</head>
<body>
<h1>Speed Test</h1>
<div id="badid"></div>
<div id="time-test">
<p>Using the following selector expressions (<input type="text" id="times" maxlength="5" size="5" value="20"/> times each):</p>
<p>NOTE: Number shown is an average.</p>
<div class="buttons">
<button class="selectAll">Select All</button>
<button class="deselectAll">Deselect All</button>
<button class="runTests">Run Tests</button>
<button class="retryTies">Retry Ties</button>
</div>
<table cellspacing="0">
<thead>
<tr>
<th>Run?</th>
<th>Test</th>
</tr>
</thead>
<tfoot>
<tr>
<th></th>
<th></th>
</tr>
<tr>
<th></th>
<th></th>
</tr>
</tfoot>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<div class="buttons">
<button class="selectAll">Select All</button>
<button class="deselectAll">Deselect All</button>
<button class="runTests">Run Tests</button>
<button class="retryTies">Retry Ties</button>
<button id="addTest">+</button>
</div>
</div>
<div class="dialog">
<h2>As You Like It</h2>
<div id="playwright">
by William Shakespeare
</div>
<div class="dialog scene" id="scene1">
<h3>ACT I, SCENE III. A room in the palace.</h3>
<div class="dialog">
<div class="direction">Enter CELIA and ROSALIND</div>
</div>
<div id="speech1" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.1">Why, cousin! why, Rosalind! Cupid have mercy! not a word?</div>
</div>
<div id="speech2" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.2">Not one to throw at a dog.</div>
</div>
<div id="speech3" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.3">No, thy words are too precious to be cast away upon</div>
<div id="scene1.3.4">curs; throw some of them at me; come, lame me with reasons.</div>
</div>
<div id="speech4" class="character">ROSALIND</div>
<div id="speech5" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.8">But is all this for your father?</div>
</div>
<div class="dialog">
<div id="scene1.3.5">Then there were two cousins laid up; when the one</div>
<div id="scene1.3.6">should be lamed with reasons and the other mad</div>
<div id="scene1.3.7">without any.</div>
</div>
<div id="speech6" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.9">No, some of it is for my child's father. O, how</div>
<div id="scene1.3.10">full of briers is this working-day world!</div>
</div>
<div id="speech7" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.11">They are but burs, cousin, thrown upon thee in</div>
<div id="scene1.3.12">holiday foolery: if we walk not in the trodden</div>
<div id="scene1.3.13">paths our very petticoats will catch them.</div>
</div>
<div id="speech8" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.14">I could shake them off my coat: these burs are in my heart.</div>
</div>
<div id="speech9" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.15">Hem them away.</div>
</div>
<div id="speech10" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.16">I would try, if I could cry 'hem' and have him.</div>
</div>
<div id="speech11" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.17">Come, come, wrestle with thy affections.</div>
</div>
<div id="speech12" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.18">O, they take the part of a better wrestler than myself!</div>
</div>
<div id="speech13" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.19">O, a good wish upon you! you will try in time, in</div>
<div id="scene1.3.20">despite of a fall. But, turning these jests out of</div>
<div id="scene1.3.21">service, let us talk in good earnest: is it</div>
<div id="scene1.3.22">possible, on such a sudden, you should fall into so</div>
<div id="scene1.3.23">strong a liking with old Sir Rowland's youngest son?</div>
</div>
<div id="speech14" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.24">The duke my father loved his father dearly.</div>
</div>
<div id="speech15" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.25">Doth it therefore ensue that you should love his son</div>
<div id="scene1.3.26">dearly? By this kind of chase, I should hate him,</div>
<div id="scene1.3.27">for my father hated his father dearly; yet I hate</div>
<div id="scene1.3.28">not Orlando.</div>
</div>
<div id="speech16" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.29">No, faith, hate him not, for my sake.</div>
</div>
<div id="speech17" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.30">Why should I not? doth he not deserve well?</div>
</div>
<div id="speech18" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.31">Let me love him for that, and do you love him</div>
<div id="scene1.3.32">because I do. Look, here comes the duke.</div>
</div>
<div id="speech19" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.33">With his eyes full of anger.</div>
<div class="direction">Enter DUKE FREDERICK, with Lords</div>
</div>
<div id="speech20" class="character">DUKE FREDERICK</div>
<div class="dialog">
<div id="scene1.3.34">Mistress, dispatch you with your safest haste</div>
<div id="scene1.3.35">And get you from our court.</div>
</div>
<div id="speech21" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.36">Me, uncle?</div>
</div>
<div id="speech22" class="character">DUKE FREDERICK</div>
<div class="dialog">
<div id="scene1.3.37">You, cousin</div>
<div id="scene1.3.38">Within these ten days if that thou be'st found</div>
<div id="scene1.3.39">So near our public court as twenty miles,</div>
<div id="scene1.3.40">Thou diest for it.</div>
</div>
<div id="speech23" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.41"> I do beseech your grace,</div>
<div id="scene1.3.42">Let me the knowledge of my fault bear with me:</div>
<div id="scene1.3.43">If with myself I hold intelligence</div>
<div id="scene1.3.44">Or have acquaintance with mine own desires,</div>
<div id="scene1.3.45">If that I do not dream or be not frantic,--</div>
<div id="scene1.3.46">As I do trust I am not--then, dear uncle,</div>
<div id="scene1.3.47">Never so much as in a thought unborn</div>
<div id="scene1.3.48">Did I offend your highness.</div>
</div>
<div id="speech24" class="character">DUKE FREDERICK</div>
<div class="dialog">
<div id="scene1.3.49">Thus do all traitors:</div>
<div id="scene1.3.50">If their purgation did consist in words,</div>
<div id="scene1.3.51">They are as innocent as grace itself:</div>
<div id="scene1.3.52">Let it suffice thee that I trust thee not.</div>
</div>
<div id="speech25" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.53">Yet your mistrust cannot make me a traitor:</div>
<div id="scene1.3.54">Tell me whereon the likelihood depends.</div>
</div>
<div id="speech26" class="character">DUKE FREDERICK</div>
<div class="dialog">
<div id="scene1.3.55">Thou art thy father's daughter; there's enough.</div>
</div>
<div id="speech27" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.56">So was I when your highness took his dukedom;</div>
<div id="scene1.3.57">So was I when your highness banish'd him:</div>
<div id="scene1.3.58">Treason is not inherited, my lord;</div>
<div id="scene1.3.59">Or, if we did derive it from our friends,</div>
<div id="scene1.3.60">What's that to me? my father was no traitor:</div>
<div id="scene1.3.61">Then, good my liege, mistake me not so much</div>
<div id="scene1.3.62">To think my poverty is treacherous.</div>
</div>
<div id="speech28" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.63">Dear sovereign, hear me speak.</div>
</div>
<div id="speech29" class="character">DUKE FREDERICK</div>
<div class="dialog">
<div id="scene1.3.64">Ay, Celia; we stay'd her for your sake,</div>
<div id="scene1.3.65">Else had she with her father ranged along.</div>
</div>
<div id="speech30" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.66">I did not then entreat to have her stay;</div>
<div id="scene1.3.67">It was your pleasure and your own remorse:</div>
<div id="scene1.3.68">I was too young that time to value her;</div>
<div id="scene1.3.69">But now I know her: if she be a traitor,</div>
<div id="scene1.3.70">Why so am I; we still have slept together,</div>
<div id="scene1.3.71">Rose at an instant, learn'd, play'd, eat together,</div>
<div id="scene1.3.72">And wheresoever we went, like Juno's swans,</div>
<div id="scene1.3.73">Still we went coupled and inseparable.</div>
</div>
<div id="speech31" class="character">DUKE FREDERICK</div>
<div class="dialog">
<div id="scene1.3.74">She is too subtle for thee; and her smoothness,</div>
<div id="scene1.3.75">Her very silence and her patience</div>
<div id="scene1.3.76">Speak to the people, and they pity her.</div>
<div id="scene1.3.77">Thou art a fool: she robs thee of thy name;</div>
<div id="scene1.3.78">And thou wilt show more bright and seem more virtuous</div>
<div id="scene1.3.79">When she is gone. Then open not thy lips:</div>
<div id="scene1.3.80">Firm and irrevocable is my doom</div>
<div id="scene1.3.81">Which I have pass'd upon her; she is banish'd.</div>
</div>
<div id="speech32" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.82">Pronounce that sentence then on me, my liege:</div>
<div id="scene1.3.83">I cannot live out of her company.</div>
</div>
<div id="speech33" class="character">DUKE FREDERICK</div>
<div class="dialog">
<div id="scene1.3.84">You are a fool. You, niece, provide yourself:</div>
<div id="scene1.3.85">If you outstay the time, upon mine honour,</div>
<div id="scene1.3.86">And in the greatness of my word, you die.</div>
<div class="direction">Exeunt DUKE FREDERICK and Lords</div>
</div>
<div id="speech34" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.87">O my poor Rosalind, whither wilt thou go?</div>
<div id="scene1.3.88">Wilt thou change fathers? I will give thee mine.</div>
<div id="scene1.3.89">I charge thee, be not thou more grieved than I am.</div>
</div>
<div id="speech35" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.90">I have more cause.</div>
</div>
<div id="speech36" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.91"> Thou hast not, cousin;</div>
<div id="scene1.3.92">Prithee be cheerful: know'st thou not, the duke</div>
<div id="scene1.3.93">Hath banish'd me, his daughter?</div>
</div>
<div id="speech37" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.94">That he hath not.</div>
</div>
<div id="speech38" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.95">No, hath not? Rosalind lacks then the love</div>
<div id="scene1.3.96">Which teacheth thee that thou and I am one:</div>
<div id="scene1.3.97">Shall we be sunder'd? shall we part, sweet girl?</div>
<div id="scene1.3.98">No: let my father seek another heir.</div>
<div id="scene1.3.99">Therefore devise with me how we may fly,</div>
<div id="scene1.3.100">Whither to go and what to bear with us;</div>
<div id="scene1.3.101">And do not seek to take your change upon you,</div>
<div id="scene1.3.102">To bear your griefs yourself and leave me out;</div>
<div id="scene1.3.103">For, by this heaven, now at our sorrows pale,</div>
<div id="scene1.3.104">Say what thou canst, I'll go along with thee.</div>
</div>
<div id="speech39" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.105">Why, whither shall we go?</div>
</div>
<div id="speech40" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.106">To seek my uncle in the forest of Arden.</div>
</div>
<div id="speech41" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.107">Alas, what danger will it be to us,</div>
<div id="scene1.3.108">Maids as we are, to travel forth so far!</div>
<div id="scene1.3.109">Beauty provoketh thieves sooner than gold.</div>
</div>
<div id="speech42" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.110">I'll put myself in poor and mean attire</div>
<div id="scene1.3.111">And with a kind of umber smirch my face;</div>
<div id="scene1.3.112">The like do you: so shall we pass along</div>
<div id="scene1.3.113">And never stir assailants.</div>
</div>
<div id="speech43" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.114">Were it not better,</div>
<div id="scene1.3.115">Because that I am more than common tall,</div>
<div id="scene1.3.116">That I did suit me all points like a man?</div>
<div id="scene1.3.117">A gallant curtle-axe upon my thigh,</div>
<div id="scene1.3.118">A boar-spear in my hand; and--in my heart</div>
<div id="scene1.3.119">Lie there what hidden woman's fear there will--</div>
<div id="scene1.3.120">We'll have a swashing and a martial outside,</div>
<div id="scene1.3.121">As many other mannish cowards have</div>
<div id="scene1.3.122">That do outface it with their semblances.</div>
</div>
<div id="speech44" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.123">What shall I call thee when thou art a man?</div>
</div>
<div id="speech45" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.124">I'll have no worse a name than Jove's own page;</div>
<div id="scene1.3.125">And therefore look you call me Ganymede.</div>
<div id="scene1.3.126">But what will you be call'd?</div>
</div>
<div id="speech46" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.127">Something that hath a reference to my state</div>
<div id="scene1.3.128">No longer Celia, but Aliena.</div>
</div>
<div id="speech47" class="character">ROSALIND</div>
<div class="dialog">
<div id="scene1.3.129">But, cousin, what if we assay'd to steal</div>
<div id="scene1.3.130">The clownish fool out of your father's court?</div>
<div id="scene1.3.131">Would he not be a comfort to our travel?</div>
</div>
<div id="speech48" class="character">CELIA</div>
<div class="dialog">
<div id="scene1.3.132">He'll go along o'er the wide world with me;</div>
<div id="scene1.3.133">Leave me alone to woo him. Let's away,</div>
<div id="scene1.3.134">And get our jewels and our wealth together,</div>
<div id="scene1.3.135">Devise the fittest time and safest way</div>
<div id="scene1.3.136">To hide us from pursuit that will be made</div>
<div id="scene1.3.137">After my flight. Now go we in content</div>
<div id="scene1.3.138">To liberty and not to banishment.</div>
<div class="direction">Exeunt</div>
</div>
</div>
</div>
<script type="text/javascript" charset="utf-8">
jQuery.benchmarker = {libraries: ["$", "jQuery"]};
</script>
<script src="benchmarker.js"></script>
</body>
</html>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

285
build/uglify.js Normal file
View file

@ -0,0 +1,285 @@
#! /usr/bin/env node
// -*- js -*-
global.sys = require(/^v0\.[012]/.test(process.version) ? "sys" : "util");
var fs = require("fs");
var jsp = require("./lib/parse-js"),
pro = require("./lib/process");
var options = {
ast: false,
mangle: true,
mangle_toplevel: false,
squeeze: true,
make_seqs: true,
dead_code: true,
verbose: false,
show_copyright: true,
out_same_file: false,
max_line_length: 32 * 1024,
unsafe: false,
reserved_names: null,
defines: { },
codegen_options: {
ascii_only: false,
beautify: false,
indent_level: 4,
indent_start: 0,
quote_keys: false,
space_colon: false
},
output: true // stdout
};
var args = jsp.slice(process.argv, 2);
var filename;
out: while (args.length > 0) {
var v = args.shift();
switch (v) {
case "-b":
case "--beautify":
options.codegen_options.beautify = true;
break;
case "-i":
case "--indent":
options.codegen_options.indent_level = args.shift();
break;
case "-q":
case "--quote-keys":
options.codegen_options.quote_keys = true;
break;
case "-mt":
case "--mangle-toplevel":
options.mangle_toplevel = true;
break;
case "--no-mangle":
case "-nm":
options.mangle = false;
break;
case "--no-squeeze":
case "-ns":
options.squeeze = false;
break;
case "--no-seqs":
options.make_seqs = false;
break;
case "--no-dead-code":
options.dead_code = false;
break;
case "--no-copyright":
case "-nc":
options.show_copyright = false;
break;
case "-o":
case "--output":
options.output = args.shift();
break;
case "--overwrite":
options.out_same_file = true;
break;
case "-v":
case "--verbose":
options.verbose = true;
break;
case "--ast":
options.ast = true;
break;
case "--unsafe":
options.unsafe = true;
break;
case "--max-line-len":
options.max_line_length = parseInt(args.shift(), 10);
break;
case "--reserved-names":
options.reserved_names = args.shift().split(",");
break;
case "-d":
case "--define":
var defarg = args.shift();
try {
var defsym = function(sym) {
// KEYWORDS_ATOM doesn't include NaN or Infinity - should we check
// for them too ?? We don't check reserved words and the like as the
// define values are only substituted AFTER parsing
if (jsp.KEYWORDS_ATOM.hasOwnProperty(sym)) {
throw "Don't define values for inbuilt constant '"+sym+"'";
}
return sym;
},
defval = function(v) {
if (v.match(/^"(.*)"$/) || v.match(/^'(.*)'$/)) {
return [ "string", RegExp.$1 ];
}
else if (!isNaN(parseFloat(v))) {
return [ "num", parseFloat(v) ];
}
else if (v.match(/^[a-z\$_][a-z\$_0-9]*$/i)) {
return [ "name", v ];
}
else if (!v.match(/"/)) {
return [ "string", v ];
}
else if (!v.match(/'/)) {
return [ "string", v ];
}
throw "Can't understand the specified value: "+v;
};
if (defarg.match(/^([a-z_\$][a-z_\$0-9]*)(=(.*))?$/i)) {
var sym = defsym(RegExp.$1),
val = RegExp.$2 ? defval(RegExp.$2.substr(1)) : [ 'name', 'true' ];
options.defines[sym] = val;
}
else {
throw "The --define option expects SYMBOL[=value]";
}
} catch(ex) {
sys.print("ERROR: In option --define "+defarg+"\n"+ex+"\n");
process.exit(1);
}
break;
case "--define-from-module":
var defmodarg = args.shift(),
defmodule = require(defmodarg),
sym,
val;
for (sym in defmodule) {
if (defmodule.hasOwnProperty(sym)) {
options.defines[sym] = function(val) {
if (typeof val == "string")
return [ "string", val ];
if (typeof val == "number")
return [ "num", val ];
if (val === true)
return [ 'name', 'true' ];
if (val === false)
return [ 'name', 'false' ];
if (val === null)
return [ 'name', 'null' ];
if (val === undefined)
return [ 'name', 'undefined' ];
sys.print("ERROR: In option --define-from-module "+defmodarg+"\n");
sys.print("ERROR: Unknown object type for: "+sym+"="+val+"\n");
process.exit(1);
return null;
}(defmodule[sym]);
}
}
break;
case "--ascii":
options.codegen_options.ascii_only = true;
break;
default:
filename = v;
break out;
}
}
if (options.verbose) {
pro.set_logger(function(msg){
sys.debug(msg);
});
}
jsp.set_logger(function(msg){
sys.debug(msg);
});
if (filename) {
fs.readFile(filename, "utf8", function(err, text){
if (err) throw err;
output(squeeze_it(text));
});
} else {
var stdin = process.openStdin();
stdin.setEncoding("utf8");
var text = "";
stdin.on("data", function(chunk){
text += chunk;
});
stdin.on("end", function() {
output(squeeze_it(text));
});
}
function output(text) {
var out;
if (options.out_same_file && filename)
options.output = filename;
if (options.output === true) {
out = process.stdout;
} else {
out = fs.createWriteStream(options.output, {
flags: "w",
encoding: "utf8",
mode: 0644
});
}
out.write(text);
if (options.output !== true) {
out.end();
}
};
// --------- main ends here.
function show_copyright(comments) {
var ret = "";
for (var i = 0; i < comments.length; ++i) {
var c = comments[i];
if (c.type == "comment1") {
ret += "//" + c.value + "\n";
} else {
ret += "/*" + c.value + "*/";
}
}
return ret;
};
function squeeze_it(code) {
var result = "";
if (options.show_copyright) {
var tok = jsp.tokenizer(code), c;
c = tok();
result += show_copyright(c.comments_before);
}
try {
var ast = time_it("parse", function(){ return jsp.parse(code); });
if (options.mangle) ast = time_it("mangle", function(){
return pro.ast_mangle(ast, {
toplevel: options.mangle_toplevel,
defines: options.defines,
except: options.reserved_names
});
});
if (options.squeeze) ast = time_it("squeeze", function(){
ast = pro.ast_squeeze(ast, {
make_seqs : options.make_seqs,
dead_code : options.dead_code,
keep_comps : !options.unsafe
});
if (options.unsafe)
ast = pro.ast_squeeze_more(ast);
return ast;
});
if (options.ast)
return sys.inspect(ast, null, null);
result += time_it("generate", function(){ return pro.gen_code(ast, options.codegen_options) });
if (!options.codegen_options.beautify && options.max_line_length) {
result = time_it("split", function(){ return pro.split_lines(result, options.max_line_length) });
}
return result;
} catch(ex) {
sys.debug(ex.stack);
sys.debug(sys.inspect(ex));
sys.debug(JSON.stringify(ex));
}
};
function time_it(name, cont) {
if (!options.verbose)
return cont();
var t1 = new Date().getTime();
try { return cont(); }
finally { sys.debug("// " + name + ": " + ((new Date().getTime() - t1) / 1000).toFixed(3) + " sec."); }
};

15
speed/benchmark.js Normal file
View file

@ -0,0 +1,15 @@
// Runs a function many times without the function call overhead
function benchmark(fn, times, name){
fn = fn.toString();
var s = fn.indexOf('{')+1,
e = fn.lastIndexOf('}');
fn = fn.substring(s,e);
return benchmarkString(fn, times, name);
}
function benchmarkString(fn, times, name) {
var fn = new Function("i", "var t=new Date; while(i--) {" + fn + "}; return new Date - t")(times)
fn.displayName = name || "benchmarked";
return fn;
}

0
build/speed/benchmarker.css → speed/benchmarker.css Executable file → Normal file
View file

57
build/speed/benchmarker.js → speed/benchmarker.js Executable file → Normal file
View file

@ -1,18 +1,42 @@
jQuery.benchmarker.tests = [
// Selectors from:
// http://ejohn.org/blog/selectors-that-people-actually-use/
/*
// For Amazon.com
"#navAmazonLogo", "#navSwmSkedPop",
".navbar", ".navGreeting",
"div", "table",
"img.navCrossshopTabCap", "span.navGreeting",
"#navbar table", "#navidWelcomeMsg span",
"div#navbar", "ul#navAmazonLogo",
"#navAmazonLogo .navAmazonLogoGatewayPanel", "#navidWelcomeMsg .navGreeting",
".navbar .navAmazonLogoGatewayPanel", ".navbar .navGreeting",
"*",
"body", "body div", "div",
"div div div", "div div", ".dialog", "div.dialog", "div .dialog",
"#speech5", "div#speech5", "div #speech5", "div > div", "div.scene div.dialog",
"div#scene1.scene div.dialog div", "#scene1 #speech1", "body > div.dialog div#speech5",
"div:nth-child(even)", "div:nth-child(odd)",
"div:nth-child(1)", "div:nth-child(2n)",
"div:nth-child(2n+3)", "div:first-child",
"div:last-child", "div:only-child",
"div:contains(CELIA)",
"div ~ div", "div + div",
"div[@class]", "div[@class=dialog]", "div[@class!=dialog]",
"div[@class^=dialog]", "div[@class$=dialog]", "div[@class*=dialog]"
]
"#navAmazonLogo li.navAmazonLogoGatewayPanel", "#navidWelcomeMsg span.navGreeting",
"a[name=top]", "form[name=site-search]",
".navbar li", ".navbar span",
"[name=top]", "[name=site-search]",
"ul li", "a img",
"#navbar #navidWelcomeMsg", "#navbar #navSwmDWPop",
"#navbar ul li", "#navbar a img"
*/
// For Yahoo.com
"#page", "#masthead", "#mastheadhd",
".mastheadbd", ".first", ".on",
"div", "li", "a",
"div.mastheadbd", "li.first", "li.on",
"#page div", "#dtba span",
"div#page", "div#masthead",
"#page .mastheadbd", "#page .first",
".outer_search_container .search_container", ".searchbox_container .inputtext",
"*",
"#page div.mastheadbd", "#page li.first",
"input[name=p]", "a[name=marketplace]",
".outer_search_container div", ".searchbox_container span",
"[name=p]", "[name=marketplace]",
"ul li", "form input",
"#page #e2econtent", "#page #e2e"
];
jQuery.fn.benchmark = function() {
this.each(function() {
@ -38,8 +62,8 @@
jQuery("button.retryTies").bind("click", function() { jQuery("tr:has(td.tie) td.test").benchmark() })
jQuery("button.selectAll").bind("click", function() { jQuery("input[@type=checkbox]").each(function() { this.checked = true }) })
jQuery("button.deselectAll").bind("click", function() { jQuery("input[@type=checkbox]").each(function() { this.checked = false }) })
jQuery("button.selectAll").bind("click", function() { jQuery("input[type=checkbox]").each(function() { this.checked = true }) })
jQuery("button.deselectAll").bind("click", function() { jQuery("input[type=checkbox]").each(function() { this.checked = false }) })
jQuery("#addTest").bind("click", function() {
jQuery("table").append("<tr><td><input type='checkbox' /></td><td><input type='text' /><button>Add</button></td></tr>");
@ -77,9 +101,6 @@
var times = times || 50;
var el = list[0];
var code = jQuery(el).text().replace(/^-/, "");
if(!libraries[0].match(/^jQ/)) {
code = code.replace(/@/, "");
}
var timeArr = []
for(i = 0; i < times + 2; i++) {
var time = new Date()

39
speed/closest.html Normal file
View file

@ -0,0 +1,39 @@
<!doctype html>
<html>
<head>
<title>Test .closest() Performance</title>
<script src="benchmark.js"></script>
<script src="jquery-basis.js"></script>
<script>var old = jQuery.noConflict(true);</script>
<script src="../dist/jquery.js"></script>
<script>
jQuery(function ready() {
var node = $("#child"), name;
jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) {
setTimeout(function(){
name = "closest '" + item + "'";
jQuery("#results").append("<li>" + name + "<ul>" +
"<li>new: " + benchmarkString("$('#child').closest('" + item + "')", 2500, name) + "</li>" +
"<li>old: " + benchmarkString("old('#child').closest('" + item + "')", 2500, name) + "</li>"
+ "</ul></li>");
}, 100);
});
});
</script>
</head>
<body>
<div>
<p>Hello</p>
<div class="zoo" id="zoo" data-foo="bar">
<div>
<p id="child">lorem ipsum</p>
<p>dolor sit amet</p>
</div>
</div>
</div>
<ul id="results"></ul>
</body>
</html>

82
speed/css.html Normal file
View file

@ -0,0 +1,82 @@
<!doctype html>
<html>
<head>
<title>Test Event Handling Performance</title>
<script src="benchmark.js"></script>
<script src="jquery-basis.js"></script>
<script>var old = jQuery.noConflict(true);</script>
<script src="../dist/jquery.js"></script>
<script>
var num = 400;
jQuery(function(){
var p = old("p");
var s = (new Date).getTime();
for ( var n = 0; n < 5; n++ ) {
for ( var i = 0; i < num; i++ ) {
p.css("position");
p.css("top");
p.css("left");
p.css("display");
}
}
var oldNum = (new Date).getTime() - s;
p = jQuery("p");
s = (new Date).getTime();
for ( var n = 0; n < 5; n++ ) {
for ( var i = 0; i < num; i++ ) {
p.css("position");
p.css("top");
p.css("left");
p.css("display");
}
}
var curNum = (new Date).getTime() - s;
jQuery("#num").text( old.fn.jquery + ": " + oldNum + " " + jQuery.fn.jquery + ": " + curNum );
});
jQuery(function(){
var p = old("p");
var s = (new Date).getTime();
for ( var n = 0; n < 5; n++ ) {
for ( var i = 0; i < num; i++ ) {
p.css("position", "relative");
p.css("top", 15);
p.css("left", 15);
p.css("display", "block");
}
}
var oldNum = (new Date).getTime() - s;
p = jQuery("p");
s = (new Date).getTime();
for ( var n = 0; n < 5; n++ ) {
for ( var i = 0; i < num; i++ ) {
p.css("position", "relative");
p.css("top", 15);
p.css("left", 15);
p.css("display", "block");
}
}
var curNum = (new Date).getTime() - s;
jQuery("#num2").text( old.fn.jquery + ": " + oldNum + " " + jQuery.fn.jquery + ": " + curNum );
});
</script>
<style>p { position: absolute; top: 5px; left: 5px; }</style>
</head>
<body>
<p><strong>Getting Values:</strong> <span id="num">Loading...</span></p>
<p><strong>Setting Values:</strong> <span id="num2">Loading...</span></p>
</body>
</html>

58
speed/event.html Normal file
View file

@ -0,0 +1,58 @@
<!doctype html>
<html>
<head>
<title>Test Event Handling Performance</title>
<script src="benchmark.js"></script>
<script src="jquery-basis.js"></script>
<script>var old = jQuery.noConflict(true);</script>
<script src="../dist/jquery.js"></script>
<script>
jQuery(function(){
});
var events = [], num = 400, exec = false;
jQuery(document).mousemove(function(e){
if ( exec ) {
return;
}
if ( events.length >= num ) {
exec = true;
var s = (new Date).getTime();
for ( var n = 0; n < 5; n++ ) {
for ( var i = 0; i < num; i++ ) {
old.event.handle.call( document, events[i] );
}
}
var oldNum = (new Date).getTime() - s;
s = (new Date).getTime();
for ( var n = 0; n < 5; n++ ) {
for ( var i = 0; i < num; i++ ) {
jQuery.event.handle.call( document, events[i] );
}
}
var curNum = (new Date).getTime() - s;
jQuery("#num").text( old.fn.jquery + ": " + oldNum + " " + jQuery.fn.jquery + ": " + curNum );
jQuery(this).unbind( "mousemove", e.handler );
} else {
events.push( e.originalEvent );
jQuery("#num").text( events.length + " / " + num );
}
});
</script>
</head>
<body>
<p>Move the mouse, please!</p>
<p id="num"></p>
</body>
</html>

183
speed/filter.html Normal file
View file

@ -0,0 +1,183 @@
<!doctype html>
<html>
<head>
<title>Test .filter() Performance</title>
<script src="benchmark.js"></script>
<script src="jquery-basis.js"></script>
<script>var old = jQuery.noConflict(true);</script>
<script src="../dist/jquery.js"></script>
<script>
jQuery(function ready() {
var node = $("#child"), name;
jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) {
setTimeout(function(){
name = "filter '" + item + "'";
jQuery("#results").append("<li>" + name + "<ul>" +
"<li>new: " + benchmarkString("$('div').filter('" + item + "')", 100, name) + "</li>" +
"<li>old: " + benchmarkString("old('div').filter('" + item + "')", 100, name) + "</li>" +
"</ul></li>");
jQuery("#results").append("<li>single " + name + "<ul>" +
"<li>new: " + benchmarkString("$('#nonexistant').filter('" + item + "')", 1000, name) + "</li>" +
"<li>old: " + benchmarkString("old('#nonexistant').filter('" + item + "')", 1000, name) + "</li>" +
"</ul></li>");
}, 100);
});
});
</script>
</head>
<body>
<div>
<p>Hello</p>
<div class="zoo" id="nonexistant" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
</div>
<ul id="results"></ul>
</body>
</html>

179
speed/find.html Normal file
View file

@ -0,0 +1,179 @@
<!doctype html>
<html>
<head>
<title>Test .find() Performance</title>
<script src="benchmark.js"></script>
<script src="jquery-basis.js"></script>
<script>var old = jQuery.noConflict(true);</script>
<script src="../dist/jquery.js"></script>
<script>
jQuery(function ready() {
var node = $("#child"), name;
jQuery.each([".zoo", "#zoo", "[data-foo=zoo]", "#nonexistant"], function(i, item) {
setTimeout(function(){
name = "find '" + item + "'";
jQuery("#results").append("<li>rooted " + name + "<ul>" +
"<li>new: " + benchmarkString("$('body').find('" + item + "')", 250, name) + "</li>" +
"<li>old: " + benchmarkString("old('body').find('" + item + "')", 250, name) + "</li>" +
"</ul></li>");
}, 100);
});
});
</script>
</head>
<body>
<div>
<p>Hello</p>
<div class="zoo" id="nonexistant" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
<div class="zoo" id="zoo" data-foo="bar"><div></div></div>
</div>
<ul id="results"></ul>
</body>
</html>

72
speed/index.html Normal file

File diff suppressed because one or more lines are too long

6238
speed/jquery-basis.js vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,47 @@
<script type="text/javascript">
(function(){
// Conclusions:
// slice() is a little faster than concat() except on Chrome
// This clone() is slower on FF & IE but takes 50% on Safari & Chrome
var SIZE = 1e4,
LOOPS = 500;
var arr = new Array(SIZE);
for ( var i=arr.length-1; i >= 0; --i )
arr[i] = 0;
var t = new Date;
for ( i=0; i < LOOPS; i++ )
arr.slice(0);
var tslice = new Date - t;
t = new Date;
for ( i=0; i < LOOPS; i++ )
arr.concat();
var tconcat = new Date - t;
// clone() is just to see how fast built-ins are
t = new Date;
for ( i=0; i < LOOPS; i++ )
clone(arr);
var tclone = new Date - t;
alert([
'slice:'+tslice,
'concat:'+tconcat,
'clone:'+tclone
].join('\n'));
function clone(arr){
var i = arr.length,
copy = new Array(i);
while (i--)
copy[i] = arr[i];
return copy;
}
})();
</script>

File diff suppressed because it is too large Load diff

79
src/ajax/jsonp.js Normal file
View file

@ -0,0 +1,79 @@
(function( jQuery ) {
var jsc = jQuery.now(),
jsre = /(\=)\?(&|$)|\?\?/i;
// Default jsonp settings
jQuery.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
return jQuery.expando + "_" + ( jsc++ );
}
});
// Detect, normalize options and install callbacks for jsonp requests
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
( typeof s.data === "string" );
if ( s.dataTypes[ 0 ] === "jsonp" ||
s.jsonp !== false && ( jsre.test( s.url ) ||
inspectData && jsre.test( s.data ) ) ) {
var responseContainer,
jsonpCallback = s.jsonpCallback =
jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
previous = window[ jsonpCallback ],
url = s.url,
data = s.data,
replace = "$1" + jsonpCallback + "$2";
if ( s.jsonp !== false ) {
url = url.replace( jsre, replace );
if ( s.url === url ) {
if ( inspectData ) {
data = data.replace( jsre, replace );
}
if ( s.data === data ) {
// Add callback manually
url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
}
}
}
s.url = url;
s.data = data;
// Install callback
window[ jsonpCallback ] = function( response ) {
responseContainer = [ response ];
};
// Clean-up function
jqXHR.always(function() {
// Set callback back to previous value
window[ jsonpCallback ] = previous;
// Call if it was a function and we have a response
if ( responseContainer && jQuery.isFunction( previous ) ) {
window[ jsonpCallback ]( responseContainer[ 0 ] );
}
});
// Use data converter to retrieve json after script execution
s.converters["script json"] = function() {
if ( !responseContainer ) {
jQuery.error( jsonpCallback + " was not called" );
}
return responseContainer[ 0 ];
};
// force json dataType
s.dataTypes[ 0 ] = "json";
// Delegate to script
return "script";
}
});
})( jQuery );

89
src/ajax/script.js Normal file
View file

@ -0,0 +1,89 @@
(function( jQuery ) {
// Install script dataType
jQuery.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /javascript|ecmascript/
},
converters: {
"text script": function( text ) {
jQuery.globalEval( text );
return text;
}
}
});
// Handle cache's special case and global
jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) {
s.cache = false;
}
if ( s.crossDomain ) {
s.type = "GET";
s.global = false;
}
});
// Bind script tag hack transport
jQuery.ajaxTransport( "script", function(s) {
// This transport only deals with cross domain requests
if ( s.crossDomain ) {
var script,
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
return {
send: function( _, callback ) {
script = document.createElement( "script" );
script.async = "async";
if ( s.scriptCharset ) {
script.charset = s.scriptCharset;
}
script.src = s.url;
// Attach handlers for all browsers
script.onload = script.onreadystatechange = function( _, isAbort ) {
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
// Handle memory leak in IE
script.onload = script.onreadystatechange = null;
// Remove the script
if ( head && script.parentNode ) {
head.removeChild( script );
}
// Dereference the script
script = undefined;
// Callback if not abort
if ( !isAbort ) {
callback( 200, "success" );
}
}
};
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
// This arises when a base node is used (#2709 and #4378).
head.insertBefore( script, head.firstChild );
},
abort: function() {
if ( script ) {
script.onload( 0, 1 );
}
}
};
}
});
})( jQuery );

218
src/ajax/xhr.js Normal file
View file

@ -0,0 +1,218 @@
(function( jQuery ) {
var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
xhrOnUnloadAbort = window.ActiveXObject ? function() {
// Abort all pending requests
for ( var key in xhrCallbacks ) {
xhrCallbacks[ key ]( 0, 1 );
}
} : false,
xhrId = 0,
xhrCallbacks;
// Functions to create xhrs
function createStandardXHR() {
try {
return new window.XMLHttpRequest();
} catch( e ) {}
}
function createActiveXHR() {
try {
return new window.ActiveXObject( "Microsoft.XMLHTTP" );
} catch( e ) {}
}
// Create the request object
// (This is still attached to ajaxSettings for backward compatibility)
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
/* Microsoft failed to properly
* implement the XMLHttpRequest in IE7 (can't request local files),
* so we use the ActiveXObject when it is available
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
* we need a fallback.
*/
function() {
return !this.isLocal && createStandardXHR() || createActiveXHR();
} :
// For all other browsers, use the standard XMLHttpRequest object
createStandardXHR;
// Determine support properties
(function( xhr ) {
jQuery.extend( jQuery.support, {
ajax: !!xhr,
cors: !!xhr && ( "withCredentials" in xhr )
});
})( jQuery.ajaxSettings.xhr() );
// Create transport if the browser can provide an xhr
if ( jQuery.support.ajax ) {
jQuery.ajaxTransport(function( s ) {
// Cross domain only allowed if supported through XMLHttpRequest
if ( !s.crossDomain || jQuery.support.cors ) {
var callback;
return {
send: function( headers, complete ) {
// Get a new xhr
var xhr = s.xhr(),
handle,
i;
// Open the socket
// Passing null username, generates a login popup on Opera (#2865)
if ( s.username ) {
xhr.open( s.type, s.url, s.async, s.username, s.password );
} else {
xhr.open( s.type, s.url, s.async );
}
// Apply custom fields if provided
if ( s.xhrFields ) {
for ( i in s.xhrFields ) {
xhr[ i ] = s.xhrFields[ i ];
}
}
// Override mime type if needed
if ( s.mimeType && xhr.overrideMimeType ) {
xhr.overrideMimeType( s.mimeType );
}
// X-Requested-With header
// For cross-domain requests, seeing as conditions for a preflight are
// akin to a jigsaw puzzle, we simply never set it to be sure.
// (it can always be set on a per-request basis or even using ajaxSetup)
// For same-domain requests, won't change header if already provided.
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
headers[ "X-Requested-With" ] = "XMLHttpRequest";
}
// Need an extra try/catch for cross domain requests in Firefox 3
try {
for ( i in headers ) {
xhr.setRequestHeader( i, headers[ i ] );
}
} catch( _ ) {}
// Do send the request
// This may raise an exception which is actually
// handled in jQuery.ajax (so no try/catch here)
xhr.send( ( s.hasContent && s.data ) || null );
// Listener
callback = function( _, isAbort ) {
var status,
statusText,
responseHeaders,
responses,
xml;
// Firefox throws exceptions when accessing properties
// of an xhr when a network error occured
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
try {
// Was never called and is aborted or complete
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
// Only called once
callback = undefined;
// Do not keep as active anymore
if ( handle ) {
xhr.onreadystatechange = jQuery.noop;
if ( xhrOnUnloadAbort ) {
delete xhrCallbacks[ handle ];
}
}
// If it's an abort
if ( isAbort ) {
// Abort it manually if needed
if ( xhr.readyState !== 4 ) {
xhr.abort();
}
} else {
status = xhr.status;
responseHeaders = xhr.getAllResponseHeaders();
responses = {};
xml = xhr.responseXML;
// Construct response list
if ( xml && xml.documentElement /* #4958 */ ) {
responses.xml = xml;
}
responses.text = xhr.responseText;
// Firefox throws an exception when accessing
// statusText for faulty cross-domain requests
try {
statusText = xhr.statusText;
} catch( e ) {
// We normalize with Webkit giving an empty statusText
statusText = "";
}
// Filter status for non standard behaviors
// If the request is local and we have data: assume a success
// (success with no data won't get notified, that's the best we
// can do given current implementations)
if ( !status && s.isLocal && !s.crossDomain ) {
status = responses.text ? 200 : 404;
// IE - #1450: sometimes returns 1223 when it should be 204
} else if ( status === 1223 ) {
status = 204;
}
}
}
} catch( firefoxAccessException ) {
if ( !isAbort ) {
complete( -1, firefoxAccessException );
}
}
// Call complete if needed
if ( responses ) {
complete( status, statusText, responses, responseHeaders );
}
};
// if we're in sync mode or it's in cache
// and has been retrieved directly (IE6 & IE7)
// we need to manually fire the callback
if ( !s.async || xhr.readyState === 4 ) {
callback();
} else {
handle = ++xhrId;
if ( xhrOnUnloadAbort ) {
// Create the active xhrs callbacks list if needed
// and attach the unload handler
if ( !xhrCallbacks ) {
xhrCallbacks = {};
jQuery( window ).unload( xhrOnUnloadAbort );
}
// Add to list of active xhrs callbacks
xhrCallbacks[ handle ] = callback;
}
xhr.onreadystatechange = callback;
}
},
abort: function() {
if ( callback ) {
callback(0,1);
}
}
};
}
});
}
})( jQuery );

630
src/attributes.js Normal file
View file

@ -0,0 +1,630 @@
(function( jQuery ) {
var rclass = /[\n\t\r]/g,
rspace = /\s+/,
rreturn = /\r/g,
rtype = /^(?:button|input)$/i,
rfocusable = /^(?:button|input|object|select|textarea)$/i,
rclickable = /^a(?:rea)?$/i,
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
rinvalidChar = /\:|^on/,
formHook, boolHook;
jQuery.fn.extend({
attr: function( name, value ) {
return jQuery.access( this, name, value, true, jQuery.attr );
},
removeAttr: function( name ) {
return this.each(function() {
jQuery.removeAttr( this, name );
});
},
prop: function( name, value ) {
return jQuery.access( this, name, value, true, jQuery.prop );
},
removeProp: function( name ) {
name = jQuery.propFix[ name ] || name;
return this.each(function() {
// try/catch handles cases where IE balks (such as removing a property on window)
try {
this[ name ] = undefined;
delete this[ name ];
} catch( e ) {}
});
},
addClass: function( value ) {
var classNames, i, l, elem,
setClass, c, cl;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).addClass( value.call(this, j, this.className) );
});
}
if ( value && typeof value === "string" ) {
classNames = value.split( rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
if ( elem.nodeType === 1 ) {
if ( !elem.className && classNames.length === 1 ) {
elem.className = value;
} else {
setClass = " " + elem.className + " ";
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
setClass += classNames[ c ] + " ";
}
}
elem.className = jQuery.trim( setClass );
}
}
}
}
return this;
},
removeClass: function( value ) {
var classNames, i, l, elem, className, c, cl;
if ( jQuery.isFunction( value ) ) {
return this.each(function( j ) {
jQuery( this ).removeClass( value.call(this, j, this.className) );
});
}
if ( (value && typeof value === "string") || value === undefined ) {
classNames = (value || "").split( rspace );
for ( i = 0, l = this.length; i < l; i++ ) {
elem = this[ i ];
if ( elem.nodeType === 1 && elem.className ) {
if ( value ) {
className = (" " + elem.className + " ").replace( rclass, " " );
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
className = className.replace(" " + classNames[ c ] + " ", " ");
}
elem.className = jQuery.trim( className );
} else {
elem.className = "";
}
}
}
}
return this;
},
toggleClass: function( value, stateVal ) {
var type = typeof value,
isBool = typeof stateVal === "boolean";
if ( jQuery.isFunction( value ) ) {
return this.each(function( i ) {
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
});
}
return this.each(function() {
if ( type === "string" ) {
// toggle individual class names
var className,
i = 0,
self = jQuery( this ),
state = stateVal,
classNames = value.split( rspace );
while ( (className = classNames[ i++ ]) ) {
// check each className given, space seperated list
state = isBool ? state : !self.hasClass( className );
self[ state ? "addClass" : "removeClass" ]( className );
}
} else if ( type === "undefined" || type === "boolean" ) {
if ( this.className ) {
// store className if set
jQuery._data( this, "__className__", this.className );
}
// toggle whole className
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
}
});
},
hasClass: function( selector ) {
var className = " " + selector + " ";
for ( var i = 0, l = this.length; i < l; i++ ) {
if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
return true;
}
}
return false;
},
val: function( value ) {
var hooks, ret,
elem = this[0];
if ( !arguments.length ) {
if ( elem ) {
hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
return ret;
}
ret = elem.value;
return typeof ret === "string" ?
// handle most common string cases
ret.replace(rreturn, "") :
// handle cases where value is null/undef or number
ret == null ? "" : ret;
}
return undefined;
}
var isFunction = jQuery.isFunction( value );
return this.each(function( i ) {
var self = jQuery(this), val;
if ( this.nodeType !== 1 ) {
return;
}
if ( isFunction ) {
val = value.call( this, i, self.val() );
} else {
val = value;
}
// Treat null/undefined as ""; convert numbers to string
if ( val == null ) {
val = "";
} else if ( typeof val === "number" ) {
val += "";
} else if ( jQuery.isArray( val ) ) {
val = jQuery.map(val, function ( value ) {
return value == null ? "" : value + "";
});
}
hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
// If set returns undefined, fall back to normal setting
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
this.value = val;
}
});
}
});
jQuery.extend({
valHooks: {
option: {
get: function( elem ) {
// attributes.value is undefined in Blackberry 4.7 but
// uses .value. See #6932
var val = elem.attributes.value;
return !val || val.specified ? elem.value : elem.text;
}
},
select: {
get: function( elem ) {
var value,
index = elem.selectedIndex,
values = [],
options = elem.options,
one = elem.type === "select-one";
// Nothing was selected
if ( index < 0 ) {
return null;
}
// Loop through all the selected options
for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
var option = options[ i ];
// Don't return options that are disabled or in a disabled optgroup
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
// Get the specific value for the option
value = jQuery( option ).val();
// We don't need an array for one selects
if ( one ) {
return value;
}
// Multi-Selects return an array
values.push( value );
}
}
// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
if ( one && !values.length && options.length ) {
return jQuery( options[ index ] ).val();
}
return values;
},
set: function( elem, value ) {
var values = jQuery.makeArray( value );
jQuery(elem).find("option").each(function() {
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
});
if ( !values.length ) {
elem.selectedIndex = -1;
}
return values;
}
}
},
attrFn: {
val: true,
css: true,
html: true,
text: true,
data: true,
width: true,
height: true,
offset: true
},
attrFix: {
// Always normalize to ensure hook usage
tabindex: "tabIndex"
},
attr: function( elem, name, value, pass ) {
var nType = elem.nodeType;
// don't get/set attributes on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return undefined;
}
if ( pass && name in jQuery.attrFn ) {
return jQuery( elem )[ name ]( value );
}
// Fallback to prop when attributes are not supported
if ( !("getAttribute" in elem) ) {
return jQuery.prop( elem, name, value );
}
var ret, hooks,
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// Normalize the name if needed
if ( notxml ) {
name = jQuery.attrFix[ name ] || name;
hooks = jQuery.attrHooks[ name ];
if ( !hooks ) {
// Use boolHook for boolean attributes
if ( rboolean.test( name ) ) {
hooks = boolHook;
// Use formHook for forms and if the name contains certain characters
} else if ( formHook && name !== "className" &&
(jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {
hooks = formHook;
}
}
}
if ( value !== undefined ) {
if ( value === null ) {
jQuery.removeAttr( elem, name );
return undefined;
} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
elem.setAttribute( name, "" + value );
return value;
}
} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
return ret;
} else {
ret = elem.getAttribute( name );
// Non-existent attributes return null, we normalize to undefined
return ret === null ?
undefined :
ret;
}
},
removeAttr: function( elem, name ) {
var propName;
if ( elem.nodeType === 1 ) {
name = jQuery.attrFix[ name ] || name;
if ( jQuery.support.getSetAttribute ) {
// Use removeAttribute in browsers that support it
elem.removeAttribute( name );
} else {
jQuery.attr( elem, name, "" );
elem.removeAttributeNode( elem.getAttributeNode( name ) );
}
// Set corresponding property to false for boolean attributes
if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) in elem ) {
elem[ propName ] = false;
}
}
},
attrHooks: {
type: {
set: function( elem, value ) {
// We can't allow the type property to be changed (since it causes problems in IE)
if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
jQuery.error( "type property can't be changed" );
} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
// Setting the type on a radio button after the value resets the value in IE6-9
// Reset value to it's default in case type is set after value
// This is for element creation
var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
elem.value = val;
}
return value;
}
}
},
tabIndex: {
get: function( elem ) {
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
var attributeNode = elem.getAttributeNode("tabIndex");
return attributeNode && attributeNode.specified ?
parseInt( attributeNode.value, 10 ) :
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
0 :
undefined;
}
},
// Use the value property for back compat
// Use the formHook for button elements in IE6/7 (#1954)
value: {
get: function( elem, name ) {
if ( formHook && jQuery.nodeName( elem, "button" ) ) {
return formHook.get( elem, name );
}
return name in elem ?
elem.value :
null;
},
set: function( elem, value, name ) {
if ( formHook && jQuery.nodeName( elem, "button" ) ) {
return formHook.set( elem, value, name );
}
// Does not return so that setAttribute is also used
elem.value = value;
}
}
},
propFix: {
tabindex: "tabIndex",
readonly: "readOnly",
"for": "htmlFor",
"class": "className",
maxlength: "maxLength",
cellspacing: "cellSpacing",
cellpadding: "cellPadding",
rowspan: "rowSpan",
colspan: "colSpan",
usemap: "useMap",
frameborder: "frameBorder",
contenteditable: "contentEditable"
},
prop: function( elem, name, value ) {
var nType = elem.nodeType;
// don't get/set properties on text, comment and attribute nodes
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
return undefined;
}
var ret, hooks,
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
if ( notxml ) {
// Fix name and attach hooks
name = jQuery.propFix[ name ] || name;
hooks = jQuery.propHooks[ name ];
}
if ( value !== undefined ) {
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
return ret;
} else {
return (elem[ name ] = value);
}
} else {
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== undefined ) {
return ret;
} else {
return elem[ name ];
}
}
},
propHooks: {}
});
// Hook for boolean attributes
boolHook = {
get: function( elem, name ) {
// Align boolean attributes with corresponding properties
return jQuery.prop( elem, name ) ?
name.toLowerCase() :
undefined;
},
set: function( elem, value, name ) {
var propName;
if ( value === false ) {
// Remove boolean attributes when set to false
jQuery.removeAttr( elem, name );
} else {
// value is true since we know at this point it's type boolean and not false
// Set boolean attributes to the same name and set the DOM property
propName = jQuery.propFix[ name ] || name;
if ( propName in elem ) {
// Only set the IDL specifically if it already exists on the element
elem[ propName ] = true;
}
elem.setAttribute( name, name.toLowerCase() );
}
return name;
}
};
// IE6/7 do not support getting/setting some attributes with get/setAttribute
if ( !jQuery.support.getSetAttribute ) {
// propFix is more comprehensive and contains all fixes
jQuery.attrFix = jQuery.propFix;
// Use this for any attribute on a form in IE6/7
formHook = jQuery.attrHooks.name = jQuery.attrHooks.title = jQuery.valHooks.button = {
get: function( elem, name ) {
var ret;
ret = elem.getAttributeNode( name );
// Return undefined if nodeValue is empty string
return ret && ret.nodeValue !== "" ?
ret.nodeValue :
undefined;
},
set: function( elem, value, name ) {
// Check form objects in IE (multiple bugs related)
// Only use nodeValue if the attribute node exists on the form
var ret = elem.getAttributeNode( name );
if ( ret ) {
ret.nodeValue = value;
return value;
}
}
};
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
// This is for removals
jQuery.each([ "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
set: function( elem, value ) {
if ( value === "" ) {
elem.setAttribute( name, "auto" );
return value;
}
}
});
});
}
// Some attributes require a special call on IE
if ( !jQuery.support.hrefNormalized ) {
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
get: function( elem ) {
var ret = elem.getAttribute( name, 2 );
return ret === null ? undefined : ret;
}
});
});
}
if ( !jQuery.support.style ) {
jQuery.attrHooks.style = {
get: function( elem ) {
// Return undefined in the case of empty string
// Normalize to lowercase since IE uppercases css property names
return elem.style.cssText.toLowerCase() || undefined;
},
set: function( elem, value ) {
return (elem.style.cssText = "" + value);
}
};
}
// Safari mis-reports the default selected property of an option
// Accessing the parent's selectedIndex property fixes it
if ( !jQuery.support.optSelected ) {
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
get: function( elem ) {
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
// Make sure that it also works with optgroups, see #5701
if ( parent.parentNode ) {
parent.parentNode.selectedIndex;
}
}
}
});
}
// Radios and checkboxes getter/setter
if ( !jQuery.support.checkOn ) {
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = {
get: function( elem ) {
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
return elem.getAttribute("value") === null ? "on" : elem.value;
}
};
});
}
jQuery.each([ "radio", "checkbox" ], function() {
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
set: function( elem, value ) {
if ( jQuery.isArray( value ) ) {
return (elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0);
}
}
});
});
})( jQuery );

File diff suppressed because it is too large Load diff

372
src/css.js Normal file
View file

@ -0,0 +1,372 @@
(function( jQuery ) {
var ralpha = /alpha\([^)]*\)/i,
ropacity = /opacity=([^)]*)/,
// fixed for IE9, see #8346
rupper = /([A-Z]|^ms)/g,
rnumpx = /^-?\d+(?:px)?$/i,
rnum = /^-?\d/,
rrelNum = /^[+\-]=/,
rrelNumFilter = /[^+\-\.\de]+/g,
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
cssWidth = [ "Left", "Right" ],
cssHeight = [ "Top", "Bottom" ],
curCSS,
getComputedStyle,
currentStyle;
jQuery.fn.css = function( name, value ) {
// Setting 'undefined' is a no-op
if ( arguments.length === 2 && value === undefined ) {
return this;
}
return jQuery.access( this, name, value, true, function( elem, name, value ) {
return value !== undefined ?
jQuery.style( elem, name, value ) :
jQuery.css( elem, name );
});
};
jQuery.extend({
// Add in style property hooks for overriding the default
// behavior of getting and setting a style property
cssHooks: {
opacity: {
get: function( elem, computed ) {
if ( computed ) {
// We should always get a number back from opacity
var ret = curCSS( elem, "opacity", "opacity" );
return ret === "" ? "1" : ret;
} else {
return elem.style.opacity;
}
}
}
},
// Exclude the following css properties to add px
cssNumber: {
"fillOpacity": true,
"fontWeight": true,
"lineHeight": true,
"opacity": true,
"orphans": true,
"widows": true,
"zIndex": true,
"zoom": true
},
// Add in properties whose names you wish to fix before
// setting or getting the value
cssProps: {
// normalize float css property
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
},
// Get and set the style property on a DOM Node
style: function( elem, name, value, extra ) {
// Don't set styles on text and comment nodes
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
return;
}
// Make sure that we're working with the right name
var ret, type, origName = jQuery.camelCase( name ),
style = elem.style, hooks = jQuery.cssHooks[ origName ];
name = jQuery.cssProps[ origName ] || origName;
// Check if we're setting a value
if ( value !== undefined ) {
type = typeof value;
// Make sure that NaN and null values aren't set. See: #7116
if ( type === "number" && isNaN( value ) || value == null ) {
return;
}
// convert relative number strings (+= or -=) to relative numbers. #7345
if ( type === "string" && rrelNum.test( value ) ) {
value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) );
// Fixes bug #9237
type = "number";
}
// If a number was passed in, add 'px' to the (except for certain CSS properties)
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
value += "px";
}
// If a hook was provided, use that value, otherwise just set the specified value
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
// Fixes bug #5509
try {
style[ name ] = value;
} catch(e) {}
}
} else {
// If a hook was provided get the non-computed value from there
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
return ret;
}
// Otherwise just get the value from the style object
return style[ name ];
}
},
css: function( elem, name, extra ) {
var ret, hooks;
// Make sure that we're working with the right name
name = jQuery.camelCase( name );
hooks = jQuery.cssHooks[ name ];
name = jQuery.cssProps[ name ] || name;
// cssFloat needs a special treatment
if ( name === "cssFloat" ) {
name = "float";
}
// If a hook was provided get the computed value from there
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
return ret;
// Otherwise, if a way to get the computed value exists, use that
} else if ( curCSS ) {
return curCSS( elem, name );
}
},
// A method for quickly swapping in/out CSS properties to get correct calculations
swap: function( elem, options, callback ) {
var old = {};
// Remember the old values, and insert the new ones
for ( var name in options ) {
old[ name ] = elem.style[ name ];
elem.style[ name ] = options[ name ];
}
callback.call( elem );
// Revert the old values
for ( name in options ) {
elem.style[ name ] = old[ name ];
}
}
});
// DEPRECATED, Use jQuery.css() instead
jQuery.curCSS = jQuery.css;
jQuery.each(["height", "width"], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
var val;
if ( computed ) {
if ( elem.offsetWidth !== 0 ) {
return getWH( elem, name, extra );
} else {
jQuery.swap( elem, cssShow, function() {
val = getWH( elem, name, extra );
});
}
return val;
}
},
set: function( elem, value ) {
if ( rnumpx.test( value ) ) {
// ignore negative width and height values #1599
value = parseFloat( value );
if ( value >= 0 ) {
return value + "px";
}
} else {
return value;
}
}
};
});
if ( !jQuery.support.opacity ) {
jQuery.cssHooks.opacity = {
get: function( elem, computed ) {
// IE uses filters for opacity
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
( parseFloat( RegExp.$1 ) / 100 ) + "" :
computed ? "1" : "";
},
set: function( elem, value ) {
var style = elem.style,
currentStyle = elem.currentStyle;
// IE has trouble with opacity if it does not have layout
// Force it by setting the zoom level
style.zoom = 1;
// Set the alpha filter to set the opacity
var opacity = jQuery.isNaN( value ) ?
"" :
"alpha(opacity=" + value * 100 + ")",
filter = currentStyle && currentStyle.filter || style.filter || "";
style.filter = ralpha.test( filter ) ?
filter.replace( ralpha, opacity ) :
filter + " " + opacity;
}
};
}
jQuery(function() {
// This hook cannot be added until DOM ready because the support test
// for it is not run until after DOM ready
if ( !jQuery.support.reliableMarginRight ) {
jQuery.cssHooks.marginRight = {
get: function( elem, computed ) {
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
// Work around by temporarily setting element display to inline-block
var ret;
jQuery.swap( elem, { "display": "inline-block" }, function() {
if ( computed ) {
ret = curCSS( elem, "margin-right", "marginRight" );
} else {
ret = elem.style.marginRight;
}
});
return ret;
}
};
}
});
if ( document.defaultView && document.defaultView.getComputedStyle ) {
getComputedStyle = function( elem, name ) {
var ret, defaultView, computedStyle;
name = name.replace( rupper, "-$1" ).toLowerCase();
if ( !(defaultView = elem.ownerDocument.defaultView) ) {
return undefined;
}
if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
ret = computedStyle.getPropertyValue( name );
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
ret = jQuery.style( elem, name );
}
}
return ret;
};
}
if ( document.documentElement.currentStyle ) {
currentStyle = function( elem, name ) {
var left,
ret = elem.currentStyle && elem.currentStyle[ name ],
rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
style = elem.style;
// From the awesome hack by Dean Edwards
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
// If we're not dealing with a regular pixel number
// but a number that has a weird ending, we need to convert it to pixels
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
// Remember the original values
left = style.left;
// Put in the new values to get a computed value out
if ( rsLeft ) {
elem.runtimeStyle.left = elem.currentStyle.left;
}
style.left = name === "fontSize" ? "1em" : (ret || 0);
ret = style.pixelLeft + "px";
// Revert the changed values
style.left = left;
if ( rsLeft ) {
elem.runtimeStyle.left = rsLeft;
}
}
return ret === "" ? "auto" : ret;
};
}
curCSS = getComputedStyle || currentStyle;
function getWH( elem, name, extra ) {
// Start with offset property
var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
which = name === "width" ? cssWidth : cssHeight;
if ( val > 0 ) {
if ( extra !== "border" ) {
jQuery.each( which, function() {
if ( !extra ) {
val -= parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
}
if ( extra === "margin" ) {
val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
} else {
val -= parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
}
});
}
return val + "px";
}
// Fall back to computed then uncomputed css if necessary
val = curCSS( elem, name, name );
if ( val < 0 || val == null ) {
val = elem.style[ name ] || 0;
}
// Normalize "", auto, and prepare for extra
val = parseFloat( val ) || 0;
// Add padding, border, margin
if ( extra ) {
jQuery.each( which, function() {
val += parseFloat( jQuery.css( elem, "padding" + this ) ) || 0;
if ( extra !== "padding" ) {
val += parseFloat( jQuery.css( elem, "border" + this + "Width" ) ) || 0;
}
if ( extra === "margin" ) {
val += parseFloat( jQuery.css( elem, extra + this ) ) || 0;
}
});
}
return val + "px";
}
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.hidden = function( elem ) {
var width = elem.offsetWidth,
height = elem.offsetHeight;
return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
};
jQuery.expr.filters.visible = function( elem ) {
return !jQuery.expr.filters.hidden( elem );
};
}
})( jQuery );

328
src/data.js Normal file
View file

@ -0,0 +1,328 @@
(function( jQuery ) {
var rbrace = /^(?:\{.*\}|\[.*\])$/,
rmultiDash = /([a-z])([A-Z])/g;
jQuery.extend({
cache: {},
// Please use with caution
uuid: 0,
// Unique for each copy of jQuery on the page
// Non-digits removed to match rinlinejQuery
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
// The following elements throw uncatchable exceptions if you
// attempt to add expando properties to them.
noData: {
"embed": true,
// Ban all objects except for Flash (which handle expandos)
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
"applet": true
},
hasData: function( elem ) {
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
return !!elem && !isEmptyDataObject( elem );
},
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
// We have to handle DOM nodes and JS objects differently because IE6-7
// can't GC object references properly across the DOM-JS boundary
isNode = elem.nodeType,
// Only DOM nodes need the global jQuery cache; JS object data is
// attached directly to the object so GC can occur automatically
cache = isNode ? jQuery.cache : elem,
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
// Avoid doing any more work than we need to when trying to get data on an
// object that has no data at all
if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) {
return;
}
if ( !id ) {
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
elem[ jQuery.expando ] = id = ++jQuery.uuid;
} else {
id = jQuery.expando;
}
}
if ( !cache[ id ] ) {
cache[ id ] = {};
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
// metadata on plain JS objects when the object is serialized using
// JSON.stringify
if ( !isNode ) {
cache[ id ].toJSON = jQuery.noop;
}
}
// An object can be passed to jQuery.data instead of a key/value pair; this gets
// shallow copied over onto the existing cache
if ( typeof name === "object" || typeof name === "function" ) {
if ( pvt ) {
cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
} else {
cache[ id ] = jQuery.extend(cache[ id ], name);
}
}
thisCache = cache[ id ];
// Internal jQuery data is stored in a separate object inside the object's data
// cache in order to avoid key collisions between internal data and user-defined
// data
if ( pvt ) {
if ( !thisCache[ internalKey ] ) {
thisCache[ internalKey ] = {};
}
thisCache = thisCache[ internalKey ];
}
if ( data !== undefined ) {
thisCache[ jQuery.camelCase( name ) ] = data;
}
// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
// not attempt to inspect the internal events object using jQuery.data, as this
// internal data object is undocumented and subject to change.
if ( name === "events" && !thisCache[name] ) {
return thisCache[ internalKey ] && thisCache[ internalKey ].events;
}
return getByName ?
// Check for both converted-to-camel and non-converted data property names
thisCache[ jQuery.camelCase( name ) ] || thisCache[ name ] :
thisCache;
},
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
if ( !jQuery.acceptData( elem ) ) {
return;
}
var internalKey = jQuery.expando, isNode = elem.nodeType,
// See jQuery.data for more information
cache = isNode ? jQuery.cache : elem,
// See jQuery.data for more information
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
// If there is already no cache entry for this object, there is no
// purpose in continuing
if ( !cache[ id ] ) {
return;
}
if ( name ) {
var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
if ( thisCache ) {
delete thisCache[ name ];
// If there is no data left in the cache, we want to continue
// and let the cache object itself get destroyed
if ( !isEmptyDataObject(thisCache) ) {
return;
}
}
}
// See jQuery.data for more information
if ( pvt ) {
delete cache[ id ][ internalKey ];
// Don't destroy the parent cache unless the internal data object
// had been the only thing left in it
if ( !isEmptyDataObject(cache[ id ]) ) {
return;
}
}
var internalCache = cache[ id ][ internalKey ];
// Browsers that fail expando deletion also refuse to delete expandos on
// the window, but it will allow it on all other JS objects; other browsers
// don't care
if ( jQuery.support.deleteExpando || cache != window ) {
delete cache[ id ];
} else {
cache[ id ] = null;
}
// We destroyed the entire user cache at once because it's faster than
// iterating through each key, but we need to continue to persist internal
// data if it existed
if ( internalCache ) {
cache[ id ] = {};
// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
// metadata on plain JS objects when the object is serialized using
// JSON.stringify
if ( !isNode ) {
cache[ id ].toJSON = jQuery.noop;
}
cache[ id ][ internalKey ] = internalCache;
// Otherwise, we need to eliminate the expando on the node to avoid
// false lookups in the cache for entries that no longer exist
} else if ( isNode ) {
// IE does not allow us to delete expando properties from nodes,
// nor does it have a removeAttribute function on Document nodes;
// we must handle all of these cases
if ( jQuery.support.deleteExpando ) {
delete elem[ jQuery.expando ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
} else {
elem[ jQuery.expando ] = null;
}
}
},
// For internal use only.
_data: function( elem, name, data ) {
return jQuery.data( elem, name, data, true );
},
// A method for determining if a DOM node can handle the data expando
acceptData: function( elem ) {
if ( elem.nodeName ) {
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
if ( match ) {
return !(match === true || elem.getAttribute("classid") !== match);
}
}
return true;
}
});
jQuery.fn.extend({
data: function( key, value ) {
var data = null;
if ( typeof key === "undefined" ) {
if ( this.length ) {
data = jQuery.data( this[0] );
if ( this[0].nodeType === 1 ) {
var attr = this[0].attributes, name;
for ( var i = 0, l = attr.length; i < l; i++ ) {
name = attr[i].name;
if ( name.indexOf( "data-" ) === 0 ) {
name = jQuery.camelCase( name.substring(5) );
dataAttr( this[0], name, data[ name ] );
}
}
}
}
return data;
} else if ( typeof key === "object" ) {
return this.each(function() {
jQuery.data( this, key );
});
}
var parts = key.split(".");
parts[1] = parts[1] ? "." + parts[1] : "";
if ( value === undefined ) {
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
// Try to fetch any internally stored data first
if ( data === undefined && this.length ) {
data = jQuery.data( this[0], key );
data = dataAttr( this[0], key, data );
}
return data === undefined && parts[1] ?
this.data( parts[0] ) :
data;
} else {
return this.each(function() {
var $this = jQuery( this ),
args = [ parts[0], value ];
$this.triggerHandler( "setData" + parts[1] + "!", args );
jQuery.data( this, key, value );
$this.triggerHandler( "changeData" + parts[1] + "!", args );
});
}
},
removeData: function( key ) {
return this.each(function() {
jQuery.removeData( this, key );
});
}
});
function dataAttr( elem, key, data ) {
// If nothing was found internally, try to fetch any
// data from the HTML5 data-* attribute
if ( data === undefined && elem.nodeType === 1 ) {
var name = "data-" + key.replace( rmultiDash, "$1-$2" ).toLowerCase();
data = elem.getAttribute( name );
if ( typeof data === "string" ) {
try {
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
!jQuery.isNaN( data ) ? parseFloat( data ) :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}
// Make sure we set the data so it isn't changed later
jQuery.data( elem, key, data );
} else {
data = undefined;
}
}
return data;
}
// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
// property to be considered empty objects; this property always exists in
// order to make sure JSON.stringify does not expose internal metadata
function isEmptyDataObject( obj ) {
for ( var name in obj ) {
if ( name !== "toJSON" ) {
return false;
}
}
return true;
}
})( jQuery );

199
src/deferred.js Normal file
View file

@ -0,0 +1,199 @@
(function( jQuery ) {
var // Promise methods
promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
// Static reference to slice
sliceDeferred = [].slice;
jQuery.extend({
// Create a simple deferred (one callbacks list)
_Deferred: function() {
var // callbacks list
callbacks = [],
// stored [ context , args ]
fired,
// to avoid firing when already doing so
firing,
// flag to know if the deferred has been cancelled
cancelled,
// the deferred itself
deferred = {
// done( f1, f2, ...)
done: function() {
if ( !cancelled ) {
var args = arguments,
i,
length,
elem,
type,
_fired;
if ( fired ) {
_fired = fired;
fired = 0;
}
for ( i = 0, length = args.length; i < length; i++ ) {
elem = args[ i ];
type = jQuery.type( elem );
if ( type === "array" ) {
deferred.done.apply( deferred, elem );
} else if ( type === "function" ) {
callbacks.push( elem );
}
}
if ( _fired ) {
deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
}
}
return this;
},
// resolve with given context and args
resolveWith: function( context, args ) {
if ( !cancelled && !fired && !firing ) {
// make sure args are available (#8421)
args = args || [];
firing = 1;
try {
while( callbacks[ 0 ] ) {
callbacks.shift().apply( context, args );
}
}
finally {
fired = [ context, args ];
firing = 0;
}
}
return this;
},
// resolve with this as context and given arguments
resolve: function() {
deferred.resolveWith( this, arguments );
return this;
},
// Has this deferred been resolved?
isResolved: function() {
return !!( firing || fired );
},
// Cancel
cancel: function() {
cancelled = 1;
callbacks = [];
return this;
}
};
return deferred;
},
// Full fledged deferred (two callbacks list)
Deferred: function( func ) {
var deferred = jQuery._Deferred(),
failDeferred = jQuery._Deferred(),
promise;
// Add errorDeferred methods, then and promise
jQuery.extend( deferred, {
then: function( doneCallbacks, failCallbacks ) {
deferred.done( doneCallbacks ).fail( failCallbacks );
return this;
},
always: function() {
return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );
},
fail: failDeferred.done,
rejectWith: failDeferred.resolveWith,
reject: failDeferred.resolve,
isRejected: failDeferred.isResolved,
pipe: function( fnDone, fnFail ) {
return jQuery.Deferred(function( newDefer ) {
jQuery.each( {
done: [ fnDone, "resolve" ],
fail: [ fnFail, "reject" ]
}, function( handler, data ) {
var fn = data[ 0 ],
action = data[ 1 ],
returned;
if ( jQuery.isFunction( fn ) ) {
deferred[ handler ](function() {
returned = fn.apply( this, arguments );
if ( returned && jQuery.isFunction( returned.promise ) ) {
returned.promise().then( newDefer.resolve, newDefer.reject );
} else {
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
}
});
} else {
deferred[ handler ]( newDefer[ action ] );
}
});
}).promise();
},
// Get a promise for this deferred
// If obj is provided, the promise aspect is added to the object
promise: function( obj ) {
if ( obj == null ) {
if ( promise ) {
return promise;
}
promise = obj = {};
}
var i = promiseMethods.length;
while( i-- ) {
obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
}
return obj;
}
});
// Make sure only one callback list will be used
deferred.done( failDeferred.cancel ).fail( deferred.cancel );
// Unexpose cancel
delete deferred.cancel;
// Call given func if any
if ( func ) {
func.call( deferred, deferred );
}
return deferred;
},
// Deferred helper
when: function( firstParam ) {
var args = arguments,
i = 0,
length = args.length,
count = length,
deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
firstParam :
jQuery.Deferred();
function resolveFunc( i ) {
return function( value ) {
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
if ( !( --count ) ) {
// Strange bug in FF4:
// Values changed onto the arguments object sometimes end up as undefined values
// outside the $.when method. Cloning the object into a fresh array solves the issue
deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
}
};
}
if ( length > 1 ) {
for( ; i < length; i++ ) {
if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
args[ i ].promise().then( resolveFunc(i), deferred.reject );
} else {
--count;
}
}
if ( !count ) {
deferred.resolveWith( deferred, args );
}
} else if ( deferred !== firstParam ) {
deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
}
return deferred.promise();
}
});
})( jQuery );

69
src/dimensions.js Normal file
View file

@ -0,0 +1,69 @@
(function( jQuery ) {
// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
jQuery.each([ "Height", "Width" ], function( i, name ) {
var type = name.toLowerCase();
// innerHeight and innerWidth
jQuery.fn[ "inner" + name ] = function() {
var elem = this[0];
return elem && elem.style ?
parseFloat( jQuery.css( elem, type, "padding" ) ) :
null;
};
// outerHeight and outerWidth
jQuery.fn[ "outer" + name ] = function( margin ) {
var elem = this[0];
return elem && elem.style ?
parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
null;
};
jQuery.fn[ type ] = function( size ) {
// Get window width or height
var elem = this[0];
if ( !elem ) {
return size == null ? null : this;
}
if ( jQuery.isFunction( size ) ) {
return this.each(function( i ) {
var self = jQuery( this );
self[ type ]( size.call( this, i, self[ type ]() ) );
});
}
if ( jQuery.isWindow( elem ) ) {
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
var docElemProp = elem.document.documentElement[ "client" + name ];
return elem.document.compatMode === "CSS1Compat" && docElemProp ||
elem.document.body[ "client" + name ] || docElemProp;
// Get document width or height
} else if ( elem.nodeType === 9 ) {
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
return Math.max(
elem.documentElement["client" + name],
elem.body["scroll" + name], elem.documentElement["scroll" + name],
elem.body["offset" + name], elem.documentElement["offset" + name]
);
// Get or set width or height on the element
} else if ( size === undefined ) {
var orig = jQuery.css( elem, type ),
ret = parseFloat( orig );
return jQuery.isNaN( ret ) ? orig : ret;
// Set the width or height on the element (default to pixels if value is unitless)
} else {
return this.css( type, typeof size === "string" ? size : size + "px" );
}
};
});
})( jQuery );

619
src/effects.js vendored Normal file
View file

@ -0,0 +1,619 @@
(function( jQuery ) {
var elemdisplay = {},
iframe, iframeDoc,
rfxtypes = /^(?:toggle|show|hide)$/,
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
timerId,
fxAttrs = [
// height animations
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
// width animations
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
// opacity animations
[ "opacity" ]
],
fxNow,
requestAnimationFrame = window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame;
jQuery.fn.extend({
show: function( speed, easing, callback ) {
var elem, display;
if ( speed || speed === 0 ) {
return this.animate( genFx("show", 3), speed, easing, callback);
} else {
for ( var i = 0, j = this.length; i < j; i++ ) {
elem = this[i];
if ( elem.style ) {
display = elem.style.display;
// Reset the inline display of this element to learn if it is
// being hidden by cascaded rules or not
if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
display = elem.style.display = "";
}
// Set elements which have been overridden with display: none
// in a stylesheet to whatever the default browser style is
// for such an element
if ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
}
}
}
// Set the display of most of the elements in a second loop
// to avoid the constant reflow
for ( i = 0; i < j; i++ ) {
elem = this[i];
if ( elem.style ) {
display = elem.style.display;
if ( display === "" || display === "none" ) {
elem.style.display = jQuery._data(elem, "olddisplay") || "";
}
}
}
return this;
}
},
hide: function( speed, easing, callback ) {
if ( speed || speed === 0 ) {
return this.animate( genFx("hide", 3), speed, easing, callback);
} else {
for ( var i = 0, j = this.length; i < j; i++ ) {
if ( this[i].style ) {
var display = jQuery.css( this[i], "display" );
if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
jQuery._data( this[i], "olddisplay", display );
}
}
}
// Set the display of the elements in a second loop
// to avoid the constant reflow
for ( i = 0; i < j; i++ ) {
if ( this[i].style ) {
this[i].style.display = "none";
}
}
return this;
}
},
// Save the old toggle function
_toggle: jQuery.fn.toggle,
toggle: function( fn, fn2, callback ) {
var bool = typeof fn === "boolean";
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
this._toggle.apply( this, arguments );
} else if ( fn == null || bool ) {
this.each(function() {
var state = bool ? fn : jQuery(this).is(":hidden");
jQuery(this)[ state ? "show" : "hide" ]();
});
} else {
this.animate(genFx("toggle", 3), fn, fn2, callback);
}
return this;
},
fadeTo: function( speed, to, easing, callback ) {
return this.filter(":hidden").css("opacity", 0).show().end()
.animate({opacity: to}, speed, easing, callback);
},
animate: function( prop, speed, easing, callback ) {
var optall = jQuery.speed(speed, easing, callback);
if ( jQuery.isEmptyObject( prop ) ) {
return this.each( optall.complete, [ false ] );
}
// Do not change referenced properties as per-property easing will be lost
prop = jQuery.extend( {}, prop );
return this[ optall.queue === false ? "each" : "queue" ](function() {
// XXX 'this' does not always have a nodeName when running the
// test suite
if ( optall.queue === false ) {
jQuery._mark( this );
}
var opt = jQuery.extend( {}, optall ),
isElement = this.nodeType === 1,
hidden = isElement && jQuery(this).is(":hidden"),
name, val, p,
display, e,
parts, start, end, unit;
// will store per property easing and be used to determine when an animation is complete
opt.animatedProperties = {};
for ( p in prop ) {
// property name normalization
name = jQuery.camelCase( p );
if ( p !== name ) {
prop[ name ] = prop[ p ];
delete prop[ p ];
}
val = prop[ name ];
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
if ( jQuery.isArray( val ) ) {
opt.animatedProperties[ name ] = val[ 1 ];
val = prop[ name ] = val[ 0 ];
} else {
opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
}
if ( val === "hide" && hidden || val === "show" && !hidden ) {
return opt.complete.call( this );
}
if ( isElement && ( name === "height" || name === "width" ) ) {
// Make sure that nothing sneaks out
// Record all 3 overflow attributes because IE does not
// change the overflow attribute when overflowX and
// overflowY are set to the same value
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
// Set display property to inline-block for height/width
// animations on inline elements that are having width/height
// animated
if ( jQuery.css( this, "display" ) === "inline" &&
jQuery.css( this, "float" ) === "none" ) {
if ( !jQuery.support.inlineBlockNeedsLayout ) {
this.style.display = "inline-block";
} else {
display = defaultDisplay( this.nodeName );
// inline-level elements accept inline-block;
// block-level elements need to be inline with layout
if ( display === "inline" ) {
this.style.display = "inline-block";
} else {
this.style.display = "inline";
this.style.zoom = 1;
}
}
}
}
}
if ( opt.overflow != null ) {
this.style.overflow = "hidden";
}
for ( p in prop ) {
e = new jQuery.fx( this, opt, p );
val = prop[ p ];
if ( rfxtypes.test(val) ) {
e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
} else {
parts = rfxnum.exec( val );
start = e.cur();
if ( parts ) {
end = parseFloat( parts[2] );
unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
// We need to compute starting value
if ( unit !== "px" ) {
jQuery.style( this, p, (end || 1) + unit);
start = ((end || 1) / e.cur()) * start;
jQuery.style( this, p, start + unit);
}
// If a +=/-= token was provided, we're doing a relative animation
if ( parts[1] ) {
end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
}
e.custom( start, end, unit );
} else {
e.custom( start, val, "" );
}
}
}
// For JS strict compliance
return true;
});
},
stop: function( clearQueue, gotoEnd ) {
if ( clearQueue ) {
this.queue([]);
}
this.each(function() {
var timers = jQuery.timers,
i = timers.length;
// clear marker counters if we know they won't be
if ( !gotoEnd ) {
jQuery._unmark( true, this );
}
while ( i-- ) {
if ( timers[i].elem === this ) {
if (gotoEnd) {
// force the next step to be the last
timers[i](true);
}
timers.splice(i, 1);
}
}
});
// start the next in the queue if the last step wasn't forced
if ( !gotoEnd ) {
this.dequeue();
}
return this;
}
});
// Animations created synchronously will run synchronously
function createFxNow() {
setTimeout( clearFxNow, 0 );
return ( fxNow = jQuery.now() );
}
function clearFxNow() {
fxNow = undefined;
}
// Generate parameters to create a standard animation
function genFx( type, num ) {
var obj = {};
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
obj[ this ] = type;
});
return obj;
}
// Generate shortcuts for custom animations
jQuery.each({
slideDown: genFx("show", 1),
slideUp: genFx("hide", 1),
slideToggle: genFx("toggle", 1),
fadeIn: { opacity: "show" },
fadeOut: { opacity: "hide" },
fadeToggle: { opacity: "toggle" }
}, function( name, props ) {
jQuery.fn[ name ] = function( speed, easing, callback ) {
return this.animate( props, speed, easing, callback );
};
});
jQuery.extend({
speed: function( speed, easing, fn ) {
var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
};
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
// Queueing
opt.old = opt.complete;
opt.complete = function( noUnmark ) {
if ( jQuery.isFunction( opt.old ) ) {
opt.old.call( this );
}
if ( opt.queue !== false ) {
jQuery.dequeue( this );
} else if ( noUnmark !== false ) {
jQuery._unmark( this );
}
};
return opt;
},
easing: {
linear: function( p, n, firstNum, diff ) {
return firstNum + diff * p;
},
swing: function( p, n, firstNum, diff ) {
return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
}
},
timers: [],
fx: function( elem, options, prop ) {
this.options = options;
this.elem = elem;
this.prop = prop;
options.orig = options.orig || {};
}
});
jQuery.fx.prototype = {
// Simple function for setting a style value
update: function() {
if ( this.options.step ) {
this.options.step.call( this.elem, this.now, this );
}
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
},
// Get the current size
cur: function() {
if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
return this.elem[ this.prop ];
}
var parsed,
r = jQuery.css( this.elem, this.prop );
// Empty strings, null, undefined and "auto" are converted to 0,
// complex values such as "rotate(1rad)" are returned as is,
// simple values such as "10px" are parsed to Float.
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
},
// Start an animation from one number to another
custom: function( from, to, unit ) {
var self = this,
fx = jQuery.fx,
raf;
this.startTime = fxNow || createFxNow();
this.start = from;
this.end = to;
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
this.now = this.start;
this.pos = this.state = 0;
function t( gotoEnd ) {
return self.step(gotoEnd);
}
t.elem = this.elem;
if ( t() && jQuery.timers.push(t) && !timerId ) {
// Use requestAnimationFrame instead of setInterval if available
if ( requestAnimationFrame ) {
timerId = true;
raf = function() {
// When timerId gets set to null at any point, this stops
if ( timerId ) {
requestAnimationFrame( raf );
fx.tick();
}
};
requestAnimationFrame( raf );
} else {
timerId = setInterval( fx.tick, fx.interval );
}
}
},
// Simple 'show' function
show: function() {
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
this.options.show = true;
// Begin the animation
// Make sure that we start at a small width/height to avoid any
// flash of content
this.custom(this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur());
// Start by showing the element
jQuery( this.elem ).show();
},
// Simple 'hide' function
hide: function() {
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.style( this.elem, this.prop );
this.options.hide = true;
// Begin the animation
this.custom(this.cur(), 0);
},
// Each step of an animation
step: function( gotoEnd ) {
var t = fxNow || createFxNow(),
done = true,
elem = this.elem,
options = this.options,
i, n;
if ( gotoEnd || t >= options.duration + this.startTime ) {
this.now = this.end;
this.pos = this.state = 1;
this.update();
options.animatedProperties[ this.prop ] = true;
for ( i in options.animatedProperties ) {
if ( options.animatedProperties[i] !== true ) {
done = false;
}
}
if ( done ) {
// Reset the overflow
if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
jQuery.each( [ "", "X", "Y" ], function (index, value) {
elem.style[ "overflow" + value ] = options.overflow[index];
});
}
// Hide the element if the "hide" operation was done
if ( options.hide ) {
jQuery(elem).hide();
}
// Reset the properties, if the item has been hidden or shown
if ( options.hide || options.show ) {
for ( var p in options.animatedProperties ) {
jQuery.style( elem, p, options.orig[p] );
}
}
// Execute the complete function
options.complete.call( elem );
}
return false;
} else {
// classical easing cannot be used with an Infinity duration
if ( options.duration == Infinity ) {
this.now = t;
} else {
n = t - this.startTime;
this.state = n / options.duration;
// Perform the easing function, defaults to swing
this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration );
this.now = this.start + ((this.end - this.start) * this.pos);
}
// Perform the next step of the animation
this.update();
}
return true;
}
};
jQuery.extend( jQuery.fx, {
tick: function() {
for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
if ( !timers[i]() ) {
timers.splice(i--, 1);
}
}
if ( !timers.length ) {
jQuery.fx.stop();
}
},
interval: 13,
stop: function() {
clearInterval( timerId );
timerId = null;
},
speeds: {
slow: 600,
fast: 200,
// Default speed
_default: 400
},
step: {
opacity: function( fx ) {
jQuery.style( fx.elem, "opacity", fx.now );
},
_default: function( fx ) {
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
} else {
fx.elem[ fx.prop ] = fx.now;
}
}
}
});
if ( jQuery.expr && jQuery.expr.filters ) {
jQuery.expr.filters.animated = function( elem ) {
return jQuery.grep(jQuery.timers, function( fn ) {
return elem === fn.elem;
}).length;
};
}
// Try to restore the default display value of an element
function defaultDisplay( nodeName ) {
if ( !elemdisplay[ nodeName ] ) {
var body = document.body,
elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
display = elem.css( "display" );
elem.remove();
// If the simple way fails,
// get element's real default display by attaching it to a temp iframe
if ( display === "none" || display === "" ) {
// No iframe to use yet, so create it
if ( !iframe ) {
iframe = document.createElement( "iframe" );
iframe.frameBorder = iframe.width = iframe.height = 0;
}
body.appendChild( iframe );
// Create a cacheable copy of the iframe document on first call.
// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
// document to it; WebKit & Firefox won't allow reusing the iframe document.
if ( !iframeDoc || !iframe.createElement ) {
iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
iframeDoc.close();
}
elem = iframeDoc.createElement( nodeName );
iframeDoc.body.appendChild( elem );
display = jQuery.css( elem, "display" );
body.removeChild( iframe );
}
// Store the correct default display
elemdisplay[ nodeName ] = display;
}
return elemdisplay[ nodeName ];
}
})( jQuery );

File diff suppressed because it is too large Load diff

421
src/fx.js
View file

@ -1,421 +0,0 @@
jQuery.fn.extend({
show: function(speed,callback){
return speed ?
this.animate({
height: "show", width: "show", opacity: "show"
}, speed, callback) :
this.filter(":hidden").each(function(){
this.style.display = this.oldblock || "";
if ( jQuery.css(this,"display") == "none" ) {
var elem = jQuery("<" + this.tagName + " />").appendTo("body");
this.style.display = elem.css("display");
// handle an edge condition where css is - div { display:none; } or similar
if (this.style.display == "none")
this.style.display = "block";
elem.remove();
}
}).end();
},
hide: function(speed,callback){
return speed ?
this.animate({
height: "hide", width: "hide", opacity: "hide"
}, speed, callback) :
this.filter(":visible").each(function(){
this.oldblock = this.oldblock || jQuery.css(this,"display");
this.style.display = "none";
}).end();
},
// Save the old toggle function
_toggle: jQuery.fn.toggle,
toggle: function( fn, fn2 ){
return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
this._toggle( fn, fn2 ) :
fn ?
this.animate({
height: "toggle", width: "toggle", opacity: "toggle"
}, fn, fn2) :
this.each(function(){
jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
});
},
slideDown: function(speed,callback){
return this.animate({height: "show"}, speed, callback);
},
slideUp: function(speed,callback){
return this.animate({height: "hide"}, speed, callback);
},
slideToggle: function(speed, callback){
return this.animate({height: "toggle"}, speed, callback);
},
fadeIn: function(speed, callback){
return this.animate({opacity: "show"}, speed, callback);
},
fadeOut: function(speed, callback){
return this.animate({opacity: "hide"}, speed, callback);
},
fadeTo: function(speed,to,callback){
return this.animate({opacity: to}, speed, callback);
},
animate: function( prop, speed, easing, callback ) {
var optall = jQuery.speed(speed, easing, callback);
return this[ optall.queue === false ? "each" : "queue" ](function(){
if ( this.nodeType != 1)
return false;
var opt = jQuery.extend({}, optall);
var hidden = jQuery(this).is(":hidden"), self = this;
for ( var p in prop ) {
if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
return jQuery.isFunction(opt.complete) && opt.complete.apply(this);
if ( p == "height" || p == "width" ) {
// Store display property
opt.display = jQuery.css(this, "display");
// Make sure that nothing sneaks out
opt.overflow = this.style.overflow;
}
}
if ( opt.overflow != null )
this.style.overflow = "hidden";
opt.curAnim = jQuery.extend({}, prop);
jQuery.each( prop, function(name, val){
var e = new jQuery.fx( self, opt, name );
if ( /toggle|show|hide/.test(val) )
e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
else {
var parts = val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),
start = e.cur(true) || 0;
if ( parts ) {
var end = parseFloat(parts[2]),
unit = parts[3] || "px";
// We need to compute starting value
if ( unit != "px" ) {
self.style[ name ] = (end || 1) + unit;
start = ((end || 1) / e.cur(true)) * start;
self.style[ name ] = start + unit;
}
// If a +=/-= token was provided, we're doing a relative animation
if ( parts[1] )
end = ((parts[1] == "-=" ? -1 : 1) * end) + start;
e.custom( start, end, unit );
} else
e.custom( start, val, "" );
}
});
// For JS strict compliance
return true;
});
},
queue: function(type, fn){
if ( jQuery.isFunction(type) || ( type && type.constructor == Array )) {
fn = type;
type = "fx";
}
if ( !type || (typeof type == "string" && !fn) )
return queue( this[0], type );
return this.each(function(){
if ( fn.constructor == Array )
queue(this, type, fn);
else {
queue(this, type).push( fn );
if ( queue(this, type).length == 1 )
fn.apply(this);
}
});
},
stop: function(clearQueue, gotoEnd){
var timers = jQuery.timers;
if (clearQueue)
this.queue([]);
this.each(function(){
// go in reverse order so anything added to the queue during the loop is ignored
for ( var i = timers.length - 1; i >= 0; i-- )
if ( timers[i].elem == this ) {
if (gotoEnd)
// force the next step to be the last
timers[i](true);
timers.splice(i, 1);
}
});
// start the next in the queue if the last step wasn't forced
if (!gotoEnd)
this.dequeue();
return this;
}
});
var queue = function( elem, type, array ) {
if ( !elem )
return undefined;
type = type || "fx";
var q = jQuery.data( elem, type + "queue" );
if ( !q || array )
q = jQuery.data( elem, type + "queue",
array ? jQuery.makeArray(array) : [] );
return q;
};
jQuery.fn.dequeue = function(type){
type = type || "fx";
return this.each(function(){
var q = queue(this, type);
q.shift();
if ( q.length )
q[0].apply( this );
});
};
jQuery.extend({
speed: function(speed, easing, fn) {
var opt = speed && speed.constructor == Object ? speed : {
complete: fn || !fn && easing ||
jQuery.isFunction( speed ) && speed,
duration: speed,
easing: fn && easing || easing && easing.constructor != Function && easing
};
opt.duration = (opt.duration && opt.duration.constructor == Number ?
opt.duration :
{ slow: 600, fast: 200 }[opt.duration]) || 400;
// Queueing
opt.old = opt.complete;
opt.complete = function(){
if ( opt.queue !== false )
jQuery(this).dequeue();
if ( jQuery.isFunction( opt.old ) )
opt.old.apply( this );
};
return opt;
},
easing: {
linear: function( p, n, firstNum, diff ) {
return firstNum + diff * p;
},
swing: function( p, n, firstNum, diff ) {
return ((-Math.cos(p*Math.PI)/2) + 0.5) * diff + firstNum;
}
},
timers: [],
timerId: null,
fx: function( elem, options, prop ){
this.options = options;
this.elem = elem;
this.prop = prop;
if ( !options.orig )
options.orig = {};
}
});
jQuery.fx.prototype = {
// Simple function for setting a style value
update: function(){
if ( this.options.step )
this.options.step.apply( this.elem, [ this.now, this ] );
(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
// Set display property to block for height/width animations
if ( this.prop == "height" || this.prop == "width" )
this.elem.style.display = "block";
},
// Get the current size
cur: function(force){
if ( this.elem[this.prop] != null && this.elem.style[this.prop] == null )
return this.elem[ this.prop ];
var r = parseFloat(jQuery.css(this.elem, this.prop, force));
return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
},
// Start an animation from one number to another
custom: function(from, to, unit){
this.startTime = (new Date()).getTime();
this.start = from;
this.end = to;
this.unit = unit || this.unit || "px";
this.now = this.start;
this.pos = this.state = 0;
this.update();
var self = this;
function t(gotoEnd){
return self.step(gotoEnd);
}
t.elem = this.elem;
jQuery.timers.push(t);
if ( jQuery.timerId == null ) {
jQuery.timerId = setInterval(function(){
var timers = jQuery.timers;
for ( var i = 0; i < timers.length; i++ )
if ( !timers[i]() )
timers.splice(i--, 1);
if ( !timers.length ) {
clearInterval( jQuery.timerId );
jQuery.timerId = null;
}
}, 13);
}
},
// Simple 'show' function
show: function(){
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
this.options.show = true;
// Begin the animation
this.custom(0, this.cur());
// Make sure that we start at a small width/height to avoid any
// flash of content
if ( this.prop == "width" || this.prop == "height" )
this.elem.style[this.prop] = "1px";
// Start by showing the element
jQuery(this.elem).show();
},
// Simple 'hide' function
hide: function(){
// Remember where we started, so that we can go back to it later
this.options.orig[this.prop] = jQuery.attr( this.elem.style, this.prop );
this.options.hide = true;
// Begin the animation
this.custom(this.cur(), 0);
},
// Each step of an animation
step: function(gotoEnd){
var t = (new Date()).getTime();
if ( gotoEnd || t > this.options.duration + this.startTime ) {
this.now = this.end;
this.pos = this.state = 1;
this.update();
this.options.curAnim[ this.prop ] = true;
var done = true;
for ( var i in this.options.curAnim )
if ( this.options.curAnim[i] !== true )
done = false;
if ( done ) {
if ( this.options.display != null ) {
// Reset the overflow
this.elem.style.overflow = this.options.overflow;
// Reset the display
this.elem.style.display = this.options.display;
if ( jQuery.css(this.elem, "display") == "none" )
this.elem.style.display = "block";
}
// Hide the element if the "hide" operation was done
if ( this.options.hide )
this.elem.style.display = "none";
// Reset the properties, if the item has been hidden or shown
if ( this.options.hide || this.options.show )
for ( var p in this.options.curAnim )
jQuery.attr(this.elem.style, p, this.options.orig[p]);
}
// If a callback was provided, execute it
if ( done && jQuery.isFunction( this.options.complete ) )
// Execute the complete function
this.options.complete.apply( this.elem );
return false;
} else {
var n = t - this.startTime;
this.state = n / this.options.duration;
// Perform the easing function, defaults to swing
this.pos = jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")](this.state, n, 0, 1, this.options.duration);
this.now = this.start + ((this.end - this.start) * this.pos);
// Perform the next step of the animation
this.update();
}
return true;
}
};
jQuery.fx.step = {
scrollLeft: function(fx){
fx.elem.scrollLeft = fx.now;
},
scrollTop: function(fx){
fx.elem.scrollTop = fx.now;
},
opacity: function(fx){
jQuery.attr(fx.elem.style, "opacity", fx.now);
},
_default: function(fx){
fx.elem.style[ fx.prop ] = fx.now + fx.unit;
}
};

View file

@ -1 +1,21 @@
(function(){
/*!
* jQuery JavaScript Library v@VERSION
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: @DATE
*/
(function( window, undefined ) {
// Use the correct document accordingly with window argument (sandbox)
var document = window.document,
navigator = window.navigator,
location = window.location;

765
src/manipulation.js Normal file
View file

@ -0,0 +1,765 @@
(function( jQuery ) {
var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
rleadingWhitespace = /^\s+/,
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
rtagName = /<([\w:]+)/,
rtbody = /<tbody/i,
rhtml = /<|&#?\w+;/,
rnocache = /<(?:script|object|embed|option|style)/i,
// checked="checked" or checked
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
rscriptType = /\/(java|ecma)script/i,
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
wrapMap = {
option: [ 1, "<select multiple='multiple'>", "</select>" ],
legend: [ 1, "<fieldset>", "</fieldset>" ],
thead: [ 1, "<table>", "</table>" ],
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
area: [ 1, "<map>", "</map>" ],
_default: [ 0, "", "" ]
};
wrapMap.optgroup = wrapMap.option;
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
wrapMap.th = wrapMap.td;
// IE can't serialize <link> and <script> tags normally
if ( !jQuery.support.htmlSerialize ) {
wrapMap._default = [ 1, "div<div>", "</div>" ];
}
jQuery.fn.extend({
text: function( text ) {
if ( jQuery.isFunction(text) ) {
return this.each(function(i) {
var self = jQuery( this );
self.text( text.call(this, i, self.text()) );
});
}
if ( typeof text !== "object" && text !== undefined ) {
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
}
return jQuery.text( this );
},
wrapAll: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapAll( html.call(this, i) );
});
}
if ( this[0] ) {
// The elements to wrap the target around
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
if ( this[0].parentNode ) {
wrap.insertBefore( this[0] );
}
wrap.map(function() {
var elem = this;
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
elem = elem.firstChild;
}
return elem;
}).append( this );
}
return this;
},
wrapInner: function( html ) {
if ( jQuery.isFunction( html ) ) {
return this.each(function(i) {
jQuery(this).wrapInner( html.call(this, i) );
});
}
return this.each(function() {
var self = jQuery( this ),
contents = self.contents();
if ( contents.length ) {
contents.wrapAll( html );
} else {
self.append( html );
}
});
},
wrap: function( html ) {
return this.each(function() {
jQuery( this ).wrapAll( html );
});
},
unwrap: function() {
return this.parent().each(function() {
if ( !jQuery.nodeName( this, "body" ) ) {
jQuery( this ).replaceWith( this.childNodes );
}
}).end();
},
append: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.appendChild( elem );
}
});
},
prepend: function() {
return this.domManip(arguments, true, function( elem ) {
if ( this.nodeType === 1 ) {
this.insertBefore( elem, this.firstChild );
}
});
},
before: function() {
if ( this[0] && this[0].parentNode ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this );
});
} else if ( arguments.length ) {
var set = jQuery(arguments[0]);
set.push.apply( set, this.toArray() );
return this.pushStack( set, "before", arguments );
}
},
after: function() {
if ( this[0] && this[0].parentNode ) {
return this.domManip(arguments, false, function( elem ) {
this.parentNode.insertBefore( elem, this.nextSibling );
});
} else if ( arguments.length ) {
var set = this.pushStack( this, "after", arguments );
set.push.apply( set, jQuery(arguments[0]).toArray() );
return set;
}
},
// keepData is for internal use only--do not document
remove: function( selector, keepData ) {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
if ( !keepData && elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
jQuery.cleanData( [ elem ] );
}
if ( elem.parentNode ) {
elem.parentNode.removeChild( elem );
}
}
}
return this;
},
empty: function() {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
// Remove element nodes and prevent memory leaks
if ( elem.nodeType === 1 ) {
jQuery.cleanData( elem.getElementsByTagName("*") );
}
// Remove any remaining nodes
while ( elem.firstChild ) {
elem.removeChild( elem.firstChild );
}
}
return this;
},
clone: function( dataAndEvents, deepDataAndEvents ) {
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
return this.map( function () {
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
});
},
html: function( value ) {
if ( value === undefined ) {
return this[0] && this[0].nodeType === 1 ?
this[0].innerHTML.replace(rinlinejQuery, "") :
null;
// See if we can take a shortcut and just use innerHTML
} else if ( typeof value === "string" && !rnocache.test( value ) &&
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
value = value.replace(rxhtmlTag, "<$1></$2>");
try {
for ( var i = 0, l = this.length; i < l; i++ ) {
// Remove element nodes and prevent memory leaks
if ( this[i].nodeType === 1 ) {
jQuery.cleanData( this[i].getElementsByTagName("*") );
this[i].innerHTML = value;
}
}
// If using innerHTML throws an exception, use the fallback method
} catch(e) {
this.empty().append( value );
}
} else if ( jQuery.isFunction( value ) ) {
this.each(function(i){
var self = jQuery( this );
self.html( value.call(this, i, self.html()) );
});
} else {
this.empty().append( value );
}
return this;
},
replaceWith: function( value ) {
if ( this[0] && this[0].parentNode ) {
// Make sure that the elements are removed from the DOM before they are inserted
// this can help fix replacing a parent with child elements
if ( jQuery.isFunction( value ) ) {
return this.each(function(i) {
var self = jQuery(this), old = self.html();
self.replaceWith( value.call( this, i, old ) );
});
}
if ( typeof value !== "string" ) {
value = jQuery( value ).detach();
}
return this.each(function() {
var next = this.nextSibling,
parent = this.parentNode;
jQuery( this ).remove();
if ( next ) {
jQuery(next).before( value );
} else {
jQuery(parent).append( value );
}
});
} else {
return this.length ?
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
this;
}
},
detach: function( selector ) {
return this.remove( selector, true );
},
domManip: function( args, table, callback ) {
var results, first, fragment, parent,
value = args[0],
scripts = [];
// We can't cloneNode fragments that contain checked, in WebKit
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
return this.each(function() {
jQuery(this).domManip( args, table, callback, true );
});
}
if ( jQuery.isFunction(value) ) {
return this.each(function(i) {
var self = jQuery(this);
args[0] = value.call(this, i, table ? self.html() : undefined);
self.domManip( args, table, callback );
});
}
if ( this[0] ) {
parent = value && value.parentNode;
// If we're in a fragment, just use that instead of building a new one
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
results = { fragment: parent };
} else {
results = jQuery.buildFragment( args, this, scripts );
}
fragment = results.fragment;
if ( fragment.childNodes.length === 1 ) {
first = fragment = fragment.firstChild;
} else {
first = fragment.firstChild;
}
if ( first ) {
table = table && jQuery.nodeName( first, "tr" );
for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
callback.call(
table ?
root(this[i], first) :
this[i],
// Make sure that we do not leak memory by inadvertently discarding
// the original fragment (which might have attached data) instead of
// using it; in addition, use the original fragment object for the last
// item instead of first because it can end up being emptied incorrectly
// in certain situations (Bug #8070).
// Fragments from the fragment cache must always be cloned and never used
// in place.
results.cacheable || (l > 1 && i < lastIndex) ?
jQuery.clone( fragment, true, true ) :
fragment
);
}
}
if ( scripts.length ) {
jQuery.each( scripts, evalScript );
}
}
return this;
}
});
function root( elem, cur ) {
return jQuery.nodeName(elem, "table") ?
(elem.getElementsByTagName("tbody")[0] ||
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
elem;
}
function cloneCopyEvent( src, dest ) {
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
return;
}
var internalKey = jQuery.expando,
oldData = jQuery.data( src ),
curData = jQuery.data( dest, oldData );
// Switch to use the internal data object, if it exists, for the next
// stage of data copying
if ( (oldData = oldData[ internalKey ]) ) {
var events = oldData.events;
curData = curData[ internalKey ] = jQuery.extend({}, oldData);
if ( events ) {
delete curData.handle;
curData.events = {};
for ( var type in events ) {
for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
}
}
}
}
}
function cloneFixAttributes( src, dest ) {
var nodeName;
// We do not need to do anything for non-Elements
if ( dest.nodeType !== 1 ) {
return;
}
// clearAttributes removes the attributes, which we don't want,
// but also removes the attachEvent events, which we *do* want
if ( dest.clearAttributes ) {
dest.clearAttributes();
}
// mergeAttributes, in contrast, only merges back on the
// original attributes, not the events
if ( dest.mergeAttributes ) {
dest.mergeAttributes( src );
}
nodeName = dest.nodeName.toLowerCase();
// IE6-8 fail to clone children inside object elements that use
// the proprietary classid attribute value (rather than the type
// attribute) to identify the type of content to display
if ( nodeName === "object" ) {
dest.outerHTML = src.outerHTML;
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
// IE6-8 fails to persist the checked state of a cloned checkbox
// or radio button. Worse, IE6-7 fail to give the cloned element
// a checked appearance if the defaultChecked value isn't also set
if ( src.checked ) {
dest.defaultChecked = dest.checked = src.checked;
}
// IE6-7 get confused and end up setting the value of a cloned
// checkbox/radio button to an empty string instead of "on"
if ( dest.value !== src.value ) {
dest.value = src.value;
}
// IE6-8 fails to return the selected option to the default selected
// state when cloning options
} else if ( nodeName === "option" ) {
dest.selected = src.defaultSelected;
// IE6-8 fails to set the defaultValue to the correct value when
// cloning other types of input fields
} else if ( nodeName === "input" || nodeName === "textarea" ) {
dest.defaultValue = src.defaultValue;
}
// Event data gets referenced instead of copied if the expando
// gets copied too
dest.removeAttribute( jQuery.expando );
}
jQuery.buildFragment = function( args, nodes, scripts ) {
var fragment, cacheable, cacheresults, doc;
// nodes may contain either an explicit document object,
// a jQuery collection or context object.
// If nodes[0] contains a valid object to assign to doc
if ( nodes && nodes[0] ) {
doc = nodes[0].ownerDocument || nodes[0];
}
// Ensure that an attr object doesn't incorrectly stand in as a document object
// Chrome and Firefox seem to allow this to occur and will throw exception
// Fixes #8950
if ( !doc.createDocumentFragment ) {
doc = document;
}
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
// Cloning options loses the selected state, so don't cache them
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
cacheable = true;
cacheresults = jQuery.fragments[ args[0] ];
if ( cacheresults && cacheresults !== 1 ) {
fragment = cacheresults;
}
}
if ( !fragment ) {
fragment = doc.createDocumentFragment();
jQuery.clean( args, doc, fragment, scripts );
}
if ( cacheable ) {
jQuery.fragments[ args[0] ] = cacheresults ? fragment : 1;
}
return { fragment: fragment, cacheable: cacheable };
};
jQuery.fragments = {};
jQuery.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function( name, original ) {
jQuery.fn[ name ] = function( selector ) {
var ret = [],
insert = jQuery( selector ),
parent = this.length === 1 && this[0].parentNode;
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
insert[ original ]( this[0] );
return this;
} else {
for ( var i = 0, l = insert.length; i < l; i++ ) {
var elems = (i > 0 ? this.clone(true) : this).get();
jQuery( insert[i] )[ original ]( elems );
ret = ret.concat( elems );
}
return this.pushStack( ret, name, insert.selector );
}
};
});
function getAll( elem ) {
if ( "getElementsByTagName" in elem ) {
return elem.getElementsByTagName( "*" );
} else if ( "querySelectorAll" in elem ) {
return elem.querySelectorAll( "*" );
} else {
return [];
}
}
// Used in clean, fixes the defaultChecked property
function fixDefaultChecked( elem ) {
if ( elem.type === "checkbox" || elem.type === "radio" ) {
elem.defaultChecked = elem.checked;
}
}
// Finds all inputs and passes them to fixDefaultChecked
function findInputs( elem ) {
if ( jQuery.nodeName( elem, "input" ) ) {
fixDefaultChecked( elem );
} else if ( "getElementsByTagName" in elem ) {
jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
}
}
jQuery.extend({
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
var clone = elem.cloneNode(true),
srcElements,
destElements,
i;
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
// IE copies events bound via attachEvent when using cloneNode.
// Calling detachEvent on the clone will also remove the events
// from the original. In order to get around this, we use some
// proprietary methods to clear the events. Thanks to MooTools
// guys for this hotness.
cloneFixAttributes( elem, clone );
// Using Sizzle here is crazy slow, so we use getElementsByTagName
// instead
srcElements = getAll( elem );
destElements = getAll( clone );
// Weird iteration because IE will replace the length property
// with an element if you are cloning the body and one of the
// elements on the page has a name or id of "length"
for ( i = 0; srcElements[i]; ++i ) {
cloneFixAttributes( srcElements[i], destElements[i] );
}
}
// Copy the events from the original to the clone
if ( dataAndEvents ) {
cloneCopyEvent( elem, clone );
if ( deepDataAndEvents ) {
srcElements = getAll( elem );
destElements = getAll( clone );
for ( i = 0; srcElements[i]; ++i ) {
cloneCopyEvent( srcElements[i], destElements[i] );
}
}
}
srcElements = destElements = null;
// Return the cloned set
return clone;
},
clean: function( elems, context, fragment, scripts ) {
var checkScriptType;
context = context || document;
// !context.createElement fails in IE with an error but returns typeof 'object'
if ( typeof context.createElement === "undefined" ) {
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
}
var ret = [], j;
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( typeof elem === "number" ) {
elem += "";
}
if ( !elem ) {
continue;
}
// Convert html string into DOM nodes
if ( typeof elem === "string" ) {
if ( !rhtml.test( elem ) ) {
elem = context.createTextNode( elem );
} else {
// Fix "XHTML"-style tags in all browsers
elem = elem.replace(rxhtmlTag, "<$1></$2>");
// Trim whitespace, otherwise indexOf won't work as expected
var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
wrap = wrapMap[ tag ] || wrapMap._default,
depth = wrap[0],
div = context.createElement("div");
// Go to html and back, then peel off extra wrappers
div.innerHTML = wrap[1] + elem + wrap[2];
// Move to the right depth
while ( depth-- ) {
div = div.lastChild;
}
// Remove IE's autoinserted <tbody> from table fragments
if ( !jQuery.support.tbody ) {
// String was a <table>, *may* have spurious <tbody>
var hasBody = rtbody.test(elem),
tbody = tag === "table" && !hasBody ?
div.firstChild && div.firstChild.childNodes :
// String was a bare <thead> or <tfoot>
wrap[1] === "<table>" && !hasBody ?
div.childNodes :
[];
for ( j = tbody.length - 1; j >= 0 ; --j ) {
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
tbody[ j ].parentNode.removeChild( tbody[ j ] );
}
}
}
// IE completely kills leading whitespace when innerHTML is used
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
}
elem = div.childNodes;
}
}
// Resets defaultChecked for any radios and checkboxes
// about to be appended to the DOM in IE 6/7 (#8060)
var len;
if ( !jQuery.support.appendChecked ) {
if ( elem[0] && typeof (len = elem.length) === "number" ) {
for ( j = 0; j < len; j++ ) {
findInputs( elem[j] );
}
} else {
findInputs( elem );
}
}
if ( elem.nodeType ) {
ret.push( elem );
} else {
ret = jQuery.merge( ret, elem );
}
}
if ( fragment ) {
checkScriptType = function( elem ) {
return !elem.type || rscriptType.test( elem.type );
};
for ( i = 0; ret[i]; i++ ) {
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
} else {
if ( ret[i].nodeType === 1 ) {
var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
}
fragment.appendChild( ret[i] );
}
}
}
return ret;
},
cleanData: function( elems ) {
var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
deleteExpando = jQuery.support.deleteExpando;
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
continue;
}
id = elem[ jQuery.expando ];
if ( id ) {
data = cache[ id ] && cache[ id ][ internalKey ];
if ( data && data.events ) {
for ( var type in data.events ) {
if ( special[ type ] ) {
jQuery.event.remove( elem, type );
// This is a shortcut to avoid jQuery.event.remove's overhead
} else {
jQuery.removeEvent( elem, type, data.handle );
}
}
// Null the DOM reference to avoid IE6/7/8 leak (#7054)
if ( data.handle ) {
data.handle.elem = null;
}
}
if ( deleteExpando ) {
delete elem[ jQuery.expando ];
} else if ( elem.removeAttribute ) {
elem.removeAttribute( jQuery.expando );
}
delete cache[ id ];
}
}
}
});
function evalScript( i, elem ) {
if ( elem.src ) {
jQuery.ajax({
url: elem.src,
async: false,
dataType: "script"
});
} else {
jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
}
if ( elem.parentNode ) {
elem.parentNode.removeChild( elem );
}
}
})( jQuery );

View file

@ -1,98 +1,308 @@
// The Offset Method
// Originally By Brandon Aaron, part of the Dimension Plugin
// http://jquery.com/plugins/project/dimensions
jQuery.fn.offset = function() {
var left = 0, top = 0, elem = this[0], results;
(function( jQuery ) {
if ( elem ) with ( jQuery.browser ) {
var parent = elem.parentNode,
offsetChild = elem,
offsetParent = elem.offsetParent,
doc = elem.ownerDocument,
safari2 = safari && parseInt(version) < 522,
fixed = jQuery.css(elem, "position") == "fixed";
var rtable = /^t(?:able|d|h)$/i,
rroot = /^(?:body|html)$/i;
// Use getBoundingClientRect if available
if ( elem.getBoundingClientRect ) {
var box = elem.getBoundingClientRect();
if ( "getBoundingClientRect" in document.documentElement ) {
jQuery.fn.offset = function( options ) {
var elem = this[0], box;
// Add the document scroll offsets
add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
box.top + Math.max(doc.documentElement.scrollTop, doc.body.scrollTop));
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
// IE adds the HTML element's border, by default it is medium which is 2px
// IE 6 and 7 quirks mode the border width is overwritable by the following css html { border: 0; }
// IE 7 standards mode, the border is always 2px
// This border/offset is typically represented by the clientLeft and clientTop properties
// However, in IE6 and 7 quirks mode the clientLeft and clientTop properties are not updated when overwriting it via CSS
// Therefore this method will be off by 2px in IE while in quirksmode
add( -doc.documentElement.clientLeft, -doc.documentElement.clientTop );
if ( !elem || !elem.ownerDocument ) {
return null;
}
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
try {
box = elem.getBoundingClientRect();
} catch(e) {}
var doc = elem.ownerDocument,
docElem = doc.documentElement;
// Make sure we're not dealing with a disconnected DOM node
if ( !box || !jQuery.contains( docElem, elem ) ) {
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
}
var body = doc.body,
win = getWindow(doc),
clientTop = docElem.clientTop || body.clientTop || 0,
clientLeft = docElem.clientLeft || body.clientLeft || 0,
scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
top = box.top + scrollTop - clientTop,
left = box.left + scrollLeft - clientLeft;
return { top: top, left: left };
};
// Otherwise loop through the offsetParents and parentNodes
} else {
jQuery.fn.offset = function( options ) {
var elem = this[0];
// Initial element offsets
add( elem.offsetLeft, elem.offsetTop );
if ( options ) {
return this.each(function( i ) {
jQuery.offset.setOffset( this, options, i );
});
}
// Get parent offsets
while ( offsetParent ) {
// Add offsetParent offsets
add( offsetParent.offsetLeft, offsetParent.offsetTop );
if ( !elem || !elem.ownerDocument ) {
return null;
}
// Mozilla and Safari > 2 does not include the border on offset parents
// However Mozilla adds the border for table or table cells
if ( mozilla && !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari && !safari2 )
border( offsetParent );
if ( elem === elem.ownerDocument.body ) {
return jQuery.offset.bodyOffset( elem );
}
// Add the document scroll offsets if position is fixed on any offsetParent
if ( !fixed && jQuery.css(offsetParent, "position") == "fixed" )
fixed = true;
jQuery.offset.initialize();
// Set offsetChild to previous offsetParent unless it is the body element
offsetChild = /^body$/i.test(offsetParent.tagName) ? offsetChild : offsetParent;
// Get next offsetParent
var computedStyle,
offsetParent = elem.offsetParent,
prevOffsetParent = elem,
doc = elem.ownerDocument,
docElem = doc.documentElement,
body = doc.body,
defaultView = doc.defaultView,
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
top = elem.offsetTop,
left = elem.offsetLeft;
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
break;
}
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
top -= elem.scrollTop;
left -= elem.scrollLeft;
if ( elem === offsetParent ) {
top += elem.offsetTop;
left += elem.offsetLeft;
if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
prevOffsetParent = offsetParent;
offsetParent = elem.offsetParent;
}
if ( jQuery.offset.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
top += parseFloat( computedStyle.borderTopWidth ) || 0;
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
}
prevComputedStyle = computedStyle;
}
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
top += body.offsetTop;
left += body.offsetLeft;
}
if ( jQuery.offset.supportsFixedPosition && prevComputedStyle.position === "fixed" ) {
top += Math.max( docElem.scrollTop, body.scrollTop );
left += Math.max( docElem.scrollLeft, body.scrollLeft );
}
return { top: top, left: left };
};
}
jQuery.offset = {
initialize: function() {
var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
jQuery.extend( container.style, { position: "absolute", top: 0, left: 0, margin: 0, border: 0, width: "1px", height: "1px", visibility: "hidden" } );
container.innerHTML = html;
body.insertBefore( container, body.firstChild );
innerDiv = container.firstChild;
checkDiv = innerDiv.firstChild;
td = innerDiv.nextSibling.firstChild.firstChild;
this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
checkDiv.style.position = "fixed";
checkDiv.style.top = "20px";
// safari subtracts parent border width here which is 5px
this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
checkDiv.style.position = checkDiv.style.top = "";
innerDiv.style.overflow = "hidden";
innerDiv.style.position = "relative";
this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
this.doesNotIncludeMarginInBodyOffset = (body.offsetTop !== bodyMarginTop);
body.removeChild( container );
jQuery.offset.initialize = jQuery.noop;
},
bodyOffset: function( body ) {
var top = body.offsetTop,
left = body.offsetLeft;
jQuery.offset.initialize();
if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
}
return { top: top, left: left };
},
setOffset: function( elem, options, i ) {
var position = jQuery.css( elem, "position" );
// set position first, in-case top/left are set even on static elem
if ( position === "static" ) {
elem.style.position = "relative";
}
var curElem = jQuery( elem ),
curOffset = curElem.offset(),
curCSSTop = jQuery.css( elem, "top" ),
curCSSLeft = jQuery.css( elem, "left" ),
calculatePosition = (position === "absolute" || position === "fixed") && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
props = {}, curPosition = {}, curTop, curLeft;
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
if ( calculatePosition ) {
curPosition = curElem.position();
curTop = curPosition.top;
curLeft = curPosition.left;
} else {
curTop = parseFloat( curCSSTop ) || 0;
curLeft = parseFloat( curCSSLeft ) || 0;
}
if ( jQuery.isFunction( options ) ) {
options = options.call( elem, i, curOffset );
}
if (options.top != null) {
props.top = (options.top - curOffset.top) + curTop;
}
if (options.left != null) {
props.left = (options.left - curOffset.left) + curLeft;
}
if ( "using" in options ) {
options.using.call( elem, props );
} else {
curElem.css( props );
}
}
};
jQuery.fn.extend({
position: function() {
if ( !this[0] ) {
return null;
}
var elem = this[0],
// Get *real* offsetParent
offsetParent = this.offsetParent(),
// Get correct offsets
offset = this.offset(),
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
// Subtract element margins
// note: when an element has margin: auto the offsetLeft and marginLeft
// are the same in Safari causing offset.left to incorrectly be 0
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
// Add offsetParent borders
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
// Subtract the two offsets
return {
top: offset.top - parentOffset.top,
left: offset.left - parentOffset.left
};
},
offsetParent: function() {
return this.map(function() {
var offsetParent = this.offsetParent || document.body;
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
offsetParent = offsetParent.offsetParent;
}
return offsetParent;
});
}
});
// Get parent scroll offsets
while ( parent && parent.tagName && !/^body|html$/i.test(parent.tagName) ) {
// Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug
if ( !/^inline|table.*$/i.test(jQuery.css(parent, "display")) )
// Subtract parent scroll offsets
add( -parent.scrollLeft, -parent.scrollTop );
// Mozilla does not add the border for a parent that has overflow != visible
if ( mozilla && jQuery.css(parent, "overflow") != "visible" )
border( parent );
// Create scrollLeft and scrollTop methods
jQuery.each( ["Left", "Top"], function( i, name ) {
var method = "scroll" + name;
// Get next parent
parent = parent.parentNode;
jQuery.fn[ method ] = function( val ) {
var elem, win;
if ( val === undefined ) {
elem = this[ 0 ];
if ( !elem ) {
return null;
}
// Safari <= 2 doubles body offsets with a fixed position element/offsetParent or absolutely positioned offsetChild
// Mozilla doubles body offsets with a non-absolutely positioned offsetChild
if ( (safari2 && (fixed || jQuery.css(offsetChild, "position") == "absolute")) ||
(mozilla && jQuery.css(offsetChild, "position") != "absolute") )
add( -doc.body.offsetLeft, -doc.body.offsetTop );
win = getWindow( elem );
// Add the document scroll offsets if position is fixed
if ( fixed )
add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
Math.max(doc.documentElement.scrollTop, doc.body.scrollTop));
// Return the scroll offset
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
jQuery.support.boxModel && win.document.documentElement[ method ] ||
win.document.body[ method ] :
elem[ method ];
}
// Return an object with top and left properties
results = { top: top, left: left };
}
// Set the scroll offset
return this.each(function() {
win = getWindow( this );
function border(elem) {
add( jQuery.curCSS(elem, "borderLeftWidth", true), jQuery.curCSS(elem, "borderTopWidth", true) );
}
if ( win ) {
win.scrollTo(
!i ? val : jQuery( win ).scrollLeft(),
i ? val : jQuery( win ).scrollTop()
);
function add(l, t) {
left += parseInt(l) || 0;
top += parseInt(t) || 0;
} else {
this[ method ] = val;
}
return results;
});
};
});
function getWindow( elem ) {
return jQuery.isWindow( elem ) ?
elem :
elem.nodeType === 9 ?
elem.defaultView || elem.parentWindow :
false;
}
})( jQuery );

View file

@ -1 +1,3 @@
})();
// Expose jQuery to the global object
window.jQuery = window.$ = jQuery;
})(window);

172
src/queue.js Normal file
View file

@ -0,0 +1,172 @@
(function( jQuery ) {
function handleQueueMarkDefer( elem, type, src ) {
var deferDataKey = type + "defer",
queueDataKey = type + "queue",
markDataKey = type + "mark",
defer = jQuery.data( elem, deferDataKey, undefined, true );
if ( defer &&
( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
// Give room for hard-coded callbacks to fire first
// and eventually mark/queue something else on the element
setTimeout( function() {
if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
!jQuery.data( elem, markDataKey, undefined, true ) ) {
jQuery.removeData( elem, deferDataKey, true );
defer.resolve();
}
}, 0 );
}
}
jQuery.extend({
_mark: function( elem, type ) {
if ( elem ) {
type = (type || "fx") + "mark";
jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
}
},
_unmark: function( force, elem, type ) {
if ( force !== true ) {
type = elem;
elem = force;
force = false;
}
if ( elem ) {
type = type || "fx";
var key = type + "mark",
count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
if ( count ) {
jQuery.data( elem, key, count, true );
} else {
jQuery.removeData( elem, key, true );
handleQueueMarkDefer( elem, type, "mark" );
}
}
},
queue: function( elem, type, data ) {
if ( elem ) {
type = (type || "fx") + "queue";
var q = jQuery.data( elem, type, undefined, true );
// Speed up dequeue by getting out quickly if this is just a lookup
if ( data ) {
if ( !q || jQuery.isArray(data) ) {
q = jQuery.data( elem, type, jQuery.makeArray(data), true );
} else {
q.push( data );
}
}
return q || [];
}
},
dequeue: function( elem, type ) {
type = type || "fx";
var queue = jQuery.queue( elem, type ),
fn = queue.shift(),
defer;
// If the fx queue is dequeued, always remove the progress sentinel
if ( fn === "inprogress" ) {
fn = queue.shift();
}
if ( fn ) {
// Add a progress sentinel to prevent the fx queue from being
// automatically dequeued
if ( type === "fx" ) {
queue.unshift("inprogress");
}
fn.call(elem, function() {
jQuery.dequeue(elem, type);
});
}
if ( !queue.length ) {
jQuery.removeData( elem, type + "queue", true );
handleQueueMarkDefer( elem, type, "queue" );
}
}
});
jQuery.fn.extend({
queue: function( type, data ) {
if ( typeof type !== "string" ) {
data = type;
type = "fx";
}
if ( data === undefined ) {
return jQuery.queue( this[0], type );
}
return this.each(function() {
var queue = jQuery.queue( this, type, data );
if ( type === "fx" && queue[0] !== "inprogress" ) {
jQuery.dequeue( this, type );
}
});
},
dequeue: function( type ) {
return this.each(function() {
jQuery.dequeue( this, type );
});
},
// Based off of the plugin by Clint Helfers, with permission.
// http://blindsignals.com/index.php/2009/07/jquery-delay/
delay: function( time, type ) {
time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
type = type || "fx";
return this.queue( type, function() {
var elem = this;
setTimeout(function() {
jQuery.dequeue( elem, type );
}, time );
});
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
},
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, object ) {
if ( typeof type !== "string" ) {
object = type;
type = undefined;
}
type = type || "fx";
var defer = jQuery.Deferred(),
elements = this,
i = elements.length,
count = 1,
deferDataKey = type + "defer",
queueDataKey = type + "queue",
markDataKey = type + "mark",
tmp;
function resolve() {
if ( !( --count ) ) {
defer.resolveWith( elements, [ elements ] );
}
}
while( i-- ) {
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
count++;
tmp.done( resolve );
}
}
resolve();
return defer.promise();
}
});
})( jQuery );

View file

@ -1,445 +0,0 @@
var chars = jQuery.browser.safari && parseInt(jQuery.browser.version) < 417 ?
"(?:[\\w*_-]|\\\\.)" :
"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",
quickChild = new RegExp("^>\\s*(" + chars + "+)"),
quickID = new RegExp("^(" + chars + "+)(#)(" + chars + "+)"),
quickClass = new RegExp("^([#.]?)(" + chars + "*)");
jQuery.extend({
expr: {
"": function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);},
"#": function(a,i,m){return a.getAttribute("id")==m[2];},
":": {
// Position Checks
lt: function(a,i,m){return i<m[3]-0;},
gt: function(a,i,m){return i>m[3]-0;},
nth: function(a,i,m){return m[3]-0==i;},
eq: function(a,i,m){return m[3]-0==i;},
first: function(a,i){return i==0;},
last: function(a,i,m,r){return i==r.length-1;},
even: function(a,i){return i%2==0;},
odd: function(a,i){return i%2;},
// Child Checks
"first-child": function(a){return a.parentNode.getElementsByTagName("*")[0]==a;},
"last-child": function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;},
"only-child": function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling");},
// Parent Checks
parent: function(a){return a.firstChild;},
empty: function(a){return !a.firstChild;},
// Text Check
contains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;},
// Visibility
visible: function(a){return "hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";},
hidden: function(a){return "hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";},
// Form attributes
enabled: function(a){return !a.disabled;},
disabled: function(a){return a.disabled;},
checked: function(a){return a.checked;},
selected: function(a){return a.selected||jQuery.attr(a,"selected");},
// Form elements
text: function(a){return "text"==a.type;},
radio: function(a){return "radio"==a.type;},
checkbox: function(a){return "checkbox"==a.type;},
file: function(a){return "file"==a.type;},
password: function(a){return "password"==a.type;},
submit: function(a){return "submit"==a.type;},
image: function(a){return "image"==a.type;},
reset: function(a){return "reset"==a.type;},
button: function(a){return "button"==a.type||jQuery.nodeName(a,"button");},
input: function(a){return /input|select|textarea|button/i.test(a.nodeName);},
// :has()
has: function(a,i,m){return jQuery.find(m[3],a).length;},
// :header
header: function(a){return /h\d/i.test(a.nodeName);},
// :animated
animated: function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}
}
},
// The regular expressions that power the parsing engine
parse: [
// Match: [@value='test'], [@foo]
/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,
// Match: :contains('foo')
/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,
// Match: :even, :last-chlid, #id, .class
new RegExp("^([:.#]*)(" + chars + "+)")
],
multiFilter: function( expr, elems, not ) {
var old, cur = [];
while ( expr && expr != old ) {
old = expr;
var f = jQuery.filter( expr, elems, not );
expr = f.t.replace(/^\s*,\s*/, "" );
cur = not ? elems = f.r : jQuery.merge( cur, f.r );
}
return cur;
},
find: function( t, context ) {
// Quickly handle non-string expressions
if ( typeof t != "string" )
return [ t ];
// check to make sure context is a DOM element or a document
if ( context && context.nodeType != 1 && context.nodeType != 9)
return [ ];
// Set the correct context (if none is provided)
context = context || document;
// Initialize the search
var ret = [context], done = [], last, nodeName;
// Continue while a selector expression exists, and while
// we're no longer looping upon ourselves
while ( t && last != t ) {
var r = [];
last = t;
t = jQuery.trim(t);
var foundToken = false;
// An attempt at speeding up child selectors that
// point to a specific element tag
var re = quickChild;
var m = re.exec(t);
if ( m ) {
nodeName = m[1].toUpperCase();
// Perform our own iteration and filter
for ( var i = 0; ret[i]; i++ )
for ( var c = ret[i].firstChild; c; c = c.nextSibling )
if ( c.nodeType == 1 && (nodeName == "*" || c.nodeName.toUpperCase() == nodeName) )
r.push( c );
ret = r;
t = t.replace( re, "" );
if ( t.indexOf(" ") == 0 ) continue;
foundToken = true;
} else {
re = /^([>+~])\s*(\w*)/i;
if ( (m = re.exec(t)) != null ) {
r = [];
var merge = {};
nodeName = m[2].toUpperCase();
m = m[1];
for ( var j = 0, rl = ret.length; j < rl; j++ ) {
var n = m == "~" || m == "+" ? ret[j].nextSibling : ret[j].firstChild;
for ( ; n; n = n.nextSibling )
if ( n.nodeType == 1 ) {
var id = jQuery.data(n);
if ( m == "~" && merge[id] ) break;
if (!nodeName || n.nodeName.toUpperCase() == nodeName ) {
if ( m == "~" ) merge[id] = true;
r.push( n );
}
if ( m == "+" ) break;
}
}
ret = r;
// And remove the token
t = jQuery.trim( t.replace( re, "" ) );
foundToken = true;
}
}
// See if there's still an expression, and that we haven't already
// matched a token
if ( t && !foundToken ) {
// Handle multiple expressions
if ( !t.indexOf(",") ) {
// Clean the result set
if ( context == ret[0] ) ret.shift();
// Merge the result sets
done = jQuery.merge( done, ret );
// Reset the context
r = ret = [context];
// Touch up the selector string
t = " " + t.substr(1,t.length);
} else {
// Optimize for the case nodeName#idName
var re2 = quickID;
var m = re2.exec(t);
// Re-organize the results, so that they're consistent
if ( m ) {
m = [ 0, m[2], m[3], m[1] ];
} else {
// Otherwise, do a traditional filter check for
// ID, class, and element selectors
re2 = quickClass;
m = re2.exec(t);
}
m[2] = m[2].replace(/\\/g, "");
var elem = ret[ret.length-1];
// Try to do a global search by ID, where we can
if ( m[1] == "#" && elem && elem.getElementById && !jQuery.isXMLDoc(elem) ) {
// Optimization for HTML document case
var oid = elem.getElementById(m[2]);
// Do a quick check for the existence of the actual ID attribute
// to avoid selecting by the name attribute in IE
// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
if ( (jQuery.browser.msie||jQuery.browser.opera) && oid && typeof oid.id == "string" && oid.id != m[2] )
oid = jQuery('[@id="'+m[2]+'"]', elem)[0];
// Do a quick check for node name (where applicable) so
// that div#foo searches will be really fast
ret = r = oid && (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
} else {
// We need to find all descendant elements
for ( var i = 0; ret[i]; i++ ) {
// Grab the tag name being searched for
var tag = m[1] == "#" && m[3] ? m[3] : m[1] != "" || m[0] == "" ? "*" : m[2];
// Handle IE7 being really dumb about <object>s
if ( tag == "*" && ret[i].nodeName.toLowerCase() == "object" )
tag = "param";
r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
}
// It's faster to filter by class and be done with it
if ( m[1] == "." )
r = jQuery.classFilter( r, m[2] );
// Same with ID filtering
if ( m[1] == "#" ) {
var tmp = [];
// Try to find the element with the ID
for ( var i = 0; r[i]; i++ )
if ( r[i].getAttribute("id") == m[2] ) {
tmp = [ r[i] ];
break;
}
r = tmp;
}
ret = r;
}
t = t.replace( re2, "" );
}
}
// If a selector string still exists
if ( t ) {
// Attempt to filter it
var val = jQuery.filter(t,r);
ret = r = val.r;
t = jQuery.trim(val.t);
}
}
// An error occurred with the selector;
// just return an empty set instead
if ( t )
ret = [];
// Remove the root context
if ( ret && context == ret[0] )
ret.shift();
// And combine the results
done = jQuery.merge( done, ret );
return done;
},
classFilter: function(r,m,not){
m = " " + m + " ";
var tmp = [];
for ( var i = 0; r[i]; i++ ) {
var pass = (" " + r[i].className + " ").indexOf( m ) >= 0;
if ( !not && pass || not && !pass )
tmp.push( r[i] );
}
return tmp;
},
filter: function(t,r,not) {
var last;
// Look for common filter expressions
while ( t && t != last ) {
last = t;
var p = jQuery.parse, m;
for ( var i = 0; p[i]; i++ ) {
m = p[i].exec( t );
if ( m ) {
// Remove what we just matched
t = t.substring( m[0].length );
m[2] = m[2].replace(/\\/g, "");
break;
}
}
if ( !m )
break;
// :not() is a special case that can be optimized by
// keeping it out of the expression list
if ( m[1] == ":" && m[2] == "not" )
// optimize if only one selector found (most common case)
r = isSimple.test( m[3] ) ?
jQuery.filter(m[3], r, true).r :
jQuery( r ).not( m[3] );
// We can get a big speed boost by filtering by class here
else if ( m[1] == "." )
r = jQuery.classFilter(r, m[2], not);
else if ( m[1] == "[" ) {
var tmp = [], type = m[3];
for ( var i = 0, rl = r.length; i < rl; i++ ) {
var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
if ( z == null || /href|src|selected/.test(m[2]) )
z = jQuery.attr(a,m[2]) || '';
if ( (type == "" && !!z ||
type == "=" && z == m[5] ||
type == "!=" && z != m[5] ||
type == "^=" && z && !z.indexOf(m[5]) ||
type == "$=" && z.substr(z.length - m[5].length) == m[5] ||
(type == "*=" || type == "~=") && z.indexOf(m[5]) >= 0) ^ not )
tmp.push( a );
}
r = tmp;
// We can get a speed boost by handling nth-child here
} else if ( m[1] == ":" && m[2] == "nth-child" ) {
var merge = {}, tmp = [],
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
m[3] == "even" && "2n" || m[3] == "odd" && "2n+1" ||
!/\D/.test(m[3]) && "0n+" + m[3] || m[3]),
// calculate the numbers (first)n+(last) including if they are negative
first = (test[1] + (test[2] || 1)) - 0, last = test[3] - 0;
// loop through all the elements left in the jQuery object
for ( var i = 0, rl = r.length; i < rl; i++ ) {
var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
if ( !merge[id] ) {
var c = 1;
for ( var n = parentNode.firstChild; n; n = n.nextSibling )
if ( n.nodeType == 1 )
n.nodeIndex = c++;
merge[id] = true;
}
var add = false;
if ( first == 0 ) {
if ( node.nodeIndex == last )
add = true;
} else if ( (node.nodeIndex - last) % first == 0 && (node.nodeIndex - last) / first >= 0 )
add = true;
if ( add ^ not )
tmp.push( node );
}
r = tmp;
// Otherwise, find the expression to execute
} else {
var fn = jQuery.expr[ m[1] ];
if ( typeof fn == "object" )
fn = fn[ m[2] ];
if ( typeof fn == "string" )
fn = eval("false||function(a,i){return " + fn + ";}");
// Execute it against the current filter
r = jQuery.grep( r, function(elem, i){
return fn(elem, i, m, r);
}, not );
}
}
// Return an array of filtered elements (r)
// and the modified expression string (t)
return { r: r, t: t };
},
dir: function( elem, dir ){
var matched = [];
var cur = elem[dir];
while ( cur && cur != document ) {
if ( cur.nodeType == 1 )
matched.push( cur );
cur = cur[dir];
}
return matched;
},
nth: function(cur,result,dir,elem){
result = result || 1;
var num = 0;
for ( ; cur; cur = cur[dir] )
if ( cur.nodeType == 1 && ++num == result )
break;
return cur;
},
sibling: function( n, elem ) {
var r = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType == 1 && (!elem || n != elem) )
r.push( n );
}
return r;
}
});

1
src/sizzle Submodule

@ -0,0 +1 @@
Subproject commit 3ba396e439a07c2a2facafbe07cdaa1b80a24c00

7
src/sizzle-jquery.js Normal file
View file

@ -0,0 +1,7 @@
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;

256
src/support.js Normal file
View file

@ -0,0 +1,256 @@
(function( jQuery ) {
jQuery.support = (function() {
var div = document.createElement( "div" ),
documentElement = document.documentElement,
all,
a,
select,
opt,
input,
marginDiv,
support,
fragment,
body,
testElementParent,
testElement,
testElementStyle,
tds,
events,
eventName,
i,
isSupported;
// Preliminary tests
div.setAttribute("className", "t");
div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
all = div.getElementsByTagName( "*" );
a = div.getElementsByTagName( "a" )[ 0 ];
// Can't get basic test support
if ( !all || !all.length || !a ) {
return {};
}
// First batch of supports tests
select = document.createElement( "select" );
opt = select.appendChild( document.createElement("option") );
input = div.getElementsByTagName( "input" )[ 0 ];
support = {
// IE strips leading whitespace when .innerHTML is used
leadingWhitespace: ( div.firstChild.nodeType === 3 ),
// Make sure that tbody elements aren't automatically inserted
// IE will insert them into empty tables
tbody: !div.getElementsByTagName( "tbody" ).length,
// Make sure that link elements get serialized correctly by innerHTML
// This requires a wrapper element in IE
htmlSerialize: !!div.getElementsByTagName( "link" ).length,
// Get the style information from getAttribute
// (IE uses .cssText instead)
style: /top/.test( a.getAttribute("style") ),
// Make sure that URLs aren't manipulated
// (IE normalizes it by default)
hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
// Make sure that element opacity exists
// (IE uses filter instead)
// Use a regex to work around a WebKit issue. See #5145
opacity: /^0.55$/.test( a.style.opacity ),
// Verify style float existence
// (IE uses styleFloat instead of cssFloat)
cssFloat: !!a.style.cssFloat,
// Make sure that if no value is specified for a checkbox
// that it defaults to "on".
// (WebKit defaults to "" instead)
checkOn: ( input.value === "on" ),
// Make sure that a selected-by-default option has a working selected property.
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
optSelected: opt.selected,
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
getSetAttribute: div.className !== "t",
// Will be defined later
submitBubbles: true,
changeBubbles: true,
focusinBubbles: false,
deleteExpando: true,
noCloneEvent: true,
inlineBlockNeedsLayout: false,
shrinkWrapBlocks: false,
reliableMarginRight: true
};
// Make sure checked status is properly cloned
input.checked = true;
support.noCloneChecked = input.cloneNode( true ).checked;
// Make sure that the options inside disabled selects aren't marked as disabled
// (WebKit marks them as disabled)
select.disabled = true;
support.optDisabled = !opt.disabled;
// Test to see if it's possible to delete an expando from an element
// Fails in Internet Explorer
try {
delete div.test;
} catch( e ) {
support.deleteExpando = false;
}
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
div.attachEvent( "onclick", function() {
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
support.noCloneEvent = false;
});
div.cloneNode( true ).fireEvent( "onclick" );
}
// Check if a radio maintains it's value
// after being appended to the DOM
input = document.createElement("input");
input.value = "t";
input.setAttribute("type", "radio");
support.radioValue = input.value === "t";
input.setAttribute("checked", "checked");
div.appendChild( input );
fragment = document.createDocumentFragment();
fragment.appendChild( div.firstChild );
// WebKit doesn't clone checked state correctly in fragments
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
div.innerHTML = "";
// Figure out if the W3C box model works as expected
div.style.width = div.style.paddingLeft = "1px";
body = document.getElementsByTagName( "body" )[ 0 ];
// We use our own, invisible, body unless the body is already present
// in which case we use a div (#9239)
testElement = document.createElement( body ? "div" : "body" );
testElementStyle = {
visibility: "hidden",
width: 0,
height: 0,
border: 0,
margin: 0
};
if ( body ) {
jQuery.extend( testElementStyle, {
position: "absolute",
left: -1000,
top: -1000
});
}
for ( i in testElementStyle ) {
testElement.style[ i ] = testElementStyle[ i ];
}
testElement.appendChild( div );
testElementParent = body || documentElement;
testElementParent.insertBefore( testElement, testElementParent.firstChild );
// Check if a disconnected checkbox will retain its checked
// value of true after appended to the DOM (IE6/7)
support.appendChecked = input.checked;
support.boxModel = div.offsetWidth === 2;
if ( "zoom" in div.style ) {
// Check if natively block-level elements act like inline-block
// elements when setting their display to 'inline' and giving
// them layout
// (IE < 8 does this)
div.style.display = "inline";
div.style.zoom = 1;
support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
// Check if elements with layout shrink-wrap their children
// (IE 6 does this)
div.style.display = "";
div.innerHTML = "<div style='width:4px;'></div>";
support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
}
div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
tds = div.getElementsByTagName( "td" );
// Check if table cells still have offsetWidth/Height when they are set
// to display:none and there are still other visible table cells in a
// table row; if so, offsetWidth/Height are not reliable for use when
// determining if an element has been hidden directly using
// display:none (it is still safe to use offsets if a parent element is
// hidden; don safety goggles and see bug #4512 for more information).
// (only IE 8 fails this test)
isSupported = ( tds[ 0 ].offsetHeight === 0 );
tds[ 0 ].style.display = "";
tds[ 1 ].style.display = "none";
// Check if empty table cells still have offsetWidth/Height
// (IE < 8 fail this test)
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
div.innerHTML = "";
// Check if div with explicit width and no margin-right incorrectly
// gets computed margin-right based on width of container. For more
// info see bug #3333
// Fails in WebKit before Feb 2011 nightlies
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
if ( document.defaultView && document.defaultView.getComputedStyle ) {
marginDiv = document.createElement( "div" );
marginDiv.style.width = "0";
marginDiv.style.marginRight = "0";
div.appendChild( marginDiv );
support.reliableMarginRight =
( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
}
// Remove the body element we added
testElement.innerHTML = "";
testElementParent.removeChild( testElement );
// Technique from Juriy Zaytsev
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
// We only care about the case where non-standard event systems
// are used, namely in IE. Short-circuiting here helps us to
// avoid an eval call (in setAttribute) which can cause CSP
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
if ( div.attachEvent ) {
for( i in {
submit: 1,
change: 1,
focusin: 1
} ) {
eventName = "on" + i;
isSupported = ( eventName in div );
if ( !isSupported ) {
div.setAttribute( eventName, "return;" );
isSupported = ( typeof div[ eventName ] === "function" );
}
support[ i + "Bubbles" ] = isSupported;
}
}
// Null connected elements to avoid leaks in IE
testElement = fragment = select = opt = body = marginDiv = div = input = null;
return support;
})();
// Keep track of boxModel
jQuery.boxModel = jQuery.support.boxModel;
})( jQuery );

334
src/traversing.js Normal file
View file

@ -0,0 +1,334 @@
(function( jQuery ) {
var runtil = /Until$/,
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
// Note: This RegExp should be improved, or likely pulled from Sizzle
rmultiselector = /,/,
isSimple = /^.[^:#\[\.,]*$/,
slice = Array.prototype.slice,
POS = jQuery.expr.match.POS,
// methods guaranteed to produce a unique set when starting from a unique set
guaranteedUnique = {
children: true,
contents: true,
next: true,
prev: true
};
jQuery.fn.extend({
find: function( selector ) {
var self = this,
i, l;
if ( typeof selector !== "string" ) {
return jQuery( selector ).filter(function() {
for ( i = 0, l = self.length; i < l; i++ ) {
if ( jQuery.contains( self[ i ], this ) ) {
return true;
}
}
});
}
var ret = this.pushStack( "", "find", selector ),
length, n, r;
for ( i = 0, l = this.length; i < l; i++ ) {
length = ret.length;
jQuery.find( selector, this[i], ret );
if ( i > 0 ) {
// Make sure that the results are unique
for ( n = length; n < ret.length; n++ ) {
for ( r = 0; r < length; r++ ) {
if ( ret[r] === ret[n] ) {
ret.splice(n--, 1);
break;
}
}
}
}
}
return ret;
},
has: function( target ) {
var targets = jQuery( target );
return this.filter(function() {
for ( var i = 0, l = targets.length; i < l; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}
}
});
},
not: function( selector ) {
return this.pushStack( winnow(this, selector, false), "not", selector);
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector, true), "filter", selector );
},
is: function( selector ) {
return !!selector && ( typeof selector === "string" ?
jQuery.filter( selector, this ).length > 0 :
this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
var ret = [], i, l, cur = this[0];
// Array
if ( jQuery.isArray( selectors ) ) {
var match, selector,
matches = {},
level = 1;
if ( cur && selectors.length ) {
for ( i = 0, l = selectors.length; i < l; i++ ) {
selector = selectors[i];
if ( !matches[ selector ] ) {
matches[ selector ] = POS.test( selector ) ?
jQuery( selector, context || this.context ) :
selector;
}
}
while ( cur && cur.ownerDocument && cur !== context ) {
for ( selector in matches ) {
match = matches[ selector ];
if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
ret.push({ selector: selector, elem: cur, level: level });
}
}
cur = cur.parentNode;
level++;
}
}
return ret;
}
// String
var pos = POS.test( selectors ) || typeof selectors !== "string" ?
jQuery( selectors, context || this.context ) :
0;
for ( i = 0, l = this.length; i < l; i++ ) {
cur = this[i];
while ( cur ) {
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
ret.push( cur );
break;
} else {
cur = cur.parentNode;
if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
break;
}
}
}
}
ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
return this.pushStack( ret, "closest", selectors );
},
// Determine the position of an element within
// the matched set of elements
index: function( elem ) {
if ( !elem || typeof elem === "string" ) {
return jQuery.inArray( this[0],
// If it receives a string, the selector is used
// If it receives nothing, the siblings are used
elem ? jQuery( elem ) : this.parent().children() );
}
// Locate the position of the desired element
return jQuery.inArray(
// If it receives a jQuery object, the first element is used
elem.jquery ? elem[0] : elem, this );
},
add: function( selector, context ) {
var set = typeof selector === "string" ?
jQuery( selector, context ) :
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
all = jQuery.merge( this.get(), set );
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
all :
jQuery.unique( all ) );
},
andSelf: function() {
return this.add( this.prevObject );
}
});
// A painfully simple check to see if an element is disconnected
// from a document (should be improved, where feasible).
function isDisconnected( node ) {
return !node || !node.parentNode || node.parentNode.nodeType === 11;
}
jQuery.each({
parent: function( elem ) {
var parent = elem.parentNode;
return parent && parent.nodeType !== 11 ? parent : null;
},
parents: function( elem ) {
return jQuery.dir( elem, "parentNode" );
},
parentsUntil: function( elem, i, until ) {
return jQuery.dir( elem, "parentNode", until );
},
next: function( elem ) {
return jQuery.nth( elem, 2, "nextSibling" );
},
prev: function( elem ) {
return jQuery.nth( elem, 2, "previousSibling" );
},
nextAll: function( elem ) {
return jQuery.dir( elem, "nextSibling" );
},
prevAll: function( elem ) {
return jQuery.dir( elem, "previousSibling" );
},
nextUntil: function( elem, i, until ) {
return jQuery.dir( elem, "nextSibling", until );
},
prevUntil: function( elem, i, until ) {
return jQuery.dir( elem, "previousSibling", until );
},
siblings: function( elem ) {
return jQuery.sibling( elem.parentNode.firstChild, elem );
},
children: function( elem ) {
return jQuery.sibling( elem.firstChild );
},
contents: function( elem ) {
return jQuery.nodeName( elem, "iframe" ) ?
elem.contentDocument || elem.contentWindow.document :
jQuery.makeArray( elem.childNodes );
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var ret = jQuery.map( this, fn, until ),
// The variable 'args' was introduced in
// https://github.com/jquery/jquery/commit/52a0238
// to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
// http://code.google.com/p/v8/issues/detail?id=1050
args = slice.call(arguments);
if ( !runtil.test( name ) ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
ret = jQuery.filter( selector, ret );
}
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
ret = ret.reverse();
}
return this.pushStack( ret, name, args.join(",") );
};
});
jQuery.extend({
filter: function( expr, elems, not ) {
if ( not ) {
expr = ":not(" + expr + ")";
}
return elems.length === 1 ?
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
jQuery.find.matches(expr, elems);
},
dir: function( elem, dir, until ) {
var matched = [],
cur = elem[ dir ];
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
if ( cur.nodeType === 1 ) {
matched.push( cur );
}
cur = cur[dir];
}
return matched;
},
nth: function( cur, result, dir, elem ) {
result = result || 1;
var num = 0;
for ( ; cur; cur = cur[dir] ) {
if ( cur.nodeType === 1 && ++num === result ) {
break;
}
}
return cur;
},
sibling: function( n, elem ) {
var r = [];
for ( ; n; n = n.nextSibling ) {
if ( n.nodeType === 1 && n !== elem ) {
r.push( n );
}
}
return r;
}
});
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
// Can't pass null or undefined to indexOf in Firefox 4
// Set to 0 to skip string check
qualifier = qualifier || 0;
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem, i ) {
return (elem === qualifier) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem, i ) {
return (jQuery.inArray( elem, qualifier ) >= 0) === keep;
});
}
})( jQuery );

31
test/csp.php Normal file
View file

@ -0,0 +1,31 @@
<?php header("X-Content-Security-Policy-Report-Only: allow *"); ?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSP Test Page</title>
<script src="../src/core.js"></script>
<script src="../src/deferred.js"></script>
<script src="../src/support.js"></script>
<script src="../src/data.js"></script>
<script src="../src/queue.js"></script>
<script src="../src/attributes.js"></script>
<script src="../src/event.js"></script>
<script src="../src/sizzle/sizzle.js"></script>
<script src="../src/sizzle-jquery.js"></script>
<script src="../src/traversing.js"></script>
<script src="../src/manipulation.js"></script>
<script src="../src/css.js"></script>
<script src="../src/ajax.js"></script>
<script src="../src/ajax/jsonp.js"></script>
<script src="../src/ajax/script.js"></script>
<script src="../src/ajax/xhr.js"></script>
<script src="../src/effects.js"></script>
<script src="../src/offset.js"></script>
<script src="../src/dimensions.js"></script>
</head>
<body>
<p>CSP Test Page</p>
</body>
</html>

4
test/data/atom+xml.php Normal file
View file

@ -0,0 +1,4 @@
<?php header("Content-type: atom+xml") ?>
<root>
<element />
</root>

1
test/data/badjson.js Normal file
View file

@ -0,0 +1 @@
{bad: 1}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<dashboard>
<locations class="foo">
<location for="bar">
<location for="bar" checked="different">
<infowindowtab>
<tab title="Location"><![CDATA[blabla]]></tab>
<tab title="Users"><![CDATA[blublu]]></tab>

1
test/data/echoData.php Normal file
View file

@ -0,0 +1 @@
<?php echo file_get_contents('php://input'); ?>

1
test/data/echoQuery.php Normal file
View file

@ -0,0 +1 @@
<?php echo $_SERVER['QUERY_STRING']; ?>

View file

@ -0,0 +1,5 @@
<?php
header("HTTP/1.0 400 Bad Request");
echo "plain text message";

21
test/data/etag.php Normal file
View file

@ -0,0 +1,21 @@
<?php
error_reporting(0);
$ts = $_REQUEST['ts'];
$etag = md5($ts);
$ifNoneMatch = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : false;
if ($ifNoneMatch == $etag) {
header('HTTP/1.0 304 Not Modified');
die; // stop processing
}
header("Etag: " . $etag);
if ( $ifNoneMatch ) {
echo "OK: " . $etag;
} else {
echo "FAIL";
}
?>

18
test/data/headers.php Normal file
View file

@ -0,0 +1,18 @@
<?php
header( "Sample-Header: Hello World" );
header( "Empty-Header: " );
header( "Sample-Header2: Hello World 2" );
$headers = array();
foreach( $_SERVER as $key => $value ) {
$key = str_replace( "_" , "-" , substr( $key , 0 , 5 ) == "HTTP_" ? substr( $key , 5 ) : $key );
$headers[ $key ] = $value;
}
foreach( explode( "_" , $_GET[ "keys" ] ) as $key ) {
echo "$key: " . @$headers[ strtoupper( $key ) ] . "\n";
}

View file

@ -0,0 +1,20 @@
<?php
error_reporting(0);
$ts = $_REQUEST['ts'];
$ifModifiedSince = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) : false;
if ($ifModifiedSince == $ts) {
header('HTTP/1.0 304 Not Modified');
die; // stop processing
}
header("Last-Modified: " . $ts);
if ( $ifModifiedSince ) {
echo "OK: " . $ts;
} else {
echo "FAIL";
}
?>

View file

@ -1,5 +1,9 @@
<?php
error_reporting(0);
if ( $_REQUEST['header'] ) {
header("Content-type: application/json");
}
$json = $_REQUEST['json'];
if($json) {
echo '[ {"name": "John", "age": 21}, {"name": "Peter", "age": 25 } ]';

View file

@ -1 +0,0 @@
json_assigned_obj = { "test" : "worked" };

View file

@ -1,6 +1,10 @@
<?php
error_reporting(0);
$callback = $_REQUEST['callback'];
if ( ! $callback ) {
$callback = explode("?",end(explode("/",$_SERVER['REQUEST_URI'])));
$callback = $callback[0];
}
$json = $_REQUEST['json'];
if($json) {
echo $callback . '([ {"name": "John", "age": 21}, {"name": "Peter", "age": 25 } ])';

View file

@ -19,11 +19,6 @@ if($name == 'foo') {
echo "pan";
die();
}
$request = apache_request_headers();
$request = $request['X-Custom-Header'];
if(strlen($request) > 0) {
echo $request;
die();
}
echo 'ERROR <script type="text/javascript">ok( true, "name.php executed" );</script>';
?>

View file

@ -12,12 +12,26 @@
#absolute-1-1-1 { top: 1px; left: 1px; }
#absolute-2 { top: 19px; left: 19px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
p.instructions { position: absolute; bottom: 0; }
#positionTest { position: absolute; }
</style>
<script src="../../../src/core.js"></script>
<script src="../../../src/deferred.js"></script>
<script src="../../../src/support.js"></script>
<script src="../../../src/sizzle/sizzle.js"></script>
<script src="../../../src/sizzle-jquery.js"></script>
<script src="../../../src/traversing.js"></script>
<script src="../../../src/data.js"></script>
<script src="../../../src/event.js"></script>
<script src="../../../src/css.js"></script>
<script src="../../../src/offset.js"></script>
<script type="text/javascript" src="../../../dist/jquery.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
jQuery(function($) {
$('.absolute').click(function() {
$('#marker').css( $(this).offset() );
var pos = $(this).position();
$(this).css({ top: pos.top, left: pos.left });
return false;
});
});
@ -30,6 +44,8 @@
</div>
</div>
<div id="absolute-2" class="absolute">absolute-2</div>
<div id="positionTest">Has absolute position but no values set for the location ('auto').</div>
<div id="marker"></div>
<p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
</body>
</html>

View file

@ -0,0 +1,33 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>body</title>
<style type="text/css" media="screen">
body { margin: 1px; padding: 5px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
<script src="../../../src/core.js"></script>
<script src="../../../src/deferred.js"></script>
<script src="../../../src/support.js"></script>
<script src="../../../src/sizzle/sizzle.js"></script>
<script src="../../../src/sizzle-jquery.js"></script>
<script src="../../../src/traversing.js"></script>
<script src="../../../src/data.js"></script>
<script src="../../../src/event.js"></script>
<script src="../../../src/css.js"></script>
<script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
jQuery(function($) {
$('body').click(function() {
$('#marker').css( $(this).offset() );
return false;
});
});
</script>
</head>
<body>
<div id="marker"></div>
</body>
</html>

View file

@ -12,9 +12,18 @@
#forceScroll { width: 5000px; height: 5000px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
<script type="text/javascript" src="../../../dist/jquery.js"></script>
<script src="../../../src/core.js"></script>
<script src="../../../src/deferred.js"></script>
<script src="../../../src/support.js"></script>
<script src="../../../src/sizzle/sizzle.js"></script>
<script src="../../../src/sizzle-jquery.js"></script>
<script src="../../../src/traversing.js"></script>
<script src="../../../src/data.js"></script>
<script src="../../../src/event.js"></script>
<script src="../../../src/css.js"></script>
<script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
jQuery(function($) {
window.scrollTo(1000,1000);
$('.fixed').click(function() {
$('#marker').css( $(this).offset() );
@ -26,7 +35,9 @@
<body>
<div id="fixed-1" class="fixed"></div>
<div id="fixed-2" class="fixed"></div>
<div id="fixed-no-top-left" class="fixed"></div>
<div id="forceScroll"></div>
<div id="marker"></div>
<p class="instructions">Click the white box to move the marker to it.</p>
</body>
</html>

View file

@ -6,15 +6,26 @@
<title>relative</title>
<style type="text/css" media="screen">
body { margin: 1px; padding: 5px; }
div.relative { position: relative; margin: 1px; border: 2px solid #000; padding: 5px; width: 100px; height: 100px; background: #fff; overflow: hidden; }
div.relative { position: relative; top: 0; left: 0; margin: 1px; border: 2px solid #000; padding: 5px; width: 100px; height: 100px; background: #fff; overflow: hidden; }
#relative-2 { top: 20px; left: 20px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
<script type="text/javascript" src="../../../dist/jquery.js"></script>
<script src="../../../src/core.js"></script>
<script src="../../../src/deferred.js"></script>
<script src="../../../src/support.js"></script>
<script src="../../../src/sizzle/sizzle.js"></script>
<script src="../../../src/sizzle-jquery.js"></script>
<script src="../../../src/traversing.js"></script>
<script src="../../../src/data.js"></script>
<script src="../../../src/event.js"></script>
<script src="../../../src/css.js"></script>
<script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
jQuery(function($) {
$('.relative').click(function() {
$('#marker').css( $(this).offset() );
var pos = $(this).position();
$(this).css({ position: 'absolute', top: pos.top, left: pos.left });
return false;
});
});
@ -24,5 +35,6 @@
<div id="relative-1" class="relative"><div id="relative-1-1" class="relative"><div id="relative-1-1-1" class="relative"></div></div></div>
<div id="relative-2" class="relative"></div>
<div id="marker"></div>
<p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
</body>
</html>

View file

@ -13,9 +13,18 @@
#forceScroll { width: 5000px; height: 5000px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
<script type="text/javascript" src="../../../dist/jquery.js"></script>
<script src="../../../src/core.js"></script>
<script src="../../../src/deferred.js"></script>
<script src="../../../src/support.js"></script>
<script src="../../../src/sizzle/sizzle.js"></script>
<script src="../../../src/sizzle-jquery.js"></script>
<script src="../../../src/traversing.js"></script>
<script src="../../../src/data.js"></script>
<script src="../../../src/event.js"></script>
<script src="../../../src/css.js"></script>
<script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
jQuery(function($) {
window.scrollTo(1000,1000);
$('#scroll-1')[0].scrollLeft = 5;
$('#scroll-1')[0].scrollTop = 5;
@ -34,5 +43,6 @@
</div>
<div id="forceScroll"></div>
<div id="marker"></div>
<p class="instructions">Click the white box to move the marker to it.</p>
</body>
</html>

View file

@ -6,15 +6,26 @@
<title>static</title>
<style type="text/css" media="screen">
body { margin: 1px; padding: 5px; }
div.static { position: static; margin: 1px; border: 2px solid #000; padding: 5px; width: 100px; height: 100px; background: #fff; overflow: hidden; }
div.static { position: static; top: 0; left: 0; margin: 1px; border: 2px solid #000; padding: 5px; width: 100px; height: 100px; background: #fff; overflow: hidden; }
#static-2 { top: 20px; left: 20px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
<script type="text/javascript" src="../../../dist/jquery.js"></script>
<script src="../../../src/core.js"></script>
<script src="../../../src/deferred.js"></script>
<script src="../../../src/support.js"></script>
<script src="../../../src/sizzle/sizzle.js"></script>
<script src="../../../src/sizzle-jquery.js"></script>
<script src="../../../src/traversing.js"></script>
<script src="../../../src/data.js"></script>
<script src="../../../src/event.js"></script>
<script src="../../../src/css.js"></script>
<script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
jQuery(function($) {
$('.static').click(function() {
$('#marker').css( $(this).offset() );
var pos = $(this).position();
$(this).css({ position: 'absolute', top: pos.top, left: pos.left });
return false;
});
});
@ -24,5 +35,6 @@
<div id="static-1" class="static"><div id="static-1-1" class="static"><div id="static-1-1-1" class="static"></div></div></div>
<div id="static-2" class="static"></div>
<div id="marker"></div>
<p class="instructions">Click the white box to move the marker to it. Clicking the box also changes the position to absolute (if not already) and sets the position according to the position method.</p>
</body>
</html>

View file

@ -10,9 +10,18 @@
th, td { border: 1px solid #000; width: 100px; height: 100px; }
#marker { position: absolute; border: 2px solid #000; width: 50px; height: 50px; background: #ccc; }
</style>
<script type="text/javascript" src="../../../dist/jquery.js"></script>
<script src="../../../src/core.js"></script>
<script src="../../../src/deferred.js"></script>
<script src="../../../src/support.js"></script>
<script src="../../../src/sizzle/sizzle.js"></script>
<script src="../../../src/sizzle-jquery.js"></script>
<script src="../../../src/traversing.js"></script>
<script src="../../../src/data.js"></script>
<script src="../../../src/event.js"></script>
<script src="../../../src/css.js"></script>
<script src="../../../src/offset.js"></script>
<script type="text/javascript" charset="utf-8">
$(function() {
jQuery(function($) {
$('table, th, td').click(function() {
$('#marker').css( $(this).offset() );
return false;
@ -38,5 +47,6 @@
</tbody>
</table>
<div id="marker"></div>
<p class="instructions">Click the white box to move the marker to it.</p>
</body>
</html>

12
test/data/params_html.php Normal file
View file

@ -0,0 +1,12 @@
<div id="post">
<?php
foreach( $_POST as $key=>$value )
echo "<b id='$key'>$value</b>";
?>
</div>
<div id="get">
<?php
foreach( $_GET as $key=>$value )
echo "<b id='$key'>$value</b>";
?>
</div>

View file

@ -0,0 +1 @@
var delayedMessage = "It worked!";

View file

@ -0,0 +1,25 @@
// Simple script loader that uses jQuery.readyWait via jQuery.holdReady()
//Hold on jQuery!
jQuery.holdReady(true);
var readyRegExp = /^(complete|loaded)$/;
function assetLoaded( evt ){
var node = evt.currentTarget || evt.srcElement;
if ( evt.type === "load" || readyRegExp.test(node.readyState) ) {
jQuery.holdReady(false);
}
}
setTimeout( function() {
var script = document.createElement("script");
script.type = "text/javascript";
if ( script.addEventListener ) {
script.addEventListener( "load", assetLoaded, false );
} else {
script.attachEvent( "onreadystatechange", assetLoaded );
}
script.src = "data/readywaitasset.js";
document.getElementsByTagName("head")[0].appendChild(script);
}, 2000 );

11
test/data/script.php Normal file
View file

@ -0,0 +1,11 @@
<?php
error_reporting(0);
if ( $_REQUEST['header'] ) {
if ( $_REQUEST['header'] == "ecma" ) {
header("Content-type: application/ecmascript");
} else {
header("Content-type: text/javascript");
}
}
?>
ok( true, "Script executed correctly." );

Some files were not shown because too many files have changed in this diff Show more