From 29f68d218dc00775349738fb8ecf3da54d7573e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Sun, 26 Mar 2017 18:06:34 -0300 Subject: [PATCH 01/11] Fix spelling mistake --- installers/raspberry.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installers/raspberry.sh b/installers/raspberry.sh index 2df89a5f..a76c1a9e 100644 --- a/installers/raspberry.sh +++ b/installers/raspberry.sh @@ -65,7 +65,7 @@ if command_exists node; then fi else - echo -e "\e[92mNo Node.js upgrade nessecery.\e[0m" + echo -e "\e[92mNo Node.js upgrade necessary.\e[0m" fi else From 5a6f5133af50b285ab5ccdfa434f62ad775a157e Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sat, 1 Apr 2017 22:05:21 +0200 Subject: [PATCH 02/11] Prepare setup for 2.1.2 --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccf6eba1..f55c6ed6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2.1.2] - Unreleased + +### Changed + +### Added + +### Updated ## [2.1.1] - 2017-04-01 diff --git a/package.json b/package.json index a190f12d..3f1bde8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magicmirror", - "version": "2.1.1", + "version": "2.1.2-dev", "description": "The open source modular smart mirror platform.", "main": "js/electron.js", "scripts": { From 5ccf053cba9adbc24a93fd76e95c99a460a037d0 Mon Sep 17 00:00:00 2001 From: Doug Kline Date: Sat, 1 Apr 2017 17:23:24 -0400 Subject: [PATCH 03/11] TL;RL cheat notes for IPv4 ipWhitelist Hopefully save a google or support request -- while still using IPv4 addresses on MagicMirror network, need to set full address by using ::ffff: as prefix to IP in config. e.g. ::ffff:192.168.5.1 and not 192.168.5.1 --- config/config.js.sample | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/config.js.sample b/config/config.js.sample index 53677cfa..e07c2c75 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -6,7 +6,12 @@ var config = { port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses. + 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"], + language: "en", timeFormat: 24, From 4a70e3cd319143c15efccea6bf40a83a8b1d5969 Mon Sep 17 00:00:00 2001 From: Doug Kline Date: Sat, 1 Apr 2017 18:54:28 -0400 Subject: [PATCH 04/11] Update config.js.sample --- config/config.js.sample | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/config.js.sample b/config/config.js.sample index e07c2c75..9b8787bb 100644 --- a/config/config.js.sample +++ b/config/config.js.sample @@ -6,12 +6,11 @@ var config = { port: 8080, - ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses + 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"], - language: "en", timeFormat: 24, From 63ae2b8095aa7505407f7399a2b01c4073cc98a2 Mon Sep 17 00:00:00 2001 From: Andrew McOlash Date: Sun, 2 Apr 2017 15:06:58 -0500 Subject: [PATCH 05/11] Add in ability to wrap calendar events to multiple lines --- CHANGELOG.md | 1 + modules/default/calendar/README.md | 1 + modules/default/calendar/calendar.css | 1 + modules/default/calendar/calendar.js | 38 ++++++++++++++++++++++----- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f55c6ed6..a3e23c6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Changed ### Added +- Add in option to wrap long calendar events to multiple lines using `wrapEvents` configuration option ### Updated diff --git a/modules/default/calendar/README.md b/modules/default/calendar/README.md index 470560ba..003c13e1 100644 --- a/modules/default/calendar/README.md +++ b/modules/default/calendar/README.md @@ -31,6 +31,7 @@ The following properties can be configured: | `displaySymbol` | Display a symbol in front of an entry.

**Possible values:** `true` or `false`
**Default value:** `true` | `defaultSymbol` | The default symbol.

