apostrophe-rss
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -68,4 +68,7 @@ var feedparser = require('feedparser'); | ||
var now = new Date(); | ||
if (cache.hasOwnProperty(item.feed) && ((cache[item.feed].when + lifetime) > now.getTime())) { | ||
item._entries = cache[item.feed].data; | ||
// Take all properties into account, not just the feed, so the cache | ||
// doesn't prevent us from seeing a change in the limit property right away | ||
var key = JSON.stringify({ feed: item.feed, limit: item.limit }); | ||
if (cache.hasOwnProperty(key) && ((cache[key].when + lifetime) > now.getTime())) { | ||
item._entries = cache[key].data; | ||
return callback(); | ||
@@ -86,3 +89,3 @@ } | ||
// Cache for fast access later | ||
cache[item.feed] = { when: now.getTime(), data: item._entries }; | ||
cache[key] = { when: now.getTime(), data: item._entries }; | ||
return callback(); | ||
@@ -89,0 +92,0 @@ }).on('error', function(error) { |
{ | ||
"name": "apostrophe-rss", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Adds an RSS feed widget to the Apostrophe content management system", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,7 +16,7 @@ // @class Editor for RSS feed widgets | ||
AposWidgetEditor.call(self, options); | ||
self.prePreview = getFeed; | ||
self.preSave = getFeed; | ||
AposWidgetEditor.call(self, options); | ||
self.afterCreatingEl = function() { | ||
@@ -26,3 +26,3 @@ self.$feed = self.$el.find('[name="feed"]'); | ||
self.$limit = self.$el.find('[name="limit"]'); | ||
self.$limit.val(self.data.limit); | ||
self.$limit.val(self.data.limit || 10); | ||
setTimeout(function() { | ||
@@ -39,2 +39,3 @@ self.$feed.focus(); | ||
self.data.limit = self.$limit.val(); | ||
apos.log('limit: ' + self.data.limit); | ||
} | ||
@@ -41,0 +42,0 @@ return callback(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7965
117
1