Avoid deprecation warnings regarding image smoothing, by carefully checking for properties in order of least to most deprecatable (what a delightful process)
This commit is contained in:
parent
63f3f67fe8
commit
cf596ee224
10 changed files with 349 additions and 343 deletions
|
|
@ -94,13 +94,13 @@ function Cd(a){if(!ib(a))if(!a.G)D(a);else if(a.w&&a.B){a.u||(a.u=a.w.length);if
|
|||
function Dd(a,b){if(rb(a.B,b,a.u,a.J?1:Qb)){var c;for(c=0;c<a.w.length;c++)wb(a.B,b+c,a.w[c]);if(a.J&&256==b){for(c=0;c<Bd.length;c++)wb(a.B,Bd[c],118);Cc(a.b,function(a){return function(b){if(0<=Bd.indexOf(b)){var c=!1,h=a.b,g=a.F;if(5==b)switch(c=!0,h.O){case 2:Ed(a,String.fromCharCode(h.R));break;case 9:for(var l=Jc(h),k="",n=255;n--;){var p=a.b.X(l++);if(36==p)break;k+=String.fromCharCode(p)}Ed(a,k);break;default:c=!1}c?td.call(h):g&&(a.g("\nCP/M vector "+r(b)),F(h,b),g.da());b=!0}else b=!1;return b}}(a));
|
||||
Ec(a.b,b)}return!0}return!1}function Ed(a,b){b=b.replace(/\r/g,"");a.ta&&(a.ta.value+=b,a.ta.scrollTop=a.ta.scrollHeight)}Ia(function(){for(var a=C(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new zd(d);bb(d,c)}});function Fd(a){v.call(this,"RAM",a,Fd);this.C=a.addr;this.u=a.size;this.w=!1}Va(Fd);m=Fd.prototype;m.Ia=function(a,b,c,d){this.B=b;this.b=c;this.F=d;D(this)};m.Ba=function(a,b){b||this.reset();return!0};m.Aa=function(a){return a?this.save():!0};
|
||||
m.reset=function(){!this.w&&this.u&&rb(this.B,this.C,this.u,1)&&(this.w=!0);this.w||t("No RAM allocated")};m.save=function(){return null};m.restore=function(){return!0};Ia(function(){for(var a=C(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Fd(d);bb(d,c)}});function Gd(a){v.call(this,"Keyboard",a,Gd,65536);D(this)}Va(Gd);Ia(function(){for(var a=C(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=z(c),d=new Gd(d);bb(d,c)}});
|
||||
function Hd(a,b,c,d,e){var f=this;this.wa=wa("Gecko/");var h=["","moz","webkit","ms"];v.call(this,"Video",a,Hd,262144);this.ha=a.screenWidth;this.aa=a.screenHeight;this.qa=a.bufferAddr;this.H=a.bufferCols;this.Y=a.bufferRows;this.ia=a.bufferBits||1;this.qb=a.bufferLeft||0;if(this.C=a.bufferRotate)this.C=this.C%360,0<this.C&&(this.C-=360),-90!=this.C&&(this.na("unsupported buffer rotation: "+this.C),this.C=0);this.Zb=a.interruptRate;this.Ea=a.refreshRate||60;this.K=b;this.L=c;this.Ca=d||b||null;b=
|
||||
a.smoothing;(c=Qa.smoothing)&&(b="true"==c);if(null!=b)for(c=0;c<h.length;c++)d=(d=h[c])?d+"ImageSmoothingEnabled":"imageSmoothingEnabled",this.L[d]=b;if(this.G=a.screenRotate)this.G=this.G%360,0<this.G&&(this.G-=360),-90!=this.G?(this.na("unsupported screen rotation: "+this.G),this.G=0):(this.L.translate(0,this.aa),this.L.rotate(this.G*Math.PI/180),this.L.scale(this.aa/this.ha,this.ha/this.aa));this.ba=1<<this.ia;this.W=Array(this.ba+2);this.W[0]=[0,0,0,255];this.W[1]=[255,255,255,255];this.W[this.ba+
|
||||
0]=[255,255,0,255];this.W[this.ba+1]=[0,255,0,255];a=this.H;b=this.Y;this.C&&(a=this.Y,b=this.H);this.xa=this.L.createImageData(a,b);this.J=document.createElement("canvas");this.J.width=a;this.J.height=b;this.pb=this.J.getContext("2d");if(this.u=e)if(this.u.Pa=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.u.Pa){for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){Id(f,document.fullscreenElement||
|
||||
document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement?!0:!1)},!1);break}for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){Id(f,null)},!1);break}}}Va(Hd);
|
||||
Hd.prototype.Ia=function(a,b,c,d){this.w=a;this.B=b;this.b=c;this.F=d;this.oa=(this.H*this.ia>>3)*this.Y;rb(this.B,this.qa,this.oa,3)&&(this.Fa=this.oa>>1,this.Ga=16/this.ia|0,this.sa=!1,void 0===this.fa||this.fa.length!=this.Fa)&&(this.fa=Array(this.Fa));D(this)};Hd.prototype.pa=function(a,b,c){var d=this;switch(b){case "fullScreen":return this.T[b]=c,this.u&&this.u.Pa?c.onclick=function(){d.Pa()}:c.parentNode.removeChild(c),!0}return!1};
|
||||
Hd.prototype.Pa=function(){var a=!1;if(this.u){if(this.u.Pa){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.ha/this.aa;b>c&&(a=Math.round(c/b*100)+"%")}this.wa?(this.K.style.width=a,this.K.style.width=a,this.K.style.display="block",this.K.style.margin="auto"):(this.u.style.width=a,this.u.style.height="auto");this.u.style.backgroundColor="black";this.u.Pa();a=!0}this.Ca&&this.Ca.focus()}return a};
|
||||
function Id(a,b){!b&&a.u&&(a.wa?a.K.style.width=a.K.style.height="":a.u.style.width=a.u.style.height="");eb(a,"notifyFullScreen("+b+")",!0)}
|
||||
function Hd(a,b,c,d,e){var f=this;this.wa=wa("Gecko/");var h=["","moz","ms","webkit"];v.call(this,"Video",a,Hd,262144);this.ha=a.screenWidth;this.aa=a.screenHeight;this.qa=a.bufferAddr;this.J=a.bufferCols;this.Y=a.bufferRows;this.ia=a.bufferBits||1;this.qb=a.bufferLeft||0;if(this.C=a.bufferRotate)this.C=this.C%360,0<this.C&&(this.C-=360),-90!=this.C&&(this.na("unsupported buffer rotation: "+this.C),this.C=0);this.Zb=a.interruptRate;this.Ea=a.refreshRate||60;this.L=b;this.H=c;this.Ca=d||b||null;b=
|
||||
a.smoothing;(c=Qa.smoothing)&&(b="true"==c);if(null!=b)for(c=0;c<h.length;c++)if(d=(d=h[c])?d+"ImageSmoothingEnabled":"imageSmoothingEnabled",void 0!==this.H[d]){this.H[d]=b;break}if(this.G=a.screenRotate)this.G=this.G%360,0<this.G&&(this.G-=360),-90!=this.G?(this.na("unsupported screen rotation: "+this.G),this.G=0):(this.H.translate(0,this.aa),this.H.rotate(this.G*Math.PI/180),this.H.scale(this.aa/this.ha,this.ha/this.aa));this.ba=1<<this.ia;this.W=Array(this.ba+2);this.W[0]=[0,0,0,255];this.W[1]=
|
||||
[255,255,255,255];this.W[this.ba+0]=[255,255,0,255];this.W[this.ba+1]=[0,255,0,255];a=this.J;b=this.Y;this.C&&(a=this.Y,b=this.J);this.xa=this.H.createImageData(a,b);this.K=document.createElement("canvas");this.K.width=a;this.K.height=b;this.pb=this.K.getContext("2d");if(this.u=e)if(this.u.Pa=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.u.Pa){for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){Id(f,
|
||||
document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?!0:!1)},!1);break}for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){Id(f,null)},!1);break}}}Va(Hd);
|
||||
Hd.prototype.Ia=function(a,b,c,d){this.w=a;this.B=b;this.b=c;this.F=d;this.oa=(this.J*this.ia>>3)*this.Y;rb(this.B,this.qa,this.oa,3)&&(this.Fa=this.oa>>1,this.Ga=16/this.ia|0,this.sa=!1,void 0===this.fa||this.fa.length!=this.Fa)&&(this.fa=Array(this.Fa));D(this)};Hd.prototype.pa=function(a,b,c){var d=this;switch(b){case "fullScreen":return this.T[b]=c,this.u&&this.u.Pa?c.onclick=function(){d.Pa()}:c.parentNode.removeChild(c),!0}return!1};
|
||||
Hd.prototype.Pa=function(){var a=!1;if(this.u){if(this.u.Pa){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.ha/this.aa;b>c&&(a=Math.round(c/b*100)+"%")}this.wa?(this.L.style.width=a,this.L.style.width=a,this.L.style.display="block",this.L.style.margin="auto"):(this.u.style.width=a,this.u.style.height="auto");this.u.style.backgroundColor="black";this.u.Pa();a=!0}this.Ca&&this.Ca.focus()}return a};
|
||||
function Id(a,b){!b&&a.u&&(a.wa?a.L.style.width=a.L.style.height="":a.u.style.width=a.u.style.height="");eb(a,"notifyFullScreen("+b+")",!0)}
|
||||
Ia(function(){for(var a=C(document,"pc8080","video"),b=0;b<a.length;b++){var c=a[b],d=z(c),e=document.createElement("canvas");if(void 0===e||!e.getContext){c.innerHTML="<br/>Missing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=qa().indexOf("MSIE")&&(c.onresize=function(a,b,c,d){return function(){b.style.height=
|
||||
(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Qa.aspect);f&&.3<=f&&3.33>=f&&(Ga("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");wa("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new Hd(d,e,h,f,c);bb(d,c)}});
|
||||
function Jd(a){v.call(this,"Debugger",a,Jd);this.style=Kd;this.fa=this.Ca=this.L=0;this.Y=T();this.Gb=T();this.G=-1;this.C=[];this.ia=!1;this.ha=T();this.J=[];this.oa={};this.u=this.aa=this.H=[];Ld(this);this.wa=0;Md(this);this.Fa=[];Nd(this,a.messages);this.Ga=a.commands;var b=this;window?void 0===window.$&&(window.$=function(a){return qc(b,a)}):void 0===global.$&&(global.$=function(a){return qc(b,a)})}Va(Jd);
|
||||
|
|
@ -192,8 +192,8 @@ function nf(a,b){var c=a.u;c||(c=ua("user"),void 0!==c?!c&&b&&(c=null,window&&(c
|
|||
function yf(a,b){a.u=null;var c=oa(pa()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(va("user",c.data),a.u=c.data)}catch(e){t(e.message+" ("+d+")")}return a.u}function sf(a){var b=null;a.u&&(b=pa()+"/api/v1/user?req=load&user="+a.u+"&state="+df(a,pf));return b}
|
||||
function xf(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=df(a,pf);d.data=c;b=oa(pa()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.na("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.na(c),va("user",""),a.u=null)}}
|
||||
function nb(a,b,c){a=Ya(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}m.mb=function(){};m.va=function(a){this.b&&this.b.va(a);this.G&&this.G.va(a)};
|
||||
function yc(a,b){for(var c=0;c<a.aa.length;c++)a:{var d=a.aa[c];if(0<=b){if(b&1){d=d.b;d.u=d.u&-8|10;break a}var e=d.b;e.u=e.u&-8|9;if(e=d.sa){for(var e=d.B,f=d.oa,h=!0,g=d.qa>>>e.ea;0<f&&g<e.U.length;)e.U[g].ya&&(e.U[g].ya=h=!1,e.U[g].Lb=!0),f-=e.ua,g++;e=h}if(e)break a}var g=d.qa,l=g+d.oa,k=0,n=0,p=0,e=d.H,x=0,f=d.Y,B=h=0,u=d.ia,la=(1<<u)-1;d.qb&&(u=-u,B=16+u);for(;g<l;){var w=vb(d.B,g);if(d.sa&&w===d.fa[k])n+=d.Ga;else{d.fa[k]=w;var da=B;da&&(w=w>>8|(w&255)<<8);n<e&&(e=n);for(var K=d.Ga;K--;){var M=
|
||||
w>>da&la,P=d.xa,A=n++,X=M,M=void 0,M=d.C?(P.height-A-1)*P.width+p:A+p*P.width;X&&(208<=A&&236>A?X=d.ba+0:28<=A&&72>A&&(X=d.ba+1));A=d.W[X];M*=A.length;P.data[M]=A[0];P.data[M+1]=A[1];P.data[M+2]=A[2];P.data[M+3]=A[3];da+=u}n>x&&(x=n);p<f&&(f=p);p>=h&&(h=p+1)}g+=2;k++;if(n>=d.H&&(n=0,p++,p>d.Y))break}d.sa=!0;e<d.H&&(g=x-e,h-=f,d.C&&(l=e,k=g,e=f,g=h,f=d.H-(l+k),h=k),d.pb.putImageData(d.xa,0,0,e,f,g,h),d.L.drawImage(d.J,0,0,d.J.width,d.J.height,0,0,d.ha,d.aa))}}
|
||||
function yc(a,b){for(var c=0;c<a.aa.length;c++)a:{var d=a.aa[c];if(0<=b){if(b&1){d=d.b;d.u=d.u&-8|10;break a}var e=d.b;e.u=e.u&-8|9;if(e=d.sa){for(var e=d.B,f=d.oa,h=!0,g=d.qa>>>e.ea;0<f&&g<e.U.length;)e.U[g].ya&&(e.U[g].ya=h=!1,e.U[g].Lb=!0),f-=e.ua,g++;e=h}if(e)break a}var g=d.qa,l=g+d.oa,k=0,n=0,p=0,e=d.J,x=0,f=d.Y,B=h=0,u=d.ia,la=(1<<u)-1;d.qb&&(u=-u,B=16+u);for(;g<l;){var w=vb(d.B,g);if(d.sa&&w===d.fa[k])n+=d.Ga;else{d.fa[k]=w;var da=B;da&&(w=w>>8|(w&255)<<8);n<e&&(e=n);for(var K=d.Ga;K--;){var M=
|
||||
w>>da&la,P=d.xa,A=n++,X=M,M=void 0,M=d.C?(P.height-A-1)*P.width+p:A+p*P.width;X&&(208<=A&&236>A?X=d.ba+0:28<=A&&72>A&&(X=d.ba+1));A=d.W[X];M*=A.length;P.data[M]=A[0];P.data[M+1]=A[1];P.data[M+2]=A[2];P.data[M+3]=A[3];da+=u}n>x&&(x=n);p<f&&(f=p);p>=h&&(h=p+1)}g+=2;k++;if(n>=d.J&&(n=0,p++,p>d.Y))break}d.sa=!0;e<d.J&&(g=x-e,h-=f,d.C&&(l=e,k=g,e=f,g=h,f=d.J-(l+k),h=k),d.pb.putImageData(d.xa,0,0,e,f,g,h),d.H.drawImage(d.K,0,0,d.K.width,d.K.height,0,0,d.ha,d.aa))}}
|
||||
Ia(function(){for(var a=C(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=z(c),c=C(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],h=z(f),h=new kf(h,d,!0);bb(h,f);h.ba&&tf(h,h.kb)}});Da.show.push(function(){for(var a=C(document,"pc8080","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Za("Computer",c.id))&&c.sa&&!c.A.ka&&c.kb(-1)}});
|
||||
Da.exit.push(function(){for(var a=C(document,"pc8080","computer"),b=0;b<a.length;b++){var c=z(a[b]);(c=Za("Computer",c.id))&&c.A.ka&&cf(c,!(!c.w||c.L),!0)}});var Mf=0;function Nf(a,b,c,d,e,f){e("Loading "+a+"...");oa(a,null,!0,function(h,g,l){l?(g||(g="unable to load "+a+" ("+l+")"),f(g,null)):Of(g,a,b,c,d,e,f)})}
|
||||
function Of(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){Xa(c,b,a);var g=b;g&&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="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$2"));
|
||||
|
|
|
|||
|
|
@ -84,13 +84,13 @@ function $b(a){if(!Na(a))if(!a.g)B(a);else if(a.b&&a.o){a.c||(a.c=a.b.length);if
|
|||
function ac(a,b){if(Va(a.o,b,a.c,a.l?1:gb)){var c;for(c=0;c<a.b.length;c++)$a(a.o,b+c,a.b[c]);if(a.l&&256==b){for(c=0;c<Zb.length;c++)$a(a.o,Zb[c],118);Fb(a.a,function(a){return function(b){if(0<=Zb.indexOf(b)){var c=!1,h=a.a,g=a.J;if(5==b)switch(c=!0,h.v){case 2:bc(a,String.fromCharCode(h.w));break;case 9:for(var l=G(h),k="",t=255;t--;){var q=a.a.F(l++);if(36==q)break;k+=String.fromCharCode(q)}bc(a,k);break;default:c=!1}c?Rb.call(h):g&&(a.R("\nCP/M vector 0x"+n(b,4)),D(h,b),wb(g));b=!0}else b=!1;
|
||||
return b}}(a));Hb(a.a,b)}return!0}return!1}function bc(a,b){b=b.replace(/\r/g,"");a.Z&&(a.Z.value+=b,a.Z.scrollTop=a.Z.scrollHeight)}wa(function(){for(var a=z(document,"pc8080","rom"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new Xb(d);La(d,c)}});function cc(a){u.call(this,"RAM",a,cc);this.f=a.addr;this.c=a.size;this.b=!1}w(cc);m=cc.prototype;m.da=function(a,b,c,d){this.o=b;this.a=c;this.J=d;B(this)};m.X=function(a,b){b||this.reset();return!0};m.W=function(a){return a?this.save():!0};
|
||||
m.reset=function(){!this.b&&this.c&&Va(this.o,this.f,this.c,1)&&(this.b=!0);this.b||r("No RAM allocated")};m.save=function(){return null};m.restore=function(){return!0};wa(function(){for(var a=z(document,"pc8080","ram"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new cc(d);La(d,c)}});function ec(a){u.call(this,"Keyboard",a,ec);B(this)}w(ec);wa(function(){for(var a=z(document,"pc8080","keyboard"),b=0;b<a.length;b++){var c=a[b],d=y(c),d=new ec(d);La(d,c)}});
|
||||
function fc(a,b,c,d,e){var f=this;this.U=ra("Gecko/");var h=["","moz","webkit","ms"];u.call(this,"Video",a,fc);this.G=a.screenWidth;this.A=a.screenHeight;this.M=a.bufferAddr;this.g=a.bufferCols;this.s=a.bufferRows;this.H=a.bufferBits||1;this.eb=a.bufferLeft||0;if(this.c=a.bufferRotate)this.c=this.c%360,0<this.c&&(this.c-=360),-90!=this.c&&(this.I("unsupported buffer rotation: "+this.c),this.c=0);this.fb=a.interruptRate;this.Y=a.refreshRate||60;this.j=b;this.l=c;this.$=d||b||null;b=a.smoothing;(c=
|
||||
Ba.smoothing)&&(b="true"==c);if(null!=b)for(c=0;c<h.length;c++)d=(d=h[c])?d+"ImageSmoothingEnabled":"imageSmoothingEnabled",this.l[d]=b;if(this.f=a.screenRotate)this.f=this.f%360,0<this.f&&(this.f-=360),-90!=this.f?(this.I("unsupported screen rotation: "+this.f),this.f=0):(this.l.translate(0,this.A),this.l.rotate(this.f*Math.PI/180),this.l.scale(this.A/this.G,this.G/this.A));this.C=1<<this.H;this.m=Array(this.C+2);this.m[0]=[0,0,0,255];this.m[1]=[255,255,255,255];this.m[this.C+0]=[255,255,0,255];
|
||||
this.m[this.C+1]=[0,255,0,255];a=this.g;b=this.s;this.c&&(a=this.s,b=this.g);this.V=this.l.createImageData(a,b);this.i=document.createElement("canvas");this.i.width=a;this.i.height=b;this.Ja=this.i.getContext("2d");if(this.b=e)if(this.b.ha=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.b.ha){for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){gc(f,document.fullscreenElement||document.mozFullScreenElement||
|
||||
document.webkitFullscreenElement||document.msFullscreenElement?!0:!1)},!1);break}for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){gc(f,null)},!1);break}}}w(fc);fc.prototype.da=function(a,b,c,d){this.u=a;this.o=b;this.a=c;this.J=d;this.K=(this.g*this.H>>3)*this.s;Va(this.o,this.M,this.K,3)&&(this.aa=this.K>>1,this.ba=16/this.H|0,this.O=!1,void 0===this.D||this.D.length!=this.aa)&&(this.D=Array(this.aa));B(this)};
|
||||
function fc(a,b,c,d,e){var f=this;this.U=ra("Gecko/");var h=["","moz","ms","webkit"];u.call(this,"Video",a,fc);this.G=a.screenWidth;this.A=a.screenHeight;this.M=a.bufferAddr;this.i=a.bufferCols;this.s=a.bufferRows;this.H=a.bufferBits||1;this.eb=a.bufferLeft||0;if(this.c=a.bufferRotate)this.c=this.c%360,0<this.c&&(this.c-=360),-90!=this.c&&(this.I("unsupported buffer rotation: "+this.c),this.c=0);this.fb=a.interruptRate;this.Y=a.refreshRate||60;this.l=b;this.g=c;this.$=d||b||null;b=a.smoothing;(c=
|
||||
Ba.smoothing)&&(b="true"==c);if(null!=b)for(c=0;c<h.length;c++)if(d=(d=h[c])?d+"ImageSmoothingEnabled":"imageSmoothingEnabled",void 0!==this.g[d]){this.g[d]=b;break}if(this.f=a.screenRotate)this.f=this.f%360,0<this.f&&(this.f-=360),-90!=this.f?(this.I("unsupported screen rotation: "+this.f),this.f=0):(this.g.translate(0,this.A),this.g.rotate(this.f*Math.PI/180),this.g.scale(this.A/this.G,this.G/this.A));this.C=1<<this.H;this.m=Array(this.C+2);this.m[0]=[0,0,0,255];this.m[1]=[255,255,255,255];this.m[this.C+
|
||||
0]=[255,255,0,255];this.m[this.C+1]=[0,255,0,255];a=this.i;b=this.s;this.c&&(a=this.s,b=this.i);this.V=this.g.createImageData(a,b);this.j=document.createElement("canvas");this.j.width=a;this.j.height=b;this.Ja=this.j.getContext("2d");if(this.b=e)if(this.b.ha=e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullscreen,this.b.ha){for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenchange","on"+d in document){document.addEventListener(d,function(){gc(f,document.fullscreenElement||
|
||||
document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?!0:!1)},!1);break}for(c=0;c<h.length;c++)if(d=h[c]+"fullscreenerror","on"+d in document){document.addEventListener(d,function(){gc(f,null)},!1);break}}}w(fc);fc.prototype.da=function(a,b,c,d){this.u=a;this.o=b;this.a=c;this.J=d;this.K=(this.i*this.H>>3)*this.s;Va(this.o,this.M,this.K,3)&&(this.aa=this.K>>1,this.ba=16/this.H|0,this.O=!1,void 0===this.D||this.D.length!=this.aa)&&(this.D=Array(this.aa));B(this)};
|
||||
fc.prototype.P=function(a,b,c){var d=this;switch(b){case "fullScreen":return this.B[b]=c,this.b&&this.b.ha?c.onclick=function(){d.ha()}:c.parentNode.removeChild(c),!0}return!1};
|
||||
fc.prototype.ha=function(){var a=!1;if(this.b){if(this.b.ha){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.G/this.A;b>c&&(a=Math.round(c/b*100)+"%")}this.U?(this.j.style.width=a,this.j.style.width=a,this.j.style.display="block",this.j.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.ha();a=!0}this.$&&this.$.focus()}return a};
|
||||
function gc(a,b){!b&&a.b&&(a.U?a.j.style.width=a.j.style.height="":a.b.style.width=a.b.style.height="")}
|
||||
fc.prototype.ha=function(){var a=!1;if(this.b){if(this.b.ha){a="100%";if(screen&&screen.width&&screen.height){var b=screen.width/screen.height,c=this.G/this.A;b>c&&(a=Math.round(c/b*100)+"%")}this.U?(this.l.style.width=a,this.l.style.width=a,this.l.style.display="block",this.l.style.margin="auto"):(this.b.style.width=a,this.b.style.height="auto");this.b.style.backgroundColor="black";this.b.ha();a=!0}this.$&&this.$.focus()}return a};
|
||||
function gc(a,b){!b&&a.b&&(a.U?a.l.style.width=a.l.style.height="":a.b.style.width=a.b.style.height="")}
|
||||
wa(function(){for(var a=z(document,"pc8080","video"),b=0;b<a.length;b++){var c=a[b],d=y(c),e=document.createElement("canvas");if(void 0===e||!e.getContext){c.innerHTML="<br/>Missing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","pcjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.style.backgroundColor=d.screenColor;e.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(c.onresize=function(a,
|
||||
b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,e,d.screenWidth,d.screenHeight),c.onresize());var f=+(d.aspect||Ba.aspect);f&&.3<=f&&3.33>=f&&(va("onresize",function(a,b,c){return function(){b.style.height=(a.clientWidth/c|0)+"px"}}(c,e,f)),window.onresize());c.appendChild(e);f=document.createElement("textarea");ra("iOS")&&(f.setAttribute("autocapitalize","off"),f.setAttribute("autocorrect","off"));c.appendChild(f);var h=e.getContext("2d"),d=new fc(d,e,h,f,c);La(d,c)}});
|
||||
function E(a,b,c){this.id=a.id;this.key=hc(a,b,c);this.J=a.J;ic(this,a.$a)}function hc(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}
|
||||
|
|
@ -115,9 +115,9 @@ function qc(a,b){var c=a.c;c||(c=pa("user"),void 0!==c?!c&&b&&(c=null,window&&(c
|
|||
function Bc(a,b){a.c=null;var c=p(la()+"/api/v1/user?req=verify&user="+b),d=c[1];if(!c[0]&&d)try{c=eval("("+d+")"),c.code&&"ok"==c.code&&(qa("user",c.data),a.c=c.data)}catch(e){r(e.message+" ("+d+")")}return a.c}function uc(a){var b=null;a.c&&(b=la()+"/api/v1/user?req=load&user="+a.c+"&state="+hc(a,Z));return b}
|
||||
function Ac(a,b,c){if(c){var d={req:"store"};d.user=b;d.state=hc(a,Z);d.data=c;b=p(la()+"/api/v1/user",d);d=b[0];if(b[1]){if(d){var e=d.indexOf("\n");0<e&&(d=d.substr(0,e));d.indexOf("Error: ")||(d=d.substr(7))}d='{"code":'+b[1]+',"data":"'+d+'"}'}b=JSON.parse(d);b&&"ok"==b.code?a.I("Machine state saved to server"):c&&(c=b&&b.data||"unable to save machine state",c="error"==b.code?"Error: "+c:"Error "+b.code+": "+c,a.I(c),qa("user",""),a.c=null)}}
|
||||
function Ra(a,b,c){a=x(a.id);for(var d=0;d<a.length;d++){var e=a[d];if(c)c==e&&(c=null);else if(e.type==b)return e}return null}m.ga=function(a){this.a&&this.a.ga(a);this.g&&this.g.ga(a)};
|
||||
function Bb(a,b){for(var c=0;c<a.A.length;c++)a:{var d=a.A[c];if(0<=b){if(b&1){d=d.a;d.D=d.D&-8|10;break a}var e=d.a;e.D=e.D&-8|9;if(e=d.O){for(var e=d.o,f=d.K,h=!0,g=d.M>>>e.c;0<f&&g<e.b.length;)e.b[g].S&&(e.b[g].S=h=!1,e.b[g].Ta=!0),f-=e.f,g++;e=h}if(e)break a}var g=d.M,l=g+d.K,k=0,t=0,q=0,e=d.g,ja=0,f=d.s,dc=h=0,Ia=d.H,Hc=(1<<Ia)-1;d.eb&&(Ia=-Ia,dc=16+Ia);for(;g<l;){var A;A=d.o;var aa=g,Ja=aa&A.g,L=(aa&A.i)>>>A.c;A=Ja!=A.g?A.b[L].ab(Ja,aa):A.b[L++].Oa(Ja,aa)|A.b[L&A.u].Oa(0,aa+1)<<8;if(d.O&&A===
|
||||
d.D[k])t+=d.ba;else{d.D[k]=A;(aa=dc)&&(A=A>>8|(A&255)<<8);t<e&&(e=t);for(Ja=d.ba;Ja--;){var ba=A>>aa&Hc,L=d.V,I=t++,Ya=ba,ba=void 0,ba=d.c?(L.height-I-1)*L.width+q:I+q*L.width;Ya&&(208<=I&&236>I?Ya=d.C+0:28<=I&&72>I&&(Ya=d.C+1));I=d.m[Ya];ba*=I.length;L.data[ba]=I[0];L.data[ba+1]=I[1];L.data[ba+2]=I[2];L.data[ba+3]=I[3];aa+=Ia}t>ja&&(ja=t);q<f&&(f=q);q>=h&&(h=q+1)}g+=2;k++;if(t>=d.g&&(t=0,q++,q>d.s))break}d.O=!0;e<d.g&&(g=ja-e,h-=f,d.c&&(l=e,k=g,e=f,g=h,f=d.g-(l+k),h=k),d.Ja.putImageData(d.V,0,0,
|
||||
e,f,g,h),d.l.drawImage(d.i,0,0,d.i.width,d.i.height,0,0,d.G,d.A))}}wa(function(){for(var a=z(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=y(c),c=z(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],h=y(f),h=new nc(h,d,!0);La(h,f);h.C&&vc(h,h.wa)}});sa.show.push(function(){for(var a=z(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ka("Computer",c.id))&&c.O&&!c.h.L&&c.wa(-1)}});
|
||||
function Bb(a,b){for(var c=0;c<a.A.length;c++)a:{var d=a.A[c];if(0<=b){if(b&1){d=d.a;d.D=d.D&-8|10;break a}var e=d.a;e.D=e.D&-8|9;if(e=d.O){for(var e=d.o,f=d.K,h=!0,g=d.M>>>e.c;0<f&&g<e.b.length;)e.b[g].S&&(e.b[g].S=h=!1,e.b[g].Ta=!0),f-=e.f,g++;e=h}if(e)break a}var g=d.M,l=g+d.K,k=0,t=0,q=0,e=d.i,ja=0,f=d.s,dc=h=0,Ia=d.H,Hc=(1<<Ia)-1;d.eb&&(Ia=-Ia,dc=16+Ia);for(;g<l;){var A;A=d.o;var aa=g,Ja=aa&A.g,L=(aa&A.i)>>>A.c;A=Ja!=A.g?A.b[L].ab(Ja,aa):A.b[L++].Oa(Ja,aa)|A.b[L&A.u].Oa(0,aa+1)<<8;if(d.O&&A===
|
||||
d.D[k])t+=d.ba;else{d.D[k]=A;(aa=dc)&&(A=A>>8|(A&255)<<8);t<e&&(e=t);for(Ja=d.ba;Ja--;){var ba=A>>aa&Hc,L=d.V,I=t++,Ya=ba,ba=void 0,ba=d.c?(L.height-I-1)*L.width+q:I+q*L.width;Ya&&(208<=I&&236>I?Ya=d.C+0:28<=I&&72>I&&(Ya=d.C+1));I=d.m[Ya];ba*=I.length;L.data[ba]=I[0];L.data[ba+1]=I[1];L.data[ba+2]=I[2];L.data[ba+3]=I[3];aa+=Ia}t>ja&&(ja=t);q<f&&(f=q);q>=h&&(h=q+1)}g+=2;k++;if(t>=d.i&&(t=0,q++,q>d.s))break}d.O=!0;e<d.i&&(g=ja-e,h-=f,d.c&&(l=e,k=g,e=f,g=h,f=d.i-(l+k),h=k),d.Ja.putImageData(d.V,0,0,
|
||||
e,f,g,h),d.g.drawImage(d.j,0,0,d.j.width,d.j.height,0,0,d.G,d.A))}}wa(function(){for(var a=z(document,"pc8080-machine"),b=0;b<a.length;b++)for(var c=a[b],d=y(c),c=z(c,"pc8080","computer"),e=0;e<c.length;e++){var f=c[e],h=y(f),h=new nc(h,d,!0);La(h,f);h.C&&vc(h,h.wa)}});sa.show.push(function(){for(var a=z(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ka("Computer",c.id))&&c.O&&!c.h.L&&c.wa(-1)}});
|
||||
sa.exit.push(function(){for(var a=z(document,"pc8080","computer"),b=0;b<a.length;b++){var c=y(a[b]);(c=Ka("Computer",c.id))&&c.h.L&&zc(c,!(!c.b||c.m),!0)}});var Cc=0;function Dc(a,b,c,d,e,f){e("Loading "+a+"...");p(a,null,!0,function(h,g,l){l?(g||(g="unable to load "+a+" ("+l+")"),f(g,null)):Ec(g,a,b,c,d,e,f)})}
|
||||
function Ec(a,b,c,d,e,f,h){function g(a,f){if(f)h(f,null);else{if(c){Ha(c,b,a);var g=b;g&&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="APPCLASS">).*?(<\/xsl:variable>)/,"$1pc8080$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(q){g=null,a=q.message}else a="unrecognized XML: "+(255<a.length?a.substr(0,255)+"...":a);h(a,g)}}a?e?Fc(a,f,g):g(a,null):h("no data"+(b?" for file: "+b:""),null)}
|
||||
|
|
|
|||
Loading…
Reference in a new issue