**Possible values:** See [Font Awsome](http://fontawesome.io/icons/) website.
**Default value:** `calendar` | `maxTitleLength` | The maximum title length.

**Possible values:** `10` - `50`
**Default value:** `25` +| `wrapEvents` | Wrap event titles to multiple lines. Breaks lines at the length defined by `maxTitleLength`.

**Possible values:** `true` or `false`
**Default value:** `false` | `fetchInterval` | How often does the content needs to be fetched? (Milliseconds)

**Possible values:** `1000` - `86400000`
**Default value:** `300000` (5 minutes) | `animationSpeed` | Speed of the update animation. (Milliseconds)

**Possible values:**`0` - `5000`
**Default value:** `2000` (2 seconds) | `fade` | Fade the future events to black. (Gradient)

**Possible values:** `true` or `false`
**Default value:** `true` diff --git a/modules/default/calendar/calendar.css b/modules/default/calendar/calendar.css index 26b1e93d..123ab084 100644 --- a/modules/default/calendar/calendar.css +++ b/modules/default/calendar/calendar.css @@ -2,6 +2,7 @@ padding-left: 0; padding-right: 10px; font-size: 80%; + vertical-align: top; } .calendar .symbol span { diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 12ce290f..fa77c94a 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -18,6 +18,7 @@ Module.register("calendar", { displayRepeatingCountTitle: false, defaultRepeatingCountTitle: "", maxTitleLength: 25, + wrapEvents: false, // wrap events to multiple lines breaking at maxTitleLength fetchInterval: 5 * 60 * 1000, // Update every 5 minutes. animationSpeed: 2000, fade: true, @@ -414,15 +415,38 @@ 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 * * return string - The shortened string. */ - shorten: function (string, maxLength) { - if (string.length > maxLength) { - return string.slice(0, maxLength) + "…"; - } + shorten: function (string, maxLength, wrapEvents) { + if (wrapEvents) { + var temp = ""; + var currentLine = ""; + var words = string.split(" "); - return string; + for (var i = 0; i < words.length; i++) { + var word = words[i]; + if (currentLine.length + word.length < 25 - 1) { // max - 1 to account for a space + currentLine += (word + " "); + } else { + if (currentLine.length > 0) { + temp += (currentLine + "
" + word + " "); + } else { + temp += (word + "
"); + } + currentLine = ""; + } + } + + return temp + currentLine; + } else { + if (string.length > maxLength) { + return string.slice(0, maxLength) + "…"; + } else { + return string; + } + } }, /* capFirst(string) @@ -437,7 +461,7 @@ Module.register("calendar", { /* titleTransform(title) * Transforms the title of an event for usage. * Replaces parts of the text as defined in config.titleReplace. - * Shortens title based on config.maxTitleLength + * Shortens title based on config.maxTitleLength and config.wrapEvents * * argument title string - The title to transform. * @@ -456,7 +480,7 @@ Module.register("calendar", { title = title.replace(needle, replacement); } - title = this.shorten(title, this.config.maxTitleLength); + title = this.shorten(title, this.config.maxTitleLength, this.config.wrapEvents); return title; }, From 154e33a2c3652c1f0538d13b4893eacb06305771 Mon Sep 17 00:00:00 2001 From: Andrew McOlash Date: Sun, 2 Apr 2017 15:10:00 -0500 Subject: [PATCH 06/11] Make times align to the top of the cell --- modules/default/calendar/calendar.css | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/default/calendar/calendar.css b/modules/default/calendar/calendar.css index 123ab084..6bc5762d 100644 --- a/modules/default/calendar/calendar.css +++ b/modules/default/calendar/calendar.css @@ -20,4 +20,5 @@ .calendar .time { padding-left: 30px; text-align: right; + vertical-align: top; } From 64f2a6757345c23e277b58d365161fd3ea7da089 Mon Sep 17 00:00:00 2001 From: Greg Dev Date: Sun, 2 Apr 2017 22:29:54 +0200 Subject: [PATCH 07/11] Add Polish translation for week and day after tomorrow --- translations/pl.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/translations/pl.json b/translations/pl.json index 0c79835f..1d30e395 100644 --- a/translations/pl.json +++ b/translations/pl.json @@ -3,9 +3,12 @@ "TODAY": "Dziś", "TOMORROW": "Jutro", + "DAYAFTERTOMORROW": "Pojutrze", "RUNNING": "Koniec za", "EMPTY": "Brak wydarzeń.", + "WEEK": "Tydzień", + "N": "N", "NNE": "NNE", "NE": "NE", From fb90574d44a0ea86f678b637614b161282f52e10 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Sun, 2 Apr 2017 23:10:32 +0200 Subject: [PATCH 08/11] Update CHANGELOG.md --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3e23c6d..49c5543c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,10 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Changed ### Added -- Add in option to wrap long calendar events to multiple lines using `wrapEvents` configuration option +- Add in option to wrap long calendar events to multiple lines using `wrapEvents` configuration option. ### Updated +- Added missing keys to Polish translation. ## [2.1.1] - 2017-04-01 From 3e1eb035178ca21c7acad4ad970b1aedc9d49ec4 Mon Sep 17 00:00:00 2001 From: fewieden Date: Mon, 3 Apr 2017 10:06:57 +0200 Subject: [PATCH 09/11] added german translation key --- CHANGELOG.md | 1 + translations/de.json | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49c5543c..8d883b16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Updated - Added missing keys to Polish translation. +- Added missing key to German translation. ## [2.1.1] - 2017-04-01 diff --git a/translations/de.json b/translations/de.json index eb67d41a..2723bf86 100644 --- a/translations/de.json +++ b/translations/de.json @@ -7,6 +7,8 @@ "RUNNING": "noch", "EMPTY": "Keine Termine.", + "WEEK": "Woche", + "N": "N", "NNE": "NNO", "NE": "NO", From a74efd285c92b0657a4b46c80ea6fd6eb5d0e596 Mon Sep 17 00:00:00 2001 From: fewieden Date: Mon, 3 Apr 2017 10:37:23 +0200 Subject: [PATCH 10/11] fix typo + eslint --- Gruntfile.js | 30 ++++++++++++++++------- modules/node_modules/node_helper/index.js | 11 +++++---- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 06fed2d5..4951f5c7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -6,12 +6,12 @@ module.exports = function(grunt) { options: { configFile: ".eslintrc.json" }, - target: ["js/*.js", "modules/default/*.js", "modules/default/*/*.js", + target: [ + "js/*.js", "modules/default/*.js", "modules/default/*/*.js", "serveronly/*.js", "*.js", "tests/*/*.js", "!modules/default/alert/notificationFx.js", "!modules/default/alert/modernizr.custom.js", "!modules/default/alert/classie.js", - "config/*", - "translations/translations.js", "vendor/vendor.js" - + "config/*", "translations/translations.js", "vendor/vendor.js", + "modules/node_modules/node_helper/index.js" ] }, stylelint: { @@ -19,14 +19,21 @@ module.exports = function(grunt) { options: { configFile: ".stylelintrc" }, - src: ["css/main.css", "modules/default/calendar/calendar.css", "modules/default/clock/clock_styles.css", "modules/default/currentweather/currentweather.css", "modules/default/weatherforcast/weatherforcast.css"] + src: [ + "css/main.css", "modules/default/calendar/calendar.css", + "modules/default/clock/clock_styles.css", + "modules/default/currentweather/currentweather.css", + "modules/default/weatherforcast/weatherforcast.css" + ] } }, jsonlint: { main: { - src: ["package.json", ".eslintrc.json", ".stylelintrc", "translations/*.json", + src: [ + "package.json", ".eslintrc.json", ".stylelintrc", "translations/*.json", "modules/default/*/translations/*.json", "installers/pm2_MagicMirror.json", - "vendor/package.js"], + "vendor/package.js" + ], options: { reporter: "jshint" } @@ -58,11 +65,16 @@ module.exports = function(grunt) { "MD038": false } }, - src: ["README.md", "CHANGELOG.md", "LICENSE.md", "modules/README.md", "modules/default/**/*.md", "!modules/default/calendar/vendor/ical.js/readme.md"] + src: [ + "README.md", "CHANGELOG.md", "LICENSE.md", "modules/README.md", + "modules/default/**/*.md", "!modules/default/calendar/vendor/ical.js/readme.md" + ] } }, yamllint: { - all: [".travis.yml"] + all: [ + ".travis.yml" + ] } }); grunt.loadNpmTasks("grunt-eslint"); diff --git a/modules/node_modules/node_helper/index.js b/modules/node_modules/node_helper/index.js index 8d0372bd..37c3e2cb 100644 --- a/modules/node_modules/node_helper/index.js +++ b/modules/node_modules/node_helper/index.js @@ -20,7 +20,7 @@ NodeHelper = Class.extend({ }, start: function() { - console.log("Staring module helper: " + this.name); + console.log("Starting module helper: " + this.name); }, /* socketNotificationReceived(notification, payload) @@ -45,7 +45,7 @@ NodeHelper = Class.extend({ /* setPath(path) * Set the module path. * - * argument name string - Module name. + * argument path string - Module path. */ setPath: function(path) { this.path = path; @@ -98,9 +98,10 @@ NodeHelper = Class.extend({ // register catch all. socket.on("*", function(notification, payload) { - if (notification !== "*") - //console.log('received message in namespace: ' + namespace); - self.socketNotificationReceived(notification, payload); + if (notification !== "*") { + //console.log('received message in namespace: ' + namespace); + self.socketNotificationReceived(notification, payload); + } }); }); From 636dbe5b95110cc2f9c86e3262915b2984fbeb1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Ram=C3=ADrez=20Norambuena?= Date: Mon, 3 Apr 2017 11:47:22 -0300 Subject: [PATCH 11/11] Globing pattern test grunt (#1) * Fix Matching patterns tests directories Grunt task of eslint * Fix eslint errors in testsuite. * Format one line per file in src section in Gruntfile.js --- Gruntfile.js | 35 ++++++++++++++----- .../compliments/compliments_parts_day.js | 2 +- tests/configs/modules/positions.js | 4 +-- tests/unit/global_vars/root_path_spec.js | 4 +-- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 4951f5c7..8d069c82 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -7,10 +7,18 @@ module.exports = function(grunt) { configFile: ".eslintrc.json" }, target: [ - "js/*.js", "modules/default/*.js", "modules/default/*/*.js", - "serveronly/*.js", "*.js", "tests/*/*.js", "!modules/default/alert/notificationFx.js", - "!modules/default/alert/modernizr.custom.js", "!modules/default/alert/classie.js", - "config/*", "translations/translations.js", "vendor/vendor.js", + "js/*.js", + "modules/default/*.js", + "modules/default/*/*.js", + "serveronly/*.js", + "*.js", + "tests/**/*.js", + "!modules/default/alert/notificationFx.js", + "!modules/default/alert/modernizr.custom.js", + "!modules/default/alert/classie.js", + "config/*", + "translations/translations.js", + "vendor/vendor.js", "modules/node_modules/node_helper/index.js" ] }, @@ -20,7 +28,8 @@ module.exports = function(grunt) { configFile: ".stylelintrc" }, src: [ - "css/main.css", "modules/default/calendar/calendar.css", + "css/main.css", + "modules/default/calendar/calendar.css", "modules/default/clock/clock_styles.css", "modules/default/currentweather/currentweather.css", "modules/default/weatherforcast/weatherforcast.css" @@ -30,8 +39,12 @@ module.exports = function(grunt) { jsonlint: { main: { src: [ - "package.json", ".eslintrc.json", ".stylelintrc", "translations/*.json", - "modules/default/*/translations/*.json", "installers/pm2_MagicMirror.json", + "package.json", + ".eslintrc.json", + ".stylelintrc", + "translations/*.json", + "modules/default/*/translations/*.json", + "installers/pm2_MagicMirror.json", "vendor/package.js" ], options: { @@ -66,8 +79,12 @@ module.exports = function(grunt) { } }, src: [ - "README.md", "CHANGELOG.md", "LICENSE.md", "modules/README.md", - "modules/default/**/*.md", "!modules/default/calendar/vendor/ical.js/readme.md" + "README.md", + "CHANGELOG.md", + "LICENSE.md", + "modules/README.md", + "modules/default/**/*.md", + "!modules/default/calendar/vendor/ical.js/readme.md" ] } }, diff --git a/tests/configs/modules/compliments/compliments_parts_day.js b/tests/configs/modules/compliments/compliments_parts_day.js index 8d47fe22..b4443567 100644 --- a/tests/configs/modules/compliments/compliments_parts_day.js +++ b/tests/configs/modules/compliments/compliments_parts_day.js @@ -1,4 +1,4 @@ -/* Magic Mirror Test config for default compliments +/* Magic Mirror Test config for default compliments * * By Rodrigo Ramírez Norambuena https://rodrigoramirez.com * MIT Licensed. diff --git a/tests/configs/modules/positions.js b/tests/configs/modules/positions.js index 7d0188c2..60e6dd04 100644 --- a/tests/configs/modules/positions.js +++ b/tests/configs/modules/positions.js @@ -24,8 +24,8 @@ var config = { // Using exotic content. This is why dont accept go to JSON configuration file (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"]; + "middle_center", "lower_third", "bottom_left", "bottom_center", "bottom_right", + "bottom_bar", "fullscreen_above", "fullscreen_below"]; var modules = Array(); for (idx in positions) { modules.push({ diff --git a/tests/unit/global_vars/root_path_spec.js b/tests/unit/global_vars/root_path_spec.js index 197ee6a7..ef7ce3e9 100644 --- a/tests/unit/global_vars/root_path_spec.js +++ b/tests/unit/global_vars/root_path_spec.js @@ -63,8 +63,8 @@ describe("'global.root_path' set in js/app.js", function() { }); it("should expect the global.version equals package.json file", function() { - version_package = JSON.parse(fs.readFileSync("package.json", "utf8")).version; - expect(this.sandbox.global.version).to.equal(version_package); + versionPackage = JSON.parse(fs.readFileSync("package.json", "utf8")).version; + expect(this.sandbox.global.version).to.equal(versionPackage); }); });