Allow for the removal of feed tags

Added options: both, description, title
This commit is contained in:
yo-less 2016-08-27 01:16:31 +02:00
parent 43a0829f44
commit c427050a92

View File

@ -25,8 +25,8 @@ Module.register("newsfeed",{
updateInterval: 10 * 1000,
animationSpeed: 2.5 * 1000,
maxNewsItems: 0, // 0 for unlimited
removeStartTags: false,
removeEndTags: false,
removeStartTags: '',
removeEndTags: '',
startTags: [],
endTags: []
@ -103,7 +103,7 @@ Module.register("newsfeed",{
//Remove selected tags from the beginning of rss feed items (title or description)
if (this.config.removeStartTags) {
if (this.config.removeStartTags == 'title' || 'both') {
for (f=0; f<this.config.startTags.length;f++) {
if (this.newsItems[this.activeItem].title.slice(0,this.config.startTags[f].length) == this.config.startTags[f]) {
@ -111,6 +111,10 @@ Module.register("newsfeed",{
}
}
}
if (this.config.removeStartTags == 'description' || 'both') {
if (this.config.showDescription) {
for (f=0; f<this.config.startTags.length;f++) {
if (this.newsItems[this.activeItem].description.slice(0,this.config.startTags[f].length) == this.config.startTags[f]) {