JavaScript framework for building data-oriented, event-driven browser applications.
plugin.coffeesrc/ | |
---|---|
Plugins | MITHgrid.namespace "Plugin", (exports) -> |
This is the base of a plugin, which can package together various things that augment an application. MITHgrid.Plugin.MyPlugin.initInstance = function(options) { var that = MITHgrid.Plugin.initInstance('MyPlugin', options, { ... }) }; var myApp = MITHgrid.Application({ plugins: [ { name: 'MyPlugin', ... } ] }); |
exports.initInstance = (klass, options) ->
that = { options: options, presentation: { } }
readyFns = [ ]
that.getTypes = () ->
if options?.types?
options.types
else
[ ]
that.getProperties = () ->
if options?.properties?
options.properties
else
[ ]
that.getComponents = () ->
if options?.components?
options.components
else
[ ]
that.getPresentations = () ->
if options?.presentations?
options.presentations
else
[ ]
that.ready = readyFns.push
that.eventReady = (app) ->
for fn in readyFns
fn app
readyFns = []
that.ready = (fn) ->
fn app
that
|
This project is maintained by umd-mith
Hosted on GitHub Pages — Theme by orderedlist