summaryrefslogtreecommitdiffstats
path: root/etherpad/src/static/js
diff options
context:
space:
mode:
authorEgil Moeller <egil.moller@freecode.no>2010-03-22 00:23:01 +0100
committerEgil Moeller <egil.moller@freecode.no>2010-03-22 00:23:01 +0100
commitf0050f45b67b0ca6539e03b23848e977f47c0905 (patch)
tree87f9168b0174b59b82fc5a116f6f24e5876f9c0b /etherpad/src/static/js
parentfc00cfedd6c25d1634a1e0d28a7b7bc5f42e1cd7 (diff)
downloadetherpad-f0050f45b67b0ca6539e03b23848e977f47c0905.tar.gz
etherpad-f0050f45b67b0ca6539e03b23848e977f47c0905.tar.bz2
etherpad-f0050f45b67b0ca6539e03b23848e977f47c0905.zip
Updated changes to adhere to new directory layout
Diffstat (limited to 'etherpad/src/static/js')
-rw-r--r--etherpad/src/static/js/plugins.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/etherpad/src/static/js/plugins.js b/etherpad/src/static/js/plugins.js
new file mode 100644
index 0000000..6d8804e
--- /dev/null
+++ b/etherpad/src/static/js/plugins.js
@@ -0,0 +1,19 @@
+function callHook(hookName, args) {
+ if (clientVars.hooks[hookName] === undefined)
+ return [];
+ var res = [];
+ for (i = 0; i < clientVars.hooks[hookName].length; i++) {
+ var plugin = clientVars.hooks[hookName][i];
+ var pluginRes = eval(plugin.plugin)[plugin.original || hookName](args);
+ if (pluginRes != undefined && pluginRes != null)
+ res = res.concat(pluginRes);
+ }
+ return res;
+}
+
+function callHookStr(hookName, args, sep, pre, post) {
+ if (sep == undefined) sep = '';
+ if (pre == undefined) pre = '';
+ if (post == undefined) post = '';
+ return callHook(hookName, args).map(function (x) { return pre + x + post}).join(sep || "");
+}