mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
first-commit
This commit is contained in:
commit
325c322a27
207 changed files with 35989 additions and 0 deletions
22
static/js/plugins.js
Normal file
22
static/js/plugins.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
plugins = {
|
||||
callHook: function (hookName, args) {
|
||||
var hook = clientVars.hooks[hookName];
|
||||
if (hook === undefined)
|
||||
return [];
|
||||
var res = [];
|
||||
for (var i = 0, N=hook.length; i < N; i++) {
|
||||
var plugin = hook[i];
|
||||
var pluginRes = eval(plugin.plugin)[plugin.original || hookName](args);
|
||||
if (pluginRes != undefined && pluginRes != null)
|
||||
res = res.concat(pluginRes);
|
||||
}
|
||||
return res;
|
||||
},
|
||||
|
||||
callHookStr: function (hookName, args, sep, pre, post) {
|
||||
if (sep == undefined) sep = '';
|
||||
if (pre == undefined) pre = '';
|
||||
if (post == undefined) post = '';
|
||||
return plugins.callHook(hookName, args).map(function (x) { return pre + x + post}).join(sep || "");
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue