From dbd40f035d765cfa442a0731229d31a9113d8d11 Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Sat, 13 Mar 2010 00:24:55 +0100 Subject: Fixed the paths for plugin-provided static files, and added an example usage to the testplugin --- trunk/etherpad/src/etherpad/control/static_control.js | 10 +++++----- trunk/etherpad/src/plugins/testplugin/static/js/test.js | 2 +- trunk/etherpad/src/plugins/testplugin/templates/testplugin.ejs | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'trunk') diff --git a/trunk/etherpad/src/etherpad/control/static_control.js b/trunk/etherpad/src/etherpad/control/static_control.js index ba509d8..d938b26 100644 --- a/trunk/etherpad/src/etherpad/control/static_control.js +++ b/trunk/etherpad/src/etherpad/control/static_control.js @@ -31,11 +31,11 @@ function onRequest() { /* 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)]]); + [PrefixMatcher('/static/js/plugins/'+plugin+'/'), faststatic.directoryServer('/plugins/' + plugin + '/static/js/', opts)], + [PrefixMatcher('/static/css/plugins/'+plugin+'/'), faststatic.directoryServer('/plugins/' + plugin + '/static/css/', opts)], + [PrefixMatcher('/static/swf/plugins/'+plugin+'/'), faststatic.directoryServer('/plugins/' + plugin + '/static/swf/', opts)], + [PrefixMatcher('/static/html/plugins/'+plugin+'/'), faststatic.directoryServer('/plugins/' + plugin + '/static/html/', opts)], + [PrefixMatcher('/static/zip/plugins/'+plugin+'/'), faststatic.directoryServer('/plugins/' + plugin + '/static/zip/', opts)]]); } var serveFavicon = faststatic.singleFileServer(staticBase + '/favicon.ico', opts); diff --git a/trunk/etherpad/src/plugins/testplugin/static/js/test.js b/trunk/etherpad/src/plugins/testplugin/static/js/test.js index 2899720..de6ac71 100644 --- a/trunk/etherpad/src/plugins/testplugin/static/js/test.js +++ b/trunk/etherpad/src/plugins/testplugin/static/js/test.js @@ -1 +1 @@ -kafoo +alert("KAFOOOOO"); diff --git a/trunk/etherpad/src/plugins/testplugin/templates/testplugin.ejs b/trunk/etherpad/src/plugins/testplugin/templates/testplugin.ejs index e529982..02bf934 100644 --- a/trunk/etherpad/src/plugins/testplugin/templates/testplugin.ejs +++ b/trunk/etherpad/src/plugins/testplugin/templates/testplugin.ejs @@ -20,6 +20,7 @@ limitations under the License. */ %> helpers.includeJQuery(); helpers.includeCometJs(); helpers.includeJs("json2.js"); + helpers.includeJs("plugins/testplugin/test.js") helpers.addToHead('\n\n'); %> -- cgit v1.2.3