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
|
|
@ -122,8 +122,8 @@ function Za(a,b,c){var d,e=!c;b=b.keyCode;c&&(a.sa=b);16==b?(a.g&=-5,c&&(a.g|=4)
|
|||
function $a(a,b){var c=!1;b==a.W?a.U&&(a.U.reset(!0),c=!0):(a.R&&65<=b&&90>=b&&(b+=32),bb(a,b),U(a,b,!0,0)&&(2==a.s.I?U(a,b,!1,1):(c=!1,a.v[b]&&(clearTimeout(a.v[b]),c=!0),c=ab(a,c),a.v[a.A=b]=setTimeout(function(a){return function(){U(a,b,!1,3)}}(a),c),a.u&&K(a.u,a.u.ya)&&a.u.message("keyPressSimulate("+u(b)+"): setTimeout()")),c=!0));a.u&&K(a.u,a.u.ya)&&a.u.message("keyPressSimulate("+u(b)+"): "+(c?"true":"false"));return c}
|
||||
function U(a,b,c,d){var e=!1;c||(a.v[b]=null,a.A==b&&(a.A=0));var g=0,h=a.b[b];void 0===h&&(1<=b&&26>=b&&(b+=64,g=a.K),h=a.b[b]);void 0!==h&&(b=h>>12,e=h>>8&15,g||(g=h&255),c?(a.o[b]|=1<<e,a.o[0]=g==a.K?a.o[0]|64:240==g?a.o[0]|4:242==g?a.o[0]|2:a.o[0]&-71):(a.o[b]&=~(1<<e),a.o[0]&=-71,a.o[0]|=a.g&70),c=!d&&!a.L.length,a.L.push(a.o.slice()),eb(a,c),e=!0);return e}f.S=function(){};f.Ib=function(a){this.ja=this.s.S(a)^this.O;this.V++;eb(this,!1,a)};
|
||||
function eb(a,b,c){var d=Sa(a.s);b||(2==a.s.I?b=void 0!==c&&32<=a.V:(b=d-a.qa,b=0>b||8192<=b));b&&(b=a.L.shift(),void 0!==b&&(a.fa=b),a.V=0,a.qa=d);for(b=d=0;8>b;b++)a.ja&1<<b&&(d|=a.fa[b]);d^=a.O;if(void 0!==c)a.a[c]=d;else if(c=a.ra,d!=a.ka)for(;c<a.jb;c++)a.a[c]=d;a.ka=d}y(function(){for(var a=G(document,"c1pjs","keyboard"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new Ya(d);F(d,c)}});
|
||||
function fb(a,b,c,d){C.call(this,"C1PVideo",a);this.ja=a.model;this.$=a.charCols;this.ba=a.charRows;this.qa=a.screenWidth;this.ra=a.screenHeight;this.B=a.charWidth;this.D=a.charHeight;gb(this);this.A=b;this.O=c;this.o=d;var e;b=["","moz","ms","webkit"];a=a.smoothing;if(!ua){c={};if(window){e||(e=window.location.search.substr(1));for(var g=/\+/g,h=/([^&=]+)=?([^&]*)/g;d=h.exec(e);)c[decodeURIComponent(d[1].replace(g," "))]=decodeURIComponent(d[2].replace(g," "))}ua=c}(e=ua.smoothing)&&(a="true"==e);
|
||||
if(null!=a)for(e=0;e<b.length;e++)if(c=(c=b[e])?c+"ImageSmoothingEnabled":"imageSmoothingEnabled",void 0!==this.O[c]){this.O[c]=a;break}}p(fb,C);f=fb.prototype;f.reset=function(a){this.Ma(this.ja);if(this.a)for(var b=this.K;b<this.R;b++)this.a[b]=a?Math.floor(256*Math.random()):32};f.T=function(a,b,c){switch(b){case "refresh":return this.H[b]=c,c.onclick=function(a){return function(){hb(a);Ha(a)}}(this),!0}return!1};
|
||||
function fb(a,b,c,d){C.call(this,"C1PVideo",a);this.ja=a.model;this.$=a.charCols;this.ba=a.charRows;this.qa=a.screenWidth;this.ra=a.screenHeight;this.B=a.charWidth;this.D=a.charHeight;gb(this);this.A=b;this.O=c;this.o=d;var e;b=["","moz","ms","webkit"];a=a.smoothing;if(!ua){c={};if(window){e||(e=window.location.search.substr(1));for(var g=/\+/g,h=/([^&=]+)=?([^&]*)/g;d=h.exec(e);)c[decodeURIComponent(d[1].replace(g," "))]=decodeURIComponent(d[2].replace(g," "))}ua=c}(e=ua.smoothing||ua.smoothing)&&
|
||||
(a="true"==e);if(null!=a)for(e=0;e<b.length;e++)if(c=(c=b[e])?c+"ImageSmoothingEnabled":"imageSmoothingEnabled",void 0!==this.O[c]){this.O[c]=a;break}}p(fb,C);f=fb.prototype;f.reset=function(a){this.Ma(this.ja);if(this.a)for(var b=this.K;b<this.R;b++)this.a[b]=a?Math.floor(256*Math.random()):32};f.T=function(a,b,c){switch(b){case "refresh":return this.H[b]=c,c.onclick=function(a){return function(){hb(a);Ha(a)}}(this),!0}return!1};
|
||||
f.ca=function(a,b,c,d){this.a=a;this.K=b;this.ka=c-b+1;this.R=this.K+this.ka;d&&(this.s=d,Ia(d,56832,56832,this,this.S),O(d,56832,56832,this,this.Kb));this.reset(!0)};function gb(a,b,c,d,e){a.I=void 0!==b?b:a.$;a.sa=void 0!==c?c:a.ba;a.g=a.I*a.sa;a.R=a.K+a.g;a.Z=void 0!==d?d:0;a.fa=void 0!==e?e:c;a.V=Math.floor(a.qa/a.I);a.W=Math.floor(a.ra/a.fa)}f.da=function(){this.A.focus()};
|
||||
f.Ma=function(a){this.M=a;600==this.M?(gb(this,this.$,this.ba,3,25),1024==this.g&&this.s&&(this.v=this.R+this.g-1,O(this.s,this.v,this.v,this,this.Gb))):(this.l("updated video model: "+this.M),gb(this,64,32));hb(this);Ha(this)};f.ia=function(a,b){if(a&&!this.C.N&&H(this)){if(this.C.N=!0,this.u=M(b,"debugger"),this.b=M(b,"keyboard"))this.b.T("canvas","keyDown",this.A),this.b.T("canvas","keyPress",this.A),this.b.T("canvas","keyUp",this.A)}else!a&&this.C.N&&(this.C.N=!1)};
|
||||
f.X=function(){this.B||(this.B=Math.floor(this.o.width/16));this.D||(this.D=Math.floor(this.o.height/16));C.prototype.X.call(this)};f.S=function(a,b){var c=this.s.S(a);void 0!==b&&this.u&&T(this.u,this,a,b,this.u.$a);this.s.a[a]=c&127|(Math.floor(Sa(this.s)/8333)&1?128:0)};f.Kb=function(a,b){void 0!==b&&this.u&&T(this.u,this,a,b,this.u.$a)};
|
||||
|
|
@ -185,7 +185,7 @@ Z.prototype.start=function(){for(var a in this.Y)if("cpu"!=a)for(var b=0;b<this.
|
|||
function Nb(a){var b=null,c;for(c in a.Y)for(var d=0;d<a.Y[c].length;d++){var e=a.Y[c][d];if(e){if(!H(e)){H(e,function(a){return function(){Nb(a)}}(a));return}"cpu"==c?b=e:e.ia&&e.ia(!0,a)}}a.X();a.l("C1Pjs v1.35.1\nCopyright \u00a9 2012-2017 Jeff Parsons <Jeff@pcjs.org>");b&&b.ia(!0,a)}
|
||||
y(function(){for(var a=G(document,"c1pjs","computer"),b=0;b<a.length;b++){for(var c=a[b],d=E(c),e,g={},h,l=0,k=0,m=0;m<d.modules.length;m++){var n=d.modules[m];if(!m){if("cpu"!=n.type)break;l=n.start;k=n.end;h=Array(k+1-l);for(e=l;e<h.length;e++)h[e]=0}if(e=va(n.refID,d.id)){var r=n.type;void 0===g[r]&&(g[r]=[]);g[r].push(e);e.ca&&void 0!==n.start&&e.ca(h,n.start,n.end,g.cpu[0])}else{A('no component for <module refid="'+n.refID+'">');return}}if(!h){A('<module type="cpu"> definition must appear first in the <computer> specification');
|
||||
break}if(e=va("debugger",d.id))g["debugger"]=[e],e.ca&&e.ca(h,l,k,g.cpu[0]);l=new Z(d,g);if(k=va("panel",d.id))if(g.panel=[k],k.Sa){e=d.id;d=void 0;g=[];e&&(e=0<(d=e.indexOf("."))?e.substr(0,d+1):"");for(d=0;d<D.length;d++)m=D[d],e&&m.id.indexOf(e)||g.push(m);d=g;for(g=0;g<d.length;g++)e=d[g],e!=k&&(e.Wa=k.Wa,e.l=k.l,e.Sa=k.Sa)}F(l,c);Nb(l)}});var Ob=0;function Pb(a,b,c,d,e,g){e("Loading "+a+"...");w(a,function(h,l,k){k?(l||(l="unable to load "+a+" ("+k+")"),g(l,null)):Rb(l,a,b,c,d,e,g)})}
|
||||
function Rb(a,b,c,d,e,g,h){function l(a,g){if(g)h(g,null);else{c&&(L[c]&&b&&(L[c][b]=a),(g=b)&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+g+'"}',"object"==typeof resources&&(g=null),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,
|
||||
function Rb(a,b,c,d,e,g,h){function l(a,g){if(g)h(g,null);else{c&&(L[c]&&b&&(L[c][b]=a),(g=b)&&0>g.indexOf("/")&&"/"==window.location.pathname.slice(-1)&&(g=window.location.pathname+g),d?"}"==d.slice(-1)?(d=d.slice(0,-1),1<d.length&&(d+=",")):d='{state:"'+d+'",':d="{",d+='url:"'+g+'"}',"object"==typeof resources&&(g=null),d=d.replace(/\$/g,"$$$$"),a=a.replace(/(<machine[^>]*\sid=)(['"]).*?\2/,"$1$2"+c+"$2"+(d?" parms='"+d+"'":"")+(g?' url="'+g+'"':"")));e||(a=a.replace(/(<xsl:variable name="APPNAME">).*?(<\/xsl:variable>)/,
|
||||
"$1C1Pjs$2"),a=a.replace(/(<xsl:variable name="APPCLASS">).*?(<\/xsl:variable>)/,"$1c1pjs$2"));g=null;if("<"==a.charAt(0))try{e||(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(n){g=null,a=n.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?Sb(a,g,l):l(a,null):h("no data"+(b?" for file: "+
|
||||
b:""),null)}
|
||||
function Sb(a,b,c){var d;if(d=/<([a-z]+)\s+ref="(.*?)"(.*?)\/>/g.exec(a)){var e=d[2];b("Loading "+e+"...");w(e,function(g,h,l){if(l||!h)c(a,"unable to resolve XML reference: "+d[0]+" ("+l+")");else{if(g=d[3])if(l=h.match(new RegExp("<"+d[1]+"[^>]*>"))){for(var k=l[0],m,n=/( [a-z]+=)(['"])(.*?)\2/g;m=n.exec(g);)k=0>k.indexOf(m[1])?k.replace(">",m[0]+">"):k.replace(new RegExp(m[1]+"(['\"])(.*?)\\1"),m[0]);l[0]!=k&&(h=h.replace(l[0],k))}else{c(a,"missing <"+d[1]+"> in "+e);return}h=h.replace(/<\?xml[^>]*>[\r\n]*/,"");
|
||||
|
|
|
|||
Loading…
Reference in a new issue