summaryrefslogtreecommitdiff
path: root/addons/web/static/lib/qweb/qweb2.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2014-09-08 16:55:46 +0200
committerXavier Morel <xmo@openerp.com>2014-10-06 19:13:42 +0200
commitbed6b01c53b520591e6f693dbb5c25cc5b772bbc (patch)
treee3cfcc8e32e4cdbc10db47c1e9a73334ed8180de /addons/web/static/lib/qweb/qweb2.js
parent4fb49a67f39c5a2c1d56d8c171ab91f81f5cb307 (diff)
[ADD] qweb-js: escf, rawf for parity with Python version
Diffstat (limited to 'addons/web/static/lib/qweb/qweb2.js')
-rw-r--r--addons/web/static/lib/qweb/qweb2.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/addons/web/static/lib/qweb/qweb2.js b/addons/web/static/lib/qweb/qweb2.js
index e4a792e856f..08208fbe3a6 100644
--- a/addons/web/static/lib/qweb/qweb2.js
+++ b/addons/web/static/lib/qweb/qweb2.js
@@ -28,7 +28,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
var QWeb2 = {
expressions_cache: {},
RESERVED_WORDS: 'true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,this,typeof,eval,void,Math,RegExp,Array,Object,Date'.split(','),
- ACTIONS_PRECEDENCE: 'foreach,if,call,set,esc,raw,js,debug,log'.split(','),
+ ACTIONS_PRECEDENCE: 'foreach,if,call,set,escf,esc,rawf,raw,js,debug,log'.split(','),
WORD_REPLACEMENT: {
'and': '&&',
'or': '||',
@@ -739,11 +739,21 @@ QWeb2.Element = (function() {
}
},
compile_action_esc : function(value) {
- this.top("r.push(context.engine.tools.html_escape(" + (this.format_expression(value)) + "));");
+ this.top("r.push(context.engine.tools.html_escape("
+ + this.format_expression(value)
+ + "));");
+ },
+ compile_action_escf : function (value) {
+ this.top("r.push(context.engine.tools.html_escape("
+ + this.string_interpolation(value)
+ + '));');
},
compile_action_raw : function(value) {
this.top("r.push(" + (this.format_expression(value)) + ");");
},
+ compile_action_rawf: function (value) {
+ this.top('r.push(' + this.string_interpolation(value) + ');');
+ },
compile_action_js : function(value) {
this.top("(function(" + value + ") {");
this.bottom("})(dict);");