aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgil Moeller <egil.moller@freecode.no>2010-04-09 22:04:53 +0200
committerEgil Moeller <egil.moller@freecode.no>2010-04-09 22:04:53 +0200
commit07f65c61458cf4909ffce9c129e9200bbc3f3abb (patch)
tree32dd9bab6fe6407e411973386fb26734900a39a2
parent7f57da299f144054de41ca8f61ac4f2f45098c77 (diff)
downloadetherpad-07f65c61458cf4909ffce9c129e9200bbc3f3abb.tar.gz
etherpad-07f65c61458cf4909ffce9c129e9200bbc3f3abb.tar.xz
etherpad-07f65c61458cf4909ffce9c129e9200bbc3f3abb.zip
Added a default templatye.use('body') at the end of each template
-rw-r--r--etherpad/src/etherpad/utils.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/etherpad/src/etherpad/utils.js b/etherpad/src/etherpad/utils.js
index 67592b1..83a1ec4 100644
--- a/etherpad/src/etherpad/utils.js
+++ b/etherpad/src/etherpad/utils.js
@@ -91,7 +91,7 @@ function renderTemplateAsString(filename, data, plugin) {
data = data || {};
data.helpers = helpers; // global helpers
data.plugins = plugins; // Access callHook and the like...
- new Template(data, plugin);
+ var template = new Template(data, plugin);
var f = findTemplate(filename, plugin); //"/templates/"+filename;
if (! appjet.scopeCache.ejs) {
@@ -100,6 +100,7 @@ function renderTemplateAsString(filename, data, plugin) {
var cacheObj = appjet.scopeCache.ejs[filename];
if (cacheObj === undefined || fileLastModified(f) > cacheObj.mtime) {
var templateText = readFile(f);
+ templateText += "<%: template.use('body', function () { return ''; }); %> ";
cacheObj = {};
cacheObj.tmpl = new EJS({text: templateText, name: filename});
cacheObj.mtime = fileLastModified(f);