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

@ -54,9 +54,9 @@ e[c]&255,d.L[f++]=e[c]>>8&255,d.L[f++]=e[c]>>16&255,d.L[f++]=e[c]>>24&255;else(e
function Ba(){return"http://"+(window?window.location.host:"www.pcjs.org")}function Ca(){if(null==Da){var a=!1;if(window)try{window.localStorage.setItem("PCjs.localStorage","PCjs.localStorage"),a="PCjs.localStorage"==window.localStorage.getItem("PCjs.localStorage"),window.localStorage.removeItem("PCjs.localStorage")}catch(b){a=!1}Da=a}return Da}function Ea(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
function Fa(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function Ga(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 Ha(a){if(!Ia){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," "))}Ia=c}return Ia[a]||Ia[a.toLowerCase()]}function Ja(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Ka(a){La.init.push(a)}
function Ma(a){if(Na)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){r(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Oa(a){!Na&&a?(Na=!0,Pa&&Qa("init"),Ra&&Qa("show")):Na=a}function Qa(a){La[a]&&Ma(La[a])}var Ia=null,La={init:[],show:[],exit:[]},Pa=!1,Ra=!1,Na=!0,Da=null;Ja("onload",function(){Pa=!0;Ma(La.init)});Ja("onpageshow",function(){Ra=!0;Ma(La.show)});Ja(Ga("Opera")||Ga("iOS")?"onunload":"onbeforeunload",function(){Ma(La.exit)});
function t(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.rd=b.comment;this.Je=b;this.exports={};this.o=this.bindings={};a=this.id.indexOf(".");0>a?this.ib=this.id:(this.Ua=this.id.substr(0,a),this.ib=this.id.substr(a+1));this.j={ready:!1,Ra:!1,Yc:!1,R:!1,gd:!1,error:!1};this.ic=null;this.j.error=!1;this.qd=c||0;this.D=this.c=this.v=this.A=this.ob=null;u.push(this)}function Sa(a,b,c){Ua[a]&&b&&(Ua[a][b]=c)}function Va(){return Date.now()||+new Date}
function r(a){window&&window.alert(a)}function Wa(a){var b=!1;window&&(b=window.confirm(a));return b}function Xa(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 Ya(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 Ma(a){if(Na)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){r(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Oa(a){!Na&&a?(Na=!0,Pa&&Qa("init"),Ra&&Qa("show")):Na=a}function Qa(a){La[a]&&Ma(La[a])}var Ia=null,La={init:[],show:[],exit:[]},Pa=!1,Ra=!1,Na=!0,Da=null;Ja("onload",function(){Pa=!0;Ma(La.init)});Ja("onpageshow",function(){Ra=!0;Ma(La.show)});
Ja(Ga("iOS")?"onpagehide":Ga("Opera")?"onunload":"onbeforeunload",function(){Ma(La.exit)});function t(a,b,c){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.rd=b.comment;this.Je=b;this.exports={};this.o=this.bindings={};a=this.id.indexOf(".");0>a?this.ib=this.id:(this.Ua=this.id.substr(0,a),this.ib=this.id.substr(a+1));this.j={ready:!1,Ra:!1,Yc:!1,R:!1,gd:!1,error:!1};this.ic=null;this.j.error=!1;this.qd=c||0;this.D=this.c=this.v=this.A=this.ob=null;u.push(this)}
function Sa(a,b,c){Ua[a]&&b&&(Ua[a][b]=c)}function Va(){return Date.now()||+new Date}function r(a){window&&window.alert(a)}function Wa(a){var b=!1;window&&(b=window.confirm(a));return b}function Xa(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 Ya(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 Za(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 w(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")}catch(c){r(c.message+" ("+a+")")}return b}
function x(a,b){var c=z;b=A(b.parentNode,c+"-control");for(var d=0;d<b.length;d++)for(var e=b[d].childNodes,f=0;f<e.length;f++){var g=e[f];if(1===g.nodeType){var k=g.getAttribute("class");if(k)for(var l=k.split(" "),m=0;m<l.length;m++)switch(k=l[m],k){case c+"-binding":(k=w(g))&&k.binding&&a.ma(k.type,k.binding,g,k.value),m=l.length}}}}
function A(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.getElementsByClassName(b);var d;c=[];a=a.getElementsByTagName("*");var e=new RegExp("(^| )"+b+"( |$)");b=0;for(d=a.length;b<d;b++)e.test(a[b].className)&&c.push(a[b]);return c}
@ -277,7 +277,7 @@ function eh(a,b){if(!b){var c;if("object"==typeof resources&&(c=resources.parms)
h.Vb=function(a,b){for(var c=this,d=Xa(this.id),e=0;e<=d.length;e++){var f=e<d.length?d[e]:this;if(!eb(f)){eb(f,function(){c.Vb(a,b)});return}}a.call(this,b)};function jh(a,b){var c=new E(a,"1.35.1",kh);if(hh(c)&&lh(c)){var d=c.get(mh),e=b?b.get(mh):"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())}}
h.Sb=function(a){void 0===a&&(a=this.a||(this.s?nh:gh));if(!this.g){this.g++;var b=!1,c=!1;this.C=!1;var d=this.l||new E(this,"1.35.1");if(a==oh)b=!0;else if(a>gh){if(hh(d,this.s)){this.h=new E(this,"1.35.1",rh);hh(this.h)&&(sh(this,d),a=th,uh(this.h));this.h.set(mh,ya());vh(this.h);var e=this.a&&!this.m;if(a==nh||Wa("Click OK to restore the previous "+hb+" machine state, or CANCEL to reset the machine.")){if(c=lh(d)){var f=d.get("code"),g=d.get("data");f&&("ok"==f?hh(d,g):("error"==f&&"no machine state"!=
g?(this.G("Error: "+g),"unable to verify user"==g&&(Fa(wh,""),this.b=null)):this.aa(f+": "+g),uh(d),hh(d)?(c=lh(d),e=!0):c=!1))}e&&jh(this,c?d:null)}else a==th&&d.clear()}else jh(this);delete this.s;delete this.l}e=Xa(this.id);for(f=0;f<e.length;f++)g=e[f],g!==this&&g!=this.c&&(c=xh(this,g,d,b,c));b=[d,a,c];a!=oh?this.Vb(this.Gd,b):this.Gd(b)}};
function xh(a,b,c,d,e){if(!b.j.R){b.j.R=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/[a-z0-9]\./i,".")))),"string"===typeof f&&(f=null),!b.la(f,d)&&f&&(r("Unable to restore state for "+b.type),a.u&&!a.I?(c.clear(),a.a=gh,window&&window.location.reload()):a.C=!0,b.la(null),e=!1),!d&&b.rd){var g=b.rd.split("|");for(a=0;a<g.length;a++)b.status(g[a])}}catch(k){r("Error restoring state for "+b.type+" ("+k.message+")")}}return e}
function xh(a,b,c,d,e){if(!b.j.R){b.j.R=!0;var f=null;try{if(e&&((f=c.get(b.id))||(f=c.get(b.id.replace(/-[0-9]+\./i,".")))),"string"===typeof f&&(f=null),!b.la(f,d)&&f&&(r("Unable to restore state for "+b.type),a.u&&!a.I?(c.clear(),a.a=gh,window&&window.location.reload()):a.C=!0,b.la(null),e=!1),!d&&b.rd){var g=b.rd.split("|");for(a=0;a<g.length;a++)b.status(g[a])}}catch(k){r("Error restoring state for "+b.type+" ("+k.message+")")}}return e}
h.Gd=function(a){var b=a[0],c=0>a[1];a=a[2];this.H=!0;this.j.R=!0;var d=this.o.power;d&&(d.textContent="Shutdown");this.c&&(xh(this,this.c,b,c,a),Lb(this,-2),this.c.Y());this.C&&(sh(this,b),b.clear());!c&&this.h&&(this.h.clear(),delete this.h);this.g=0};
function sh(a,b){if(Wa("There may be a problem with your "+hb+" machine.\n\nTo help us diagnose it, click OK to send this "+hb+" machine state to http://www.pcjs.org.")){var c=a.K;a=a.b||"";b=b.toString();var d={};d.app=hb;d.ver="1.35.1";d.url=c;d.user=a;d.type="bug";d.data=b;za("http://www.pcjs.org/api/v1/report",d,!0)}}
function yh(a,b,c){var d,e="none";if(a.g)return null;a.g--;var f=new E(a,"1.35.1"),g=new E(a,"1.35.1",kh),k=ya();g.set(mh,k);f.set(mh,k);f.set(zh,"1.35.1");f.set(Ah,window?window.location.href:null);f.set(Bh,window?window.navigator.userAgent:"");a.c&&a.c.ka&&(c&&(b&&(a.c.j.Y=a.c.j.N),G(a.c)),d=a.c.ka(b,c),"object"===typeof d&&f.set(a.c.id,d),c&&(a.c.j.R=!1,!1===d&&(e=null)));for(var k=Xa(a.id),l=0;l<k.length;l++){var m=k[l];m.j.R&&(m.ka&&(d=m.ka(b,c),"object"===typeof d&&f.set(m.id,d)),c&&(m.j.R=