Bundled output for commit 111187cb4f [skip ci]
This commit is contained in:
parent
111187cb4f
commit
fe7cc3efe6
2 changed files with 6 additions and 6 deletions
|
|
@ -946,7 +946,7 @@ var parseQueryString = function(string) {
|
|||
if (value !== "" && !isNaN(number) || value === "NaN") value = number
|
||||
else if (value === "true") value = true
|
||||
else if (value === "false") value = false
|
||||
else {
|
||||
else if (value.charAt(0) !== "/") {
|
||||
var date = new Date(value)
|
||||
if (!isNaN(date.getTime())) value = date
|
||||
}
|
||||
|
|
|
|||
10
mithril.min.js
vendored
10
mithril.min.js
vendored
|
|
@ -32,11 +32,11 @@ f[h].slice(1);null!=d[k]&&(b=b.replace(f[h],d[k]),delete d[k])}return b}function
|
|||
g.user:void 0,"string"===typeof g.password?g.password:void 0);g.serialize===JSON.stringify&&z&&n.setRequestHeader("Content-Type","application/json; charset=utf-8");g.deserialize===k&&n.setRequestHeader("Accept","application/json, text/*");"function"===typeof g.config&&(n=g.config(n,g)||n);n.onreadystatechange=function(){if(4===n.readyState){try{var b=g.extract!==l?g.extract(n,g):g.deserialize(g.extract(n,g));if(200<=n.status&&300>n.status||304===n.status)d(m(g.type,b));else{var f=Error(n.responseText),
|
||||
h;for(h in b)f[h]=b[h];d.error(f)}}catch(k){d.error(k)}"function"===typeof q&&q()}};z?n.send(g.data):n.send();return d},jsonp:function(g){var d=f();void 0!==g.initialValue&&d(g.initialValue);var k=g.callbackName||"_mithril_"+Math.round(1E16*Math.random())+"_"+v++,n=b.document.createElement("script");b[k]=function(f){n.parentNode.removeChild(n);d(m(g.type,f));"function"===typeof q&&q();delete b[k]};n.onerror=function(){n.parentNode.removeChild(n);d.error(Error("JSONP request failed"));"function"===
|
||||
typeof q&&q();delete b[k]};null==g.data&&(g.data={});g.url=p(g.url,g.data);g.data[g.callbackKey||"callback"]=k;n.src=h(g.url,g.data);b.document.documentElement.appendChild(n);return d},setCompletionCallback:function(b){q=b}}}(window,N),K=function(){var b=[];return{subscribe:b.push.bind(b),unsubscribe:function(f){f=b.indexOf(f);-1<f&&b.splice(f,1)},publish:function(){for(var f=0;f<b.length;f++)b[f].apply(this,arguments)}}}(),L=function(b){if(""===b||null==b)return{};"?"===b.charAt(0)&&(b=b.slice(1));
|
||||
b=b.split("&");for(var f={},p={},h=0;h<b.length;h++){var k=b[h].split("="),l=decodeURIComponent(k[0]),k=2===k.length?decodeURIComponent(k[1]):"",m=Number(k);""!==k&&!isNaN(m)||"NaN"===k?k=m:"true"===k?k=!0:"false"===k?k=!1:(m=new Date(k),isNaN(m.getTime())||(k=m));var m=l.split(/\]\[?|\[/),v=f;-1<l.indexOf("[")&&m.pop();for(var q=0;q<m.length;q++){var l=m[q],g=m[q+1],g=""==g||!isNaN(parseInt(g,10)),d=q===m.length-1;""===l&&(l=m.slice(0,q).join(),null==p[l]&&(p[l]=0),l=p[l]++);null==v[l]&&(v[l]=d?
|
||||
k:g?[]:{});v=v[l]}}return f};G.setCompletionCallback(K.publish);var Q=function(b){var f=0,p=null,h="function"===typeof requestAnimationFrame?requestAnimationFrame:setTimeout;return function(k){var l=Date.now();!0===k||0===f||16<=l-f?(f=l,b()):null===p&&(p=h(function(){p=null;b();f=Date.now()},16-(l-f)))}},R=function(b,f,p,h){h=Q(h);null!=f&&f.setEventCallback(function(b){!1!==b.redraw&&p.publish()});null!=p&&(b.redraw&&p.unsubscribe(b.redraw),p.subscribe(h));return b.redraw=h};y.mount=function(b,
|
||||
f){return function(p,h){null===h?(b.render(p,[]),f.unsubscribe(p.redraw),delete p.redraw):R(p,b,f,function(){b.render(p,w(h,void 0,void 0,void 0,void 0,void 0))})()}}(M,K);var S=function(b){function f(d){var f=b.location[d].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);"pathname"===d&&"/"!==f[0]&&(f="/"+f);return f}function p(b){return function(){null==g&&(g=v(function(){g=null;b()}))}}function h(b,f,g){var h=b.indexOf("?"),k=b.indexOf("#"),l=-1<h?h:-1<k?k:b.length;if(-1<h){var h=L(b.slice(h+
|
||||
1,-1<k?k:b.length)),m;for(m in h)f[m]=h[m]}if(-1<k)for(m in f=L(b.slice(k+1)),f)g[m]=f[m];return b.slice(0,l)}function k(){switch(q.charAt(0)){case "#":return f("hash").slice(q.length);case "?":return f("search").slice(q.length)+f("hash");default:return f("pathname").slice(q.length)+f("search")+f("hash")}}function l(d,f,g){var k={},r={};d=h(d,k,r);if(null!=f){for(var l in f)k[l]=f[l];d=d.replace(/:([^\/]+)/g,function(b,d){delete k[d];return f[d]})}(l=E(k))&&(d+="?"+l);(r=E(r))&&(d+="#"+r);m?(g&&g.replace?
|
||||
b.history.replaceState(null,null,q+d):b.history.pushState(null,null,q+d),b.onpopstate()):b.location.href=q+d}var m="function"===typeof b.history.pushState,v="function"===typeof setImmediate?setImmediate:setTimeout,q="#!",g;return{setPrefix:function(b){q=b},getPath:k,setPath:l,defineRoutes:function(d,f,g){function l(){var b=k(),m={},p=h(b,m,m),q;for(q in d){var u=new RegExp("^"+q.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(u.test(p)){p.replace(u,function(){for(var g=
|
||||
b=b.split("&");for(var f={},p={},h=0;h<b.length;h++){var k=b[h].split("="),l=decodeURIComponent(k[0]),k=2===k.length?decodeURIComponent(k[1]):"",m=Number(k);""!==k&&!isNaN(m)||"NaN"===k?k=m:"true"===k?k=!0:"false"===k?k=!1:"/"!==k.charAt(0)&&(m=new Date(k),isNaN(m.getTime())||(k=m));var m=l.split(/\]\[?|\[/),v=f;-1<l.indexOf("[")&&m.pop();for(var q=0;q<m.length;q++){var l=m[q],g=m[q+1],g=""==g||!isNaN(parseInt(g,10)),d=q===m.length-1;""===l&&(l=m.slice(0,q).join(),null==p[l]&&(p[l]=0),l=p[l]++);null==
|
||||
v[l]&&(v[l]=d?k:g?[]:{});v=v[l]}}return f};G.setCompletionCallback(K.publish);var Q=function(b){var f=0,p=null,h="function"===typeof requestAnimationFrame?requestAnimationFrame:setTimeout;return function(k){var l=Date.now();!0===k||0===f||16<=l-f?(f=l,b()):null===p&&(p=h(function(){p=null;b();f=Date.now()},16-(l-f)))}},R=function(b,f,p,h){h=Q(h);null!=f&&f.setEventCallback(function(b){!1!==b.redraw&&p.publish()});null!=p&&(b.redraw&&p.unsubscribe(b.redraw),p.subscribe(h));return b.redraw=h};y.mount=
|
||||
function(b,f){return function(p,h){null===h?(b.render(p,[]),f.unsubscribe(p.redraw),delete p.redraw):R(p,b,f,function(){b.render(p,w(h,void 0,void 0,void 0,void 0,void 0))})()}}(M,K);var S=function(b){function f(d){var f=b.location[d].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);"pathname"===d&&"/"!==f[0]&&(f="/"+f);return f}function p(b){return function(){null==g&&(g=v(function(){g=null;b()}))}}function h(b,f,g){var h=b.indexOf("?"),k=b.indexOf("#"),l=-1<h?h:-1<k?k:b.length;if(-1<h){var h=
|
||||
L(b.slice(h+1,-1<k?k:b.length)),m;for(m in h)f[m]=h[m]}if(-1<k)for(m in f=L(b.slice(k+1)),f)g[m]=f[m];return b.slice(0,l)}function k(){switch(q.charAt(0)){case "#":return f("hash").slice(q.length);case "?":return f("search").slice(q.length)+f("hash");default:return f("pathname").slice(q.length)+f("search")+f("hash")}}function l(d,f,g){var k={},r={};d=h(d,k,r);if(null!=f){for(var l in f)k[l]=f[l];d=d.replace(/:([^\/]+)/g,function(b,d){delete k[d];return f[d]})}(l=E(k))&&(d+="?"+l);(r=E(r))&&(d+="#"+
|
||||
r);m?(g&&g.replace?b.history.replaceState(null,null,q+d):b.history.pushState(null,null,q+d),b.onpopstate()):b.location.href=q+d}var m="function"===typeof b.history.pushState,v="function"===typeof setImmediate?setImmediate:setTimeout,q="#!",g;return{setPrefix:function(b){q=b},getPath:k,setPath:l,defineRoutes:function(d,f,g){function l(){var b=k(),m={},p=h(b,m,m),q;for(q in d){var u=new RegExp("^"+q.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$");if(u.test(p)){p.replace(u,function(){for(var g=
|
||||
q.match(/:[^\/]+/g)||[],h=[].slice.call(arguments,1,-2),k=0;k<g.length;k++)m[g[k].replace(/:|\./g,"")]=decodeURIComponent(h[k]);f(d[q],m,b,q)});return}}g(b,m)}m?b.onpopstate=p(l):"#"===q.charAt(0)&&(b.onhashchange=l);l();return l},link:function(b){b.dom.setAttribute("href",q+b.attrs.href);b.dom.onclick=function(f){f.preventDefault();f.redraw=!1;l(b.attrs.href,void 0,void 0)}}}};y.route=function(b,f){function p(b){return b}var h=S(b),k,l,m,v,q,g={view:function(){return m(w(l,null,v,void 0,void 0,void 0))}},
|
||||
d=function(b,d,u){l="div";m=p;v=null;f(b,g);h.defineRoutes(u,function(d,f,g){var h="function"!==typeof d.view,n=p,u=k=function(p){u===k&&(k=null,l=null!=p?p:h?"div":d,m=n,v=f,q=g,b.redraw(!0))},w=function(){u()};h&&("function"===typeof d.render&&(n=d.render.bind(d)),"function"===typeof d.onmatch&&(w=d.onmatch));w.call(d,u,f,g)},function(){h.setPath(d,null,{replace:!0})})};d.link=h.link;d.prefix=h.setPrefix;d.set=h.setPath;d.get=function(){return q};return d}(window,y.mount);y.withAttr=function(b,
|
||||
f,p){return function(h){return f.call(p||this,b in h.currentTarget?h.currentTarget[b]:h.currentTarget.getAttribute(b))}};y.prop=N;y.render=M.render;y.redraw=K.publish;y.request=G.request;y.jsonp=G.jsonp;y.parseQueryString=L;y.buildQueryString=E;y.version="1.0.0";"undefined"!==typeof module?module.exports=y:window.m=y};
|
||||
Loading…
Add table
Add a link
Reference in a new issue