Config: Add option disabled for modules configuration

This commit is contained in:
Rodrigo Ramírez Norambuena 2016-11-14 14:43:30 -03:00
parent c054b3b0de
commit 62567264f0
4 changed files with 8 additions and 2 deletions

View File

@ -25,6 +25,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Add the abilty to set timezone on the date display in the Clock Module
- Ability to set date format in calendar module
- Possibility to use currentweather for the compliments
- Added option `disabled` for modules.
### Updated
- Modified translations for Frysk.

View File

@ -92,6 +92,7 @@ Module configuration:
| `position` | The location of the module in which the module will be loaded. Possible values are `top_ bar`, `top_left`, `top_center`, `top_right`, `upper_third`, `middle_center`, `lower_third`, `bottom_left`, `bottom_center`, `bottom_right`, `bottom_bar`, `fullscreen_above`, and `fullscreen_below`. This field is optional but most modules require this field to set. Check the documentation of the module for more information. Multiple modules with the same position will be ordered based on the order in the configuration file. |
| `classes` | Additional classes which are passed to the module. The field is optional. |
| `header` | To display a header text above the module, add the header property. This field is optional. |
| `disabled` | Set disabled to `true` to skip creating the module. This field is optional. |
| `config` | An object with the module configuration properties. Check the documentation of the module for more information. This field is optional, unless the module requires extra configuration. |
## Modules

View File

@ -156,7 +156,7 @@ var App = function() {
for (var m in config.modules) {
var module = config.modules[m];
if (modules.indexOf(module.module) === -1) {
if (modules.indexOf(module.module) === -1 && !module.disabled) {
modules.push(module.module);
}
}
@ -184,4 +184,4 @@ var App = function() {
};
};
module.exports = new App();
module.exports = new App();

View File

@ -89,6 +89,10 @@ var Loader = (function() {
moduleFolder = config.paths.modules + "/default/" + module;
}
if (moduleData.disabled === true) {
continue;
}
moduleFiles.push({
index: m,
identifier: "module_" + m + "_" + module,