Add possibility to display item description. #157

This commit is contained in:
Michael Teeuw
2016-04-12 11:06:59 +02:00
parent a64699d064
commit af2f469b84
4 changed files with 46 additions and 63 deletions

View File

@@ -13,8 +13,9 @@ Module.register("newsfeed",{
defaults: {
feedUrl: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml",
showPublishDate: true,
showDescription: false,
reloadInterval: 5 * 60 * 1000, // every 5 minutes
updateInterval: 7.5 * 1000,
updateInterval: 10 * 1000,
animationSpeed: 2.5 * 1000,
encoding: "UTF-8" //ISO-8859-1
},
@@ -83,6 +84,13 @@ Module.register("newsfeed",{
title.innerHTML = this.newsItems[this.activeItem].title;
wrapper.appendChild(title);
if (this.config.showDescription) {
var description = document.createElement("div");
description.className = "small light";
description.innerHTML = this.newsItems[this.activeItem].description;
wrapper.appendChild(description);
}
} else {
wrapper.innerHTML = "Loading news ...";
wrapper.className = "small dimmed";