mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-10 09:14:37 +00:00
Allow for the removal of feed tags
Added options: both, description, title
This commit is contained in:
parent
43a0829f44
commit
c427050a92
@ -25,8 +25,8 @@ Module.register("newsfeed",{
|
|||||||
updateInterval: 10 * 1000,
|
updateInterval: 10 * 1000,
|
||||||
animationSpeed: 2.5 * 1000,
|
animationSpeed: 2.5 * 1000,
|
||||||
maxNewsItems: 0, // 0 for unlimited
|
maxNewsItems: 0, // 0 for unlimited
|
||||||
removeStartTags: false,
|
removeStartTags: '',
|
||||||
removeEndTags: false,
|
removeEndTags: '',
|
||||||
startTags: [],
|
startTags: [],
|
||||||
endTags: []
|
endTags: []
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ Module.register("newsfeed",{
|
|||||||
|
|
||||||
//Remove selected tags from the beginning of rss feed items (title or description)
|
//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++) {
|
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]) {
|
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) {
|
if (this.config.showDescription) {
|
||||||
for (f=0; f<this.config.startTags.length;f++) {
|
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]) {
|
if (this.newsItems[this.activeItem].description.slice(0,this.config.startTags[f].length) == this.config.startTags[f]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user