Added some polyfills for old browsers

This commit is contained in:
Jeff 2016-10-01 14:37:02 -07:00 committed by Jeff Parsons
commit 07ee5497bc
11 changed files with 69 additions and 13 deletions

View file

@ -21,6 +21,8 @@ function D(a,b,c){c&&(b+="-"+c+"-object");if(a.getElementsByClassName)return a.g
z.prototype={constructor:z,parent:null,toString:function(){return this.name?this.name:this.id||this.type},pa:function(a,b,c){switch(b){case "clear":return this.N[b]||(this.N[b]=c,c.onclick=function(a){return function(){a.N.print&&(a.N.print.value="")}}(this)),!0;case "print":return this.N[b]||(this.Ga=this.N[b]=c,c.value="",this.g=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.ka=function(a){this.g(a,this.cb)}),!0;default:return!1}},log:function(){},g:function(){},status:function(a){this.g(this.cb+": "+a)},ka:function(a,b,c){Pa(a,b,c||this.type)},Ea:function(){return this.C.xa=!0},Ia:function(a,b){b&&(this.C.xa=!1);return!0}};function E(a,b,c,d,e,f,g){a.H&&(!0===g?g=0:null==g&&(g=a.ta),gb(a.H,a,b,c,d,e,f,g))}function hb(a,b){a.H&&ib(a,0)&&a.H.message(b,void 0)}function ib(a,b){if(a.H){a===a.H?b|=0:b=b||a.ta;var c=a.H.ta&b;return!!b&&c===b||!!(c&a.H.Id)}return!1}
function jb(a,b){if(a.C.Kb)return a.C.sb=!1,a.C.Kb=!1;if(a.C.error)return a.g(a.toString()+" error"),!1;a.C.sb=b;return a.C.sb}function kb(a,b){a.C.sb&&(b?a.C.Kb=!0:void 0===b&&a.g(a.toString()+" busy"));return a.C.sb}function F(a){if(!a.C.error&&(a.C.ready=!0,a.C.ready)){var b=a.Eb;a.Eb=null;b&&b()}}function nb(a,b){b&&(a.C.ready?b():a.Eb=b);return a.C.ready}function ob(a,b){a.C.error=!0;a.ka(b)}
Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
var pb="undefined"!==typeof ArrayBuffer,qb=[1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,
0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1],rb={cpu:1,bus:64,mem:128,port:256,nvr:16384,chipset:32768,keyboard:65536,key:131072,video:262144,fdc:524288,disk:2097152,serial:8388608,speaker:33554432,computer:67108864,log:268435456,warn:536870912,buffer:1073741824,halt:-2147483648};function sb(a){z.call(this,"Panel",a,sb)}A(sb);l=sb.prototype;
l.pa=function(a,b,c,d){return this.B&&this.B.pa(a,b,c,d)||this.b&&this.b.pa(a,b,c,d)||this.J&&this.J.pa(a,b,c,d)||this.H&&this.H.pa(a,b,c,d)?!0:this.parent.pa.call(this,a,b,c,d)};l.Pa=function(a,b,c,d){this.B=a;this.u=b;this.b=c;this.H=d;this.J=tb(a,"Keyboard")};l.Ea=function(a,b){b||ub();return!0};l.Ia=function(){return!0};l.Ja=function(){};function ub(){for(var a=!1,b=D(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=B(d),f=db(e.id);f||(a=!0,f=new sb(e));fb(f,d);a&&F(f)}}Na(ub);

View file

@ -18,7 +18,8 @@ function z(a){var b=null;if(a=a.getAttribute("data-value"))try{b=eval("("+a+")")
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}
r.prototype={constructor:r,parent:null,toString:function(){return this.name?this.name:this.id||this.type},V:function(a,b,c){switch(b){case "clear":return this.A[b]||(this.A[b]=c,c.onclick=function(a){return function(){a.A.print&&(a.A.print.value="")}}(this)),!0;case "print":return this.A[b]||(this.va=this.A[b]=c,c.value="",this.da=function(a){return function(b,c){8192<a.value.length&&(a.value=a.value.substr(a.value.length-4096));a.value+=(void 0!==c?c+": ":"")+(b||"")+"\n";a.scrollTop=a.scrollHeight}}(c),
this.M=function(a){this.da(a,this.Sa)}),!0;default:return!1}},log:function(){},da:function(){},status:function(a){this.da(this.Sa+": "+a)},M:function(a,b,c){Aa(a,b,c||this.type)},ga:function(){return this.l.Y=!0},ia:function(a,b){b&&(this.l.Y=!1);return!0}};function Qa(a,b){if(a.l.eb)return a.l.Wa=!1,a.l.eb=!1;if(a.l.error)return a.da(a.toString()+" error"),!1;a.l.Wa=b;return a.l.Wa}function B(a){if(!a.l.error&&(a.l.ready=!0,a.l.ready)){var b=a.Za;a.Za=null;b&&b()}}
function Ra(a,b){b&&(a.l.ready?b():a.Za=b);return a.l.ready}
function Ra(a,b){b&&(a.l.ready?b():a.Za=b);return a.l.ready}Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return e.apply(this instanceof c&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))}function c(){}if("function"!=typeof this)throw new TypeError("Function.prototype.bind: non-callable object");var d=Array.prototype.slice.call(arguments,1),e=this;c.prototype=this.prototype;b.prototype=new c;return b});
var Sa="undefined"!==typeof ArrayBuffer,Ta=[1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,
0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1];function Ua(a){r.call(this,"Panel",a,Ua)}w(Ua);k=Ua.prototype;k.V=function(a,b,c,d){return this.v&&this.v.V(a,b,c,d)||this.a&&this.a.V(a,b,c,d)||this.m&&this.m.V(a,b,c,d)?!0:this.parent.V.call(this,a,b,c,d)};k.qa=function(a,b,c,d){this.v=a;this.j=b;this.a=c;this.N=d;this.m=Va(a,"Keyboard")};k.ga=function(a,b){b||Wa();return!0};k.ia=function(){return!0};k.Aa=function(){};
function Wa(){for(var a=!1,b=A(document,"pc8080","panel"),c=0;c<b.length;c++){var d=b[c],e=z(d),f=Na(e.id);f||(a=!0,f=new Ua(e));Pa(f,d);a&&B(f)}}ya(Wa);