Added support for special autoType sequences (eg, $date and $time, which generate current date and time strings accepted by the PC-DOS date and time prompts)

This commit is contained in:
Jeff Parsons 2017-06-23 09:39:40 -07:00 • committed by Jeff Parsons
commit 991e924d01
38 changed files with 3324 additions and 3009 deletions

View file

@ -53,7 +53,7 @@ function Aa(a,b){var c,d={L:null,ia:null,ea:null,da:null};if("["==b.charAt(0)||"
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=g.data)?d.Gj=e:d.L=g;d.L&&(d.L.length?1==d.L.length&&(r(d.L[0]),d=null):(r("Empty resource: "+a),d=null));d.ia=g.symbols}catch(k){r("Resource data error ("+a+"): "+k.message),d=null}else{e=[];b=b.replace(/\n/gm," ").replace(/ +$/,"").split(" ");for(c=0;c<b.length;c++){f=parseInt(b[c],16);if(isNaN(f)){r("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.L=e)}return d}
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]}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 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}
@ -295,8 +295,9 @@ function E(a,b,c){this.id=a.id;this.a="";this.c={};this.b=this.o=!1;this.key=Fh(
function vh(a){var b=!0;if(Ca()){var c=JSON.stringify(a.c);Fa(a.key,c)||(r("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}h.toString=function(){return this.c?JSON.stringify(this.c):this.a};function uh(a,b){a.a="";a.c={};a.b=a.o=!1;b&&a.set("parms",b)}
h.clear=function(a){uh(this);var b=[];try{for(var c=0,d=window.localStorage.length;c<d;c++)b.push(window.localStorage.key(c))}catch(e){}for(c=0;c<b.length;c++)if((d=b[c])&&(a||d.substr(0,this.key.length)==this.key)){try{window.localStorage.removeItem(d)}catch(e){}b.splice(c,1);c=0}};function Fh(a,b,c){a=a.id;if(b){var d=b.indexOf(".");0<d&&(a+=".v"+b.substr(0,d))}c&&(a+="."+c);return a}var Gh=0;
function Hh(a,b,c,d,e,f,g){f("Loading "+a+"...");za(a,null,!0,function(k,l,m){m?(l||(l="unable to load "+a+" ("+m+")"),g(l,null)):Ih(l,a,b,c,d,e,f,g)})}
function Ih(a,b,c,d,e,f,g,k){function l(a,g){if(g)k(g,null);else{c&&(Sa(c,b,a),(g=b)&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1<e.length&&(e+=",")):e='{state:"'+e+'",':e="{",e+='url:"'+g+'"}',"object"==typeof resources&&(g=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(g?' url="'+g+'"':"")));f||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,"$1PDPjs$2"),
a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1"+d+"$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){g=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);k(a,g)}}a?f?Jh(a,g,l):l(a,null):k("no data"+(b?" for file: "+b:""),null)}
function Ih(a,b,c,d,e,f,g,k){function l(a,g){if(g)k(g,null);else{c&&(Sa(c,b,a),(g=b)&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g),e?"}"==e.slice(-1)?(e=e.slice(0,-1),1<e.length&&(e+=",")):e='{state:"'+e+'",':e="{",e+='url:"'+g+'"}',"object"==typeof resources&&(g=null),e=e.replace(/\$/g,"$$$$"),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(e?" parms='"+e+"'":"")+(g?' url="'+g+'"':"")));f||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,
"$1PDPjs$2"),a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1"+d+"$2"));g=null;if("<"==a.charAt(0))try{f||(a=a.replace(/<!DOCTYPE(.|[\r\n])*]>\s*/g,"")),window.ActiveXObject||"ActiveXObject"in window?(g=new window.ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(a)):g=(new window.DOMParser).parseFromString(a,"text/xml")}catch(q){g=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);k(a,g)}}a?f?Jh(a,g,l):l(a,null):k("no data"+(b?" for file: "+
b:""),null)}
function Jh(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");za(e,null,!0,function(f,g,k){if(k||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+k+")");else{if(f=d[3])if(k=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var l=k[0],m,p=/( [a-z]+=)(['"])(.*?)\2/g;m=p.exec(f);)l=0>l.indexOf(m[1])?l.replace(">",m[0]+">"):l.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);k[0]!=l&&(g=g.replace(k[0],l))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
"");a=a.replace(d[0],g);Jh(a,b,c)}})}else c(a,null)}
function Kh(a,b,c,d,e){function f(a){if(void 0===l){var b=k&&A(k,"machine-warning");l=b&&b[0]||k}l&&(l.innerHTML=ua(a))}function g(a){f("Error: "+a);m&&(--Gh||Oa(!0));m=!1}var k,l,m=!0;Gh++;Ua[b]={};try{if(k=document.getElementById(b)){var p;if("object"==typeof resources&&(p=resources.css)){var q=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css";v.styleSheet?v.styleSheet.cssText=p:v.appendChild(document.createTextNode(p));q.appendChild(v)}d||