Initial dev repository
[kcls-web.git] / opac / extras / mobile / js / template.js
diff --git a/opac/extras/mobile/js/template.js b/opac/extras/mobile/js/template.js
new file mode 100644 (file)
index 0000000..da37824
--- /dev/null
@@ -0,0 +1,2 @@
+module("template",function(){var b,c;b={start:"<%",end:"%>",interpolate:/<%=(.+?)%>/g};c=RegExp("'(?=[^"+b.end.substr(0,1)+"]*"+b.end.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")+")","g");this.template=function(e,d){var a;a=e.replace(/[\r\t\n]/g," ").replace(c,"\t").split("'").join("\\'").split("\t").join("'").replace(b.interpolate,"',$1,'").split(b.start).join("');").split(b.end).join("p.push('");a="var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a+"');}return p.join('');";
+a=new Function("obj",a);return d?a(d):a};return null});