diff options
author | Egil Moeller <egil.moller@freecode.no> | 2010-03-13 00:04:13 +0100 |
---|---|---|
committer | Egil Moeller <egil.moller@freecode.no> | 2010-03-13 00:04:13 +0100 |
commit | 0ac64400c89d61c2c79f41c42c7506d27a81f273 (patch) | |
tree | 307324458ae23031583ada61051b364ba1e64bd9 | |
parent | 616a926a29ff850ff83555e9c0b9b4a87140f464 (diff) | |
download | etherpad-0ac64400c89d61c2c79f41c42c7506d27a81f273.tar.gz etherpad-0ac64400c89d61c2c79f41c42c7506d27a81f273.tar.xz etherpad-0ac64400c89d61c2c79f41c42c7506d27a81f273.zip |
Added static file serving for plugins
Diffstat (limited to '')
-rw-r--r-- | trunk/etherpad/src/etherpad/control/static_control.js | 15 | ||||
-rw-r--r-- | trunk/etherpad/src/plugins/testplugin/static/js/test.js | 1 |
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 |