From ab14fc8440f43760f61458f39c0b7a17945962d6 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sat, 23 Apr 2016 17:20:58 +0200 Subject: [PATCH 01/36] fix #223 --- modules/default/calendar/vendor/ical.js/node-ical.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/default/calendar/vendor/ical.js/node-ical.js b/modules/default/calendar/vendor/ical.js/node-ical.js index 6ce04892..294908ea 100644 --- a/modules/default/calendar/vendor/ical.js/node-ical.js +++ b/modules/default/calendar/vendor/ical.js/node-ical.js @@ -28,6 +28,14 @@ ical.objectHandlers['END'] = function(val, params, curr, stack){ if (curr.rrule) { var rule = curr.rrule.replace('RRULE:', ''); if (rule.indexOf('DTSTART') === -1) { + + if (curr.start.length === 8) { + var comps = /^(\d{4})(\d{2})(\d{2})$/.exec(curr.start); + if (comps) { + curr.start = new Date (comps[1], comps[2], comps[3]); + } + } + rule += ';DTSTART=' + curr.start.toISOString().replace(/[-:]/g, ''); rule = rule.replace(/\.[0-9]{3}/, ''); } From 0f2c19f40fbcc43f685fbab4bf1f08cebecd49fe Mon Sep 17 00:00:00 2001 From: djsunrise19 Date: Sat, 23 Apr 2016 17:36:59 +0200 Subject: [PATCH 02/36] Update de.json "Noch" is grammatically better than "Endet in" for running events. --- modules/default/calendar/translations/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/calendar/translations/de.json b/modules/default/calendar/translations/de.json index 53530085..2e5de572 100644 --- a/modules/default/calendar/translations/de.json +++ b/modules/default/calendar/translations/de.json @@ -1,7 +1,7 @@ { "TODAY": "Heute" , "TOMORROW": "Morgen" - , "RUNNING": "Endet in" + , "RUNNING": "Noch" , "LOADING": "Lade Termine …" , "EMPTY": "Keine Termine." } From bd9557b11eda2455ae3e7b6dc129736a8a15e1bb Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sat, 23 Apr 2016 17:40:44 +0200 Subject: [PATCH 03/36] Prevent display of events in the past. #162 --- modules/default/calendar/calendar.js | 5 +++-- modules/default/calendar/calendarfetcher.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index c1ffc492..5e315586 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -124,7 +124,7 @@ Module.register("calendar",{ if (event.fullDayEvent) { if (event.today) { timeWrapper.innerHTML = this.translate("TODAY"); - } else if (event.startDate - now < 24 * 60 * 60 * 1000) { + } else if (event.startDate - now < 24 * 60 * 60 * 1000 && event.startDate - now > 0) { timeWrapper.innerHTML = this.translate("TOMORROW"); } else { timeWrapper.innerHTML = moment(event.startDate,"x").fromNow(); @@ -141,7 +141,8 @@ Module.register("calendar",{ timeWrapper.innerHTML = this.translate("RUNNING") + ' ' + moment(event.endDate,"x").fromNow(true); } } - // timeWrapper.innerHTML = moment(event.startDate,'x').format('lll'); + //timeWrapper.innerHTML += ' - '+ moment(event.startDate,'x').format('lll'); + //console.log(event); timeWrapper.className = "time light"; eventWrapper.appendChild(timeWrapper); diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index 771ee5b3..ac558e2f 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -99,7 +99,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe continue; } - if (fullDayEvent && endDate < today) { + if (fullDayEvent && endDate <= today) { //console.log("It's a fullday event, and it is before today. So skip: " + title); continue; } From 66e71282a0f1dba3eb38ba34baf484d3b4de4094 Mon Sep 17 00:00:00 2001 From: djsunrise19 Date: Sat, 23 Apr 2016 20:26:05 +0200 Subject: [PATCH 04/36] Update README.md Not necessary anymore, because we made that with "de.json" in calendar --- modules/default/calendar/README.md | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index df0bb0d2..cfe4e2b8 100644 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -112,36 +112,6 @@ The following properties can be configured: - - loadingText - Text to display while loading item.
-
Default value: 'Loading events …' - - - - emptyCalendarText - Text to display when there are no upcoming events.
-
Default value: 'No upcoming events.' - - - - todayText - Text to display when a fullday event is planned for today.
-
Default value: 'Today' - - - - tomorrowText - Text to display when a fullday event is planned for tomorrow.
-
Default value: 'Tomorrow' - - - - runningText - Text to display when an event is still running.
-
Default value: 'Ends in' - - From 39602e0a987c2f47a51e38be749918c8d62749c6 Mon Sep 17 00:00:00 2001 From: Paul-Vincent Roll Date: Sun, 24 Apr 2016 13:53:21 +0200 Subject: [PATCH 05/36] Update custom.css --- css/custom.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css/custom.css b/css/custom.css index 5871da5c..7d0d0681 100644 --- a/css/custom.css +++ b/css/custom.css @@ -6,9 +6,9 @@ * MIT Licensed. * * * * Add any custom CSS below. * - * Changes to this files will not be ignored by GIT. * + * Changes to this files will be ignored by GIT. * *****************************************************/ body { - } \ No newline at end of file + } From 84e02c828f33024294e292afd66c1b0e0c17b459 Mon Sep 17 00:00:00 2001 From: Paul-Vincent Roll Date: Sun, 24 Apr 2016 14:18:41 +0200 Subject: [PATCH 06/36] Wheezy is supported now isn't it? --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d79c219..588c61bd 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ MagicMirror² focuses on a modular plugin system and uses [Electron](http://elec ## Usage #### Raspberry Pi Support -Electron, the app wrapper around MagicMirror², only supports the Raspberry Pi 2 & 3. The Raspberry Pi 1 is currently **not** supported. If you want to run this on a Raspberry Pi 1, use the [server only](#server-only) feature and setup a fullscreen browser yourself. Note the only Jessie is currently supported. If you want to use Wheezy, check out [this issue](https://github.com/MichMich/MagicMirror/issues/188). +Electron, the app wrapper around MagicMirror², only supports the Raspberry Pi 2 & 3. The Raspberry Pi 1 is currently **not** supported. If you want to run this on a Raspberry Pi 1, use the [server only](#server-only) feature and setup a fullscreen browser yourself. #### Automatic Installer (Raspberry Pi Only!) @@ -39,7 +39,7 @@ curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/v2-beta/installe 1. Download and install the latest Node.js version. 2. Clone the repository and check out the beta branch: `git clone -b v2-beta https://github.com/MichMich/MagicMirror` 3. Enter the repository: `cd ~/MagicMirror` -4. Install and run the app: `npm install && npm start` (You may have to restart your terminal before this works!) +4. Install and run the app: `npm install && npm start` **Important:** `npm start` does **not** work via SSH, use `DISPLAY=:0 nohup npm start &` instead. This starts the mirror on the remote display. From 0890fd521e51fa0ad3262605a5aa15c9302535bf Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 15:23:07 -0500 Subject: [PATCH 07/36] Added units variable --- config/config.js.sample | 1 + 1 file changed, 1 insertion(+) diff --git a/config/config.js.sample b/config/config.js.sample index 99ab2ead..0b5f45d4 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -9,6 +9,7 @@ var config = { language: 'en', timeFormat: 24, + units: 'metric', modules: [ { From a91a2c2609afd4c60ff4b5c22a54e35cc9e12f29 Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 15:24:44 -0500 Subject: [PATCH 08/36] Units configurable from Config.js --- modules/default/weatherforecast/weatherforecast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index ff7c4190..c1e79828 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -13,7 +13,7 @@ Module.register("weatherforecast",{ defaults: { location: "", appid: "", - units: "metric", + units: config.units, updateInterval: 10 * 60 * 1000, // every 10 minutes animationSpeed: 1000, timeFormat: config.timeFormat, From 2007f5ece49a7a50392fac239d42d7a9439f744f Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 15:25:35 -0500 Subject: [PATCH 09/36] Units from config.js --- modules/default/currentweather/currentweather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 3a7520ce..6c6aa100 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -13,7 +13,7 @@ Module.register("currentweather",{ defaults: { location: "", appid: "", - units: "metric", + units: config.units, updateInterval: 10 * 60 * 1000, // every 10 minutes animationSpeed: 1000, timeFormat: config.timeFormat, From 13a01d76f7be7d391faa5477a54546491da0b29a Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 15:33:22 -0500 Subject: [PATCH 10/36] Added default units variable Added a default units variable if users do not configure in config.js. --- js/defaults.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/defaults.js b/js/defaults.js index e3dc3d2b..28cc2613 100644 --- a/js/defaults.js +++ b/js/defaults.js @@ -12,7 +12,8 @@ var defaults = { language: "en", timeFormat: 24, - + units: "metric", + modules: [ { module: "helloworld", From af827b5645b0dce5ad92e888457d7bf0a226b9c2 Mon Sep 17 00:00:00 2001 From: Paul-Vincent Roll Date: Sun, 24 Apr 2016 22:33:30 +0200 Subject: [PATCH 11/36] Added getTranslations() to the documentation --- modules/README.md | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/modules/README.md b/modules/README.md index 965051b0..a622b1e9 100644 --- a/modules/README.md +++ b/modules/README.md @@ -97,7 +97,7 @@ start: function() { ####`getScripts()` **Should return: Array** -The getScripts method is called to request any additional scripts that need to be loaded. This method should therefor return an array with strings. If you want to return a full path to a file in the module folder, use the `this.file('filename.js')` method. In all cases the loader will only load a file once. It even checks if the file is available in the default vendor folder. +The getScripts method is called to request any additional scripts that need to be loaded. This method should therefore return an array with strings. If you want to return a full path to a file in the module folder, use the `this.file('filename.js')` method. In all cases the loader will only load a file once. It even checks if the file is available in the default vendor folder. **Example:** ````javascript @@ -117,7 +117,7 @@ getScripts: function() { ####`getStyles()` **Should return: Array** -The getStyles method is called to request any additional scripts that need to be loaded. This method should therefor return an array with strings. If you want to return a full path to a file in the module folder, use the `this.file('filename.css')` method. In all cases the loader will only load a file once. It even checks if the file is available in the default vendor folder. +The getStyles method is called to request any additional stylesheets that need to be loaded. This method should therefore return an array with strings. If you want to return a full path to a file in the module folder, use the `this.file('filename.css')` method. In all cases the loader will only load a file once. It even checks if the file is available in the default vendor folder. **Example:** ````javascript @@ -133,6 +133,22 @@ getStyles: function() { ```` **Note:** If a file can not be loaded, the boot up of the mirror will stall. Therefore it's advised not to use any external urls. +####`getTranslations()` +**Should return: Dictionary** + +The getTranslations method is called to request translation files that need to be loaded. This method should therefore return a dictionary with the files to load, identified by the country's short name. + +**Example:** +````javascript +getTranslations: function() { + return { + en: "translations/en.json", + de: "translations/de.json" + } +} + +```` + ####`getDom()` **Should return:** Dom Object @@ -448,6 +464,21 @@ Module.register("modulename",{ //... }); ```` +## MagicMirror Translation + +The Magic Mirror contains a convenience wrapper for `l18n`. You can use this to automatically serve different translations for your modules based on the user's `language` configuration. + +**Example:** +````javascript +this.translate("INFO") //Will return a translated string for the identifier INFO +```` + +**Example json file:** +````javascript +{ + "INFO": "Really important information!" +} +```` ## MagicMirror Logger @@ -458,4 +489,4 @@ The Magic Mirror contains a convenience wrapper for logging. Currently, this log Log.info('error'); Log.log('log'); Log.error('info'); -``` \ No newline at end of file +```` From 838196073750564233e1ac3e76b160f521717a77 Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 15:38:50 -0500 Subject: [PATCH 12/36] Added "units" configuration instructions Added instructions for configuring the units variable in config.js. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 588c61bd..4c935d31 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ The following properties can be configured: | `port` | The port on which the MagicMirror² server will run on. The default value is `8080`. | | `language` | The language of the interface. (Note: Not all elements will be localized.) Possible values are `en`, `nl`, `ru`, `fr`, etc., but the default value is `en`. | | `timeFormat` | The form of time notation that will be used. Possible values are `12` or `24`. The default is `24`. | +| `units` | The units that will be used in the default weather modules. Possible values are `metric` or `imperial`. The default is `metric`. | | `modules` | An array of active modules. **The array must contain objects. See the next table below for more information.** | Module configuration: From a897772df27c2c0e5f8af94423b70d525eb4dfbb Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 16:00:13 -0500 Subject: [PATCH 13/36] Units now configured by config.js --- modules/default/currentweather/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index 3c818eee..3f1f2af4 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -50,9 +50,9 @@ The following properties can be configured: units - What units to use?
-
Possible values: default = Kelvin, metric = Celsius, imperial =Fahrenheit -
Default value: metric + What units to use. Specified by config.js
+
Possible values: config.units = Specified by config.js, default = Kelvin, metric = Celsius, imperial =Fahrenheit +
Default value: config.units From 3d0de834e08f2c7b196b2036b4071a3b3de5d0a2 Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 16:01:27 -0500 Subject: [PATCH 14/36] Units now configured by config.js --- modules/default/weatherforecast/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/default/weatherforecast/README.md b/modules/default/weatherforecast/README.md index bea80514..c5be33ce 100644 --- a/modules/default/weatherforecast/README.md +++ b/modules/default/weatherforecast/README.md @@ -50,9 +50,9 @@ The following properties can be configured: units - What units to use?
-
Possible values: default = Kelvin, metric = Celsius, imperial =Fahrenheit -
Default value: metric + What units to use. Specified by config.js
+
Possible values: config.units = Specified by config.js, default = Kelvin, metric = Celsius, imperial =Fahrenheit +
Default value: config.units From fd3676067a6a385e6da500fdc8f0ea5872fca9e3 Mon Sep 17 00:00:00 2001 From: Paul-Vincent Roll Date: Sun, 24 Apr 2016 23:06:49 +0200 Subject: [PATCH 15/36] Added translation fallback note to documentation --- modules/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/README.md b/modules/README.md index a622b1e9..9d6be2cd 100644 --- a/modules/README.md +++ b/modules/README.md @@ -480,6 +480,8 @@ this.translate("INFO") //Will return a translated string for the identifier INFO } ```` +**Note:** Currently there is no fallback if a translation identifier does not exist in one language. Right now you always have to add all identifier to all your translations even if they are not translated yet (see [#191](https://github.com/MichMich/MagicMirror/issues/191)). + ## MagicMirror Logger The Magic Mirror contains a convenience wrapper for logging. Currently, this logger is a simple proxy to the original `console.log` methods. But it might get additional features in the future. The Loggers is currently only available in the core module file (not in the node_helper). From 1ab00ac804530eec3ba91608f207ea8af03c35a2 Mon Sep 17 00:00:00 2001 From: Paul-Vincent Roll Date: Sun, 24 Apr 2016 23:14:24 +0200 Subject: [PATCH 16/36] Moved this.translate() to the instance methods --- modules/README.md | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/modules/README.md b/modules/README.md index 9d6be2cd..b2caa2af 100644 --- a/modules/README.md +++ b/modules/README.md @@ -277,6 +277,25 @@ To show a module, you can call the `show(speed, callback)` method. You can call **Note 2:** If the show animation is hijacked (an other method calls show on the same module), the callback will not be called.
**Note 3:** If the dom is not yet created, the show method won't work. Wait for the `DOM_OBJECTS_CREATED` [notification](#notificationreceivednotification-payload-sender). +####`this.translate(identifier)` +***identifier* String** - Identifier of the string that should be translated. + +The Magic Mirror contains a convenience wrapper for `l18n`. You can use this to automatically serve different translations for your modules based on the user's `language` configuration. + +**Example:** +````javascript +this.translate("INFO") //Will return a translated string for the identifier INFO +```` + +**Example json file:** +````javascript +{ + "INFO": "Really important information!" +} +```` + +**Note:** Currently there is no fallback if a translation identifier does not exist in one language. Right now you always have to add all identifier to all your translations even if they are not translated yet (see [#191](https://github.com/MichMich/MagicMirror/issues/191)). + ## The Node Helper: node_helper.js @@ -464,23 +483,6 @@ Module.register("modulename",{ //... }); ```` -## MagicMirror Translation - -The Magic Mirror contains a convenience wrapper for `l18n`. You can use this to automatically serve different translations for your modules based on the user's `language` configuration. - -**Example:** -````javascript -this.translate("INFO") //Will return a translated string for the identifier INFO -```` - -**Example json file:** -````javascript -{ - "INFO": "Really important information!" -} -```` - -**Note:** Currently there is no fallback if a translation identifier does not exist in one language. Right now you always have to add all identifier to all your translations even if they are not translated yet (see [#191](https://github.com/MichMich/MagicMirror/issues/191)). ## MagicMirror Logger From 836148a3355c509dd43e503dd3dc30659d945c44 Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 16:15:05 -0500 Subject: [PATCH 17/36] Update currentweather.js --- .../default/currentweather/currentweather.js | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 6c6aa100..86475016 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -19,6 +19,7 @@ Module.register("currentweather",{ timeFormat: config.timeFormat, showPeriod: true, showPeriodUpper: false, + showDirection: false, lang: config.language, initialLoadDelay: 0, // 0 seconds delay @@ -68,6 +69,7 @@ Module.register("currentweather",{ moment.locale(config.language); this.windSpeed = null; + this.windDirection = null; this.sunriseSunsetTime = null; this.sunriseSunsetIcon = null; this.temperature = null; @@ -112,6 +114,10 @@ Module.register("currentweather",{ var windSpeed = document.createElement("span"); windSpeed.innerHTML = " " + this.windSpeed; small.appendChild(windSpeed); + + var windDirection = document.createElement("span"); + windDirection.innerHTML = " " + this.windDirection; + small.appendChild(windDirection); var spacer = document.createElement("span"); spacer.innerHTML = " "; @@ -198,6 +204,9 @@ Module.register("currentweather",{ processWeather: function(data) { this.temperature = this.roundValue(data.main.temp); this.windSpeed = this.ms2Beaufort(this.roundValue(data.wind.speed)); + if (this.showDirection) { + this.windDirection = this.deg2Cardinal(data.wind.deg); + } else {} this.weatherType = this.config.iconTable[data.weather[0].icon]; var now = new Date(); @@ -274,6 +283,44 @@ Module.register("currentweather",{ * * return number - Rounded Temperature. */ + + deg2Card: function(deg) { + if (deg>11.25 && deg<33.75){ + return "NNE"; + }else if (deg>33.75 && deg<56.25){ + return "ENE"; + }else if (deg>56.25 && deg<78.75){ + return "E"; + }else if (deg>78.75 && deg<101.25){ + return "ESE"; + }else if (deg>101.25 && deg<123.75){ + return "ESE"; + }else if (deg>123.75 && deg<146.25){ + return "SE"; + }else if (deg>146.25 && deg<168.75){ + return "SSE"; + }else if (deg>168.75 && deg<191.25){ + return "S"; + }else if (deg>191.25 && deg<213.75){ + return "SSW"; + }else if (deg>213.75 && deg<236.25){ + return "SW"; + }else if (deg>236.25 && deg<258.75){ + return "WSW"; + }else if (deg>258.75 && deg<281.25){ + return "W"; + }else if (deg>281.25 && deg<303.75){ + return "WNW"; + }else if (deg>303.75 && deg<326.25){ + return "NW"; + }else if (deg>326.25 && deg<348.75){ + return "NNW"; + }else{ + return "N"; + } + } + + roundValue: function(temperature) { return parseFloat(temperature).toFixed(1); } From 77cb8530e5cae8c1a207ff94f502a4943785c24f Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 16:55:39 -0500 Subject: [PATCH 18/36] Update currentweather.js --- modules/default/currentweather/currentweather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 86475016..7c116672 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -284,7 +284,7 @@ Module.register("currentweather",{ * return number - Rounded Temperature. */ - deg2Card: function(deg) { + deg2Cardinal: function(deg) { if (deg>11.25 && deg<33.75){ return "NNE"; }else if (deg>33.75 && deg<56.25){ From 8d29bd5c322aa0fde0b0825c90733129bfb3c08e Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 17:40:18 -0500 Subject: [PATCH 19/36] Update currentweather.js --- modules/default/currentweather/currentweather.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 7c116672..ea9f7fa2 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -19,7 +19,7 @@ Module.register("currentweather",{ timeFormat: config.timeFormat, showPeriod: true, showPeriodUpper: false, - showDirection: false, + showDirection: true, lang: config.language, initialLoadDelay: 0, // 0 seconds delay @@ -110,15 +110,17 @@ Module.register("currentweather",{ var windIcon = document.createElement("span"); windIcon.className = "wi wi-strong-wind dimmed"; small.appendChild(windIcon); - + var windSpeed = document.createElement("span"); windSpeed.innerHTML = " " + this.windSpeed; small.appendChild(windSpeed); - var windDirection = document.createElement("span"); - windDirection.innerHTML = " " + this.windDirection; - small.appendChild(windDirection); - + if (this.showDirection) { + var windDirection = document.createElement("span"); + windDirection.innerHTML = " " + this.windDirection; + small.appendChild(windDirection); + } + var spacer = document.createElement("span"); spacer.innerHTML = " "; small.appendChild(spacer); @@ -318,7 +320,7 @@ Module.register("currentweather",{ }else{ return "N"; } - } + }, roundValue: function(temperature) { From 2aae0528b55bc85771a72a4fe2e49fcc5a21bd84 Mon Sep 17 00:00:00 2001 From: "Warwolf8.9" Date: Sun, 24 Apr 2016 18:06:12 -0500 Subject: [PATCH 20/36] Added wind direction in Current Weather module --- modules/default/currentweather/currentweather.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index ea9f7fa2..d40593a8 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -19,7 +19,7 @@ Module.register("currentweather",{ timeFormat: config.timeFormat, showPeriod: true, showPeriodUpper: false, - showDirection: true, + showDirection: false, lang: config.language, initialLoadDelay: 0, // 0 seconds delay @@ -114,13 +114,12 @@ Module.register("currentweather",{ var windSpeed = document.createElement("span"); windSpeed.innerHTML = " " + this.windSpeed; small.appendChild(windSpeed); - - if (this.showDirection) { + + if (this.config.showDirection) { var windDirection = document.createElement("span"); windDirection.innerHTML = " " + this.windDirection; small.appendChild(windDirection); } - var spacer = document.createElement("span"); spacer.innerHTML = " "; small.appendChild(spacer); @@ -206,9 +205,7 @@ Module.register("currentweather",{ processWeather: function(data) { this.temperature = this.roundValue(data.main.temp); this.windSpeed = this.ms2Beaufort(this.roundValue(data.wind.speed)); - if (this.showDirection) { - this.windDirection = this.deg2Cardinal(data.wind.deg); - } else {} + this.windDirection = this.deg2Cardinal(data.wind.deg); this.weatherType = this.config.iconTable[data.weather[0].icon]; var now = new Date(); From db9e615e4d9970111da574f06713b5584833a059 Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 18:30:54 -0500 Subject: [PATCH 21/36] Update README.md --- modules/default/currentweather/README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index 3f1f2af4..2b3a5300 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -14,7 +14,8 @@ modules: [ config: { // See 'Configuration options' for more information. location: 'Amsterdam,Netherlands', - appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key. + appid: 'abcde12345abcde12345abcde12345ab', //openweathermap.org API key. + showWindDirection: true } } ] @@ -90,6 +91,13 @@ The following properties can be configured:
Default value: false + + showWindDirection + Show the wind direction next to the wind speed.
+
Possible values: true or false +
Default value: false + + lang The language of the days.
From 5a5f5318d1bd5ef6e8649622ff53cb4aff72c87f Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 18:31:46 -0500 Subject: [PATCH 22/36] Update README.md --- modules/default/currentweather/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index 2b3a5300..585a0ae4 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -15,7 +15,7 @@ modules: [ // See 'Configuration options' for more information. location: 'Amsterdam,Netherlands', appid: 'abcde12345abcde12345abcde12345ab', //openweathermap.org API key. - showWindDirection: true + showWindDirection: true, } } ] From 5f8ef64ca439ac6e8e152ea1d8313c4e99535eab Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Sun, 24 Apr 2016 18:34:39 -0500 Subject: [PATCH 23/36] showDirection to showWindDirection --- modules/default/currentweather/currentweather.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index d40593a8..4ab04c4f 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -19,7 +19,7 @@ Module.register("currentweather",{ timeFormat: config.timeFormat, showPeriod: true, showPeriodUpper: false, - showDirection: false, + showWindDirection: false, lang: config.language, initialLoadDelay: 0, // 0 seconds delay @@ -115,7 +115,7 @@ Module.register("currentweather",{ windSpeed.innerHTML = " " + this.windSpeed; small.appendChild(windSpeed); - if (this.config.showDirection) { + if (this.config.showWindDirection) { var windDirection = document.createElement("span"); windDirection.innerHTML = " " + this.windDirection; small.appendChild(windDirection); From 74c96d8521d4ad80c2e6ad3842c9bb445a116e9b Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Mon, 25 Apr 2016 06:23:55 -0500 Subject: [PATCH 24/36] Removed showWindDirection --- modules/default/currentweather/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index 585a0ae4..eb592001 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -15,7 +15,6 @@ modules: [ // See 'Configuration options' for more information. location: 'Amsterdam,Netherlands', appid: 'abcde12345abcde12345abcde12345ab', //openweathermap.org API key. - showWindDirection: true, } } ] From 8562bdfc4a13ac36e27dadec5c933d1200a97bc1 Mon Sep 17 00:00:00 2001 From: roxasvalor Date: Mon, 25 Apr 2016 06:27:26 -0500 Subject: [PATCH 25/36] Removed trailing comma --- modules/default/currentweather/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/currentweather/README.md b/modules/default/currentweather/README.md index eb592001..2ce54aac 100644 --- a/modules/default/currentweather/README.md +++ b/modules/default/currentweather/README.md @@ -14,7 +14,7 @@ modules: [ config: { // See 'Configuration options' for more information. location: 'Amsterdam,Netherlands', - appid: 'abcde12345abcde12345abcde12345ab', //openweathermap.org API key. + appid: 'abcde12345abcde12345abcde12345ab' //openweathermap.org API key. } } ] From f12125f2a4cc46ef7beeef44c3f1a864d46efe11 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 27 Apr 2016 09:37:44 +0200 Subject: [PATCH 26/36] Update to node 6.0.0 --- installers/raspberry.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installers/raspberry.sh b/installers/raspberry.sh index 4f1d2e2c..3c1687c0 100644 --- a/installers/raspberry.sh +++ b/installers/raspberry.sh @@ -18,7 +18,7 @@ echo "Installing helper tools ..." sudo apt-get install curl wget build-essential unzip || exit ARM=$(uname -m) # Determine which Pi is running. -NODE_LATEST="v5.11.0" # Set the latest version here. +NODE_LATEST="v6.0.0" # Set the latest version here. DOWNLOAD_URL="https://nodejs.org/dist/latest/node-$NODE_LATEST-linux-$ARM.tar.gz" # Construct the download URL. echo "Installing Latest Node.js ..." From 08bc644de1b80ea8ca821125fc753da4b210581d Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 27 Apr 2016 09:42:12 +0200 Subject: [PATCH 27/36] Fix #245 --- .jscsrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.jscsrc b/.jscsrc index bc1fcea6..4638b44f 100644 --- a/.jscsrc +++ b/.jscsrc @@ -4,5 +4,6 @@ "validateQuoteMarks": "\"", "maximumLineLength": 250, "requireCurlyBraces": [], - "requireCamelCaseOrUpperCaseIdentifiers": false + "requireCamelCaseOrUpperCaseIdentifiers": false, + "excludeFiles": [".jscsrc"], } \ No newline at end of file From 7cbc8a0edee8fc320323439c083580e5878b00fd Mon Sep 17 00:00:00 2001 From: djsunrise19 Date: Wed, 27 Apr 2016 10:45:15 +0200 Subject: [PATCH 28/36] Update de.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cause ´morgen um ***` and other words are written lowercased, it makes sense to write ´noch` lowercased too. Days und whole day events have to be as they are. --- modules/default/calendar/translations/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/calendar/translations/de.json b/modules/default/calendar/translations/de.json index 2e5de572..cea5588d 100644 --- a/modules/default/calendar/translations/de.json +++ b/modules/default/calendar/translations/de.json @@ -1,7 +1,7 @@ { "TODAY": "Heute" , "TOMORROW": "Morgen" - , "RUNNING": "Noch" + , "RUNNING": "noch" , "LOADING": "Lade Termine …" , "EMPTY": "Keine Termine." } From ab2c91ba2023b33c93e40a4f8c843749e8c94c07 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 27 Apr 2016 14:37:11 +0200 Subject: [PATCH 29/36] Add slack channel (experimental) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4c935d31..e461cf90 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ Node Version License Known Vulnerabilities +

**MagicMirror²** is an open source modular smart mirror platform. With a growing list of installable modules, the **MagicMirror²** allows you to convert your hallway or bathroom mirror into your personal assistant. **MagicMirror²** is built by the creator of [the original MagicMirror](http://michaelteeuw.nl/tagged/magicmirror) with the incredible help of a [growing community of contributors](https://github.com/MichMich/MagicMirror/graphs/contributors). From f1841168245ecb904110240ca16acfc415b39786 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Wed, 27 Apr 2016 14:39:21 +0200 Subject: [PATCH 30/36] Remove slack. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index e461cf90..4c935d31 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ Node Version License Known Vulnerabilities -

**MagicMirror²** is an open source modular smart mirror platform. With a growing list of installable modules, the **MagicMirror²** allows you to convert your hallway or bathroom mirror into your personal assistant. **MagicMirror²** is built by the creator of [the original MagicMirror](http://michaelteeuw.nl/tagged/magicmirror) with the incredible help of a [growing community of contributors](https://github.com/MichMich/MagicMirror/graphs/contributors). From 8b792c5fe0d25fce66cdb4047703903c1d1bbd69 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Fri, 29 Apr 2016 11:24:14 -0400 Subject: [PATCH 31/36] clockBold's Re-Incarnation: Part I --- modules/default/clock/clock.js | 35 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/modules/default/clock/clock.js b/modules/default/clock/clock.js index 611170f4..7f76324f 100644 --- a/modules/default/clock/clock.js +++ b/modules/default/clock/clock.js @@ -1,41 +1,34 @@ /* global Log, Module, moment, config */ - /* Magic Mirror * Module: Clock * * By Michael Teeuw http://michaelteeuw.nl * MIT Licensed. */ - Module.register("clock",{ - // Module config defaults. defaults: { timeFormat: config.timeFormat, displaySeconds: true, showPeriod: true, showPeriodUpper: false, + clockBold: false }, - // Define required scripts. getScripts: function() { return ["moment.js"]; }, - // Define start sequence. start: function() { Log.info("Starting module: " + this.name); - // Schedule update interval. var self = this; setInterval(function() { self.updateDom(); }, 1000); - // Set locale. moment.locale(config.language); }, - // Override dom generator. getDom: function() { // Create wrappers. @@ -44,35 +37,36 @@ Module.register("clock",{ var timeWrapper = document.createElement("div"); var secondsWrapper = document.createElement("sup"); var periodWrapper = document.createElement("span"); - // Style Wrappers dateWrapper.className = "date normal medium"; timeWrapper.className = "time bright large light"; secondsWrapper.className = "dimmed"; - // Set content of wrappers. - // The moment().format('h') method has a bug on the Raspberry Pi. + // The moment().format("h") method has a bug on the Raspberry Pi. // So we need to generate the timestring manually. // See issue: https://github.com/MichMich/MagicMirror/issues/181 - var timeString = moment().format('HH:mm'); + if (this.config.clockBold === true) { + var timeString = moment().format("HH[]mm[]"); + } else { + var timeString = moment().format("HH:mm"); + } if (this.config.timeFormat !== 24) { var now = new Date(); var hours = now.getHours() % 12 || 12; - timeString = hours + moment().format(':mm'); + if (this.config.clockBold === true) { + timeString = hours + moment().format("[]mm[]"); + } else { + timeString = hours + moment().format(":mm"); + } } - dateWrapper.innerHTML = moment().format("dddd, LL"); timeWrapper.innerHTML = timeString; secondsWrapper.innerHTML = moment().format("ss"); - - if (this.config.showPeriodUpper) { - periodWrapper.innerHTML = moment().format('A'); + periodWrapper.innerHTML = moment().format("A"); } else { - periodWrapper.innerHTML = moment().format('a'); + periodWrapper.innerHTML = moment().format("a"); } - - // Combine wrappers. wrapper.appendChild(dateWrapper); wrapper.appendChild(timeWrapper); @@ -82,7 +76,6 @@ Module.register("clock",{ if (this.config.showPeriod && this.config.timeFormat !== 24) { timeWrapper.appendChild(periodWrapper); } - // Return the wrapper to the dom. return wrapper; } From ab3f585a2baffef30cbeec3364a85b02b86803e5 Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Fri, 29 Apr 2016 11:25:05 -0400 Subject: [PATCH 32/36] clockBold's Re-Incarnation: Part II --- modules/default/clock/README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/default/clock/README.md b/modules/default/clock/README.md index 522b1ad2..8808825c 100644 --- a/modules/default/clock/README.md +++ b/modules/default/clock/README.md @@ -47,14 +47,21 @@ The following properties can be configured: showPeriod - Show the period (am/pm) with 12 hour format
+ Show the period (am/pm) with 12 hour format.

Possible values: true or false
Default value: true showPeriodUpper - Show the period (AM/PM) with 12 hour format as uppercase
+ Show the period (AM/PM) with 12 hour format as uppercase.
+
Possible values: true or false +
Default value: false + + + + clockBold + Remove the colon and bold the minutes to make a more modern look.

Possible values: true or false
Default value: false From 3f040e77443b8561c24511cd50c6978f77e66bfc Mon Sep 17 00:00:00 2001 From: "Ashley M. Kirchner" Date: Fri, 29 Apr 2016 12:52:10 -0600 Subject: [PATCH 33/36] Update weatherforecast.js Added the option to change the amount of forecasted days returned by the OpenWeatherAPI. --- modules/default/weatherforecast/weatherforecast.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index c1e79828..c5b8762b 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -14,6 +14,7 @@ Module.register("weatherforecast",{ location: "", appid: "", units: config.units, + maxNumberOfDays: 7, updateInterval: 10 * 60 * 1000, // every 10 minutes animationSpeed: 1000, timeFormat: config.timeFormat, @@ -189,6 +190,12 @@ Module.register("weatherforecast",{ params += "q=" + this.config.location; params += "&units=" + this.config.units; params += "&lang=" + this.config.lang; + /* + * Submit a specific number of days to forecast, between 1 to 16 days. + * The OpenWeatherMap API properly handles values outside of the 1 - 16 range and returns 7 days by default. + * This is simply being pedantic and doing it ourselves. + */ + params += "&cnt=" + (((this.config.maxNumberOfDays < 1) || (this.config.maxNumberOfDays > 16)) ? 7 : this.config.maxNumberOfDays); params += "&APPID=" + this.config.appid; return params; From 4d0a93fc3b2e6a4d1aeb3768216a8bee87639532 Mon Sep 17 00:00:00 2001 From: "Ashley M. Kirchner" Date: Fri, 29 Apr 2016 12:58:03 -0600 Subject: [PATCH 34/36] Update README.md Added the maxNumberOfDays config option to change the amount of forecasted days returned by the OpenWeatherAPI. --- modules/default/weatherforecast/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/default/weatherforecast/README.md b/modules/default/weatherforecast/README.md index c5be33ce..9e93bd14 100644 --- a/modules/default/weatherforecast/README.md +++ b/modules/default/weatherforecast/README.md @@ -55,6 +55,14 @@ The following properties can be configured:
Default value: config.units + + maxNumberOfDays + How many days of forecast to return. Specified by config.js
+
Possible values: 1 - 16 +
Default value: 7 (7 days) +
This value is optional. By default the weatherforecast module will return 7 days. + + updateInterval How often does the content needs to be fetched? (Milliseconds)
From f627c5e5a1d10633d145801380823306837ec84b Mon Sep 17 00:00:00 2001 From: Nicholas Hubbard Date: Sun, 1 May 2016 13:46:41 -0400 Subject: [PATCH 35/36] Extend the Logger Add Timing, Grouping, and Warning to the logger. --- js/logger.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/js/logger.js b/js/logger.js index 994fe534..dd094458 100644 --- a/js/logger.js +++ b/js/logger.js @@ -21,6 +21,27 @@ var Log = (function() { }, error: function(message) { console.error(message); + }, + warn: function(message) { + console.warn(message); + }, + group: function(message) { + console.group(message); + }, + groupCollapsed: function(message) { + console.groupCollapsed(message); + } + groupEnd: function() { + console.groupEnd(); + }, + time: function(message) { + console.time(message); + }, + timeEnd: function(message) { + console.timeEnd(message); + }, + timeStamp: function(message) { + console.timeStamp(message); } }; })(); From 0252495ecad031afb87df9c0afbb9c39f521e8bc Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sun, 1 May 2016 23:30:01 +0200 Subject: [PATCH 36/36] Missing , --- js/logger.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/logger.js b/js/logger.js index dd094458..5b2df990 100644 --- a/js/logger.js +++ b/js/logger.js @@ -30,7 +30,7 @@ var Log = (function() { }, groupCollapsed: function(message) { console.groupCollapsed(message); - } + }, groupEnd: function() { console.groupEnd(); },