Merge branch 'develop' into rp-zero-w-es6-fix

This commit is contained in:
Elan Trybuch 2018-08-16 12:07:38 -04:00 committed by GitHub
commit facfa73214
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 126 additions and 56 deletions

View File

@ -4,12 +4,37 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
---
## [2.4.2] - 2018-08-16
## [2.5.1] - 2018-08-16
### Fixed
- Fix calendar parsing issue for Midori on RasperryPi Zero w, realted to issue #694.
## [2.5.0] - Unreleased
*This release is scheduled to be released on 2018-10-01.*
### Added
- 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
- Fix for weatherforecast rainfall rounding [#1374](https://github.com/MichMich/MagicMirror/issues/1374)
### Fixed
- Mixup between german and spanish translation for newsfeed.
- Fixed close dates to be absolute, if no configured in the config.js - module Calendar
### Updated
- Swedish translations
- Hungarian translations for the updatenotification module
- Updated Norsk bokmål translation
- Updated Norsk nynorsk translation
## [2.4.1] - 2018-07-04
### Fixed

View File

@ -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{

View File

@ -0,0 +1,4 @@
{
"sysTitle": "MagicMirror Notification",
"welcome": "Bienvenue, le démarrage a été un succès!"
}

View File

@ -295,8 +295,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

View File

@ -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.

View File

@ -90,7 +90,7 @@ Module.register("newsfeed",{
if (this.config.feedUrl) {
wrapper.className = "small bright";
wrapper.innerHTML = "The configuration options for the newsfeed module have changed.<br>Please check the documentation.";
wrapper.innerHTML = this.translate("configuration_changed");
return wrapper;
}
@ -123,21 +123,21 @@ Module.register("newsfeed",{
//Remove selected tags from the beginning of rss feed items (title or description)
if (this.config.removeStartTags == "title" || this.config.removeStartTags == "both") {
if (this.config.removeStartTags === "title" || this.config.removeStartTags === "both") {
for (f=0; f<this.config.startTags.length;f++) {
if (this.newsItems[this.activeItem].title.slice(0,this.config.startTags[f].length) == this.config.startTags[f]) {
if (this.newsItems[this.activeItem].title.slice(0,this.config.startTags[f].length) === this.config.startTags[f]) {
this.newsItems[this.activeItem].title = this.newsItems[this.activeItem].title.slice(this.config.startTags[f].length,this.newsItems[this.activeItem].title.length);
}
}
}
if (this.config.removeStartTags == "description" || this.config.removeStartTags == "both") {
if (this.config.removeStartTags === "description" || this.config.removeStartTags === "both") {
if (this.isShowingDescription) {
for (f=0; f<this.config.startTags.length;f++) {
if (this.newsItems[this.activeItem].description.slice(0,this.config.startTags[f].length) == this.config.startTags[f]) {
if (this.newsItems[this.activeItem].description.slice(0,this.config.startTags[f].length) === this.config.startTags[f]) {
this.newsItems[this.activeItem].title = this.newsItems[this.activeItem].description.slice(this.config.startTags[f].length,this.newsItems[this.activeItem].description.length);
}
}
@ -149,14 +149,14 @@ Module.register("newsfeed",{
if (this.config.removeEndTags) {
for (f=0; f<this.config.endTags.length;f++) {
if (this.newsItems[this.activeItem].title.slice(-this.config.endTags[f].length)==this.config.endTags[f]) {
if (this.newsItems[this.activeItem].title.slice(-this.config.endTags[f].length)===this.config.endTags[f]) {
this.newsItems[this.activeItem].title = this.newsItems[this.activeItem].title.slice(0,-this.config.endTags[f].length);
}
}
if (this.isShowingDescription) {
for (f=0; f<this.config.endTags.length;f++) {
if (this.newsItems[this.activeItem].description.slice(-this.config.endTags[f].length)==this.config.endTags[f]) {
if (this.newsItems[this.activeItem].description.slice(-this.config.endTags[f].length)===this.config.endTags[f]) {
this.newsItems[this.activeItem].description = this.newsItems[this.activeItem].description.slice(0,-this.config.endTags[f].length);
}
}
@ -338,7 +338,7 @@ Module.register("newsfeed",{
notificationReceived: function(notification, payload, sender) {
Log.info(this.name + " - received notification: " + notification);
if(notification == "ARTICLE_NEXT"){
if(notification === "ARTICLE_NEXT"){
var before = this.activeItem;
this.activeItem++;
if (this.activeItem >= this.newsItems.length) {
@ -347,7 +347,7 @@ Module.register("newsfeed",{
this.resetDescrOrFullArticleAndTimer();
Log.info(this.name + " - going from article #" + before + " to #" + this.activeItem + " (of " + this.newsItems.length + ")");
this.updateDom(100);
} else if(notification == "ARTICLE_PREVIOUS"){
} else if(notification === "ARTICLE_PREVIOUS"){
var before = this.activeItem;
this.activeItem--;
if (this.activeItem < 0) {
@ -358,42 +358,52 @@ Module.register("newsfeed",{
this.updateDom(100);
}
// if "more details" is received the first time: show article summary, on second time show full article
else if(notification == "ARTICLE_MORE_DETAILS"){
else if(notification === "ARTICLE_MORE_DETAILS"){
// full article is already showing, so scrolling down
if(this.config.showFullArticle == true){
if(this.config.showFullArticle === true){
this.scrollPosition += this.config.scrollLength;
window.scrollTo(0, this.scrollPosition);
Log.info(this.name + " - scrolling down");
Log.info(this.name + " - ARTICLE_MORE_DETAILS, scroll position: " + this.config.scrollLength);
}
// display full article
else {
this.isShowingDescription = !this.isShowingDescription;
this.config.showFullArticle = !this.isShowingDescription;
// make bottom bar align to top to allow scrolling
if(this.config.showFullArticle == true){
document.getElementsByClassName("region bottom bar")[0].style.bottom = "inherit";
document.getElementsByClassName("region bottom bar")[0].style.top = "-90px";
}
clearInterval(timer);
timer = null;
Log.info(this.name + " - showing " + this.isShowingDescription ? "article description" : "full article");
this.updateDom(100);
this.showFullArticle();
}
} else if(notification == "ARTICLE_SCROLL_UP"){
if(this.config.showFullArticle == true){
} else if(notification === "ARTICLE_SCROLL_UP"){
if(this.config.showFullArticle === true){
this.scrollPosition -= this.config.scrollLength;
window.scrollTo(0, this.scrollPosition);
Log.info(this.name + " - scrolling up");
Log.info(this.name + " - ARTICLE_SCROLL_UP, scroll position: " + this.config.scrollLength);
}
} else if(notification == "ARTICLE_LESS_DETAILS"){
} else if(notification === "ARTICLE_LESS_DETAILS"){
this.resetDescrOrFullArticleAndTimer();
Log.info(this.name + " - showing only article titles again");
this.updateDom(100);
} else if (notification === "ARTICLE_TOGGLE_FULL"){
if (this.config.showFullArticle){
this.activeItem++;
this.resetDescrOrFullArticleAndTimer();
} else {
this.showFullArticle();
}
} else {
Log.info(this.name + " - unknown notification, ignoring: " + notification);
}
},
showFullArticle: function() {
this.isShowingDescription = !this.isShowingDescription;
this.config.showFullArticle = !this.isShowingDescription;
// make bottom bar align to top to allow scrolling
if(this.config.showFullArticle === true){
document.getElementsByClassName("region bottom bar")[0].style.bottom = "inherit";
document.getElementsByClassName("region bottom bar")[0].style.top = "-90px";
}
clearInterval(timer);
timer = null;
Log.info(this.name + " - showing " + this.isShowingDescription ? "article description" : "full article");
this.updateDom(100);
}
});

View File

@ -0,0 +1,3 @@
{
"configuration_changed": "Die Konfigurationsoptionen für das Newsfeed-Modul haben sich geändert. \nBitte überprüfen Sie die Dokumentation."
}

View File

@ -0,0 +1,3 @@
{
"configuration_changed": "The configuration options for the newsfeed module have changed.\nPlease check the documentation."
}

View File

@ -0,0 +1,3 @@
{
"configuration_changed": "Las opciones de configuración para el módulo de suministro de noticias han cambiado. \nVerifique la documentación."
}

View File

@ -0,0 +1,3 @@
{
"configuration_changed": "Les options de configuration du module newsfeed ont changé. \nVeuillez consulter la documentation."
}

View File

@ -177,7 +177,7 @@ Module.register("weatherforecast",{
rainCell.innerHTML = "";
} else {
if(config.units !== "imperial") {
rainCell.innerHTML = forecast.rain + " mm";
rainCell.innerHTML = parseFloat(forecast.rain).toFixed(1) + " mm";
} else {
rainCell.innerHTML = (parseFloat(forecast.rain) / 25.4).toFixed(2) + " in";
}
@ -350,7 +350,7 @@ Module.register("weatherforecast",{
icon: this.config.iconTable[forecast.weather[0].icon],
maxTemp: this.roundValue(forecast.temp.max),
minTemp: this.roundValue(forecast.temp.min),
rain: this.roundValue(forecast.rain)
rain: forecast.rain
};
this.forecast.push(forecastData);

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "magicmirror",
"version": "2.4.1",
"version": "2.5.0-dev",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "magicmirror",
"version": "2.4.1",
"version": "2.5.0-dev",
"description": "The open source modular smart mirror platform.",
"main": "js/electron.js",
"scripts": {

View File

@ -28,5 +28,7 @@
"UPDATE_NOTIFICATION": "MagicMirror² actualización disponible.",
"UPDATE_NOTIFICATION_MODULE": "Disponible una actualización para el módulo {MODULE_NAME}.",
"UPDATE_INFO": "Tu actual instalación está {COMMIT_COUNT} cambios detrás de la rama {BRANCH_NAME}."
"UPDATE_INFO": "Tu actual instalación está {COMMIT_COUNT} cambios detrás de la rama {BRANCH_NAME}.",
"FEELS": "Sensación térmica de"
}

View File

@ -6,7 +6,7 @@
"DAYAFTERTOMORROW": "Après-demain",
"RUNNING": "Se termine dans",
"EMPTY": "Aucun RDV à venir.",
"WEEK": "Semaine {weekNumber}",
"N": "N",
@ -25,8 +25,10 @@
"WNW": "ONO",
"NW": "NO",
"NNW": "NNO",
"UPDATE_NOTIFICATION": "Une mise à jour de MagicMirror² est disponible",
"UPDATE_NOTIFICATION_MODULE": "Une mise à jour est disponible pour le module {MODULE_NAME} .",
"UPDATE_INFO": "L'installation actuelle est {COMMIT_COUNT} en retard sur la branche {BRANCH_NAME} ."
"UPDATE_INFO": "L'installation actuelle est {COMMIT_COUNT} en retard sur la branche {BRANCH_NAME} .",
"FEELS": "Ressenti"
}

View File

@ -7,6 +7,8 @@
"RUNNING": "Vége lesz",
"EMPTY": "Nincs közelgő esemény.",
"WEEK": "{weekNumber}. hét",
"N": "É",
"NNE": "ÉÉK",
"NE": "ÉK",
@ -24,7 +26,9 @@
"NW": "ÉNy",
"NNW": "ÉÉNy",
"UPDATE_NOTIFICATION": "MagicMirror² elérhető egy frissítés!",
"UPDATE_NOTIFICATION_MODULE": "A frissítés {MODULE_NAME} modul néven érhető el.",
"UPDATE_INFO": "A jelenlegi telepítés {COMMIT_COUNT} mögött {BRANCH_NAME} ágon található."
"UPDATE_NOTIFICATION": "MagicMirror²-hoz frissítés érhető el.",
"UPDATE_NOTIFICATION_MODULE": "A {MODULE_NAME} modulhoz frissítés érhető el.",
"UPDATE_INFO": "A jelenlegi telepítés óta {COMMIT_COUNT} commit jelent meg a {BRANCH_NAME} ágon.",
"FEELS": "Érzet"
}

View File

@ -28,5 +28,7 @@
"UPDATE_NOTIFICATION": "MagicMirror²-oppdatering er tilgjengelig.",
"UPDATE_NOTIFICATION_MODULE": "Oppdatering tilgjengelig for modulen {MODULE_NAME}.",
"UPDATE_INFO": "Nåværende installasjon er {COMMIT_COUNT} bak {BRANCH_NAME} grenen."
"UPDATE_INFO": "Nåværende installasjon er {COMMIT_COUNT} bak {BRANCH_NAME} grenen.",
"FEELS": "Føles som"
}

View File

@ -26,5 +26,7 @@
"UPDATE_NOTIFICATION": "MagicMirror² oppdatering er tilgjengeleg.",
"UPDATE_NOTIFICATION_MODULE": "Oppdatering tilgjengeleg for modulen {MODULE_NAME}.",
"UPDATE_INFO": "noverande installasjon er {COMMIT_COUNT} bak {BRANCH_NAME} greinen."
"UPDATE_INFO": "noverande installasjon er {COMMIT_COUNT} bak {BRANCH_NAME} greinen.",
"FEELS": "Kjenst som"
}

View File

@ -28,5 +28,7 @@
"UPDATE_NOTIFICATION": "MagicMirror² uppdatering finns tillgänglig.",
"UPDATE_NOTIFICATION_MODULE": "Uppdatering finns tillgänglig av {MODULE_NAME} modulen.",
"UPDATE_INFO": "Denna installation ligger {COMMIT_COUNT} steg bakom {BRANCH_NAME} grenen."
"UPDATE_INFO": "Denna installation ligger {COMMIT_COUNT} steg bakom {BRANCH_NAME} grenen.",
"FEELS": "Känns som"
}