Merge pull request #769 from amcolash/single_line_news

Add in single line news items
This commit is contained in:
Michael Teeuw 2017-03-17 13:27:13 +01:00 committed by GitHub
commit 28eb0be4ad
4 changed files with 13 additions and 2 deletions

View File

@ -49,6 +49,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Korean Translation.
- Added console warning on startup when deprecated config options are used
- Add option to display temperature unit label to the current weather module
- Added ability to disable wrapping of news items
### Fixed
- Update .gitignore to not ignore default modules folder.

View File

@ -121,6 +121,12 @@ sup {
margin-bottom: 0;
}
.no-wrap {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/**
* Region Definitions.
*/

View File

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

View File

@ -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);
}