168 Commits

Author SHA1 Message Date
David Glasser
5a5204e3a4 Remove closures around package files. (hint: git blame -w)
The bundler now adds closures around client files and the server adds closures
around server files.
2013-03-19 15:13:53 -07:00
Nick Martin
331177d002 Comment only. 2013-03-18 15:26:55 -07:00
Nick Martin
abe3ee9cbe Merge remote-tracking branch 'origin/deps-radical' into devel 2013-03-12 10:39:03 -07:00
David Glasser
0d3be81357 spark: apply transform in initial render.
parties example: add displayName using transform instead of keeping it as a
separate function. This allows us to drop a few helpers, too.
2013-03-11 23:08:54 -07:00
Nick Martin
65840c1152 Merge remote-tracking branch 'origin/pr/753' into devel 2013-03-11 22:45:38 -07:00
James Gill
17c21705a7 Spark.attachEvents can handle arrays of callbacks. 2013-03-11 17:09:29 -07:00
Naomi Seyfer
1653c091e7 Change the names from factory to transform 2013-03-11 15:49:17 -07:00
David Greenspan
a18a92e65f Deps.run => Deps.autorun 2013-03-11 12:17:39 -07:00
Naomi Seyfer
6b35610d22 actually use the factory instead of printing it 2013-03-08 18:28:26 -08:00
Naomi Seyfer
996fc144bf Basics of factories on collections 2013-03-08 16:33:12 -08:00
David Greenspan
334f172cac radical radical Deps (needs more tests & docs) 2013-03-07 17:44:21 -08:00
David Greenspan
833769c97d Merge branch 'devel' into deps-radical 2013-03-05 13:48:23 -08:00
Chris Mather
57b067b5bd Make eventData an empty object if no data context is found.
This prevents the thisArg from getting set to `window` if eventData is
undefined.

See:
http://stackoverflow.com/questions/15137206/the-context-of-this-in-meteor-template-event-handlers-using-handlebars-for-te/15149650#15149650
2013-03-05 11:22:42 -08:00
David Greenspan
457de14998 renaming 2013-02-28 16:06:31 -08:00
David Greenspan
f6aabffab3 port all packages to new Deps (tests pass) 2013-02-25 17:52:51 -08:00
David Greenspan
9fd43419fa Fix #604: input with name="id" in form 2013-02-15 12:05:09 -08:00
David Glasser
732e948de7 Add ordered-dict dependency to spark. 2013-02-13 00:46:12 -08:00
David Glasser
9b486b3c9b Meteor.random -> Random.fraction
add Random.choice
2013-02-13 00:08:50 -08:00
David Glasser
ed36db211d Use Random.id() in Spark.
We couldn't use Meteor.uuid() because it contained '-' but Random.id() is fine.
2013-02-12 23:51:34 -08:00
David Glasser
e95bcb870c Get rid of duplicate random code inside minimongo.
Temporarily move the objectid-specific function into random.js.
2013-02-12 23:49:43 -08:00
David Glasser
fdb1773d4a Rename uuid package to random. No further changes. 2013-02-12 23:38:22 -08:00
David Glasser
77ac416374 Some ddp-pre1 cleanup
- Delete dead EJSON._each2.

- Make OrderedDict.remove throw if the key isn't in it.

- Make changed callbacks in two places throw if the document isn't in the
  dictionary. (Other callbacks implicitly throw via OrderedDict.)

