apostrophe-rss
Advanced tools
Comparing version 0.0.3 to 0.0.5
23
index.js
var feedparser = require('feedparser'); | ||
var extend = require('extend'); | ||
var cache = {}; | ||
@@ -16,4 +16,10 @@ | ||
self.pushAsset = function(type, name) { | ||
return apos.pushAsset(type, name, __dirname, '/apos-rss'); | ||
self.pushAsset = function(type, name, optionsArg) { | ||
var options = {}; | ||
if (optionsArg) { | ||
extend(true, options, optionsArg); | ||
} | ||
options.fs = __dirname; | ||
options.web = '/apos-rss'; | ||
return apos.pushAsset(type, name, options); | ||
}; | ||
@@ -26,3 +32,3 @@ | ||
// Include our editor template in the markup when aposTemplates is called | ||
self.pushAsset('template', 'rssEditor'); | ||
self.pushAsset('template', 'rssEditor', { when: 'user' }); | ||
@@ -33,4 +39,4 @@ // Make sure that aposScripts and aposStylesheets summon our assets | ||
// resources needed also by non-editing users.) | ||
self.pushAsset('script', 'rss'); | ||
self.pushAsset('stylesheet', 'rss'); | ||
self.pushAsset('script', 'editor', { when: 'user' }); | ||
self.pushAsset('stylesheet', 'content', { when: 'always' }); | ||
@@ -44,2 +50,3 @@ // Serve our assets | ||
css: 'rss', | ||
icon: 'rss', | ||
sanitize: function(item) { | ||
@@ -49,4 +56,3 @@ if (!item.feed.match(/^https?\:\/\//)) { | ||
} | ||
item.limit = parseInt(item.limit); | ||
console.log(item); | ||
item.limit = parseInt(item.limit, 10); | ||
}, | ||
@@ -72,3 +78,2 @@ render: function(data) { | ||
articles = articles.slice(0, item.limit); | ||
console.log('SLICED: ', articles.length); | ||
@@ -75,0 +80,0 @@ // map is native in node |
{ | ||
"name": "apostrophe-rss", | ||
"version": "0.0.3", | ||
"version": "0.0.5", | ||
"description": "Adds an RSS feed widget to the Apostrophe content management system", | ||
@@ -25,5 +25,6 @@ "main": "index.js", | ||
"dependencies": { | ||
"feedparser": "~0.11.0" | ||
"feedparser": "~0.11.0", | ||
"extend": "~1.1.3" | ||
}, | ||
"devDependencies": {} | ||
} |
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
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
7986
10
2
119
+ Addedextend@~1.1.3
+ Addedextend@1.1.3(transitive)