From ac159008dc97477b61403faed5b39624acc0d7fb Mon Sep 17 00:00:00 2001 From: Gandalf-the-Bot Date: Tue, 22 Nov 2016 05:32:22 +0000 Subject: [PATCH 1/3] Bundled output for commit d20e8a880f055789138fb71912cb7230f1fdd017 [skip ci] --- mithril.js | 3 ++- mithril.min.js | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/mithril.js b/mithril.js index 2a5a6cca..81c01464 100644 --- a/mithril.js +++ b/mithril.js @@ -30,7 +30,8 @@ function hyperscript(selector) { else if (match[3][0] === "[") { var attrValue = match[6] if (attrValue) attrValue = attrValue.replace(/\\(["'])/g, "$1").replace(/\\\\/g, "\\") - attributes[match[4]] = attrValue || true + if (match[4] === "class") classes.push(attrValue) + else attributes[match[4]] = attrValue || true } } if (classes.length > 0) attributes.className = classes.join(" ") diff --git a/mithril.min.js b/mithril.min.js index 35246297..61c1a779 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -1,8 +1,8 @@ new function(){function l(a,b,k,d,n,h){return{tag:a,key:b,attrs:k,children:d,text:n,dom:h,domSize:void 0,state:{},events:void 0,instance:void 0,skip:!1}}function t(a){if(null==a||"string"!==typeof a&&null==a.view)throw Error("The selector must be either a string or a component.");if("string"===typeof a&&void 0===G[a]){for(var b,k,d=[],n={};b=N.exec(a);){var h=b[1],v=b[2];""===h&&""!==v?k=v:"#"===h?n.id=v:"."===h?d.push(v):"["===b[3][0]&&((h=b[6])&&(h=h.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")), -n[b[4]]=h||!0)}0=u&&B>=n;){var z=a[u],l=e[n];if(z!==l||g)if(null!=z&&null!=l&&z.key===l.key)u++,n++,h(c,z,l,f,q(a,u,d),g, -m),g&&z.tag===l.tag&&r(c,v(z),d);else if(z=a[w],z!==l||g)if(null!=z&&null!=l&&z.key===l.key)h(c,z,l,f,q(a,w+1,d),g,m),(g||n=u&&B>=n;){z=a[w];l=e[B];if(z!==l||g)if(null!=z&&null!=l&&z.key===l.key)h(c,z,l,f,q(a,w+1,d),g,m),g&&z.tag===l.tag&&r(c,v(z),d),null!=z.dom&&(d=z.dom),w--;else{if(!x){x=a;var z=w,D={},t;for(t=0;t=u&&B>=n;){var z=a[u],l=e[n];if(z!==l||g)if(null!=z&&null!=l&&z.key===l.key)u++,n++,h(c,z,l,d,q(a,u,f),g, +m),g&&z.tag===l.tag&&r(c,v(z),f);else if(z=a[w],z!==l||g)if(null!=z&&null!=l&&z.key===l.key)h(c,z,l,d,q(a,w+1,f),g,m),(g||n=u&&B>=n;){z=a[w];l=e[B];if(z!==l||g)if(null!=z&&null!=l&&z.key===l.key)h(c,z,l,d,q(a,w+1,f),g,m),g&&z.tag===l.tag&&r(c,v(z),f),null!=z.dom&&(f=z.dom),w--;else{if(!x){x=a;var z=w,D={},t;for(t=0;t Date: Tue, 22 Nov 2016 11:14:58 +0100 Subject: [PATCH 2/3] Fix blinking select in chrome when setting select value --- render/render.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/render/render.js b/render/render.js index b05fa302..27c0a9d0 100644 --- a/render/render.js +++ b/render/render.js @@ -432,6 +432,8 @@ module.exports = function($window) { else if (key in element && !isAttribute(key) && ns === undefined) { //setting input[value] to same value by typing on focused element moves cursor to end in Chrome if (vnode.tag === "input" && key === "value" && vnode.dom.value === value && vnode.dom === $doc.activeElement) return + //setting select[value] to same value while having select open blinks select dropdown in Chrome + if (vnode.tag === "select" && key === "value" && vnode.dom.value === value && vnode.dom === $doc.activeElement) return //setting option[value] to same value while having select open blinks select dropdown in Chrome if (vnode.tag === "option" && key === "value" && vnode.dom.value === value) return element[key] = value From e04eea3c28bc77bff1bec43cd1f68ab5abbbd7e8 Mon Sep 17 00:00:00 2001 From: Gandalf-the-Bot Date: Tue, 22 Nov 2016 14:38:48 +0000 Subject: [PATCH 3/3] Bundled output for commit 57cbd54fe89842efb10f0db0c1cc3e5648b597f2 [skip ci] --- README.md | 2 +- mithril.js | 2 ++ mithril.min.js | 78 +++++++++++++++++++++++++------------------------- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 19de653f..065fb6b6 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,6 @@ There are over 4000 assertions in the test suite, and tests cover even difficult ## Modularity -Despite the huge improvements in performance and modularity, the new codebase is smaller than v0.2.x, currently clocking at 7.37 KB min+gzip +Despite the huge improvements in performance and modularity, the new codebase is smaller than v0.2.x, currently clocking at 7.38 KB min+gzip In addition, Mithril is now completely modular: you can import only the modules that you need and easily integrate 3rd party modules if you wish to use a different library for routing, ajax, and even rendering diff --git a/mithril.js b/mithril.js index 81c01464..650de6ae 100644 --- a/mithril.js +++ b/mithril.js @@ -758,6 +758,8 @@ var _13 = function($window) { else if (key1 in element && !isAttribute(key1) && ns === undefined) { //setting input[value] to same value by typing on focused element moves cursor to end in Chrome if (vnode.tag === "input" && key1 === "value" && vnode.dom.value === value && vnode.dom === $doc.activeElement) return + //setting select[value] to same value while having select open blinks select dropdown in Chrome + if (vnode.tag === "select" && key1 === "value" && vnode.dom.value === value && vnode.dom === $doc.activeElement) return //setting option[value] to same value while having select open blinks select dropdown in Chrome if (vnode.tag === "option" && key1 === "value" && vnode.dom.value === value) return element[key1] = value diff --git a/mithril.min.js b/mithril.min.js index 61c1a779..a84c8be2 100644 --- a/mithril.min.js +++ b/mithril.min.js @@ -1,40 +1,40 @@ -new function(){function l(a,b,k,d,n,h){return{tag:a,key:b,attrs:k,children:d,text:n,dom:h,domSize:void 0,state:{},events:void 0,instance:void 0,skip:!1}}function t(a){if(null==a||"string"!==typeof a&&null==a.view)throw Error("The selector must be either a string or a component.");if("string"===typeof a&&void 0===G[a]){for(var b,k,d=[],n={};b=N.exec(a);){var h=b[1],v=b[2];""===h&&""!==v?k=v:"#"===h?n.id=v:"."===h?d.push(v):"["===b[3][0]&&((h=b[6])&&(h=h.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")), -"class"===b[4]?d.push(h):n[b[4]]=h||!0)}0a.indexOf("?")?"?":"&";a+=d+f}return a}function v(a){try{return""!== -a?JSON.parse(a):null}catch(x){throw Error(a);}}function q(a){return a.responseText}function r(a,b){if("function"===typeof a)if(b instanceof Array)for(var d=0;da.indexOf("?")?"?":"&";a+=e+f}return a}function v(a){try{return""!== +a?JSON.parse(a):null}catch(x){throw Error(a);}}function q(a){return a.responseText}function r(a,b){if("function"===typeof a)if(b instanceof Array)for(var e=0;em.status||304===m.status)b(r(f.type,a));else{var h=Error(m.responseText),k;for(k in a)h[k]=a[k];d(h)}}catch(F){d(F)}};p&&null!=f.data?m.send(f.data):m.send()}))}, -jsonp:function(f){return d(new b(function(b,d){var m=f.callbackName||"_mithril_"+Math.round(1E16*Math.random())+"_"+l++,k=a.document.createElement("script");a[m]=function(d){k.parentNode.removeChild(k);b(r(f.type,d));delete a[m]};k.onerror=function(){k.parentNode.removeChild(k);d(Error("JSONP request failed"));delete a[m]};null==f.data&&(f.data={});f.url=n(f.url,f.data);f.data[f.callbackKey||"callback"]=m;k.src=h(f.url,f.data);a.document.documentElement.appendChild(k)}))},setCompletionCallback:function(a){w= -a}}}(window,"undefined"!==typeof Promise?Promise:y),I=function(){var a=[];return{subscribe:a.push.bind(a),unsubscribe:function(b){b=a.indexOf(b);-1=u&&B>=n;){var z=a[u],l=e[n];if(z!==l||g)if(null!=z&&null!=l&&z.key===l.key)u++,n++,h(c,z,l,d,q(a,u,f),g, -m),g&&z.tag===l.tag&&r(c,v(z),f);else if(z=a[w],z!==l||g)if(null!=z&&null!=l&&z.key===l.key)h(c,z,l,d,q(a,w+1,f),g,m),(g||n=u&&B>=n;){z=a[w];l=e[B];if(z!==l||g)if(null!=z&&null!=l&&z.key===l.key)h(c,z,l,d,q(a,w+1,f),g,m),g&&z.tag===l.tag&&r(c,v(z),f),null!=z.dom&&(f=z.dom),w--;else{if(!x){x=a;var z=w,D={},t;for(t=0;tm.status||304===m.status)b(r(f.type,a));else{var h=Error(m.responseText),k;for(k in a)h[k]=a[k];e(h)}}catch(F){e(F)}};p&&null!=f.data?m.send(f.data):m.send()}))}, +jsonp:function(f){return e(new b(function(b,e){var m=f.callbackName||"_mithril_"+Math.round(1E16*Math.random())+"_"+l++,k=a.document.createElement("script");a[m]=function(e){k.parentNode.removeChild(k);b(r(f.type,e));delete a[m]};k.onerror=function(){k.parentNode.removeChild(k);e(Error("JSONP request failed"));delete a[m]};null==f.data&&(f.data={});f.url=n(f.url,f.data);f.data[f.callbackKey||"callback"]=m;k.src=h(f.url,f.data);a.document.documentElement.appendChild(k)}))},setCompletionCallback:function(a){w= +a}}}(window,"undefined"!==typeof Promise?Promise:z),I=function(){var a=[];return{subscribe:a.push.bind(a),unsubscribe:function(b){b=a.indexOf(b);-1=u&&B>=n;){var y=a[u],l=d[n];if(y!==l||g)if(null!=y&&null!=l&&y.key===l.key)u++,n++,h(c,y,l,e,q(a,u,f),g, +m),g&&y.tag===l.tag&&r(c,v(y),f);else if(y=a[w],y!==l||g)if(null!=y&&null!=l&&y.key===l.key)h(c,y,l,e,q(a,w+1,f),g,m),(g||n=u&&B>=n;){y=a[w];l=d[B];if(y!==l||g)if(null!=y&&null!=l&&y.key===l.key)h(c,y,l,e,q(a,w+1,f),g,m),g&&y.tag===l.tag&&r(c,v(y),f),null!=y.dom&&(f=y.dom),w--;else{if(!x){x=a;var y=w,D={},A;for(A=0;A