https://github.com/aolde/moduler.js
JavaScript library for binding modules to DOM elements.
https://github.com/aolde/moduler.js
Last synced: 5 months ago
JSON representation
JavaScript library for binding modules to DOM elements.
- Host: GitHub
- URL: https://github.com/aolde/moduler.js
- Owner: aolde
- License: mit
- Created: 2013-08-04T18:09:56.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2024-07-30T19:51:27.000Z (almost 2 years ago)
- Last Synced: 2024-07-31T00:04:42.695Z (almost 2 years ago)
- Language: JavaScript
- Homepage: http://aolde.github.io/moduler.js
- Size: 937 KB
- Stars: 12
- Watchers: 8
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
moduler.js
==========
> JavaScript library for binding modules to DOM elements.
## Getting Started
Get the [latest version](https://github.com/simplyio/moduler.js/releases) from the releases in Github and include the moduler.js in your HTML page. jQuery is a prerequisite for moduler.js to work.
## Quick Example
**1.** Create a new module type:
```JavaScript
(function () {
"use strict";
var moduleObj = moduler('hello-world', {
defaults: {
message: 'Hello ',
},
init: function (module) {
module.$element.click(function() {
alert(module.settings.message + module.$element.text());
});
}
});
})();
```
**2.** Apply it to an element:
```html
Peter Griffin
```
**3.** Click on "Peter Griffin" and an alert box will appear saying ``Hey Peter Griffin`` because we overrided the default message (``"Hello "``).
## Samples
Every module has a sample that you can view at: https://rawgit.com/simplyio/moduler.js/master/src/index.html
## Browser Support
Tested in the following browsers, but will likely work in all modern browsers.
- Internet Explorer 8 and later.
- Chrome, latest.
- Firefox, latest.
## Documentation
- [Creating your first module](https://github.com/simplyio/moduler.js/wiki/Creating-your-first-module)
- [Explanation of a module](https://github.com/simplyio/moduler.js/wiki/Example-module-explained)
## Issues
Report bugs through the [issue list](https://github.com/simplyio/moduler.js/issues) on Github.
## Tests
The QUnit testing framework is used to test most of moduler.js's features. You can run them by opening tests/tests.html or navigate to http://simplyio.github.io/moduler.js/tests/tests.html.
## License
Moduler.js is freely distributable under the terms of the MIT license.