diff --git a/CHANGELOG.md b/CHANGELOG.md
index 982ecf4e..0a06df56 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,18 +3,22 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [2.1.1] - Unreleased
+- Make mouse events pass through the region fullscreen_above to modules below.
### Changed
- Installer: Use init config.js from config.js.sample.
### Added
- Add loaded function to modules, providing an async callback.
-- Afrikaans translation.
+- Made default newsfeed module aware of gesture events from [MMM-Gestures](https://github.com/thobach/MMM-Gestures)
+- Add use pm2 for manager process into Installer RaspberryPi script
+- Russian Translation
+- Afrikaans Translation
### Fixed
- Update .gitignore to not ignore default modules folder.
- Remove white flash on boot up.
-
+- Added `update` in Raspberry Pi installation script.
## [2.1.0] - 2016-12-31
diff --git a/README.md b/README.md
index 7c5286dd..126a1d7f 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ MagicMirror² focuses on a modular plugin system and uses [Electron](http://elec
- [Configuration](#configuration)
- [Modules](#modules)
- [Known Issues](#known-issues)
-- [community](#community)
+- [Community](#community)
- [Contributing Guidelines](#contributing-guidelines)
## Usage
diff --git a/css/main.css b/css/main.css
index 5e63e596..f1c07fa0 100644
--- a/css/main.css
+++ b/css/main.css
@@ -135,6 +135,11 @@ sup {
left: -60px;
right: -60px;
bottom: -60px;
+ pointer-events: none;
+}
+
+.region.fullscreen * {
+ pointer-events: auto;
}
.region.right {
diff --git a/installers/mm.sh b/installers/mm.sh
new file mode 100755
index 00000000..cc6c4bb3
--- /dev/null
+++ b/installers/mm.sh
@@ -0,0 +1,2 @@
+cd ~/MagicMirror
+DISPLAY=:0 npm start
diff --git a/installers/pm2_MagicMirror.json b/installers/pm2_MagicMirror.json
new file mode 100644
index 00000000..55f8df31
--- /dev/null
+++ b/installers/pm2_MagicMirror.json
@@ -0,0 +1,7 @@
+{
+ apps : [{
+ name : "MagicMirror",
+ script : "/home/pi/MagicMirror/installer/mm.sh",
+ watch : ["/home/pi/MagicMirror/config/config.js"]
+ }]
+}
diff --git a/installers/raspberry.sh b/installers/raspberry.sh
index b970d02e..718f78b6 100644
--- a/installers/raspberry.sh
+++ b/installers/raspberry.sh
@@ -36,6 +36,10 @@ fi
function version_gt() { test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"; }
function command_exists () { type "$1" &> /dev/null ;}
+# Update before first apt-get
+echo -e "\e[96mUpdating packages ...\e[90m"
+sudo apt-get update || echo -e "\e[91mUpdate failed, carrying on installation ...\e[90m"
+
# Installing helper tools
echo -e "\e[96mInstalling helper tools ...\e[90m"
sudo apt-get install curl wget git build-essential unzip || exit
@@ -144,6 +148,16 @@ else
echo -e "\e[93mplymouth is not installed.\e[0m";
fi
+# Use pm2 control like a service MagicMirror
+read -p "Do you want use pm2 for auto starting of your MagicMirror (y/n)?" choice
+if [[ $choice =~ ^[Yy]$ ]]
+then
+ sudo npm install -g pm2
+ sudo su -c "env PATH=$PATH:/usr/bin pm2 startup linux -u pi --hp /home/pi"
+ pm2 start ~/MagicMirror/installers/pm2_MagicMirror.json
+ pm2 save
+fi
+
echo " "
echo -e "\e[92mWe're ready! Run \e[1m\e[97mDISPLAY=:0 npm start\e[0m\e[92m from the ~/MagicMirror directory to start your MagicMirror.\e[0m"
echo " "
diff --git a/modules/default/alert/translations/ru.json b/modules/default/alert/translations/ru.json
new file mode 100644
index 00000000..ef7ee708
--- /dev/null
+++ b/modules/default/alert/translations/ru.json
@@ -0,0 +1,4 @@
+{
+ "sysTitle": "MagicMirror Уведомление",
+ "welcome": "Добро пожаловать, старт был успешным!""
+}
diff --git a/modules/default/newsfeed/README.md b/modules/default/newsfeed/README.md
index 58c7b9ae..8a0fec25 100644
--- a/modules/default/newsfeed/README.md
+++ b/modules/default/newsfeed/README.md
@@ -1,9 +1,10 @@
# Module: News Feed
The `newsfeed ` module is one of the default modules of the MagicMirror.
-This module displays news headlines based on an RSS feed.
+This module displays news headlines based on an RSS feed. Scrolling through news headlines happens time-based (````updateInterval````), but can also be controlled by sending news feed specific notifications to the module.
## Using the module
+### Configuration
To use this module, add it to the modules array in the `config/config.js` file:
````javascript
modules: [
@@ -30,6 +31,51 @@ modules: [
]
````
+### Notifications
+#### Interacting with the module
+MagicMirror's [notification mechanism](https://github.com/MichMich/MagicMirror/tree/master/modules#thissendnotificationnotification-payload) allows to send notifications to the ````newsfeed```` module. The following notifications are supported:
+
+
+
+
+
+ Notification Identifier |
+ Description |
+
+
+
+
+ ARTICLE_NEXT |
+ Shows the next news title (hiding the summary or previously fully displayed article) |
+
+
+ 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. The module expects that the module's configuration option ````showDescription```` is set to ````false```` (default value).
+ When received a *second consecutive time*, shows the full news article in an IFRAME.
+ 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````. |
+
+
+ ARTICLE_LESS_DETAILS |
+ Hides the summary or full news article and only displays the news title of the currently viewed news item. |
+
+
+
+
+Note the payload of the sent notification event is ignored.
+
+#### Example
+The following example shows how the next news article title can be displayed on the MagicMirror.
+````javascript
+this.sendNotification('ARTICLE_NEXT');
+````
+
+#### ````newsfeed```` specific notification emitting modules
+The third party [MMM-Gestures](https://github.com/thobach/MMM-Gestures) module supports above notifications when moving your hand up, down, left or right in front of a gesture sensor attached to the MagicMirror. See module's readme for more details.
+
## Configuration options
The following properties can be configured:
diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js
index 74014208..aed917f8 100644
--- a/modules/default/newsfeed/newsfeed.js
+++ b/modules/default/newsfeed/newsfeed.js
@@ -89,7 +89,8 @@ Module.register("newsfeed",{
if (this.newsItems.length > 0) {
- if (this.config.showSourceTitle || this.config.showPublishDate) {
+ // this.config.showFullArticle is a run-time configuration, triggered by optional notifications
+ if (!this.config.showFullArticle && (this.config.showSourceTitle || this.config.showPublishDate)) {
var sourceAndTimestamp = document.createElement("div");
sourceAndTimestamp.className = "light small dimmed";
@@ -152,10 +153,12 @@ Module.register("newsfeed",{
}
- var title = document.createElement("div");
- title.className = "bright medium light";
- title.innerHTML = this.newsItems[this.activeItem].title;
- wrapper.appendChild(title);
+ if(!this.config.showFullArticle){
+ var title = document.createElement("div");
+ title.className = "bright medium light";
+ title.innerHTML = this.newsItems[this.activeItem].title;
+ wrapper.appendChild(title);
+ }
if (this.config.showDescription) {
var description = document.createElement("div");
@@ -164,6 +167,21 @@ Module.register("newsfeed",{
wrapper.appendChild(description);
}
+ if (this.config.showFullArticle) {
+ var fullArticle = document.createElement("iframe");
+ fullArticle.className = "";
+ fullArticle.style.width = "100%";
+ fullArticle.style.top = "0";
+ fullArticle.style.left = "0";
+ fullArticle.style.position = "fixed";
+ fullArticle.height = window.innerHeight;
+ fullArticle.style.border = "none";
+ fullArticle.src = this.newsItems[this.activeItem].url;
+ wrapper.appendChild(fullArticle);
+ }
+
+
+
} else {
wrapper.innerHTML = this.translate("LOADING");
wrapper.className = "small dimmed";
@@ -256,7 +274,7 @@ Module.register("newsfeed",{
self.updateDom(self.config.animationSpeed);
- setInterval(function() {
+ timer = setInterval(function() {
self.activeItem++;
self.updateDom(self.config.animationSpeed);
}, this.config.updateInterval);
@@ -273,5 +291,50 @@ Module.register("newsfeed",{
return string.charAt(0).toUpperCase() + string.slice(1);
},
+ resetDescrOrFullArticleAndTimer: function() {
+ this.config.showDescription = false;
+ this.config.showFullArticle = false;
+ if(!timer){
+ this.scheduleUpdateInterval();
+ }
+ },
+
+ notificationReceived: function(notification, payload, sender) {
+ Log.info(this.name + " - received notification: " + notification);
+ if(notification == "ARTICLE_NEXT"){
+ var before = this.activeItem;
+ this.activeItem++;
+ if (this.activeItem >= this.newsItems.length) {
+ this.activeItem = 0;
+ }
+ 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"){
+ var before = this.activeItem;
+ this.activeItem--;
+ if (this.activeItem < 0) {
+ this.activeItem = this.newsItems.length - 1;
+ }
+ this.resetDescrOrFullArticleAndTimer();
+ Log.info(this.name + " - going from article #" + before + " to #" + this.activeItem + " (of " + this.newsItems.length + ")");
+ 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"){
+ this.config.showDescription = !this.config.showDescription;
+ this.config.showFullArticle = !this.config.showDescription;
+ clearInterval(timer);
+ timer = null;
+ Log.info(this.name + " - showing " + this.config.showDescription ? "article description" : "full article");
+ this.updateDom(100);
+ } else if(notification == "ARTICLE_LESS_DETAILS"){
+ this.resetDescrOrFullArticleAndTimer();
+ Log.info(this.name + " - showing only article titles again");
+ this.updateDom(100);
+ } else {
+ Log.info(this.name + " - unknown notification, ignoring: " + notification);
+ }
+ },
});
diff --git a/translations/pl.json b/translations/pl.json
index 7a47745b..06bf3b5c 100644
--- a/translations/pl.json
+++ b/translations/pl.json
@@ -24,10 +24,10 @@
"W": "W",
"WNW": "WNW",
"NW": "NW",
- "NNW": "NNW"
-
+ "NNW": "NNW",
+
/* UPDATE INFO */
"UPDATE_NOTIFICATION": "Dostępna jest aktualizacja MagicMirror².",
"UPDATE_NOTIFICATION_MODULE": "Dostępna jest aktualizacja modułu MODULE_NAME.",
- "UPDATE_INFO": "The current installation is COMMIT_COUNT behind on the BRANCH_NAME branch."
+ "UPDATE_INFO": "Zainstalowana wersja odbiega o COMMIT_COUNT commitów od gałęzi BRANCH_NAME."
}
diff --git a/translations/ru.json b/translations/ru.json
new file mode 100644
index 00000000..053385ee
--- /dev/null
+++ b/translations/ru.json
@@ -0,0 +1,34 @@
+{
+ /* GENERAL */
+ "LOADING": "Загрузка …",
+
+ /* CALENDAR */
+ "TODAY": "Сегодня",
+ "TOMORROW": "Завтра",
+ "DAYAFTERTOMORROW": "Послезавтра",
+ "RUNNING": "Заканчивается через",
+ "EMPTY": "Нет предстоящих событий",
+
+ /* WEATHER */
+ "N": "С",
+ "NNE": "ССВ",
+ "NE": "СВ",
+ "ENE": "ВСВ",
+ "E": "В",
+ "ESE": "ВЮВ",
+ "SE": "ЮВ",
+ "SSE": "ЮЮВ",
+ "S": "Ю",
+ "SSW": "ЮЮЗ",
+ "SW": "ЮЗ",
+ "WSW": "ЗЮЗ",
+ "W": "З",
+ "WNW": "ЗСЗ",
+ "NW": "СЗ",
+ "NNW": "ССЗ",
+
+ /* UPDATE INFO */
+ "UPDATE_NOTIFICATION": "Есть обновление для MagicMirror².",
+ "UPDATE_NOTIFICATION_MODULE": "Есть обновление для MODULE_NAME модуля.",
+ "UPDATE_INFO": "Данная инсталляция позади BRANCH_NAME ветки на COMMIT_COUNT коммитов."
+}
diff --git a/translations/translations.js b/translations/translations.js
index d5e74882..e98a0ad6 100644
--- a/translations/translations.js
+++ b/translations/translations.js
@@ -26,5 +26,6 @@ var translations = {
"gr" : "translations/gr.json", // Greek
"da" : "translations/da.json", // Danish
"tr" : "translations/tr.json", // Turkish
+ "ru" : "translations/ru.json", // Russian
"af" : "translations/af.json", // Afrikaans
};