Skip to content
Browse files

update template

  • Loading branch information...
1 parent f5379bc commit 00436e480a089c15fe00d034857bb25f7b715228 @yiminghe yiminghe committed Jan 10, 2012
Showing with 7 additions and 7 deletions.
  1. +3 −3 build/template-min.js
  2. +3 −3 build/template.js
  3. +1 −1 src/template/base.js
View
6 build/template-min.js
@@ -1,9 +1,9 @@
/*
-Copyright 2011, KISSY UI Library v1.20
+Copyright 2012, KISSY UI Library v1.20
MIT Licensed
-build time: Dec 8 16:21
+build time: Jan 10 19:03
*/
KISSY.add("template/base",function(e){function h(b){if(!i[b]){var d=e.guid(k),f,g,c=[q,d,r,g=s(b),t];try{f=new Function(d,c.join(""))}catch(a){c[3]=l+m+u+","+a.message+l+m;f=new Function(d,c.join(""))}i[b]={name:d,o:g,parser:c.join(""),render:f}}return i[b]}var i={},j={"#":"start","/":"end"},n=RegExp("KS_TEMPL_STAT_PARAM","g"),k="KS_DATA_",l='");',m='KS_TEMPL.push("',u="KISSY.Template: Syntax Error. ",q="var KS_TEMPL=[],KS_TEMPL_STAT_PARAM=false;with(",r='||{}){try{KS_TEMPL.push("',t='");}catch(e){KS_TEMPL=["KISSY.Template: Render Error. " + e.message]}};return KS_TEMPL.join("");',
-v=function(b){return b.replace(/"/g,'\\"')},o=e.trim,s=function(b){var d,f;return v(o(b).replace(/[\r\t\n]/g," ").replace(/\\/g,"\\\\")).replace(/\{\{([#/]?)(?!\}\})([^}]*)\}\}/g,function(g,c,a){d="";a=o(a).replace(/\\"/g,'"');if(c){f=a.indexOf(" ");a=f===-1?[a,""]:[a.substring(0,f),a.substring(f)];g=a[0];a=o(a[1]);if((g=p[g])&&j[c]){c=g[j[c]];d=String(e.isFunction(c)?c.apply(this,a.split(/\s+/)):c.replace(n,a))}}else d="KS_TEMPL.push(typeof ("+a+') ==="undefined"?"":'+a+");";return l+d+m})},p={"if":{start:"if(KS_TEMPL_STAT_PARAM){",
+v=function(b){return b.replace(/"/g,'\\"')},o=e.trim,s=function(b){var d,f;return v(o(b).replace(/[\r\t\n]/g," ").replace(/\\/g,"\\\\")).replace(/\{\{([#/]?)(?!\}\})([^}]*)\}\}/g,function(g,c,a){d="";a=o(a).replace(/\\"/g,'"');if(c){f=a.indexOf(" ");a=f===-1?[a,""]:[a.substring(0,f),a.substring(f)];g=a[0];a=o(a[1]);if((g=p[g])&&j[c]){c=g[j[c]];d=String(e.isFunction(c)?c.apply(this,a.split(/\s+/)):c.replace(n,a))}}else d="KS_TEMPL.push(typeof ("+a+') ==="undefined"?"":'+a+");";return l+d+m})},p={"if":{start:'if(typeof (KS_TEMPL_STAT_PARAM) !=="undefined" && KS_TEMPL_STAT_PARAM){',
end:"}"},"else":{start:"}else{"},elseif:{start:"}else if(KS_TEMPL_STAT_PARAM){"},each:{start:function(b,d,f,g){var c="_ks_value",a="_ks_index";if(d==="as"&&f){c=f||c;a=g||a}return"KISSY.each("+b+", function("+c+", "+a+"){"},end:"});"},"!":{start:"/*KS_TEMPL_STAT_PARAM*/"}};e.mix(h,{log:function(b){if(!(b in i)){h(b);this.log(b)}},addStatement:function(b,d){if(e.isString(b))p[b]=d;else e.mix(p,b)}});return h});
KISSY.add("template/node",function(e,h,i){var j=i.all;e.mix(e,{tmpl:function(n,k){return j(h(j(n).html()).render(k))}})},{requires:["./base","node"]});KISSY.add("template",function(e,h){return e.Template=h},{requires:["template/base","template/node"]});
View
6 build/template.js
@@ -1,7 +1,7 @@
/*
-Copyright 2011, KISSY UI Library v1.20
+Copyright 2012, KISSY UI Library v1.20
MIT Licensed
-build time: Dec 8 16:21
+build time: Jan 10 19:03
*/
/**
* @fileoverview KISSY Template Engine.
@@ -108,7 +108,7 @@ KISSY.add('template/base', function(S) {
// expression
Statements = {
'if': {
- start: 'if(' + KS_TEMPL_STAT_PARAM + '){',
+ start: 'if(typeof (' + KS_TEMPL_STAT_PARAM + ') !=="undefined" && ' + KS_TEMPL_STAT_PARAM + '){',
end: '}'
},
View
2 src/template/base.js
@@ -103,7 +103,7 @@ KISSY.add('template/base', function(S) {
// expression
Statements = {
'if': {
- start: 'if(' + KS_TEMPL_STAT_PARAM + '){',
+ start: 'if(typeof (' + KS_TEMPL_STAT_PARAM + ') !=="undefined" && ' + KS_TEMPL_STAT_PARAM + '){',
end: '}'
},

0 comments on commit 00436e4

Please sign in to comment.
Something went wrong with that request. Please try again.