Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enova/mutiny
Reusable, declarative HTML5 widgets
https://github.com/enova/mutiny
Last synced: about 1 month ago
JSON representation
Reusable, declarative HTML5 widgets
- Host: GitHub
- URL: https://github.com/enova/mutiny
- Owner: enova
- License: mit
- Created: 2012-09-19T17:20:31.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-10-20T18:02:56.000Z (about 9 years ago)
- Last Synced: 2024-11-10T15:52:01.475Z (about 2 months ago)
- Language: JavaScript
- Homepage: http://mutinyjs.com
- Size: 2.29 MB
- Stars: 3
- Watchers: 34
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
mutiny.js [![Build Status](https://secure.travis-ci.org/enova/mutiny.png)](http://travis-ci.org/enova/mutiny)
=====
Tired of writing procedural code to generate Javascript UI elements in a
completely different section of the HTML document? So are we! Mutiny.js allows
you to declaratively create widgets in the same location by extending HTML5 data
attributes.Usage
-----
1. Install Mutiny. We use [bower](http://bower.io/):```console
$ bower install --save mutiny
```2. Load Mutiny into the page:
```html
```3. Add the HTML5 data attributes:
```html
Click me to select all
```4. Watch the magic!
Extending
-----
Javascript:```javascript
Mutiny.widgets.optionsToText = {
defaults: {'def': 'opt'},
init: function(instigator, options) {
var s = [];
for(var key in options) {
s.push('"' + key + '": "' + options[key] + '"');
}
instigator.textContent = '{' + s.join(', ') + '}');
}
};
```HTML5:
```html
```Running Tests/Examples
-----
```console
$ git clone https://github.com/enova/mutiny.git
$ cd mutiny
$ ./server.sh
$ open http://localhost:5100/
```Licensing
-----
Mutiny is released by [Enova](http://www.enova.com) under the
[MIT License](https://github.com/enova/mutiny/blob/master/LICENSE).