Commit Graph

66 Commits

Author SHA1 Message Date
Dave Methvin
ce15bd7d0c Fix #7579. Don't convert to number if it changes the string. Close gh-852.
Net effect here is that hex numbers and most exponential-format numbers or long sequences of digits will remain strings rather than being coerced to numbers. `The people have spoken.
2012-07-25 10:28:50 -04:00
Chad Killingsworth
de9bed319e Make unit tests friendly to Closure Compiler. Closes gh-845.
Conflicts:
    	test/unit/effects.js
    	test/unit/offset.js
2012-07-05 15:52:42 -04:00
Rick Waldron
7ff3da186c Unit tests are linted and passing. 2012-06-21 15:30:24 -04:00
Andy Monat
dc337f628c Fix #11435. Remove obsolete test code. 2012-04-04 21:38:47 -04:00
Sindre Sorhus
96bb57d4ef Fix #11309. Recognize hexadecimal in data attributes. 2012-02-09 20:27:27 -05:00
Richard Gibson
6c2a501de4 Fix #5571. Setters should treat undefined as a no-op and be chainable. 2011-12-06 15:25:38 -05:00
Mike Sherov
f35ba5e699 Fix #10691. Remove all instances of equals() and same(), as these are deprecated in QUnit. 2011-11-06 15:27:42 -05:00
Corey Frang
9b3768b968 Landing pull request 512. 1.7 - removeData now takes space separated lists and arrays of keys - Fixes #7323.
More Details:
 - https://github.com/jquery/jquery/pull/512
 - http://bugs.jquery.com/ticket/7323
2011-09-19 21:16:20 -04:00
Corey Frang
2831cfd072 Landing pull request 503. 1.7 data: set a flag in the private data cache to avoid having to scan attributes multiple times - Fixes #8909.
More Details:
 - https://github.com/jquery/jquery/pull/503
 - http://bugs.jquery.com/ticket/8909
2011-09-19 16:13:57 -04:00
Corey Frang
d5f144a7bb Landing pull request 500. 1.7 - "public data" stored as a key on "internal data" - Fixes #8921.
More Details:
 - https://github.com/jquery/jquery/pull/500
 - http://bugs.jquery.com/ticket/8921
2011-09-19 16:13:14 -04:00
rwldrn
8e8fa6dc1a Bug in rmultidash. Fixes #10194 2011-09-07 10:13:22 -04:00
rwldrn
93beee8ac0 Test for window inference. Fixes #10080 2011-08-18 10:17:12 -04:00
Dave Methvin
b22c904652 Merge pull request #456 from rwldrn/9318
Improves support for arbitrary numbers in data keys. Fixes #9318
2011-08-05 07:45:05 -07:00
Rick Waldron
22028e403f Adds failing tests 2011-08-05 10:17:02 -04:00
Rick Waldron
7daf44b5ab Adds failing tests for #9413 2011-08-05 09:43:15 -04:00
Rick Waldron
84d066ff7c Correct non-null|undefined evaluation of data property values. Fixes #9794 2011-07-10 21:45:50 -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
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
timmywil
ecf6a3c383 Switch QUnit div from depreceted #main to #qunit-fixture 2011-04-17 02:43:57 -04:00
louisremi
11adde5127 second batch 2011-04-11 22:33:29 +02: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
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
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
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
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
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
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
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
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
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
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
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
1dee0d2ed8 Added some more tests relating to attaching data to a window. 2010-10-11 17:52:00 -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
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
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
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
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
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
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
c4b4df4691 Make sure that .data() events don't bubble, per the discussion in 2e10af143b. Fixes #6832. 2010-07-27 13:45:32 -04: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
InfinitiesLoop
2e10af143b Ticket #6804. Adds a changeData event. 2010-07-20 10:12:40 +08: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