mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 03:39:55 +00:00
Fix typos and some whitespaces
This commit is contained in:
parent
caf56671dc
commit
99b4c43fd5
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// Use seperate scope to prevent global scope pollution
|
// Use separate scope to prevent global scope pollution
|
||||||
(function () {
|
(function () {
|
||||||
var config = {};
|
var config = {};
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
const request = lib.get(url, (response) => {
|
const request = lib.get(url, (response) => {
|
||||||
var configData = "";
|
var configData = "";
|
||||||
|
|
||||||
// Gather incomming data
|
// Gather incoming data
|
||||||
response.on("data", function(chunk) {
|
response.on("data", function(chunk) {
|
||||||
configData += chunk;
|
configData += chunk;
|
||||||
});
|
});
|
||||||
@ -44,7 +44,7 @@
|
|||||||
reject(new Error(`Unable to read config from server (${url} (${error.message}`));
|
reject(new Error(`Unable to read config from server (${url} (${error.message}`));
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
function fail(message, code = 1) {
|
function fail(message, code = 1) {
|
||||||
if (message !== undefined && typeof message === "string") {
|
if (message !== undefined && typeof message === "string") {
|
||||||
|
@ -48,7 +48,6 @@ var App = function() {
|
|||||||
*
|
*
|
||||||
* argument callback function - The callback function.
|
* argument callback function - The callback function.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var loadConfig = function(callback) {
|
var loadConfig = function(callback) {
|
||||||
console.log("Loading config ...");
|
console.log("Loading config ...");
|
||||||
var defaults = require(__dirname + "/defaults.js");
|
var defaults = require(__dirname + "/defaults.js");
|
||||||
@ -173,7 +172,7 @@ var App = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* cmpVersions(a,b)
|
/* cmpVersions(a,b)
|
||||||
* Compare two symantic version numbers and return the difference.
|
* Compare two semantic version numbers and return the difference.
|
||||||
*
|
*
|
||||||
* argument a string - Version number a.
|
* argument a string - Version number a.
|
||||||
* argument a string - Version number b.
|
* argument a string - Version number b.
|
||||||
@ -197,7 +196,7 @@ var App = function() {
|
|||||||
/* start(callback)
|
/* start(callback)
|
||||||
* This methods starts the core app.
|
* This methods starts the core app.
|
||||||
* It loads the config, then it loads all modules.
|
* It loads the config, then it loads all modules.
|
||||||
* When it"s done it executs the callback with the config as argument.
|
* When it's done it executes the callback with the config as argument.
|
||||||
*
|
*
|
||||||
* argument callback function - The callback function.
|
* argument callback function - The callback function.
|
||||||
*/
|
*/
|
||||||
@ -231,7 +230,6 @@ var App = function() {
|
|||||||
if (typeof callback === "function") {
|
if (typeof callback === "function") {
|
||||||
callback(config);
|
callback(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -291,7 +291,7 @@ var MM = (function() {
|
|||||||
var moduleWrapper = document.getElementById(module.identifier);
|
var moduleWrapper = document.getElementById(module.identifier);
|
||||||
if (moduleWrapper !== null) {
|
if (moduleWrapper !== null) {
|
||||||
moduleWrapper.style.transition = "opacity " + speed / 1000 + "s";
|
moduleWrapper.style.transition = "opacity " + speed / 1000 + "s";
|
||||||
// Restore the postition. See hideModule() for more info.
|
// Restore the position. See hideModule() for more info.
|
||||||
moduleWrapper.style.position = "static";
|
moduleWrapper.style.position = "static";
|
||||||
|
|
||||||
updateWrapperStates();
|
updateWrapperStates();
|
||||||
@ -311,7 +311,7 @@ var MM = (function() {
|
|||||||
/* updateWrapperStates()
|
/* updateWrapperStates()
|
||||||
* Checks for all positions if it has visible content.
|
* Checks for all positions if it has visible content.
|
||||||
* If not, if will hide the position to prevent unwanted margins.
|
* If not, if will hide the position to prevent unwanted margins.
|
||||||
* This method schould be called by the show and hide methods.
|
* This method should be called by the show and hide methods.
|
||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* If the top_bar only contains the update notification. And no update is available,
|
* If the top_bar only contains the update notification. And no update is available,
|
||||||
@ -319,7 +319,6 @@ var MM = (function() {
|
|||||||
* an ugly top margin. By using this function, the top bar will be hidden if the
|
* an ugly top margin. By using this function, the top bar will be hidden if the
|
||||||
* update notification is not visible.
|
* update notification is not visible.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var updateWrapperStates = function() {
|
var updateWrapperStates = function() {
|
||||||
var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third", "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", "bottom_bar", "fullscreen_above", "fullscreen_below"];
|
var positions = ["top_bar", "top_left", "top_center", "top_right", "upper_third", "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", "bottom_bar", "fullscreen_above", "fullscreen_below"];
|
||||||
|
|
||||||
@ -478,7 +477,7 @@ var MM = (function() {
|
|||||||
/* sendNotification(notification, payload, sender)
|
/* sendNotification(notification, payload, sender)
|
||||||
* Send a notification to all modules.
|
* Send a notification to all modules.
|
||||||
*
|
*
|
||||||
* argument notification string - The identifier of the noitication.
|
* argument notification string - The identifier of the notification.
|
||||||
* argument payload mixed - The payload of the notification.
|
* argument payload mixed - The payload of the notification.
|
||||||
* argument sender Module - The module that sent the notification.
|
* argument sender Module - The module that sent the notification.
|
||||||
*/
|
*/
|
||||||
|
@ -76,7 +76,7 @@ var Module = Class.extend({
|
|||||||
/* getDom()
|
/* getDom()
|
||||||
* This method generates the dom which needs to be displayed. This method is called by the Magic Mirror core.
|
* This method generates the dom which needs to be displayed. This method is called by the Magic Mirror core.
|
||||||
* This method can to be subclassed if the module wants to display info on the mirror.
|
* This method can to be subclassed if the module wants to display info on the mirror.
|
||||||
* Alternatively, the getTemplete method could be subclassed.
|
* Alternatively, the getTemplate method could be subclassed.
|
||||||
*
|
*
|
||||||
* return DomObject | Promise - The dom or a promise with the dom to display.
|
* return DomObject | Promise - The dom or a promise with the dom to display.
|
||||||
*/
|
*/
|
||||||
@ -121,7 +121,7 @@ var Module = Class.extend({
|
|||||||
|
|
||||||
/* getTemplate()
|
/* getTemplate()
|
||||||
* This method returns the template for the module which is used by the default getDom implementation.
|
* This method returns the template for the module which is used by the default getDom implementation.
|
||||||
* This method needs to be subclassed if the module wants to use a tempate.
|
* This method needs to be subclassed if the module wants to use a template.
|
||||||
* It can either return a template sting, or a template filename.
|
* It can either return a template sting, or a template filename.
|
||||||
* If the string ends with '.html' it's considered a file from within the module's folder.
|
* If the string ends with '.html' it's considered a file from within the module's folder.
|
||||||
*
|
*
|
||||||
@ -233,7 +233,7 @@ var Module = Class.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
/* socket()
|
/* socket()
|
||||||
* Returns a socket object. If it doesn"t exist, it"s created.
|
* Returns a socket object. If it doesn't exist, it"s created.
|
||||||
* It also registers the notification callback.
|
* It also registers the notification callback.
|
||||||
*/
|
*/
|
||||||
socket: function () {
|
socket: function () {
|
||||||
@ -438,11 +438,10 @@ Module.create = function (name) {
|
|||||||
var ModuleClass = Module.extend(clonedDefinition);
|
var ModuleClass = Module.extend(clonedDefinition);
|
||||||
|
|
||||||
return new ModuleClass();
|
return new ModuleClass();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* cmpVersions(a,b)
|
/* cmpVersions(a,b)
|
||||||
* Compare two symantic version numbers and return the difference.
|
* Compare two semantic version numbers and return the difference.
|
||||||
*
|
*
|
||||||
* argument a string - Version number a.
|
* argument a string - Version number a.
|
||||||
* argument a string - Version number b.
|
* argument a string - Version number b.
|
||||||
|
@ -159,6 +159,7 @@ var Translator = (function() {
|
|||||||
|
|
||||||
return key;
|
return key;
|
||||||
},
|
},
|
||||||
|
|
||||||
/* load(module, file, isFallback, callback)
|
/* load(module, file, isFallback, callback)
|
||||||
* Load a translation file (json) and remember the data.
|
* Load a translation file (json) and remember the data.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user