/************** JavaScript Inline Template (jsilt) **************/ /* (c) Copyright Patrick Curry, 2009-2018. All rights Reserved */ /* https://google.com/search?q=javascript+jsilt+-jshint+-jslint+-jstl+-jst+-jit+-silt+-split+-jlist+-jilt+-list+-jps */ // Config Variables var _jsiltConfigInit = function() { this.jtg="j"; this.jetg="je"; this.ntg="span"; this.neg="\%\%\%"; this.bt="{"; this.et="}"; this.jb="~~~~~~"; this.jglf=1; this.jglv=1; this.ttg="span"; this.ttc="_template"; }; // Init the config variables var _jsiltConfig = new _jsiltConfigInit(); // Initialize the Jsilt CSS ASAP var _jsiltStyleTag = document.createElement('style'); _jsiltStyleTag.type = 'text/css'; var _jsiltStyleTagInnerHtml = _jsiltConfig.jtg+','+_jsiltConfig.jetg+',.'+_jsiltConfig.ttc+'{display:none;}'; // console.log(_jsiltStyleTagInnerHtml); _jsiltStyleTag.innerHTML = _jsiltStyleTagInnerHtml; document.getElementsByTagName('head')[0].appendChild(_jsiltStyleTag); // End of CSS function _jsilt() { // Config Variables this.jtg=_jsiltConfig.jtg; // NEW this.jetg=_jsiltConfig.jetg; // END NEW this.ntg=_jsiltConfig.ntg; this.neg=_jsiltConfig.neg; this.bt=_jsiltConfig.bt; this.et=_jsiltConfig.et; this.jb=_jsiltConfig.jb; this.jglf=_jsiltConfig.jglf; this.jglv=_jsiltConfig.jglv; // Helper Variables this.pageloaded=0; this.jsilthasrun=0; this.jtr=false; this.jss=""; this.jse=""; this.jt=""; this.jts=""; this.nts=""; this.d1 = 0; this.tmp this.tmpSplit; // Template Variables this.jtm = new Array(); this.jtsd = 0; this.ttg=_jsiltConfig.ttg; this.ttc=_jsiltConfig.ttc; this.templatesToBeCompiled; // Regex town this.jtbx = new RegExp("<"+this.jtg+">","g"); this.jthx = new RegExp("<"+this.jtg+"[^>]*>","g"); this.jtex = new RegExp("","g"); this.jetbx = new RegExp("<"+this.jetg+">","g"); this.jethx = new RegExp("<"+this.jetg+"[^>]*>","g"); this.jetex = new RegExp("","g"); this.ntbx = new RegExp("<"+this.ntg+">","g"); this.ntex = new RegExp("","g"); this.negx = new RegExp(this.neg,"g"); this.btx = new RegExp(this.bt,"g"); this.etx = new RegExp(this.et,"g"); this.jnf = new RegExp("function[ ]+([^(]+)\(([^\{]*)\)\{","g"); this.jnv1 = new RegExp("global var ([^\s=]+);","g"); this.jnv2 = new RegExp("global var ([^\s=]+=)","g"); this.hc1 = new RegExp("","g"); this.hc3 = new RegExp("-->","g"); this.jc1 = new RegExp("//[^\n]*\n","g"); this.jc2 = new RegExp("//[^\r]*\r","g"); } _jsilt.prototype.e = function(str) { if(typeof(str) != "undefined" && (typeof(str) == "string" || typeof(str) == "number") ){ if(jsilt.jtr<=0) { if (!jsilt.pageloaded){ document.write(str);return; }else{ alert("Page has loaded, nowhere to echo to.");return; } } str=str.toString(); jsilt.jss+=str; //alert(this.jss); } }; function lt(a,b){return ab;}; function lte(a,b){return a<=b;}; function gte(a,b){return a>=b;}; _jsilt.prototype.compile = function(block) { //alert("jsiltcompile"); this.jtr++; if (block && block != "") { this.tmp = block.toString() + ""; if (block.innerHTML && block.innerHTML != "") { this.tmp = block.innerHTML.toString() + ""; } // TODO: make this hc1/")==-1 && this.tmpSplit[j].indexOf("