text: !function () { var t = {}; this.tmpl = function e(n, r) { var o = /\W/.test(n) ? new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('" + n.replace(/[\r\t\n]/g, " ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g, "$1\r").replace(/\t=(.*?)%>/g, "',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'") + "');}return p.join('');") : t[n] = t[n] || e(document.getElementById(n).innerHTML); return r ? o(r) : o } }(); var routes = {}; function route(t, e, n) { routes[t] = { templateId: e, controller: n } } var el = null; function router() { el = el || document.getElementById("appRoot"); var t = location.hash.slice(1) || "/", e = routes[t]; el && e && e.controller && (el.innerHTML = tmpl(e.templateId, new e.controller)) } window.addEventListener("hashchange", router), window.addEventListener("load", router);