diff options
author | Egil Moeller <egil.moller@freecode.no> | 2010-04-13 00:41:25 +0200 |
---|---|---|
committer | Egil Moeller <egil.moller@freecode.no> | 2010-04-13 00:41:25 +0200 |
commit | 9b3bf90c33d4e742111b434045a4d75b68a0780f (patch) | |
tree | f440cb58ea3b178bab6e9151bde805dd63379d7e | |
parent | 3ecd19e733897bc26b5a803f06f7aa26d4877f0c (diff) | |
download | etherpad-9b3bf90c33d4e742111b434045a4d75b68a0780f.tar.gz etherpad-9b3bf90c33d4e742111b434045a4d75b68a0780f.tar.xz etherpad-9b3bf90c33d4e742111b434045a4d75b68a0780f.zip |
Added inheritance between templates for different plugins
-rw-r--r-- | etherpad/src/etherpad/utils.js | 20 |
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); |