From 941d5d7cd9b3e94c57306aed0aab2a8d52dc2a55 Mon Sep 17 00:00:00 2001 From: rejas Date: Mon, 20 Apr 2020 22:16:23 +0200 Subject: [PATCH] Fix mixed tabs and whitespace errors --- config/config.js.sample | 33 ++++++++++++------------ js/app.js | 2 +- js/server.js | 2 +- modules/default/calendar/calendar.js | 8 +++--- modules/default/clock/clock.js | 2 +- modules/default/weather/weather.js | 6 ++--- modules/default/weather/weatherobject.js | 4 +-- 7 files changed, 28 insertions(+), 29 deletions(-) diff --git a/config/config.js.sample b/config/config.js.sample index 5d26b320..6c2cd437 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -9,19 +9,19 @@ */ var config = { - address: "localhost", // Address to listen on, can be: - // - "localhost", "127.0.0.1", "::1" to listen on loopback interface - // - another specific IPv4/6 to listen on a specific interface - // - "0.0.0.0", "::" to listen on any interface - // Default, when address config is left out or empty, is "localhost" + address: "localhost", // Address to listen on, can be: + // - "localhost", "127.0.0.1", "::1" to listen on loopback interface + // - another specific IPv4/6 to listen on a specific interface + // - "0.0.0.0", "::" to listen on any interface + // Default, when address config is left out or empty, is "localhost" port: 8080, - basePath: "/", // The URL path where MagicMirror is hosted. If you are using a Reverse proxy - // you must set the sub path here. basePath must end with a / - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses - // or add a specific IPv4 of 192.168.1.5 : - // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"], - // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format : - // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"], + basePath: "/", // The URL path where MagicMirror is hosted. If you are using a Reverse proxy + // you must set the sub path here. basePath must end with a / + ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses + // or add a specific IPv4 of 192.168.1.5 : + // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"], + // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format : + // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"], useHttps: false, // Support HTTPS or not, default "false" will use HTTP httpsPrivateKey: "", // HTTPS private key path, only require when useHttps is true @@ -31,10 +31,10 @@ var config = { timeFormat: 24, units: "metric", // serverOnly: true/false/"local" , - // local for armv6l processors, default - // starts serveronly and then starts chrome browser - // false, default for all NON-armv6l devices - // true, force serveronly mode, because you want to.. no UI on this device + // local for armv6l processors, default + // starts serveronly and then starts chrome browser + // false, default for all NON-armv6l devices + // true, force serveronly mode, because you want to.. no UI on this device modules: [ { @@ -100,7 +100,6 @@ var config = { } }, ] - }; /*************** DO NOT EDIT THE LINE BELOW ***************/ diff --git a/js/app.js b/js/app.js index b7c55ffa..50223ecd 100644 --- a/js/app.js +++ b/js/app.js @@ -61,7 +61,7 @@ var App = function() { // https://forum.magicmirror.builders/topic/1456/test-suite-for-magicmirror/8 var configFilename = path.resolve(global.root_path + "/config/config.js"); if (typeof(global.configuration_file) !== "undefined") { - configFilename = path.resolve(global.configuration_file); + configFilename = path.resolve(global.configuration_file); } try { diff --git a/js/server.js b/js/server.js index 185790af..36bf9770 100644 --- a/js/server.js +++ b/js/server.js @@ -73,7 +73,7 @@ var Server = function(config, callback) { configFile = "config/config.js"; if (typeof(global.configuration_file) !== "undefined") { - configFile = global.configuration_file; + configFile = global.configuration_file; } html = html.replace("#CONFIG_FILE#", configFile); diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index d93f570c..d0986598 100755 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -474,8 +474,8 @@ Module.register("calendar", { } if(this.config.hidePrivate) { if(event.class === "PRIVATE") { - // do not add the current event, skip it - continue; + // do not add the current event, skip it + continue; } } if(this.config.hideOngoing) { @@ -734,8 +734,8 @@ Module.register("calendar", { var regParts = needle.match(/^\/(.+)\/([gim]*)$/); if (regParts) { - // the parsed pattern is a regexp. - needle = new RegExp(regParts[1], regParts[2]); + // the parsed pattern is a regexp. + needle = new RegExp(regParts[1], regParts[2]); } title = title.replace(needle, replacement); diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index 08dcced0..f1f49529 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -198,7 +198,7 @@ Module.register("clock",{ * Create wrappers for ANALOG clock, only if specified in config */ - if (this.config.displayType !== "digital") { + if (this.config.displayType !== "digital") { // If it isn't 'digital', then an 'analog' clock was also requested // Calculate the degree offset for each hand of the clock diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index 868316d9..9b9c435d 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -210,11 +210,11 @@ Module.register("weather",{ if (isNaN(value) || value === 0 || value.toFixed(2) === "0.00") { value = ""; } else { - if (this.config.weatherProvider === "ukmetoffice") { + if (this.config.weatherProvider === "ukmetoffice") { value += "%"; - } else { + } else { value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`; - } + } } } else if (type === "humidity") { value += "%"; diff --git a/modules/default/weather/weatherobject.js b/modules/default/weather/weatherobject.js index ed455537..60311424 100755 --- a/modules/default/weather/weatherobject.js +++ b/modules/default/weather/weatherobject.js @@ -87,8 +87,8 @@ class WeatherObject { } feelsLike() { - if (this.feelsLikeTemp) { - return this.feelsLikeTemp; + if (this.feelsLikeTemp) { + return this.feelsLikeTemp; } const windInMph = (this.windUnits === "imperial") ? this.windSpeed : this.windSpeed * 2.23694; const tempInF = this.tempUnits === "imperial" ? this.temperature : this.temperature * 9 / 5 + 32;