diff options
author | Simon B @piratpartiet <simonb@redhog.org> | 2010-04-21 23:31:54 +0200 |
---|---|---|
committer | Simon B @piratpartiet <simonb@redhog.org> | 2010-04-21 23:31:54 +0200 |
commit | beb002e2b700305afae26355018c7f23441451c2 (patch) | |
tree | 1311acf84e9be4934108bb47a89797f191ef90a7 /infrastructure | |
parent | 9b3549217642995834d7166456ab8d14e0c99d99 (diff) | |
parent | a1b52bd59f990726178addb42772cf5a4130b808 (diff) | |
download | etherpad-beb002e2b700305afae26355018c7f23441451c2.tar.gz etherpad-beb002e2b700305afae26355018c7f23441451c2.tar.xz etherpad-beb002e2b700305afae26355018c7f23441451c2.zip |
Merge commit 'mainline/master'
Diffstat (limited to 'infrastructure')
-rw-r--r-- | infrastructure/framework-src/modules/ejs.js | 16 |
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;', ' }', ' }', '};' |