diff --git a/tim.min.js b/tim.min.js new file mode 100644 index 0000000..4b4eb18 --- /dev/null +++ b/tim.min.js @@ -0,0 +1 @@ +!function(t,e,n){"undefined"!=typeof module&&module.exports?module.exports=e():"function"==typeof n.define&&n.define.amd?define(e):n.tim=e()}(0,function(){return function t(e){"use strict";var n,r,o,i,f={start:"{{",end:"}}",path:"[a-z0-9_$][\\.a-z0-9_]*"},l={},a={};function u(){r=new RegExp(f.start+"\\s*("+f.path+")\\s*"+f.end,"gi")}function s(t){var e;if(t){for(e in t)t.hasOwnProperty(e)&&(f[e]=t[e]);u()}return f}function c(t,e){var n;switch(typeof t){case"string":if(e===i)return l[t]||"";!1===e?delete l[t]:l[t]=e;break;case"object":for(n in t)t.hasOwnProperty(n)&&c(n,t[n]);break;case"boolean":t||(l={})}return l}function p(t,e){var n;for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function d(t,e){return t[1]-e[1]}function y(t,e,n){var r=a[t];return r||(r=a[t]=[]),r.push([e,n||0]),r.sort(d),e}function m(t,e){var r,o,f,l,u=a[t];if(u){for(r=[e],o=2,f=arguments.length;o=0))throw"tim: '"+o+"' not closed";if(s=s.slice(0,y),"boolean"==typeof i)c=i?s:"";else{for(h in i)i.hasOwnProperty(h)&&(r.lastIndex=0,g=m("loopData",g=p({_key:h,_content:i[h]},i[h]),x,o),c+=m("loop",x=w(s,g),o,g));c=m("loopEnd",c,o,g)}t=u+c+t.slice(a+s.length+d.length)}r.lastIndex=0}return t}(t,e)),t=m("templateAfter",t)}return e?s(e):u(),h.stop=function(){n=!0},w.settings=s,w.templates=c,w.parser=t,w.filter=h,y("token",function(t,e,n){for(var r=t.split("."),o=r.length,f=e,l=0;l