summaryrefslogtreecommitdiffstats
path: root/lib/models/plugin.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models/plugin.js')
-rw-r--r--lib/models/plugin.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/models/plugin.js b/lib/models/plugin.js
index ed7ad82..372558b 100644
--- a/lib/models/plugin.js
+++ b/lib/models/plugin.js
@@ -74,6 +74,23 @@ Plugin.prototype.getHooks = function() {
};
/**
+ Return infos about resources for a specific type
+
+ @param {String} type
+ @return {Map<String:Mixed>}
+*/
+Plugin.prototype.getResources = function(type) {
+ if (type != 'website' && type != 'ebook') {
+ throw new Error('Invalid assets type ' + type);
+ }
+
+ var content = this.getContent();
+ return (content.get(type)
+ || (type == 'website'? content.get('book') : null)
+ || Immutable.Map());
+};
+
+/**
Return map of filters
@return {Map<String:Function>}
*/