2022-01-26 23:09:26 +01:00
|
|
|
/* MagicMirror²
|
2016-03-29 15:44:43 +02:00
|
|
|
* Module: NewsFeed
|
|
|
|
*
|
2020-04-28 23:05:28 +02:00
|
|
|
* By Michael Teeuw https://michaelteeuw.nl
|
2016-03-29 15:44:43 +02:00
|
|
|
* MIT Licensed.
|
|
|
|
*/
|
2020-05-11 22:22:32 +02:00
|
|
|
Module.register("newsfeed", {
|
2016-03-29 15:44:43 +02:00
|
|
|
// Default module config.
|
|
|
|
defaults: {
|
2016-04-20 14:39:38 +02:00
|
|
|
feeds: [
|
|
|
|
{
|
|
|
|
title: "New York Times",
|
2020-04-28 23:05:28 +02:00
|
|
|
url: "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml",
|
2016-04-20 14:39:38 +02:00
|
|
|
encoding: "UTF-8" //ISO-8859-1
|
|
|
|
}
|
|
|
|
],
|
2021-06-03 12:45:08 +02:00
|
|
|
showAsList: false,
|
2016-04-20 14:39:38 +02:00
|
|
|
showSourceTitle: true,
|
2016-03-29 15:44:43 +02:00
|
|
|
showPublishDate: true,
|
2019-05-31 16:23:40 +02:00
|
|
|
broadcastNewsFeeds: true,
|
|
|
|
broadcastNewsUpdates: true,
|
2016-04-12 11:06:59 +02:00
|
|
|
showDescription: false,
|
2022-01-22 23:34:57 +01:00
|
|
|
showTitleAsUrl: false,
|
2017-03-11 17:36:47 -06:00
|
|
|
wrapTitle: true,
|
|
|
|
wrapDescription: true,
|
2017-11-15 12:21:02 +07:00
|
|
|
truncDescription: true,
|
|
|
|
lengthDescription: 400,
|
2017-03-10 16:56:28 +01:00
|
|
|
hideLoading: false,
|
2017-11-15 12:21:02 +07:00
|
|
|
reloadInterval: 5 * 60 * 1000, // every 5 minutes
|
2016-04-12 11:06:59 +02:00
|
|
|
updateInterval: 10 * 1000,
|
2016-04-05 14:35:11 -04:00
|
|
|
animationSpeed: 2.5 * 1000,
|
2016-08-26 22:06:03 +02:00
|
|
|
maxNewsItems: 0, // 0 for unlimited
|
2017-03-21 19:39:51 +01:00
|
|
|
ignoreOldItems: false,
|
|
|
|
ignoreOlderThan: 24 * 60 * 60 * 1000, // 1 day
|
2016-12-01 19:48:53 -03:00
|
|
|
removeStartTags: "",
|
|
|
|
removeEndTags: "",
|
2016-08-27 00:32:47 +02:00
|
|
|
startTags: [],
|
Added ability to set a list of prohibited words that will be filtered out of newsfeed
Resolves #1071
`prohibitedWords` config parameter is an array of words. If set and case insensitive greedy match is found anywhere in the title then that newsfeed item will not be displayed. Readme updated with instructions.
Users should be careful on the words selection as careless setting may remove many or all items from the newsfeed. Some obvious mistakes like `space, comma, dot` etc. can be prevented programatically, but I left it out of this PR
Example:
with `prohibitedWords: ['dodgers']`
Original `newsItems`:
```
0:{title: "New York City, Russia, Los Angeles Dodgers: Your Wednesday Briefing", description: "Here’s what you need to know to start your day.", pubdate: "Wed, 01 Nov 2017 09:37:36 GMT", url: "https://www.nytimes.com/2017/11/01/briefing/new-yo…ssia-los-angeles-dodgers.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
1:{title: "A Mangled School Bus, Bodies Everywhere; ‘It Was Surreal’", description: "A truck ramming bicyclists. The driver emerging wi…e attack, it was as confusing as it was gruesome.", pubdate: "Wed, 01 Nov 2017 09:27:41 GMT", url: "https://www.nytimes.com/2017/10/31/nyregion/nyc-sc…r-attack-truck-witnesses.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
2:{title: "Dodgers 3, Astros 1 | Series tied, 3-3: With a Rally and a Romp, Dodgers Top Astros and Force Game 7", description: "Down by a run with just four innings left in Game …nst a dominating Justin Verlander. Game 7 awaits.", pubdate: "Wed, 01 Nov 2017 07:21:07 GMT", url: "https://www.nytimes.com/2017/11/01/sports/dodgers-win-game-6.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
3:{title: "José Andrés Fed Puerto Rico, and May Change How Aid Is Given", description: "The chef’s huge effort is just the latest led by c…ocally based way to feed people after a disaster.", pubdate: "Wed, 01 Nov 2017 06:40:09 GMT", url: "https://www.nytimes.com/2017/10/30/dining/jose-andres-puerto-rico.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
```
Filtered `newsItems`:
```
0:{title: "A Mangled School Bus, Bodies Everywhere; ‘It Was Surreal’", description: "A truck ramming bicyclists. The driver emerging wi…e attack, it was as confusing as it was gruesome.", pubdate: "Wed, 01 Nov 2017 09:27:41 GMT", url: "https://www.nytimes.com/2017/10/31/nyregion/nyc-sc…r-attack-truck-witnesses.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
1:{title: "José Andrés Fed Puerto Rico, and May Change How Aid Is Given", description: "The chef’s huge effort is just the latest led by c…ocally based way to feed people after a disaster.", pubdate: "Wed, 01 Nov 2017 06:40:09 GMT", url: "https://www.nytimes.com/2017/10/30/dining/jose
```
2017-11-01 03:40:32 -07:00
|
|
|
endTags: [],
|
2018-01-29 21:26:34 +01:00
|
|
|
prohibitedWords: [],
|
2018-06-26 20:01:28 -04:00
|
|
|
scrollLength: 500,
|
2021-12-21 13:31:39 +01:00
|
|
|
logFeedWarnings: false,
|
|
|
|
dangerouslyDisableAutoEscaping: false
|
2016-03-29 15:44:43 +02:00
|
|
|
},
|
|
|
|
|
Release 2.22.0 (#2983)
## [2.22.0] - 2023-01-01
Thanks to: @angeldeejay, @buxxi, @dariom, @dWoolridge,
@KristjanESPERANTO, @MagMar94, @naveensrinivasan, @retroflex, @SkySails
and @Tom.
Special thanks to @khassel, @rejas and @sdetweil for taking over most
(if not all) of the work on this release as project collaborators. This
version would not be there without their effort. Thank you!
### Added
- Added test for remoteFile option in compliments module
- Added hourlyWeather functionality to Weather.gov weather provider
- Removed weatherEndpoint definition from weathergov.js (not used)
- Added css class names "today" and "tomorrow" for default calendar
- Added Collaboration.md
- Added new github action for dependency review (#2862)
- Added a WeatherProvider for Open-Meteo
- Added Yr as a weather provider
- Added config options "ignoreXOriginHeader" and
"ignoreContentSecurityPolicy"
### Removed
- Removed usage of internal fetch function of node until it is more
stable
### Updated
- Cleaned up test directory (#2937) and jest config (#2959)
- Wait for all modules to start before declaring the system ready
(#2487)
- Updated e2e tests (moved `done()` in helper functions) and use es6
syntax in all tests
- Updated da translation
- Rework weather module
- Make sure smhi provider api only gets a maximum of 6 digits
coordinates (#2955)
- Use fetch instead of XMLHttpRequest in weatherprovider (#2935)
- Reworked how weatherproviders handle units (#2849)
- Use unix() method for parsing times, fix suntimes on the way (#2950)
- Refactor conversion functions into utils class (#2958)
- The `cors`-method in `server.js` now supports sending and recieving
HTTP headers
- Replace `…` by `…`
- Cleanup compliments module
- Updated dependencies including electron to v22 (#2903)
### Fixed
- Correctly show apparent temperature in SMHI weather provider
- Ensure updatenotification module isn't shown when local is _ahead_ of
remote
- Handle node_helper errors during startup (#2944)
- Possibility to change FontAwesome class in calendar, so icons like
`fab fa-facebook-square` works.
- Fix cors problems with newsfeed articles (as far as possible), allow
disabling cors per feed with option `useCorsProxy: false` (#2840)
- Tests not waiting for the application to start and stop before
starting the next test
- Fix electron tests failing sometimes in github workflow
- Fixed gap in clock module when displayed on the left side with
displayType=digital
- Fixed playwright issue by upgrading to v1.29.1 (#2969)
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: Karsten Hassel <hassel@gmx.de>
Co-authored-by: Malte Hallström <46646495+SkySails@users.noreply.github.com>
Co-authored-by: Veeck <github@veeck.de>
Co-authored-by: veeck <michael@veeck.de>
Co-authored-by: dWoolridge <dwoolridge@charter.net>
Co-authored-by: Johan <jojjepersson@yahoo.se>
Co-authored-by: Dario Mratovich <dario_mratovich@hotmail.com>
Co-authored-by: Dario Mratovich <dario.mratovich@outlook.com>
Co-authored-by: Magnus <34011212+MagMar94@users.noreply.github.com>
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: buxxi <buxxi@omfilm.net>
Co-authored-by: Thomas Hirschberger <47733292+Tom-Hirschberger@users.noreply.github.com>
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
Co-authored-by: Andrés Vanegas Jiménez <142350+angeldeejay@users.noreply.github.com>
2023-01-01 18:09:08 +01:00
|
|
|
getUrlPrefix: function (item) {
|
|
|
|
if (item.useCorsProxy) {
|
Release 2.23.0 (#3078)
## [2.23.0] - 2023-04-04
Thanks to: @angeldeejay, @buxxi, @CarJem, @dariom, @DaveChild, @dWoolridge, @grenagit, @Hirschberger, @KristjanESPERANTO, @MagMar94, @naveensrinivasan, @nfogal, @psieg, @rajniszp, @retroflex, @SkySails and @tomzt.
Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not all) of the work on this release as project collaborators. This version would not be there without their effort. Thank you guys! You are awesome!
### Added
- Added increments for hourly forecasts in weather module (#2996)
- Added tests for hourly weather forecast
- Added possibility to ignore MagicMirror repo in updatenotification module
- Added Pirate Weather as new weather provider (#3005)
- Added possibility to use your own templates in Alert module
- Added error message if `<modulename>.js` file is missing in module folder to get a hint in the logs (#2403)
- Added possibility to use environment variables in `config.js` (#1756)
- Added option `pastDaysCount` to default calendar module to control of how many days past events should be displayed
- Added thai language to alert module
- Added option `sendNotifications` in clock module (#3056)
### Removed
- Removed darksky weather provider
- Removed unneeded (and unwanted) '.' after the year in calendar repeatingCountTitle (#2896)
### Updated
- Use develop as target branch for dependabot
- Update issue template, contributing doc and sample config
- The weather modules clearly separates precipitation amount and probability (risk of rain/snow)
- This requires all providers that only supports probability to change the config from `showPrecipitationAmount` to `showPrecipitationProbability`.
- Update tests for weather and calendar module
- Changed updatenotification module for MagicMirror repo only: Send only notifications for `master` if there is a tag on a newer commit
- Update dates in Calendar widgets every minute
- Cleanup jest coverage for patches
- Update `stylelint` dependencies, switch to `stylelint-config-standard` and handle `stylelint` issues, update `main.css` matching new rules
- Update Eslint config, add new rule and handle issue
- Convert lots of callbacks to async/await
- Revise require imports (#3071 and #3072)
### Fixed
- Fix wrong day labels in envcanada forecast (#2987)
- Fix for missing default class name prefix for customEvents in calendar
- Fix electron flashing white screen on startup (#1919)
- Fix weathergov provider hourly forecast (#3008)
- Fix message display with HTML code into alert module (#2828)
- Fix typo in french translation
- Yr wind direction is no longer inverted
- Fix async node_helper stopping electron start (#2487)
- The wind direction arrow now points in the direction the wind is flowing, not into the wind (#3019)
- Fix precipitation css styles and rounding value
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
- Fix empty news feed stopping the reload forever
- Fix e2e tests (failed after async changes) by running calendar and newsfeed tests last
- Lint: Use template literals instead of string concatenation
- Fix default alert module to render HTML for title and message
- Fix Open-Meteo wind speed units
2023-04-04 20:44:32 +02:00
|
|
|
return `${location.protocol}//${location.host}/cors?url=`;
|
Release 2.22.0 (#2983)
## [2.22.0] - 2023-01-01
Thanks to: @angeldeejay, @buxxi, @dariom, @dWoolridge,
@KristjanESPERANTO, @MagMar94, @naveensrinivasan, @retroflex, @SkySails
and @Tom.
Special thanks to @khassel, @rejas and @sdetweil for taking over most
(if not all) of the work on this release as project collaborators. This
version would not be there without their effort. Thank you!
### Added
- Added test for remoteFile option in compliments module
- Added hourlyWeather functionality to Weather.gov weather provider
- Removed weatherEndpoint definition from weathergov.js (not used)
- Added css class names "today" and "tomorrow" for default calendar
- Added Collaboration.md
- Added new github action for dependency review (#2862)
- Added a WeatherProvider for Open-Meteo
- Added Yr as a weather provider
- Added config options "ignoreXOriginHeader" and
"ignoreContentSecurityPolicy"
### Removed
- Removed usage of internal fetch function of node until it is more
stable
### Updated
- Cleaned up test directory (#2937) and jest config (#2959)
- Wait for all modules to start before declaring the system ready
(#2487)
- Updated e2e tests (moved `done()` in helper functions) and use es6
syntax in all tests
- Updated da translation
- Rework weather module
- Make sure smhi provider api only gets a maximum of 6 digits
coordinates (#2955)
- Use fetch instead of XMLHttpRequest in weatherprovider (#2935)
- Reworked how weatherproviders handle units (#2849)
- Use unix() method for parsing times, fix suntimes on the way (#2950)
- Refactor conversion functions into utils class (#2958)
- The `cors`-method in `server.js` now supports sending and recieving
HTTP headers
- Replace `…` by `…`
- Cleanup compliments module
- Updated dependencies including electron to v22 (#2903)
### Fixed
- Correctly show apparent temperature in SMHI weather provider
- Ensure updatenotification module isn't shown when local is _ahead_ of
remote
- Handle node_helper errors during startup (#2944)
- Possibility to change FontAwesome class in calendar, so icons like
`fab fa-facebook-square` works.
- Fix cors problems with newsfeed articles (as far as possible), allow
disabling cors per feed with option `useCorsProxy: false` (#2840)
- Tests not waiting for the application to start and stop before
starting the next test
- Fix electron tests failing sometimes in github workflow
- Fixed gap in clock module when displayed on the left side with
displayType=digital
- Fixed playwright issue by upgrading to v1.29.1 (#2969)
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: Karsten Hassel <hassel@gmx.de>
Co-authored-by: Malte Hallström <46646495+SkySails@users.noreply.github.com>
Co-authored-by: Veeck <github@veeck.de>
Co-authored-by: veeck <michael@veeck.de>
Co-authored-by: dWoolridge <dwoolridge@charter.net>
Co-authored-by: Johan <jojjepersson@yahoo.se>
Co-authored-by: Dario Mratovich <dario_mratovich@hotmail.com>
Co-authored-by: Dario Mratovich <dario.mratovich@outlook.com>
Co-authored-by: Magnus <34011212+MagMar94@users.noreply.github.com>
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: buxxi <buxxi@omfilm.net>
Co-authored-by: Thomas Hirschberger <47733292+Tom-Hirschberger@users.noreply.github.com>
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
Co-authored-by: Andrés Vanegas Jiménez <142350+angeldeejay@users.noreply.github.com>
2023-01-01 18:09:08 +01:00
|
|
|
} else {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2016-03-29 15:44:43 +02:00
|
|
|
// Define required scripts.
|
2020-05-11 22:22:32 +02:00
|
|
|
getScripts: function () {
|
2016-04-05 14:35:11 -04:00
|
|
|
return ["moment.js"];
|
2016-03-29 15:44:43 +02:00
|
|
|
},
|
|
|
|
|
2021-01-16 11:52:55 +01:00
|
|
|
//Define required styles.
|
|
|
|
getStyles: function () {
|
|
|
|
return ["newsfeed.css"];
|
|
|
|
},
|
|
|
|
|
2016-05-11 12:38:41 +02:00
|
|
|
// Define required translations.
|
2020-05-11 22:22:32 +02:00
|
|
|
getTranslations: function () {
|
2017-03-30 21:15:51 +02:00
|
|
|
// The translations for the default modules are defined in the core translation files.
|
|
|
|
// Therefor we can just return false. Otherwise we should have returned a dictionary.
|
|
|
|
// If you're trying to build your own module including translations, check out the documentation.
|
2016-05-11 12:38:41 +02:00
|
|
|
return false;
|
|
|
|
},
|
|
|
|
|
2016-03-29 15:44:43 +02:00
|
|
|
// Define start sequence.
|
2020-05-11 22:22:32 +02:00
|
|
|
start: function () {
|
Release 2.23.0 (#3078)
## [2.23.0] - 2023-04-04
Thanks to: @angeldeejay, @buxxi, @CarJem, @dariom, @DaveChild, @dWoolridge, @grenagit, @Hirschberger, @KristjanESPERANTO, @MagMar94, @naveensrinivasan, @nfogal, @psieg, @rajniszp, @retroflex, @SkySails and @tomzt.
Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not all) of the work on this release as project collaborators. This version would not be there without their effort. Thank you guys! You are awesome!
### Added
- Added increments for hourly forecasts in weather module (#2996)
- Added tests for hourly weather forecast
- Added possibility to ignore MagicMirror repo in updatenotification module
- Added Pirate Weather as new weather provider (#3005)
- Added possibility to use your own templates in Alert module
- Added error message if `<modulename>.js` file is missing in module folder to get a hint in the logs (#2403)
- Added possibility to use environment variables in `config.js` (#1756)
- Added option `pastDaysCount` to default calendar module to control of how many days past events should be displayed
- Added thai language to alert module
- Added option `sendNotifications` in clock module (#3056)
### Removed
- Removed darksky weather provider
- Removed unneeded (and unwanted) '.' after the year in calendar repeatingCountTitle (#2896)
### Updated
- Use develop as target branch for dependabot
- Update issue template, contributing doc and sample config
- The weather modules clearly separates precipitation amount and probability (risk of rain/snow)
- This requires all providers that only supports probability to change the config from `showPrecipitationAmount` to `showPrecipitationProbability`.
- Update tests for weather and calendar module
- Changed updatenotification module for MagicMirror repo only: Send only notifications for `master` if there is a tag on a newer commit
- Update dates in Calendar widgets every minute
- Cleanup jest coverage for patches
- Update `stylelint` dependencies, switch to `stylelint-config-standard` and handle `stylelint` issues, update `main.css` matching new rules
- Update Eslint config, add new rule and handle issue
- Convert lots of callbacks to async/await
- Revise require imports (#3071 and #3072)
### Fixed
- Fix wrong day labels in envcanada forecast (#2987)
- Fix for missing default class name prefix for customEvents in calendar
- Fix electron flashing white screen on startup (#1919)
- Fix weathergov provider hourly forecast (#3008)
- Fix message display with HTML code into alert module (#2828)
- Fix typo in french translation
- Yr wind direction is no longer inverted
- Fix async node_helper stopping electron start (#2487)
- The wind direction arrow now points in the direction the wind is flowing, not into the wind (#3019)
- Fix precipitation css styles and rounding value
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
- Fix empty news feed stopping the reload forever
- Fix e2e tests (failed after async changes) by running calendar and newsfeed tests last
- Lint: Use template literals instead of string concatenation
- Fix default alert module to render HTML for title and message
- Fix Open-Meteo wind speed units
2023-04-04 20:44:32 +02:00
|
|
|
Log.info(`Starting module: ${this.name}`);
|
2016-03-29 15:44:43 +02:00
|
|
|
|
|
|
|
// Set locale.
|
|
|
|
moment.locale(config.language);
|
2016-04-03 19:52:13 +02:00
|
|
|
|
2016-03-29 15:44:43 +02:00
|
|
|
this.newsItems = [];
|
|
|
|
this.loaded = false;
|
2021-03-16 13:47:48 +01:00
|
|
|
this.error = null;
|
2016-03-29 15:44:43 +02:00
|
|
|
this.activeItem = 0;
|
2018-01-29 21:26:34 +01:00
|
|
|
this.scrollPosition = 0;
|
2016-03-30 12:20:46 +02:00
|
|
|
|
2016-04-20 14:39:38 +02:00
|
|
|
this.registerFeeds();
|
2016-03-31 13:05:23 +02:00
|
|
|
|
2018-05-15 20:32:02 -04:00
|
|
|
this.isShowingDescription = this.config.showDescription;
|
2016-03-30 12:20:46 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
// Override socket notification handler.
|
2020-05-11 22:22:32 +02:00
|
|
|
socketNotificationReceived: function (notification, payload) {
|
2016-04-05 14:35:11 -04:00
|
|
|
if (notification === "NEWS_ITEMS") {
|
2016-04-20 14:39:38 +02:00
|
|
|
this.generateFeed(payload);
|
2016-03-30 12:20:46 +02:00
|
|
|
|
2016-04-20 14:39:38 +02:00
|
|
|
if (!this.loaded) {
|
2021-01-16 12:26:38 +01:00
|
|
|
if (this.config.hideLoading) {
|
|
|
|
this.show();
|
|
|
|
}
|
2016-04-20 14:39:38 +02:00
|
|
|
this.scheduleUpdateInterval();
|
2016-03-30 12:20:46 +02:00
|
|
|
}
|
2016-04-20 14:39:38 +02:00
|
|
|
|
2016-05-11 12:38:41 +02:00
|
|
|
this.loaded = true;
|
2021-03-16 13:47:48 +01:00
|
|
|
this.error = null;
|
2021-05-02 10:24:22 +02:00
|
|
|
} else if (notification === "NEWSFEED_ERROR") {
|
|
|
|
this.error = this.translate(payload.error_type);
|
2021-03-16 13:47:48 +01:00
|
|
|
this.scheduleUpdateInterval();
|
2016-03-30 12:20:46 +02:00
|
|
|
}
|
2016-03-29 15:44:43 +02:00
|
|
|
},
|
|
|
|
|
2021-01-16 13:37:18 +01:00
|
|
|
//Override fetching of template name
|
|
|
|
getTemplate: function () {
|
2016-04-20 14:39:38 +02:00
|
|
|
if (this.config.feedUrl) {
|
2021-01-16 13:37:18 +01:00
|
|
|
return "oldconfig.njk";
|
|
|
|
} else if (this.config.showFullArticle) {
|
|
|
|
return "fullarticle.njk";
|
2016-04-20 14:39:38 +02:00
|
|
|
}
|
2021-01-16 13:37:18 +01:00
|
|
|
return "newsfeed.njk";
|
|
|
|
},
|
2016-04-05 13:16:23 +02:00
|
|
|
|
2021-01-16 13:37:18 +01:00
|
|
|
//Override template data and return whats used for the current template
|
|
|
|
getTemplateData: function () {
|
|
|
|
// this.config.showFullArticle is a run-time configuration, triggered by optional notifications
|
|
|
|
if (this.config.showFullArticle) {
|
|
|
|
return {
|
|
|
|
url: this.getActiveItemURL()
|
|
|
|
};
|
2016-03-29 15:44:43 +02:00
|
|
|
}
|
2021-03-16 13:47:48 +01:00
|
|
|
if (this.error) {
|
|
|
|
return {
|
|
|
|
error: this.error
|
|
|
|
};
|
|
|
|
}
|
2021-01-16 14:06:07 +01:00
|
|
|
if (this.newsItems.length === 0) {
|
2021-01-16 13:37:18 +01:00
|
|
|
return {
|
2021-12-20 13:29:56 +01:00
|
|
|
empty: true
|
2021-01-16 13:37:18 +01:00
|
|
|
};
|
2016-03-29 15:44:43 +02:00
|
|
|
}
|
2021-01-16 13:37:18 +01:00
|
|
|
if (this.activeItem >= this.newsItems.length) {
|
|
|
|
this.activeItem = 0;
|
|
|
|
}
|
2021-03-16 13:47:48 +01:00
|
|
|
|
2021-01-16 13:37:18 +01:00
|
|
|
const item = this.newsItems[this.activeItem];
|
2021-06-03 11:40:18 +02:00
|
|
|
const items = this.newsItems.map(function (item) {
|
|
|
|
item.publishDate = moment(new Date(item.pubdate)).fromNow();
|
|
|
|
return item;
|
|
|
|
});
|
2021-01-16 13:37:18 +01:00
|
|
|
|
|
|
|
return {
|
|
|
|
loaded: true,
|
|
|
|
config: this.config,
|
|
|
|
sourceTitle: item.sourceTitle,
|
|
|
|
publishDate: moment(new Date(item.pubdate)).fromNow(),
|
|
|
|
title: item.title,
|
Release 2.22.0 (#2983)
## [2.22.0] - 2023-01-01
Thanks to: @angeldeejay, @buxxi, @dariom, @dWoolridge,
@KristjanESPERANTO, @MagMar94, @naveensrinivasan, @retroflex, @SkySails
and @Tom.
Special thanks to @khassel, @rejas and @sdetweil for taking over most
(if not all) of the work on this release as project collaborators. This
version would not be there without their effort. Thank you!
### Added
- Added test for remoteFile option in compliments module
- Added hourlyWeather functionality to Weather.gov weather provider
- Removed weatherEndpoint definition from weathergov.js (not used)
- Added css class names "today" and "tomorrow" for default calendar
- Added Collaboration.md
- Added new github action for dependency review (#2862)
- Added a WeatherProvider for Open-Meteo
- Added Yr as a weather provider
- Added config options "ignoreXOriginHeader" and
"ignoreContentSecurityPolicy"
### Removed
- Removed usage of internal fetch function of node until it is more
stable
### Updated
- Cleaned up test directory (#2937) and jest config (#2959)
- Wait for all modules to start before declaring the system ready
(#2487)
- Updated e2e tests (moved `done()` in helper functions) and use es6
syntax in all tests
- Updated da translation
- Rework weather module
- Make sure smhi provider api only gets a maximum of 6 digits
coordinates (#2955)
- Use fetch instead of XMLHttpRequest in weatherprovider (#2935)
- Reworked how weatherproviders handle units (#2849)
- Use unix() method for parsing times, fix suntimes on the way (#2950)
- Refactor conversion functions into utils class (#2958)
- The `cors`-method in `server.js` now supports sending and recieving
HTTP headers
- Replace `…` by `…`
- Cleanup compliments module
- Updated dependencies including electron to v22 (#2903)
### Fixed
- Correctly show apparent temperature in SMHI weather provider
- Ensure updatenotification module isn't shown when local is _ahead_ of
remote
- Handle node_helper errors during startup (#2944)
- Possibility to change FontAwesome class in calendar, so icons like
`fab fa-facebook-square` works.
- Fix cors problems with newsfeed articles (as far as possible), allow
disabling cors per feed with option `useCorsProxy: false` (#2840)
- Tests not waiting for the application to start and stop before
starting the next test
- Fix electron tests failing sometimes in github workflow
- Fixed gap in clock module when displayed on the left side with
displayType=digital
- Fixed playwright issue by upgrading to v1.29.1 (#2969)
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: Karsten Hassel <hassel@gmx.de>
Co-authored-by: Malte Hallström <46646495+SkySails@users.noreply.github.com>
Co-authored-by: Veeck <github@veeck.de>
Co-authored-by: veeck <michael@veeck.de>
Co-authored-by: dWoolridge <dwoolridge@charter.net>
Co-authored-by: Johan <jojjepersson@yahoo.se>
Co-authored-by: Dario Mratovich <dario_mratovich@hotmail.com>
Co-authored-by: Dario Mratovich <dario.mratovich@outlook.com>
Co-authored-by: Magnus <34011212+MagMar94@users.noreply.github.com>
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: buxxi <buxxi@omfilm.net>
Co-authored-by: Thomas Hirschberger <47733292+Tom-Hirschberger@users.noreply.github.com>
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
Co-authored-by: Andrés Vanegas Jiménez <142350+angeldeejay@users.noreply.github.com>
2023-01-01 18:09:08 +01:00
|
|
|
url: this.getUrlPrefix(item) + item.url,
|
2021-05-25 09:29:48 +02:00
|
|
|
description: item.description,
|
2021-06-03 11:40:18 +02:00
|
|
|
items: items
|
2021-01-16 13:37:18 +01:00
|
|
|
};
|
2016-03-29 15:44:43 +02:00
|
|
|
},
|
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
getActiveItemURL: function () {
|
Release 2.22.0 (#2983)
## [2.22.0] - 2023-01-01
Thanks to: @angeldeejay, @buxxi, @dariom, @dWoolridge,
@KristjanESPERANTO, @MagMar94, @naveensrinivasan, @retroflex, @SkySails
and @Tom.
Special thanks to @khassel, @rejas and @sdetweil for taking over most
(if not all) of the work on this release as project collaborators. This
version would not be there without their effort. Thank you!
### Added
- Added test for remoteFile option in compliments module
- Added hourlyWeather functionality to Weather.gov weather provider
- Removed weatherEndpoint definition from weathergov.js (not used)
- Added css class names "today" and "tomorrow" for default calendar
- Added Collaboration.md
- Added new github action for dependency review (#2862)
- Added a WeatherProvider for Open-Meteo
- Added Yr as a weather provider
- Added config options "ignoreXOriginHeader" and
"ignoreContentSecurityPolicy"
### Removed
- Removed usage of internal fetch function of node until it is more
stable
### Updated
- Cleaned up test directory (#2937) and jest config (#2959)
- Wait for all modules to start before declaring the system ready
(#2487)
- Updated e2e tests (moved `done()` in helper functions) and use es6
syntax in all tests
- Updated da translation
- Rework weather module
- Make sure smhi provider api only gets a maximum of 6 digits
coordinates (#2955)
- Use fetch instead of XMLHttpRequest in weatherprovider (#2935)
- Reworked how weatherproviders handle units (#2849)
- Use unix() method for parsing times, fix suntimes on the way (#2950)
- Refactor conversion functions into utils class (#2958)
- The `cors`-method in `server.js` now supports sending and recieving
HTTP headers
- Replace `…` by `…`
- Cleanup compliments module
- Updated dependencies including electron to v22 (#2903)
### Fixed
- Correctly show apparent temperature in SMHI weather provider
- Ensure updatenotification module isn't shown when local is _ahead_ of
remote
- Handle node_helper errors during startup (#2944)
- Possibility to change FontAwesome class in calendar, so icons like
`fab fa-facebook-square` works.
- Fix cors problems with newsfeed articles (as far as possible), allow
disabling cors per feed with option `useCorsProxy: false` (#2840)
- Tests not waiting for the application to start and stop before
starting the next test
- Fix electron tests failing sometimes in github workflow
- Fixed gap in clock module when displayed on the left side with
displayType=digital
- Fixed playwright issue by upgrading to v1.29.1 (#2969)
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: Karsten Hassel <hassel@gmx.de>
Co-authored-by: Malte Hallström <46646495+SkySails@users.noreply.github.com>
Co-authored-by: Veeck <github@veeck.de>
Co-authored-by: veeck <michael@veeck.de>
Co-authored-by: dWoolridge <dwoolridge@charter.net>
Co-authored-by: Johan <jojjepersson@yahoo.se>
Co-authored-by: Dario Mratovich <dario_mratovich@hotmail.com>
Co-authored-by: Dario Mratovich <dario.mratovich@outlook.com>
Co-authored-by: Magnus <34011212+MagMar94@users.noreply.github.com>
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: buxxi <buxxi@omfilm.net>
Co-authored-by: Thomas Hirschberger <47733292+Tom-Hirschberger@users.noreply.github.com>
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
Co-authored-by: Andrés Vanegas Jiménez <142350+angeldeejay@users.noreply.github.com>
2023-01-01 18:09:08 +01:00
|
|
|
const item = this.newsItems[this.activeItem];
|
|
|
|
if (item) {
|
|
|
|
return typeof item.url === "string" ? this.getUrlPrefix(item) + item.url : this.getUrlPrefix(item) + item.url.href;
|
|
|
|
} else {
|
|
|
|
return "";
|
|
|
|
}
|
2019-03-25 01:08:59 +01:00
|
|
|
},
|
|
|
|
|
2020-08-03 11:36:29 +02:00
|
|
|
/**
|
|
|
|
* Registers the feeds to be used by the backend.
|
2016-03-29 15:44:43 +02:00
|
|
|
*/
|
2020-05-11 22:22:32 +02:00
|
|
|
registerFeeds: function () {
|
2021-03-16 21:15:19 +01:00
|
|
|
for (let feed of this.config.feeds) {
|
2016-04-20 14:39:38 +02:00
|
|
|
this.sendSocketNotification("ADD_FEED", {
|
|
|
|
feed: feed,
|
|
|
|
config: this.config
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2020-08-03 11:36:29 +02:00
|
|
|
/**
|
2016-04-20 14:39:38 +02:00
|
|
|
* Generate an ordered list of items for this configured module.
|
2020-08-03 11:36:29 +02:00
|
|
|
* @param {object} feeds An object with feeds returned by the node helper.
|
2016-04-20 14:39:38 +02:00
|
|
|
*/
|
2020-05-11 22:22:32 +02:00
|
|
|
generateFeed: function (feeds) {
|
2021-03-16 21:15:19 +01:00
|
|
|
let newsItems = [];
|
|
|
|
for (let feed in feeds) {
|
|
|
|
const feedItems = feeds[feed];
|
2016-04-20 14:39:38 +02:00
|
|
|
if (this.subscribedToFeed(feed)) {
|
2021-03-16 21:15:19 +01:00
|
|
|
for (let item of feedItems) {
|
2016-04-20 14:39:38 +02:00
|
|
|
item.sourceTitle = this.titleForFeed(feed);
|
2020-05-11 22:22:32 +02:00
|
|
|
if (!(this.config.ignoreOldItems && Date.now() - new Date(item.pubdate) > this.config.ignoreOlderThan)) {
|
2017-03-21 19:39:51 +01:00
|
|
|
newsItems.push(item);
|
|
|
|
}
|
2016-04-20 14:39:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-05-11 22:22:32 +02:00
|
|
|
newsItems.sort(function (a, b) {
|
2021-03-16 21:15:19 +01:00
|
|
|
const dateA = new Date(a.pubdate);
|
|
|
|
const dateB = new Date(b.pubdate);
|
2016-04-20 14:39:38 +02:00
|
|
|
return dateB - dateA;
|
2016-03-30 12:20:46 +02:00
|
|
|
});
|
2021-12-20 13:29:56 +01:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
if (this.config.maxNewsItems > 0) {
|
2016-06-06 00:16:49 +02:00
|
|
|
newsItems = newsItems.slice(0, this.config.maxNewsItems);
|
|
|
|
}
|
Added ability to set a list of prohibited words that will be filtered out of newsfeed
Resolves #1071
`prohibitedWords` config parameter is an array of words. If set and case insensitive greedy match is found anywhere in the title then that newsfeed item will not be displayed. Readme updated with instructions.
Users should be careful on the words selection as careless setting may remove many or all items from the newsfeed. Some obvious mistakes like `space, comma, dot` etc. can be prevented programatically, but I left it out of this PR
Example:
with `prohibitedWords: ['dodgers']`
Original `newsItems`:
```
0:{title: "New York City, Russia, Los Angeles Dodgers: Your Wednesday Briefing", description: "Here’s what you need to know to start your day.", pubdate: "Wed, 01 Nov 2017 09:37:36 GMT", url: "https://www.nytimes.com/2017/11/01/briefing/new-yo…ssia-los-angeles-dodgers.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
1:{title: "A Mangled School Bus, Bodies Everywhere; ‘It Was Surreal’", description: "A truck ramming bicyclists. The driver emerging wi…e attack, it was as confusing as it was gruesome.", pubdate: "Wed, 01 Nov 2017 09:27:41 GMT", url: "https://www.nytimes.com/2017/10/31/nyregion/nyc-sc…r-attack-truck-witnesses.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
2:{title: "Dodgers 3, Astros 1 | Series tied, 3-3: With a Rally and a Romp, Dodgers Top Astros and Force Game 7", description: "Down by a run with just four innings left in Game …nst a dominating Justin Verlander. Game 7 awaits.", pubdate: "Wed, 01 Nov 2017 07:21:07 GMT", url: "https://www.nytimes.com/2017/11/01/sports/dodgers-win-game-6.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
3:{title: "José Andrés Fed Puerto Rico, and May Change How Aid Is Given", description: "The chef’s huge effort is just the latest led by c…ocally based way to feed people after a disaster.", pubdate: "Wed, 01 Nov 2017 06:40:09 GMT", url: "https://www.nytimes.com/2017/10/30/dining/jose-andres-puerto-rico.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
```
Filtered `newsItems`:
```
0:{title: "A Mangled School Bus, Bodies Everywhere; ‘It Was Surreal’", description: "A truck ramming bicyclists. The driver emerging wi…e attack, it was as confusing as it was gruesome.", pubdate: "Wed, 01 Nov 2017 09:27:41 GMT", url: "https://www.nytimes.com/2017/10/31/nyregion/nyc-sc…r-attack-truck-witnesses.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
1:{title: "José Andrés Fed Puerto Rico, and May Change How Aid Is Given", description: "The chef’s huge effort is just the latest led by c…ocally based way to feed people after a disaster.", pubdate: "Wed, 01 Nov 2017 06:40:09 GMT", url: "https://www.nytimes.com/2017/10/30/dining/jose
```
2017-11-01 03:40:32 -07:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
if (this.config.prohibitedWords.length > 0) {
|
2021-04-24 21:59:16 +02:00
|
|
|
newsItems = newsItems.filter(function (item) {
|
2021-03-16 21:15:19 +01:00
|
|
|
for (let word of this.config.prohibitedWords) {
|
2021-04-24 21:59:16 +02:00
|
|
|
if (item.title.toLowerCase().indexOf(word.toLowerCase()) > -1) {
|
Added ability to set a list of prohibited words that will be filtered out of newsfeed
Resolves #1071
`prohibitedWords` config parameter is an array of words. If set and case insensitive greedy match is found anywhere in the title then that newsfeed item will not be displayed. Readme updated with instructions.
Users should be careful on the words selection as careless setting may remove many or all items from the newsfeed. Some obvious mistakes like `space, comma, dot` etc. can be prevented programatically, but I left it out of this PR
Example:
with `prohibitedWords: ['dodgers']`
Original `newsItems`:
```
0:{title: "New York City, Russia, Los Angeles Dodgers: Your Wednesday Briefing", description: "Here’s what you need to know to start your day.", pubdate: "Wed, 01 Nov 2017 09:37:36 GMT", url: "https://www.nytimes.com/2017/11/01/briefing/new-yo…ssia-los-angeles-dodgers.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
1:{title: "A Mangled School Bus, Bodies Everywhere; ‘It Was Surreal’", description: "A truck ramming bicyclists. The driver emerging wi…e attack, it was as confusing as it was gruesome.", pubdate: "Wed, 01 Nov 2017 09:27:41 GMT", url: "https://www.nytimes.com/2017/10/31/nyregion/nyc-sc…r-attack-truck-witnesses.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
2:{title: "Dodgers 3, Astros 1 | Series tied, 3-3: With a Rally and a Romp, Dodgers Top Astros and Force Game 7", description: "Down by a run with just four innings left in Game …nst a dominating Justin Verlander. Game 7 awaits.", pubdate: "Wed, 01 Nov 2017 07:21:07 GMT", url: "https://www.nytimes.com/2017/11/01/sports/dodgers-win-game-6.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
3:{title: "José Andrés Fed Puerto Rico, and May Change How Aid Is Given", description: "The chef’s huge effort is just the latest led by c…ocally based way to feed people after a disaster.", pubdate: "Wed, 01 Nov 2017 06:40:09 GMT", url: "https://www.nytimes.com/2017/10/30/dining/jose-andres-puerto-rico.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
```
Filtered `newsItems`:
```
0:{title: "A Mangled School Bus, Bodies Everywhere; ‘It Was Surreal’", description: "A truck ramming bicyclists. The driver emerging wi…e attack, it was as confusing as it was gruesome.", pubdate: "Wed, 01 Nov 2017 09:27:41 GMT", url: "https://www.nytimes.com/2017/10/31/nyregion/nyc-sc…r-attack-truck-witnesses.html?partner=rss&emc=rss", sourceTitle: "New York Times"}
1:{title: "José Andrés Fed Puerto Rico, and May Change How Aid Is Given", description: "The chef’s huge effort is just the latest led by c…ocally based way to feed people after a disaster.", pubdate: "Wed, 01 Nov 2017 06:40:09 GMT", url: "https://www.nytimes.com/2017/10/30/dining/jose
```
2017-11-01 03:40:32 -07:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}, this);
|
|
|
|
}
|
2021-01-16 14:06:07 +01:00
|
|
|
newsItems.forEach((item) => {
|
2021-01-16 11:10:53 +01:00
|
|
|
//Remove selected tags from the beginning of rss feed items (title or description)
|
|
|
|
if (this.config.removeStartTags === "title" || this.config.removeStartTags === "both") {
|
2021-03-16 22:46:19 +01:00
|
|
|
for (let startTag of this.config.startTags) {
|
|
|
|
if (item.title.slice(0, startTag.length) === startTag) {
|
|
|
|
item.title = item.title.slice(startTag.length, item.title.length);
|
2021-01-16 11:10:53 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.config.removeStartTags === "description" || this.config.removeStartTags === "both") {
|
|
|
|
if (this.isShowingDescription) {
|
2021-03-16 22:46:19 +01:00
|
|
|
for (let startTag of this.config.startTags) {
|
|
|
|
if (item.description.slice(0, startTag.length) === startTag) {
|
|
|
|
item.description = item.description.slice(startTag.length, item.description.length);
|
2021-01-16 11:10:53 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Remove selected tags from the end of rss feed items (title or description)
|
|
|
|
if (this.config.removeEndTags) {
|
2021-03-16 22:46:19 +01:00
|
|
|
for (let endTag of this.config.endTags) {
|
|
|
|
if (item.title.slice(-endTag.length) === endTag) {
|
|
|
|
item.title = item.title.slice(0, -endTag.length);
|
2021-01-16 11:10:53 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.isShowingDescription) {
|
2021-03-16 22:46:19 +01:00
|
|
|
for (let endTag of this.config.endTags) {
|
|
|
|
if (item.description.slice(-endTag.length) === endTag) {
|
|
|
|
item.description = item.description.slice(0, -endTag.length);
|
2021-01-16 11:10:53 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-01-16 14:06:07 +01:00
|
|
|
});
|
|
|
|
|
2019-05-31 16:23:40 +02:00
|
|
|
// get updated news items and broadcast them
|
2021-03-16 21:15:19 +01:00
|
|
|
const updatedItems = [];
|
2020-05-11 22:22:32 +02:00
|
|
|
newsItems.forEach((value) => {
|
|
|
|
if (this.newsItems.findIndex((value1) => value1 === value) === -1) {
|
2019-05-31 16:23:40 +02:00
|
|
|
// Add item to updated items list
|
2019-06-14 14:03:07 +02:00
|
|
|
updatedItems.push(value);
|
2019-05-31 16:23:40 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// check if updated items exist, if so and if we should broadcast these updates, then lets do so
|
|
|
|
if (this.config.broadcastNewsUpdates && updatedItems.length > 0) {
|
2020-05-11 22:22:32 +02:00
|
|
|
this.sendNotification("NEWS_FEED_UPDATE", { items: updatedItems });
|
2019-05-31 16:23:40 +02:00
|
|
|
}
|
|
|
|
|
2016-04-20 14:39:38 +02:00
|
|
|
this.newsItems = newsItems;
|
|
|
|
},
|
|
|
|
|
2020-08-03 11:36:29 +02:00
|
|
|
/**
|
2016-04-20 14:39:38 +02:00
|
|
|
* Check if this module is configured to show this feed.
|
2020-08-03 11:36:29 +02:00
|
|
|
* @param {string} feedUrl Url of the feed to check.
|
|
|
|
* @returns {boolean} True if it is subscribed, false otherwise
|
2016-04-20 14:39:38 +02:00
|
|
|
*/
|
2020-05-11 22:22:32 +02:00
|
|
|
subscribedToFeed: function (feedUrl) {
|
2021-03-16 21:15:19 +01:00
|
|
|
for (let feed of this.config.feeds) {
|
2016-04-20 14:39:38 +02:00
|
|
|
if (feed.url === feedUrl) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
|
2020-08-03 11:36:29 +02:00
|
|
|
/**
|
|
|
|
* Returns title for the specific feed url.
|
|
|
|
* @param {string} feedUrl Url of the feed
|
|
|
|
* @returns {string} The title of the feed
|
2016-04-20 14:39:38 +02:00
|
|
|
*/
|
2020-05-11 22:22:32 +02:00
|
|
|
titleForFeed: function (feedUrl) {
|
2021-03-16 21:15:19 +01:00
|
|
|
for (let feed of this.config.feeds) {
|
2016-04-20 14:39:38 +02:00
|
|
|
if (feed.url === feedUrl) {
|
2016-12-01 19:48:53 -03:00
|
|
|
return feed.title || "";
|
2016-04-20 14:39:38 +02:00
|
|
|
}
|
|
|
|
}
|
2016-12-01 19:48:53 -03:00
|
|
|
return "";
|
2016-03-29 15:44:43 +02:00
|
|
|
},
|
|
|
|
|
2020-08-03 11:36:29 +02:00
|
|
|
/**
|
2016-03-29 15:44:43 +02:00
|
|
|
* Schedule visual update.
|
|
|
|
*/
|
2020-05-11 22:22:32 +02:00
|
|
|
scheduleUpdateInterval: function () {
|
2021-03-16 22:46:19 +01:00
|
|
|
this.updateDom(this.config.animationSpeed);
|
2016-03-29 15:44:43 +02:00
|
|
|
|
2019-07-09 10:20:02 +02:00
|
|
|
// Broadcast NewsFeed if needed
|
2021-03-16 22:46:19 +01:00
|
|
|
if (this.config.broadcastNewsFeeds) {
|
|
|
|
this.sendNotification("NEWS_FEED", { items: this.newsItems });
|
2019-07-09 10:20:02 +02:00
|
|
|
}
|
|
|
|
|
2021-10-17 16:01:01 +02:00
|
|
|
// #2638 Clear timer if it already exists
|
|
|
|
if (this.timer) clearInterval(this.timer);
|
|
|
|
|
2021-03-16 22:46:19 +01:00
|
|
|
this.timer = setInterval(() => {
|
|
|
|
this.activeItem++;
|
|
|
|
this.updateDom(this.config.animationSpeed);
|
2019-05-31 16:23:40 +02:00
|
|
|
|
|
|
|
// Broadcast NewsFeed if needed
|
2021-03-16 22:46:19 +01:00
|
|
|
if (this.config.broadcastNewsFeeds) {
|
|
|
|
this.sendNotification("NEWS_FEED", { items: this.newsItems });
|
2019-05-31 16:23:40 +02:00
|
|
|
}
|
2016-03-29 15:44:43 +02:00
|
|
|
}, this.config.updateInterval);
|
|
|
|
},
|
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
resetDescrOrFullArticleAndTimer: function () {
|
2018-05-15 20:32:02 -04:00
|
|
|
this.isShowingDescription = this.config.showDescription;
|
2017-01-08 14:38:16 +01:00
|
|
|
this.config.showFullArticle = false;
|
2018-01-29 21:26:34 +01:00
|
|
|
this.scrollPosition = 0;
|
|
|
|
// reset bottom bar alignment
|
2021-01-16 11:52:55 +01:00
|
|
|
document.getElementsByClassName("region bottom bar")[0].classList.remove("newsfeed-fullarticle");
|
2020-05-11 22:22:32 +02:00
|
|
|
if (!this.timer) {
|
2017-01-08 14:38:16 +01:00
|
|
|
this.scheduleUpdateInterval();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
notificationReceived: function (notification, payload, sender) {
|
2020-07-12 12:45:32 +02:00
|
|
|
const before = this.activeItem;
|
2021-01-16 12:26:38 +01:00
|
|
|
if (notification === "MODULE_DOM_CREATED" && this.config.hideLoading) {
|
|
|
|
this.hide();
|
|
|
|
} else if (notification === "ARTICLE_NEXT") {
|
2017-01-06 21:57:30 +01:00
|
|
|
this.activeItem++;
|
|
|
|
if (this.activeItem >= this.newsItems.length) {
|
|
|
|
this.activeItem = 0;
|
2017-01-04 10:46:31 +01:00
|
|
|
}
|
2017-01-08 14:38:16 +01:00
|
|
|
this.resetDescrOrFullArticleAndTimer();
|
Release 2.23.0 (#3078)
## [2.23.0] - 2023-04-04
Thanks to: @angeldeejay, @buxxi, @CarJem, @dariom, @DaveChild, @dWoolridge, @grenagit, @Hirschberger, @KristjanESPERANTO, @MagMar94, @naveensrinivasan, @nfogal, @psieg, @rajniszp, @retroflex, @SkySails and @tomzt.
Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not all) of the work on this release as project collaborators. This version would not be there without their effort. Thank you guys! You are awesome!
### Added
- Added increments for hourly forecasts in weather module (#2996)
- Added tests for hourly weather forecast
- Added possibility to ignore MagicMirror repo in updatenotification module
- Added Pirate Weather as new weather provider (#3005)
- Added possibility to use your own templates in Alert module
- Added error message if `<modulename>.js` file is missing in module folder to get a hint in the logs (#2403)
- Added possibility to use environment variables in `config.js` (#1756)
- Added option `pastDaysCount` to default calendar module to control of how many days past events should be displayed
- Added thai language to alert module
- Added option `sendNotifications` in clock module (#3056)
### Removed
- Removed darksky weather provider
- Removed unneeded (and unwanted) '.' after the year in calendar repeatingCountTitle (#2896)
### Updated
- Use develop as target branch for dependabot
- Update issue template, contributing doc and sample config
- The weather modules clearly separates precipitation amount and probability (risk of rain/snow)
- This requires all providers that only supports probability to change the config from `showPrecipitationAmount` to `showPrecipitationProbability`.
- Update tests for weather and calendar module
- Changed updatenotification module for MagicMirror repo only: Send only notifications for `master` if there is a tag on a newer commit
- Update dates in Calendar widgets every minute
- Cleanup jest coverage for patches
- Update `stylelint` dependencies, switch to `stylelint-config-standard` and handle `stylelint` issues, update `main.css` matching new rules
- Update Eslint config, add new rule and handle issue
- Convert lots of callbacks to async/await
- Revise require imports (#3071 and #3072)
### Fixed
- Fix wrong day labels in envcanada forecast (#2987)
- Fix for missing default class name prefix for customEvents in calendar
- Fix electron flashing white screen on startup (#1919)
- Fix weathergov provider hourly forecast (#3008)
- Fix message display with HTML code into alert module (#2828)
- Fix typo in french translation
- Yr wind direction is no longer inverted
- Fix async node_helper stopping electron start (#2487)
- The wind direction arrow now points in the direction the wind is flowing, not into the wind (#3019)
- Fix precipitation css styles and rounding value
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
- Fix empty news feed stopping the reload forever
- Fix e2e tests (failed after async changes) by running calendar and newsfeed tests last
- Lint: Use template literals instead of string concatenation
- Fix default alert module to render HTML for title and message
- Fix Open-Meteo wind speed units
2023-04-04 20:44:32 +02:00
|
|
|
Log.debug(`${this.name} - going from article #${before} to #${this.activeItem} (of ${this.newsItems.length})`);
|
2017-01-06 21:57:30 +01:00
|
|
|
this.updateDom(100);
|
2020-05-11 22:22:32 +02:00
|
|
|
} else if (notification === "ARTICLE_PREVIOUS") {
|
2017-01-06 21:57:30 +01:00
|
|
|
this.activeItem--;
|
|
|
|
if (this.activeItem < 0) {
|
|
|
|
this.activeItem = this.newsItems.length - 1;
|
2017-01-04 10:46:31 +01:00
|
|
|
}
|
2017-01-08 14:38:16 +01:00
|
|
|
this.resetDescrOrFullArticleAndTimer();
|
Release 2.23.0 (#3078)
## [2.23.0] - 2023-04-04
Thanks to: @angeldeejay, @buxxi, @CarJem, @dariom, @DaveChild, @dWoolridge, @grenagit, @Hirschberger, @KristjanESPERANTO, @MagMar94, @naveensrinivasan, @nfogal, @psieg, @rajniszp, @retroflex, @SkySails and @tomzt.
Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not all) of the work on this release as project collaborators. This version would not be there without their effort. Thank you guys! You are awesome!
### Added
- Added increments for hourly forecasts in weather module (#2996)
- Added tests for hourly weather forecast
- Added possibility to ignore MagicMirror repo in updatenotification module
- Added Pirate Weather as new weather provider (#3005)
- Added possibility to use your own templates in Alert module
- Added error message if `<modulename>.js` file is missing in module folder to get a hint in the logs (#2403)
- Added possibility to use environment variables in `config.js` (#1756)
- Added option `pastDaysCount` to default calendar module to control of how many days past events should be displayed
- Added thai language to alert module
- Added option `sendNotifications` in clock module (#3056)
### Removed
- Removed darksky weather provider
- Removed unneeded (and unwanted) '.' after the year in calendar repeatingCountTitle (#2896)
### Updated
- Use develop as target branch for dependabot
- Update issue template, contributing doc and sample config
- The weather modules clearly separates precipitation amount and probability (risk of rain/snow)
- This requires all providers that only supports probability to change the config from `showPrecipitationAmount` to `showPrecipitationProbability`.
- Update tests for weather and calendar module
- Changed updatenotification module for MagicMirror repo only: Send only notifications for `master` if there is a tag on a newer commit
- Update dates in Calendar widgets every minute
- Cleanup jest coverage for patches
- Update `stylelint` dependencies, switch to `stylelint-config-standard` and handle `stylelint` issues, update `main.css` matching new rules
- Update Eslint config, add new rule and handle issue
- Convert lots of callbacks to async/await
- Revise require imports (#3071 and #3072)
### Fixed
- Fix wrong day labels in envcanada forecast (#2987)
- Fix for missing default class name prefix for customEvents in calendar
- Fix electron flashing white screen on startup (#1919)
- Fix weathergov provider hourly forecast (#3008)
- Fix message display with HTML code into alert module (#2828)
- Fix typo in french translation
- Yr wind direction is no longer inverted
- Fix async node_helper stopping electron start (#2487)
- The wind direction arrow now points in the direction the wind is flowing, not into the wind (#3019)
- Fix precipitation css styles and rounding value
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
- Fix empty news feed stopping the reload forever
- Fix e2e tests (failed after async changes) by running calendar and newsfeed tests last
- Lint: Use template literals instead of string concatenation
- Fix default alert module to render HTML for title and message
- Fix Open-Meteo wind speed units
2023-04-04 20:44:32 +02:00
|
|
|
Log.debug(`${this.name} - going from article #${before} to #${this.activeItem} (of ${this.newsItems.length})`);
|
2017-01-06 21:57:30 +01:00
|
|
|
this.updateDom(100);
|
|
|
|
}
|
2017-01-08 14:38:16 +01:00
|
|
|
// if "more details" is received the first time: show article summary, on second time show full article
|
2020-05-11 22:22:32 +02:00
|
|
|
else if (notification === "ARTICLE_MORE_DETAILS") {
|
2018-01-29 21:26:34 +01:00
|
|
|
// full article is already showing, so scrolling down
|
2020-05-11 22:22:32 +02:00
|
|
|
if (this.config.showFullArticle === true) {
|
2018-01-29 21:26:34 +01:00
|
|
|
this.scrollPosition += this.config.scrollLength;
|
|
|
|
window.scrollTo(0, this.scrollPosition);
|
Release 2.23.0 (#3078)
## [2.23.0] - 2023-04-04
Thanks to: @angeldeejay, @buxxi, @CarJem, @dariom, @DaveChild, @dWoolridge, @grenagit, @Hirschberger, @KristjanESPERANTO, @MagMar94, @naveensrinivasan, @nfogal, @psieg, @rajniszp, @retroflex, @SkySails and @tomzt.
Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not all) of the work on this release as project collaborators. This version would not be there without their effort. Thank you guys! You are awesome!
### Added
- Added increments for hourly forecasts in weather module (#2996)
- Added tests for hourly weather forecast
- Added possibility to ignore MagicMirror repo in updatenotification module
- Added Pirate Weather as new weather provider (#3005)
- Added possibility to use your own templates in Alert module
- Added error message if `<modulename>.js` file is missing in module folder to get a hint in the logs (#2403)
- Added possibility to use environment variables in `config.js` (#1756)
- Added option `pastDaysCount` to default calendar module to control of how many days past events should be displayed
- Added thai language to alert module
- Added option `sendNotifications` in clock module (#3056)
### Removed
- Removed darksky weather provider
- Removed unneeded (and unwanted) '.' after the year in calendar repeatingCountTitle (#2896)
### Updated
- Use develop as target branch for dependabot
- Update issue template, contributing doc and sample config
- The weather modules clearly separates precipitation amount and probability (risk of rain/snow)
- This requires all providers that only supports probability to change the config from `showPrecipitationAmount` to `showPrecipitationProbability`.
- Update tests for weather and calendar module
- Changed updatenotification module for MagicMirror repo only: Send only notifications for `master` if there is a tag on a newer commit
- Update dates in Calendar widgets every minute
- Cleanup jest coverage for patches
- Update `stylelint` dependencies, switch to `stylelint-config-standard` and handle `stylelint` issues, update `main.css` matching new rules
- Update Eslint config, add new rule and handle issue
- Convert lots of callbacks to async/await
- Revise require imports (#3071 and #3072)
### Fixed
- Fix wrong day labels in envcanada forecast (#2987)
- Fix for missing default class name prefix for customEvents in calendar
- Fix electron flashing white screen on startup (#1919)
- Fix weathergov provider hourly forecast (#3008)
- Fix message display with HTML code into alert module (#2828)
- Fix typo in french translation
- Yr wind direction is no longer inverted
- Fix async node_helper stopping electron start (#2487)
- The wind direction arrow now points in the direction the wind is flowing, not into the wind (#3019)
- Fix precipitation css styles and rounding value
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
- Fix empty news feed stopping the reload forever
- Fix e2e tests (failed after async changes) by running calendar and newsfeed tests last
- Lint: Use template literals instead of string concatenation
- Fix default alert module to render HTML for title and message
- Fix Open-Meteo wind speed units
2023-04-04 20:44:32 +02:00
|
|
|
Log.debug(`${this.name} - scrolling down`);
|
|
|
|
Log.debug(`${this.name} - ARTICLE_MORE_DETAILS, scroll position: ${this.config.scrollLength}`);
|
2020-05-11 22:22:32 +02:00
|
|
|
} else {
|
2018-07-07 16:35:07 +02:00
|
|
|
this.showFullArticle();
|
2018-01-29 21:26:34 +01:00
|
|
|
}
|
2020-05-11 22:22:32 +02:00
|
|
|
} else if (notification === "ARTICLE_SCROLL_UP") {
|
|
|
|
if (this.config.showFullArticle === true) {
|
2018-04-17 00:25:58 +02:00
|
|
|
this.scrollPosition -= this.config.scrollLength;
|
|
|
|
window.scrollTo(0, this.scrollPosition);
|
Release 2.23.0 (#3078)
## [2.23.0] - 2023-04-04
Thanks to: @angeldeejay, @buxxi, @CarJem, @dariom, @DaveChild, @dWoolridge, @grenagit, @Hirschberger, @KristjanESPERANTO, @MagMar94, @naveensrinivasan, @nfogal, @psieg, @rajniszp, @retroflex, @SkySails and @tomzt.
Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not all) of the work on this release as project collaborators. This version would not be there without their effort. Thank you guys! You are awesome!
### Added
- Added increments for hourly forecasts in weather module (#2996)
- Added tests for hourly weather forecast
- Added possibility to ignore MagicMirror repo in updatenotification module
- Added Pirate Weather as new weather provider (#3005)
- Added possibility to use your own templates in Alert module
- Added error message if `<modulename>.js` file is missing in module folder to get a hint in the logs (#2403)
- Added possibility to use environment variables in `config.js` (#1756)
- Added option `pastDaysCount` to default calendar module to control of how many days past events should be displayed
- Added thai language to alert module
- Added option `sendNotifications` in clock module (#3056)
### Removed
- Removed darksky weather provider
- Removed unneeded (and unwanted) '.' after the year in calendar repeatingCountTitle (#2896)
### Updated
- Use develop as target branch for dependabot
- Update issue template, contributing doc and sample config
- The weather modules clearly separates precipitation amount and probability (risk of rain/snow)
- This requires all providers that only supports probability to change the config from `showPrecipitationAmount` to `showPrecipitationProbability`.
- Update tests for weather and calendar module
- Changed updatenotification module for MagicMirror repo only: Send only notifications for `master` if there is a tag on a newer commit
- Update dates in Calendar widgets every minute
- Cleanup jest coverage for patches
- Update `stylelint` dependencies, switch to `stylelint-config-standard` and handle `stylelint` issues, update `main.css` matching new rules
- Update Eslint config, add new rule and handle issue
- Convert lots of callbacks to async/await
- Revise require imports (#3071 and #3072)
### Fixed
- Fix wrong day labels in envcanada forecast (#2987)
- Fix for missing default class name prefix for customEvents in calendar
- Fix electron flashing white screen on startup (#1919)
- Fix weathergov provider hourly forecast (#3008)
- Fix message display with HTML code into alert module (#2828)
- Fix typo in french translation
- Yr wind direction is no longer inverted
- Fix async node_helper stopping electron start (#2487)
- The wind direction arrow now points in the direction the wind is flowing, not into the wind (#3019)
- Fix precipitation css styles and rounding value
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
- Fix empty news feed stopping the reload forever
- Fix e2e tests (failed after async changes) by running calendar and newsfeed tests last
- Lint: Use template literals instead of string concatenation
- Fix default alert module to render HTML for title and message
- Fix Open-Meteo wind speed units
2023-04-04 20:44:32 +02:00
|
|
|
Log.debug(`${this.name} - scrolling up`);
|
|
|
|
Log.debug(`${this.name} - ARTICLE_SCROLL_UP, scroll position: ${this.config.scrollLength}`);
|
2018-04-17 00:25:58 +02:00
|
|
|
}
|
2020-05-11 22:22:32 +02:00
|
|
|
} else if (notification === "ARTICLE_LESS_DETAILS") {
|
2017-01-08 14:38:16 +01:00
|
|
|
this.resetDescrOrFullArticleAndTimer();
|
Release 2.23.0 (#3078)
## [2.23.0] - 2023-04-04
Thanks to: @angeldeejay, @buxxi, @CarJem, @dariom, @DaveChild, @dWoolridge, @grenagit, @Hirschberger, @KristjanESPERANTO, @MagMar94, @naveensrinivasan, @nfogal, @psieg, @rajniszp, @retroflex, @SkySails and @tomzt.
Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not all) of the work on this release as project collaborators. This version would not be there without their effort. Thank you guys! You are awesome!
### Added
- Added increments for hourly forecasts in weather module (#2996)
- Added tests for hourly weather forecast
- Added possibility to ignore MagicMirror repo in updatenotification module
- Added Pirate Weather as new weather provider (#3005)
- Added possibility to use your own templates in Alert module
- Added error message if `<modulename>.js` file is missing in module folder to get a hint in the logs (#2403)
- Added possibility to use environment variables in `config.js` (#1756)
- Added option `pastDaysCount` to default calendar module to control of how many days past events should be displayed
- Added thai language to alert module
- Added option `sendNotifications` in clock module (#3056)
### Removed
- Removed darksky weather provider
- Removed unneeded (and unwanted) '.' after the year in calendar repeatingCountTitle (#2896)
### Updated
- Use develop as target branch for dependabot
- Update issue template, contributing doc and sample config
- The weather modules clearly separates precipitation amount and probability (risk of rain/snow)
- This requires all providers that only supports probability to change the config from `showPrecipitationAmount` to `showPrecipitationProbability`.
- Update tests for weather and calendar module
- Changed updatenotification module for MagicMirror repo only: Send only notifications for `master` if there is a tag on a newer commit
- Update dates in Calendar widgets every minute
- Cleanup jest coverage for patches
- Update `stylelint` dependencies, switch to `stylelint-config-standard` and handle `stylelint` issues, update `main.css` matching new rules
- Update Eslint config, add new rule and handle issue
- Convert lots of callbacks to async/await
- Revise require imports (#3071 and #3072)
### Fixed
- Fix wrong day labels in envcanada forecast (#2987)
- Fix for missing default class name prefix for customEvents in calendar
- Fix electron flashing white screen on startup (#1919)
- Fix weathergov provider hourly forecast (#3008)
- Fix message display with HTML code into alert module (#2828)
- Fix typo in french translation
- Yr wind direction is no longer inverted
- Fix async node_helper stopping electron start (#2487)
- The wind direction arrow now points in the direction the wind is flowing, not into the wind (#3019)
- Fix precipitation css styles and rounding value
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
- Fix empty news feed stopping the reload forever
- Fix e2e tests (failed after async changes) by running calendar and newsfeed tests last
- Lint: Use template literals instead of string concatenation
- Fix default alert module to render HTML for title and message
- Fix Open-Meteo wind speed units
2023-04-04 20:44:32 +02:00
|
|
|
Log.debug(`${this.name} - showing only article titles again`);
|
2017-01-06 21:57:30 +01:00
|
|
|
this.updateDom(100);
|
2020-05-11 22:22:32 +02:00
|
|
|
} else if (notification === "ARTICLE_TOGGLE_FULL") {
|
|
|
|
if (this.config.showFullArticle) {
|
2018-07-07 16:35:07 +02:00
|
|
|
this.activeItem++;
|
|
|
|
this.resetDescrOrFullArticleAndTimer();
|
|
|
|
} else {
|
|
|
|
this.showFullArticle();
|
|
|
|
}
|
2020-05-11 22:22:32 +02:00
|
|
|
} else if (notification === "ARTICLE_INFO_REQUEST") {
|
2019-03-25 01:08:59 +01:00
|
|
|
this.sendNotification("ARTICLE_INFO_RESPONSE", {
|
2020-05-11 22:22:32 +02:00
|
|
|
title: this.newsItems[this.activeItem].title,
|
2019-03-25 01:08:59 +01:00
|
|
|
source: this.newsItems[this.activeItem].sourceTitle,
|
2020-05-11 22:22:32 +02:00
|
|
|
date: this.newsItems[this.activeItem].pubdate,
|
|
|
|
desc: this.newsItems[this.activeItem].description,
|
|
|
|
url: this.getActiveItemURL()
|
2019-06-05 10:23:58 +02:00
|
|
|
});
|
2017-01-04 10:46:31 +01:00
|
|
|
}
|
|
|
|
},
|
2016-08-27 00:32:47 +02:00
|
|
|
|
2020-05-11 22:22:32 +02:00
|
|
|
showFullArticle: function () {
|
2018-07-07 16:35:07 +02:00
|
|
|
this.isShowingDescription = !this.isShowingDescription;
|
|
|
|
this.config.showFullArticle = !this.isShowingDescription;
|
|
|
|
// make bottom bar align to top to allow scrolling
|
2020-05-11 22:22:32 +02:00
|
|
|
if (this.config.showFullArticle === true) {
|
2021-01-16 11:52:55 +01:00
|
|
|
document.getElementsByClassName("region bottom bar")[0].classList.add("newsfeed-fullarticle");
|
2018-07-07 16:35:07 +02:00
|
|
|
}
|
2020-05-02 10:39:09 +02:00
|
|
|
clearInterval(this.timer);
|
|
|
|
this.timer = null;
|
Release 2.23.0 (#3078)
## [2.23.0] - 2023-04-04
Thanks to: @angeldeejay, @buxxi, @CarJem, @dariom, @DaveChild, @dWoolridge, @grenagit, @Hirschberger, @KristjanESPERANTO, @MagMar94, @naveensrinivasan, @nfogal, @psieg, @rajniszp, @retroflex, @SkySails and @tomzt.
Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not all) of the work on this release as project collaborators. This version would not be there without their effort. Thank you guys! You are awesome!
### Added
- Added increments for hourly forecasts in weather module (#2996)
- Added tests for hourly weather forecast
- Added possibility to ignore MagicMirror repo in updatenotification module
- Added Pirate Weather as new weather provider (#3005)
- Added possibility to use your own templates in Alert module
- Added error message if `<modulename>.js` file is missing in module folder to get a hint in the logs (#2403)
- Added possibility to use environment variables in `config.js` (#1756)
- Added option `pastDaysCount` to default calendar module to control of how many days past events should be displayed
- Added thai language to alert module
- Added option `sendNotifications` in clock module (#3056)
### Removed
- Removed darksky weather provider
- Removed unneeded (and unwanted) '.' after the year in calendar repeatingCountTitle (#2896)
### Updated
- Use develop as target branch for dependabot
- Update issue template, contributing doc and sample config
- The weather modules clearly separates precipitation amount and probability (risk of rain/snow)
- This requires all providers that only supports probability to change the config from `showPrecipitationAmount` to `showPrecipitationProbability`.
- Update tests for weather and calendar module
- Changed updatenotification module for MagicMirror repo only: Send only notifications for `master` if there is a tag on a newer commit
- Update dates in Calendar widgets every minute
- Cleanup jest coverage for patches
- Update `stylelint` dependencies, switch to `stylelint-config-standard` and handle `stylelint` issues, update `main.css` matching new rules
- Update Eslint config, add new rule and handle issue
- Convert lots of callbacks to async/await
- Revise require imports (#3071 and #3072)
### Fixed
- Fix wrong day labels in envcanada forecast (#2987)
- Fix for missing default class name prefix for customEvents in calendar
- Fix electron flashing white screen on startup (#1919)
- Fix weathergov provider hourly forecast (#3008)
- Fix message display with HTML code into alert module (#2828)
- Fix typo in french translation
- Yr wind direction is no longer inverted
- Fix async node_helper stopping electron start (#2487)
- The wind direction arrow now points in the direction the wind is flowing, not into the wind (#3019)
- Fix precipitation css styles and rounding value
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
- Fix empty news feed stopping the reload forever
- Fix e2e tests (failed after async changes) by running calendar and newsfeed tests last
- Lint: Use template literals instead of string concatenation
- Fix default alert module to render HTML for title and message
- Fix Open-Meteo wind speed units
2023-04-04 20:44:32 +02:00
|
|
|
Log.debug(`${this.name} - showing ${this.isShowingDescription ? "article description" : "full article"}`);
|
2018-07-07 16:35:07 +02:00
|
|
|
this.updateDom(100);
|
|
|
|
}
|
2016-03-29 15:44:43 +02:00
|
|
|
});
|