Skip to content
Browse files

added minified doT.js

  • Loading branch information...
1 parent 0470508 commit ee9848b7e9d5f6ec860d8289b295c261c821050b @olado committed Apr 21, 2012
Showing with 6 additions and 1 deletion.
  1. +5 −0 doT.min.js
  2. +1 −1 examples/browsersample.html
View
5 doT.min.js
@@ -0,0 +1,5 @@
+(function(){function l(b,a,j){return(typeof a==="string"?a:a.toString()).replace(b.define,function(i,c,g,h){if(c.indexOf("def.")===0)c=c.substring(4);if(!(c in j))if(g===":")j[c]=h;else eval("def['"+c+"']="+h);return""}).replace(b.use,function(i,c){var g=eval(c);return g?l(b,g,j):g})}function k(b){return b.replace(/\\'/g,"'").replace(/\\\\/g,"\\").replace(/[\r\t\n]/g," ")}var e={version:"0.1.8"},f=function(){return this||(0,eval)("this")}();if(typeof module!=="undefined"&&module.exports)module.exports=
+e;else if(typeof define==="function"&&define.amd)define(function(){return e});else f.doT=e;e.templateSettings={evaluate:/\{\{([\s\S]+?)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,conditionalStart:/\{\{\?([\s\S]+?)\}\}/g,conditionalElse:/\{\{\?\?\s*([\s\S]*?)\s*\}\}/g,conditionalEnd:/\{\{\?\}\}/g,varname:"it",strip:true,append:true};if(!f.encodeHTML){var n={"&":"&#38;","<":"&#60;",">":"&#62;",
+'"':"&#34;","'":"&#39;","/":"&#47;"},o=/&(?!\\w+;)|<|>|\"|'|\//g;f.encodeHTML=function(b){return b?b.toString().replace(o,function(a){return n[a]||a}):b}}var m={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}};e.template=function(b,a,j){a=a||e.templateSettings;var i=a.append?m.append:m.split;if(a.use||a.define){var c=f.def;f.def=j||{};b=l(a,b,f.def);if(c)f.def=c;else delete f.def}b=("var out='"+(a.strip?b.replace(/\s*<!\[CDATA\[\s*|\s*\]\]>\s*|[\r\n\t]|(\/\*[\s\S]*?\*\/)/g,
+""):b).replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(a.interpolate,function(h,d){return i.start+k(d)+i.end}).replace(a.encode,function(h,d){return i.startencode+k(d)+i.end}).replace(a.conditionalEnd,"';}out+='").replace(a.conditionalElse,function(h,d){return d?"';}else if("+k(d)+"){out+='":"';}else{out+='"}).replace(a.conditionalStart,function(h,d){return"';if("+k(d)+"){out+='"}).replace(a.evaluate,function(h,d){return"';"+k(d)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,
+"\\r").split("out+='';").join("").split("var out='';out+=").join("var out=");try{return new Function(a.varname,b)}catch(g){typeof console!=="undefined"&&console.log("Could not create a template function: "+b);throw g;}};e.compile=function(b,a){return e.template(b,null,a)}})();
View
2 examples/browsersample.html
@@ -25,7 +25,7 @@
{{=it.name}}
</script>
- <script src="../doT.js" type="text/javascript"></script>
+ <script src="../doT.min.js" type="text/javascript"></script>
</head>
<body>

0 comments on commit ee9848b

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