diff --git a/mithril.js b/mithril.js index 01eea041..7694efa1 100644 --- a/mithril.js +++ b/mithril.js @@ -301,6 +301,7 @@ var _9 = function($window, Stream0) { function request(args) { var stream0 = Stream0() if (args.initialValue !== undefined) stream0(args.initialValue) + args.method = args.method.toUpperCase() var useBody = typeof args.useBody === "boolean" ? args.useBody : args.method !== "GET" && args.method !== "TRACE" diff --git a/mithril.min.js b/mithril.min.js index 8020bbcf..0240464d 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -3,7 +3,7 @@ k[f[4]]=h||!0)}0e.filter(I).length)throw Error("Ensure that each item passed to m.prop.combine/m.prop.merge is a stream"); return t(f(),e,function(){var n=e.filter(d);if(0e.indexOf("?")?"?":"&";e+=g+f}return e}function k(e){try{return""!==e?JSON.parse(e):null}catch(m){throw Error(e);}}function h(e){return e.responseText}function y(e,c){if("function"===typeof e)if(c instanceof Array)for(var f=0;fw.status||304===w.status)m(y(e.type,c));else{var f=Error(w.responseText),g;for(g in c)f[g]=c[g];m.error(f)}}catch(T){m.error(T)}"function"===typeof p&&p()}};x?w.send(e.data):w.send();return m},jsonp:function(e){var m=f();void 0!==e.initialValue&&m(e.initialValue);var h=e.callbackName||"_mithril_"+Math.round(1E16*Math.random())+"_"+z++,k=c.document.createElement("script");c[h]=function(f){k.parentNode.removeChild(k);m(y(e.type,f));"function"===typeof p&&p();delete c[h]};k.onerror=function(){k.parentNode.removeChild(k); -m.error(Error("JSONP request failed"));"function"===typeof p&&p();delete c[h]};null==e.data&&(e.data={});e.url=r(e.url,e.data);e.data[e.callbackKey||"callback"]=h;k.src=g(e.url,e.data);c.document.documentElement.appendChild(k);return m},setCompletionCallback:function(c){p=c}}}(window,P),M=function(){var c=[];return{subscribe:c.push.bind(c),unsubscribe:function(f){f=c.indexOf(f);-1=q&&x>=A;){var t=b[q],l=d[A];if(t!==l||n)if(null!=t&&null!=l&&t.key===l.key)q++,A++,h(a,t,l,c,z(b,q,e),n,g),n&&t.tag===l.tag&&p(a,y(t),e);else if(t=b[k],t!==l||n)if(null!=t&&null!=l&&t.key===l.key)h(a,t,l,c,z(b,k+1,e),n,g),(n||A=q&&x>=A;){t=b[k];l=d[x];if(t!==l||n)if(null!=t&&null!=l&&t.key===l.key)h(a, -t,l,c,z(b,k+1,e),n,g),n&&t.tag===l.tag&&p(a,y(t),e),null!=t.dom&&(e=t.dom),k--;else{if(!w){w=b;var t=k,C={},u;for(u=0;uw.status||304===w.status)m(y(e.type,c));else{var f=Error(w.responseText),g;for(g in c)f[g]=c[g];m.error(f)}}catch(S){m.error(S)}"function"===typeof p&&p()}};x?w.send(e.data):w.send();return m},jsonp:function(e){var m=f();void 0!==e.initialValue&&m(e.initialValue);var h=e.callbackName||"_mithril_"+Math.round(1E16*Math.random())+"_"+z++,k=c.document.createElement("script");c[h]=function(f){k.parentNode.removeChild(k);m(y(e.type,f)); +"function"===typeof p&&p();delete c[h]};k.onerror=function(){k.parentNode.removeChild(k);m.error(Error("JSONP request failed"));"function"===typeof p&&p();delete c[h]};null==e.data&&(e.data={});e.url=r(e.url,e.data);e.data[e.callbackKey||"callback"]=h;k.src=g(e.url,e.data);c.document.documentElement.appendChild(k);return m},setCompletionCallback:function(e){p=e}}}(window,P),M=function(){var c=[];return{subscribe:c.push.bind(c),unsubscribe:function(f){f=c.indexOf(f);-1=q&&x>=A;){var t=b[q],l=d[A];if(t!==l||n)if(null!=t&&null!=l&&t.key===l.key)q++,A++,h(a,t,l,c,z(b,q,e),n,g),n&&t.tag===l.tag&&p(a,y(t),e);else if(t=b[k],t!==l||n)if(null!=t&&null!=l&&t.key===l.key)h(a,t,l,c,z(b,k+1,e),n,g),(n||A=q&&x>=A;){t=b[k];l=d[x];if(t!==l||n)if(null!=t&&null!=l&&t.key===l.key)h(a,t,l,c,z(b,k+1,e),n,g),n&&t.tag===l.tag&&p(a,y(t),e),null!=t.dom&&(e=t.dom),k--;else{if(!w){w=b;var t=k,C={},u;for(u=0;u