Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/waymondo/director

JavaScript plugin for dynamic template decorating from declarative attributes
https://github.com/waymondo/director

Last synced: about 2 months ago
JSON representation

JavaScript plugin for dynamic template decorating from declarative attributes

Awesome Lists containing this project

README

        

### Director.js

A dinky template plugin for `$` (either jQuery or Zepto with the `data` module) and `_` (either Underscore or Lo-Dash). Director.js lets your define dynamic decorator functions as objects in a declarative `data-direct` attribute. It was created out of necessity for a reusable pattern for sprucing up liberally cached templates.

#### Quick Example

``` html




```

When you call `director.direct()` the following JavaScript will get automatically executed:

``` coffeescript
$("#menu").find("#dashboard a").css({color: "red"})
```

Check the [blog post](http://blog.waymondo.com/2014-02-23-director-dot-js-dynamic-template-decorating-from-declarative-attributes) and [example.html](https://github.com/waymondo/director/blob/master/example.html) for more info and examples.