ld31-space-diggers/node_modules/browser-sync/node_modules/browser-sync-client/lib/ghostmode.forms.js
Ruben Müller 760c1838ed Add game
2014-12-07 20:57:49 +01:00

35 lines
716 B
JavaScript

"use strict";
exports.plugins = {
"inputs": require("./ghostmode.forms.input"),
"toggles": require("./ghostmode.forms.toggles"),
"submit": require("./ghostmode.forms.submit")
};
/**
* Load plugins for enabled options
* @param bs
*/
exports.init = function (bs, eventManager) {
var checkOpt = true;
var options = bs.options.ghostMode.forms;
if (options === true) {
checkOpt = false;
}
function init(name) {
exports.plugins[name].init(bs, eventManager);
}
for (var name in exports.plugins) {
if (!checkOpt) {
init(name);
} else {
if (options[name]) {
init(name);
}
}
}
};