mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
new options
* truncated description support * specific reloadInterval for particular feed
This commit is contained in:
parent
df597f53b2
commit
12110a4442
@ -23,6 +23,8 @@ Module.register("newsfeed",{
|
||||
showDescription: false,
|
||||
wrapTitle: true,
|
||||
wrapDescription: true,
|
||||
truncDescription: true,
|
||||
lengthDescription: 400,
|
||||
hideLoading: false,
|
||||
reloadInterval: 5 * 60 * 1000, // every 5 minutes
|
||||
updateInterval: 10 * 1000,
|
||||
@ -35,7 +37,6 @@ Module.register("newsfeed",{
|
||||
startTags: [],
|
||||
endTags: [],
|
||||
prohibitedWords: []
|
||||
|
||||
},
|
||||
|
||||
// Define required scripts.
|
||||
@ -169,7 +170,9 @@ Module.register("newsfeed",{
|
||||
if (this.config.showDescription) {
|
||||
var description = document.createElement("div");
|
||||
description.className = "small light" + (!this.config.wrapDescription ? " no-wrap" : "");
|
||||
description.innerHTML = this.newsItems[this.activeItem].description;
|
||||
var txtDesc = this.newsItems[this.activeItem].description;
|
||||
//Log.info('txtDesc.length = ' + txtDesc.length + " - " + this.config.lengthDescription);
|
||||
description.innerHTML = (this.config.truncDescription ? (txtDesc.length > this.config.lengthDescription ? txtDesc.substring(0, this.config.lengthDescription) + "..." : txtDesc) : txtDesc);
|
||||
wrapper.appendChild(description);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user