aboutsummaryrefslogtreecommitdiffstats
path: root/infrastructure
diff options
context:
space:
mode:
authorPeter Martischka <pita@pitapoison.de>2010-04-10 10:46:05 +0200
committerPeter Martischka <pita@pitapoison.de>2010-04-10 10:46:05 +0200
commit3a6489d7b064ae812115ad0545eb605f28dd8d6c (patch)
treee289abdfd9e4bf965629faa931fae48bb975364f /infrastructure
parent6938cf57d04bf1af1065c054e7002d44d48265ab (diff)
parentf49fc5640ddcdd9c72ae1e95729fb44073dbb595 (diff)
downloadetherpad-3a6489d7b064ae812115ad0545eb605f28dd8d6c.tar.gz
etherpad-3a6489d7b064ae812115ad0545eb605f28dd8d6c.tar.xz
etherpad-3a6489d7b064ae812115ad0545eb605f28dd8d6c.zip
Merge branch 'master' of http://github.com/redhog/pad
Diffstat (limited to 'infrastructure')
-rw-r--r--infrastructure/framework-src/modules/ejs.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/infrastructure/framework-src/modules/ejs.js b/infrastructure/framework-src/modules/ejs.js
index bf14ed3..58c67bc 100644
--- a/infrastructure/framework-src/modules/ejs.js
+++ b/infrastructure/framework-src/modules/ejs.js
@@ -33,6 +33,7 @@
import("jsutils.*");
import("funhtml");
+import("etherpad.log");
jimport("java.lang.System.out.println");
jimport("net.appjet.ajstdlib.execution.executeCodeInNewScope");
@@ -75,12 +76,13 @@ var EjsScanner = function(source, left, right) {
this.double_left = left+'%%';
this.double_right = '%%'+right;
this.left_equal = left+'%=';
+ this.left_colon = left+'%:';
this.left_comment = left+'%#';
if(left=='[') {
- this.SplitRegexp = /(\[%%)|(%%\])|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/;
+ this.SplitRegexp = /(\[%%)|(%%\])|(\[%:)|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/;
}
else {
- this.SplitRegexp = new RegExp('('+this.double_left+')|(%%'+this.double_right+')|('+this.left_equal+')|('+this.left_comment+')|('+this.left_delimiter+')|('+this.right_delimiter+'\n)|('+this.right_delimiter+')|(\n)')
+ this.SplitRegexp = new RegExp('('+this.double_left+')|(%%'+this.double_right+')|('+this.left_equal+')|('+this.left_colon+')|('+this.left_equal+')|('+this.left_comment+')|('+this.left_delimiter+')|('+this.right_delimiter+'\n)|('+this.right_delimiter+')|(\n)')
}
this.source = source;
@@ -178,7 +180,7 @@ EjsBuffer.prototype = {
/* Adaptation from the Compiler of erb.rb */
EjsCompiler = function(source, left) {
- this.pre_cmd = ['var ___ejsO = "";'];
+ this.pre_cmd = ['var ejs_data = "";'];
this.post_cmd = new Array();
this.source = ' ';
if (source != null)
@@ -217,7 +219,7 @@ EjsCompiler.prototype = {
compile: function(options) {
options = options || {};
this.out = '';
- var put_cmd = "___ejsO += ";
+ var put_cmd = "ejs_data += ";
var insert_cmd = put_cmd;
var buff = new EjsBuffer(this.pre_cmd, this.post_cmd);
var content = '';
@@ -241,6 +243,7 @@ EjsCompiler.prototype = {
break;
case scanner.left_delimiter:
case scanner.left_equal:
+ case scanner.left_colon:
case scanner.left_comment:
scanner.stag = token;
if (content.length > 0)
@@ -277,6 +280,9 @@ EjsCompiler.prototype = {
case scanner.left_equal:
buff.push(insert_cmd + "(EjsScanner.to_text(" + content + "))");
break;
+ case scanner.left_colon:
+ buff.push(insert_cmd + content);
+ break;
}
scanner.stag = null;
content = '';
@@ -302,7 +308,7 @@ EjsCompiler.prototype = {
' with(_VIEW) {',
' with (_CONTEXT) {',
this.out,
- ' return ___ejsO;',
+ ' return ejs_data;',
' }',
' }',
'};'