diff --git a/clientonly/index.js b/clientonly/index.js index 957ee114..30288d37 100644 --- a/clientonly/index.js +++ b/clientonly/index.js @@ -2,7 +2,7 @@ "use strict"; -// Use seperate scope to prevent global scope pollution +// Use separate scope to prevent global scope pollution (function () { var config = {}; @@ -30,7 +30,7 @@ const request = lib.get(url, (response) => { var configData = ""; - // Gather incomming data + // Gather incoming data response.on("data", function(chunk) { configData += chunk; }); @@ -44,7 +44,7 @@ reject(new Error(`Unable to read config from server (${url} (${error.message}`)); }); }) - }; + } function fail(message, code = 1) { if (message !== undefined && typeof message === "string") { diff --git a/js/app.js b/js/app.js index 4a10ba6d..b75b9829 100644 --- a/js/app.js +++ b/js/app.js @@ -48,7 +48,6 @@ var App = function() { * * argument callback function - The callback function. */ - var loadConfig = function(callback) { console.log("Loading config ..."); var defaults = require(__dirname + "/defaults.js"); @@ -173,7 +172,7 @@ var App = function() { }; /* 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 b. @@ -197,7 +196,7 @@ var App = function() { /* start(callback) * This methods starts the core app. * 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. */ @@ -231,7 +230,6 @@ var App = function() { if (typeof callback === "function") { callback(config); } - }); }); }); diff --git a/js/main.js b/js/main.js index 2330d3ee..b3173306 100644 --- a/js/main.js +++ b/js/main.js @@ -291,7 +291,7 @@ var MM = (function() { var moduleWrapper = document.getElementById(module.identifier); if (moduleWrapper !== null) { 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"; updateWrapperStates(); @@ -311,7 +311,7 @@ var MM = (function() { /* updateWrapperStates() * Checks for all positions if it has visible content. * 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: * 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 * update notification is not visible. */ - 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"]; @@ -478,7 +477,7 @@ var MM = (function() { /* sendNotification(notification, payload, sender) * 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 sender Module - The module that sent the notification. */ diff --git a/js/module.js b/js/module.js index 3e39dd5c..efd84418 100644 --- a/js/module.js +++ b/js/module.js @@ -76,7 +76,7 @@ var Module = Class.extend({ /* getDom() * 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. - * 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. */ @@ -121,7 +121,7 @@ var Module = Class.extend({ /* getTemplate() * 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. * 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() - * 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. */ socket: function () { @@ -438,11 +438,10 @@ Module.create = function (name) { var ModuleClass = Module.extend(clonedDefinition); return new ModuleClass(); - }; /* 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 b. diff --git a/js/translator.js b/js/translator.js index fe9d0ec0..6891802d 100644 --- a/js/translator.js +++ b/js/translator.js @@ -159,6 +159,7 @@ var Translator = (function() { return key; }, + /* load(module, file, isFallback, callback) * Load a translation file (json) and remember the data. *