diff options
author | John McLear <john@mclear.co.uk> | 2012-06-22 03:53:50 -0700 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2012-06-22 03:53:50 -0700 |
commit | e4ff4021ab016728a711dd98e8a734e0868ffd53 (patch) | |
tree | 3cf1a8dafe548a9dec9e9c153db5cba7bdccad4b /src/static/js/pluginfw/plugins.js | |
parent | ab467310f58d6c4e9cb1d73ebf2fc30a51a827c5 (diff) | |
parent | 476cfc8da0d26b876480665ece4e7ff9a85315fc (diff) | |
download | etherpad-lite-e4ff4021ab016728a711dd98e8a734e0868ffd53.zip |
Merge pull request #810 from redhog/aceEditEvent
Plugin/hook features&bugfixes
Diffstat (limited to 'src/static/js/pluginfw/plugins.js')
-rw-r--r-- | src/static/js/pluginfw/plugins.js | 14 |
1 files changed, 8 insertions, 6 deletions
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] || {}) |