2
0
Fork 0
tcrud/lib/plugin/ui/lib/ui-lib-flot.js
2017-06-10 16:53:29 +02:00

40 lines
1.4 KiB
JavaScript

module.exports = (function () {
var incHostFileJSNodeModule = function(ctx,includeFile,namePart) {
if (includeFile) {
ctx.hostFileJSNodeModule({file: 'jquery.flot.'+namePart+'.js',path: 'flot'});
}
};
return function UILibFlotPlugin() {
this.configPlugin = function (ctx) {
ctx.key='uiLibFlot';
ctx.description='Adds basic flot js libs to resources.';
ctx.localDir = __dirname;
ctx.localConfigTemplate = 'ui-lib-flot.json';
ctx.dependencies.push('uiLibJQuery');
};
this.configServer = function(ctx) {
ctx.hostFileJSNodeModule({file: 'jquery.flot.js', path: 'flot'});
var inc = ctx.troot.tmeta.tplugin.uiLibFlot.include;
incHostFileJSNodeModule(ctx,inc.categories, 'categories');
incHostFileJSNodeModule(ctx,inc.crosshair, 'crosshair');
incHostFileJSNodeModule(ctx,inc.errorbars, 'errorbars');
incHostFileJSNodeModule(ctx,inc.fillbetween, 'fillbetween');
incHostFileJSNodeModule(ctx,inc.image, 'image');
incHostFileJSNodeModule(ctx,inc.navigate, 'navigate');
incHostFileJSNodeModule(ctx,inc.pie, 'pie');
incHostFileJSNodeModule(ctx,inc.resize, 'resize');
incHostFileJSNodeModule(ctx,inc.selection, 'selection');
incHostFileJSNodeModule(ctx,inc.stack, 'stack');
incHostFileJSNodeModule(ctx,inc.symbol, 'symbol');
incHostFileJSNodeModule(ctx,inc.threshold, 'threshold');
incHostFileJSNodeModule(ctx,inc.time, 'time');
};
};
})();