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:
parent
45b4dea546
commit
991e924d01
38 changed files with 3324 additions and 3009 deletions
|
|
@ -42,7 +42,7 @@ function ua(a,b){var c,d={I:null,O:null,T:null,S:null};if("["==b.charAt(0)||"{"=
|
|||
e[c]&255,d.I[f++]=e[c]>>8&255,d.I[f++]=e[c]>>16&255,d.I[f++]=e[c]>>24&255;else(e=g.data)?d.Y=e:d.I=g;d.I&&(d.I.length?1==d.I.length&&(q(d.I[0]),d=null):(q("Empty resource: "+a),d=null));d.O=g.symbols}catch(h){q("Resource data error ("+a+"): "+h.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)){q("Resource data error ("+a+"): invalid hex byte ("+b[c]+")");break}e.push(f&255)}c==b.length&&(d.I=e)}return d}
|
||||
function pa(){return"http://"+(window?window.location.host:"www.pcjs.org")}function va(){if(null==wa){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}wa=a}return wa}function xa(a){var b;if(window)try{b=window.localStorage.getItem(a)}catch(c){}return b}
|
||||
function ya(a,b){try{return window.localStorage.setItem(a,b),!0}catch(c){}return!1}function za(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 Aa(a){if(!Ba){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," "))}Ba=c}return Ba[a]}function Ca(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Da(a){r.init.push(a)}
|
||||
function Aa(a){if(!Ba){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," "))}Ba=c}return Ba[a]||Ba[a.toLowerCase()]}function Ca(a,b){if(window){var c=window[a];window[a]="function"!==typeof c?b:function(){c&&c();b()}}}function Da(a){r.init.push(a)}
|
||||
function Fa(a){if(Ga)try{for(var b=0;b<a.length;b++)a[b]()}catch(c){q(""+("An unexpected exception occurred:\n\n"+c.message+"\n\nPlease send this information to support@pcjs.org. Thanks."))}}function Ha(a){!Ga&&a?(Ga=!0,Ia&&Ja("init"),Ka&&Ja("show")):Ga=a}function Ja(a){r[a]&&Fa(r[a])}var Ba=null,r={init:[],show:[],exit:[]},Ia=!1,Ka=!1,Ga=!0,wa=null;Ca("onload",function(){Ia=!0;Fa(r.init)});Ca("onpageshow",function(){Ka=!0;Fa(r.show)});Ca(za("Opera")||za("iOS")?"onunload":"onbeforeunload",function(){Fa(r.exit)});
|
||||
function t(a,b){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Wa=b.comment;this.jb=b;this.exports={};this.m=this.bindings={};a=this.id.indexOf(".");0>a?this.va=this.id:(this.wa=this.id.substr(0,a),this.va=this.id.substr(a+1));this.h={ready:!1,Ba:!1,Oa:!1,F:!1,Sa:!1,error:!1};this.Da=null;this.h.error=!1;this.w=this.j=this.s=this.v=this.ga=null;v.push(this)}function La(a,b,c){Ma[a]&&b&&(Ma[a][b]=c)}function Na(){return Date.now()||+new Date}
|
||||
function q(a){window&&window.alert(a)}function Oa(a){var b=!1;window&&(b=window.confirm(a));return b}function w(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b<v.length;b++){var d=v[b];a&&d.id.indexOf(a)||c.push(d)}return c}function Pa(a){if(void 0!==a){var b;for(b=0;b<v.length;b++)if(v[b].id===a)return v[b]}return null}
|
||||
|
|
@ -185,8 +185,9 @@ r.exit.push(function(){for(var a=A(document,z,"computer"),b=0;b<a.length;b++){va
|
|||
function od(a){var b=!0;if(!a.j)try{a.a=JSON.parse(a.f),a.j=!0}catch(c){q(c.message||c),b=!1}return b}function wd(a){var b=!0;if(va()){var c=JSON.stringify(a.a);ya(a.key,c)||(q("Unable to store "+c.length+" bytes in browser local storage"),b=!1)}return b}k.toString=function(){return this.a?JSON.stringify(this.a):this.f};function vd(a,b){a.f="";a.a={};a.g=a.j=!1;b&&a.set("parms",b)}
|
||||
k.clear=function(a){vd(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 Gd(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 Hd=0;
|
||||
function Id(a,b,c,d,e,f,g){f("Loading "+a+"...");p(a,null,!0,function(h,m,u){u?(m||(m="unable to load "+a+" ("+u+")"),g(m,null)):Jd(m,a,b,c,d,e,f,g)})}
|
||||
function Jd(a,b,c,d,e,f,g,h){function m(a,g){if(g)h(g,null);else{c&&(La(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(H){g=null,a=H.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?f?Kd(a,g,m):m(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
function Jd(a,b,c,d,e,f,g,h){function m(a,g){if(g)h(g,null);else{c&&(La(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(H){g=null,a=H.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?f?Kd(a,g,m):m(a,null):h("no data"+(b?" for file: "+
|
||||
b:""),null)}
|
||||
function Kd(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");p(e,null,!0,function(f,g,h){if(h||!g)c(a,"unable to resolve XML reference: "+d[0]+" ("+h+")");else{if(f=d[3])if(h=g.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var m=h[0],u,D=/( [a-z]+=)(['"])(.*?)\2/g;u=D.exec(f);)m=0>m.indexOf(u[1])?m.replace(">",u[0]+">"):m.replace(new RegExp(u[1]+"(['\"])(.*?)\\1"),u[0]);h[0]!=m&&(g=g.replace(h[0],m))}else{c(a,"missing <"+d[1]+"> in "+e);return}g=g.replace(/<\?xml[^>]*>[\r\n]*/,
|
||||
"");a=a.replace(d[0],g);Kd(a,b,c)}})}else c(a,null)}
|
||||
function Ld(a,b,c,d,e){function f(a){if(void 0===m){var b=h&&A(h,"machine-warning");m=b&&b[0]||h}m&&(m.innerHTML=qa(a))}function g(a){f("Error: "+a);u&&(--Hd||Ha(!0));u=!1}var h,m,u=!0;Hd++;Ma[b]={};try{if(h=document.getElementById(b)){var D;if("object"==typeof resources&&(D=resources.css)){var H=document.head||document.getElementsByTagName("head")[0],Ea=document.createElement("style");Ea.type="text/css";Ea.styleSheet?Ea.styleSheet.cssText=D:Ea.appendChild(document.createTextNode(D));H.appendChild(Ea)}d||
|
||||
|
|
|
|||
Loading…
Reference in a new issue