PDP-11 panel switches can now be scripted

This commit is contained in:
Jeff Parsons 2017-02-06 13:07:15 -08:00 • committed by Jeff Parsons
commit 2e93b71095
14 changed files with 334 additions and 224 deletions

View file

@ -32,7 +32,7 @@ function ka(a,b,c){for(var d=!0;c<b.length;){var f=b[c],g=f[0],h=null;0<=la.inde
e.toString=function(){return this.name?this.name:this.id||this.type};
e.L=function(a,b,c){switch(b){case "clear":return this.B[b]||(this.B[b]=c,c.onclick=function(a){return function(){a.B.print&&(a.B.print.value="")}}(this)),!0;case "print":return this.B[b]||(this.sa=this.B[b]=c,c.value="",this.F=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.ta=function(a){this.F(a,this.va)}),!0;default:return!1}};e.log=function(){};e.F=function(){};
e.status=function(a){this.F(this.va+": "+a)};e.ta=function(a,b,c){c=c||this.type;b||z((c?c+": ":"")+a)};function oa(a,b){a.u.error=!0;a.ta(b)}function I(a,b){b&&(a.u.ready?b():a.ua=b);return a.u.ready}e.R=function(a){this.u.error||(this.u.ready=!1!==a,this.u.ready&&(a=this.ua,this.ua=null,a&&a()))};function pa(a,b){if(a.u.wa)return a.u.ra=!1,a.u.wa=!1;if(a.u.error)return a.F(a.toString()+" error"),!1;a.u.ra=b;return a.u.ra}
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var J=window?window.PCjs.Machines:{},D=window?window.PCjs.Components:[],la=["sleep","wait"],ma={alert:function(a){z(a);return!0},sleep:function(a,b){setTimeout(a,+b);return!1}},na={select:function(a,b,c){var d=!1;if(a=a.bindings[b])for(b=0;b<a.options.length;b++)if(a.options[b].textContent==c){a.selectedIndex!=b&&(a.selectedIndex=b);d=!0;break}return d}};
window&&(window.PCjs||(window.PCjs={}),window.PCjs.Machines||(window.PCjs.Machines={}),window.PCjs.Components||(window.PCjs.Components=[]));var J=window?window.PCjs.Machines:{},D=window?window.PCjs.Components:[],la=["hold","sleep","wait"],ma={alert:function(a){z(a);return!0},sleep:function(a,b){setTimeout(a,+b);return!1}},na={select:function(a,b,c){var d=!1;if(a=a.bindings[b])for(b=0;b<a.options.length;b++)if(a.options[b].textContent==c){a.selectedIndex!=b&&(a.selectedIndex=b);d=!0;break}return d}};
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});Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});
Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return f.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),f=this;c.prototype=this.prototype;b.prototype=new c;return b});function K(a){C.call(this,"C1PPanel",a);this.u.I=!1}p(K,C);
K.prototype.L=function(a,b,c,d){return this.J&&this.J.L(a,b,c,d)||this.G&&this.G.L(a,b,c,d)||this.b&&this.b.L(a,b,c,d)?!0:C.prototype.L.call(this,a,b,c,d)};K.prototype.$=function(a,b){a&&!this.u.I&&(this.u.I=!0,this.J=b,this.G=L(b,"cpu"),this.b=L(b,"keyboard"),qa())};function qa(){for(var a=!1,b=H(document,"c1pjs","panel"),c=0;c<b.length;c++){var d=b[c],f=F(d),g=E(f.id);g||(a=!0,g=new K(f));G(g,d);a&&g.R()}}v(qa);