This commit is contained in:
Leo Horie 2016-10-31 11:52:35 -04:00
parent 8b5873c4f7
commit dd63e724c7
2 changed files with 2 additions and 2 deletions

2
mithril.min.js vendored
View file

@ -40,4 +40,4 @@ f("hash")}}function h(e,f,h){var k={},l={};e=g(e,k,l);if(null!=f){for(var r in f
f,h){function l(){var b=k(),l={},r=g(b,l,l),m;for(m in e){var p=new RegExp("^"+m.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(p.test(r)){r.replace(p,function(){for(var g=m.match(/:[^\/]+/g)||[],h=[].slice.call(arguments,1,-2),k=0;k<g.length;k++)l[g[k].replace(/:|\./g,"")]=decodeURIComponent(h[k]);f(e[m],l,b,m)});return}}h(b,l)}w?b.onpopstate=p(l):"#"===m.charAt(0)&&(b.onhashchange=l);l();return l},link:function(b){b.dom.setAttribute("href",m+b.attrs.href);b.dom.onclick=
function(b){b.ctrlKey||b.metaKey||b.shiftKey||2===b.which||(b.preventDefault(),b.redraw=!1,b=this.getAttribute("href"),0===b.indexOf(m)&&(b=b.slice(m.length)),h(b,void 0,void 0))}}}};A.route=function(b,f){function p(b){return b}var g=U(b),k,h,w,x,m,e={view:function(){return[w(y(h,null,x,void 0,void 0,void 0))]}},l=function(b,l,y){h="div";w=p;x=null;f(b,e);g.defineRoutes(y,function(e,f,g){var l="function"!==typeof e.view,r=p,u=k=function(p){u===k&&(k=null,h=null!=p?p:l?"div":e,w=r,x=f,m=g,b.redraw(!0))},
v=function(){u()};l&&("function"===typeof e.render&&(r=e.render.bind(e)),"function"===typeof e.onmatch&&(v=e.onmatch));v.call(e,u,f,g)},function(){g.setPath(l,null,{replace:!0})})};l.link=g.link;l.prefix=g.setPrefix;l.set=g.setPath;l.get=function(){return m};return l}(window,A.mount);A.withAttr=function(b,f,p){return function(g){return f.call(p||this,b in g.currentTarget?g.currentTarget[b]:g.currentTarget.getAttribute(b))}};A.prop=O;A.render=P.render;A.redraw=M.publish;A.request=L.request;A.jsonp=
L.jsonp;A.parseQueryString=N;A.buildQueryString=I;A.version="1.0.0";"undefined"!==typeof module?module.exports=A:window.m=A};
L.jsonp;A.parseQueryString=N;A.buildQueryString=I;A.version="1.0.0-rc.1";"undefined"!==typeof module?module.exports=A:window.m=A};