aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgil Moeller <egil.moller@freecode.no>2010-04-13 00:41:25 +0200
committerEgil Moeller <egil.moller@freecode.no>2010-04-13 00:41:25 +0200
commit9b3bf90c33d4e742111b434045a4d75b68a0780f (patch)
treef440cb58ea3b178bab6e9151bde805dd63379d7e
parent3ecd19e733897bc26b5a803f06f7aa26d4877f0c (diff)
downloadetherpad-9b3bf90c33d4e742111b434045a4d75b68a0780f.tar.gz
etherpad-9b3bf90c33d4e742111b434045a4d75b68a0780f.tar.xz
etherpad-9b3bf90c33d4e742111b434045a4d75b68a0780f.zip
Added inheritance between templates for different plugins
-rw-r--r--etherpad/src/etherpad/utils.js20
1 files changed, 15 insertions, 5 deletions
diff --git a/etherpad/src/etherpad/utils.js b/etherpad/src/etherpad/utils.js
index 1d139ed..091901d 100644
--- a/etherpad/src/etherpad/utils.js
+++ b/etherpad/src/etherpad/utils.js
@@ -70,11 +70,21 @@ function findExistsingFile(files) {
function findTemplate(filename, plugin) {
var files = [];
- if (plugin != undefined) {
- files.push('/plugins/' + plugin + '/templates/' + filename);
- files.push('/themes/' + appjet.config.theme + '/plugins/' + plugin + '/templates/' + filename);
- files.push('/themes/default/plugins/' + plugin + '/templates/' + filename);
- }
+ var pluginList = [plugin];
+ try {
+ if (plugin.forEach !== undefined)
+ pluginList = plugin;
+ else
+ pluginList = [plugin];
+ } catch (e) {}
+
+ pluginList.forEach(function (plugin) {
+ if (plugin != undefined) {
+ files.push('/plugins/' + plugin + '/templates/' + filename);
+ files.push('/themes/' + appjet.config.theme + '/plugins/' + plugin + '/templates/' + filename);
+ files.push('/themes/default/plugins/' + plugin + '/templates/' + filename);
+ }
+ });
files.push('/themes/' + appjet.config.theme + '/templates/' + filename);
files.push('/themes/default/templates/' + filename);