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,8 +23,10 @@ Module.register("newsfeed",{
|
|||||||
showDescription: false,
|
showDescription: false,
|
||||||
wrapTitle: true,
|
wrapTitle: true,
|
||||||
wrapDescription: true,
|
wrapDescription: true,
|
||||||
|
truncDescription: true,
|
||||||
|
lengthDescription: 400,
|
||||||
hideLoading: false,
|
hideLoading: false,
|
||||||
reloadInterval: 5 * 60 * 1000, // every 5 minutes
|
reloadInterval: 5 * 60 * 1000, // every 5 minutes
|
||||||
updateInterval: 10 * 1000,
|
updateInterval: 10 * 1000,
|
||||||
animationSpeed: 2.5 * 1000,
|
animationSpeed: 2.5 * 1000,
|
||||||
maxNewsItems: 0, // 0 for unlimited
|
maxNewsItems: 0, // 0 for unlimited
|
||||||
@ -35,7 +37,6 @@ Module.register("newsfeed",{
|
|||||||
startTags: [],
|
startTags: [],
|
||||||
endTags: [],
|
endTags: [],
|
||||||
prohibitedWords: []
|
prohibitedWords: []
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Define required scripts.
|
// Define required scripts.
|
||||||
@ -169,7 +170,9 @@ Module.register("newsfeed",{
|
|||||||
if (this.config.showDescription) {
|
if (this.config.showDescription) {
|
||||||
var description = document.createElement("div");
|
var description = document.createElement("div");
|
||||||
description.className = "small light" + (!this.config.wrapDescription ? " no-wrap" : "");
|
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);
|
wrapper.appendChild(description);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user