From 96c338859b8a33a27e53ae13b632f4ae1cae6d9c Mon Sep 17 00:00:00 2001 From: Veeck Date: Sun, 11 Jun 2017 11:53:55 +0200 Subject: [PATCH] More lazy sunday cleanups of missing semicolons, unused vars and other small thins --- js/electron.js | 2 +- js/main.js | 4 +--- js/server.js | 2 +- modules/default/calendar/calendar.js | 7 +++---- modules/default/weatherforecast/weatherforecast.js | 10 ++++------ 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/js/electron.js b/js/electron.js index fbbdba94..20b6475f 100644 --- a/js/electron.js +++ b/js/electron.js @@ -30,7 +30,7 @@ function createWindow() { zoomFactor: config.zoom }, backgroundColor: "#000000" - } + }; // DEPRECATED: "kioskmode" backwards compatibility, to be removed // settings these options directly instead provides cleaner interface diff --git a/js/main.js b/js/main.js index 5c8a6737..f499da62 100644 --- a/js/main.js +++ b/js/main.js @@ -165,8 +165,6 @@ var MM = (function() { if( headerWrapper.length > 0 && newHeader) { headerWrapper[0].innerHTML = newHeader; } - - }; /* hideModule(module, speed, callback) @@ -219,7 +217,7 @@ var MM = (function() { // remove lockString if set in options. if (options.lockString) { - var index = module.lockStrings.indexOf(options.lockString) + var index = module.lockStrings.indexOf(options.lockString); if ( index !== -1) { module.lockStrings.splice(index, 1); } diff --git a/js/server.js b/js/server.js index 2fc8dc6f..002c2031 100644 --- a/js/server.js +++ b/js/server.js @@ -43,7 +43,7 @@ var Server = function(config, callback) { app.use("/js", express.static(__dirname)); var directories = ["/config", "/css", "/fonts", "/modules", "/vendor", "/translations", "/tests/configs"]; var directory; - for (i in directories) { + for (var i in directories) { directory = directories[i]; app.use(directory, express.static(path.resolve(global.root_path + directory))); } diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 71efb00f..848d163c 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -174,7 +174,6 @@ Module.register("calendar", { var titleWrapper = document.createElement("td"), repeatingCountTitle = ""; - if (this.config.displayRepeatingCountTitle) { repeatingCountTitle = this.countTitleForUrl(event.url); @@ -421,7 +420,7 @@ Module.register("calendar", { * * argument string string - The string to shorten. * argument maxLength number - The max length of the string. - * argument wrapEvents - Wrap the text after the line has reached maxLength + * argument wrapEvents - Wrap the text after the line has reached maxLength * * return string - The shortened string. */ @@ -496,9 +495,9 @@ Module.register("calendar", { */ broadcastEvents: function () { var eventList = []; - for (url in this.calendarData) { + for (var url in this.calendarData) { var calendar = this.calendarData[url]; - for (e in calendar) { + for (var e in calendar) { var event = cloneObject(calendar[e]); delete event.url; eventList.push(event); diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 38661e74..aab3aa15 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -63,7 +63,7 @@ Module.register("weatherforecast",{ firstEvent: false, // create a variable to hold the location name based on the API result. - fetchedLocatioName: "", + fetchedLocationName: "", // Define required scripts. getScripts: function() { @@ -175,7 +175,6 @@ Module.register("weatherforecast",{ row.style.opacity = 1 - (1 / steps * currentStep); } } - } return table; @@ -184,7 +183,7 @@ Module.register("weatherforecast",{ // Override getHeader method. getHeader: function() { if (this.config.appendLocationNameToHeader) { - return this.data.header + " " + this.fetchedLocatioName; + return this.data.header + " " + this.fetchedLocationName; } return this.data.header; @@ -200,10 +199,9 @@ Module.register("weatherforecast",{ if (notification === "CALENDAR_EVENTS") { var senderClasses = sender.data.classes.toLowerCase().split(" "); if (senderClasses.indexOf(this.config.calendarClass.toLowerCase()) !== -1) { - var lastEvent = this.firstEvent; this.firstEvent = false; - for (e in payload) { + for (var e in payload) { var event = payload[e]; if (event.location || event.geo) { this.firstEvent = event; @@ -291,7 +289,7 @@ Module.register("weatherforecast",{ * argument data object - Weather information received form openweather.org. */ processWeather: function(data) { - this.fetchedLocatioName = data.city.name + ", " + data.city.country; + this.fetchedLocationName = data.city.name + ", " + data.city.country; this.forecast = []; for (var i = 0, count = data.list.length; i < count; i++) {