Skip to content

Commit 3545f80

Browse files
authored
Merge pull request #1338 from MichMich/develop
Release 2.4.0
2 parents 60b9a5b + 0b2d156 commit 3545f80

32 files changed

+1814
-5984
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jspm_modules
1919
# Visual Studio Code ignoramuses.
2020
.vscode/
2121

22+
# IDE Code ignoramuses.
23+
.idea/
24+
2225
# Various Windows ignoramuses.
2326
Thumbs.db
2427
ehthumbs.db

CHANGELOG.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,55 @@
11
# MagicMirror² Change Log
2+
23
All notable changes to this project will be documented in this file.
34
This project adheres to [Semantic Versioning](http://semver.org/).
45

5-
## [2.3.1] - 2018-04-01
6+
---
7+
8+
## [2.4.0] - 2018-07-01
9+
10+
⚠️ **Warning:** This release includes an updated version of Electron. This requires a Raspberry Pi configuration change to allow the best performance and prevent the CPU from overheating. Please read the information on the [MagicMirror Wiki](https://github.com/michmich/magicmirror/wiki/configuring-the-raspberry-pi#enable-the-open-gl-driver-to-decrease-electrons-cpu-usage).
11+
12+
ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`
13+
14+
### Added
15+
16+
- Enabled translation of feelsLike for module currentweather
17+
- Added support for on-going calendar events
18+
- Added scroll up in fullscreen newsfeed article view
19+
- Changed fullscreen newsfeed width from 100% to 100vw (better results)
20+
- Added option to calendar module that colors only the symbol instead of the whole line
21+
- Added option for new display format in the calendar module with date headers with times/events below.
22+
- Ability to fetch compliments from a remote server
23+
- Add regex filtering to calendar module
24+
- Customize classes for table
25+
- Added option to newsfeed module to only log error parsing a news article if enabled
26+
- Add update translations for Português Brasileiro
27+
28+
### Changed
29+
- Upgrade to Electron 2.0.0.
30+
- Remove yarn-or-npm which breaks production builds.
31+
- Invoke module suspend even if no dom content. [#1308](https://github.com/MichMich/MagicMirror/issues/1308)
632

733
### Fixed
34+
- Fixed issue where wind chill could not be displayed in Fahrenheit. [#1247](https://github.com/MichMich/MagicMirror/issues/1247)
35+
- Fixed issues where a module crashes when it tries to dismiss a non existing alert. [#1240](https://github.com/MichMich/MagicMirror/issues/1240)
36+
- In default module currentWeather/currentWeather.js line 296, 300, self.config.animationSpeed can not be found because the notificationReceived function does not have "self" variable.
37+
- Fixed browser-side code to work on the Midori browser.
38+
- Fixed issue where heat index was reporting incorrect values in Celsius and Fahrenheit. [#1263](https://github.com/MichMich/MagicMirror/issues/1263)
39+
- Fixed weatherforecast to use dt_txt field instead of dt to handle timezones better
40+
- Newsfeed now remembers to show the description when `"ARTICLE_LESS_DETAILS"` is called if the user wants to always show the description. [#1282](https://github.com/MichMich/MagicMirror/issues/1282)
41+
- `clientonly/*.js` is now linted, and one linting error is fixed
42+
- Fix issue #1196 by changing underscore to hyphen in locale id, in align with momentjs.
43+
- Fixed issue where heat index and wind chill were reporting incorrect values in Kelvin. [#1263](https://github.com/MichMich/MagicMirror/issues/1263)
44+
45+
### Updated
46+
- Updated Italian translation
47+
- Updated German translation
48+
- Updated Dutch translation
849

50+
## [2.3.1] - 2018-04-01
51+
52+
### Fixed
953
- Downgrade electron to 1.4.15 to solve the black screen issue.[#1243](https://github.com/MichMich/MagicMirror/issues/1243)
1054

1155
## [2.3.0] - 2018-04-01

Gruntfile.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module.exports = function(grunt) {
1111
"modules/default/*.js",
1212
"modules/default/*/*.js",
1313
"serveronly/*.js",
14+
"clientonly/*.js",
1415
"*.js",
1516
"tests/**/*.js",
1617
"!modules/default/alert/notificationFx.js",

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ MagicMirror² focuses on a modular plugin system and uses [Electron](http://elec
1717
## Table Of Contents
1818

1919
- [Installation](#installation)
20-
- [Raspberry Pi](#raspberrypi)
20+
- [Raspberry Pi](#raspberry-pi)
2121
- [General](#general)
2222
- [Server Only](#server-only)
2323
- [Client Only](#client-only)
@@ -119,11 +119,11 @@ The following wiki links are helpful for the initial configuration of your Magic
119119

120120
### General
121121

122-
1. Copy `config/config.js.sample` to `config/config.js`. \
122+
1. Copy `/home/pi/MagicMirror/config/config.js.sample` to `/home/pi/MagicMirror/config/config.js`. \
123123
**Note:** If you used the installer script. This step is already done for you.
124124

125125
2. Modify your required settings. \
126-
Note: You'll can check your configuration running `npm run config:check`.
126+
Note: You'll can check your configuration running `npm run config:check` in `/home/pi/MagicMirror`.
127127

128128

129129
The following properties can be configured:
@@ -146,7 +146,7 @@ Module configuration:
146146
| **Option** | **Description** |
147147
| --- | --- |
148148
| `module` | The name of the module. This can also contain the subfolder. Valid examples include `clock`, `default/calendar` and `custommodules/mymodule`. |
149-
| `position` | The location of the module in which the module will be loaded. Possible values are `top_ bar`, `top_left`, `top_center`, `top_right`, `upper_third`, `middle_center`, `lower_third`, `bottom_left`, `bottom_center`, `bottom_right`, `bottom_bar`, `fullscreen_above`, and `fullscreen_below`. This field is optional but most modules require this field to set. Check the documentation of the module for more information. Multiple modules with the same position will be ordered based on the order in the configuration file. |
149+
| `position` | The location of the module in which the module will be loaded. Possible values are `top_bar`, `top_left`, `top_center`, `top_right`, `upper_third`, `middle_center`, `lower_third`, `bottom_left`, `bottom_center`, `bottom_right`, `bottom_bar`, `fullscreen_above`, and `fullscreen_below`. This field is optional but most modules require this field to set. Check the documentation of the module for more information. Multiple modules with the same position will be ordered based on the order in the configuration file. |
150150
| `classes` | Additional classes which are passed to the module. The field is optional. |
151151
| `header` | To display a header text above the module, add the header property. This field is optional. |
152152
| `disabled` | Set disabled to `true` to skip creating the module. This field is optional. |

clientonly/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
process.stdout.write(`Client: ${err}`);
8989
});
9090

91-
child.on('close', (code) => {
91+
child.on("close", (code) => {
9292
if (code != 0) {
9393
console.log(`There something wrong. The clientonly is not running code ${code}`);
9494
}

js/main.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var MM = (function() {
2121
var createDomObjects = function() {
2222
var domCreationPromises = [];
2323

24-
modules.forEach(module => {
24+
modules.forEach(function(module) {
2525
if (typeof module.data.position !== "string") {
2626
return;
2727
}
@@ -52,14 +52,14 @@ var MM = (function() {
5252

5353
var domCreationPromise = updateDom(module, 0);
5454
domCreationPromises.push(domCreationPromise);
55-
domCreationPromise.then(() => {
55+
domCreationPromise.then(function() {
5656
sendNotification("MODULE_DOM_CREATED", null, null, module);
5757
}).catch(Log.error);
5858
});
5959

6060
updateWrapperStates();
6161

62-
Promise.all(domCreationPromises).then(() => {
62+
Promise.all(domCreationPromises).then(function() {
6363
sendNotification("DOM_OBJECTS_CREATED");
6464
});
6565
};
@@ -106,7 +106,7 @@ var MM = (function() {
106106
* return Promise - Resolved when the dom is fully updated.
107107
*/
108108
var updateDom = function(module, speed) {
109-
return new Promise((resolve) => {
109+
return new Promise(function(resolve) {
110110
var newContentPromise = module.getDom();
111111
var newHeader = module.getHeader();
112112

@@ -115,7 +115,7 @@ var MM = (function() {
115115
newContentPromise = Promise.resolve(newContentPromise);
116116
}
117117

118-
newContentPromise.then((newContent) => {
118+
newContentPromise.then(function(newContent) {
119119
var updatePromise = updateDomWithContent(module, speed, newHeader, newContent);
120120

121121
updatePromise.then(resolve).catch(Log.error);
@@ -134,7 +134,7 @@ var MM = (function() {
134134
* return Promise - Resolved when the module dom has been updated.
135135
*/
136136
var updateDomWithContent = function(module, speed, newHeader, newContent) {
137-
return new Promise((resolve) => {
137+
return new Promise(function(resolve) {
138138
if (module.hidden || !speed) {
139139
updateModuleContent(module, newHeader, newContent);
140140
resolve();
@@ -245,6 +245,9 @@ var MM = (function() {
245245

246246
if (typeof callback === "function") { callback(); }
247247
}, speed);
248+
} else {
249+
// invoke callback even if no content, issue 1308
250+
if (typeof callback === "function") { callback(); }
248251
}
249252
};
250253

js/module.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,16 @@ var Module = Class.extend({
8181
* return DomObject | Promise - The dom or a promise with the dom to display.
8282
*/
8383
getDom: function () {
84-
return new Promise((resolve) => {
84+
var self = this;
85+
return new Promise(function(resolve) {
8586
var div = document.createElement("div");
86-
var template = this.getTemplate();
87-
var templateData = this.getTemplateData();
87+
var template = self.getTemplate();
88+
var templateData = self.getTemplateData();
8889

8990
// Check to see if we need to render a template string or a file.
9091
if (/^.*((\.html)|(\.njk))$/.test(template)) {
9192
// the template is a filename
92-
this.nunjucksEnvironment().render(template, templateData, function (err, res) {
93+
self.nunjucksEnvironment().render(template, templateData, function (err, res) {
9394
if (err) {
9495
Log.error(err)
9596
}
@@ -100,7 +101,7 @@ var Module = Class.extend({
100101
});
101102
} else {
102103
// the template is a template string.
103-
div.innerHTML = this.nunjucksEnvironment().renderString(template, templateData);
104+
div.innerHTML = self.nunjucksEnvironment().renderString(template, templateData);
104105

105106
resolve(div);
106107
}

modules/default/alert/alert.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,13 @@ Module.register("alert",{
110110
},
111111
hide_alert: function(sender) {
112112
//Dismiss alert and remove from this.alerts
113-
this.alerts[sender.name].dismiss();
114-
this.alerts[sender.name] = null;
115-
//Remove overlay
116-
var overlay = document.getElementById("overlay");
117-
overlay.parentNode.removeChild(overlay);
113+
if (this.alerts[sender.name]) {
114+
this.alerts[sender.name].dismiss();
115+
this.alerts[sender.name] = null;
116+
//Remove overlay
117+
var overlay = document.getElementById("overlay");
118+
overlay.parentNode.removeChild(overlay);
119+
}
118120
},
119121
setPosition: function(pos) {
120122
//Add css to body depending on the set position for notifications

modules/default/calendar/README.md

100644100755
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Module: Calendar
22
The `calendar` module is one of the default modules of the MagicMirror.
33
This module displays events from a public .ical calendar. It can combine multiple calendars.
4+
Note that calendars may not contain any entry before 1st January 1970, otherwise the calendar won't be displayed and the module will crash.
45

56
## Using the module
67

@@ -33,30 +34,34 @@ The following properties can be configured:
3334
| `maxTitleLength` | The maximum title length. <br><br> **Possible values:** `10` - `50` <br> **Default value:** `25`
3435
| `wrapEvents` | Wrap event titles to multiple lines. Breaks lines at the length defined by `maxTitleLength`. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
3536
| `fetchInterval` | How often does the content needs to be fetched? (Milliseconds) <br><br> **Possible values:** `1000` - `86400000` <br> **Default value:** `300000` (5 minutes)
36-
| `animationSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:**`0` - `5000` <br> **Default value:** `2000` (2 seconds)
37+
| `animationSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:** `0` - `5000` <br> **Default value:** `2000` (2 seconds)
3738
| `fade` | Fade the future events to black. (Gradient) <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
3839
| `fadePoint` | Where to start fade? <br><br> **Possible values:** `0` (top of the list) - `1` (bottom of list) <br> **Default value:** `0.25`
40+
| `tableClass` | Name of the classes issued from `main.css`. <br><br> **Possible values:** xsmall, small, medium, large, xlarge. <br> **Default value:** _small._
3941
| `calendars` | The list of calendars. <br><br> **Possible values:** An array, see _calendar configuration_ below. <br> **Default value:** _An example calendar._
4042
| `titleReplace` | An object of textual replacements applied to the tile of the event. This allow to remove or replace certains words in the title. <br><br> **Example:** `{'Birthday of ' : '', 'foo':'bar'}` <br> **Default value:** `{ "De verjaardag van ": "", "'s birthday": "" }`
4143
| `displayRepeatingCountTitle` | Show count title for yearly repeating events (e.g. "X. Birthday", "X. Anniversary") <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
4244
| `dateFormat` | Format to use for the date of events (when using absolute dates) <br><br> **Possible values:** See [Moment.js formats](http://momentjs.com/docs/#/parsing/string-format/) <br> **Default value:** `MMM Do` (e.g. Jan 18th)
4345
| `fullDayEventDateFormat` | Format to use for the date of full day events (when using absolute dates) <br><br> **Possible values:** See [Moment.js formats](http://momentjs.com/docs/#/parsing/string-format/) <br> **Default value:** `MMM Do` (e.g. Jan 18th)
44-
| `timeFormat` | Display event times as absolute dates, or relative time <br><br> **Possible values:** `absolute` or `relative` <br> **Default value:** `relative`
46+
| `timeFormat` | Display event times as absolute dates, or relative time, or using absolute date headers with times for each event next to it <br><br> **Possible values:** `absolute` or `relative` or `dateheaders` <br> **Default value:** `relative`
4547
| `getRelative` | How much time (in hours) should be left until calendar events start getting relative? <br><br> **Possible values:** `0` (events stay absolute) - `48` (48 hours before the event starts) <br> **Default value:** `6`
4648
| `urgency` | When using a timeFormat of `absolute`, the `urgency` setting allows you to display events within a specific time frame as `relative`. This allows events within a certain time frame to be displayed as relative (in xx days) while others are displayed as absolute dates <br><br> **Possible values:** a positive integer representing the number of days for which you want a relative date, for example `7` (for 7 days) <br><br> **Default value:** `7`
4749
| `broadcastEvents` | If this property is set to true, the calendar will broadcast all the events to all other modules with the notification message: `CALENDAR_EVENTS`. The event objects are stored in an array and contain the following fields: `title`, `startDate`, `endDate`, `fullDayEvent`, `location` and `geo`. <br><br> **Possible values:** `true`, `false` <br><br> **Default value:** `true`
4850
| `hidePrivate` | Hides private calendar events. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
49-
| `excludedEvents` | An array of words / phrases from event titles that will be excluded from being shown. <br><br>Additionally advanced filter objects can be passed in. Below is the configuration for the advance filtering object.<br>**Required**<br>`filterBy` - string used to determine if filter is applied.<br>**Optional**<br>`until` - Time before an event to display it Ex: [`'3 days'`, `'2 months'`, `'1 week'`]<br>`caseSensitive` - By default, excludedEvents are case insensitive, set this to true to enforce case sensitivity<br><br> **Example:** `['Birthday', 'Hide This Event', {filterBy: 'Payment', until: '6 days', caseSensitive: true}]` <br> **Default value:** `[]`
51+
| `hideOngoing` | Hides calendar events that have already started. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
52+
| `excludedEvents` | An array of words / phrases from event titles that will be excluded from being shown. <br><br>Additionally advanced filter objects can be passed in. Below is the configuration for the advance filtering object.<br>**Required**<br>`filterBy` - string used to determine if filter is applied.<br>**Optional**<br>`until` - Time before an event to display it Ex: [`'3 days'`, `'2 months'`, `'1 week'`]<br>`caseSensitive` - By default, excludedEvents are case insensitive, set this to true to enforce case sensitivity<br>`regex` - set to `true` if filterBy is a regex. For those not familiar with regex it is used for pattern matching, please see [here](https://regexr.com/) for more info.<br><br> **Example:** `['Birthday', 'Hide This Event', {filterBy: 'Payment', until: '6 days', caseSensitive: true}, {filterBy: '^[0-9]{1,}.*', regex: true}]` <br> **Default value:** `[]`
5053

5154
### Calendar configuration
5255

5356
The `calendars` property contains an array of the configured calendars.
5457
The `colored` property gives the option for an individual color for each calendar.
58+
The `coloredSymbolOnly` property will apply color to the symbol only, not the whole line. This is only applicable when `colored` is also enabled.
5559

5660
#### Default value:
5761
````javascript
5862
config: {
5963
colored: false,
64+
coloredSymbolOnly: false,
6065
calendars: [
6166
{
6267
url: 'http://www.calendarlabs.com/templates/ical/US-Holidays.ics',

0 commit comments

Comments
 (0)