- Remove OrderedDict.pop (which didn't return the key) and push.
2013-02-12 17:18:09 -08:00
Naomi Seyfer
38db5ddc1d * remove spark dependency on minimongo * simpler to use orderedDict with obj k
Removed spark dependency on minimongo by duplicating a very small amount of
code.  There is an XXX to mark it.

OrderedDict can have a function as the first argument to its constructor; it
will use the function to transform whatever object is used as a key to strings.
2013-02-06 14:23:47 -08:00
Naomi Seyfer
d92628020f Refactor Spark to use observeChanges instead of observe
It uses an orderedDict instead of an array, and also this new version happens to
not do a ton of splices, which might help with performance in cases for really
large numbers of items.  Anyway, introduced a dependency on LocalCollection;
will break that soon.
2013-02-04 14:42:45 -08:00
Naomi Seyfer
06c0d7b216 Undoing David comments to spark, probably not switching over to OC 2013-01-25 16:09:04 -08:00
Naomi Seyfer
f65b5c738d ordered dictionary, for eventual use in observeChanges->observe 2013-01-25 16:07:14 -08:00
Naomi Seyfer
3068fd1a36 ObjectID collections now an option not the default 2013-01-17 15:42:34 -05:00
Naomi Seyfer
5d93d60aa6 All tests now pass after switching the defualt Collection to ObjectID
**Caveats:**
 - I have not written any more tests; I perhaps should
 - I have not yet written any code to keep current Collections from mixing
   strings and ObjectIDs
 - I don't actually know if the default should be ObjectID.  I should discuss
    with people about this.
2013-01-17 15:41:18 -05:00
David Glasser
a9a7179ebf Follow-up to 26c725 to work on more browsers.
Windows Safari (eg) seems to apply the "uncheck existing radios when new radios
are created" even earlier than other browsers, so save values earlier.
2013-01-03 15:33:42 -08:00
David Glasser
46e772c0ef Merge branch 'devel' into release-0.5.3
Pull in fix to #392.
2013-01-03 10:34:00 -08:00
David Greenspan
5eae5eae4c Further protect from stack traces on re-render 2013-01-02 18:10:48 -08:00
David Greenspan
577e1b6b12 Fix #392 - Spark.isolate prints stack trace
Isolates would print a stack trace upon re-render
if their DOM nodes had been manually removed from
the DOM without called Spark.finalize.
2013-01-02 18:07:58 -08:00
David Glasser
26c7258027 Follow-up to 442b86: fix re-rendering of unfocused radio buttons.
Before 442b86, this worked because we always unconditionally made tgt checked if
src was checked. With the new 3-way-diff algorithm for value and checkedness, we
need to save the checkedness of tgt before any DOM manipulation that could
uncheck it.
2012-12-27 00:06:42 -08:00
David Glasser
32870ea933 Spark: Test that patching "<input type=checkbox/radio checked>" onto unchecked
input works.

This test was extracted from a fix for this specific issue #478 which
accidentally never got merged; 442b86eebd ended up fixing this issue with a
slightly different change than the unmerged fix.
2012-12-24 11:12:26 -08:00
David Glasser
442b86eebd Preserve CHECKED status similarly to VALUE.
Fixes #510.
2012-12-04 14:47:40 -08:00
David Glasser
723154e472 When preserving elements with values, preserve the value of elements unless the
server's rendering has changed.

This fixes two independent issues:

  - If the user has changed the value in a preserved field, and something causes
    the field to be rerendered, and the re-rendering renders the same value that
    was originally rendered, this now preserves the user's change rather than
    reverting to the original value.

  - INPUTs with type other than TEXT can now have reactive values (eg,
    type=SUBMIT).
2012-12-04 14:47:40 -08:00
David Glasser
401c0cfa21 Better error message from Spark when patching bad HTML fails.
Fixes #512.
2012-11-28 13:22:29 -08:00
Nick Martin
46c14a7405 Workaround new underscore failure in IE8. 2012-11-19 14:18:04 -08:00
David Glasser
bae1a59af6 Publicize Meteor._autorun as Meteor.autorun (with docs and tests). 2012-10-12 00:50:35 -07:00
David Glasser
20e29d2851 Make everything in deps-utils private for now. 2012-10-05 15:26:22 -07:00
David Glasser
08a0eda83e Merge branch 'devel' into deps-utils-private
Conflicts:
	packages/session/session.js
2012-10-05 15:14:13 -07:00
David Greenspan
998ad47b21 newline at end of file 2012-10-01 10:13:44 -07:00
David Greenspan
1e82308054 Tweaks from Geoff code review 2012-09-29 13:24:46 -07:00
David Greenspan
0adc89e736 spark tests no longer clear _globalPreserves 2012-09-28 13:16:00 -07:00
David Greenspan
1920122ddd move idNameLabeler into Spark 2012-09-27 19:34:59 -07:00
David Greenspan
fe096edf23 spark_tests uses preserve-input labeler 2012-09-24 20:36:19 -07:00
David Greenspan
eaf146cc2e preserve-inputs package, Spark._globalPreserves 2012-09-24 20:17:19 -07:00
David Greenspan
0565593da5 block browser events triggered by Spark DOM manip 2012-09-24 20:01:24 -07:00
David Greenspan
deafbf4a3d implement proper legacy-style id/name preservation
just in spark_tests, but to go in package
2012-09-24 20:01:24 -07:00
David Greenspan
1168a70e3e fix reactive <select> tag in IE 7-8
Work around IE bug where HTML comments don't materialize inside
<select> and <option> tags.
2012-09-24 12:06:19 -07:00