Skip to content
Browse files

add more to the readme

  • Loading branch information...
1 parent 43c2d4b commit 58f7c5c8c9fb966421e0858d38a98c253c009960 @jldailey committed May 23, 2012
Showing with 27 additions and 18 deletions.
  1. +27 −18 README.md
View
45 README.md
@@ -2,30 +2,39 @@ BlingJS is meant to be as useful as jQuery, but more consistent.
In particular, it is more consistent about doing set-based operations:
* All operations return sets wherever possible.
+* As much as possible is a plugin, even core operations.
-So, while it supports all the same basic operations as jQuery,
-these operations behave slightly differently.
+So, while it supports all the same basic operations as jQuery, they behave
+slightly different.
-For instance, the `.html()` operation in jQuery just returns the
-innerHTML of the _first_ DOM node in the input; here, you get a set of
-html strings, one from each node.
+For instance, the `.html()` operation.
+* in jQuery, returns the innerHTML of the _first_ DOM node in the input
+* here, you get a set of html strings, one from _each_ node.
-This **set philosophy** means that basic set primitives like `.intersect()` and `.union()`
-are more useful (and they are part of the "core" plugin).
+This **set philosophy** means that set operations are useful:
+* `.intersect()`
+* `.union()`
-Highly modular, almost everything is a plugin, as much as possible.
+These kinds of set operations are part of the "core" plugin, and there also some
+new things, like the `.select()` and `.zap()` operations.
-There are also some new things, like the `.select()` and `.zap()` operations.
-
-The `.select()` operation will grab a single property from every item in
-a set. So, `.html()` is a shortcut for `.select('innerHTML')`. You can also extract
-nested values easily, as in `.select('style.color')`, arbitrary nesting depth, and
-arrays, are supported, e.g. `.select('foo.bar.0.baz')`.
+The `.select()` operation will collect a single property from every item in
+a set.
+> `.html()` is a shortcut for `.select('innerHTML')`.
+* You can extract nested values, e.g. `.select('style.color')`.
+* Arbitrary nesting depth, and arrays, e.g. `.select('foo.bar.0.baz')`.
The `.zap()` operation is a way to do assignment and stay in a loosely
-functional context. So, `.html("new html")` is a shortcut for
-`.zap('innerHTML', "new html")`. But more than just simple assignment,
-it can also 'stripe' values across a set; a common thing to want to
-accomplish across list items, e.g. `$("li").zap('className', ["odd", "even"])`.
+functional context.
+> `.html("new html")` is a shortcut for `.zap('innerHTML', "new html")`.
+
+More than just simple assignment, it can also 'stripe' values across a set;
+a common thing to want to accomplish across list items.
+> `$("li").zap('className', ["odd", "even"])`.
+
+It can map a function across nested properties of your set items:
+> `$("li").zap('style.top', -> $.px @+10 )`
+This example moves every list-item up 10 pixels, and allows you to continue chaining
+on the list-items.
http://blingjs.com

0 comments on commit 58f7c5c

Please sign in to comment.
Something went wrong with that request. Please try again.