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:
Jeff Parsons 2017-06-26 11:05:01 -07:00 committed by Jeff Parsons
commit 7ca8fa18a1
12 changed files with 19 additions and 18 deletions

View file

@ -20,7 +20,7 @@ one of several JavaScript Machines in the [PCjs Project](https://github.com/jeff
includes:
* [PCx86](/docs/pcx86/), an x86-based emulator of the [IBM PC and PC-compatibles](/devices/pcx86/machine/)
* [PC8080](/modules/pc8080/), an 8080 machine emulator (e.g., [Space Invaders](/devices/pc8080/machine/invaders/) and the [VT100 Terminal](/devices/pc8080/machine/vt100/))
* [PC8080](/modules/pc8080/), an 8080 machine emulator (see [Space Invaders](/devices/pc8080/machine/invaders/) and the [VT100 Terminal](/devices/pc8080/machine/vt100/))
* [C1Pjs](/docs/c1pjs/), an emulation of the 6502-based [Ohio Scientific Challenger 1P](/devices/c1p/)
* [PDPjs](/docs/pdpjs/), a set of machine emulation modules supporting the DEC [PDP-10](/devices/pdp10/machine/) and [PDP-11](/devices/pdp11/machine/)

View file

@ -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)}

View file

@ -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)}

View file

@ -3216,7 +3216,7 @@ DiskDump.prototype.convertOSIDiskToJSON = function()
};
/**
* convertToIMG()
* convertToIMG(fRaw)
*
* Converts the disk image data to a Buffer.
*
@ -3224,9 +3224,10 @@ DiskDump.prototype.convertOSIDiskToJSON = function()
* disk images under /tmp, using a name based on a hash of the source path).
*
* @this {DiskDump}
* @param {boolean} [fRaw] (used by httpapi.js to get the underlying Buffer)
* @return {Buffer|null} containing the disk image's raw data, or null if no data available (or parse error)
*/
DiskDump.prototype.convertToIMG = function()
DiskDump.prototype.convertToIMG = function(fRaw)
{
if (!this.bufDisk) {
@ -3391,7 +3392,7 @@ DiskDump.prototype.convertToIMG = function()
this.bufDisk = buf;
}
return this.bufDisk;
return (fRaw && this.bufDisk instanceof BufferPF)? this.bufDisk.buf : this.bufDisk;
};
/**

View file

@ -519,9 +519,9 @@ HTMLOut.filter = function(req, res, next)
HTMLOut.logError(err);
next(); // alternatively: res.status(404).send("Cannot GET " + req.path);
} else {
sData = sData.replace(/^([ \t]*import\s+\S+\s+from\s+(['"]).*?\1;)/gm, "// $1");
sData = sData.replace(/^([ \t]*import\s+\S+\s+from\s+['"].*?['"];)/gm, "// $1");
sData = sData.replace(/^([ \t]*export\s+default\s+\S+;)/gm, "// $1");
sData = sData.replace(/^([ \t]*var\s+\S+\s*=\s*require\((['"]).*?\1\);)/gm, "// $1");
sData = sData.replace(/^([ \t]*var\s+\S+\s*=\s*require\(['"].*?['"]\);)/gm, "// $1");
sData = sData.replace(/^([ \t]*(if\s+\(NODE\)\s*|)module\.exports\s*=\s*\S+;)/gm, "// $1");
res.set("Content-Type", "application/javascript");
res.status(200).send(sData);
@ -1643,7 +1643,7 @@ HTMLOut.prototype.getManifestXML = function(sToken, sIndent, aParms)
}
if (sNodeLink) {
if (str.endsWith(sNodeLink, ".json") && sNodeLink.indexOf("/disks/") === 0) {
if (str.endsWith(sNodeLink, ".json") && (!sNodeLink.indexOf("/apps/") || !sNodeLink.indexOf("/disks/"))) {
sOnClick = obj.genOnClick(sNodeLink);
}
sNodeValue = '<a href="' + net.encodeURL(sNodeLink, obj.req, obj.fDebug) + '"' + sOnClick + '>' + sNodeValue + '</a>';

View file

@ -715,7 +715,7 @@ HTTPAPI.processDumpAPI = function(req, res)
if (sDisk.indexOf("..") < 0 || req.app.settings.port == 8088) {
sFormat = req.query[DumpAPI.QUERY.FORMAT] || DumpAPI.FORMAT.JSON;
fComments = (req.query[DumpAPI.QUERY.COMMENTS]? true : false);
fComments = !!req.query[DumpAPI.QUERY.COMMENTS];
var sSize = req.query[DumpAPI.QUERY.MBHD];
if (sSize) {
sSize = (sSize * 1000).toString();
@ -751,7 +751,7 @@ HTTPAPI.processDumpAPI = function(req, res)
if (sFile.indexOf("..") < 0 || req.app.settings.port == 8088) {
sFormat = req.query[DumpAPI.QUERY.FORMAT] || DumpAPI.FORMAT.JSON;
fComments = (req.query[DumpAPI.QUERY.COMMENTS]? true : false);
fComments = !!req.query[DumpAPI.QUERY.COMMENTS];
var fDecimal;
if (req.query[DumpAPI.QUERY.DECIMAL]) {
fDecimal = (req.query[DumpAPI.QUERY.DECIMAL] == "true");
@ -793,7 +793,7 @@ HTTPAPI.dumpDisk = function(err, disk, res)
sAttachment = path.basename(disk.sDiskPath);
var i = sAttachment.lastIndexOf('.');
if (i > 0) sAttachment = sAttachment.substring(0, i+1) + DumpAPI.FORMAT.IMG;
sResponse = disk.convertToIMG();
sResponse = disk.convertToIMG(true);
} else {
// res.charset = "utf-8";
sMIMEType = "application/json; charset=utf-8";

View file

@ -252,7 +252,7 @@ class Keyboard extends Component {
control.onclick = function(kbd, sKey, simCode) {
return function onKeyboardBindingClick(event) {
if (!COMPILED && kbd.messageEnabled()) kbd.printMessage(sKey + " clicked", Messages.KEYS);
if (kbd.cmp) kbd.cmp.updateFocus();
if (kbd.cmp) kbd.cmp.updateFocus(true);
kbd.sInjectBuffer = ""; // actual key events should stop any injection currently in progress
kbd.updateShiftState(simCode, true); // future-proofing if/when any LOCK keys are added to CLICKCODES
kbd.addActiveKey(simCode, true);

View file

@ -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)}

File diff suppressed because one or more lines are too long

View file

@ -44182,7 +44182,7 @@ class Keyboard extends Component {
control.onclick = function(kbd, sKey, simCode) {
return function onKeyboardBindingClick(event) {
if (!COMPILED && kbd.messageEnabled()) kbd.printMessage(sKey + " clicked", Messages.KEYS);
if (kbd.cmp) kbd.cmp.updateFocus();
if (kbd.cmp) kbd.cmp.updateFocus(true);
kbd.sInjectBuffer = ""; // actual key events should stop any injection currently in progress
kbd.updateShiftState(simCode, true); // future-proofing if/when any LOCK keys are added to CLICKCODES
kbd.addActiveKey(simCode, true);

View file

@ -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)}

File diff suppressed because one or more lines are too long