diff options
author | Peter Martischka <pita@pitapoison.de> | 2010-04-04 19:30:52 +0200 |
---|---|---|
committer | Peter Martischka <pita@pitapoison.de> | 2010-04-04 19:30:52 +0200 |
commit | 0c4322daa175fd81cf3f9aaa5b7c912c70be3f7d (patch) | |
tree | 591af146f6658e65d46524dc719a491dd8d95318 | |
parent | a7e7f1e0766dee5f69d5125b9c400aeeb28c5309 (diff) | |
parent | 49c31d0d5b028bf7a5c79a23192853e6aa3a43b1 (diff) | |
download | etherpad-0c4322daa175fd81cf3f9aaa5b7c912c70be3f7d.tar.gz etherpad-0c4322daa175fd81cf3f9aaa5b7c912c70be3f7d.tar.xz etherpad-0c4322daa175fd81cf3f9aaa5b7c912c70be3f7d.zip |
Merge branch 'master' of git://github.com/redhog/pad
Diffstat (limited to '')
-rw-r--r-- | etherpad/src/etherpad/admin/plugins.js | 3 | ||||
-rw-r--r-- | etherpad/src/main.js | 30 |
2 files changed, 18 insertions, 15 deletions
diff --git a/etherpad/src/etherpad/admin/plugins.js b/etherpad/src/etherpad/admin/plugins.js index 7b59662..384817f 100644 --- a/etherpad/src/etherpad/admin/plugins.js +++ b/etherpad/src/etherpad/admin/plugins.js @@ -232,7 +232,8 @@ function callHook(hookName, args) { var plugin = hooks[hookName][i]; var pluginRes = pluginModules[plugin.plugin][plugin.original || hookName](args); if (pluginRes != undefined && pluginRes != null) - res = res.concat(pluginRes); + for (var i = 0; i < pluginRes.length; i++) + res.push(pluginRes[i]); /* Don't use Array.concat as it flatterns arrays within the array */ } return res; } diff --git a/etherpad/src/main.js b/etherpad/src/main.js index 745f5fa..9035f2d 100644 --- a/etherpad/src/main.js +++ b/etherpad/src/main.js @@ -364,20 +364,22 @@ function handlePath() { // these paths are handled identically on all sites/subdomains. var commonDispatcher = new Dispatcher(); - commonDispatcher.addLocations( - plugins.callHook('handlePath').concat([ - ['/favicon.ico', forward(static_control)], - ['/robots.txt', forward(static_control)], - ['/crossdomain.xml', forward(static_control)], - [PrefixMatcher('/static/'), forward(static_control)], - [PrefixMatcher('/ep/genimg/'), genimg.renderPath], - [PrefixMatcher('/ep/pad/'), forward(pad_control)], - [PrefixMatcher('/ep/script/'), forward(scriptcontrol)], - [/^\/([^\/]+)$/, pad_control.render_pad], - [DirMatcher('/ep/unit-tests/'), forward(testcontrol)], - [DirMatcher('/ep/pne-manual/'), forward(pne_manual_control)], - [DirMatcher('/ep/pro-help/'), forward(pro_help_control)] - ])); + + commonDispatcher.addLocations(plugins.callHook('handlePath')); + + commonDispatcher.addLocations([ + ['/favicon.ico', forward(static_control)], + ['/robots.txt', forward(static_control)], + ['/crossdomain.xml', forward(static_control)], + [PrefixMatcher('/static/'), forward(static_control)], + [PrefixMatcher('/ep/genimg/'), genimg.renderPath], + [PrefixMatcher('/ep/pad/'), forward(pad_control)], + [PrefixMatcher('/ep/script/'), forward(scriptcontrol)], + [/^\/([^\/]+)$/, pad_control.render_pad], + [DirMatcher('/ep/unit-tests/'), forward(testcontrol)], + [DirMatcher('/ep/pne-manual/'), forward(pne_manual_control)], + [DirMatcher('/ep/pro-help/'), forward(pro_help_control)] + ]); var etherpadDotComDispatcher = new Dispatcher(); etherpadDotComDispatcher.addLocations([ |