#Dragonfly
Dragonfly is a flexible and light ui framework.
##Features
##Browser Support
##API Documentation
see: Dragonfly API Documentation
##Modular Development
###Dynamic Loading
Dragonfly follows the AMD specification, you can use any js file as a AMD module and load it with a AMD loader, for example:
require(['Button'], function(Button) {
var button = new Button();
button.render();
});
###Optimization
If you want to optimize all the modules into one file, follow the steps below:
step1. install RequireJS
npm install -g requirejs
step2. copy r.js
to the ./tool
folder, and then
node r.js -o build-js.js
node r.js -o build-css.js
The optimized files will be created in the ./output
folder. For more settings about optimization, see:example.build.js.
###Namespace You can use the optimized file as a AMD module like before.
If you don't have an AMD loader like RequireJS, Dragonfly will export a global API entry called "D", change the start.frag if you want to define your own namespace:
root.D = factory();
or call the noConflic() method to get the reference to the Dragonfly object:
var myD = D.noConflict();