kriszyp/dbind — pull request #2 by asudoh (2013-01-30 06:53:15+00:00)
Title: Introduced several object/element-related bindings, etc.

I've been playing around the code and trying to figure out the design intents and how things should actually work. I ended up with making some changes as the result. I'm not sure if the changes align to the design intents, or conflicts them, though. Any thoughts/questions on them will be nice.

(@cjolif, @edchat, @neonstalwart Any thoughts from you will be nice, too)

The changes I made are the following:

`getValue()` no longer sends future changes
--------

Moved code handling future changes to `then()` and made `getValue()` a sole getter, sending current value to the callback. Also introduced `setValue()` working as a setter.

Introduced `ObjectBinding`, separated from base `Binding`
--------

The new `ObjectBinding` does not change the parent object via `is()`.

Introduced `WidgetBinding` separated from `StatefulBinding`
-------

The new `WidgetBinding` can specify what widget attribute should be the main value. Also it excludes `id` attribute from the list of child binding, as it should be immutable. Made `StatefulBinding`'s main value just a placeholder, as it does not make sense for it to handle a specific Stateful property.

Introduced `ElementAttributeBinding`, `ElementClassBinding`, `ElementCollapsedBinding` and `ElementHiddenBinding`
--------

They can be created as children of `ElementBinding`, with `[attribname]`, `.classname`, `.collapsed`, `.hidden` keys, respectively.