Setting the stage for a resource status update mechanism
This commit is contained in:
parent
754a4a4027
commit
2cb0be42f0
36 changed files with 872 additions and 773 deletions
|
|
@ -132,8 +132,8 @@ function Ha(a){var b=0;if(a.C.N)for(;b<a.g;){var c=a.a[a.K+b];if(a.L[b]!=c){var
|
|||
y(function(){for(var a=G(document,"c1pjs","video"),b=0;b<a.length;b++){var c=a[b],d=E(c),e=document.createElement("canvas");if(!e||!e.getContext){c.innerHTML="<br/>Missing <canvas> support. Please try a newer web browser.";break}e.setAttribute("class","c1pjs-canvas");e.setAttribute("width",d.screenWidth);e.setAttribute("height",d.screenHeight);e.setAttribute("contenteditable","true");e.setAttribute("autocapitalize","off");e.setAttribute("autocorrect","off");e.style.backgroundColor=d.screenColor;
|
||||
e.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(e.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",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.appendChild(e);var g=new Image,h=e.getContext("2d"),e=new fb(d,e,h,g);g.onload=function(a){return function(){a.X()}}(e,d.charSet);g.src=d.charSet;F(e,c)}});
|
||||
function ib(a){C.call(this,"C1PSerialPort",a);this.C.N=!1;this.D=a.demo;this.reset(!0)}p(ib,C);f=ib.prototype;f.reset=function(a){if(a||this.o!=jb){this.v=-1;this.A=0;this.g="";if(this.D){a=1;if(this.nb){var b=this.nb.match(/\d+/);null!==b&&(a=parseInt(b[0],10))}this.g='10 PRINT "HELLO OSI #'+a+'"\n'}this.B=!0;this.o=kb}};f.start=function(){this.b&&this.D&&(cb(this.b," C\n\n",3E3),setTimeout(function(a){return function(){a.o=lb;cb(a.b,"LOAD\n")}}(this),12E3));this.D=!1};
|
||||
f.T=function(a,b,c){var d=this;switch(b){case "listSerial":return this.H[b]=c,!0;case "loadSerial":return this.H[b]=c,c.onclick=function(){d.H.listSerial&&w(d.H.listSerial.value,function(a,b,c){mb(d,a,b,c)})},!0;case "mountSerial":return!x("Mobi")&&window&&"FileReader"in window?(this.H[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){var b=a.currentTarget[1].files[0],c=new FileReader;c.onload=function(){mb(d,
|
||||
b.name,c.result.toString(),0)};c.readAsText(b);return!1}):c.parentNode.removeChild(c),!0}return!1};f.ca=function(a,b,c,d){this.a=a;this.M=b;this.K=c-b+1;this.I=this.M+this.K;if(this.s=d)Ia(d,b,c,this,this.S),O(d,b,c,this,this.Jb);this.X()};f.ia=function(a,b){a&&!this.C.N&&(this.C.N=!0,this.U=b,this.b=M(b,"keyboard"),this.u=M(b,"debugger"))};
|
||||
f.T=function(a,b,c){var d=this;switch(b){case "listSerial":return this.H[b]=c,!0;case "loadSerial":return this.H[b]=c,c.onclick=function(){d.H.listSerial&&w(d.H.listSerial.value,function(a,b,c){mb(d,a,b,c)})},!0;case "mountSerial":return!x("Mobi")&&window&&"FileReader"in window?(this.H[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.addEventListener("submit",function(a){var b=a.currentTarget[1].files[0],c=new FileReader;c.onload=
|
||||
function(){mb(d,b.name,c.result.toString(),0)};c.readAsText(b);return!1})):c.parentNode.removeChild(c),!0}return!1};f.ca=function(a,b,c,d){this.a=a;this.M=b;this.K=c-b+1;this.I=this.M+this.K;if(this.s=d)Ia(d,b,c,this,this.S),O(d,b,c,this,this.Jb);this.X()};f.ia=function(a,b){a&&!this.C.N&&(this.C.N=!0,this.U=b,this.b=M(b,"keyboard"),this.u=M(b,"debugger"))};
|
||||
function mb(a,b,c,d){if(c){a.A=0;a.g=c;a.B=!0;a.o=kb;if(-1!==b.indexOf(".json",b.length-5))try{d="";var e=eval("("+c+")").bytes;for(c=0;c<e.length;c++)d+=String.fromCharCode(e[c]);a.g=d;a.B=!1}catch(g){a.l('Error processing file "'+b+'": '+g.message);return}a.U&&a.b&&a.s.C.oa?(a.l("auto-loading "+b),a.s.da(),"."!=a.g.charAt(0)?(a.o=lb,cb(a.b,"NEW\nLOAD\n")):(a.o=jb,a.U.reset(!0),cb(a.b,"ML"))):a.l(b+" ready to load")}else a.l('Error loading file "'+b+'" ('+d+")")}
|
||||
f.S=function(a,b){void 0!==b&&(a&1?nb(this):this.g&&!this.A&&nb(this))};f.Jb=function(a,b){void 0!==b&&this.u&&T(this.u,this,a,b,this.u.Ke,!0)};function nb(a){if(void 0!==a.g){a.v=-1;if(a.A<a.g.length){var b=a.g.charCodeAt(a.A++)&255;a.B&&10==b&&(b=13);a.v=b}else a.g="",a.A=0,a.o==lb&&a.b&&cb(a.b," \nRUN\n"),a.o=kb;for(b=a.M+0;b<a.I;b+=2)a.a[b]=0<=a.v?ob:pb;for(b=a.M+1;b<a.I;b+=2)a.a[b]=0<=a.v?a.v:0}}var pb=0,ob=1,kb=0,lb=1,jb=2;
|
||||
y(function(){for(var a=G(document,"c1pjs","serial"),b=0;b<a.length;b++){var c=a[b],d=E(c),d=new ib(d);F(d,c)}});function qb(a){C.call(this,"C1PDiskController",a);this.C.N=!1;this.reset(!0)}p(qb,C);f=qb.prototype;f.reset=function(a){rb(this);this.b=-1;a&&(this.g=[],this.g[0]={Te:0,mb:40,Nb:!0,Ba:20,na:0,Aa:-1,Ra:[]})};
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -2616,7 +2616,7 @@ class Component {
|
|||
/**
|
||||
* Component.getComponentParms(element)
|
||||
*
|
||||
* @param {Object} element from the DOM
|
||||
* @param {HTMLElement} element from the DOM
|
||||
*/
|
||||
static getComponentParms(element)
|
||||
{
|
||||
|
|
@ -2666,7 +2666,7 @@ class Component {
|
|||
* Component.bindComponentControls(component, element, sAppClass)
|
||||
*
|
||||
* @param {Component} component
|
||||
* @param {Object} element from the DOM
|
||||
* @param {HTMLElement} element from the DOM
|
||||
* @param {string} sAppClass
|
||||
*/
|
||||
static bindComponentControls(component, element, sAppClass)
|
||||
|
|
@ -2715,7 +2715,7 @@ class Component {
|
|||
* TODO: This should probably be moved into weblib.js at some point, along with the control binding functions above,
|
||||
* to keep all the browser-related code together.
|
||||
*
|
||||
* @param {Object} element from the DOM
|
||||
* @param {HTMLDocument|HTMLElement|Node} element from the DOM
|
||||
* @param {string} sClass
|
||||
* @param {string} [sObjClass]
|
||||
* @return {Array|NodeList}
|
||||
|
|
@ -3008,7 +3008,7 @@ class Component {
|
|||
* @this {Component}
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas")
|
||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "reset")
|
||||
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {HTMLElement} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {string} [sValue] optional data value
|
||||
* @return {boolean} true if binding was successful, false if unrecognized binding request
|
||||
*/
|
||||
|
|
@ -3608,7 +3608,7 @@ class C1PPanel extends Component {
|
|||
* @this {C1PPanel}
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas")
|
||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "reset")
|
||||
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {HTMLElement} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {string} [sValue] optional data value
|
||||
* @return {boolean} true if binding was successful, false if unrecognized binding request
|
||||
*/
|
||||
|
|
@ -4164,7 +4164,7 @@ class C1PCPU extends Component {
|
|||
* @this {C1PCPU}
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea")
|
||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "run")
|
||||
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {HTMLElement} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {string} [sValue] optional data value
|
||||
* @return {boolean} true if binding was successful, false if unrecognized binding request
|
||||
*/
|
||||
|
|
@ -8206,7 +8206,7 @@ class C1PKeyboard extends Component {
|
|||
* @this {C1PKeyboard}
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea")
|
||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "esc", "ctrl-c")
|
||||
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {HTMLElement} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {string} [sValue] optional data value
|
||||
* @return {boolean} true if binding was successful, false if unrecognized binding request
|
||||
*/
|
||||
|
|
@ -9012,9 +9012,9 @@ class C1PVideo extends Component {
|
|||
*
|
||||
* @this {C1PVideo}
|
||||
* @param {Object} parmsVideo
|
||||
* @param {Object} canvas
|
||||
* @param {Object} context
|
||||
* @param {Object} imgChars
|
||||
* @param {HTMLCanvasElement} canvas
|
||||
* @param {CanvasRenderingContext2D} context
|
||||
* @param {HTMLImageElement} imgChars
|
||||
*/
|
||||
constructor(parmsVideo, canvas, context, imgChars)
|
||||
{
|
||||
|
|
@ -9109,7 +9109,7 @@ class C1PVideo extends Component {
|
|||
* @this {C1PVideo}
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea")
|
||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "refresh")
|
||||
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {HTMLElement} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {string} [sValue] optional data value
|
||||
* @return {boolean} true if binding was successful, false if unrecognized binding request
|
||||
*/
|
||||
|
|
@ -9471,7 +9471,7 @@ class C1PVideo extends Component {
|
|||
* I've since settled on a better work-around in keyboard.js, so I've stopped worrying about how to make
|
||||
* "autocapitalize" work here.
|
||||
*/
|
||||
var eCanvas = document.createElement("canvas");
|
||||
var eCanvas = /** @type {HTMLCanvasElement} */ (document.createElement("canvas"));
|
||||
if (eCanvas === undefined || !eCanvas.getContext) {
|
||||
eVideo.innerHTML = "<br/>Missing <canvas> support. Please try a newer web browser.";
|
||||
return;
|
||||
|
|
@ -9510,7 +9510,7 @@ class C1PVideo extends Component {
|
|||
* document.createElement('img') would.
|
||||
*/
|
||||
var imgCharSet = new Image();
|
||||
var eContext = eCanvas.getContext("2d");
|
||||
var eContext = /** @type {CanvasRenderingContext2D} */ (eCanvas.getContext("2d"));
|
||||
var video = new C1PVideo(parmsVideo, eCanvas, eContext, imgCharSet);
|
||||
imgCharSet.onload = function(video, sCharSet) {
|
||||
return function() {
|
||||
|
|
@ -9608,7 +9608,7 @@ class C1PSerialPort extends Component {
|
|||
* @this {C1PSerialPort}
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea")
|
||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "listSerial")
|
||||
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {HTMLElement} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {string} [sValue] optional data value
|
||||
* @return {boolean} true if binding was successful, false if unrecognized binding request
|
||||
*/
|
||||
|
|
@ -9653,7 +9653,7 @@ class C1PSerialPort extends Component {
|
|||
submit.disabled = !files.length;
|
||||
});
|
||||
|
||||
control.onsubmit = function(event) {
|
||||
control.addEventListener('submit', function(event) {
|
||||
var file = event.currentTarget[1].files[0];
|
||||
|
||||
var reader = new FileReader();
|
||||
|
|
@ -9667,7 +9667,7 @@ class C1PSerialPort extends Component {
|
|||
* Prevent reloading of web page after form submission
|
||||
*/
|
||||
return false;
|
||||
};
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (DEBUG) this.log("Local file support not available");
|
||||
|
|
@ -10596,7 +10596,7 @@ class C1PDiskController extends Component {
|
|||
* @this {C1PDiskController}
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea")
|
||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "listDisk")
|
||||
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {HTMLElement} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {string} [sValue] optional data value
|
||||
* @return {boolean} true if binding was successful, false if unrecognized binding request
|
||||
*/
|
||||
|
|
@ -11669,7 +11669,7 @@ class C1PDebugger extends Component {
|
|||
* @this {C1PDebugger}
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea", "canvas")
|
||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "reset")
|
||||
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {HTMLElement} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {string} [sValue] optional data value
|
||||
* @return {boolean} true if binding was successful, false if unrecognized binding request
|
||||
*/
|
||||
|
|
@ -13512,7 +13512,7 @@ class C1PComputer extends Component {
|
|||
* @this {C1PComputer}
|
||||
* @param {string|null} sHTMLType is the type of the HTML control (eg, "button", "list", "text", "submit", "textarea")
|
||||
* @param {string} sBinding is the value of the 'binding' parameter stored in the HTML control's "data-value" attribute (eg, "reset")
|
||||
* @param {Object} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {HTMLElement} control is the HTML control DOM object (eg, HTMLButtonElement)
|
||||
* @param {string} [sValue] optional data value
|
||||
* @return {boolean} true if binding was successful, false if unrecognized binding request
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ function Ba(a){var b=0;if(a.u.I)for(;b<a.c;){var c=a.a[a.s+b];if(a.v[b]!=c){var
|
|||
x(function(){for(var a=J(document,"c1pjs","video"),b=0;b<a.length;b++){var c=a[b],d=H(c),f=document.createElement("canvas");if(!f||!f.getContext){c.innerHTML="<br/>Missing <canvas> support. Please try a newer web browser.";break}f.setAttribute("class","c1pjs-canvas");f.setAttribute("width",d.screenWidth);f.setAttribute("height",d.screenHeight);f.setAttribute("contenteditable","true");f.setAttribute("autocapitalize","off");f.setAttribute("autocorrect","off");f.style.backgroundColor=d.screenColor;
|
||||
f.style.height="auto";0<=(window?window.navigator.userAgent:"").indexOf("MSIE")&&(f.style.height=(c.clientWidth*d.screenHeight/d.screenWidth|0)+"px",c.onresize=function(a,b,c,d){return function(){b.style.height=(a.clientWidth*d/c|0)+"px"}}(c,f,d.screenWidth,d.screenHeight));c.appendChild(f);var g=new Image,h=f.getContext("2d"),f=new Ua(d,f,h,g);g.onload=function(a){return function(){a.R()}}(f,d.charSet);g.src=d.charSet;I(f,c)}});
|
||||
function Xa(a){E.call(this,"C1PSerialPort",a);this.u.I=!1;this.j=a.demo;this.reset(!0)}q(Xa,E);e=Xa.prototype;e.reset=function(a){if(a||this.f!=Ya){this.g=-1;this.h=0;this.c="";if(this.j){a=1;if(this.Ba){var b=this.Ba.match(/\d+/);null!==b&&(a=parseInt(b[0],10))}this.c='10 PRINT "HELLO OSI #'+a+'"\n'}this.i=!0;this.f=Za}};e.start=function(){this.b&&this.j&&(W(this.b," C\n\n",3E3),setTimeout(function(a){return function(){a.f=$a;W(a.b,"LOAD\n")}}(this),12E3));this.j=!1};
|
||||
e.L=function(a,b,c){var d=this;switch(b){case "listSerial":return this.B[b]=c,!0;case "loadSerial":return this.B[b]=c,c.onclick=function(){d.B.listSerial&&v(d.B.listSerial.value,function(a,b,c){ab(d,a,b,c)})},!0;case "mountSerial":return!w("Mobi")&&window&&"FileReader"in window?(this.B[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.onsubmit=function(a){var b=a.currentTarget[1].files[0],c=new FileReader;c.onload=function(){ab(d,
|
||||
b.name,c.result.toString(),0)};c.readAsText(b);return!1}):c.parentNode.removeChild(c),!0}return!1};e.Y=function(a,b,c,d){this.a=a;this.m=b;this.s=c-b+1;this.o=this.m+this.s;if(this.G=d)Ca(d,b,c,this,this.X),Q(d,b,c,this,this.ab);this.R()};e.$=function(a,b){a&&!this.u.I&&(this.u.I=!0,this.J=b,this.b=O(b,"keyboard"))};
|
||||
e.L=function(a,b,c){var d=this;switch(b){case "listSerial":return this.B[b]=c,!0;case "loadSerial":return this.B[b]=c,c.onclick=function(){d.B.listSerial&&v(d.B.listSerial.value,function(a,b,c){ab(d,a,b,c)})},!0;case "mountSerial":return!w("Mobi")&&window&&"FileReader"in window?(this.B[b]=c,c.addEventListener("change",function(){var a=c.children[0];a.children[1].disabled=!a.children[0].files.length}),c.addEventListener("submit",function(a){var b=a.currentTarget[1].files[0],c=new FileReader;c.onload=
|
||||
function(){ab(d,b.name,c.result.toString(),0)};c.readAsText(b);return!1})):c.parentNode.removeChild(c),!0}return!1};e.Y=function(a,b,c,d){this.a=a;this.m=b;this.s=c-b+1;this.o=this.m+this.s;if(this.G=d)Ca(d,b,c,this,this.X),Q(d,b,c,this,this.ab);this.R()};e.$=function(a,b){a&&!this.u.I&&(this.u.I=!0,this.J=b,this.b=O(b,"keyboard"))};
|
||||
function ab(a,b,c,d){if(c){a.h=0;a.c=c;a.i=!0;a.f=Za;if(-1!==b.indexOf(".json",b.length-5))try{d="";var f=eval("("+c+")").bytes;for(c=0;c<f.length;c++)d+=String.fromCharCode(f[c]);a.c=d;a.i=!1}catch(g){a.F('Error processing file "'+b+'": '+g.message);return}a.J&&a.b&&a.G.u.Z?(a.F("auto-loading "+b),a.G.ca(),"."!=a.c.charAt(0)?(a.f=$a,W(a.b,"NEW\nLOAD\n")):(a.f=Ya,a.J.reset(!0),W(a.b,"ML"))):a.F(b+" ready to load")}else a.F('Error loading file "'+b+'" ('+d+")")}
|
||||
e.X=function(a,b){void 0!==b&&(a&1?bb(this):this.c&&!this.h&&bb(this))};e.ab=function(){};function bb(a){if(void 0!==a.c){a.g=-1;if(a.h<a.c.length){var b=a.c.charCodeAt(a.h++)&255;a.i&&10==b&&(b=13);a.g=b}else a.c="",a.h=0,a.f==$a&&a.b&&W(a.b," \nRUN\n"),a.f=Za;for(b=a.m+0;b<a.o;b+=2)a.a[b]=0<=a.g?cb:db;for(b=a.m+1;b<a.o;b+=2)a.a[b]=0<=a.g?a.g:0}}var db=0,cb=1,Za=0,$a=1,Ya=2;x(function(){for(var a=J(document,"c1pjs","serial"),b=0;b<a.length;b++){var c=a[b],d=H(c),d=new Xa(d);I(d,c)}});
|
||||
function eb(a){E.call(this,"C1PDiskController",a);this.u.I=!1;this.reset(!0)}q(eb,E);e=eb.prototype;e.reset=function(a){fb(this);this.b=-1;a&&(this.c=[],this.c[0]={de:0,Ga:40,cb:!0,ia:20,aa:0,ha:-1,qa:[]})};
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue