3 Star 1 Fork 0

Gitee 极速下载/tpl-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/niceue/tpl.js
克隆/下载
tpl.js 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
Jony 提交于 11年前 . Optimized code
/*! tpl.js 0.3.1, github.com/niceue/tpl.js */
!function(n){function t(n,t){var i=e(n);return t?i(t):i}function e(n){n=n||"","#"===n.charAt(0)&&(n=document.getElementById(n.substring(1)).innerHTML);for(var e,i,r,_=function(n){return n.trim?n.trim():n.replace(/^\s*|\s*$/g,"")},u=function(n){return n.replace(/('|\\|\r?\n)/g,"\\$1")},f=t.begin,s=t.end,c=t.variable,d=c||"$",o="var "+d+"="+d+"||this,__='',___, echo=function(s){__+=s}, include=function(t,d){__+=tpl(t).call(d||"+d+")};"+(c?"":"with($||{}){"),g=f.length,l=s.length,a=n.indexOf(f);-1!=a&&(e=i?a+g:n.indexOf(s),!(a>e));)o+="__+='"+u(n.substring(0,a))+"';",i?(n=n.substring(g+l+1),i--):(r=_(n.substring(a+g,e)),"#"===r?i=1:0===r.indexOf("=")?(r=r.substring(1),o+="___="+r+";typeof ___!=='undefined'&&(__+=___);"):o+="\n"+r+"\n"),n=n.substring(e+l),a=n.indexOf(f+(i?"#"+s:""));return o+="__+='"+u(n)+"'"+(c?";":"}")+"return __",new Function(d,o)}t.begin="<#",t.end="#>",n.tpl=t,"function"==typeof define&&define("tpl",[],function(){return t})}(this);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/tpl-js.git
git@gitee.com:mirrors/tpl-js.git
mirrors
tpl-js
tpl-js
master

搜索帮助