├── docs ├── CNAME ├── fonts │ ├── proxima-nova │ │ ├── ProximaNova-Light-webfont.eot │ │ ├── ProximaNova-Reg-webfont.eot │ │ ├── ProximaNova-Reg-webfont.ttf │ │ ├── ProximaNova-Black-webfont.eot │ │ ├── ProximaNova-Black-webfont.ttf │ │ ├── ProximaNova-Black-webfont.woff │ │ ├── ProximaNova-Bold-webfont.eot │ │ ├── ProximaNova-Bold-webfont.ttf │ │ ├── ProximaNova-Bold-webfont.woff │ │ ├── ProximaNova-BoldIt-webfont.eot │ │ ├── ProximaNova-BoldIt-webfont.ttf │ │ ├── ProximaNova-Light-webfont.ttf │ │ ├── ProximaNova-Light-webfont.woff │ │ ├── ProximaNova-Reg-webfont.woff │ │ ├── ProximaNova-RegIt-webfont.eot │ │ ├── ProximaNova-RegIt-webfont.ttf │ │ ├── ProximaNova-RegIt-webfont.woff │ │ ├── ProximaNova-Sbold-webfont.eot │ │ ├── ProximaNova-Sbold-webfont.ttf │ │ ├── ProximaNova-Sbold-webfont.woff │ │ ├── ProximaNova-Thin-webfont.eot │ │ ├── ProximaNova-Thin-webfont.ttf │ │ ├── ProximaNova-Thin-webfont.woff │ │ ├── ProximaNova-ThinIt-webfont.eot │ │ ├── ProximaNova-ThinIt-webfont.ttf │ │ ├── ProximaNova-Xbold-webfont.eot │ │ ├── ProximaNova-Xbold-webfont.ttf │ │ ├── ProximaNova-Xbold-webfont.woff │ │ ├── ProximaNova-BlackIt-webfont.eot │ │ ├── ProximaNova-BlackIt-webfont.ttf │ │ ├── ProximaNova-BlackIt-webfont.woff │ │ ├── ProximaNova-BoldIt-webfont.woff │ │ ├── ProximaNova-LightIt-webfont.eot │ │ ├── ProximaNova-LightIt-webfont.ttf │ │ ├── ProximaNova-LightIt-webfont.woff │ │ ├── ProximaNova-SboldIt-webfont.eot │ │ ├── ProximaNova-SboldIt-webfont.ttf │ │ ├── ProximaNova-SboldIt-webfont.woff │ │ ├── ProximaNova-ThinIt-webfont.woff │ │ ├── ProximaNova-XboldIt-webfont.eot │ │ ├── ProximaNova-XboldIt-webfont.ttf │ │ └── ProximaNova-XboldIt-webfont.woff │ ├── entypo │ │ ├── entypo.eot │ │ ├── entypo.ttf │ │ ├── entypo.woff │ │ └── entypo.svg │ └── entypo-social │ │ ├── entypo-social.eot │ │ ├── entypo-social.ttf │ │ ├── entypo-social.woff │ │ └── entypo-social.svg ├── img │ ├── kin.png │ ├── vs.png │ ├── dell.png │ ├── disco.png │ ├── mikeric.jpg │ └── attendease.png ├── docs │ ├── reference │ │ ├── _binders │ │ │ ├── html.md │ │ │ ├── show.md │ │ │ ├── hide.md │ │ │ ├── enabled.md │ │ │ ├── disabled.md │ │ │ ├── value.md │ │ │ ├── text.md │ │ │ ├── unless.md │ │ │ ├── if.md │ │ │ ├── class-[classname].md │ │ │ ├── [attribute].md │ │ │ ├── checked.md │ │ │ ├── unchecked.md │ │ │ ├── on-[event].md │ │ │ └── each-[item].md │ │ ├── _data.json │ │ └── index.jade │ └── guide │ │ ├── _sections │ │ ├── formatters.md │ │ ├── adapters │ │ │ ├── default.md │ │ │ └── creating.md │ │ ├── usage │ │ │ ├── binding.md │ │ │ ├── configuring.md │ │ │ └── templates.md │ │ ├── iteration │ │ │ ├── iteration.md │ │ │ └── index.md │ │ ├── functions-call.md │ │ ├── binders.md │ │ ├── formatters │ │ │ ├── one-way.md │ │ │ ├── arguments.md │ │ │ └── two-way.md │ │ ├── binders │ │ │ ├── one-way.md │ │ │ ├── two-way.md │ │ │ └── api.md │ │ ├── index.md │ │ ├── computed-properties.md │ │ ├── install.md │ │ ├── adapters.md │ │ └── components.md │ │ ├── index.jade │ │ └── _data.json ├── js │ ├── app.js │ └── highlight.js ├── css │ ├── responsive.styl │ ├── syntax.css │ ├── type.css │ └── screen.styl ├── _layout.jade └── index.jade ├── .gitignore ├── src ├── formatters.coffee ├── export.coffee ├── util.coffee ├── parsers.coffee ├── rivets.coffee ├── adapter.coffee ├── view.coffee ├── binders.coffee └── bindings.coffee ├── component.json ├── bower.json ├── spec ├── rivets │ ├── formatters.js │ ├── text_template_parser.js │ ├── component_binding.js │ ├── functional.js │ ├── binders.js │ ├── routines.js │ └── binding.js ├── runner.html └── lib │ └── mock.data.js ├── LICENSE ├── package.json ├── doc.sh ├── gulpfile.js ├── README.md ├── CHANGELOG.md └── dist └── rivets.min.js /docs/CNAME: -------------------------------------------------------------------------------- 1 | rivetsjs.com 2 | -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Light-webfont.eot: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.swp 3 | node_modules/**/* 4 | -------------------------------------------------------------------------------- /docs/img/kin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/img/kin.png -------------------------------------------------------------------------------- /docs/img/vs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/img/vs.png -------------------------------------------------------------------------------- /docs/img/dell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/img/dell.png -------------------------------------------------------------------------------- /docs/img/disco.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/img/disco.png -------------------------------------------------------------------------------- /docs/img/mikeric.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/img/mikeric.jpg -------------------------------------------------------------------------------- /docs/img/attendease.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/img/attendease.png -------------------------------------------------------------------------------- /docs/fonts/entypo/entypo.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/entypo/entypo.eot -------------------------------------------------------------------------------- /docs/fonts/entypo/entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/entypo/entypo.ttf -------------------------------------------------------------------------------- /docs/fonts/entypo/entypo.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/entypo/entypo.woff -------------------------------------------------------------------------------- /docs/fonts/entypo-social/entypo-social.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/entypo-social/entypo-social.eot -------------------------------------------------------------------------------- /docs/fonts/entypo-social/entypo-social.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/entypo-social/entypo-social.ttf -------------------------------------------------------------------------------- /docs/fonts/entypo-social/entypo-social.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/entypo-social/entypo-social.woff -------------------------------------------------------------------------------- /docs/docs/reference/_binders/html.md: -------------------------------------------------------------------------------- 1 | Sets the element's HTML content. 2 | 3 | ```html 4 |
5 | ``` 6 | -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Reg-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Reg-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Reg-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Reg-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Black-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Black-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Black-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Black-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Black-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Black-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Bold-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Bold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Bold-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Bold-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-BoldIt-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-BoldIt-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-BoldIt-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-BoldIt-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Light-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Light-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Light-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Reg-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Reg-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-RegIt-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-RegIt-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-RegIt-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-RegIt-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-RegIt-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-RegIt-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Sbold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Sbold-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Sbold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Sbold-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Sbold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Sbold-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Thin-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Thin-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Thin-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Thin-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Thin-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Thin-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-ThinIt-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-ThinIt-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-ThinIt-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-ThinIt-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Xbold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Xbold-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Xbold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Xbold-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-Xbold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-Xbold-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-BlackIt-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-BlackIt-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-BlackIt-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-BlackIt-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-BlackIt-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-BlackIt-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-BoldIt-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-BoldIt-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-LightIt-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-LightIt-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-LightIt-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-LightIt-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-LightIt-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-LightIt-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-SboldIt-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-SboldIt-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-SboldIt-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-SboldIt-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-SboldIt-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-SboldIt-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-ThinIt-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-ThinIt-webfont.woff -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-XboldIt-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-XboldIt-webfont.eot -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-XboldIt-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-XboldIt-webfont.ttf -------------------------------------------------------------------------------- /docs/fonts/proxima-nova/ProximaNova-XboldIt-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mikeric/rivets/HEAD/docs/fonts/proxima-nova/ProximaNova-XboldIt-webfont.woff -------------------------------------------------------------------------------- /src/formatters.coffee: -------------------------------------------------------------------------------- 1 | # Core formatters 2 | 3 | # Calls a function with arguments 4 | Rivets.public.formatters['call'] = (value, args...) -> 5 | value.call @, args... 6 | 7 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/show.md: -------------------------------------------------------------------------------- 1 | Shows the element when the value evaluates to true and hides the element when the value evaluates to false. 2 | 3 | ```html 4 | 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/hide.md: -------------------------------------------------------------------------------- 1 | Hides the element when the value evaluates to true and shows the element when the value evaluates to false. 2 | 3 | ```html 4 |
5 | ``` 6 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/enabled.md: -------------------------------------------------------------------------------- 1 | Enables the element when the value evaluates to true and disables the element when the value evaluates to false. 2 | 3 | ```html 4 | 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/disabled.md: -------------------------------------------------------------------------------- 1 | Disables the element when the value evaluates to true and enables the element when the value evaluates to false. 2 | 3 | ```html 4 | 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/value.md: -------------------------------------------------------------------------------- 1 | Sets the element's value when the attribute changes and sets the bound object's value when the input element changes from user input (two-way). 2 | 3 | ```html 4 | 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/text.md: -------------------------------------------------------------------------------- 1 | Sets the element's text content. 2 | 3 | ```html 4 |

