- this.code = this.code.replace(
- /<for +each="(.+?)" +in="(.+?)" *>/gi,
- function (match, eachName, inName) {
- return "``;\rvar $"+eachName+"_keys = keys("+inName+");\rfor(var $"+eachName+"_i = 0; $"+eachName+"_i < $"+eachName+"_keys.length; $"+eachName+"_i++) {\rvar $"+eachName+"_last = ($"+eachName+"_i == $"+eachName+"_keys.length-1);\rvar $"+eachName+"_key = $"+eachName+"_keys[$"+eachName+"_i];\rvar "+eachName+" = "+inName+"[$"+eachName+"_key];\routput+=``";
- }
- );
- this.code = this.code.replace(/<if test="(.+?)">/g, "``;\rif ($1) { \routput+=``");
- this.code = this.code.replace(/<else\s*\/>/g, "``;} \relse\r{ \routput+=``");
-
- this.code = this.code.replace(/<\/(if|for)>/g, "``;\r};\routput+=``");
-
- //File.write("/tmp/jstookit_eval_"+this.templateName+".4.js", this.code);
-
- this.code = this.code.replace(
- /\{\+\s*([\s\S]+?)\s*\+\}/gi,
- function (match, code) {
- code = code.replace(/"/g, "``"); // prevent qoute-escaping of inline code
- code = code.replace(/(\r?\n)/g, " ");
- return "``+ \r("+code+") +\r``";
- }
- );
- //File.write("/tmp/jstookit_eval_"+this.templateName+".6.js", this.code);
-
- this.code = this.code.replace(
- /\{!\s*([\s\S]+?)\s*!\}/gi,
- function (match, code) {
- code = code.replace(/"/g, "``"); // prevent qoute-escaping of inline code
- code = code.replace(/(\n)/g, " "); // remove quotes..
- return "``; "+code+";\routput+=``";
- }
- );
- //File.write("/tmp/jstookit_eval_"+this.templateName+".7.js", this.code);
- this.code = this.code+"``;";
+ this.code = this.code.replace(
+ /<for +each="(.+?)" +in="(.+?)" *>/gi,
+ function (match, eachName, inName) {
+ return "``;\rvar $"+eachName+"_keys = keys("+inName+");\rfor(var $"+eachName+"_i = 0; $"+eachName+"_i < $"+eachName+"_keys.length; $"+eachName+"_i++) {\rvar $"+eachName+"_last = ($"+eachName+"_i == $"+eachName+"_keys.length-1);\rvar $"+eachName+"_key = $"+eachName+"_keys[$"+eachName+"_i];\rvar "+eachName+" = "+inName+"[$"+eachName+"_key];\routput+=``";
+ }
+ );
+ this.code = this.code.replace(/<if test="(.+?)">/g, "``;\rif ($1) { \routput+=``");
+ this.code = this.code.replace(/<else\s*\/>/g, "``;} \relse\r{ \routput+=``");
+
+ this.code = this.code.replace(/<\/(if|for)>/g, "``;\r};\routput+=``");
+
+ //File.write("/tmp/jstookit_eval_"+this.templateName+".4.js", this.code);
+
+ this.code = this.code.replace(
+ /\{\+\s*([\s\S]+?)\s*\+\}/gi,
+ function (match, code) {
+ code = code.replace(/"/g, "``"); // prevent qoute-escaping of inline code
+ code = code.replace(/(\r?\n)/g, " ");
+ return "``+ \r("+code+") +\r``";
+ }
+ );
+ //File.write("/tmp/jstookit_eval_"+this.templateName+".6.js", this.code);
+
+ this.code = this.code.replace(
+ /\{!\s*([\s\S]+?)\s*!\}/gi,
+ function (match, code) {
+ code = code.replace(/"/g, "``"); // prevent qoute-escaping of inline code
+ code = code.replace(/(\n)/g, " "); // remove quotes..
+ return "``; "+code+";\routput+=``";
+ }
+ );
+ //File.write("/tmp/jstookit_eval_"+this.templateName+".7.js", this.code);
+ this.code = this.code+"``;";