Changed the onclick handlers for Keyboard CLICKCODES to let updateFocus() scroll the canvas into view as needed, because (at least on iOS) the code that tries prevent the page from scrolling has an annoying "jerking" side-effect; also fixed the old Node web server code that would install onclick handlers for disk images, triggering automatic conversion of JSON to IMG files
This commit is contained in:
parent
ed75397b83
commit
7ca8fa18a1
12 changed files with 19 additions and 18 deletions
|
|
@ -501,7 +501,7 @@ l.save=function(){var a=new Zf(this);this.controller&&a.set(0,this.controller.sa
|
|||
l.fc=function(a,b){if(a)2==a&&(this.B=this.B&-256|b);else if(b!=(this.C&255)){a=this.D.ka;if(b&mq)this.A&&(zc(a,nq,oq,this.A),this.A=null);else{this.A||(this.A=Ac(a,nq,oq));var c=Ac(a,pq,oq);zc(a,nq,oq,c,b&qq?1:Gc)}this.C=this.C&-256|b}};l.xj=function(){return rq};l.hh=function(){return sq};var iq=-2134900736,pq=16646144,nq=917504,oq=131072,mq=1,qq=2,jq=65535,kq=2575,lq=2,rq=[null,0],sq=[function(a){return this.controller.Ia(a)},null,null,function(a,b){this.controller.fc(a,b)},null,null];
|
||||
eb(function(){for(var a=Cb(document,"pcx86","ram"),b=0;b<a.length;b++){var c=a[b],d=zb(c),d=new gq(d);Bb(d,c)}});function tq(a){pb.call(this,"Keyboard",a,65536);uq(this,a.model);this.O=Wa("Mobi");this.Z=Wa("MSIE");Ob(this,"mobile keyboard support: "+(this.O?"true":"false"));this.N=0;this.Y=this.fh=!1;this.B=[];this.ea=50;this.F=null;this.G=a.autoType;Lb(this)}ba(tq,pb);l=tq.prototype;
|
||||
l.Cb=function(a,b,c,d){var e=this,f=a+"-"+b;if(void 0===this.na[f])switch(b){case "kbd":case "screen":return c.onkeydown=function(a){return vq(e,a,!0)},c.onkeypress=function(a){a=a||window.event;a=a.which||a.keyCode;e.C="";var b=!O[a]||!!(e.jc&wq);b||xq(e,a,!0);return b},c.onkeyup=function(a){return vq(e,a,!1)},!0;case "caps-lock":return this.na[f]=c,c.onclick=function(){e.pa&&e.pa.nd();xq(e,yq,!0)},!0;case "num-lock":return this.na[f]=c,c.onclick=function(){e.pa&&e.pa.nd();xq(e,zq,!0)},!0;case "scroll-lock":return this.na[f]=
|
||||
c,c.onclick=function(){e.pa&&e.pa.nd();xq(e,Aq,!0)},!0;default:var g=b.toUpperCase().replace(/-/g,"_");if(void 0!==Bq[g]&&"button"==a)return this.na[f]=c,c.onclick=function(a,b,c){return function(){a.pa&&a.pa.nd();a.C="";Cq(a,c,!0);xq(a,c,!0)}}(this,g,Bq[g]),!0;if(void 0!==Dq[b])return this.N++,this.na[f]=c,a=function(a,b,c){return function(){a.C="";xq(a,c)}}(this,b,Dq[b]),b=function(a,b,c){return function(){Eq(a,c)}}(this,b,Dq[b]),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=
|
||||
c,c.onclick=function(){e.pa&&e.pa.nd();xq(e,Aq,!0)},!0;default:var g=b.toUpperCase().replace(/-/g,"_");if(void 0!==Bq[g]&&"button"==a)return this.na[f]=c,c.onclick=function(a,b,c){return function(){a.pa&&a.pa.nd(!0);a.C="";Cq(a,c,!0);xq(a,c,!0)}}(this,g,Bq[g]),!0;if(void 0!==Dq[b])return this.N++,this.na[f]=c,a=function(a,b,c){return function(){a.C="";xq(a,c)}}(this,b,Dq[b]),b=function(a,b,c){return function(){Eq(a,c)}}(this,b,Dq[b]),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=
|
||||
a,c.onmouseup=c.onmouseout=b),!0;if(d)return this.na[f]=c,c.onclick=function(){e.pa&&e.pa.nd();d&&!e.C&&(e.C=d,Fq(e,150))},!0}return!1};function Gq(a,b,c){if(a.N){for(var d in na)if(b==na[d]){b=+d;(d=ma[d])&&(b=d);break}for(var e in Dq)if((d=Dq[e]==b)||(d=b,d>=n.ee&&d<=n.z&&(d-=n.ee-n.de),d=Dq[e]==d),d){(a=a.na["key-"+e])&&void 0!==c&&(a.style.color=c?"#ffffff":"#000000",a.style.backgroundColor=c?"#000000":"#ffffff");break}}}
|
||||
l.uc=function(a,b,c,d){this.pa=a;this.ka=b;this.H=c;this.ba=d;this.W=Zb(a,"ChipSet");this.G=Bd(a,"autoType")||this.G;Uf(c,33,this.$m.bind(this))};l.$m=function(){if(10==(this.H.D>>8&255)&&!this.F&&this.G){var a=this.F=Hq(this.G);a&&!this.C&&(this.C=a,Fq(this,150))}return!0};
|
||||
function Hq(a){if(a){for(var b,c=/(?:^|[^$])\$([a-z]+)/g;b=c.exec(a);){var d;switch(b[1]){case "date":d=Fa("n-j-Y");break;case "time":d=Fa("h:i:s");break;default:continue}a=a.replace("$"+b[1],d)}a=a.replace(/\$\$/g,"$$")}return a}function uq(a,b){var c=0;a.ca=null;"string"==typeof b&&(a.ca=b.toUpperCase(),c=Iq.indexOf(a.ca),0>c&&(c=0));if(b=Iq[c])a.aa=parseInt(b.substr(2),10)}function wp(a){Ob(a,"keyboard reset",65792);a.A=[];yp(a,Jq)}
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ k.save=function(){var a=new Te(this);this.controller&&a.set(0,this.controller.sa
|
|||
k.Dc=function(a,b){if(a)2==a&&(this.B=this.B&-256|b);else if(b!=(this.C&255)){a=this.F.ma;if(b&ao)this.A&&(Zb(a,bo,co,this.A),this.A=null);else{this.A||(this.A=$b(a,bo,co));var c=$b(a,eo,co);Zb(a,bo,co,c,b&fo?1:fc)}this.C=this.C&-256|b}};k.ui=function(){return go};k.rg=function(){return ho};var Xn=-2134900736,eo=16646144,bo=917504,co=131072,ao=1,fo=2,Yn=65535,Zn=2575,$n=2,go=[null,0],ho=[function(a){return this.controller.Eb(a)},null,null,function(a,b){this.controller.Dc(a,b)},null,null];
|
||||
Pa(function(){for(var a=hb(document,"pcx86","ram"),b=0;b<a.length;b++){var c=a[b],d=eb(c),d=new Vn(d);gb(d,c)}});function io(a){t.call(this,"Keyboard",a);jo(this,a.model);this.W=Ka("Mobi");this.O=Ka("MSIE");this.L=0;this.M=this.pg=!1;this.A=[];this.Z=50;this.D=null;this.F=a.autoType;pb(this)}ba(io,t);k=io.prototype;
|
||||
k.wb=function(a,b,c,d){var e=this,f=a+"-"+b;if(void 0===this.ia[f])switch(b){case "kbd":case "screen":return c.onkeydown=function(a){return ko(e,a,!0)},c.onkeypress=function(a){a=a||window.event;a=a.which||a.keyCode;e.B="";var b=!V[a]||!!(e.Sb&lo);b||mo(e,a,!0);return b},c.onkeyup=function(a){return ko(e,a,!1)},!0;case "caps-lock":return this.ia[f]=c,c.onclick=function(){e.oa&&bd(e.oa);mo(e,no,!0)},!0;case "num-lock":return this.ia[f]=c,c.onclick=function(){e.oa&&bd(e.oa);mo(e,oo,!0)},!0;case "scroll-lock":return this.ia[f]=
|
||||
c,c.onclick=function(){e.oa&&bd(e.oa);mo(e,po,!0)},!0;default:var g=b.toUpperCase().replace(/-/g,"_");if(void 0!==qo[g]&&"button"==a)return this.ia[f]=c,c.onclick=function(a,b,c){return function(){a.oa&&bd(a.oa);a.B="";ro(a,c,!0);mo(a,c,!0)}}(this,g,qo[g]),!0;if(void 0!==so[b])return this.L++,this.ia[f]=c,a=function(a,b,c){return function(){a.B="";mo(a,c)}}(this,b,so[b]),b=function(a,b,c){return function(){to(a,c)}}(this,b,so[b]),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=
|
||||
c,c.onclick=function(){e.oa&&bd(e.oa);mo(e,po,!0)},!0;default:var g=b.toUpperCase().replace(/-/g,"_");if(void 0!==qo[g]&&"button"==a)return this.ia[f]=c,c.onclick=function(a,b,c){return function(){a.oa&&bd(a.oa,!0);a.B="";ro(a,c,!0);mo(a,c,!0)}}(this,g,qo[g]),!0;if(void 0!==so[b])return this.L++,this.ia[f]=c,a=function(a,b,c){return function(){a.B="";mo(a,c)}}(this,b,so[b]),b=function(a,b,c){return function(){to(a,c)}}(this,b,so[b]),"ontouchstart"in window?(c.ontouchstart=a,c.ontouchend=b):(c.onmousedown=
|
||||
a,c.onmouseup=c.onmouseout=b),!0;if(d)return this.ia[f]=c,c.onclick=function(){e.oa&&bd(e.oa);d&&!e.B&&(e.B=d,uo(e,150))},!0}return!1};function vo(a,b,c){if(a.L){for(var d in p)if(b==p[d]){b=+d;(d=ma[d])&&(b=d);break}for(var e in so)if((d=so[e]==b)||(d=b,d>=n.Dd&&d<=n.z&&(d-=n.Dd-n.Cd),d=so[e]==d),d){(a=a.ia["key-"+e])&&void 0!==c&&(a.style.color=c?"#ffffff":"#000000",a.style.backgroundColor=c?"#000000":"#ffffff");break}}}
|
||||
k.ic=function(a,b,c,d){this.oa=a;this.ma=b;this.U=c;this.Ea=d;this.V=zb(a,"ChipSet");this.F=Pc(a,"autoType")||this.F;Pe(c,33,this.Ll.bind(this))};k.Ll=function(){if(10==(this.U.F>>8&255)&&!this.D&&this.F){var a=this.D=wo(this.F);a&&!this.B&&(this.B=a,uo(this,150))}return!0};
|
||||
function wo(a){if(a){for(var b,c=/(?:^|[^$])\$([a-z]+)/g;b=c.exec(a);){var d;switch(b[1]){case "date":d=xa("n-j-Y");break;case "time":d=xa("h:i:s");break;default:continue}a=a.replace("$"+b[1],d)}a=a.replace(/\$\$/g,"$$")}return a}function jo(a,b){var c=0;a.ba=null;"string"==typeof b&&(a.ba=b.toUpperCase(),c=xo.indexOf(a.ba),0>c&&(c=0));if(b=xo[c])a.X=parseInt(b.substr(2),10)}function Vm(a,b,c){a.J!==c&&(a.J=a.K=c)&&(a.H=!0);a.I!==b&&(a.I=b)&&!a.K&&In(a,!0);a.I&&a.K&&(a.Jb=[],kn(a,ln),a.K=!1)}
|
||||
|
|
|
|||
Loading…
Reference in a new issue