Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/waymondo/director
- Owner: waymondo
- Created: 2014-02-24T16:52:45.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-24T17:15:38.000Z (almost 11 years ago)
- Last Synced: 2024-04-28T01:29:59.376Z (9 months ago)
- Language: CoffeeScript
- Size: 113 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.