mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Add in option to have single line news
This commit is contained in:
parent
d26d94b62a
commit
afe0e3c1d6
@ -121,6 +121,12 @@ sup {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.no-wrap {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/**
|
||||
* Region Definitions.
|
||||
*/
|
||||
|
@ -63,6 +63,8 @@ The following properties can be configured:
|
||||
| `showSourceTitle` | Display the title of the source. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||
| `showPublishDate` | Display the publish date of an headline. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||
| `showDescription` | Display the description of an item. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `false`
|
||||
| `wrapTitle` | Wrap the title of the item to multiple lines. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||
| `wrapDescription` | Wrap the description of the item to multiple lines. <br><br> **Possible values:** `true` or `false` <br> **Default value:** `true`
|
||||
| `reloadInterval` | How often does the content needs to be fetched? (Milliseconds) <br><br> **Possible values:** `1000` - `86400000` <br> **Default value:** `300000` (5 minutes)
|
||||
| `updateInterval` | How often do you want to display a new headline? (Milliseconds) <br><br> **Possible values:**`1000` - `60000` <br> **Default value:** `10000` (10 seconds)
|
||||
| `animationSpeed` | Speed of the update animation. (Milliseconds) <br><br> **Possible values:**`0` - `5000` <br> **Default value:** `2500` (2.5 seconds)
|
||||
|
@ -21,6 +21,8 @@ Module.register("newsfeed",{
|
||||
showSourceTitle: true,
|
||||
showPublishDate: true,
|
||||
showDescription: false,
|
||||
wrapTitle: true,
|
||||
wrapDescription: true,
|
||||
reloadInterval: 5 * 60 * 1000, // every 5 minutes
|
||||
updateInterval: 10 * 1000,
|
||||
animationSpeed: 2.5 * 1000,
|
||||
@ -155,14 +157,14 @@ Module.register("newsfeed",{
|
||||
|
||||
if(!this.config.showFullArticle){
|
||||
var title = document.createElement("div");
|
||||
title.className = "bright medium light";
|
||||
title.className = "bright medium light" + (!this.config.wrapTitle ? " no-wrap" : "");
|
||||
title.innerHTML = this.newsItems[this.activeItem].title;
|
||||
wrapper.appendChild(title);
|
||||
}
|
||||
|
||||
if (this.config.showDescription) {
|
||||
var description = document.createElement("div");
|
||||
description.className = "small light";
|
||||
description.className = "small light" + (!this.config.wrapDescription ? " no-wrap" : "");
|
||||
description.innerHTML = this.newsItems[this.activeItem].description;
|
||||
wrapper.appendChild(description);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user