Permalink
Browse files

Merge pull request #1418 from MichMich/develop

Develop
  • Loading branch information...
MichMich committed Oct 1, 2018
2 parents 6aa156d + f245cbf commit 6db61b43572d163efb6369f60238975c3e6c3efc
Showing with 234 additions and 93 deletions.
  1. +33 −0 CHANGELOG.md
  2. +3 −1 README.md
  3. +4 −4 clientonly/index.js
  4. +1 −1 config/config.js.sample
  5. +4 −0 css/main.css
  6. +13 −13 modules/default/alert/alert.js
  7. +4 −0 modules/default/alert/translations/fr.json
  8. +18 −3 modules/default/calendar/calendar.js
  9. +6 −3 modules/default/calendar/calendarfetcher.js
  10. +7 −0 modules/default/compliments/README.md
  11. +1 −1 modules/default/compliments/compliments.js
  12. +1 −0 modules/default/newsfeed/README.md
  13. +36 −26 modules/default/newsfeed/newsfeed.js
  14. +3 −0 modules/default/newsfeed/translations/de.json
  15. +3 −0 modules/default/newsfeed/translations/en.json
  16. +3 −0 modules/default/newsfeed/translations/es.json
  17. +3 −0 modules/default/newsfeed/translations/fr.json
  18. +3 −2 modules/default/updatenotification/updatenotification.js
  19. +2 −2 modules/default/weatherforecast/weatherforecast.js
  20. +1 −1 package-lock.json
  21. +1 −1 package.json
  22. +2 −1 tests/configs/data/TranslationTest.json
  23. +2 −1 tests/configs/data/en.json
  24. +2 −1 translations/af.json
  25. +2 −1 translations/bg.json
  26. +2 −1 translations/ca.json
  27. +2 −1 translations/cs.json
  28. +2 −1 translations/cy.json
  29. +2 −1 translations/da.json
  30. +2 −1 translations/de.json
  31. +2 −1 translations/en.json
  32. +4 −1 translations/es.json
  33. +2 −1 translations/et.json
  34. +6 −3 translations/fr.json
  35. +8 −3 translations/hu.json
  36. +2 −1 translations/id.json
  37. +2 −1 translations/is.json
  38. +2 −1 translations/it.json
  39. +2 −1 translations/kr.json
  40. +4 −1 translations/nb.json
  41. +2 −1 translations/nl.json
  42. +4 −1 translations/nn.json
  43. +4 −1 translations/pl.json
  44. +2 −1 translations/pt-br.json
  45. +2 −1 translations/pt.json
  46. +2 −1 translations/ro.json
  47. +2 −1 translations/ru.json
  48. +5 −1 translations/sv.json
  49. +9 −4 translations/zh-cn.json
