summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--trunk/etherpad/src/etherpad/control/static_control.js15
-rw-r--r--trunk/etherpad/src/plugins/testplugin/static/js/test.js1
2 files changed, 14 insertions, 2 deletions
diff --git a/trunk/etherpad/src/etherpad/control/static_control.js b/trunk/etherpad/src/etherpad/control/static_control.js
index 5c087b6..ba509d8 100644
--- a/trunk/etherpad/src/etherpad/control/static_control.js
+++ b/trunk/etherpad/src/etherpad/control/static_control.js
@@ -19,12 +19,25 @@ import("dispatch.{Dispatcher,PrefixMatcher,forward}");
import("etherpad.utils.*");
import("etherpad.globals.*");
+import("etherpad.admin.plugins");
function onRequest() {
var staticBase = '/static';
var opts = {cache: isProduction()};
+ var disp = new Dispatcher();
+
+ /* FIXME: Is there a more effective way to do this? */
+ for (plugin in plugins.plugins) {
+ disp.addLocations([
+ [PrefixMatcher('/static/js/'+plugin+'/'), faststatic.directoryServer('/plugins/' + plugin + '/static/js/', opts)],
+ [PrefixMatcher('/static/css/'+plugin+'/'), faststatic.directoryServer('/plugins/' + plugin + '/static/css/', opts)],
+ [PrefixMatcher('/static/swf/'+plugin+'/'), faststatic.directoryServer('/plugins/' + plugin + '/static/swf/', opts)],
+ [PrefixMatcher('/static/html/'+plugin+'/'), faststatic.directoryServer('/plugins/' + plugin + '/static/html/', opts)],
+ [PrefixMatcher('/static/zip/'+plugin+'/'), faststatic.directoryServer('/plugins/' + plugin + '/static/zip/', opts)]]);
+ }
+
var serveFavicon = faststatic.singleFileServer(staticBase + '/favicon.ico', opts);
var serveCrossDomain = faststatic.singleFileServer(staticBase + '/crossdomain.xml', opts);
var serveStaticDir = faststatic.directoryServer(staticBase, opts);
@@ -35,8 +48,6 @@ function onRequest() {
var serveHtml = faststatic.directoryServer(staticBase+'/html/', opts);
var serveZip = faststatic.directoryServer(staticBase+'/zip/', opts);
- var disp = new Dispatcher();
-
disp.addLocations([
['/favicon.ico', serveFavicon],
['/robots.txt', serveRobotsTxt],
diff --git a/trunk/etherpad/src/plugins/testplugin/static/js/test.js b/trunk/etherpad/src/plugins/testplugin/static/js/test.js
new file mode 100644
index 0000000..2899720
--- /dev/null
+++ b/trunk/etherpad/src/plugins/testplugin/static/js/test.js
@@ -0,0 +1 @@
+kafoo