apostrophe-rss
Advanced tools
Comparing version 0.0.7 to 0.0.8
{ | ||
"name": "apostrophe-rss", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Adds an RSS feed widget to the Apostrophe content management system", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,43 +0,44 @@ | ||
apos.widgetTypes.rss = { | ||
label: 'RSS', | ||
editor: function(options) { | ||
var self = this; | ||
if (!options.messages) { | ||
options.messages = {}; | ||
} | ||
if (!options.messages.missing) { | ||
options.messages.missing = 'Paste in an RSS feed URL first.'; | ||
} | ||
// @class Editor for RSS feed widgets | ||
self.afterCreatingEl = function() { | ||
self.$feed = self.$el.find('[name="feed"]'); | ||
self.$feed.val(self.data.feed); | ||
self.$limit = self.$el.find('[name="limit"]'); | ||
self.$limit.val(self.data.limit); | ||
setTimeout(function() { | ||
self.$feed.focus(); | ||
self.$feed.setSelection(0, 0); | ||
}, 500); | ||
}; | ||
function AposRssWidgetEditor(options) { | ||
var self = this; | ||
self.type = 'rss'; | ||
options.template = '.apos-rss-editor'; | ||
if (!options.messages) { | ||
options.messages = {}; | ||
} | ||
if (!options.messages.missing) { | ||
options.messages.missing = 'Paste in an RSS feed URL first.'; | ||
} | ||
self.prePreview = getFeed; | ||
self.preSave = getFeed; | ||
self.type = 'rss'; | ||
options.template = '.apos-rss-editor'; | ||
function getFeed(callback) { | ||
self.exists = !!self.$feed.val(); | ||
if (self.exists) { | ||
self.data.feed = self.$feed.val(); | ||
self.data.limit = self.$limit.val(); | ||
} | ||
return callback(); | ||
self.prePreview = getFeed; | ||
self.preSave = getFeed; | ||
AposWidgetEditor.call(self, options); | ||
self.afterCreatingEl = function() { | ||
self.$feed = self.$el.find('[name="feed"]'); | ||
self.$feed.val(self.data.feed); | ||
self.$limit = self.$el.find('[name="limit"]'); | ||
self.$limit.val(self.data.limit); | ||
setTimeout(function() { | ||
self.$feed.focus(); | ||
self.$feed.setSelection(0, 0); | ||
}, 500); | ||
}; | ||
function getFeed(callback) { | ||
self.exists = !!self.$feed.val(); | ||
if (self.exists) { | ||
self.data.feed = self.$feed.val(); | ||
self.data.limit = self.$limit.val(); | ||
} | ||
return callback(); | ||
} | ||
} | ||
// Parent class constructor shared by all widget editors | ||
apos.widgetEditor.call(self, options); | ||
}, | ||
}; | ||
AposRssWidgetEditor.label = 'RSS Feed'; | ||
apos.addWidgetType('rss'); |
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
7709
113