Assorted application updates

This commit is contained in:
Jeff Parsons 2017-06-25 09:16:08 -07:00 committed by Jeff Parsons
commit 49f25f682d
38 changed files with 223 additions and 139 deletions

View file

@ -50,7 +50,7 @@ function La(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return
function Pa(a){if(!Qa){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Qa=c}return Qa[a]||Qa[a.toLowerCase()]}function Ra(a,b,c){function d(){--a;0<=a&&(b()||(a=0));0<a?setTimeout(d,0):c()}d()}
function Sa(a,b){function c(){b(100===d)&&(e=setTimeout(c,d),d=100)}var d=0,e=null,f=!1;a.onmousedown=function(){f||e||(d=500,c())};a.ontouchstart=function(){e||(d=500,c())};a.onmouseup=a.onmouseout=function(){e&&(clearTimeout(e),e=null)};a.ontouchend=a.ontouchcancel=function(){e&&(clearTimeout(e),e=null);f=!0}}function Ta(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ua(a){Va.init.push(a)}
function Wa(a){if(Xa)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){Ya("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.",void 0,void 0)}}function Za(a){!Xa&&a?(Xa=!0,$a&&db("init"),eb&&db("show")):Xa=a}function db(a){Va[a]&&Wa(Va[a])}var Qa=null,Va={init:[],show:[],exit:[]},$a=!1,eb=!1,Xa=!0,Ja=null;Ta("onload",function(){$a=!0;Wa(Va.init)});Ta("onpageshow",function(){eb=!0;Wa(Va.show)});
Ta(Oa("Opera")||Oa("iOS")?"onunload":"onbeforeunload",function(){Wa(Va.exit)});function t(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.wc=b.comment;this.Bd=b;this.exports={};this.P=this.bindings={};a=this.id.indexOf(".");0>a?this.cb=this.id:(this.eb=this.id.substr(0,a),this.cb=this.id.substr(a+1));this.F={ready:!1,mb:!1,Ib:!1,ja:!1,Rb:!1,error:!1};this.zb=null;this.F.error=!1;this.ha=c||0;this.K=this.w=this.I=this.R=this.ua=null;fb.push(this)}
Ta(Oa("iOS")?"onpagehide":Oa("Opera")?"onunload":"onbeforeunload",function(){Wa(Va.exit)});function t(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.wc=b.comment;this.Bd=b;this.exports={};this.P=this.bindings={};a=this.id.indexOf(".");0>a?this.cb=this.id:(this.eb=this.id.substr(0,a),this.cb=this.id.substr(a+1));this.F={ready:!1,mb:!1,Ib:!1,ja:!1,Rb:!1,error:!1};this.zb=null;this.F.error=!1;this.ha=c||0;this.K=this.w=this.I=this.R=this.ua=null;fb.push(this)}
function gb(a,b,c){hb[a]&&b&&(hb[a][b]=c)}function ib(){return Date.now()||+new Date}function Ya(a,b,c){b||r((c?c+": ":"")+a)}function r(a){window&&window.alert(a)}function jb(a){var b=!1;window&&(b=window.confirm(a));return b}function kb(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<fb.length;b++){var d=fb[b];a&&d.id.indexOf(a)||c.push(d)}return c}function lb(a){if(void 0!==a){var b;for(b=0;b<fb.length;b++)if(fb[b].id===a)return fb[b]}return null}
function mb(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<fb.length;d++)if(c)c==fb[d]&&(c=null);else if(!(a!=fb[d].type||b&&fb[d].id.indexOf(b)))return fb[d]}return null}function ob(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){r(c.message+" ("+a+")")}return b}
function pb(a,b){b=qb(b.parentNode,"pc8080-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),k=0;k<h.length;k++)switch(g=h[k],g){case "pc8080-binding":(g=ob(f))&&g.binding&&a.da(g.type,g.binding,f,g.value),k=h.length}}}}
@ -280,7 +280,7 @@ function Jc(a,b,c){var d=b.toLowerCase(),d=Pa(b)||Pa(d);void 0===d&&a.S&&(d=a.S[
function si(a,b){var c=new td(a,"1.35.1",ti);if(pi(c)&&ui(c)){var d=c.get(vi),e=b?b.get(vi):"unknown";d!=e&&(a.aa("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}l=li.prototype;
l.nb=function(a){void 0===a&&(a=this.b||(this.G?wi:ni));if(!this.j){this.j++;var b=!1,c=!1;this.N=!1;var d=this.H||new td(this,"1.35.1");if(a==xi)b=!0;else if(a>ni){if(pi(d,this.G)){this.u=new td(this,"1.35.1",yi);pi(this.u)&&(zi(this,d),a=Ai,Bi(this.u));this.u.set(vi,Da());Ci(this.u);var e=this.b&&!this.C;if(a==wi||jb("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=ui(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?pi(d,g):("error"==f&&"no machine state"!=
g?(this.aa("Error: "+g),"unable to verify user"==g&&(La(Di,""),this.g=null)):this.i(f+": "+g),Bi(d),pi(d)?(c=ui(d),e=!0):c=!1))}e&&si(this,c?d:null)}else a==Ai&&d.clear()}else si(this);delete this.G;delete this.H}e=kb(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.w&&(c=Ei(this,g,d,b,c));b=[d,a,c];a!=xi?ri(this,this.Dc,b):this.Dc(b)}};
function Ei(a,b,c,d,e){if(!b.F.ja){b.F.ja=!0;if(b.wa){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.wa(f,d)&&f&&(r("Unable to restore state for "+b.type),a.M&&!a.O?(c.clear(),a.b=ni,window&&window.location.reload()):a.N=!0,b.wa(null),e=!1)}if(!d&&b.wc)for(a=b.wc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
function Ei(a,b,c,d,e){if(!b.F.ja){b.F.ja=!0;if(b.wa){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/-[0-9]+\./i,"."))));"string"===typeof f&&(f=null);!b.wa(f,d)&&f&&(r("Unable to restore state for "+b.type),a.M&&!a.O?(c.clear(),a.b=ni,window&&window.location.reload()):a.N=!0,b.wa(null),e=!1)}if(!d&&b.wc)for(a=b.wc.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
l.Dc=function(a){var b=a[0],c=0>a[1];a=a[2];this.V=!0;this.F.ja=!0;var d=this.P.power;d&&(d.textContent="Shutdown");this.w&&(Ei(this,this.w,b,c,a),this.w.lb());this.N&&(zi(this,b),b.clear());!c&&this.u&&(this.u.clear(),delete this.u);this.j=0};
function zi(a,b){if(jb("There may be a problem with your PC8080 machine.\n\nTo help us diagnose it, click OK to send this PC8080 machine state to http://www.pcjs.org.")){var c=a.g||"";b=b.toString();var d={app:"PC8080",ver:"1.35.1"};d.url=a.U;d.user=c;d.type="bug";d.data=b;Fa("http://www.pcjs.org/api/v1/report",d,!0)}}
function ei(a,b,c){var d,e="none";if(a.j)return null;a.j--;var f=new td(a,"1.35.1"),g=new td(a,"1.35.1",ti),h=Da();g.set(vi,h);f.set(vi,h);f.set(Fi,"1.35.1");f.set(Gi,window?window.location.href:null);f.set(Hi,Ha());a.w&&a.w.va&&(c&&a.w.ea(),d=a.w.va(b,c),"object"===typeof d&&f.set(a.w.id,d),c&&(a.w.F.ja=!1,!1===d&&(e=null)));for(var h=kb(a.id),k=0;k<h.length;k++){var p=h[k];p.F.ja&&(p.va&&(d=p.va(b,c),"object"===typeof d&&f.set(p.id,d)),c&&(p.F.ja=!1,!1===d&&(e=null)))}e&&(c?(h=d=!1,b?(a.g&&Vi(a,

File diff suppressed because one or more lines are too long

View file

@ -2432,7 +2432,7 @@ Web.onPageEvent('onpageshow', function onPageShow() {
Web.doPageEvent(Web.aPageEventHandlers['show']);
});
Web.onPageEvent(Web.isUserAgent("Opera") || Web.isUserAgent("iOS")? 'onunload' : 'onbeforeunload', function onPageUnload() {
Web.onPageEvent(Web.isUserAgent("iOS")? 'onpagehide' : (Web.isUserAgent("Opera")? 'onunload' : 'onbeforeunload'), function onPageUnload() {
Web.doPageEvent(Web.aPageEventHandlers['exit']);
});
@ -23372,15 +23372,17 @@ class Computer8080 extends Component {
if (!data) {
/*
* This is a hack that makes it possible for a machine whose ID has been
* supplemented with a suffix (a single letter or digit) to find object IDs
* in states created from a machine without the suffix.
* supplemented with a hyphenated numeric suffix to find object IDs in states
* created from a machine without such a suffix.
*
* For example, if a state file was created from a machine with ID "ibm5160"
* but the current machine is "ibm5160a", this attempts a second lookup with
* but the current machine is "ibm5160-1", this attempts a second lookup with
* "ibm5160", enabling us to find objects that match the original machine ID
* (eg, "ibm5160.romEGA").
*
* See /devices/pcx86/machine/5160/ega/640kb/array/ for examples of this.
*/
data = stateComputer.get(component.id.replace(/[a-z0-9]\./i, '.'));
data = stateComputer.get(component.id.replace(/-[0-9]+\./i, '.'));
}
}

View file

@ -48,7 +48,7 @@ function oa(){return"http://"+(window?window.location.host:"www.pcjs.org")}funct
function Aa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ba(a){if(window){var b=window?window.navigator.userAgent:"";return"iOS"==a&&!!b.match(/(iPod|iPhone|iPad)/)&&!!b.match(/AppleWebKit/)||"MSIE"==a&&!!b.match(/(MSIE|Trident)/)||0<=b.indexOf(a)}return!1}
function Ca(a){if(!Da){var b,c={};if(window){b||(b=window.location.search.substr(1));for(var d,e=/\+/g,f=/([^&=]+)=?([^&]*)/g;d=f.exec(b);)c[decodeURIComponent(d[1].replace(e," "))]=decodeURIComponent(d[2].replace(e," "))}Da=c}return Da[a]||Da[a.toLowerCase()]}function Ea(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Fa(a){Ga.init.push(a)}
function Ha(a){if(Ia)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){Ja("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks.",void 0,void 0)}}function Ka(a){!Ia&&a?(Ia=!0,La&&Ma("init"),Na&&Ma("show")):Ia=a}function Ma(a){Ga[a]&&Ha(Ga[a])}var Da=null,Ga={init:[],show:[],exit:[]},La=!1,Na=!1,Ia=!0,ya=null;Ea("onload",function(){La=!0;Ha(Ga.init)});Ea("onpageshow",function(){Na=!0;Ha(Ga.show)});
Ea(Ba("Opera")||Ba("iOS")?"onunload":"onbeforeunload",function(){Ha(Ga.exit)});function t(a,b){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ub=b.comment;this.Vc=b;this.exports={};this.w=this.bindings={};a=this.id.indexOf(".");0>a?this.Ya=this.id:(this.Ka=this.id.substr(0,a),this.Ya=this.id.substr(a+1));this.i={ready:!1,ab:!1,nb:!1,V:!1,rb:!1,error:!1};this.eb=null;this.i.error=!1;this.J=this.m=this.u=this.D=this.pa=null;u.push(this)}
Ea(Ba("iOS")?"onpagehide":Ba("Opera")?"onunload":"onbeforeunload",function(){Ha(Ga.exit)});function t(a,b){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ub=b.comment;this.Vc=b;this.exports={};this.w=this.bindings={};a=this.id.indexOf(".");0>a?this.Ya=this.id:(this.Ka=this.id.substr(0,a),this.Ya=this.id.substr(a+1));this.i={ready:!1,ab:!1,nb:!1,V:!1,rb:!1,error:!1};this.eb=null;this.i.error=!1;this.J=this.m=this.u=this.D=this.pa=null;u.push(this)}
function Oa(a,b,c){Pa[a]&&b&&(Pa[a][b]=c)}function Qa(){return Date.now()||+new Date}function Ja(a,b,c){b||r((c?c+": ":"")+a)}function r(a){window&&window.alert(a)}function Ra(a){var b=!1;window&&(b=window.confirm(a));return b}function Sa(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<u.length;b++){var d=u[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Ta(a){if(void 0!==a){var b;for(b=0;b<u.length;b++)if(u[b].id===a)return u[b]}return null}
function Ua(a,b){var c;if(void 0!==a){var d;b&&(b=0<(d=b.indexOf("."))?b.substr(0,d+1):"");for(d=0;d<u.length;d++)if(c)c==u[d]&&(c=null);else if(!(a!=u[d].type||b&&u[d].id.indexOf(b)))return u[d]}return null}function y(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){r(c.message+" ("+a+")")}return b}
function Va(a,b){b=A(b.parentNode,"pc8080-control");for(var c=0;c<b.length;c++)for(var d=b[c].childNodes,e=0;e<d.length;e++){var f=d[e];if(1===f.nodeType){var g=f.getAttribute("class");if(g)for(var h=g.split(" "),m=0;m<h.length;m++)switch(g=h[m],g){case "pc8080-binding":(g=y(f))&&g.binding&&a.S(g.type,g.binding,f,g.value),m=h.length}}}}
@ -194,7 +194,7 @@ function Nb(a,b,c){var d=b.toLowerCase(),d=Ca(b)||Ca(d);void 0===d&&a.F&&(d=a.F[
function qe(a,b){var c=new E(a,"1.35.1",re);if(ne(c)&&se(c)){var d=c.get(te),e=b?b.get(te):"unknown";d!=e&&(a.G("Machine state may be out-of-date\n("+d+" vs. "+e+")\nCheck your browser's local storage limits"),b||c.clear())}}k=je.prototype;
k.Ta=function(a){void 0===a&&(a=this.a||(this.o?ue:le));if(!this.c){this.c++;var b=!1,c=!1;this.B=!1;var d=this.s||new E(this,"1.35.1");if(a==ve)b=!0;else if(a>le){if(ne(d,this.o)){this.f=new E(this,"1.35.1",we);ne(this.f)&&(xe(this,d),a=ye,ze(this.f));this.f.set(te,ta());Ae(this.f);var e=this.a&&!this.j;if(a==ue||Ra("Click OK to restore the previous PC8080 machine state, or CANCEL to reset the machine.")){if(c=se(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?ne(d,g):("error"==f&&"no machine state"!=
g?(this.G("Error: "+g),"unable to verify user"==g&&(Aa(Be,""),this.b=null)):this.aa(f+": "+g),ze(d),ne(d)?(c=se(d),e=!0):c=!1))}e&&qe(this,c?d:null)}else a==ye&&d.clear()}else qe(this);delete this.o;delete this.s}e=Sa(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.m&&(c=Ce(this,g,d,b,c));b=[d,a,c];a!=ve?pe(this,this.Zb,b):this.Zb(b)}};
function Ce(a,b,c,d,e){if(!b.i.V){b.i.V=!0;if(b.ca){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,"."))));"string"===typeof f&&(f=null);!b.ca(f,d)&&f&&(r("Unable to restore state for "+b.type),a.A&&!a.C?(c.clear(),a.a=le,window&&window.location.reload()):a.B=!0,b.ca(null),e=!1)}if(!d&&b.Ub)for(a=b.Ub.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
function Ce(a,b,c,d,e){if(!b.i.V){b.i.V=!0;if(b.ca){var f=null;e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/-[0-9]+\./i,"."))));"string"===typeof f&&(f=null);!b.ca(f,d)&&f&&(r("Unable to restore state for "+b.type),a.A&&!a.C?(c.clear(),a.a=le,window&&window.location.reload()):a.B=!0,b.ca(null),e=!1)}if(!d&&b.Ub)for(a=b.Ub.split("|"),c=0;c<a.length;c++)b.status(a[c])}return e}
k.Zb=function(a){var b=a[0],c=0>a[1];a=a[2];this.N=!0;this.i.V=!0;var d=this.w.power;d&&(d.textContent="Shutdown");this.m&&(Ce(this,this.m,b,c,a),this.m.Sa());this.B&&(xe(this,b),b.clear());!c&&this.f&&(this.f.clear(),delete this.f);this.c=0};
function xe(a,b){if(Ra("There may be a problem with your PC8080 machine.\n\nTo help us diagnose it, click OK to send this PC8080 machine state to http://www.pcjs.org.")){var c=a.b||"";b=b.toString();var d={app:"PC8080",ver:"1.35.1"};d.url=a.I;d.user=c;d.type="bug";d.data=b;ua("http://www.pcjs.org/api/v1/report",d,!0)}}
function De(a,b,c){var d,e="none";if(a.c)return null;a.c--;var f=new E(a,"1.35.1"),g=new E(a,"1.35.1",re),h=ta();g.set(te,h);f.set(te,h);f.set(Ee,"1.35.1");f.set(Fe,window?window.location.href:null);f.set(Ge,window?window.navigator.userAgent:"");a.m&&a.m.ba&&(c&&Rb(a.m),d=a.m.ba(b,c),"object"===typeof d&&f.set(a.m.id,d),c&&(a.m.i.V=!1,!1===d&&(e=null)));for(var h=Sa(a.id),m=0;m<h.length;m++){var q=h[m];q.i.V&&(q.ba&&(d=q.ba(b,c),"object"===typeof d&&f.set(q.id,d)),c&&(q.i.V=!1,!1===d&&(e=null)))}e&&

File diff suppressed because one or more lines are too long