Bundled output for commit c9186bcdec [skip ci]

This commit is contained in:
Gandalf-the-Bot 2017-06-13 09:30:45 +00:00
parent c9186bcdec
commit 38956e119b
2 changed files with 14 additions and 14 deletions

View file

@ -836,7 +836,7 @@ var coreRenderer = function($window) {
if (key2 === "value") {
var normalized0 = "" + value // eslint-disable-line no-implicit-coercion
//setting input[value] to same value by typing on focused element moves cursor to end in Chrome
if (vnode.tag === "input" && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return
if ((vnode.tag === "input" || vnode.tag === "textarea") && vnode.dom.value === normalized0 && vnode.dom === $doc.activeElement) return
//setting select[value] to same value while having select open blinks select dropdown in Chrome
if (vnode.tag === "select") {
if (value === null) {

26
mithril.min.js vendored
View file

@ -29,16 +29,16 @@ a[c].dom)return a[c].dom;return b}function k(a,c,b){b&&b.parentNode?a.insertBefo
b)for(var e=a.dom;--b;){var g=e.nextSibling,f=g.parentNode;null!=f&&f.removeChild(g)}b=a.dom;e=b.parentNode;null!=e&&e.removeChild(b);if(b=null!=c&&null==a.domSize)b=a.attrs,b=!(null!=b&&(b.oncreate||b.onupdate||b.onbeforeremove||b.onremove));b&&"string"===typeof a.tag&&(c.pool?c.pool.push(a):c.pool=[a])}}var h=1,d=0;if(a.attrs&&"function"===typeof a.attrs.onbeforeremove){var e=a.attrs.onbeforeremove.call(a.state,a);null!=e&&"function"===typeof e.then&&(h++,e.then(b,b))}"string"!==typeof a.tag&&"function"===
typeof a._state.onbeforeremove&&(e=a._state.onbeforeremove.call(a.state,a),null!=e&&"function"===typeof e.then&&(h++,e.then(b,b)));b()}function B(a){a.attrs&&"function"===typeof a.attrs.onremove&&a.attrs.onremove.call(a.state,a);"string"!==typeof a.tag&&"function"===typeof a._state.onremove&&a._state.onremove.call(a.state,a);if(null!=a.instance)B(a.instance);else if(a=a.children,Array.isArray(a))for(var c=0;c<a.length;c++){var b=a[c];null!=b&&B(b)}}function D(a,c,b,d,e){var h=a.dom;if("key"!==c&&
"is"!==c&&(b!==d||"value"===c||"checked"===c||"selectedIndex"===c||"selected"===c&&a.dom===y.activeElement||"object"===typeof d)&&"undefined"!==typeof d&&!O(c)){var g=c.indexOf(":");if(-1<g&&"xlink"===c.substr(0,g))h.setAttributeNS("http://www.w3.org/1999/xlink",c.slice(g+1),d);else if("o"===c[0]&&"n"===c[1]&&"function"===typeof d)x(a,c,d);else if("style"===c)if(a=b,a===d&&(h.style.cssText="",a=null),null==d)h.style.cssText="";else if("string"===typeof d)h.style.cssText=d;else{"string"===typeof a&&
(h.style.cssText="");for(var f in d)h.style[f]=d[f];if(null!=a&&"string"!==typeof a)for(f in a)f in d||(h.style[f]="")}else if(c in h&&"href"!==c&&"list"!==c&&"form"!==c&&"width"!==c&&"height"!==c&&void 0===e&&!(a.attrs.is||-1<a.tag.indexOf("-"))){if("value"===c){f=""+d;if("input"===a.tag&&a.dom.value===f&&a.dom===y.activeElement)return;if("select"===a.tag)if(null===d){if(-1===a.dom.selectedIndex&&a.dom===y.activeElement)return}else if(null!==b&&a.dom.value===f&&a.dom===y.activeElement)return;if("option"===
a.tag&&null!=b&&a.dom.value===f)return}"input"===a.tag&&"type"===c?h.setAttribute(c,d):h[c]=d}else"boolean"===typeof d?d?h.setAttribute(c,""):h.removeAttribute(c):h.setAttribute("className"===c?"class":c,d)}}function O(a){return"oninit"===a||"oncreate"===a||"onupdate"===a||"onremove"===a||"onbeforeremove"===a||"onbeforeupdate"===a}function x(a,b,d){var c=a.dom,e="function"!==typeof G?d:function(a){var b=d.call(c,a);G.call(c,a);return b};if(b in c)c[b]="function"===typeof d?e:null;else{var h=b.slice(2);
void 0===a.events&&(a.events={});a.events[b]!==e&&(null!=a.events[b]&&c.removeEventListener(h,a.events[b],!1),"function"===typeof d&&(a.events[b]=e,c.addEventListener(h,a.events[b],!1)))}}function A(a,b,d){"function"===typeof a.oninit&&a.oninit.call(b.state,b);"function"===typeof a.oncreate&&d.push(a.oncreate.bind(b.state,b))}function I(a,b,d){"function"===typeof a.onupdate&&d.push(a.onupdate.bind(b.state,b))}var y=b.document,J=y.createDocumentFragment(),H={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},
G;return{render:function(a,b){if(!a)throw Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var c=[],d=y.activeElement;null==a.vnodes&&(a.textContent="");Array.isArray(b)||(b=[b]);n(a,a.vnodes,z.normalizeChildren(b),!1,c,null,void 0);a.vnodes=b;for(var e=0;e<c.length;e++)c[e]();y.activeElement!==d&&d.focus()},setEventCallback:function(a){return G=a}}},G=function(b){function d(b){b=f.indexOf(b);-1<b&&f.splice(b,2)}function e(){for(var b=1;b<f.length;b+=2)f[b]()}
b=P(b);b.setEventCallback(function(b){!1!==b.redraw&&e()});var f=[];return{subscribe:function(b,e){d(b);f.push(b,R(e))},unsubscribe:d,redraw:e,render:b.render}}(window);K.setCompletionCallback(G.redraw);A.mount=function(b){return function(d,e){if(null===e)b.render(d,[]),b.unsubscribe(d);else{if(null==e.view&&"function"!==typeof e)throw Error("m.mount(element, component) expects a component, not a vnode");b.subscribe(d,function(){b.render(d,z(e))});b.redraw()}}}(G);var U=x,L=function(b){if(""===b||
null==b)return{};"?"===b.charAt(0)&&(b=b.slice(1));b=b.split("&");for(var d={},e={},f=0;f<b.length;f++){var g=b[f].split("=");var n=decodeURIComponent(g[0]);g=2===g.length?decodeURIComponent(g[1]):"";"true"===g?g=!0:"false"===g&&(g=!1);var l=n.split(/\]\[?|\[/),r=d;-1<n.indexOf("[")&&l.pop();for(var p=0;p<l.length;p++){n=l[p];var k=l[p+1],k=""==k||!isNaN(parseInt(k,10)),m=p===l.length-1;""===n&&(n=l.slice(0,p).join(),null==e[n]&&(e[n]=0),n=e[n]++);null==r[n]&&(r[n]=m?g:k?[]:{});r=r[n]}}return d},
V=function(b){function d(d){var e=b.location[d].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);"pathname"===d&&"/"!==e[0]&&(e="/"+e);return e}function e(b){return function(){null==l&&(l=n(function(){l=null;b()}))}}function f(b,d,e){var a=b.indexOf("?"),f=b.indexOf("#"),g=-1<a?a:-1<f?f:b.length;if(-1<a){var a=L(b.slice(a+1,-1<f?f:b.length)),m;for(m in a)d[m]=a[m]}if(-1<f)for(m in d=L(b.slice(f+1)),d)e[m]=d[m];return b.slice(0,g)}var g="function"===typeof b.history.pushState,n="function"===
typeof setImmediate?setImmediate:setTimeout,l,r={prefix:"#!",getPath:function(){switch(r.prefix.charAt(0)){case "#":return d("hash").slice(r.prefix.length);case "?":return d("search").slice(r.prefix.length)+d("hash");default:return d("pathname").slice(r.prefix.length)+d("search")+d("hash")}},setPath:function(d,e,m){var a={},l={};d=f(d,a,l);if(null!=e){for(var k in e)a[k]=e[k];d=d.replace(/:([^\/]+)/g,function(b,d){delete a[d];return e[d]})}(k=H(a))&&(d+="?"+k);(l=H(l))&&(d+="#"+l);g?(l=m?m.state:
null,k=m?m.title:null,b.onpopstate(),m&&m.replace?b.history.replaceState(l,k,r.prefix+d):b.history.pushState(l,k,r.prefix+d)):b.location.href=r.prefix+d},defineRoutes:function(d,l,m){function a(){var a=r.getPath(),e={},g=f(a,e,e),k=b.history.state;if(null!=k)for(var n in k)e[n]=k[n];for(var p in d)if(k=new RegExp("^"+p.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$"),k.test(g)){g.replace(k,function(){for(var b=p.match(/:[^\/]+/g)||[],f=[].slice.call(arguments,1,-2),g=0;g<b.length;g++)e[b[g].replace(/:|\./g,
"")]=decodeURIComponent(f[g]);l(d[p],e,a,p)});return}m(a,e)}g?b.onpopstate=e(a):"#"===r.prefix.charAt(0)&&(b.onhashchange=a);a()}};return r};A.route=function(b,d){var e=V(b),f=function(b){return b},g,n,l,r,p,k=function(b,a,k){if(null==b)throw Error("Ensure the DOM element that was passed to `m.route` is not undefined");var m=function(){null!=g&&d.render(b,g(z(n,l.key,l)))},w=function(b){if(b!==a)e.setPath(a,null,{replace:!0});else throw Error("Could not resolve default route "+a);};e.defineRoutes(k,
function(a,b,d){var e=p=function(a,k){e===p&&(n=null==k||"function"!==typeof k.view&&"function"!==typeof k?"div":k,l=b,r=d,p=null,g=(a.render||f).bind(a),m())};a.view||"function"===typeof a?e({},a):a.onmatch?U.resolve(a.onmatch(b,d)).then(function(b){e(a,b)},w):e(a,"div")},w);d.subscribe(b,m)};k.set=function(b,a,d){null!=p&&(d={replace:!0});p=null;e.setPath(b,a,d)};k.get=function(){return r};k.prefix=function(b){e.prefix=b};k.link=function(b){b.dom.setAttribute("href",e.prefix+b.attrs.href);b.dom.onclick=
function(a){a.ctrlKey||a.metaKey||a.shiftKey||2===a.which||(a.preventDefault(),a.redraw=!1,a=this.getAttribute("href"),0===a.indexOf(e.prefix)&&(a=a.slice(e.prefix.length)),k.set(a,void 0,void 0))}};k.param=function(b){return"undefined"!==typeof l&&"undefined"!==typeof b?l[b]:l};return k}(window,G);A.withAttr=function(b,d,e){return function(f){d.call(e||this,b in f.currentTarget?f.currentTarget[b]:f.currentTarget.getAttribute(b))}};var W=P(window);A.render=W.render;A.redraw=G.redraw;A.request=K.request;
A.jsonp=K.jsonp;A.parseQueryString=L;A.buildQueryString=H;A.version="1.1.1";A.vnode=z;"undefined"!==typeof module?module.exports=A:window.m=A})();
(h.style.cssText="");for(var f in d)h.style[f]=d[f];if(null!=a&&"string"!==typeof a)for(f in a)f in d||(h.style[f]="")}else if(c in h&&"href"!==c&&"list"!==c&&"form"!==c&&"width"!==c&&"height"!==c&&void 0===e&&!(a.attrs.is||-1<a.tag.indexOf("-"))){if("value"===c){f=""+d;if(("input"===a.tag||"textarea"===a.tag)&&a.dom.value===f&&a.dom===y.activeElement)return;if("select"===a.tag)if(null===d){if(-1===a.dom.selectedIndex&&a.dom===y.activeElement)return}else if(null!==b&&a.dom.value===f&&a.dom===y.activeElement)return;
if("option"===a.tag&&null!=b&&a.dom.value===f)return}"input"===a.tag&&"type"===c?h.setAttribute(c,d):h[c]=d}else"boolean"===typeof d?d?h.setAttribute(c,""):h.removeAttribute(c):h.setAttribute("className"===c?"class":c,d)}}function O(a){return"oninit"===a||"oncreate"===a||"onupdate"===a||"onremove"===a||"onbeforeremove"===a||"onbeforeupdate"===a}function x(a,b,d){var c=a.dom,e="function"!==typeof G?d:function(a){var b=d.call(c,a);G.call(c,a);return b};if(b in c)c[b]="function"===typeof d?e:null;else{var h=
b.slice(2);void 0===a.events&&(a.events={});a.events[b]!==e&&(null!=a.events[b]&&c.removeEventListener(h,a.events[b],!1),"function"===typeof d&&(a.events[b]=e,c.addEventListener(h,a.events[b],!1)))}}function A(a,b,d){"function"===typeof a.oninit&&a.oninit.call(b.state,b);"function"===typeof a.oncreate&&d.push(a.oncreate.bind(b.state,b))}function I(a,b,d){"function"===typeof a.onupdate&&d.push(a.onupdate.bind(b.state,b))}var y=b.document,J=y.createDocumentFragment(),H={svg:"http://www.w3.org/2000/svg",
math:"http://www.w3.org/1998/Math/MathML"},G;return{render:function(a,b){if(!a)throw Error("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var c=[],d=y.activeElement;null==a.vnodes&&(a.textContent="");Array.isArray(b)||(b=[b]);n(a,a.vnodes,z.normalizeChildren(b),!1,c,null,void 0);a.vnodes=b;for(var e=0;e<c.length;e++)c[e]();y.activeElement!==d&&d.focus()},setEventCallback:function(a){return G=a}}},G=function(b){function d(b){b=f.indexOf(b);-1<b&&f.splice(b,2)}
function e(){for(var b=1;b<f.length;b+=2)f[b]()}b=P(b);b.setEventCallback(function(b){!1!==b.redraw&&e()});var f=[];return{subscribe:function(b,e){d(b);f.push(b,R(e))},unsubscribe:d,redraw:e,render:b.render}}(window);K.setCompletionCallback(G.redraw);A.mount=function(b){return function(d,e){if(null===e)b.render(d,[]),b.unsubscribe(d);else{if(null==e.view&&"function"!==typeof e)throw Error("m.mount(element, component) expects a component, not a vnode");b.subscribe(d,function(){b.render(d,z(e))});b.redraw()}}}(G);
var U=x,L=function(b){if(""===b||null==b)return{};"?"===b.charAt(0)&&(b=b.slice(1));b=b.split("&");for(var d={},e={},f=0;f<b.length;f++){var g=b[f].split("=");var n=decodeURIComponent(g[0]);g=2===g.length?decodeURIComponent(g[1]):"";"true"===g?g=!0:"false"===g&&(g=!1);var l=n.split(/\]\[?|\[/),r=d;-1<n.indexOf("[")&&l.pop();for(var p=0;p<l.length;p++){n=l[p];var k=l[p+1],k=""==k||!isNaN(parseInt(k,10)),m=p===l.length-1;""===n&&(n=l.slice(0,p).join(),null==e[n]&&(e[n]=0),n=e[n]++);null==r[n]&&(r[n]=
m?g:k?[]:{});r=r[n]}}return d},V=function(b){function d(d){var e=b.location[d].replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent);"pathname"===d&&"/"!==e[0]&&(e="/"+e);return e}function e(b){return function(){null==l&&(l=n(function(){l=null;b()}))}}function f(b,d,e){var a=b.indexOf("?"),f=b.indexOf("#"),g=-1<a?a:-1<f?f:b.length;if(-1<a){var a=L(b.slice(a+1,-1<f?f:b.length)),m;for(m in a)d[m]=a[m]}if(-1<f)for(m in d=L(b.slice(f+1)),d)e[m]=d[m];return b.slice(0,g)}var g="function"===typeof b.history.pushState,
n="function"===typeof setImmediate?setImmediate:setTimeout,l,r={prefix:"#!",getPath:function(){switch(r.prefix.charAt(0)){case "#":return d("hash").slice(r.prefix.length);case "?":return d("search").slice(r.prefix.length)+d("hash");default:return d("pathname").slice(r.prefix.length)+d("search")+d("hash")}},setPath:function(d,e,m){var a={},l={};d=f(d,a,l);if(null!=e){for(var k in e)a[k]=e[k];d=d.replace(/:([^\/]+)/g,function(b,d){delete a[d];return e[d]})}(k=H(a))&&(d+="?"+k);(l=H(l))&&(d+="#"+l);
g?(l=m?m.state:null,k=m?m.title:null,b.onpopstate(),m&&m.replace?b.history.replaceState(l,k,r.prefix+d):b.history.pushState(l,k,r.prefix+d)):b.location.href=r.prefix+d},defineRoutes:function(d,l,m){function a(){var a=r.getPath(),e={},g=f(a,e,e),k=b.history.state;if(null!=k)for(var n in k)e[n]=k[n];for(var p in d)if(k=new RegExp("^"+p.replace(/:[^\/]+?\.{3}/g,"(.*?)").replace(/:[^\/]+/g,"([^\\/]+)")+"/?$"),k.test(g)){g.replace(k,function(){for(var b=p.match(/:[^\/]+/g)||[],f=[].slice.call(arguments,
1,-2),g=0;g<b.length;g++)e[b[g].replace(/:|\./g,"")]=decodeURIComponent(f[g]);l(d[p],e,a,p)});return}m(a,e)}g?b.onpopstate=e(a):"#"===r.prefix.charAt(0)&&(b.onhashchange=a);a()}};return r};A.route=function(b,d){var e=V(b),f=function(b){return b},g,n,l,r,p,k=function(b,a,k){if(null==b)throw Error("Ensure the DOM element that was passed to `m.route` is not undefined");var m=function(){null!=g&&d.render(b,g(z(n,l.key,l)))},w=function(b){if(b!==a)e.setPath(a,null,{replace:!0});else throw Error("Could not resolve default route "+
a);};e.defineRoutes(k,function(a,b,d){var e=p=function(a,k){e===p&&(n=null==k||"function"!==typeof k.view&&"function"!==typeof k?"div":k,l=b,r=d,p=null,g=(a.render||f).bind(a),m())};a.view||"function"===typeof a?e({},a):a.onmatch?U.resolve(a.onmatch(b,d)).then(function(b){e(a,b)},w):e(a,"div")},w);d.subscribe(b,m)};k.set=function(b,a,d){null!=p&&(d={replace:!0});p=null;e.setPath(b,a,d)};k.get=function(){return r};k.prefix=function(b){e.prefix=b};k.link=function(b){b.dom.setAttribute("href",e.prefix+
b.attrs.href);b.dom.onclick=function(a){a.ctrlKey||a.metaKey||a.shiftKey||2===a.which||(a.preventDefault(),a.redraw=!1,a=this.getAttribute("href"),0===a.indexOf(e.prefix)&&(a=a.slice(e.prefix.length)),k.set(a,void 0,void 0))}};k.param=function(b){return"undefined"!==typeof l&&"undefined"!==typeof b?l[b]:l};return k}(window,G);A.withAttr=function(b,d,e){return function(f){d.call(e||this,b in f.currentTarget?f.currentTarget[b]:f.currentTarget.getAttribute(b))}};var W=P(window);A.render=W.render;A.redraw=
G.redraw;A.request=K.request;A.jsonp=K.jsonp;A.parseQueryString=L;A.buildQueryString=H;A.version="1.1.1";A.vnode=z;"undefined"!==typeof module?module.exports=A:window.m=A})();