diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-01-28 19:39:41 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-01-28 19:39:41 +0100 |
commit | 898000a5800d4f319f06937e4a6a2785b694d3b2 (patch) | |
tree | fe221fc83411c4f2507a42a7edd7450754190166 /lib | |
parent | f95beed58bf1d7aa7bedff774ee054d1e35f0fc0 (diff) | |
download | gitbook-898000a5800d4f319f06937e4a6a2785b694d3b2.zip gitbook-898000a5800d4f319f06937e4a6a2785b694d3b2.tar.gz gitbook-898000a5800d4f319f06937e4a6a2785b694d3b2.tar.bz2 |
Fix resources loading in plugins
Diffstat (limited to 'lib')
-rw-r--r-- | lib/index.js | 1 | ||||
-rw-r--r-- | lib/pluginslist.js | 2 | ||||
-rw-r--r-- | lib/utils/logger.js | 5 |
3 files changed, 5 insertions, 3 deletions
diff --git a/lib/index.js b/lib/index.js index 35322fb..26a47d5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -27,6 +27,7 @@ var FORMAT_OPTION = { module.exports = { Book: Book, + LOG_LEVELS: logger.LEVELS, commands: _.flatten([ { diff --git a/lib/pluginslist.js b/lib/pluginslist.js index 35ba8c3..2101c6f 100644 --- a/lib/pluginslist.js +++ b/lib/pluginslist.js @@ -80,7 +80,7 @@ PluginsList.prototype.load = function(plugin, options) { .then(function(plResources) { // Extract js and css _.each(Plugin.RESOURCES, function(resourceType) { - that.resources[resourceType].concat(plResources[resourceType] || []); + that.resources[resourceType] = that.resources[resourceType].concat(plResources[resourceType] || []); }); // Map of html resources by name added by each plugin diff --git a/lib/utils/logger.js b/lib/utils/logger.js index 9ef9ccf..064c196 100644 --- a/lib/utils/logger.js +++ b/lib/utils/logger.js @@ -6,7 +6,8 @@ var LEVELS = { DEBUG: 0, INFO: 1, WARN: 2, - ERROR: 3 + ERROR: 3, + DISABLED: 10 }; var COLORS = { @@ -76,7 +77,7 @@ module.exports = function(_write, logLevel) { return logger.log(level, color.red("ERROR")+"\n"); }; - _.each(LEVELS, function(level, levelKey) { + _.each(_.omit(LEVELS, 'DISABLED'), function(level, levelKey) { levelKey = levelKey.toLowerCase(); logger[levelKey] = _.partial(logger.log, level); |