5 | ``` 6 | 7 | You can also bind text using interpolation. 8 | 9 | ```html 10 |

{ user.name } is { user.age } years old.

11 | ``` 12 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/unless.md: -------------------------------------------------------------------------------- 1 | Removes and unbinds the element as well as it's child nodes when the value evaluates to true and inserts / binds the element when the value evaluates to false. 2 | 3 | ```html 4 |
5 | ``` 6 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/if.md: -------------------------------------------------------------------------------- 1 | Inserts and binds the element as well as it's child nodes into the DOM when the value evaluates to true and removes / unbinds the element when the value evaluates to false. 2 | 3 | ```html 4 |
5 | ``` 6 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/class-[classname].md: -------------------------------------------------------------------------------- 1 | Adds a class (whatever value is in place of `[classname]`) on the element when the value evaluates to true and removes that class if the value evaluates to false. 2 | 3 | ```html 4 |
  • { todo.name }
  • 5 | ``` 6 | -------------------------------------------------------------------------------- /docs/docs/reference/_data.json: -------------------------------------------------------------------------------- 1 | [ 2 | "text", 3 | "html", 4 | "show", 5 | "hide", 6 | "enabled", 7 | "disabled", 8 | "if", 9 | "unless", 10 | "value", 11 | "checked", 12 | "unchecked", 13 | "on-[event]", 14 | "each-[item]", 15 | "class-[classname]", 16 | "[attribute]" 17 | ] 18 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/[attribute].md: -------------------------------------------------------------------------------- 1 | Sets the value of an attribute (whatever value is in place of `[attribute]`) on the element. 2 | 3 | *If your binding declaration does not match any of the above routines, it will fallback to use this binding.* 4 | 5 | ```html 6 | 7 | ``` 8 | -------------------------------------------------------------------------------- /docs/docs/guide/_sections/formatters.md: -------------------------------------------------------------------------------- 1 | Formatters are functions that mutate the incoming and/or outgoing value of a binding. You can use them to format dates, numbers, currencies, etc. and because they work in a similar fashion to the Unix pipeline, the output of each feeds directly as input to the next one, so you can stack as many of them together as you like. 2 | -------------------------------------------------------------------------------- /docs/docs/guide/_sections/adapters/default.md: -------------------------------------------------------------------------------- 1 | Rivets.js ships with a `.` adapter for subscribing to properties on plain JavaScript objects. The adapter is self-implemented using ES5 natives such as `Object.defineProperty`. 2 | 3 | If you need to support non-ES5 browsers (< IE 9), you can replace this adapter to use polyfills or with a third-party library that has the browser support you need. 4 | -------------------------------------------------------------------------------- /docs/js/app.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function() { 2 | $('#hamburger').on('click', function() { 3 | menu = $('#menu') 4 | 5 | if(menu.data('open')) { 6 | menu.attr('style', 'display: none') 7 | menu.data('open', false) 8 | } else { 9 | menu.attr('style', 'display: block !important; float: left') 10 | menu.data('open', true) 11 | } 12 | }) 13 | }) 14 | -------------------------------------------------------------------------------- /docs/docs/guide/_sections/usage/binding.md: -------------------------------------------------------------------------------- 1 | Simply call `rivets.bind` on a template element with some data that you would like to bind. 2 | 3 | 4 | ```javascript 5 | rivets.bind($('#auction'), {auction: auction}) 6 | ``` 7 | 8 | *Every call to `rivets.bind` returns a fully data-bound view that you should hold on to for later. You'll need it in order to unbind it's listeners using `view.unbind()`.* 9 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/checked.md: -------------------------------------------------------------------------------- 1 | Checks the input when the value evaluates to true and unchecks the input when the value evaluates to false. This also sets the bound object's value to true/false when the user checks/unchecks the input (two-way). 2 | 3 | *Use this instead of value when binding to checkboxes or radio buttons.* 4 | 5 | ```html 6 | 7 | ``` 8 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/unchecked.md: -------------------------------------------------------------------------------- 1 | Unchecks the input when the value evaluates to true and checks the input when the value evaluates to false. This also sets the bound object's value to false/true when the user checks/unchecks the input (two-way). 2 | 3 | *Use this instead of value when binding to checkboxes or radio buttons.* 4 | 5 | ```html 6 | 7 | ``` 8 | -------------------------------------------------------------------------------- /docs/docs/reference/_binders/on-[event].md: -------------------------------------------------------------------------------- 1 | Binds an event listener on the element using the event specified in `[event]` and the bound object (should return a function) as the callback. 2 | 3 | *If the end value of the binding changes to a different function, this binder will automatically unbind the old callback and bind a new listener to the new function.* 4 | 5 | ```html 6 | 7 | ``` 8 | -------------------------------------------------------------------------------- /component.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rivets", 3 | "description": "Declarative data binding + templating solution.", 4 | "repo": "mikeric/rivets", 5 | "version": "0.9.6", 6 | "keywords": [ 7 | "data binding", 8 | "templating" 9 | ], 10 | "license": "MIT", 11 | "scripts": [ 12 | "dist/rivets.js" 13 | ], 14 | "main": "dist/rivets.js", 15 | "dependencies": { 16 | "mikeric/sightglass": "~0.2.4" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /docs/css/responsive.styl: -------------------------------------------------------------------------------- 1 | @media(min-width: 1200px) 2 | .container 3 | width 970px 4 | 5 | // Portrait tablet to landscape and desktop 6 | 7 | @media(max-width: 991px) 8 | aside 9 | display none 10 | 11 | // Landscape phone to portrait tablet 12 | 13 | @media(max-width: 767px) 14 | header #menu 15 | ul 16 | li 17 | margin 0 0 0.5em 18 | display block 19 | 20 | section.intro .blurb 21 | font-size 28px 22 | -------------------------------------------------------------------------------- /docs/docs/guide/_sections/iteration/iteration.md: -------------------------------------------------------------------------------- 1 | Use the `rv-each-[item]` binder to have Rivets.js automatically loop over items in an array and append bound instances of that element. Within that element you can bind to the iterated item as well as any contexts that are available in the parent view. 2 | 3 | ```html 4 |