1 | // Input 0
|
---|
2 | var p=void 0,t=!0,u=null,x=!1;function A(){return function(){}}var C;
|
---|
3 | window.overlayTerminal=function(a){a=a?a.split("&"):location.search.substr(1).split("&");if(0!=a.length){for(var b={},c=0;c<a.length;c++){var d=a[c].indexOf("=");0>d&&(b[a[c]]=1);0<d&&(b[a[c].substring(0,d)]=a[c].substring(d+1))}b.name||(b.name=a[0]);b.title||(b.title=a[0].length?u:"");b.autostart||(b.autostart=1E3);b.warp||(b.warp=1);b.scan||(b.scan=x);b.noskip||(b.noskip=x);a[0].length?(!b.font&&!b.fontsize&&(b.fontsize=13),!b.fontfamily&&!b.font&&(b.font="fixed-8x13",b.boldfont="fixed-8x13B"),
|
---|
4 | 0==b.fontsize&&(b.fontsize=u)):!b.fontfamily&&!b.font&&(b.font="c64",b.fontfamily="c64");b.controls=b.controls?parseInt(b.controls,10):a[0].length;new aa(b);return x}};window.startDemo=function(){var a={debug:x,scan:x,autostart:1E3,warp:1,font:"c64",title:"",loop:1E3,controls:0,onclose:function(){a.loop=0}},b=document.getElementById("frame"),c=new ba(a);b.appendChild(c);return x};
|
---|
5 | // Input 1
|
---|
6 | var D=D||function(a,b){function c(){}var d={},e=d.ha={},f=e.bb={extend:function(a){c.prototype=this;var b=new c;a&&b.Ua(a);b.hasOwnProperty("init")||(b.I=function(){b.Xb.I.apply(this,arguments)});b.I.prototype=b;b.Xb=this;return b},create:function(){var a=this.extend();a.I.apply(a,arguments);return a},I:A(),Ua:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},X:function(){return this.I.prototype.extend(this)}},i=e.ra=f.extend({I:function(a,
|
---|
7 | c){a=this.G=a||[];this.D=c!=b?c:4*a.length},toString:function(a){return(a||h).stringify(this)},concat:function(a){var b=this.G,c=a.G,d=this.D,a=a.D;this.tb();if(d%4)for(var e=0;e<a;e++)b[d+e>>>2]|=(c[e>>>2]>>>24-8*(e%4)&255)<<24-8*((d+e)%4);else if(65535<c.length)for(e=0;e<a;e+=4)b[d+e>>>2]=c[e>>>2];else b.push.apply(b,c);this.D+=a;return this},tb:function(){var b=this.G,c=this.D;b[c>>>2]&=4294967295<<32-8*(c%4);b.length=a.ceil(c/4)},X:function(){var a=f.X.call(this);a.G=this.G.slice(0);return a},
|
---|
8 | random:function(b){for(var c=[],d=0;d<b;d+=4)c.push(4294967296*a.random()|0);return new i.I(c,b)}}),g=d.la={},h=g.Kc={stringify:function(a){for(var b=a.G,a=a.D,c=[],d=0;d<a;d++){var e=b[d>>>2]>>>24-8*(d%4)&255;c.push((e>>>4).toString(16));c.push((e&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return new i.I(c,b/2)}},o=g.fb={stringify:function(a){for(var b=a.G,a=a.D,c=[],d=0;d<a;d++)c.push(String.fromCharCode(b[d>>>
|
---|
9 | 2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return new i.I(c,b)}},q=g.Qc={stringify:function(a){try{return decodeURIComponent(escape(o.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return o.parse(unescape(encodeURIComponent(a)))}},s=e.Zb=f.extend({reset:function(){this.ca=new i.I;this.Ka=0},sa:function(a){"string"==typeof a&&(a=q.parse(a));this.ca.concat(a);this.Ka+=a.D},
|
---|
10 | da:function(b){var c=this.ca,d=c.G,e=c.D,f=this.W,h=e/(4*f),h=b?a.ceil(h):a.max((h|0)-this.mb,0),b=h*f,e=a.min(4*b,e);if(b){for(var q=0;q<b;q+=f)this.jb(d,q);q=d.splice(0,b);c.D-=e}return new i.I(q,e)},X:function(){var a=f.X.call(this);a.ca=this.ca.X();return a},mb:0});e.cc=s.extend({F:f.extend(),I:function(a){this.F=this.F.extend(a);this.reset()},reset:function(){s.reset.call(this);this.Ja()},update:function(a){this.sa(a);this.da();return this},Z:function(a){a&&this.sa(a);return this.ta()},W:16,
|
---|
11 | Ia:function(a){return function(b,c){return(new a.I(c)).Z(b)}},fc:function(a){return function(b,c){return(new n.Jc.I(a,c)).Z(b)}}});var n=d.va={};return d}(Math);
|
---|
12 | (function(){var a=D.ha.ra;D.la.cb={stringify:function(a){var c=a.G,d=a.D,e=this.lb;a.tb();for(var a=[],f=0;f<d;f+=3)for(var i=(c[f>>>2]>>>24-8*(f%4)&255)<<16|(c[f+1>>>2]>>>24-8*((f+1)%4)&255)<<8|c[f+2>>>2]>>>24-8*((f+2)%4)&255,g=0;4>g&&f+0.75*g<d;g++)a.push(e.charAt(i>>>6*(3-g)&63));if(c=e.charAt(64))for(;a.length%4;)a.push(c);return a.join("")},parse:function(b){var c=b.length,d=this.lb,e=d.charAt(64);e&&(e=b.indexOf(e),-1!=e&&(c=e));for(var e=[],f=0,i=0;i<c;i++)i%4&&(e[f>>>2]|=(d.indexOf(b.charAt(i-
|
---|
13 | 1))<<2*(i%4)|d.indexOf(b.charAt(i))>>>6-2*(i%4))<<24-8*(f%4),f++);return a.create(e,f)},lb:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
|
---|
14 | (function(a){function b(a,b,c,d,e,r,f){a=a+(b&c|~b&d)+e+f;return(a<<r|a>>>32-r)+b}function c(a,b,c,d,e,r,f){a=a+(b&d|c&~d)+e+f;return(a<<r|a>>>32-r)+b}function d(a,b,c,d,e,r,f){a=a+(b^c^d)+e+f;return(a<<r|a>>>32-r)+b}function e(a,b,c,d,e,r,f){a=a+(c^(b|~d))+e+f;return(a<<r|a>>>32-r)+b}for(var f=D.ha,i=f.ra,g=f.cc,f=D.va,h=[],o=0;64>o;o++)h[o]=4294967296*a.abs(a.sin(o+1))|0;f=f.gb=g.extend({Ja:function(){this.ua=new i.I([1732584193,4023233417,2562383102,271733878])},jb:function(a,f){for(var n=0;16>
|
---|
15 | n;n++){var g=f+n,i=a[g];a[g]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}var n=this.ua.G,g=a[f+0],i=a[f+1],r=a[f+2],w=a[f+3],o=a[f+4],H=a[f+5],K=a[f+6],y=a[f+7],M=a[f+8],O=a[f+9],Q=a[f+10],V=a[f+11],B=a[f+12],Z=a[f+13],da=a[f+14],ea=a[f+15],l=n[0],m=n[1],j=n[2],k=n[3],l=b(l,m,j,k,g,7,h[0]),k=b(k,l,m,j,i,12,h[1]),j=b(j,k,l,m,r,17,h[2]),m=b(m,j,k,l,w,22,h[3]),l=b(l,m,j,k,o,7,h[4]),k=b(k,l,m,j,H,12,h[5]),j=b(j,k,l,m,K,17,h[6]),m=b(m,j,k,l,y,22,h[7]),l=b(l,m,j,k,M,7,h[8]),k=b(k,l,m,j,O,12,h[9]),j=
|
---|
16 | b(j,k,l,m,Q,17,h[10]),m=b(m,j,k,l,V,22,h[11]),l=b(l,m,j,k,B,7,h[12]),k=b(k,l,m,j,Z,12,h[13]),j=b(j,k,l,m,da,17,h[14]),m=b(m,j,k,l,ea,22,h[15]),l=c(l,m,j,k,i,5,h[16]),k=c(k,l,m,j,K,9,h[17]),j=c(j,k,l,m,V,14,h[18]),m=c(m,j,k,l,g,20,h[19]),l=c(l,m,j,k,H,5,h[20]),k=c(k,l,m,j,Q,9,h[21]),j=c(j,k,l,m,ea,14,h[22]),m=c(m,j,k,l,o,20,h[23]),l=c(l,m,j,k,O,5,h[24]),k=c(k,l,m,j,da,9,h[25]),j=c(j,k,l,m,w,14,h[26]),m=c(m,j,k,l,M,20,h[27]),l=c(l,m,j,k,Z,5,h[28]),k=c(k,l,m,j,r,9,h[29]),j=c(j,k,l,m,y,14,h[30]),m=c(m,
|
---|
17 | j,k,l,B,20,h[31]),l=d(l,m,j,k,H,4,h[32]),k=d(k,l,m,j,M,11,h[33]),j=d(j,k,l,m,V,16,h[34]),m=d(m,j,k,l,da,23,h[35]),l=d(l,m,j,k,i,4,h[36]),k=d(k,l,m,j,o,11,h[37]),j=d(j,k,l,m,y,16,h[38]),m=d(m,j,k,l,Q,23,h[39]),l=d(l,m,j,k,Z,4,h[40]),k=d(k,l,m,j,g,11,h[41]),j=d(j,k,l,m,w,16,h[42]),m=d(m,j,k,l,K,23,h[43]),l=d(l,m,j,k,O,4,h[44]),k=d(k,l,m,j,B,11,h[45]),j=d(j,k,l,m,ea,16,h[46]),m=d(m,j,k,l,r,23,h[47]),l=e(l,m,j,k,g,6,h[48]),k=e(k,l,m,j,y,10,h[49]),j=e(j,k,l,m,da,15,h[50]),m=e(m,j,k,l,H,21,h[51]),l=e(l,
|
---|
18 | m,j,k,B,6,h[52]),k=e(k,l,m,j,w,10,h[53]),j=e(j,k,l,m,Q,15,h[54]),m=e(m,j,k,l,i,21,h[55]),l=e(l,m,j,k,M,6,h[56]),k=e(k,l,m,j,ea,10,h[57]),j=e(j,k,l,m,K,15,h[58]),m=e(m,j,k,l,Z,21,h[59]),l=e(l,m,j,k,o,6,h[60]),k=e(k,l,m,j,V,10,h[61]),j=e(j,k,l,m,r,15,h[62]),m=e(m,j,k,l,O,21,h[63]);n[0]=n[0]+l|0;n[1]=n[1]+m|0;n[2]=n[2]+j|0;n[3]=n[3]+k|0},ta:function(){var b=this.ca,c=b.G,d=8*this.Ka,e=8*b.D;c[e>>>5]|=128<<24-e%32;var f=a.floor(d/4294967296);c[(e+64>>>9<<4)+15]=(f<<8|f>>>24)&16711935|(f<<24|f>>>8)&4278255360;
|
---|
19 | c[(e+64>>>9<<4)+14]=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360;b.D=4*(c.length+1);this.da();b=this.ua;c=b.G;for(d=0;4>d;d++)e=c[d],c[d]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360;return b},X:function(){var a=g.X.call(this);a.ua=this.ua.X();return a}});D.gb=g.Ia(f);D.Lc=g.fc(f)})(Math);
|
---|
20 | (function(){var a=D.ha,b=a.bb,c=a.ra,a=D.va,d=a.eb=b.extend({F:b.extend({ga:4,uc:a.gb,wc:1}),I:function(a){this.F=this.F.extend(a)},ub:function(a,b){for(var d=this.F,g=d.uc.create(),h=c.create(),o=h.G,q=d.ga,d=d.wc;o.length<q;){s&&g.update(s);var s=g.update(a).Z(b);g.reset();for(var n=1;n<d;n++)s=g.Z(s),g.reset();h.concat(s)}h.D=4*q;return h}});D.eb=function(a,b,c){return d.create(c).ub(a,b)}})();
|
---|
21 | D.ha.$b||function(a){function b(b,c,d){var e=this.kb;e?this.kb=a:e=this.ob;for(var f=0;f<d;f++)b[c+f]^=e[f]}var c=D,d=c.ha,e=d.bb,f=d.ra,i=d.Zb,g=c.la.cb,h=c.va.eb,o=d.$b=i.extend({F:e.extend(),Qa:function(a,b){return this.create(this.Ha,a,b)},Pa:function(a,b){return this.create(this.ec,a,b)},I:function(a,b,c){this.F=this.F.extend(c);this.pb=a;this.hc=b;this.reset()},reset:function(){i.reset.call(this);this.Ja()},ad:function(a){this.sa(a);return this.da()},Z:function(a){a&&this.sa(a);return this.ta()},
|
---|
22 | ga:4,Hb:4,Ha:1,ec:2,Ia:function(a){return{za:function(b,c,d){return("string"==typeof c?z:v).za(a,b,c,d)},ka:function(b,c,d){return("string"==typeof c?z:v).ka(a,b,c,d)}}}});d.Pc=o.extend({ta:function(){return this.da(t)},W:1});var q=c.mode={},s=(d.Gc=e.extend({Qa:function(a,b){return this.bc.create(a,b)},Pa:function(a,b){return this.ac.create(a,b)},I:function(a,b){this.hb=a;this.kb=b}})).extend();s.bc=s.extend({Ub:function(a,c){var d=this.hb,e=d.W;b.call(this,a,c,e);d.qc(a,c);this.ob=a.slice(c,c+e)}});
|
---|
23 | s.ac=s.extend({Ub:function(a,c){var d=this.hb,e=d.W,f=a.slice(c,c+e);d.pc(a,c);b.call(this,a,c,e);this.ob=f}});q=q.Hc=s;s=(c.Sb={}).Nc={Sb:function(a,b){for(var c=4*b,c=c-a.D%c,d=c<<24|c<<16|c<<8|c,e=[],h=0;h<c;h+=4)e.push(d);c=f.create(e,c);a.concat(c)},Ec:function(a){a.D-=a.G[a.D-1>>>2]&255}};d.Yb=o.extend({F:o.F.extend({mode:q,padding:s}),reset:function(){o.reset.call(this);var a=this.F,b=a.$,a=a.mode;if(this.pb==this.Ha)var c=a.Qa;else c=a.Pa,this.mb=1;this.jc=c.call(a,this,b&&b.G)},jb:function(a,
|
---|
24 | b){this.jc.Ub(a,b)},ta:function(){var a=this.F.padding;if(this.pb==this.Ha){a.Sb(this.ca,this.W);var b=this.da(t)}else b=this.da(t),a.Ec(b);return b},W:4});var n=d.Ic=e.extend({I:function(a){this.Ua(a)},toString:function(a){return(a||this.sc).stringify(this)}}),q=(c.Aa={}).dc={stringify:function(a){var b=a.Na,a=a.Ya;return(a?f.create([1398893684,1701076831]).concat(a).concat(b):b).toString(g)},parse:function(a){var a=g.parse(a),b=a.G;if(1398893684==b[0]&&1701076831==b[1]){var c=f.create(b.slice(2,
|
---|
25 | 4));b.splice(0,4);a.D-=16}return n.create({Na:a,Ya:c})}},v=d.Oc=e.extend({F:e.extend({Aa:q}),za:function(a,b,c,d){var d=this.F.extend(d),e=a.Qa(c,d),b=e.Z(b),e=e.F;return n.create({Na:b,key:c,$:e.$,Rc:a,mode:e.mode,padding:e.padding,W:a.W,sc:d.Aa})},ka:function(a,b,c,d){d=this.F.extend(d);b=this.nb(b,d.Aa);return a.Pa(c,d).Z(b.Na)},nb:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),c=(c.Ta={}).dc={execute:function(a,b,c,d){d||(d=f.random(8));a=h.create({ga:b+c}).ub(a,d);c=f.create(a.G.slice(b),
|
---|
26 | 4*c);a.D=4*b;return n.create({key:a,$:c,Ya:d})}},z=d.Mc=v.extend({F:v.F.extend({Ta:c}),za:function(a,b,c,d){d=this.F.extend(d);c=d.Ta.execute(c,a.ga,a.Hb);d.$=c.$;a=v.za.call(this,a,b,c.key,d);a.Ua(c);return a},ka:function(a,b,c,d){d=this.F.extend(d);b=this.nb(b,d.Aa);c=d.Ta.execute(c,a.ga,a.Hb,b.Ya);d.$=c.$;return v.ka.call(this,a,b,c.key,d)}})}();
|
---|
27 | (function(){for(var a=D.ha.Yb,b=D.va,c=[],d=[],e=[],f=[],i=[],g=[],h=[],o=[],q=[],s=[],n=[],v=0;256>v;v++)n[v]=128>v?v<<1:v<<1^283;for(var z=0,r=0,v=0;256>v;v++){var w=r^r<<1^r<<2^r<<3^r<<4,w=w>>>8^w&255^99;c[z]=w;d[w]=z;var E=n[z],H=n[E],K=n[H],y=257*n[w]^16843008*w;e[z]=y<<24|y>>>8;f[z]=y<<16|y>>>16;i[z]=y<<8|y>>>24;g[z]=y;y=16843009*K^65537*H^257*E^16843008*z;h[w]=y<<24|y>>>8;o[w]=y<<16|y>>>16;q[w]=y<<8|y>>>24;s[w]=y;z?(z=E^n[n[n[K^E]]],r^=n[n[r]]):z=r=1}var M=[0,1,2,4,8,16,32,64,128,27,54],b=
|
---|
28 | b.ab=a.extend({Ja:function(){for(var a=this.hc,b=a.G,d=a.D/4,a=4*((this.kc=d+6)+1),e=this.ic=[],f=0;f<a;f++)if(f<d)e[f]=b[f];else{var g=e[f-1];f%d?6<d&&4==f%d&&(g=c[g>>>24]<<24|c[g>>>16&255]<<16|c[g>>>8&255]<<8|c[g&255]):(g=g<<8|g>>>24,g=c[g>>>24]<<24|c[g>>>16&255]<<16|c[g>>>8&255]<<8|c[g&255],g^=M[f/d|0]<<24);e[f]=e[f-d]^g}b=this.gc=[];for(d=0;d<a;d++)f=a-d,g=d%4?e[f]:e[f-4],b[d]=4>d||4>=f?g:h[c[g>>>24]]^o[c[g>>>16&255]]^q[c[g>>>8&255]]^s[c[g&255]]},qc:function(a,b){this.ib(a,b,this.ic,e,f,i,g,c)},
|
---|
29 | pc:function(a,b){var c=a[b+1];a[b+1]=a[b+3];a[b+3]=c;this.ib(a,b,this.gc,h,o,q,s,d);c=a[b+1];a[b+1]=a[b+3];a[b+3]=c},ib:function(a,b,c,d,e,f,h,g){for(var i=this.kc,j=a[b]^c[0],k=a[b+1]^c[1],o=a[b+2]^c[2],n=a[b+3]^c[3],q=4,r=1;r<i;r++)var s=d[j>>>24]^e[k>>>16&255]^f[o>>>8&255]^h[n&255]^c[q++],v=d[k>>>24]^e[o>>>16&255]^f[n>>>8&255]^h[j&255]^c[q++],w=d[o>>>24]^e[n>>>16&255]^f[j>>>8&255]^h[k&255]^c[q++],n=d[n>>>24]^e[j>>>16&255]^f[k>>>8&255]^h[o&255]^c[q++],j=s,k=v,o=w;s=(g[j>>>24]<<24|g[k>>>16&255]<<
|
---|
30 | 16|g[o>>>8&255]<<8|g[n&255])^c[q++];v=(g[k>>>24]<<24|g[o>>>16&255]<<16|g[n>>>8&255]<<8|g[j&255])^c[q++];w=(g[o>>>24]<<24|g[n>>>16&255]<<16|g[j>>>8&255]<<8|g[k&255])^c[q++];n=(g[n>>>24]<<24|g[j>>>16&255]<<16|g[k>>>8&255]<<8|g[o&255])^c[q++];a[b]=s;a[b+1]=v;a[b+2]=w;a[b+3]=n},ga:8});D.ab=a.Ia(b)})();
|
---|
31 | // Input 2
|
---|
32 | function ca(a,b){var c=[];a.font=b;c[0]=a.measureText("WWWWI").width;a.font="bold "+b;c[1]=a.measureText("WWWWI").width;a.font="lighter "+b;c[2]=a.measureText("WWWWI").width;return c}
|
---|
33 | function fa(a){if(a.fontsize){var b=a.canvas.getContext("2d"),c="300px "+a.fontFamily+", sans",d="300px "+a.fontFamily+", serif",e=ca(b,"300px sans"),f=ca(b,"300px serif"),c=ca(b,c),d=ca(b,d),i=c[1]!=d[1]||c[1]==e[1]||d[1]==f[1],g=c[2]!=d[2]||c[2]==e[2]||d[2]==f[2];c[0]!=d[0]||c[0]==e[0]||d[0]==f[0]||i||g?setTimeout(function(){fa(a)},20):(a.Kb="normal "+a.fontsize+"px "+a.fontFamily,a.ea="bold "+a.fontsize+"px "+a.fontFamily,a.Ib="lighter "+a.fontsize+"px "+a.fontFamily,b.font=a.Kb,e=b.measureText("W").width,
|
---|
34 | b.font=a.ea,f=b.measureText("W").width,b.font=a.Ib,b=b.measureText("W").width,c=Math.max(e,f,b),a.Bc=parseInt((c-e)/2,10),a.lc=parseInt((c-f)/2,10),a.xc=parseInt((c-b)/2,10),a.font={},a.font.N=a.fontsize,a.font.L=c,a.debug("Using font-family '"+a.fontFamily+"' ["+c+" x "+a.fontsize+"]"),ga(a))}else new ha(a.Bb,function(b){a.font=b;ga(a)},a.options.debug),a.ea&&new ha(a.ea,function(b){a.P=b;ga(a)},a.options.debug)}
|
---|
35 | function ia(a,b){var c=this;if(!(a instanceof HTMLCanvasElement))throw Error("First argument to TTVCanvas constructor must be an HTMLCanvasElement (was "+a+")");c.V=F("#000000,#b21818,#18b218,#b26818,#1818b2,#b218b2,#18b2b2,#b2b2b2".split(","));c.U=F("#686868,#ff5454,#54ff54,#ffff54,#5454ff,#ff54ff,#54ffff,#ffffff".split(","));c.Bb="qemu-vgafont";c.fontFamily="monospace";c.na=[];c.canvas=a;c.debug=function(a){b.debug?b.debug("canvasview.js: "+a):alert("canvasview.js: "+a)};c.options=b;b.fontsize&&
|
---|
36 | (c.fontsize=b.fontsize);b.Y&&(c.Y=b.Y);b.font&&(c.Bb=b.font);b.Cb&&(c.fontFamily=b.Cb);b.P&&(c.ea=b.P);b.Y&&(c.Y=b.Y);b.Q&&(c.Q=b.Q);b.na&&c.na.push(b.na);c.cursor={};c.cursor.x=0;c.cursor.y=0;c.cursor.ba=t;c.o=new ja({debug:c.options.debug,A:c.options.A,width:c.options.width,height:c.options.height,mc:function(a,b,d){ka(c,a,b,d)},cursor:function(a,b,d){a>=c.o.width&&(a=c.o.width-1);ka(c,b,a,a);ka(c,c.cursor.y,c.cursor.x,c.cursor.x);c.cursor.x=a;c.cursor.y=b;c.cursor.ba=d},Dc:function(a){if(c.Q){(a.title||
|
---|
37 | a.Db)&&c.Q(a);if(a.border){var b=a.border[0];b>=0&&b<8?c.Q({border:c.V[b],width:a.border[1]*c.font.L}):b>=10&&b<18?c.Q({border:c.U[b%10],width:a.border[1]*c.font.L}):c.Q({border:u})}}}});c.aa=new la(c.o,c.options.debug);c.ya=[];for(var d=0;d<c.o.height;d++)c.ya[d]={min:0,max:c.o.width-1};setTimeout(function(){fa(c)},1);return this}
|
---|
38 | function ga(a){if(!a.fontsize){if(!a.font)return;if(a.ea){if(!a.P)return;if(a.font.L!=a.P.L||a.font.N!=a.P.N)a.debug("Normal font size ["+a.font.L+"x"+a.font.N+"] and bold font size ["+a.P.L+"x"+a.font.N+"] mismatch"),a.P=p}}a.Y&&(a.canvas.setAttribute("width",a.o.width*a.font.L),a.canvas.setAttribute("height",a.o.height*a.font.N));ma(a);a.na.forEach(function(a){a()})}ia.prototype.Fa=function(a){this.o.Fa(a.Ab);this.aa.buffer=a.aa};
|
---|
39 | function ka(a,b,c,d){if(b>=a.o.height||0>c||d>=a.o.width)throw Error("makeSpanDirty "+b+" "+a.o.height+" "+c+" "+d+" "+a.o.width);a=a.ya[b];a.min>c&&(a.min=c);a.max<d&&(a.max=d)}
|
---|
40 | function ma(a){var b=a.canvas.getContext("2d");b.textBaseline="bottom";b.lineWidth=1;b.beginPath();var c=a.font.L,d=a.font.N,e,f,i;if(a.fontsize)for(g=0;g<a.o.height;g++){h=a.ya[g];for(o=h.min;o<=h.max;o++)q=g*a.o.width+o,(r=a.cursor.x==o&&a.cursor.y==g&&a.cursor.ba)?(s=a.o.p.r.C[q]%10,r=(9<s||a.o.p.r.bold[q]?a.U:a.V)[s]):(n=a.o.p.r.B[q]%10,r=(9<n?a.U:a.V)[n]),f!=r&&(b.fillStyle=f=r),b.fillRect(o*c,g*d,c,d);for(o=h.min;o<=h.max;o++)q=g*a.o.width+o,v=a.o.p.r.bold[q],z=a.o.p.r.text[q],(r=a.cursor.x==
|
---|
41 | o&&a.cursor.y==g&&a.cursor.ba)?(n=a.o.p.r.B[q]%10,s=(9<n?a.U:a.V)[n]):(s=a.o.p.r.C[q]%10,s=(9<s||v?a.U:a.V)[s]),32!=z.charCodeAt(0)&&(f!=s&&(b.fillStyle=f=s),n=a.Kb,r=a.Bc,v&&(n=a.ea,r=a.lc),a.o.p.r.K[q]&&(n=a.Ib,r=a.xc),e!=n&&(b.font=e=n),b.fillText(z,o*c+r,(g+1)*d),b.stroke()),a.o.p.r.M[q]&&(s!=i&&(b.stroke(),b.strokeStyle=i=s,b.beginPath()),b.moveTo(o*c,(g+1)*d-1),b.lineTo((o+1)*c,(g+1)*d-1));h.min=a.o.width-1;h.max=0}else for(var g=0;g<a.o.height;g++){for(var h=a.ya[g],o=h.min;o<=h.max;o++){var q=
|
---|
42 | g*a.o.width+o,s=a.o.p.r.C[q]%10,n=a.o.p.r.B[q]%10,v=a.o.p.r.bold[q],z=a.o.p.r.text[q],r=a.cursor.x==o&&a.cursor.y==g&&a.cursor.ba;r?(r=(9<s||v?a.U:a.V)[s],s=(9<n?a.U:a.V)[n]):(s=(9<s||v?a.U:a.V)[s],r=(9<n?a.U:a.V)[n]);v&&a.P?a.P.zb(b,z,o*c,g*d,s,r):a.font.zb(b,z,o*c,g*d,s,r);a.o.p.r.M[q]&&(s!=i&&(b.stroke(),b.strokeStyle=i=s,b.beginPath()),b.moveTo(o*c,(g+1)*d-1),b.lineTo((o+1)*c,(g+1)*d-1))}h.min=a.o.width-1;h.max=0}b.stroke()};
|
---|
43 | // Input 3
|
---|
44 | function F(a){if("object"!=typeof a||a===u)return a;var b="undefined"!=typeof a.length?Array(a.length):{},c;for(c in a)b[c]="object"==typeof a[c]?F(a[c]):a[c];return b};
|
---|
45 | // Input 4
|
---|
46 | function na(a){for(var b=[],c=0;c<a.length;){var d=oa(a,c),e=oa(a,c+4),f=oa(a,c+8);if(0>f)throw Error("The stream seems to be broken [chunk size < 0]");if(0==f&&c+12+f>a.length)break;if(c+12+f>a.length)throw Error("The stream seems to be broken ["+f+";"+(c+12+f)+">"+a.length+"]");for(var i=a.substr(c+12,f),c=c+(f+12),g="",h=0;h<i.length;h++)g+=String.fromCharCode(i.charCodeAt(h)&255);b.push({time:d+e/1E6,Yc:f,data:g})}return b}
|
---|
47 | function oa(a,b){return(a.charCodeAt(b+3)&255)<<24|(a.charCodeAt(b+2)&255)<<16|(a.charCodeAt(b+1)&255)<<8|a.charCodeAt(b)&255};
|
---|
48 | // Input 5
|
---|
49 | function ba(a){function b(a){return("0"+a).slice(-2)}var c;if(a.title||""===a.title)c=a.title;else{c=a.name.split("/").reverse()[0];var d=c.substr(-4,4);if(".rec"==d||".tty"==d)c=c.substr(0,c.length-4)}var e=document.createElement("div");e.setAttribute("class","tty");e.setAttribute("style","display:none;");d=document.createElement("table");d.setAttribute("class","tty");d.id="table";var f=document.createElement("tr"),i=document.createElement("td"),g=document.createElement("td"),h=document.createElement("td"),
|
---|
50 | o=document.createElement("img"),q=document.createElement("img"),s=document.createTextNode(c);f.setAttribute("class","tty");f.id="row1";i.setAttribute("class","tty");g.setAttribute("class","tty");h.setAttribute("class","tty");i.id="cell11";g.id="cell12";h.id="cell13";o.setAttribute("class","tty");o.id="img11";q.setAttribute("class","tty");q.id="img13";a.onclose&&(q.onclick=a.onclose);i.appendChild(o);g.appendChild(s);h.appendChild(q);f.appendChild(i);f.appendChild(g);f.appendChild(h);d.appendChild(f);
|
---|
51 | f=document.createElement("tr");f.setAttribute("class","tty");f.id="row2";var n=document.createElement("td");n.setAttribute("class","tty");n.id="cell21";var v=document.createElement("canvas");v.setAttribute("class","tty");v.id="canvas";n.setAttribute("colspan","3");v.width=1;v.height=1;n.appendChild(v);f.appendChild(n);d.appendChild(f);g=document.createElement("tr");g.setAttribute("class","tty");g.id="row3";h=document.createElement("td");o=document.createElement("td");q=document.createElement("td");
|
---|
52 | h.setAttribute("class","tty");o.setAttribute("class","tty");q.setAttribute("class","tty");h.id="cell31";o.id="cell32";q.id="cell33";var z=document.createTextNode("TermTV"),f=document.createElement("span"),r=document.createElement("span"),w=document.createElement("span"),i=document.createElement("span"),E=document.createElement("span"),H=document.createElement("span"),K=document.createElement("span"),y=document.createElement("span"),M=document.createElement("span"),O=document.createElement("progress"),
|
---|
53 | Q=document.createTextNode("00:00:00"),V=document.createTextNode("00:00:00");w.setAttribute("style","display:none;");H.setAttribute("style","display:none;");f.setAttribute("class","tty");r.setAttribute("class","tty");w.setAttribute("class","tty");i.setAttribute("class","tty");E.setAttribute("class","tty");H.setAttribute("class","tty");K.setAttribute("class","tty");f.id="input321";r.id="input322a";w.id="input322b";i.id="input326";E.id="input327a";H.id="input327b";K.id="input33";K.onclick=function(){var a=
|
---|
54 | v.toDataURL("image/png"),a=a.replace("image/png","image/octet-stream");document.location.href=a;return x};y.setAttribute("class","tty");M.setAttribute("class","tty");y.id="span323";M.id="span325";O.max=1;O.value=0;y.appendChild(Q);M.appendChild(V);h.appendChild(z);o.appendChild(f);o.appendChild(r);o.appendChild(w);o.appendChild(y);o.appendChild(O);o.appendChild(M);o.appendChild(i);o.appendChild(E);o.appendChild(H);q.appendChild(K);g.appendChild(h);g.appendChild(o);g.appendChild(q);a.controls&&d.appendChild(g);
|
---|
55 | var g=document.createElement("tr"),h=document.createElement("td"),B=document.createElement("div");h.setAttribute("style","max-width:1px;");h.setAttribute("colspan","3");B.setAttribute("class","tty");B.id="div4";B.onscroll=function(){B.Fc=B.scrollHeight-B.scrollTop!=B.clientHeight};h.appendChild(B);g.appendChild(h);a.debug&&d.appendChild(g);e.appendChild(d);if(a.debug){var Z=parseInt(a.debug,10);a.debugLevel=a.debug;a.debug=function(a){if(a&&!(Z==1&&a.substr(9,3)=="emu")){if(a.substr(9,3)=="par"){var b=
|
---|
56 | document.createElement("div");b.setAttribute("style","color:green");b.appendChild(document.createTextNode(a));B.appendChild(b)}else{B.appendChild(document.createTextNode(a));B.appendChild(document.createElement("br"))}if(!B.Fc)B.scrollTop=B.scrollHeight}}}else a.debug=A();a.onready=function(a){V.nodeValue=b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds());e.style.display="inherit"};a.callback=function(a){if(a.title){var b=c;b.length&&(b=b+": ");a.title&&(b=b+a.title);s.nodeValue=
|
---|
57 | b}if(a.border){b=(a.width||0)+"px ";n.Mb=n.getAttribute("style");n.setAttribute("style","padding:"+b+b+b+b+"; background-color:"+a.border+";")}a.border==u&&n.Mb&&n.setAttribute("style",n.Mb)};a.onupdate=function(a,c){Q.nodeValue=b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds());O.value=c};a.oncompletion=function(){w.setAttribute("style","display:none;");r.setAttribute("style","display:inline;");Q.nodeValue="--:--:--"};a.onbookmark=function(){E.setAttribute("style","display:none;");
|
---|
58 | H.setAttribute("style","display:inline;")};a.onpause=function(){w.setAttribute("style","display:none;");r.setAttribute("style","display:inline;")};a.onplay=function(){r.setAttribute("style","display:none;");w.setAttribute("style","display:inline;")};e.ia=new G(v,a);f.onclick=function(){e.ia.Xa()};r.onclick=function(){e.ia.Va()};w.onclick=function(){e.ia.Va()};i.onclick=function(){e.ia.Vb()};E.onclick=function(){e.ia.Sa()};H.onclick=function(){e.ia.Sa()};return e}window.TTVDisplay=ba;
|
---|
59 | // Input 6
|
---|
60 | function ja(a){this.sb=a.mc;this.Wb=a.Dc;this.wb=a.cursor;this.A=a.A;this.debug=function(b){a.debug?a.debug("emulate.js: "+b):alert("emulate.js: "+b)};this.width=a.width||80;this.height=a.height||24;pa(this);return this}
|
---|
61 | function pa(a){a.p={};a.cursor={};a.cursor.x=0;a.cursor.y=0;a.cursor.bold=x;a.cursor.M=x;a.cursor.K=x;a.cursor.blink=x;a.cursor.ja=x;a.cursor.Gb=x;a.cursor.C=7;a.cursor.B=0;a.cursor.ba=t;a.p.r={};a.p.r.text=[];a.p.r.bold=[];a.p.r.M=[];a.p.r.K=[];a.p.r.blink=[];a.p.r.C=[];a.p.r.B=[];a.p.Ca=x;a.p.xb=F(a.cursor);a.p.fa={};a.p.fa.x=0;a.p.fa.y=0;a.p.qb=t;for(var b=0;b<a.width*a.height;b++)a.p.r.text.push(" "),a.p.r.bold.push(x),a.p.r.M.push(x),a.p.r.K.push(x),a.p.r.blink.push(x),a.p.r.C.push(7),a.p.r.B.push(0);
|
---|
62 | a.Da=F(a.p);a.mode={};a.mode.oc=t;a.mode.scroll="jump";a.mode.Ca=x;a.mode.oa="screen";a.mode.Sc=t;a.mode.yc=x;a.mode.zc=x;a.mode.vb=1;a.mode.Wc=x;a.mode.Fb=x;a.mode.Vc=0;a.mode.$c=t;a.mode.Ac="cr";a.s={};a.s.top=0;a.s.bottom=a.height-1;a.Ea={};for(b=0;b<a.width;b++)a.Ea[b]=0==b%8;a.qa="";a.ma="";a.H={};a.H.Tc="us";a.H.Uc="line";a.H.T="g0"}ja.prototype.freeze=function(){return F(this)};
|
---|
63 | ja.prototype.Fa=function(a){this.p=F(a.p);this.Da=F(a.Da);this.mode=F(a.mode);this.cursor=F(a.cursor);this.s=F(a.s);this.Ea=F(a.Ea);this.H=F(a.H);this.qa=a.qa;this.ma=a.ma;for(var b=0;b<this.height;b++)I(this,b,0,this.height-1);J(this,{title:a.qa,icon:a.ma});L(this)};function N(a){return String.fromCharCode(parseInt(a,16))}
|
---|
64 | ja.prototype.La={cd:{},bd:{"#":N("A3")},Zc:{_:" ","`":N("2666"),a:N("2591"),b:N("2409"),c:N("240C"),d:N("240D"),e:N("240A"),f:N("B0"),g:N("B1"),h:N("2424"),i:N("240B"),j:N("2518"),k:N("2510"),l:N("250C"),m:N("2514"),n:N("253C"),q:N("2500"),t:N("2524"),u:N("251C"),v:N("2534"),w:N("252C"),x:N("2502"),y:N("2264"),z:N("2265"),"{":N("3C0"),"|":N("2260"),"}":N("A3"),"~":N("B7")}};function I(a,b,c,d){a.sb&&a.sb(b,c,d)}function J(a,b){a.Wb&&a.Wb(b)}
|
---|
65 | function L(a){a.wb&&a.wb(a.cursor.x,a.cursor.y,a.cursor.ba)}function qa(a,b,c,d){!d&&2<a.A&&a.debug("SET_MARGIN="+b+" "+c);b-=1;c-=1;b+1>=c&&(b=c-1);0>b&&(b=0);b>a.height-2&&(b=a.height-2);1>c&&(c=1);c>a.height-1&&(c=a.height-1);b+1>=c&&a.debug("numbers do not obey the laws of arithmetic in setMargins");a.s.top=b;a.s.bottom=c;P(a,1,1)}
|
---|
66 | function R(a,b,c){2<a.A&&a.debug("CURSOR_STACK="+b+" [+attrib="+c+"]");"push"==b&&(c?a.p.xb=F(a.cursor):(a.p.fa.x=a.cursor.x,a.p.fa.y=a.cursor.y));"pop"==b&&(c?a.cursor=F(a.p.xb):(a.cursor.x=a.p.fa.x,a.cursor.y=a.p.fa.y));L(a)}
|
---|
67 | function ra(a,b,c){!c&&2<a.A&&a.debug("SET_ATTRIB="+(!b[0]?"0":b));var d,e;if(!b[0]||0==b[0])a.cursor.bold=x,a.cursor.M=x,a.cursor.K=x,a.cursor.blink=x,a.cursor.ja=x,a.cursor.Gb=x,d=7,e=0;else if(30<=b[0]&&37>=b[0])d=b[0]-30;else if(39==b[0])d=7;else if(40<=b[0]&&47>=b[0])e=b[0]-40;else if(49==b[0])e=0;else if(90<=b[0]&&97>=b[0])d=b[0]-90+10;else if(99==b[0])d=7;else if(100<=b[0]&&107>=b[0])e=b[0]-100+10;else if(109==b[0])e=0;else if(1==b[0])a.cursor.bold=t,a.cursor.K=x;else if(2==b[0])a.cursor.K=
|
---|
68 | t,a.cursor.bold=x;else if(21!=b[0])if(22==b[0])a.cursor.K=x,a.cursor.bold=x;else if(7==b[0]||27==b[0]){if(7==b[0]&&!a.cursor.ja&&(a.cursor.ja=t,d=a.cursor.C,e=a.cursor.B),27==b[0]&&a.cursor.ja)a.cursor.ja=x,e=a.cursor.C,d=a.cursor.B}else 4==b[0]||24==b[0]?a.cursor.M=4==b[0]:5==b[0]||25==b[0]?a.cursor.blink=5==b[0]:8==b[0]||28==b[0]?a.cursor.Gb=8==b:10==b[0]?a.H.T=p:11==b[0]?a.H.T=p:38==b[0]&&5==b[1]?(8>b[2]?d=b[2]:16>b[2]&&(d=b[2]-2),a.debug("Warning: 256-foreground color ("+b[2]+") not supported."),
|
---|
69 | b=b.slice(2)):48==b[0]&&5==b[1]?(8>b[2]?e=b[2]:16>b[2]&&(e=b[2]-2),a.debug("Warning: 256-background color ("+b[2]+") not supported."),b=b.slice(2)):38==b[0]&&2==b[1]?(a.debug("Warning: 24bit color ("+b.slice(2)+") not supported."),b=b.slice(4)):48==b[0]&&2==b[1]?(a.debug("Warning: 24bit color ("+b.slice(2)+") not supported."),b=b.slice(4)):a.debug("Warning: ignoring setAttribute("+b+")");a.cursor.ja^a.p.Ca&&(c=d,d=e,e=c);d!=p&&(a.cursor.C=d);e!=p&&(a.cursor.B=e);1<b.length&&ra(a,b.slice(1),t)}
|
---|
70 | function sa(a,b){2<a.A&&a.debug("STRING=["+a.cursor.x+"/"+a.cursor.y+";"+a.cursor.C+";"+a.cursor.B+";"+b+"]["+b.length+"]");for(var c=0;c<b.length;c++){var d=a,e=b[c];2<d.A&&d.debug("CHAR=["+d.cursor.x+"/"+d.cursor.y+";"+d.cursor.C+";"+d.cursor.B+";"+e+"]");d.H.T&&d.H[d.H.T]&&d.La[d.H[d.H.T]]&&d.La[d.H[d.H.T]][e]&&(e=d.La[d.H[d.H.T]][e]);if(d.cursor.x==d.width)if(d.p.qb){var f="screen"==d.mode.oa?d.height:d.s.bottom+1;d.cursor.x=0;d.cursor.y++;d.cursor.y>=f&&(d.cursor.y==f&&d.scroll(1),d.cursor.y=
|
---|
71 | f-1)}else d.cursor.x--;d.mode.Fb?(ta(d,d.width-1,d.cursor.y),ua(d,e,d.cursor.x,d.cursor.y),I(d,d.cursor.y,d.cursor.x,d.width-1)):(va(d,e,d.cursor.x,d.cursor.y),I(d,d.cursor.y,d.cursor.x,d.cursor.x));d.cursor.x++;L(d)}}
|
---|
72 | function S(a,b){2<a.A&&a.debug("SPECIAL_CHAR="+b);switch(b){case "carriageReturn":a.cursor.x=0;L(a);break;case "backspace":0<a.cursor.x&&(a.cursor.x--,L(a));break;case "lineFeed":case "formFeed":case "verticalTab":a.cursor.y++;a.cursor.y==a.s.bottom+1&&(a.scroll(1),a.cursor.y=a.s.bottom);a.cursor.y>=a.height&&(a.cursor.y=a.height-1);"crlf"==a.mode.Ac&&(a.cursor.x=0);L(a);break;case "horizontalTab":do a.cursor.x++;while(a.cursor.x<a.width&&!a.Ea[a.cursor.x]);L(a);break;case "bell":J(a,{bell:"bell"});
|
---|
73 | break;default:a.debug("Warning: skipping specialChar event for key "+b)}}
|
---|
74 | function T(a,b,c){2<a.A&&a.debug("ARROW=["+a.cursor.x+"/"+a.cursor.y+"] + "+b+" "+c);var d="screen"==a.mode.oa?0:a.s.top,e="screen"==a.mode.oa?a.height:a.s.bottom+1;switch(b){case "up":a.cursor.y-=c;a.cursor.y<d&&(a.cursor.y=d);break;case "down":a.cursor.y+=c;a.cursor.y>=e&&(a.cursor.y=e-1);break;case "left":a.cursor.x-=c;0>a.cursor.x&&(a.cursor.x=0);break;case "right":a.cursor.x+=c;a.cursor.x>=a.width&&(a.cursor.x=a.width-1);break;default:a.debug("Can't handle arrow event with direction "+b);return}L(a)}
|
---|
75 | function wa(a,b){2<a.A&&a.debug("DELETE_CHARS="+b);for(var c=0;c<b;c++){var d=a,e=a.width-1+a.cursor.y*d.width;d.p.r.text.splice(e,0," ");d.p.r.bold.splice(e,0,x);d.p.r.M.splice(e,0,x);d.p.r.K.splice(e,0,x);d.p.r.blink.splice(e,0,x);d.p.r.C.splice(e,0,7);d.p.r.B.splice(e,0,0);ta(a,a.cursor.x,a.cursor.y)}I(a,a.cursor.y,a.cursor.x,a.width-1)}
|
---|
76 | function U(a,b,c){2<a.A&&a.debug("INDEX="+b);switch(b){case "down":for(b=0;b<c;b++)a.cursor.y==a.s.bottom?a.scroll(1):a.cursor.y++;L(a);break;case "up":for(b=0;b<c;b++)a.cursor.y==a.s.top?a.scroll(-1):a.cursor.y--;L(a);break;case "nextLine":U(a,"down",c);a.cursor.x=0;L(a);break;case "prevLine":U(a,"up",c);a.cursor.x=0;L(a);break;default:a.debug("Can't index with method "+b)}}
|
---|
77 | function W(a,b,c){2<a.A&&a.debug("MODE="+b+" ["+c+"]");switch(b){case "insert":a.mode.Fb=c;break;case "cursorKeyANSI":a.mode.oc=c;break;case "keypad":a.mode.Xc=c;break;case "mouseTrackingUp":a.mode.zc=c;break;case "mouseTrackingDown":a.mode.yc=c;break;case "scroll":a.mode.scroll=c;break;case "autoWrap":a.p.qb=c;break;case "cursor":a.cursor.ba=c;L(a);break;case "cursorBlink":a.cursor.blink=c;break;case "width":a.debug("width="+c);break;case "height":a.debug("height="+c);break;case "currentScreen":if(c!=
|
---|
78 | a.mode.vb){a.debug("Exchange screens");b=a.p;a.p=a.Da;a.Da=b;a.mode.vb=c;for(c=0;c<a.height;c++)I(a,c,0,a.width-1)}break;case "originMode":a.mode.oa=c;P(a,1,1);break;case "reverseScreen":if(c!=a.p.Ca){a.debug("Reverse screen");a.p.Ca=c;c=a.p.r.C;a.p.r.C=a.p.r.B;a.p.r.B=c;c=a.cursor.C;a.cursor.C=a.cursor.B;a.cursor.B=c;for(c=0;c<a.height;c++)I(a,c,0,a.width-1)}break;case "borderColor":J(a,{border:c});a.debug("Setting border to [col="+c[0]+"; width="+c[1]+"]");break;default:a.debug("Warning: can't handle mode change '"+
|
---|
79 | b+"' to '"+c+"'")}}function X(a,b){2<a.A&&a.debug("ERASE_IN_LINE="+b);var c,d;switch(b){case "toEnd":c=a.cursor.x;d=a.width;break;case "toStart":c=0;d=a.cursor.x+1;break;case "whole":c=0;d=a.width;break;default:a.debug("Can't eraseInLine with method '"+b+"'");return}for(var e=c;e<d;e++)va(a," ",e,a.cursor.y);I(a,a.cursor.y,c,d-1)}
|
---|
80 | function xa(a,b){2<a.A&&a.debug("ERASE_IN_DISPLAY="+b);var c,d;switch(b){case "toEnd":X(a,"toEnd");c=a.cursor.y+1;d=a.height;break;case "toStart":X(a,"toStart");c=0;d=a.cursor.y;break;case "whole":c=0;d=a.height;break;default:a.debug("Can't eraseInDisplay with method '"+b+"'");return}for(var e=c;e<d;e++)for(var f=0;f<a.width;f++)va(a," ",f,e);for(e=c;e<d;e++)I(a,e,0,a.width-1)}
|
---|
81 | function P(a,b,c){2<a.A&&a.debug("GOTO="+b+","+c);var b=b-1,d=c-1;0>b&&(b=0);b>a.width&&(b=a.width);0>d&&(d=0);"screen"==a.mode.oa?d>=a.height&&(d=a.height-1):(d+=a.s.top,d>a.s.bottom&&(d=a.s.bottom));a.cursor.x=b;0<=c&&(a.cursor.y=d);L(a)}function ta(a,b,c){b+=c*a.width;a.p.r.text.splice(b,1);a.p.r.bold.splice(b,1);a.p.r.M.splice(b,1);a.p.r.K.splice(b,1);a.p.r.blink.splice(b,1);a.p.r.C.splice(b,1);a.p.r.B.splice(b,1)}
|
---|
82 | function ua(a,b,c,d){c+=d*a.width;a.p.r.text.splice(c,0,b);a.p.r.bold.splice(c,0,a.cursor.bold);a.p.r.M.splice(c,0,a.cursor.M);a.p.r.K.splice(c,0,a.cursor.K);a.p.r.blink.splice(c,0,a.cursor.blink);a.p.r.C.splice(c,0,a.cursor.C);a.p.r.B.splice(c,0,a.cursor.B)}
|
---|
83 | function va(a,b,c,d){c+=d*a.width;a.p.r.text.splice(c,1,b);a.p.r.bold.splice(c,1,a.cursor.bold);a.p.r.M.splice(c,1,a.cursor.M);a.p.r.K.splice(c,1,a.cursor.K);a.p.r.blink.splice(c,1,a.cursor.blink);a.p.r.C.splice(c,1,a.cursor.C);a.p.r.B.splice(c,1,a.cursor.B)}function ya(a,b,c){b+=c*a.width;a.p.r.text[b]=" ";a.p.r.bold[b]=x;a.p.r.M[b]=x;a.p.r.K[b]=x;a.p.r.blink[b]=x;a.p.r.C[b]=7;a.p.r.B[b]=0}
|
---|
84 | function za(a,b,c){for(var d=0;d<a.width;d++){var e=a,f=d+b*a.width,i=d+c*a.width;e.p.r.text.splice(i,1,e.p.r.text[f]);e.p.r.bold.splice(i,1,e.p.r.bold[f]);e.p.r.M.splice(i,1,e.p.r.M[f]);e.p.r.K.splice(i,1,e.p.r.K[f]);e.p.r.blink.splice(i,1,e.p.r.blink[f]);e.p.r.C.splice(i,1,e.p.r.C[f]);e.p.r.B.splice(i,1,e.p.r.B[f])}}
|
---|
85 | ja.prototype.scroll=function(a){2<this.A&&this.debug("SCROLL="+a);if(!(0==a||isNaN(a))){if(0<a)for(var b=0;b<a;b++)for(var c=0;c<this.width;c++)ua(this," ",0,this.s.bottom+1),ta(this,0,this.s.top);else for(b=a;0<b;b--)for(c=0;c<this.width;c++)ta(this,0,this.s.bottom),ua(this," ",0,this.s.top);for(a=this.s.top;a<=this.s.bottom;a++)I(this,a,0,this.width-1)}};function Y(a,b,c){a.debug("Warning: Event '"+b+"' not implemented: "+c)}function Aa(a,b){Y(a,"lineAttr",b)};
|
---|
86 | // Input 7
|
---|
87 | var Ba={},$={},Ca="./fonts/";
|
---|
88 | function ha(a,b,c){var d=this;if(Ba[a])b(Ba[a],u);else if($[a])$[a].xa.push(b);else{d.debug=function(a){c("font.js: "+a)};var e=$[a]={R:new Image,xa:[b]};e.R.onload=function(){e.vc=t;e.Jb&&g(a)};var f=Ca+a;e.R.onerror=function(){alert("ERROR[1] - Loading image '"+f+".png' failed.");e.xa.forEach(function(a){a(u,"Couldn't load stats file")});delete $[a]};e.R.src=f+".png";var i=new XMLHttpRequest;i.open("GET",f+".txt",t);i.onload=function(){200!=i.status?(alert("ERROR[0] - HTTP request '"+f+".txt': "+
|
---|
89 | i.statusText+" ["+i.status+"]"),e.xa.forEach(function(a){a(u,"Couldn't load stats file")}),delete $[a]):(e.Jb=i.responseText,e.vc&&g(a))};i.send(u);var g=function(a){var b=$[a],c=new h(a,b.R,b.Jb);Ba[a]=c;delete $[a];d.debug(a+" ["+c.L+"x"+c.N+"] loaded.");b.xa.forEach(function(a){a(c,u)})},h=function(a,b,c){Ba[a]=this;this.R=b;var e=this.Ma={};this.Oa={};var f=0,g=0,h=0,i=0,E=0;c.split("\n").forEach(function(a){if(a.length)if(/^\d+$/.exec(a))e[a]=[f++,g],E=parseInt(a,10),h++;else if(/^y$/.exec(a))f>
|
---|
90 | i&&(i=f),f=0,g++;else{var b=/^r(\d+)$/.exec(a);if(b){a=parseInt(b[1],10);for(b=E+1;b<=E+a;b++)e[b]=[f++,g];h+=a;E+=a}else d.debug('Stats file is corrupt, line="'+a+'"')}});f>i&&(i=f);this.nc=h;this.N=this.R.naturalHeight/(g+1);this.L=this.R.naturalWidth/i;this.L!=Math.floor(this.L)&&d.debug("font loading of "+a+" failed: image width is not a multiple of the character count (image width = "+this.R.naturalWidth+", character count = "+this.nc+")")};h.prototype.zb=function(a,b,c,e,f,g){var h=this.Ma[b.charCodeAt(0)];
|
---|
91 | if(h===p&&(h=this.Ma[0],h===p&&(h=this.Ma[63],h===p))){d.debug("Can't draw '"+b+"', it is not mapped and neither is the missing character");return}b=f.substr(1)+g.substr(1)+h[1];this.Oa[b]||(this.Oa[b]=this.tc(f,g,h[1]));a.drawImage(this.Oa[b],h[0]*this.L,0,this.L,this.N,c,e,this.L,this.N)};h.prototype.tc=function(a,b,c){var d=this.R.naturalWidth,e=this.N,f=c*this.N,c=document.createElement("canvas");c.width=d;c.height=e;var g=c.getContext("2d");g.drawImage(this.R,0,f,d,e,0,0,d,e);for(var f=g.getImageData(0,
|
---|
92 | 0,d,e),h=g.createImageData(d,e),d=4*d*e,e=0;e<d;e+=4){var i=127<f.data[e]?b:a;h.data[e]=parseInt(i.substring(1,3),16);h.data[e+1]=parseInt(i.substring(3,5),16);h.data[e+2]=parseInt(i.substring(5,7),16);h.data[e+3]=255}g.putImageData(h,0,0);return c}}};
|
---|
93 | // Input 8
|
---|
94 | function aa(a){function b(){c.style.opacity=parseFloat(c.style.opacity)+0.03;if(0.79<c.style.opacity){var d=new ba(a);i.appendChild(d)}else setTimeout(b,1)}var c=document.createElement("span");c.setAttribute("style","position:fixed;top:0px;left:0px;width:100%;height:100%;opacity:0;background-color:black;");var d=document.getElementsByTagName("body")[0];d.appendChild(c);var e=document.createElement("table");e.setAttribute("style","position:fixed;top:0px;left:0px;width:100%;height:100%");var f=document.createElement("tr"),
|
---|
95 | i=document.createElement("td");i.align="center";a.onclose=function(){d.removeChild(e);d.removeChild(c)};d.appendChild(e);e.appendChild(f);f.appendChild(i);b()}window.TTVOverlay=aa;
|
---|
96 | // Input 9
|
---|
97 | function la(a,b){this.debug=function(a){b?b("parse.js: "+a):alert("parse.js: "+a)};this.o=a;this.buffer="";return this}la.prototype.parse=function(a){for(this.buffer+=a;Da(this););};
|
---|
98 | function Da(a){for(var b=0;b<a.Ra.length;b++){var c=a.Ra[b][0].exec(a.buffer);if(c&&0!=c[0].length)return a.Ra[b][1].call(a,c),a.buffer=a.buffer.substr(c[0].length),t}50<a.buffer.length&&"\u001b"==a.buffer[0]&&(a.debug("Unknown escape sequence: "+a.buffer[1].charCodeAt(0).toString(16)+" "+a.buffer[2].charCodeAt(0).toString(16)+" "+a.buffer[3].charCodeAt(0).toString(16)+" "+a.buffer[4].charCodeAt(0).toString(16)+" "+a.buffer[5].charCodeAt(0).toString(16)+" "+a.buffer[6].charCodeAt(0).toString(16)+
|
---|
99 | " "+a.buffer[7].charCodeAt(0).toString(16)+" "+a.buffer[8].charCodeAt(0).toString(16)+" "+a.buffer[9].charCodeAt(0).toString(16)+" ["+a.buffer+"]"),sa(a.o,"\x00"),a.buffer=a.buffer.substr(1));return x}
|
---|
100 | la.prototype.Ra=[[/^[\x20-\x7F]+/,function(a){sa(this.o,a[0])}],[/^[\xC2-\xDF][\x80-\xBF]/,function(a){sa(this.o,String.fromCharCode((a[0].charCodeAt(0)&31)<<6|a[0].charCodeAt(1)&63))}],[/^\033\[([0-9;]*)m/,function(a){ra(this.o,a[1].split(";"))}],[/^[\xE0-\xEF][\x80-\xBF][\x80-\xBF]/,function(a){sa(this.o,String.fromCharCode((a[0].charCodeAt(0)&15)<<12|(a[0].charCodeAt(1)&63)<<6|a[0].charCodeAt(2)&63))}],[/^[\xF0-\xF4][\x80-\xBF][\x80-\xBF][\x80-\xBF]/,function(a){sa(this.o,String.fromCharCode((a[0].charCodeAt(0)&
|
---|
101 | 7)<<18|(a[0].charCodeAt(1)&63)<<12|(a[0].charCodeAt(2)&63)<<6|a[0].charCodeAt(3)&63))}],[/^([\x80-\xFF])/,function(a){sa(this.o,a[0])}],[/^\007/,function(){S(this.o,"bell")}],[/^\010/,function(){S(this.o,"backspace")}],[/^\011/,function(){S(this.o,"horizontalTab")}],[/^\012/,function(){S(this.o,"lineFeed")}],[/^\013/,function(){S(this.o,"verticalTab")}],[/^\014/,function(){S(this.o,"formFeed")}],[/^\015/,function(){S(this.o,"carriageReturn")}],[/^\016/,function(){this.o.H.T=p}],[/^\017/,function(){this.o.H.T=
|
---|
102 | p}],[/^\033F/,A()],[/^\033G/,A()],[/^\033\[[Hf]/,function(){P(this.o,1,1)}],[/^\033\[([0-9]*)G/,function(a){P(this.o,parseInt(a[1]||"1",10),-1)}],[/^\033\[([0-9]*);([0-9]*)[Hf]/,function(a){P(this.o,parseInt(a[2]||"1",10),parseInt(a[1]||"1",10))}],[/^\033\[([0-9]*)d/,function(a){P(this.o,1,parseInt(a[1]||"1",10))}],[/^[\000-\006]/,A()],[/^[\020-\032]/,A()],[/^[\034-\037]/,A()],[/^\033\[0?K/,function(){X(this.o,"toEnd")}],[/^\033\[1K/,function(){X(this.o,"toStart")}],[/^\033\[2K/,function(){X(this.o,
|
---|
103 | "whole")}],[/^\033K/,function(){X(this.o,"toEnd")}],[/^\033\[0?J/,function(){xa(this.o,"toEnd")}],[/^\033\[1J/,function(){xa(this.o,"toStart")}],[/^\033\[2J/,function(){xa(this.o,"whole")}],[/^\033J/,function(){xa(this.o,"toEnd")}],[/^\033\[([0-9]*)P/,function(a){wa(this.o,parseInt(a[1]||"1",10))}],[/^\033\[([0-9]*)X/,function(a){wa(this.o,parseInt(a[1]||"1",10))}],[/^\033\[([0-9]*)L/,function(a){var b=this.o,a=parseInt(a[1]||"1",10);2<b.A&&b.debug("INSERT_LINES="+a);if(!(b.cursor.y>b.s.bottom||b.cursor.y<
|
---|
104 | b.s.top)){for(var c=0;c<a;c++){for(var d=b.s.bottom;d>b.cursor.y;d--)za(b,d-1,d);for(d=0;d<b.width;d++)ya(b,d,b.cursor.y)}for(d=b.cursor.y;d<=b.s.bottom;d++)I(b,d,0,b.width-1)}}],[/^\033\[([0-9]*)M/,function(a){var b=this.o,a=parseInt(a[1]||"1",10);2<b.A&&b.debug("DELETE_LINES="+a);if(!(b.cursor.y>b.s.bottom||b.cursor.y<b.s.top)){for(var c=0;c<a;c++){for(var d=b.cursor.y;d<b.s.bottom;d++)za(b,d+1,d);for(d=0;d<b.width;d++)ya(b,d,b.s.bottom)}for(d=b.cursor.y;d<=b.s.bottom;d++)I(b,d,0,b.width-1)}}],
|
---|
105 | [/^\033\[([0-9])*@/,function(a){var b=this.o,a=parseInt(a[1]||"1",10);2<b.A&&b.debug("INSERT_CHARS="+a);for(var c=0;c<a;c++)ta(b,b.width-1,b.cursor.y),ua(b," ",b.cursor.x,b.cursor.y);I(b,b.cursor.y,b.cursor.x,b.width-1)}],[/^\033\[([0-9]+);([0-9]+)r/,function(a){qa(this.o,parseInt(a[1],10),parseInt(a[2],10))}],[/^\033\[r/,function(){var a=this.o;2<a.A&&a.debug("RESET_MARGIN=1 "+a.height);qa(a,1,a.height,t)}],[/^\033\[\[([0-9;]*)m/,A()],[/^\033\[([0-9]*)A/,function(a){T(this.o,"up",parseInt(a[1]||
|
---|
106 | "1",10))}],[/^\033\[([0-9]*)B/,function(a){T(this.o,"down",parseInt(a[1]||"1",10))}],[/^\033\[([0-9]*)C/,function(a){T(this.o,"right",parseInt(a[1]||"1",10))}],[/^\033\[([0-9]*)D/,function(a){T(this.o,"left",parseInt(a[1]||"1",10))}],[/^\033\[([0-9]*)E/,function(a){U(this.o,"nextLine",parseInt(a[1]||"1",10))}],[/^\033\[([0-9]*)F/,function(a){U(this.o,"prevLine",parseInt(a[1]||"1",10))}],[/^\033A([\x20-\x7F]?)/,function(a){T(this.o,"up",a[1]?a[1].charCodeAt(0)-32+1:1)}],[/^\033B([\x20-\x7F]?)/,function(a){T(this.o,
|
---|
107 | "down",a[1]?a[1].charCodeAt(0)-32+1:1)}],[/^\033C([\x20-\x7F]?)/,function(a){T(this.o,"right",a[1]?a[1].charCodeAt(0)-32+1:1)}],[/^\033D/,function(){T(this.o,"left",1)}],[/^\033Y(..)/,function(a){P(this.o,a[1].charCodeAt(1)-32+1,a[1].charCodeAt(0)-32+1)}],[/^\033D/,function(){U(this.o,"down",1)}],[/^\033M/,function(){U(this.o,"up",1)}],[/^\033E/,function(){U(this.o,"nextLine",1)}],[/^\033[7]/,function(){R(this.o,"push",t)}],[/^\033[8]/,function(){R(this.o,"pop",t)}],[/^\033\[s/,function(){R(this.o,
|
---|
108 | "push",x)}],[/^\033\[u/,function(){R(this.o,"pop",x)}],[/^\033=/,function(){W(this.o,"keypad","cursor")}],[/^\033>/,function(){W(this.o,"keypad","numeric")}],[/^\033\[(\??)([0-9;]+)h/,function(a){var b=this;a[2].split(";").forEach(function(c){c=a[1]+c;switch(c){case "?1":W(b.o,"cursorKeyANSI",x);break;case "?3":W(b.o,"width",132);break;case "?4":W(b.o,"scroll","smooth");break;case "?5":W(b.o,"reverseScreen",t);break;case "?6":W(b.o,"originMode","margin");break;case "?7":W(b.o,"autoWrap",t);break;
|
---|
109 | case "?8":W(b.o,"autoRepeat",t);break;case "?9":W(b.o,"mouseTrackingDown",t);break;case "?12":W(b.o,"cursorBlink",t);break;case "?25":W(b.o,"cursor",t);break;case "?47":W(b.o,"currentScreen",0);break;case "?69":break;case "?1000":W(b.o,"mouseTrackingUp",t);break;case "?1034":W(b.o,"metaKey",t);break;case "?1047":W(b.o,"currentScreen",0);break;case "?1048":R(b.o,"push",t);break;case "?1049":R(b.o,"push",t);W(b.o,"currentScreen",0);X(b.o,"whole");break;case "2":W(b.o,"keyboardLocked",t);break;case "4":W(b.o,
|
---|
110 | "insert",t);break;case "12":W(b.o,"localEcho",x);break;case "20":W(b.o,"newLineMode","crlf");break;default:b.debug('Unhandled set mode: "'+c+'"')}})}],[/^\033\[(\??)([0-9;]+)l/,function(a){var b=this;a[2].split(";").forEach(function(c){c=a[1]+c;switch(c){case "?1":W(b.o,"cursorKeyANSI",t);break;case "?2":W(b.o,"vt52",t);break;case "?3":W(b.o,"width",80);break;case "?4":W(b.o,"scroll","jump");break;case "?5":W(b.o,"reverseScreen",x);break;case "?6":W(b.o,"originMode","screen");break;case "?7":W(b.o,
|
---|
111 | "autoWrap",x);break;case "?8":W(b.o,"autoRepeat",x);break;case "?9":W(b.o,"mouseTrackingDown",x);break;case "?12":W(b.o,"cursorBlink",x);break;case "?25":W(b.o,"cursor",x);break;case "?47":W(b.o,"currentScreen",1);break;case "?69":break;case "?1000":W(b.o,"mouseTrackingUp",x);break;case "?1034":W(b.o,"metaKey",x);break;case "?1047":X(b.o,"whole");W(b.o,"currentScreen",1);break;case "?1048":R(b.o,"pop",t);break;case "?1049":W(b.o,"currentScreen",1);R(b.o,"pop",t);break;case "2":W(b.o,"keyboardLocked",
|
---|
112 | x);break;case "4":W(b.o,"insert",x);break;case "12":W(b.o,"localEcho",t);break;case "20":W(b.o,"newLineMode","cr");break;default:b.debug('Unhandled reset mode: "'+c+'"')}})}],[/^\033\[\?([0-9;]*)c/,function(a){this.debug("cursor layout"+a[1])}],[/^\033H/,function(){P(this.o,1,1)}],[/^\033\[0?g/,function(){Y(this.o,"tabStop","remove")}],[/^\033\[3g/,function(){Y(this.o,"tabStop","clear")}],[/^\033#3/,function(){Aa(this.o,"dwdhTopHalf")}],[/^\033#4/,function(){Aa(this.o,"dwdhBottomHalf")}],[/^\033#5/,
|
---|
113 | function(){Aa(this.o,"swsh")}],[/^\033#6/,function(){Aa(this.o,"dwsh")}],[/^\033\[!p/,function(){Y(this.o,"softReset",p)}],[/^\033c/,function(){Y(this.o,"reset",p)}],[/^\033\[([0-9;]*)t/,A()],[/^\033\]2;([^\033\007]*)\007/,function(a){var b=this.o,a=a[1];2<b.A&&b.debug("SET_WINDOW_TITLE= "+a);b.qa=a;J(b,{title:a})}],[/^\033\]1;([^\033\007]*)\007/,function(a){var b=this.o,a=a[1];2<b.A&&b.debug("SET_ICON_TITLE= "+a);b.ma=a;J(b,{Db:a})}],[/^\033\]0;([^\033\007]*)\007/,function(a){var b=this.o,a=a[1];
|
---|
114 | 2<b.A&&b.debug("SET_TITLE= "+a);b.qa=a;b.ma=a;J(b,{title:a,Db:a})}],[/^\033\$?([()*+-./])([ABCEHKQRYZ0124567=])/,function(a){var b=a[1],a=a[2];switch(b){case ")":b="g0";break;case "(":b="g1";break;case "*":b="g2";break;case "+":b="g3"}switch(a){case "A":a="uk";break;case "B":a="us";break;case "0":a="line";break;case "1":a="rom";break;case "2":a="romSpecial"}this.o.H[b]=a}],[/^\033N(a|[^a])/,function(a){Y(this.o,"g2char",a[1])}],[/^\033O(a|[^a])/,function(a){Y(this.o,"g3char",a[1])}],[/^\033([0-9;?]*)n/,
|
---|
115 | A()],[/^\033(\[0?c|Z)/,A()],[/^\033\[>c/,A()],[/^\033\[([0-9;]*)q/,function(a){var b=this;(a[1].length?a[1]:"0").split(";").forEach(function(a){0==parseInt(a,10)?Y(b.o,"led","off"):Y(b.o,"led","on")})}],[/^\033\[[145]?i/,A()],[/^\033\[([0-9;]*)y/,function(){Y(this.o,"hardware","selfTestRaw")}],[/^\033#8/,function(){Y(this.o,"hardware","screenAlignment")}],[/^\033%@/,A()],[/^\033%G/,A()],[/^\033\[9;([0-9]+)\]/,A()],[/^\033\[([0-9]+)(;[0-9]+)?\xb0/,function(a){W(this.o,"borderColor",[a[1],a[2]?a[2].substr(1):
|
---|
116 | u])}]];
|
---|
117 | // Input 10
|
---|
118 | function G(a,b){var c=this;b.name=b.name;b.title=b.title;b.font=b.font;b.fontsize=b.fontsize;b.Cb=b.fontfamily;b.P=b.boldfont;b.Za=b.scan;b.Ga=b.warp;b.loop=b.loop;b.rb=b.autostart;b.Rb=b.onready;b.debug=b.debug;b.Q=b.callback;b.Ba=b.onupdate;b.Ob=b.oncompletion;b.Nb=b.onbookmark;b.Pb=b.onpause;b.Qb=b.onplay;b.Lb=b.noskip;c.yb=function(a){if(c.options.debug)if(c.J&&c.J[c.O]){var d=new Date(1E3*(c.J[c.O].time-c.J[0].time));b.debug(("0"+d.getUTCHours()).slice(-2)+":"+("0"+d.getUTCMinutes()).slice(-2)+
|
---|
119 | ":"+("0"+d.getUTCSeconds()).slice(-2)+" "+a)}else b.debug("--:--:-- "+a)};c.debug=function(a){c.yb("player.js: "+a)};c.options=b;c.options.Ga||(c.options.Ga=1);var d=b.name||"index.rec",e=new XMLHttpRequest;e.open("GET",d,t);e.setRequestHeader("Cache-Control","no-cache");e.setRequestHeader("If-Match","*");e.overrideMimeType("application/octet-stream; charset=x-user-defined");e.onload=function(){if(e.status!=200){alert("ERROR[0] - HTTP request '"+d+"': "+e.statusText+" ["+e.status+"]");if(b.onclose)b.onclose()}else{var f=
|
---|
120 | e.responseText;if(f.search(/[^\x0a\x0dABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=]/)==-1){var i=f.replace(/[\x0A\x0C]/g,""),g=D.la.cb.parse(i);D.la.fb.stringify(g);if(g.G[0]==1398893684&&g.G[1]==1701076831)(g=prompt("Please enter a passphrase to decrypt the stream: "))&&(f=D.ab.ka(i,g).toString(D.la.fb))}try{c.J=new na(f);c.$a=c.J[c.J.length-1].time-c.J[0].time}catch(h){alert(h);if(c.options.onclose)c.options.onclose();return}c.debug("GO");for(var o,q,f="",i=0;i<c.J.length;i++){f=
|
---|
121 | f+c.J[i].data;for(g=RegExp("\u001b\\[[8];([0-9]+);([0-9]+)t","g");;){g=g.exec(f);if(!g)break;c.debug("Found[1]: "+g[1]+"/"+g[2]);o=parseInt(g[2],10);q=parseInt(g[1],10);break}if(!o&&!q)for(var s=RegExp("\u001b\\[([0-9]+);([0-9]+)r","g");;){g=s.exec(f);if(!g)break;var n=parseInt(g[2],10);if(!q||n>q){c.debug("Found[0]: "+g[1]+"/"+n);q=n}}f=f.substr(-12)}c.debug("OK ["+o+"x"+q+"]");f=F(b);f.na=function(){Ea(c)};f.Q=b.Q||A();f.debug=function(a){c.yb(a)};f.width=o||80;f.height=q||24;f.Y=t;c.S=new ia(a,
|
---|
122 | f)}};e.send(u);return this}function Ea(a){if(a.S)a.Eb={wa:{Ab:a.S.o.freeze(),aa:a.S.aa.buffer},index:0},a.options.Rb&&a.options.Rb(new Date(1E3*a.$a)),0<a.options.rb&&(b=a,setTimeout(function(){b.start()},parseInt(a.options.rb,10)));else{var b=a;setTimeout(function(){Ea(b)},10)}}C=G.prototype;C.start=function(a){var b=(new Date).getTime()/1E3,a=a||0;this.pa=t;this.startTime=b;this.rc=this.J[a].time;this.O=a;this.timeout=u;Fa(this);this.options.Qb&&this.options.Qb()};
|
---|
123 | function Fa(a){for(var b=(new Date).getTime()/1E3;!a.action&&a.O<a.J.length&&(a.J[a.O].time-a.rc<(b-a.startTime)*a.options.Ga||a.options.Za);){a.S.aa.parse(a.J[a.O++].data);if(a.options.Lb)break;if(a.options.Za&&1<(new Date).getTime()/1E3-b)break}var c=a.options.Lb&&!a.options.Za||a.action||a.O==a.J.length,b=(new Date).getTime();if(19<b-a.Tb||c||!a.Tb)a.Tb=b,ma(a.S);if(!a.action||a.action(t))if(a.O<a.J.length){a.options.Ba&&(b=a.J[a.O].time-a.J[0].time,c=new Date(1E3*b),a.options.Ba(c,b/a.$a));var d=
|
---|
124 | a;setTimeout(function(){Fa(d)},0)}else a.options.loop?(d=a,a.S.Fa(a.Eb),setTimeout(function(){d.start(0)},a.options.loop)):(a.timeout=u,a.pa=x,a.options.Ba&&(c=new Date(1E3*a.$a),a.options.Ba(c,1)),a.options.Ob&&a.options.Ob(),c=new Date((new Date).getTime()-1E3*a.startTime),a.debug("Completed ["+("0"+c.getUTCHours()).slice(-2)+":"+("0"+c.getUTCMinutes()).slice(-2)+":"+("0"+c.getUTCSeconds()).slice(-2)+"]"))}
|
---|
125 | C.Va=function(){if(this.pa){var a=this;this.action=function(){a.action=u;a.pa=x;this.options.Pb&&this.options.Pb();return x};return x}this.O==this.J.length?this.Xa():this.start(this.O)};C.Vb=function(){var a=this;this.action=function(){a.action=u;a.wa={wa:{Ab:a.S.o.freeze(),aa:a.S.aa.buffer},index:a.O};this.options.Nb&&this.options.Nb();return t};this.pa||this.action(x);return x};
|
---|
126 | C.Wa=function(a){if(a){var b=this;this.action=function(c){b.action=u;b.S.Fa(a.wa);ma(b.S);(c||0==a.index)&&setTimeout(function(){b.start(a.index)},1);return x};this.pa||this.action(x)}};C.Sa=function(){this.Wa(this.wa);return x};C.Xa=function(){this.Wa(this.Eb);return x};C.Cc=function(a){this.options.Ga=a;return x};window.TTVPlayer=G;G.prototype.rewind=G.prototype.Xa;G.prototype.playpause=G.prototype.Va;G.prototype.setBookmark=G.prototype.Vb;G.prototype.resume=G.prototype.Wa;G.prototype.jump=G.prototype.Sa;
|
---|
127 | G.prototype.setWarpFactor=G.prototype.Cc;
|
---|