summaryrefslogtreecommitdiff
path: root/src/static/js/pluginfw
diff options
context:
space:
mode:
Diffstat (limited to 'src/static/js/pluginfw')
-rw-r--r--src/static/js/pluginfw/hooks.js2
-rw-r--r--src/static/js/pluginfw/plugins.js14
2 files changed, 9 insertions, 7 deletions
diff --git a/src/static/js/pluginfw/hooks.js b/src/static/js/pluginfw/hooks.js
index 49e46c60..7281cac9 100644
--- a/src/static/js/pluginfw/hooks.js
+++ b/src/static/js/pluginfw/hooks.js
@@ -102,7 +102,7 @@ exports.aCallAll = function (hook_name, args, cb) {
exports.callFirst = function (hook_name, args) {
if (!args) args = {};
- if (plugins.hooks[hook_name][0] === undefined) return [];
+ if (plugins.hooks[hook_name] === undefined) return [];
return exports.syncMapFirst(plugins.hooks[hook_name], function (hook) {
return hookCallWrapper(hook, hook_name, args);
});
diff --git a/src/static/js/pluginfw/plugins.js b/src/static/js/pluginfw/plugins.js
index 1f66da41..1d486223 100644
--- a/src/static/js/pluginfw/plugins.js
+++ b/src/static/js/pluginfw/plugins.js
@@ -41,14 +41,16 @@ exports.formatParts = function () {
return _.map(exports.parts, function (part) { return part.full_name; }).join("\n");
};
-exports.formatHooks = function () {
+exports.formatHooks = function (hook_set_name) {
var res = [];
- _.chain(exports.hooks).keys().forEach(function (hook_name) {
- _.forEach(exports.hooks[hook_name], function (hook) {
- res.push(hook.hook_name + ": " + hook.hook_fn_name + " from " + hook.part.full_name);
+ var hooks = exports.extractHooks(exports.parts, hook_set_name || "hooks");
+
+ _.chain(hooks).keys().forEach(function (hook_name) {
+ _.forEach(hooks[hook_name], function (hook) {
+ res.push("<dt>" + hook.hook_name + "</dt><dd>" + hook.hook_fn_name + " from " + hook.part.full_name + "</dd>");
});
});
- return res.join("\n");
+ return "<dl>" + res.join("\n") + "</dl>";
};
exports.loadFn = function (path, hookName) {
@@ -62,7 +64,7 @@ exports.loadFn = function (path, hookName) {
return fn;
};
-exports.extractHooks = function (parts, hook_set_name, plugins) {
+exports.extractHooks = function (parts, hook_set_name) {
var hooks = {};
_.each(parts,function (part) {
_.chain(part[hook_set_name] || {})