Complete project module (for now)

- Remove unused modules from ``config.json``
* Move config list stuff from ``onLoad`` to ``api``

The api call might be useful elsewhere
This commit is contained in:
Douglas Gardner 2013-04-20 20:00:59 +00:00
parent adcd5803b0
commit 9d727a211e
2 changed files with 12 additions and 13 deletions

View File

@ -33,7 +33,7 @@ var pages = function(dbot) {
} }
res.render('project', { res.render('project', {
"configList": "", // what variable do I put here "configList": dbot.modules.project.api.configList(), // what variable do I put here
"name": dbot.config.name, "name": dbot.config.name,
"intro": dbot.t("dbotintro", { "intro": dbot.t("dbotintro", {
"botname": dbot.config.name "botname": dbot.config.name

View File

@ -4,45 +4,44 @@
* the dbot. * the dbot.
*/ */
_ = require('underscore'), _ = require('underscore');
exec = require('child_process').exec;
var project = function(dbot) { var project = function(dbot) {
this.onLoad = function() { this.api = {
var configList = function(){ 'configList' : function(callback){
var list = []; var list = [];
if(_.has(dbot.modules,'dent')){ if(_.has(dbot.modules,'dent')){
configList.push(dbot.t("dent-account", { list.push(dbot.t("dent-account", {
"username": dbot.config.dent.username "username": dbot.config.dent.username
})); }));
} }
if(dbot.config.dent.dentQuotes) { if(dbot.config.dent.dentQuotes) {
configList.push(dbot.t("dent-push")); list.push(dbot.t("dent-push"));
} }
if(_.has(dbot.modules,'link')){ if(_.has(dbot.modules,'link')){
if(dbot.config.link.autoTitle){ if(dbot.config.link.autoTitle){
configList.push(dbot.t("link-autotitle")); list.push(dbot.t("link-autotitle"));
} }
} }
if(_.has(dbot.modules,'quotes')){ if(_.has(dbot.modules,'quotes')){
configList.push(dbot.t("quote-rmlimit", { list.push(dbot.t("quote-rmlimit", {
"limit": dbot.config.quotes.rmLimit "limit": dbot.config.quotes.rmLimit
})); }));
} }
if(_.has(dbot.modules,'report')){ if(_.has(dbot.modules,'report')){
if(dbot.config.report.notifyVoice){ if(dbot.config.report.notifyVoice){
configList.push(dbot.t("report-notifyvoice")); list.push(dbot.t("report-notifyvoice"));
} }
} }
if(_.has(dbot.modules,'web')){ if(_.has(dbot.modules,'web')){
configList.push(dbot.t("web-port", { list.push(dbot.t("web-port", {
"port": dbot.config.web.webPort "port": dbot.config.web.webPort
})); }));
} }
return list; return list;
}.bind(this); }
}.bind(this); };
} }
exports.fetch = function(dbot){ exports.fetch = function(dbot){