@@ -4,6 +4,39 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
---
## [2.5.0] - 2018-10-01
### Added
- Support multi-line compliments
- Simplified Chinese translation for "Feels"
- Polish translate for "Feels"
- French translate for "Feels"
- Translations for newsfeed module
- Support for toggling news article in fullscreen
- Hungarian translation for "Feels" and "Week"
- Spanish translation for "Feels"
- Add classes instead of inline style to the message from the module Alert
- Support for events having a duration instead of an end
- Support for showing end of events through config parameters showEnd and dateEndFormat
### Fixed
- Fixed gzip encoded calendar loading issue #1400.
- Mixup between german and spanish translation for newsfeed.
- Fixed close dates to be absolute, if no configured in the config.js - module Calendar
- Fixed the UpdateNotification module message about new commits in the repository, so they can be correctly localized in singular and plural form.
- Fix for weatherforecast rainfall rounding [#1374](https://github.com/MichMich/MagicMirror/issues/1374)
- Fix calendar parsing issue for Midori on RasperryPi Zero w, related to issue #694.
- Fix weather city ID link in sample config
- Fixed issue with clientonly not updating with IP address and port provided on command line.
### Updated
- Updated Simplified Chinese translation
- Swedish translations
- Hungarian translations for the updatenotification module
- Updated Norsk bokmål translation
- Updated Norsk nynorsk translation
- Consider multi days event as full day events
## [2.4.1] - 2018-07-04
@@ -48,7 +48,9 @@ bash -c "$(curl -sL https://raw.githubusercontent.com/MichMich/MagicMirror/maste
#### Manual Installation
1. Download and install the latest *Node.js* version.
1. Download and install the latest *Node.js* version:
- `curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -`
- `sudo apt install -y nodejs`
2. Clone the repository and check out the master branch: `git clone https://github.com/MichMich/MagicMirror`
3. Enter the repository: `cd MagicMirror/`
4. Install and run the app with: `npm install && npm start` \
@@ -62,13 +62,13 @@
// Only start the client if a non-local server was provided
if (["localhost", "127.0.0.1", "::1", "::ffff:127.0.0.1", undefined].indexOf(config.address) === -1) {
getServerConfig(`http://${config.address}:${config.port}/config/`)
.then(function (config) {
.then(function (configReturn) {
// Pass along the server config via an environment variable
var env = Object.create(process.env);
var options = { env: env };
config.address = config.address;
config.port = config.port;
env.config = JSON.stringify(config);
configReturn.address = config.address;
configReturn.port = config.port;
env.config = JSON.stringify(configReturn);
// Spawn electron application
const electron = require("electron");
@@ -59,7 +59,7 @@ var config = {
position: "top_right",
config: {
location: "New York",
locationID: "", //ID from http://www.openweathermap.org/help/city_list.txt
locationID: "", //ID from http://bulk.openweathermap.org/sample/; unzip the gz file and find your city
appid: "YOUR_OPENWEATHER_API_KEY"
}
},
@@ -128,6 +128,10 @@ sup {
text-overflow: ellipsis;
}
.pre-line {
white-space: pre-line;
}
/**
* Region Definitions.
*/
@@ -38,13 +38,13 @@ Module.register("alert",{
if (this.config.effect == "slide") {this.config.effect = this.config.effect + "-" + this.config.position;}
msg = "";
if (message.title) {
msg += "<span class='thin' style='line-height: 35px; font-size:24px' color='#4A4A4A'>" + message.title + "</span>";
msg += "<span class='thin dimmed medium'>" + message.title + "</span>";
}
if (message.message){
if (msg != ""){
msg+= "<br />";
}
msg += "<span class='light' style='font-size:28px;line-height: 30px;'>" + message.message + "</span>";
msg += "<span class='light bright small'>" + message.message + "</span>";
}
new NotificationFx({
@@ -63,9 +63,9 @@ Module.register("alert",{
params.imageUrl = null;
image = "";
} else if (typeof params.imageFA === "undefined"){
image = "<img src='" + (params.imageUrl).toString() + "' height=" + (params.imageHeight).toString() + " style='margin-bottom: 10px;'/><br />";
image = "<img src='" + (params.imageUrl).toString() + "' height='" + (params.imageHeight).toString() + "' style='margin-bottom: 10px;'/><br />";
} else if (typeof params.imageUrl === "undefined"){
image = "<span class='" + "fa fa-" + params.imageFA + "' style='margin-bottom: 10px;color: #fff;font-size:" + (params.imageHeight).toString() + ";'/></span><br />";
image = "<span class='bright " + "fa fa-" + params.imageFA + "' style='margin-bottom: 10px;font-size:" + (params.imageHeight).toString() + ";'/></span><br />";
}
//Create overlay
var overlay = document.createElement("div");
@@ -79,16 +79,16 @@ Module.register("alert",{
}
//Display title and message only if they are provided in notification parameters
message ="";
var message = "";
if (params.title) {
message += "<span class='light' style='line-height: 35px; font-size:30px' color='#4A4A4A'>" + params.title + "</span>"
message += "<span class='light dimmed medium'>" + params.title + "</span>";
}
if (params.message) {
if (message != ""){
if (message !== ""){
message += "<br />";
}
message += "<span class='thin' style='font-size:22px;line-height: 30px;'>" + params.message + "</span>";
message += "<span class='thin bright small'>" + params.message + "</span>";
}
//Store alert in this.alerts
@@ -121,16 +121,16 @@ Module.register("alert",{
setPosition: function(pos) {
//Add css to body depending on the set position for notifications
var sheet = document.createElement("style");
if (pos == "center") {sheet.innerHTML = ".ns-box {margin-left: auto; margin-right: auto;text-align: center;}";}
if (pos == "right") {sheet.innerHTML = ".ns-box {margin-left: auto;text-align: right;}";}
if (pos == "left") {sheet.innerHTML = ".ns-box {margin-right: auto;text-align: left;}";}
if (pos === "center") {sheet.innerHTML = ".ns-box {margin-left: auto; margin-right: auto;text-align: center;}";}
if (pos === "right") {sheet.innerHTML = ".ns-box {margin-left: auto;text-align: right;}";}
if (pos === "left") {sheet.innerHTML = ".ns-box {margin-right: auto;text-align: left;}";}
document.body.appendChild(sheet);
},
notificationReceived: function(notification, payload, sender) {
if (notification === "SHOW_ALERT") {
if (typeof payload.type === "undefined") { payload.type = "alert"; }
if (payload.type == "alert") {
if (payload.type === "alert") {
this.show_alert(payload, sender);
} else if (payload.type = "notification") {
this.show_notification(payload);
@@ -143,7 +143,7 @@ Module.register("alert",{
this.alerts = {};
this.setPosition(this.config.position);
if (this.config.welcome_message) {
if (this.config.welcome_message == true){
if (this.config.welcome_message === true){
this.show_notification({title: this.translate("sysTitle"), message: this.translate("welcome")});
}
else{
@@ -0,0 +1,4 @@
{
"sysTitle": "MagicMirror Notification",
"welcome": "Bienvenue, le démarrage a été un succès!"
}
@@ -25,7 +25,9 @@ Module.register("calendar", {
urgency: 7,
timeFormat: "relative",
dateFormat: "MMM Do",
dateEndFormat: "HH:mm",
fullDayEventDateFormat: "MMM Do",
showEnd: true,
getRelative: 6,
fadePoint: 0.25, // Start on 1/4th of the list.
hidePrivate: false,
@@ -287,6 +289,10 @@ Module.register("calendar", {
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
}
}
if(this.config.showEnd){
timeWrapper.innerHTML += "-" ;
timeWrapper.innerHTML += this.capFirst(moment(event.endDate , "x").format(this.config.fullDayEventDateFormat));
}
} else {
if (event.startDate >= new Date()) {
if (event.startDate - now < 2 * oneDay) {
@@ -295,8 +301,12 @@ Module.register("calendar", {
// If event is within 6 hour, display 'in xxx' time format or moment.fromNow()
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").fromNow());
} else {
// Otherwise just say 'Today/Tomorrow at such-n-such time'
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").calendar());
if(this.config.timeFormat === "absolute") {
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").format(this.config.dateFormat));
} else {
// Otherwise just say 'Today/Tomorrow at such-n-such time'
timeWrapper.innerHTML = this.capFirst(moment(event.startDate, "x").calendar());
}
}
} else {
/* Check to see if the user displays absolute or relative dates with their events
@@ -325,6 +335,11 @@ Module.register("calendar", {
})
);
}
if (this.config.showEnd) {
timeWrapper.innerHTML += "-";
timeWrapper.innerHTML += this.capFirst(moment(event.endDate, "x").format(this.config.dateEndFormat));
}
}
//timeWrapper.innerHTML += ' - '+ moment(event.startDate,'x').format('lll');
//console.log(event);
@@ -436,7 +451,7 @@ Module.register("calendar", {
listContainsEvent: function(eventList, event){
for(let evt of eventList){
for(var evt of eventList){
if(evt.title === event.title && parseInt(evt.startDate) === parseInt(event.startDate)){
return true;
}
@@ -29,7 +29,8 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
var opts = {
headers: {
"User-Agent": "Mozilla/5.0 (Node.js "+ nodeVersion + ") MagicMirror/" + global.version + " (https://github.com/MichMich/MagicMirror/)"
}
},
gzip: true
};
if (auth) {
@@ -90,6 +91,9 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
var endDate;
if (typeof event.end !== "undefined") {
endDate = eventDate(event, "end");
} else if(typeof event.duration !== "undefined") {
dur=moment.duration(event.duration);
endDate = startDate.clone().add(dur);
} else {
if (!isFacebookBirthday) {
endDate = startDate;
@@ -273,8 +277,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
var start = event.start || 0;
var startDate = new Date(start);
var end = event.end || 0;
if (end - start === 24 * 60 * 60 * 1000 && startDate.getHours() === 0 && startDate.getMinutes() === 0) {
if (((end - start) % (24 * 60 * 60 * 1000)) === 0 && startDate.getHours() === 0 && startDate.getMinutes() === 0) {
// Is 24 hours, and starts on the middle of the night.
return true;
}
@@ -107,6 +107,13 @@ config: {
}
````
#### Multi-line compliments:
Use `\n` to split compliment text into multiple lines, e.g. `First line.\nSecond line.` will be shown as:
```
First line.
Second line.
```
### External Compliment File
You may specify an external file that contains the three compliment arrays. This is particularly useful if you have a
large number of compliments and do not wish to crowd your `config.js` file with a large array of compliments.
@@ -159,7 +159,7 @@ Module.register("compliments", {
var compliment = document.createTextNode(complimentText);
var wrapper = document.createElement("div");
wrapper.className = this.config.classes ? this.config.classes : "thin xlarge bright";
wrapper.className = this.config.classes ? this.config.classes : "thin xlarge bright pre-line";
wrapper.appendChild(compliment);
return wrapper;
@@ -41,6 +41,7 @@ MagicMirror's [notification mechanism](https://github.com/MichMich/MagicMirror/t
| `ARTICLE_PREVIOUS` | Shows the previous news title (hiding the summary or previously fully displayed article)
| `ARTICLE_MORE_DETAILS` | When received the _first time_, shows the corresponding description of the currently displayed news title. <br> The module expects that the module's configuration option `showDescription` is set to `false` (default value). <br><br> When received a _second consecutive time_, shows the full news article in an IFRAME. <br> This requires that the news page can be embedded in an IFRAME, e.g. doesn't have the HTTP response header [X-Frame-Options](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) set to e.g. `DENY`.<br><br>When received the _next consecutive times_, reloads the page and scrolls down by `scrollLength` pixels to paginate through the article.
| `ARTICLE_LESS_DETAILS` | Hides the summary or full news article and only displays the news title of the currently viewed news item.
| `ARTICLE_TOGGLE_FULL` | Toogles article in fullscreen.
Note the payload of the sent notification event is ignored.
Oops, something went wrong.

0 comments on commit 6db61b4

Please sign in to comment.