More attempts to clean-up and reduce spurious alerts
This commit is contained in:
parent
7aa689c745
commit
c20fe69872
11 changed files with 95 additions and 68 deletions
|
|
@ -22,6 +22,8 @@ You can also browse our collection of archived disks:
|
||||||
* [Challenger 1P Disk Library](/disks/c1p/)
|
* [Challenger 1P Disk Library](/disks/c1p/)
|
||||||
* [DEC Disk Library](/disks/dec/)
|
* [DEC Disk Library](/disks/dec/)
|
||||||
|
|
||||||
|
{% include_relative pcx86/apps.md %}
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Software Application Manifests
|
### Software Application Manifests
|
||||||
|
|
|
||||||
|
|
@ -4,52 +4,7 @@ title: IBM PC Application Demos
|
||||||
permalink: /apps/pcx86/
|
permalink: /apps/pcx86/
|
||||||
---
|
---
|
||||||
|
|
||||||
IBM PC Application Demos
|
{% include_relative apps.md %}
|
||||||
------------------------
|
|
||||||
|
|
||||||
Below are selected [PCx86](/docs/about/pcx86/) demos of classic IBM PC applications. In many cases,
|
|
||||||
we've had to create our own "Demo Disks", because copies of the original distribution disks are difficult
|
|
||||||
to find, and in some cases (e.g., [Executive Suite](1982/esuite/)), the original disks were copy-protected,
|
|
||||||
so we've been forced to use a "cracked" copy of the software instead.
|
|
||||||
|
|
||||||
A list of all the software available to PCx86 machines can be found in the [IBM PC Disk Library](/disks/pcx86/).
|
|
||||||
|
|
||||||
### 1981
|
|
||||||
|
|
||||||
* [DONKEY.BAS](1981/donkey/)
|
|
||||||
* [Microsoft Adventure](/disks/pcx86/games/microsoft/adventure/)
|
|
||||||
* [VisiCalc](1981/visicalc/)
|
|
||||||
|
|
||||||
### 1982
|
|
||||||
|
|
||||||
* [Executive Suite](1982/esuite/)
|
|
||||||
* [RatBas v2.13](1982/ratbas/)
|
|
||||||
* [Zork I](/disks/pcx86/games/infocom/zork1/)
|
|
||||||
|
|
||||||
### 1983
|
|
||||||
|
|
||||||
* [Adventures in Math v1.00](1983/adventmath/)
|
|
||||||
* [Planetfall](/disks/pcx86/games/infocom/planet/)
|
|
||||||
* [SuperCalc2 v1.00](/disks/pcx86/apps/other/sc2/1.00/)
|
|
||||||
* [SuperCalc3 v1.00](/disks/pcx86/apps/other/sc3/1.00/)
|
|
||||||
* [Zork II](/disks/pcx86/games/infocom/zork2/)
|
|
||||||
* [Zork III](/disks/pcx86/games/infocom/zork3/)
|
|
||||||
|
|
||||||
### 1984
|
|
||||||
|
|
||||||
* [The Hitchhiker's Guide to the Galaxy](/disks/pcx86/games/infocom/hhiker/)
|
|
||||||
|
|
||||||
### 1985
|
|
||||||
|
|
||||||
* [Rogue](1985/rogue/)
|
|
||||||
|
|
||||||
### 1987
|
|
||||||
|
|
||||||
* [ThinkTank v2.14](1987/thinktank/)
|
|
||||||
|
|
||||||
### 1992
|
|
||||||
|
|
||||||
* [The Dungeons of Moria v5.5](1992/moria/)
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
46
apps/pcx86/apps.md
Normal file
46
apps/pcx86/apps.md
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
IBM PC Application Demos
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
Below are selected [PCx86](/docs/about/pcx86/) demos of classic IBM PC applications. In many cases,
|
||||||
|
we've had to create our own "Demo Disks", because copies of the original distribution disks are difficult
|
||||||
|
to find, and in some cases (e.g., [Executive Suite](/apps/pcx86/1982/esuite/)), the original disks were
|
||||||
|
copy-protected, so we've been forced to use a "cracked" copy of the software instead.
|
||||||
|
|
||||||
|
A list of all the software available to PCx86 machines can be found in the [IBM PC Disk Library](/disks/pcx86/).
|
||||||
|
|
||||||
|
### 1981
|
||||||
|
|
||||||
|
* [DONKEY.BAS](/apps/pcx86/1981/donkey/)
|
||||||
|
* [Microsoft Adventure](/disks/pcx86/games/microsoft/adventure/)
|
||||||
|
* [VisiCalc](/apps/pcx86/1981/visicalc/)
|
||||||
|
|
||||||
|
### 1982
|
||||||
|
|
||||||
|
* [Executive Suite](/apps/pcx86/1982/esuite/)
|
||||||
|
* [RatBas v2.13](/apps/pcx86/1982/ratbas/)
|
||||||
|
* [Zork I](/disks/pcx86/games/infocom/zork1/)
|
||||||
|
|
||||||
|
### 1983
|
||||||
|
|
||||||
|
* [Adventures in Math v1.00](/apps/pcx86/1983/adventmath/)
|
||||||
|
* [Planetfall](/disks/pcx86/games/infocom/planet/)
|
||||||
|
* [SuperCalc2 v1.00](/disks/pcx86/apps/other/sc2/1.00/)
|
||||||
|
* [SuperCalc3 v1.00](/disks/pcx86/apps/other/sc3/1.00/)
|
||||||
|
* [Zork II](/disks/pcx86/games/infocom/zork2/)
|
||||||
|
* [Zork III](/disks/pcx86/games/infocom/zork3/)
|
||||||
|
|
||||||
|
### 1984
|
||||||
|
|
||||||
|
* [The Hitchhiker's Guide to the Galaxy](/disks/pcx86/games/infocom/hhiker/)
|
||||||
|
|
||||||
|
### 1985
|
||||||
|
|
||||||
|
* [Rogue](/apps/pcx86/1985/rogue/)
|
||||||
|
|
||||||
|
### 1987
|
||||||
|
|
||||||
|
* [ThinkTank v2.14](/apps/pcx86/1987/thinktank/)
|
||||||
|
|
||||||
|
### 1992
|
||||||
|
|
||||||
|
* [The Dungeons of Moria v5.5](/apps/pcx86/1992/moria/)
|
||||||
|
|
@ -864,16 +864,16 @@ yb("Panel",this.id))&&this.D.Je)for(b=0;b<e.length;b++)d=e[b],d.Da=this.D.Da,d.P
|
||||||
(this.M=new Zf(this,"1.35.1"),this.M.load()?b=null:delete this.M));!b&&this.A&&(b=PB(this))&&(this.I=!0);if(b){var f=this;Na(b,null,!0,function(a,b,c){c?(f.K=null,f.I=!1,f.Da("Unable to load machine state from server (error "+c+(b?": "+Ba(b):"")+")")):(f.L=b,f.Z=!0);Lb(f)})}else Lb(this);this.na.power||(this.N=!0);!c&&this.N&&QB(this,this.Mf)}else kb("Unable to find CPU component")}ba(LB,pb);
|
(this.M=new Zf(this,"1.35.1"),this.M.load()?b=null:delete this.M));!b&&this.A&&(b=PB(this))&&(this.I=!0);if(b){var f=this;Na(b,null,!0,function(a,b,c){c?(f.K=null,f.I=!1,f.Da("Unable to load machine state from server (error "+c+(b?": "+Ba(b):"")+")")):(f.L=b,f.Z=!0);Lb(f)})}else Lb(this);this.na.power||(this.N=!0);!c&&this.N&&QB(this,this.Mf)}else kb("Unable to find CPU component")}ba(LB,pb);
|
||||||
function MB(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){kb(d.message+" ("+c+")")}}a.J=b}function Bd(a,b,c){var d=Xa(b);void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function QB(a,b,c){for(var d=vb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Kb(f)){Kb(f,function(){QB(a,b,c)});return}}b.call(a,c)}
|
function MB(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){kb(d.message+" ("+c+")")}}a.J=b}function Bd(a,b,c){var d=Xa(b);void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function QB(a,b,c){for(var d=vb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Kb(f)){Kb(f,function(){QB(a,b,c)});return}}b.call(a,c)}
|
||||||
function RB(a,b){var c=new Zf(a,"1.35.1",SB);if(c.load()&&TB(c)){var d=c.get(UB),e=b?b.get(UB):"unknown";d!=e&&(a.Da("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}l=LB.prototype;
|
function RB(a,b){var c=new Zf(a,"1.35.1",SB);if(c.load()&&TB(c)){var d=c.get(UB),e=b?b.get(UB):"unknown";d!=e&&(a.Da("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}l=LB.prototype;
|
||||||
l.Mf=function(a){void 0===a&&(a=this.A||(this.L?VB:NB));if(!this.C){this.C++;var b=!1,c=!1;this.Y=!1;var d=this.M||new Zf(this,"1.35.1");if(a==WB)b=!0;else if(a>NB){if(d.load(this.L)){this.F=new Zf(this,"1.35.1",XB);this.F.load()&&(a!=VB&&YB(this,d)&&(a=ZB),$B(this.F));this.F.set(UB,Ea());aC(this.F);var e=this.A&&!this.I;if(a==VB||ub("Click OK to restore the previous PCx86 machine state, or CANCEL to reset the machine.")){if(c=TB(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==
|
l.Mf=function(a){void 0===a&&(a=this.A||(this.L?VB:NB));if(!this.C){this.C++;var b=!1,c=!1;this.Y=!1;var d=this.M||new Zf(this,"1.35.1");if(a==WB)b=!0;else if(a>NB){if(d.load(this.L)){this.F=new Zf(this,"1.35.1",XB);this.F.load()&&(a!=VB&&YB(this,d)&&(a=ZB),$B(this.F));this.F.set(UB,Ea());aC(this.F);var e=this.A&&!this.I;if(a==VB||ub("Click OK to restore the previous PCx86 machine state.")){if(c=TB(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==f&&"no machine state"!=g?(this.Da("Error: "+
|
||||||
f&&"no machine state"!=g?(this.Da("Error: "+g),"unable to verify user"==g&&(Va(bC,""),this.B=null)):this.P(f+": "+g),$B(d),d.load()?(c=TB(d),e=!0):c=!1))}e&&RB(this,c?d:null)}else a==ZB&&d.clear()}else RB(this);delete this.L;delete this.M}e=vb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.H&&(c=cC(this,g,d,b,c));b=[d,a,c];a!=WB?QB(this,this.oj,b):this.oj(b)}};
|
g),"unable to verify user"==g&&(Va(bC,""),this.B=null)):this.P(f+": "+g),$B(d),d.load()?(c=TB(d),e=!0):c=!1))}e&&RB(this,c?d:null)}else a==ZB&&d.clear()}else RB(this);delete this.L;delete this.M}e=vb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.H&&(c=cC(this,g,d,b,c));b=[d,a,c];a!=WB?QB(this,this.oj,b):this.oj(b)}};
|
||||||
function cC(a,b,c,d,e){if(!b.da.Yb){b.da.Yb=!0;if(b.Xb){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/-[0-9]+\./i,"."))));"string"===typeof f&&(f=null);!b.Xb(f,d)&&f&&(b.Da("Unable to restore hardware state")&&(a.W&&!a.Z?(c.clear(),a.A=NB,window&&window.location.reload()):a.Y=!0),b.Xb(null),e=!1)}if(!d&&b.zj)for(a=b.zj.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
function cC(a,b,c,d,e){if(!b.da.Yb){b.da.Yb=!0;if(b.Xb){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/-[0-9]+\./i,"."))));"string"===typeof f&&(f=null);!b.Xb(f,d)&&f&&(b.Da("Unable to restore hardware state")&&(a.W&&!a.Z?(c.clear(),a.A=NB,window&&window.location.reload()):a.Y=!0),b.Xb(null),e=!1)}if(!d&&b.zj)for(a=b.zj.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||||
l.oj=function(a){var b=a[0],c=0>a[1];a=a[2];this.ga=!0;this.da.Yb=!0;var d=this.na.power;d&&(d.textContent="Shutdown");this.H&&(cC(this,this.H,b,c,a),this.H.mf());this.Y&&(YB(this,b),b.clear());!c&&this.F&&(this.F.clear(),delete this.F);this.C=0};
|
l.oj=function(a){var b=a[0],c=0>a[1];a=a[2];this.ga=!0;this.da.Yb=!0;var d=this.na.power;d&&(d.textContent="Shutdown");this.H&&(cC(this,this.H,b,c,a),this.H.mf());this.Y&&(YB(this,b),b.clear());!c&&this.F&&(this.F.clear(),delete this.F);this.C=0};
|
||||||
function YB(a,b){if(!a.da.Tf){if(ub("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.B||"";b=b.toString();var d={app:"PCx86",ver:"1.35.1"};d.url=a.ea;d.user=c;d.type="bug";d.data=b;Na("http://www.pcjs.org/api/v1/report",d,!0)}return!0}return!1}
|
function YB(a,b){if(!a.da.Tf){if(ub("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.B||"";b=b.toString();var d={app:"PCx86",ver:"1.35.1"};d.url=a.ea;d.user=c;d.type="bug";d.data=b;Na("http://www.pcjs.org/api/v1/report",d,!0)}return!0}return!1}
|
||||||
function sB(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new Zf(a,"1.35.1"),g=new Zf(a,"1.35.1",SB),h=Ea();g.set(UB,h);f.set(UB,h);f.set(dC,"1.35.1");f.set(eC,window?window.location.href:null);f.set(fC,Pa());a.H&&a.H.Wb&&(c&&a.H.Jb(),d=a.H.Wb(b,c),"object"===typeof d&&f.set(a.H.id,d),c&&(a.H.da.Yb=!1,!1===d&&(e=null)));for(var h=vb(a.id),k=0;k<h.length;k++){var m=h[k];m.da.Yb&&(m.Wb&&(d=m.Wb(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.da.Yb=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.B&&gC(a,
|
function sB(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new Zf(a,"1.35.1"),g=new Zf(a,"1.35.1",SB),h=Ea();g.set(UB,h);f.set(UB,h);f.set(dC,"1.35.1");f.set(eC,window?window.location.href:null);f.set(fC,Pa());a.H&&a.H.Wb&&(c&&a.H.Jb(),d=a.H.Wb(b,c),"object"===typeof d&&f.set(a.H.id,d),c&&(a.H.da.Yb=!1,!1===d&&(e=null)));for(var h=vb(a.id),k=0;k<h.length;k++){var m=h[k];m.da.Yb&&(m.Wb&&(d=m.Wb(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.da.Yb=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.B&&gC(a,
|
||||||
a.B,f.toString()),aC(g)&&aC(f)||(e=null,d=h=!0)):a.A&&(d=!0,h=a.A==hC),d&&f.clear(h)):e=f.toString());c&&(a.da.Yb=!1,b=a.na.power)&&(b.textContent="Power");a.C=0;return e}l.reset=function(){this.ka&&this.ka.reset&&(Ob(this,"Resetting "+this.ka.type),this.ka.reset());for(var a=vb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ka&&c.reset&&(Ob(this,"Resetting "+c.type),c.reset())}};
|
a.B,f.toString()),aC(g)&&aC(f)||(e=null,d=h=!0)):a.A&&(d=!0,h=a.A==hC),d&&f.clear(h)):e=f.toString());c&&(a.da.Yb=!1,b=a.na.power)&&(b.textContent="Power");a.C=0;return e}l.reset=function(){this.ka&&this.ka.reset&&(Ob(this,"Resetting "+this.ka.type),this.ka.reset());for(var a=vb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ka&&c.reset&&(Ob(this,"Resetting "+c.type),c.reset())}};
|
||||||
l.start=function(a,b){for(var c=vb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};l.stop=function(a,b){for(var c=vb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
l.start=function(a,b){for(var c=vb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};l.stop=function(a,b){for(var c=vb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||||
l.Cb=function(a,b,c){var d=this;switch(b){case "power":return this.na[b]=c,c.onclick=function(){d.C||(d.da.Yb?sB(d,!1,!0):QB(d,d.Mf))},!0;case "reset":return this.na[b]=c,c.onclick=function(){if(d.da.Yb&&!d.C)if(d.A&&!d.K){var a=d.da.Tf||ub("Click OK to save changes to this PCx86 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");sB(d,a,!0);!a&&d.W?window&&window.location.reload():(a||(d.O=!0),d.Mf(NB),d.O=!1)}else d.reset(),d.H&&d.H.mf()},!0;case "save":if(wa(Oa(),"pcjs.org"))c.parentNode.removeChild(c);
|
l.Cb=function(a,b,c){var d=this;switch(b){case "power":return this.na[b]=c,c.onclick=function(){d.C||(d.da.Yb?sB(d,!1,!0):QB(d,d.Mf))},!0;case "reset":return this.na[b]=c,c.onclick=function(){if(d.da.Yb&&!d.C)if(d.A&&!d.K){var a=d.da.Tf||!ub("Click OK to reset this PCx86 machine and discard all disk modifications.");sB(d,a,!0);!a&&d.W?window&&window.location.reload():(a||(d.O=!0),d.Mf(NB),d.O=!1)}else d.reset(),d.H&&d.H.mf()},!0;case "save":if(wa(Oa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.na[b]=
|
||||||
else return this.na[b]=c,c.onclick=function(){var a=OB(d,!0);if(a){var b=!!(d.A&&!d.K||d.W),c=sB(d,b);b?gC(d,a,c):d.Da("Resume disabled, machine state not saved")}},!0}return!1};
|
c,c.onclick=function(){var a=OB(d,!0);if(a){var b=!!(d.A&&!d.K||d.W),c=sB(d,b);b?gC(d,a,c):d.Da("Resume disabled, machine state not saved")}},!0}return!1};
|
||||||
function OB(a,b){var c=a.B;c||((c=Ua(bC),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=tC(a,c))||a.Da("The user ID is invalid.")):b&&a.Da("Browser local storage is not available"));return c}
|
function OB(a,b){var c=a.B;c||((c=Ua(bC),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=tC(a,c))||a.Da("The user ID is invalid.")):b&&a.Da("Browser local storage is not available"));return c}
|
||||||
function tC(a,b){a.B=null;b=Na(Oa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Va(bC,b.data),a.B=b.data)}catch(d){kb(d.message+" ("+c+")")}return a.B}function PB(a){var b=null;a.B&&(b=Oa()+"/api/v1/user?req=load&user="+a.B+"&state="+uC(a,"1.35.1"));return b}
|
function tC(a,b){a.B=null;b=Na(Oa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Va(bC,b.data),a.B=b.data)}catch(d){kb(d.message+" ("+c+")")}return a.B}function PB(a){var b=null;a.B&&(b=Oa()+"/api/v1/user?req=load&user="+a.B+"&state="+uC(a,"1.35.1"));return b}
|
||||||
function gC(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=uC(a,"1.35.1");d.data=c;b=Na(Oa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Da("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.Da(c),Va(bC,""),a.B=null)}}
|
function gC(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=uC(a,"1.35.1");d.data=c;b=Na(Oa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Da("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.Da(c),Va(bC,""),a.B=null)}}
|
||||||
|
|
|
||||||
|
|
@ -666,16 +666,16 @@ this.id))&&this.D.Ef)for(b=0;b<e.length;b++)d=e[b],d.wa=this.D.wa,d.Zb=this.D.Zb
|
||||||
new Te(this,"1.35.1"),this.L.load()?b=null:delete this.L));!b&&this.A&&(b=Uu(this))&&(this.H=!0);if(b){var f=this;Ea(b,null,!0,function(a,b,c){c?(f.J=null,f.H=!1,f.wa("Unable to load machine state from server (error "+c+(b?": "+ua(b):"")+")")):(f.K=b,f.X=!0);pb(f)})}else pb(this);this.ia.power||(this.M=!0);!c&&this.M&&Vu(this,this.af)}else r("Unable to find CPU component")}ba(Qu,t);
|
new Te(this,"1.35.1"),this.L.load()?b=null:delete this.L));!b&&this.A&&(b=Uu(this))&&(this.H=!0);if(b){var f=this;Ea(b,null,!0,function(a,b,c){c?(f.J=null,f.H=!1,f.wa("Unable to load machine state from server (error "+c+(b?": "+ua(b):"")+")")):(f.K=b,f.X=!0);pb(f)})}else pb(this);this.ia.power||(this.M=!0);!c&&this.M&&Vu(this,this.af)}else r("Unable to find CPU component")}ba(Qu,t);
|
||||||
function Ru(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){r(d.message+" ("+c+")")}}a.I=b}function Pc(a,b,c){var d=La(b);void 0===d&&a.I&&(d=a.I[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Vu(a,b,c){for(var d=bb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ob(f)){ob(f,function(){Vu(a,b,c)});return}}b.call(a,c)}
|
function Ru(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){r(d.message+" ("+c+")")}}a.I=b}function Pc(a,b,c){var d=La(b);void 0===d&&a.I&&(d=a.I[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Vu(a,b,c){for(var d=bb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ob(f)){ob(f,function(){Vu(a,b,c)});return}}b.call(a,c)}
|
||||||
function Wu(a,b){var c=new Te(a,"1.35.1",Xu);if(c.load()&&Yu(c)){var d=c.get(Zu),e=b?b.get(Zu):"unknown";d!=e&&(a.wa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Qu.prototype;
|
function Wu(a,b){var c=new Te(a,"1.35.1",Xu);if(c.load()&&Yu(c)){var d=c.get(Zu),e=b?b.get(Zu):"unknown";d!=e&&(a.wa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Qu.prototype;
|
||||||
k.af=function(a){void 0===a&&(a=this.A||(this.K?$u:Su));if(!this.C){this.C++;var b=!1,c=!1;this.W=!1;var d=this.L||new Te(this,"1.35.1");if(a==av)b=!0;else if(a>Su){if(d.load(this.K)){this.F=new Te(this,"1.35.1",bv);this.F.load()&&(a!=$u&&cv(this,d)&&(a=dv),ev(this.F));this.F.set(Zu,wa());fv(this.F);var e=this.A&&!this.H;if(a==$u||ab("Click OK to restore the previous PCx86 machine state, or CANCEL to reset the machine.")){if(c=Yu(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==
|
k.af=function(a){void 0===a&&(a=this.A||(this.K?$u:Su));if(!this.C){this.C++;var b=!1,c=!1;this.W=!1;var d=this.L||new Te(this,"1.35.1");if(a==av)b=!0;else if(a>Su){if(d.load(this.K)){this.F=new Te(this,"1.35.1",bv);this.F.load()&&(a!=$u&&cv(this,d)&&(a=dv),ev(this.F));this.F.set(Zu,wa());fv(this.F);var e=this.A&&!this.H;if(a==$u||ab("Click OK to restore the previous PCx86 machine state.")){if(c=Yu(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==f&&"no machine state"!=g?(this.wa("Error: "+
|
||||||
f&&"no machine state"!=g?(this.wa("Error: "+g),"unable to verify user"==g&&(Ja(gv,""),this.B=null)):this.Zb(f+": "+g),ev(d),d.load()?(c=Yu(d),e=!0):c=!1))}e&&Wu(this,c?d:null)}else a==dv&&d.clear()}else Wu(this);delete this.K;delete this.L}e=bb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.U&&(c=hv(this,g,d,b,c));b=[d,a,c];a!=av?Vu(this,this.mi,b):this.mi(b)}};
|
g),"unable to verify user"==g&&(Ja(gv,""),this.B=null)):this.Zb(f+": "+g),ev(d),d.load()?(c=Yu(d),e=!0):c=!1))}e&&Wu(this,c?d:null)}else a==dv&&d.clear()}else Wu(this);delete this.K;delete this.L}e=bb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.U&&(c=hv(this,g,d,b,c));b=[d,a,c];a!=av?Vu(this,this.mi,b):this.mi(b)}};
|
||||||
function hv(a,b,c,d,e){if(!b.aa.Pb){b.aa.Pb=!0;if(b.Ob){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/-[0-9]+\./i,"."))));"string"===typeof f&&(f=null);!b.Ob(f,d)&&f&&(b.wa("Unable to restore hardware state")&&(a.V&&!a.X?(c.clear(),a.A=Su,window&&window.location.reload()):a.W=!0),b.Ob(null),e=!1)}if(!d&&b.vi)for(a=b.vi.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
function hv(a,b,c,d,e){if(!b.aa.Pb){b.aa.Pb=!0;if(b.Ob){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/-[0-9]+\./i,"."))));"string"===typeof f&&(f=null);!b.Ob(f,d)&&f&&(b.wa("Unable to restore hardware state")&&(a.V&&!a.X?(c.clear(),a.A=Su,window&&window.location.reload()):a.W=!0),b.Ob(null),e=!1)}if(!d&&b.vi)for(a=b.vi.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||||
k.mi=function(a){var b=a[0],c=0>a[1];a=a[2];this.ea=!0;this.aa.Pb=!0;var d=this.ia.power;d&&(d.textContent="Shutdown");this.U&&(hv(this,this.U,b,c,a),this.U.Fe());this.W&&(cv(this,b),b.clear());!c&&this.F&&(this.F.clear(),delete this.F);this.C=0};
|
k.mi=function(a){var b=a[0],c=0>a[1];a=a[2];this.ea=!0;this.aa.Pb=!0;var d=this.ia.power;d&&(d.textContent="Shutdown");this.U&&(hv(this,this.U,b,c,a),this.U.Fe());this.W&&(cv(this,b),b.clear());!c&&this.F&&(this.F.clear(),delete this.F);this.C=0};
|
||||||
function cv(a,b){if(!a.aa.hf){if(ab("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.B||"";b=b.toString();var d={app:"PCx86",ver:"1.35.1"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}return!0}return!1}
|
function cv(a,b){if(!a.aa.hf){if(ab("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.B||"";b=b.toString();var d={app:"PCx86",ver:"1.35.1"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}return!0}return!1}
|
||||||
function iv(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new Te(a,"1.35.1"),g=new Te(a,"1.35.1",Xu),h=wa();g.set(Zu,h);f.set(Zu,h);f.set(jv,"1.35.1");f.set(kv,window?window.location.href:null);f.set(lv,window?window.navigator.userAgent:"");a.U&&a.U.Nb&&(c&&Tc(a.U),d=a.U.Nb(b,c),"object"===typeof d&&f.set(a.U.id,d),c&&(a.U.aa.Pb=!1,!1===d&&(e=null)));for(var h=bb(a.id),l=0;l<h.length;l++){var m=h[l];m.aa.Pb&&(m.Nb&&(d=m.Nb(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.aa.Pb=!1,!1===d&&(e=
|
function iv(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new Te(a,"1.35.1"),g=new Te(a,"1.35.1",Xu),h=wa();g.set(Zu,h);f.set(Zu,h);f.set(jv,"1.35.1");f.set(kv,window?window.location.href:null);f.set(lv,window?window.navigator.userAgent:"");a.U&&a.U.Nb&&(c&&Tc(a.U),d=a.U.Nb(b,c),"object"===typeof d&&f.set(a.U.id,d),c&&(a.U.aa.Pb=!1,!1===d&&(e=null)));for(var h=bb(a.id),l=0;l<h.length;l++){var m=h[l];m.aa.Pb&&(m.Nb&&(d=m.Nb(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.aa.Pb=!1,!1===d&&(e=
|
||||||
null)))}e&&(c?(h=d=!1,b?(a.B&&mv(a,a.B,f.toString()),fv(g)&&fv(f)||(e=null,d=h=!0)):a.A&&(d=!0,h=a.A==nv),d&&f.clear(h)):e=f.toString());c&&(a.aa.Pb=!1,b=a.ia.power)&&(b.textContent="Power");a.C=0;return e}k.reset=function(){this.ma&&this.ma.reset&&this.ma.reset();for(var a=bb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ma&&c.reset&&c.reset()}};k.start=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};
|
null)))}e&&(c?(h=d=!1,b?(a.B&&mv(a,a.B,f.toString()),fv(g)&&fv(f)||(e=null,d=h=!0)):a.A&&(d=!0,h=a.A==nv),d&&f.clear(h)):e=f.toString());c&&(a.aa.Pb=!1,b=a.ia.power)&&(b.textContent="Power");a.C=0;return e}k.reset=function(){this.ma&&this.ma.reset&&this.ma.reset();for(var a=bb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ma&&c.reset&&c.reset()}};k.start=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};
|
||||||
k.stop=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
k.stop=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||||
k.wb=function(a,b,c){var d=this;switch(b){case "power":return this.ia[b]=c,c.onclick=function(){d.C||(d.aa.Pb?iv(d,!1,!0):Vu(d,d.af))},!0;case "reset":return this.ia[b]=c,c.onclick=function(){if(d.aa.Pb&&!d.C)if(d.A&&!d.J){var a=d.aa.hf||ab("Click OK to save changes to this PCx86 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");iv(d,a,!0);!a&&d.V?window&&window.location.reload():(a||(d.O=!0),d.af(Su),d.O=!1)}else d.reset(),d.U&&d.U.Fe()},!0;case "save":if(ra(Fa(),"pcjs.org"))c.parentNode.removeChild(c);
|
k.wb=function(a,b,c){var d=this;switch(b){case "power":return this.ia[b]=c,c.onclick=function(){d.C||(d.aa.Pb?iv(d,!1,!0):Vu(d,d.af))},!0;case "reset":return this.ia[b]=c,c.onclick=function(){if(d.aa.Pb&&!d.C)if(d.A&&!d.J){var a=d.aa.hf||!ab("Click OK to reset this PCx86 machine and discard all disk modifications.");iv(d,a,!0);!a&&d.V?window&&window.location.reload():(a||(d.O=!0),d.af(Su),d.O=!1)}else d.reset(),d.U&&d.U.Fe()},!0;case "save":if(ra(Fa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.ia[b]=
|
||||||
else return this.ia[b]=c,c.onclick=function(){var a=Tu(d,!0);if(a){var b=!!(d.A&&!d.J||d.V),c=iv(d,b);b?mv(d,a,c):d.wa("Resume disabled, machine state not saved")}},!0}return!1};
|
c,c.onclick=function(){var a=Tu(d,!0);if(a){var b=!!(d.A&&!d.J||d.V),c=iv(d,b);b?mv(d,a,c):d.wa("Resume disabled, machine state not saved")}},!0}return!1};
|
||||||
function Tu(a,b){var c=a.B;c||((c=Ia(gv),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=ov(a,c))||a.wa("The user ID is invalid.")):b&&a.wa("Browser local storage is not available"));return c}
|
function Tu(a,b){var c=a.B;c||((c=Ia(gv),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=ov(a,c))||a.wa("The user ID is invalid.")):b&&a.wa("Browser local storage is not available"));return c}
|
||||||
function ov(a,b){a.B=null;b=Ea(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ja(gv,b.data),a.B=b.data)}catch(d){r(d.message+" ("+c+")")}return a.B}function Uu(a){var b=null;a.B&&(b=Fa()+"/api/v1/user?req=load&user="+a.B+"&state="+pv(a,"1.35.1"));return b}
|
function ov(a,b){a.B=null;b=Ea(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ja(gv,b.data),a.B=b.data)}catch(d){r(d.message+" ("+c+")")}return a.B}function Uu(a){var b=null;a.B&&(b=Fa()+"/api/v1/user?req=load&user="+a.B+"&state="+pv(a,"1.35.1"));return b}
|
||||||
function mv(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=pv(a,"1.35.1");d.data=c;b=Ea(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.wa("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.wa(c),Ja(gv,""),a.B=null)}}
|
function mv(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=pv(a,"1.35.1");d.data=c;b=Ea(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.wa("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.wa(c),Ja(gv,""),a.B=null)}}
|
||||||
|
|
|
||||||
|
|
@ -538,7 +538,7 @@ class Computer extends Component {
|
||||||
this.stateFailSafe.store();
|
this.stateFailSafe.store();
|
||||||
|
|
||||||
var fValidate = this.resume && !this.fServerState;
|
var fValidate = this.resume && !this.fServerState;
|
||||||
if (resume == Computer.RESUME_AUTO || Component.confirmUser("Click OK to restore the previous " + PCX86.APPNAME + " machine state, or CANCEL to reset the machine.")) {
|
if (resume == Computer.RESUME_AUTO || Component.confirmUser("Click OK to restore the previous " + PCX86.APPNAME + " machine state.")) {
|
||||||
fRestore = stateComputer.parse();
|
fRestore = stateComputer.parse();
|
||||||
if (fRestore) {
|
if (fRestore) {
|
||||||
var sCode = stateComputer.get(UserAPI.RES.CODE);
|
var sCode = stateComputer.get(UserAPI.RES.CODE);
|
||||||
|
|
@ -810,6 +810,18 @@ class Computer extends Component {
|
||||||
/**
|
/**
|
||||||
* powerReport(stateComputer)
|
* powerReport(stateComputer)
|
||||||
*
|
*
|
||||||
|
* TODO: Ever since I migrated the PCjs website from a Node-based web server on AWS to a GitHub Pages-based site,
|
||||||
|
* the sendReport() API has been a bit-bucket. To be honest though, even before that change, I never really had
|
||||||
|
* the time (or desire) to look through all the anonymous machine states that were being posted. Most of them were
|
||||||
|
* probably due to the user switching away from a page before it finished loading anyway, leaving the machine in
|
||||||
|
* an incomplete state. That said, there should be SOME automated way for people to share their machine states
|
||||||
|
* when there's a more serious problem -- not this misleading prompt.
|
||||||
|
*
|
||||||
|
* In the meantime, to help reduce those kind of useless alerts, there's the new 'unloading' flag. However, I'm
|
||||||
|
* not sure how reliably that's being set, so additionally, the default 'resume' setting (RESUME_AUTO) tries to be
|
||||||
|
* MUCH more automatic now; this function, for example, shouldn't even be called now when RESUME_AUTO is in effect.
|
||||||
|
* Another 'resume' setting (eg, RESUME_PROMPT) must be selected instead.
|
||||||
|
*
|
||||||
* @this {Computer}
|
* @this {Computer}
|
||||||
* @param {State} stateComputer
|
* @param {State} stateComputer
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
|
|
@ -1364,7 +1376,7 @@ class Computer extends Component {
|
||||||
* I used to bypass the prompt if this.resume == Computer.RESUME_AUTO, setting fSave to true automatically,
|
* I used to bypass the prompt if this.resume == Computer.RESUME_AUTO, setting fSave to true automatically,
|
||||||
* but that gives the user no means of resetting a resumable machine that contains errors in its resume state.
|
* but that gives the user no means of resetting a resumable machine that contains errors in its resume state.
|
||||||
*/
|
*/
|
||||||
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ this.flags.unloading || Component.confirmUser("Click OK to save changes to this " + PCX86.APPNAME + " machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
|
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ this.flags.unloading || !Component.confirmUser("Click OK to reset this " + PCX86.APPNAME + " machine and discard all disk modifications."));
|
||||||
this.powerOff(fSave, true);
|
this.powerOff(fSave, true);
|
||||||
/*
|
/*
|
||||||
* Forcing the page to reload is an expedient option, but ugly. It's preferable to call powerOn()
|
* Forcing the page to reload is an expedient option, but ugly. It's preferable to call powerOn()
|
||||||
|
|
|
||||||
|
|
@ -864,16 +864,16 @@ yb("Panel",this.id))&&this.D.Je)for(b=0;b<e.length;b++)d=e[b],d.Da=this.D.Da,d.P
|
||||||
(this.M=new Zf(this,"1.35.1"),this.M.load()?b=null:delete this.M));!b&&this.A&&(b=PB(this))&&(this.I=!0);if(b){var f=this;Na(b,null,!0,function(a,b,c){c?(f.K=null,f.I=!1,f.Da("Unable to load machine state from server (error "+c+(b?": "+Ba(b):"")+")")):(f.L=b,f.Z=!0);Lb(f)})}else Lb(this);this.na.power||(this.N=!0);!c&&this.N&&QB(this,this.Mf)}else kb("Unable to find CPU component")}ba(LB,pb);
|
(this.M=new Zf(this,"1.35.1"),this.M.load()?b=null:delete this.M));!b&&this.A&&(b=PB(this))&&(this.I=!0);if(b){var f=this;Na(b,null,!0,function(a,b,c){c?(f.K=null,f.I=!1,f.Da("Unable to load machine state from server (error "+c+(b?": "+Ba(b):"")+")")):(f.L=b,f.Z=!0);Lb(f)})}else Lb(this);this.na.power||(this.N=!0);!c&&this.N&&QB(this,this.Mf)}else kb("Unable to find CPU component")}ba(LB,pb);
|
||||||
function MB(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){kb(d.message+" ("+c+")")}}a.J=b}function Bd(a,b,c){var d=Xa(b);void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function QB(a,b,c){for(var d=vb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Kb(f)){Kb(f,function(){QB(a,b,c)});return}}b.call(a,c)}
|
function MB(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){kb(d.message+" ("+c+")")}}a.J=b}function Bd(a,b,c){var d=Xa(b);void 0===d&&a.J&&(d=a.J[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function QB(a,b,c){for(var d=vb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!Kb(f)){Kb(f,function(){QB(a,b,c)});return}}b.call(a,c)}
|
||||||
function RB(a,b){var c=new Zf(a,"1.35.1",SB);if(c.load()&&TB(c)){var d=c.get(UB),e=b?b.get(UB):"unknown";d!=e&&(a.Da("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}l=LB.prototype;
|
function RB(a,b){var c=new Zf(a,"1.35.1",SB);if(c.load()&&TB(c)){var d=c.get(UB),e=b?b.get(UB):"unknown";d!=e&&(a.Da("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}l=LB.prototype;
|
||||||
l.Mf=function(a){void 0===a&&(a=this.A||(this.L?VB:NB));if(!this.C){this.C++;var b=!1,c=!1;this.Y=!1;var d=this.M||new Zf(this,"1.35.1");if(a==WB)b=!0;else if(a>NB){if(d.load(this.L)){this.F=new Zf(this,"1.35.1",XB);this.F.load()&&(a!=VB&&YB(this,d)&&(a=ZB),$B(this.F));this.F.set(UB,Ea());aC(this.F);var e=this.A&&!this.I;if(a==VB||ub("Click OK to restore the previous PCx86 machine state, or CANCEL to reset the machine.")){if(c=TB(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==
|
l.Mf=function(a){void 0===a&&(a=this.A||(this.L?VB:NB));if(!this.C){this.C++;var b=!1,c=!1;this.Y=!1;var d=this.M||new Zf(this,"1.35.1");if(a==WB)b=!0;else if(a>NB){if(d.load(this.L)){this.F=new Zf(this,"1.35.1",XB);this.F.load()&&(a!=VB&&YB(this,d)&&(a=ZB),$B(this.F));this.F.set(UB,Ea());aC(this.F);var e=this.A&&!this.I;if(a==VB||ub("Click OK to restore the previous PCx86 machine state.")){if(c=TB(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==f&&"no machine state"!=g?(this.Da("Error: "+
|
||||||
f&&"no machine state"!=g?(this.Da("Error: "+g),"unable to verify user"==g&&(Va(bC,""),this.B=null)):this.P(f+": "+g),$B(d),d.load()?(c=TB(d),e=!0):c=!1))}e&&RB(this,c?d:null)}else a==ZB&&d.clear()}else RB(this);delete this.L;delete this.M}e=vb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.H&&(c=cC(this,g,d,b,c));b=[d,a,c];a!=WB?QB(this,this.oj,b):this.oj(b)}};
|
g),"unable to verify user"==g&&(Va(bC,""),this.B=null)):this.P(f+": "+g),$B(d),d.load()?(c=TB(d),e=!0):c=!1))}e&&RB(this,c?d:null)}else a==ZB&&d.clear()}else RB(this);delete this.L;delete this.M}e=vb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.H&&(c=cC(this,g,d,b,c));b=[d,a,c];a!=WB?QB(this,this.oj,b):this.oj(b)}};
|
||||||
function cC(a,b,c,d,e){if(!b.da.Yb){b.da.Yb=!0;if(b.Xb){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/-[0-9]+\./i,"."))));"string"===typeof f&&(f=null);!b.Xb(f,d)&&f&&(b.Da("Unable to restore hardware state")&&(a.W&&!a.Z?(c.clear(),a.A=NB,window&&window.location.reload()):a.Y=!0),b.Xb(null),e=!1)}if(!d&&b.zj)for(a=b.zj.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
function cC(a,b,c,d,e){if(!b.da.Yb){b.da.Yb=!0;if(b.Xb){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/-[0-9]+\./i,"."))));"string"===typeof f&&(f=null);!b.Xb(f,d)&&f&&(b.Da("Unable to restore hardware state")&&(a.W&&!a.Z?(c.clear(),a.A=NB,window&&window.location.reload()):a.Y=!0),b.Xb(null),e=!1)}if(!d&&b.zj)for(a=b.zj.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||||
l.oj=function(a){var b=a[0],c=0>a[1];a=a[2];this.ga=!0;this.da.Yb=!0;var d=this.na.power;d&&(d.textContent="Shutdown");this.H&&(cC(this,this.H,b,c,a),this.H.mf());this.Y&&(YB(this,b),b.clear());!c&&this.F&&(this.F.clear(),delete this.F);this.C=0};
|
l.oj=function(a){var b=a[0],c=0>a[1];a=a[2];this.ga=!0;this.da.Yb=!0;var d=this.na.power;d&&(d.textContent="Shutdown");this.H&&(cC(this,this.H,b,c,a),this.H.mf());this.Y&&(YB(this,b),b.clear());!c&&this.F&&(this.F.clear(),delete this.F);this.C=0};
|
||||||
function YB(a,b){if(!a.da.Tf){if(ub("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.B||"";b=b.toString();var d={app:"PCx86",ver:"1.35.1"};d.url=a.ea;d.user=c;d.type="bug";d.data=b;Na("http://www.pcjs.org/api/v1/report",d,!0)}return!0}return!1}
|
function YB(a,b){if(!a.da.Tf){if(ub("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.B||"";b=b.toString();var d={app:"PCx86",ver:"1.35.1"};d.url=a.ea;d.user=c;d.type="bug";d.data=b;Na("http://www.pcjs.org/api/v1/report",d,!0)}return!0}return!1}
|
||||||
function sB(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new Zf(a,"1.35.1"),g=new Zf(a,"1.35.1",SB),h=Ea();g.set(UB,h);f.set(UB,h);f.set(dC,"1.35.1");f.set(eC,window?window.location.href:null);f.set(fC,Pa());a.H&&a.H.Wb&&(c&&a.H.Jb(),d=a.H.Wb(b,c),"object"===typeof d&&f.set(a.H.id,d),c&&(a.H.da.Yb=!1,!1===d&&(e=null)));for(var h=vb(a.id),k=0;k<h.length;k++){var m=h[k];m.da.Yb&&(m.Wb&&(d=m.Wb(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.da.Yb=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.B&&gC(a,
|
function sB(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new Zf(a,"1.35.1"),g=new Zf(a,"1.35.1",SB),h=Ea();g.set(UB,h);f.set(UB,h);f.set(dC,"1.35.1");f.set(eC,window?window.location.href:null);f.set(fC,Pa());a.H&&a.H.Wb&&(c&&a.H.Jb(),d=a.H.Wb(b,c),"object"===typeof d&&f.set(a.H.id,d),c&&(a.H.da.Yb=!1,!1===d&&(e=null)));for(var h=vb(a.id),k=0;k<h.length;k++){var m=h[k];m.da.Yb&&(m.Wb&&(d=m.Wb(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.da.Yb=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.B&&gC(a,
|
||||||
a.B,f.toString()),aC(g)&&aC(f)||(e=null,d=h=!0)):a.A&&(d=!0,h=a.A==hC),d&&f.clear(h)):e=f.toString());c&&(a.da.Yb=!1,b=a.na.power)&&(b.textContent="Power");a.C=0;return e}l.reset=function(){this.ka&&this.ka.reset&&(Ob(this,"Resetting "+this.ka.type),this.ka.reset());for(var a=vb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ka&&c.reset&&(Ob(this,"Resetting "+c.type),c.reset())}};
|
a.B,f.toString()),aC(g)&&aC(f)||(e=null,d=h=!0)):a.A&&(d=!0,h=a.A==hC),d&&f.clear(h)):e=f.toString());c&&(a.da.Yb=!1,b=a.na.power)&&(b.textContent="Power");a.C=0;return e}l.reset=function(){this.ka&&this.ka.reset&&(Ob(this,"Resetting "+this.ka.type),this.ka.reset());for(var a=vb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ka&&c.reset&&(Ob(this,"Resetting "+c.type),c.reset())}};
|
||||||
l.start=function(a,b){for(var c=vb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};l.stop=function(a,b){for(var c=vb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
l.start=function(a,b){for(var c=vb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};l.stop=function(a,b){for(var c=vb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||||
l.Cb=function(a,b,c){var d=this;switch(b){case "power":return this.na[b]=c,c.onclick=function(){d.C||(d.da.Yb?sB(d,!1,!0):QB(d,d.Mf))},!0;case "reset":return this.na[b]=c,c.onclick=function(){if(d.da.Yb&&!d.C)if(d.A&&!d.K){var a=d.da.Tf||ub("Click OK to save changes to this PCx86 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");sB(d,a,!0);!a&&d.W?window&&window.location.reload():(a||(d.O=!0),d.Mf(NB),d.O=!1)}else d.reset(),d.H&&d.H.mf()},!0;case "save":if(wa(Oa(),"pcjs.org"))c.parentNode.removeChild(c);
|
l.Cb=function(a,b,c){var d=this;switch(b){case "power":return this.na[b]=c,c.onclick=function(){d.C||(d.da.Yb?sB(d,!1,!0):QB(d,d.Mf))},!0;case "reset":return this.na[b]=c,c.onclick=function(){if(d.da.Yb&&!d.C)if(d.A&&!d.K){var a=d.da.Tf||!ub("Click OK to reset this PCx86 machine and discard all disk modifications.");sB(d,a,!0);!a&&d.W?window&&window.location.reload():(a||(d.O=!0),d.Mf(NB),d.O=!1)}else d.reset(),d.H&&d.H.mf()},!0;case "save":if(wa(Oa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.na[b]=
|
||||||
else return this.na[b]=c,c.onclick=function(){var a=OB(d,!0);if(a){var b=!!(d.A&&!d.K||d.W),c=sB(d,b);b?gC(d,a,c):d.Da("Resume disabled, machine state not saved")}},!0}return!1};
|
c,c.onclick=function(){var a=OB(d,!0);if(a){var b=!!(d.A&&!d.K||d.W),c=sB(d,b);b?gC(d,a,c):d.Da("Resume disabled, machine state not saved")}},!0}return!1};
|
||||||
function OB(a,b){var c=a.B;c||((c=Ua(bC),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=tC(a,c))||a.Da("The user ID is invalid.")):b&&a.Da("Browser local storage is not available"));return c}
|
function OB(a,b){var c=a.B;c||((c=Ua(bC),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=tC(a,c))||a.Da("The user ID is invalid.")):b&&a.Da("Browser local storage is not available"));return c}
|
||||||
function tC(a,b){a.B=null;b=Na(Oa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Va(bC,b.data),a.B=b.data)}catch(d){kb(d.message+" ("+c+")")}return a.B}function PB(a){var b=null;a.B&&(b=Oa()+"/api/v1/user?req=load&user="+a.B+"&state="+uC(a,"1.35.1"));return b}
|
function tC(a,b){a.B=null;b=Na(Oa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Va(bC,b.data),a.B=b.data)}catch(d){kb(d.message+" ("+c+")")}return a.B}function PB(a){var b=null;a.B&&(b=Oa()+"/api/v1/user?req=load&user="+a.B+"&state="+uC(a,"1.35.1"));return b}
|
||||||
function gC(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=uC(a,"1.35.1");d.data=c;b=Na(Oa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Da("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.Da(c),Va(bC,""),a.B=null)}}
|
function gC(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=uC(a,"1.35.1");d.data=c;b=Na(Oa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.Da("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.Da(c),Va(bC,""),a.B=null)}}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -74388,7 +74388,7 @@ class Computer extends Component {
|
||||||
this.stateFailSafe.store();
|
this.stateFailSafe.store();
|
||||||
|
|
||||||
var fValidate = this.resume && !this.fServerState;
|
var fValidate = this.resume && !this.fServerState;
|
||||||
if (resume == Computer.RESUME_AUTO || Component.confirmUser("Click OK to restore the previous " + PCX86.APPNAME + " machine state, or CANCEL to reset the machine.")) {
|
if (resume == Computer.RESUME_AUTO || Component.confirmUser("Click OK to restore the previous " + PCX86.APPNAME + " machine state.")) {
|
||||||
fRestore = stateComputer.parse();
|
fRestore = stateComputer.parse();
|
||||||
if (fRestore) {
|
if (fRestore) {
|
||||||
var sCode = stateComputer.get(UserAPI.RES.CODE);
|
var sCode = stateComputer.get(UserAPI.RES.CODE);
|
||||||
|
|
@ -74660,6 +74660,18 @@ class Computer extends Component {
|
||||||
/**
|
/**
|
||||||
* powerReport(stateComputer)
|
* powerReport(stateComputer)
|
||||||
*
|
*
|
||||||
|
* TODO: Ever since I migrated the PCjs website from a Node-based web server on AWS to a GitHub Pages-based site,
|
||||||
|
* the sendReport() API has been a bit-bucket. To be honest though, even before that change, I never really had
|
||||||
|
* the time (or desire) to look through all the anonymous machine states that were being posted. Most of them were
|
||||||
|
* probably due to the user switching away from a page before it finished loading anyway, leaving the machine in
|
||||||
|
* an incomplete state. That said, there should be SOME automated way for people to share their machine states
|
||||||
|
* when there's a more serious problem -- not this misleading prompt.
|
||||||
|
*
|
||||||
|
* In the meantime, to help reduce those kind of useless alerts, there's the new 'unloading' flag. However, I'm
|
||||||
|
* not sure how reliably that's being set, so additionally, the default 'resume' setting (RESUME_AUTO) tries to be
|
||||||
|
* MUCH more automatic now; this function, for example, shouldn't even be called now when RESUME_AUTO is in effect.
|
||||||
|
* Another 'resume' setting (eg, RESUME_PROMPT) must be selected instead.
|
||||||
|
*
|
||||||
* @this {Computer}
|
* @this {Computer}
|
||||||
* @param {State} stateComputer
|
* @param {State} stateComputer
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
|
|
@ -75214,7 +75226,7 @@ class Computer extends Component {
|
||||||
* I used to bypass the prompt if this.resume == Computer.RESUME_AUTO, setting fSave to true automatically,
|
* I used to bypass the prompt if this.resume == Computer.RESUME_AUTO, setting fSave to true automatically,
|
||||||
* but that gives the user no means of resetting a resumable machine that contains errors in its resume state.
|
* but that gives the user no means of resetting a resumable machine that contains errors in its resume state.
|
||||||
*/
|
*/
|
||||||
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ this.flags.unloading || Component.confirmUser("Click OK to save changes to this " + PCX86.APPNAME + " machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded."));
|
var fSave = (/* this.resume == Computer.RESUME_AUTO || */ this.flags.unloading || !Component.confirmUser("Click OK to reset this " + PCX86.APPNAME + " machine and discard all disk modifications."));
|
||||||
this.powerOff(fSave, true);
|
this.powerOff(fSave, true);
|
||||||
/*
|
/*
|
||||||
* Forcing the page to reload is an expedient option, but ugly. It's preferable to call powerOn()
|
* Forcing the page to reload is an expedient option, but ugly. It's preferable to call powerOn()
|
||||||
|
|
|
||||||
|
|
@ -666,16 +666,16 @@ this.id))&&this.D.Ef)for(b=0;b<e.length;b++)d=e[b],d.wa=this.D.wa,d.Zb=this.D.Zb
|
||||||
new Te(this,"1.35.1"),this.L.load()?b=null:delete this.L));!b&&this.A&&(b=Uu(this))&&(this.H=!0);if(b){var f=this;Ea(b,null,!0,function(a,b,c){c?(f.J=null,f.H=!1,f.wa("Unable to load machine state from server (error "+c+(b?": "+ua(b):"")+")")):(f.K=b,f.X=!0);pb(f)})}else pb(this);this.ia.power||(this.M=!0);!c&&this.M&&Vu(this,this.af)}else r("Unable to find CPU component")}ba(Qu,t);
|
new Te(this,"1.35.1"),this.L.load()?b=null:delete this.L));!b&&this.A&&(b=Uu(this))&&(this.H=!0);if(b){var f=this;Ea(b,null,!0,function(a,b,c){c?(f.J=null,f.H=!1,f.wa("Unable to load machine state from server (error "+c+(b?": "+ua(b):"")+")")):(f.K=b,f.X=!0);pb(f)})}else pb(this);this.ia.power||(this.M=!0);!c&&this.M&&Vu(this,this.af)}else r("Unable to find CPU component")}ba(Qu,t);
|
||||||
function Ru(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){r(d.message+" ("+c+")")}}a.I=b}function Pc(a,b,c){var d=La(b);void 0===d&&a.I&&(d=a.I[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Vu(a,b,c){for(var d=bb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ob(f)){ob(f,function(){Vu(a,b,c)});return}}b.call(a,c)}
|
function Ru(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms))try{b=eval("("+c+")")}catch(d){r(d.message+" ("+c+")")}}a.I=b}function Pc(a,b,c){var d=La(b);void 0===d&&a.I&&(d=a.I[b]);void 0===d&&c&&(d=c[b]);void 0===d&&"object"==typeof resources&&resources[b]&&(d=b);return d}function Vu(a,b,c){for(var d=bb(a.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:a;if(!ob(f)){ob(f,function(){Vu(a,b,c)});return}}b.call(a,c)}
|
||||||
function Wu(a,b){var c=new Te(a,"1.35.1",Xu);if(c.load()&&Yu(c)){var d=c.get(Zu),e=b?b.get(Zu):"unknown";d!=e&&(a.wa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Qu.prototype;
|
function Wu(a,b){var c=new Te(a,"1.35.1",Xu);if(c.load()&&Yu(c)){var d=c.get(Zu),e=b?b.get(Zu):"unknown";d!=e&&(a.wa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=Qu.prototype;
|
||||||
k.af=function(a){void 0===a&&(a=this.A||(this.K?$u:Su));if(!this.C){this.C++;var b=!1,c=!1;this.W=!1;var d=this.L||new Te(this,"1.35.1");if(a==av)b=!0;else if(a>Su){if(d.load(this.K)){this.F=new Te(this,"1.35.1",bv);this.F.load()&&(a!=$u&&cv(this,d)&&(a=dv),ev(this.F));this.F.set(Zu,wa());fv(this.F);var e=this.A&&!this.H;if(a==$u||ab("Click OK to restore the previous PCx86 machine state, or CANCEL to reset the machine.")){if(c=Yu(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==
|
k.af=function(a){void 0===a&&(a=this.A||(this.K?$u:Su));if(!this.C){this.C++;var b=!1,c=!1;this.W=!1;var d=this.L||new Te(this,"1.35.1");if(a==av)b=!0;else if(a>Su){if(d.load(this.K)){this.F=new Te(this,"1.35.1",bv);this.F.load()&&(a!=$u&&cv(this,d)&&(a=dv),ev(this.F));this.F.set(Zu,wa());fv(this.F);var e=this.A&&!this.H;if(a==$u||ab("Click OK to restore the previous PCx86 machine state.")){if(c=Yu(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?d.load(g):("error"==f&&"no machine state"!=g?(this.wa("Error: "+
|
||||||
f&&"no machine state"!=g?(this.wa("Error: "+g),"unable to verify user"==g&&(Ja(gv,""),this.B=null)):this.Zb(f+": "+g),ev(d),d.load()?(c=Yu(d),e=!0):c=!1))}e&&Wu(this,c?d:null)}else a==dv&&d.clear()}else Wu(this);delete this.K;delete this.L}e=bb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.U&&(c=hv(this,g,d,b,c));b=[d,a,c];a!=av?Vu(this,this.mi,b):this.mi(b)}};
|
g),"unable to verify user"==g&&(Ja(gv,""),this.B=null)):this.Zb(f+": "+g),ev(d),d.load()?(c=Yu(d),e=!0):c=!1))}e&&Wu(this,c?d:null)}else a==dv&&d.clear()}else Wu(this);delete this.K;delete this.L}e=bb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.U&&(c=hv(this,g,d,b,c));b=[d,a,c];a!=av?Vu(this,this.mi,b):this.mi(b)}};
|
||||||
function hv(a,b,c,d,e){if(!b.aa.Pb){b.aa.Pb=!0;if(b.Ob){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/-[0-9]+\./i,"."))));"string"===typeof f&&(f=null);!b.Ob(f,d)&&f&&(b.wa("Unable to restore hardware state")&&(a.V&&!a.X?(c.clear(),a.A=Su,window&&window.location.reload()):a.W=!0),b.Ob(null),e=!1)}if(!d&&b.vi)for(a=b.vi.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
function hv(a,b,c,d,e){if(!b.aa.Pb){b.aa.Pb=!0;if(b.Ob){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/-[0-9]+\./i,"."))));"string"===typeof f&&(f=null);!b.Ob(f,d)&&f&&(b.wa("Unable to restore hardware state")&&(a.V&&!a.X?(c.clear(),a.A=Su,window&&window.location.reload()):a.W=!0),b.Ob(null),e=!1)}if(!d&&b.vi)for(a=b.vi.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
|
||||||
k.mi=function(a){var b=a[0],c=0>a[1];a=a[2];this.ea=!0;this.aa.Pb=!0;var d=this.ia.power;d&&(d.textContent="Shutdown");this.U&&(hv(this,this.U,b,c,a),this.U.Fe());this.W&&(cv(this,b),b.clear());!c&&this.F&&(this.F.clear(),delete this.F);this.C=0};
|
k.mi=function(a){var b=a[0],c=0>a[1];a=a[2];this.ea=!0;this.aa.Pb=!0;var d=this.ia.power;d&&(d.textContent="Shutdown");this.U&&(hv(this,this.U,b,c,a),this.U.Fe());this.W&&(cv(this,b),b.clear());!c&&this.F&&(this.F.clear(),delete this.F);this.C=0};
|
||||||
function cv(a,b){if(!a.aa.hf){if(ab("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.B||"";b=b.toString();var d={app:"PCx86",ver:"1.35.1"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}return!0}return!1}
|
function cv(a,b){if(!a.aa.hf){if(ab("There may be a problem with your PCx86 machine.\n\nTo help us diagnose it, click OK to send this PCx86 machine state to http://www.pcjs.org.")){var c=a.B||"";b=b.toString();var d={app:"PCx86",ver:"1.35.1"};d.url=a.ca;d.user=c;d.type="bug";d.data=b;Ea("http://www.pcjs.org/api/v1/report",d,!0)}return!0}return!1}
|
||||||
function iv(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new Te(a,"1.35.1"),g=new Te(a,"1.35.1",Xu),h=wa();g.set(Zu,h);f.set(Zu,h);f.set(jv,"1.35.1");f.set(kv,window?window.location.href:null);f.set(lv,window?window.navigator.userAgent:"");a.U&&a.U.Nb&&(c&&Tc(a.U),d=a.U.Nb(b,c),"object"===typeof d&&f.set(a.U.id,d),c&&(a.U.aa.Pb=!1,!1===d&&(e=null)));for(var h=bb(a.id),l=0;l<h.length;l++){var m=h[l];m.aa.Pb&&(m.Nb&&(d=m.Nb(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.aa.Pb=!1,!1===d&&(e=
|
function iv(a,b,c){var d,e="none";if(a.C)return null;a.C--;var f=new Te(a,"1.35.1"),g=new Te(a,"1.35.1",Xu),h=wa();g.set(Zu,h);f.set(Zu,h);f.set(jv,"1.35.1");f.set(kv,window?window.location.href:null);f.set(lv,window?window.navigator.userAgent:"");a.U&&a.U.Nb&&(c&&Tc(a.U),d=a.U.Nb(b,c),"object"===typeof d&&f.set(a.U.id,d),c&&(a.U.aa.Pb=!1,!1===d&&(e=null)));for(var h=bb(a.id),l=0;l<h.length;l++){var m=h[l];m.aa.Pb&&(m.Nb&&(d=m.Nb(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.aa.Pb=!1,!1===d&&(e=
|
||||||
null)))}e&&(c?(h=d=!1,b?(a.B&&mv(a,a.B,f.toString()),fv(g)&&fv(f)||(e=null,d=h=!0)):a.A&&(d=!0,h=a.A==nv),d&&f.clear(h)):e=f.toString());c&&(a.aa.Pb=!1,b=a.ia.power)&&(b.textContent="Power");a.C=0;return e}k.reset=function(){this.ma&&this.ma.reset&&this.ma.reset();for(var a=bb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ma&&c.reset&&c.reset()}};k.start=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};
|
null)))}e&&(c?(h=d=!1,b?(a.B&&mv(a,a.B,f.toString()),fv(g)&&fv(f)||(e=null,d=h=!0)):a.A&&(d=!0,h=a.A==nv),d&&f.clear(h)):e=f.toString());c&&(a.aa.Pb=!1,b=a.ia.power)&&(b.textContent="Power");a.C=0;return e}k.reset=function(){this.ma&&this.ma.reset&&this.ma.reset();for(var a=bb(this.id),b=0;b<a.length;b++){var c=a[b];c!==this&&c!==this.ma&&c.reset&&c.reset()}};k.start=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.start&&e.start(a,b)}};
|
||||||
k.stop=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
k.stop=function(a,b){for(var c=bb(this.id),d=0;d<c.length;d++){var e=c[d];"CPU"!=e.type&&e!==this&&e.stop&&e.stop(a,b)}};
|
||||||
k.wb=function(a,b,c){var d=this;switch(b){case "power":return this.ia[b]=c,c.onclick=function(){d.C||(d.aa.Pb?iv(d,!1,!0):Vu(d,d.af))},!0;case "reset":return this.ia[b]=c,c.onclick=function(){if(d.aa.Pb&&!d.C)if(d.A&&!d.J){var a=d.aa.hf||ab("Click OK to save changes to this PCx86 machine.\n\nWARNING: If you CANCEL, all disk changes will be discarded.");iv(d,a,!0);!a&&d.V?window&&window.location.reload():(a||(d.O=!0),d.af(Su),d.O=!1)}else d.reset(),d.U&&d.U.Fe()},!0;case "save":if(ra(Fa(),"pcjs.org"))c.parentNode.removeChild(c);
|
k.wb=function(a,b,c){var d=this;switch(b){case "power":return this.ia[b]=c,c.onclick=function(){d.C||(d.aa.Pb?iv(d,!1,!0):Vu(d,d.af))},!0;case "reset":return this.ia[b]=c,c.onclick=function(){if(d.aa.Pb&&!d.C)if(d.A&&!d.J){var a=d.aa.hf||!ab("Click OK to reset this PCx86 machine and discard all disk modifications.");iv(d,a,!0);!a&&d.V?window&&window.location.reload():(a||(d.O=!0),d.af(Su),d.O=!1)}else d.reset(),d.U&&d.U.Fe()},!0;case "save":if(ra(Fa(),"pcjs.org"))c.parentNode.removeChild(c);else return this.ia[b]=
|
||||||
else return this.ia[b]=c,c.onclick=function(){var a=Tu(d,!0);if(a){var b=!!(d.A&&!d.J||d.V),c=iv(d,b);b?mv(d,a,c):d.wa("Resume disabled, machine state not saved")}},!0}return!1};
|
c,c.onclick=function(){var a=Tu(d,!0);if(a){var b=!!(d.A&&!d.J||d.V),c=iv(d,b);b?mv(d,a,c):d.wa("Resume disabled, machine state not saved")}},!0}return!1};
|
||||||
function Tu(a,b){var c=a.B;c||((c=Ia(gv),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=ov(a,c))||a.wa("The user ID is invalid.")):b&&a.wa("Browser local storage is not available"));return c}
|
function Tu(a,b){var c=a.B;c||((c=Ia(gv),void 0!==c)?!c&&b&&(b=null,window&&(b=window.prompt("Saving machine states on the pcjs.org server is currently unsupported.\n\nIf you're running your own server, enter your user ID below.","")),c=b)&&((c=ov(a,c))||a.wa("The user ID is invalid.")):b&&a.wa("Browser local storage is not available"));return c}
|
||||||
function ov(a,b){a.B=null;b=Ea(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ja(gv,b.data),a.B=b.data)}catch(d){r(d.message+" ("+c+")")}return a.B}function Uu(a){var b=null;a.B&&(b=Fa()+"/api/v1/user?req=load&user="+a.B+"&state="+pv(a,"1.35.1"));return b}
|
function ov(a,b){a.B=null;b=Ea(Fa()+"/api/v1/user?req=verify&user="+b);var c=b[1];if(!b[0]&&c)try{b=eval("("+c+")"),b.code&&"ok"==b.code&&(Ja(gv,b.data),a.B=b.data)}catch(d){r(d.message+" ("+c+")")}return a.B}function Uu(a){var b=null;a.B&&(b=Fa()+"/api/v1/user?req=load&user="+a.B+"&state="+pv(a,"1.35.1"));return b}
|
||||||
function mv(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=pv(a,"1.35.1");d.data=c;b=Ea(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.wa("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.wa(c),Ja(gv,""),a.B=null)}}
|
function mv(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=pv(a,"1.35.1");d.data=c;b=Ea(Fa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.wa("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.wa(c),Ja(gv,""),a.B=null)}}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue