diff --git a/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md b/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md index 115bd5dc7..dd4bade4a 100644 --- a/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md +++ b/devices/pdp11/machine/1170/panel/debugger/xxdp/README.md @@ -14,10 +14,10 @@ machines: sticky: top commands: bootXXDP: | - select rl11 listDrives RL0 - select rl11 listDisks "XXDP+ Diagnostics" - load rl11 - boot rl11 + select rl11 listDrives RL0; + select rl11 listDisks "XXDP+ Diagnostics"; + click rl11 loadDisk; + click rl11 bootDisk --- This machine is ready to boot [XXDP+ Diagnostics](/disks/dec/rl02k/xxdp/) ("BOOT RL0") and run diff --git a/docs/pcx86/examples/components.xsl b/docs/pcx86/examples/components.xsl index e873f0c46..fa882c147 100644 --- a/docs/pcx86/examples/components.xsl +++ b/docs/pcx86/examples/components.xsl @@ -14,11 +14,11 @@ pcjs pcx86 PCx86 - 1.32.1 + 1.32.2 www.pcjs.org - + diff --git a/modules/htmlout/lib/htmlout.js b/modules/htmlout/lib/htmlout.js index 353e2a5bc..694974570 100644 --- a/modules/htmlout/lib/htmlout.js +++ b/modules/htmlout/lib/htmlout.js @@ -1923,7 +1923,6 @@ HTMLOut.prototype.processMachines = function(aMachines, buildOptions, done) var sScriptFolder = sScriptName == "c1p"? "c1pjs" : (sScriptName.substr(0, 3) == "pdp"? "pdpjs" : sScriptName); asFiles.push("/versions/" + sScriptFolder + "/" + sVersion + "/components.css"); asFiles.push("/versions/" + sScriptFolder + "/" + sVersion + "/" + sScriptFile); - this.addFilesToHTML(asFiles, sScriptEmbed); } else if (asFiles = aMachineFiles[sType]) { /* @@ -1968,22 +1967,26 @@ HTMLOut.prototype.processMachines = function(aMachines, buildOptions, done) } } } - this.addFilesToHTML(asFiles, sScriptEmbed); - if (infoMachine['sticky']) { - asFiles = []; - asFiles.push("/modules/shared/lib/sticky.js"); - sScriptEmbed = ''; - this.addFilesToHTML(asFiles, sScriptEmbed); - } - if (buildOptions.id) { - asFiles = []; - asFiles.push("/modules/build/lib/build.js"); - sScriptEmbed = ''; - this.addFilesToHTML(asFiles, sScriptEmbed); - } } else { HTMLOut.logDebug('HTMLOut.processMachines(): unrecognized machine type "' + sType + '"'); + continue; + } + + this.addFilesToHTML(asFiles, sScriptEmbed); + + if (infoMachine['sticky']) { + asFiles = []; + asFiles.push("/modules/shared/lib/sticky.js"); + sScriptEmbed = ''; + this.addFilesToHTML(asFiles, sScriptEmbed); + } + + if (buildOptions.id) { + asFiles = []; + asFiles.push("/modules/build/lib/build.js"); + sScriptEmbed = ''; + this.addFilesToHTML(asFiles, sScriptEmbed); } } if (done) done(); diff --git a/modules/markout/lib/markout.js b/modules/markout/lib/markout.js index 998e9c794..241a96bdb 100644 --- a/modules/markout/lib/markout.js +++ b/modules/markout/lib/markout.js @@ -114,6 +114,7 @@ function MarkOut(sMD, sIndent, req, aParms, fDebug, sMachineFile, fAutoHeading) this.aMachines = []; // this keeps track of embedded machines on the page this.buildOptions = {}; // this keeps track of any build options specified on the page this.aMachineDefs = {}; // this keeps track of any machine definitions at the top of the file (as part of any Jekyll "Front Matter") + this.aCommandDefs = {}; // this keeps track of any command definitions at the top of the file (as part of any Jekyll "Front Matter") } /* @@ -426,10 +427,12 @@ MarkOut.prototype.convertMD = function(sIndent) if (sMD.substr(0, 3) == "---") { aMatch = sMD.match(/^---([\s\S]*?)---[ \t]*\n*/); if (aMatch) { + /* * Remove the Front Matter. */ sMD = sMD.replace(aMatch[0], ""); + /* * Extract machine definitions, if any, from the Front Matter. */ @@ -519,14 +522,31 @@ MarkOut.prototype.convertMD = function(sIndent) if (id) this.aMachineDefs[id] = machine; } } + + var aCommandDefs = aMatch[1].match(/\ncommands:([\s\S]*?)\n([^\s]|$)/); + if (aCommandDefs) { + var reCommand = /[ \t]+([^:]+):\s*\|/g; + var aCommands = aCommandDefs[1].split(reCommand); + /* + * Since the preceding RegExp contains a capture group (representing the name of the command), + * it will be "spliced" into the split results. So, aCommands[0] will be whatever characters precede + * the first command (which we can ignore), followed by the first command name, followed by one or more + * command lines, followed by the second command name, followed by one or more command lines, and so on. + */ + for (var iCommand = 1; iCommand < aCommands.length; iCommand += 2) { + this.aCommandDefs[aCommands[iCommand]] = aCommands[iCommand+1].trim().replace(/\n[ \t]*/g, "").replace(/"/g, """); + } + } + /* - * If a "title" element existed in the Front Matter, this code auto-generates a top-level - * heading with the same value. + * If a "title" element existed in the Front Matter, this code auto-generates a top-level heading + * with the same value. */ if (this.fAutoHeading) { aSubMatch = aMatch[1].match(/title:\s*(.*?)\s*?\n/); if (aSubMatch) sMD = aSubMatch[1] + "\n---\n\n" + sMD; } + /* * If a "build" ID element existed in the Front Matter, capture it. */ @@ -576,7 +596,7 @@ MarkOut.prototype.convertMD = function(sIndent) * you want the second paragraph to appear as a code block, it must be indented TWICE (by 8 spaces * or 2 tabs). That behavior should fall out of this hack as well. */ - var re = /(^|\n)( ? ?)([\*+-]|[0-9]+\.)([^\n]*\n)([ \t]+[^\n]*\n|\n)+([ \t]+[^\n]+)/g; + var re = /(^|\n)( ? ?)([*+-]|[0-9]+\.)([^\n]*\n)([ \t]+[^\n]*\n|\n)+([ \t]+[^\n]+)/g; //noinspection UnnecessaryLocalVariableJS var sMDOrig = sMD; while ((aMatch = re.exec(sMDOrig))) { @@ -845,7 +865,7 @@ MarkOut.prototype.convertMDList = function(sBlock, sIndent) var aMatch; var aMatches = []; - var re = /(^|\n) ? ? ?([\*+-]|[0-9]+\.)[ \t]+/g; + var re = /(^|\n) ? ? ?([*+-]|[0-9]+\.)[ \t]+/g; while ((aMatch = re.exec(sBlock))) { aMatches.push(aMatch); } @@ -946,8 +966,8 @@ MarkOut.prototype.convertMDLinks = function(sBlock) * page's Front Matter; however, unless/until we start using Node again to host the public site, * that's low priority. */ - sBlock = sBlock.replace(/([^\t])\{([\{%]).*?\2}/g, "$1"); - sBlock = sBlock.replace(/(\{)([\{%])(.*?\2})/g, "
$1$2$3
"); + sBlock = sBlock.replace(/([^\t])\{([{%]).*?\2}/g, "$1"); + sBlock = sBlock.replace(/(\{)([{%])(.*?\2})/g, "
$1$2$3
"); var aMatch; var re = /\[([^\[\]]*)]\((.*?)(?:\s*"(.*?)"\)|\))/g; @@ -1283,11 +1303,17 @@ MarkOut.prototype.convertMDMachineLinks = function(sBlock) var sControl = findParm(aParms, 'type') || 'button'; var sControlType = sControl == 'button'? ' type="button"' : ''; if (this.aMachineDefs[sMachineID]) { + var sCommand = findParm(aParms, 'command'); + var sValue = findParm(aParms, 'value'); + if (this.aCommandDefs[sCommand]) { + sValue = this.aCommandDefs[sCommand]; + sCommand = "script"; + } sReplacement = '<' + sControl + sControlType + ' onclick="commandMachine('; sReplacement += "'" + sMachineID + "',"; sReplacement += "'" + findParm(aParms, 'component') + "',"; - sReplacement += "'" + findParm(aParms, 'command') + "',"; - sReplacement += "'" + findParm(aParms, 'value') + "')"; + sReplacement += "'" + sCommand + "',"; + sReplacement += "'" + sValue + "')"; sReplacement += '">' + (findParm(aParms, 'label') || 'Try It!') + ''; } else { sReplacement = ""; @@ -1350,8 +1376,8 @@ MarkOut.prototype.convertMDEmphasis = function(sBlock) * *[modules](/modules/)* */ if (sBlock.indexOf('*') >= 0 || sBlock.indexOf('_') >= 0) { - sBlock = sBlock.replace(/(^|[^a-z0-9-])([\*_])\2([\s\S]*?)\2\2([^a-z0-9-]|$)/gi, "$1$3$4"); - sBlock = sBlock.replace(/(^|[^a-z0-9-])([\*_])([\s\S]*?)\2([^a-z0-9-]|$)/gi, "$1$3$4"); + sBlock = sBlock.replace(/(^|[^a-z0-9-])([*_])\2([\s\S]*?)\2\2([^a-z0-9-]|$)/gi, "$1$3$4"); + sBlock = sBlock.replace(/(^|[^a-z0-9-])([*_])([\s\S]*?)\2([^a-z0-9-]|$)/gi, "$1$3$4"); } return sBlock; }; diff --git a/modules/shared/es6/component.js b/modules/shared/es6/component.js index a16547255..d98e423de 100644 --- a/modules/shared/es6/component.js +++ b/modules/shared/es6/component.js @@ -105,7 +105,18 @@ class Component { this.name = parms['name']; this.comment = parms['comment']; this.parms = parms; - this['exports'] = {}; + + /* + * The following Component properties need to be accessible by other machines and/or command scripts; + * well, OK, or we could have exported some new functions to walk the contents of these properties, as we + * did with findMachineComponent(), but this works just as well. + * + * Also, while the double-assignment looks silly (ie, using both dot and bracket property notation), it + * resolves a complaint from the Closure Compiler, because if we use ONLY bracket notation here, then the + * Compiler wants us to change all the other references to bracket notation as well. + */ + this.exports = this['exports'] = {}; + this.bindings = this['bindings'] = {}; var i = this.id.indexOf('.'); if (i < 0) { @@ -129,7 +140,6 @@ class Component { this.fnReady = null; this.clearError(); - this.bindings = {}; this.bitsMessage = bitsMessage || 0; /** @type {Object|null} controlPrint is the HTML control, if any, that we can print to */ diff --git a/modules/shared/lib/sticky.js b/modules/shared/lib/sticky.js index 3b8d3b41a..6b5ed191c 100644 --- a/modules/shared/lib/sticky.js +++ b/modules/shared/lib/sticky.js @@ -112,15 +112,19 @@ function commandMachine(idMachine, sComponent, sCommand, sValue) if (window.findMachineComponent) { var component = window.findMachineComponent(idMachine, sComponent); if (component) { - var exports = component['exports']; - if (exports) { - var fnCommand = exports[sCommand]; - if (fnCommand) { - //noinspection JSUnresolvedFunction - if (!fnCommand.call(component, sValue)) { - window.alert("Error calling " + idMachine + "." + sComponent + "." + sCommand + "(" + sValue + ")"); + if (sCommand == "script") { + window.alert("commandScript('" + sValue + "')"); + } else { + var exports = component['exports']; + if (exports) { + var fnCommand = exports[sCommand]; + if (fnCommand) { + //noinspection JSUnresolvedFunction + if (!fnCommand.call(component, sValue)) { + window.alert("Error calling " + idMachine + "." + sComponent + "." + sCommand + "(" + sValue + ")"); + } + return; } - return; } } } diff --git a/versions/pc8080/1.32.2/pc8080-dbg.js b/versions/pc8080/1.32.2/pc8080-dbg.js index ab158f058..ed250fac8 100644 --- a/versions/pc8080/1.32.2/pc8080-dbg.js +++ b/versions/pc8080/1.32.2/pc8080-dbg.js @@ -32,7 +32,7 @@ var k;function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a;for(var d in b)if(Object.defineProperties){var e=Object.getOwnPropertyDescriptor(b,d);e&&Object.defineProperty(a,d,e)}else a[d]=b[d]} var m={le:0,oe:1,pe:2,qe:3,re:4,se:5,te:6,ue:7,ve:8,we:9,xe:10,ye:11,ze:12,Ae:13,Be:14,Ce:15,De:16,Ee:17,Fe:18,Ge:19,He:20,Ie:21,Je:22,Ke:23,Le:24,Me:25,Ne:26," ":32,"!":33,'"':34,"#":35,$:36,"%":37,"&":38,"'":39,"(":40,")":41,"*":42,"+":43,",":44,"-":45,".":46,"/":47,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,":":58,";":59,"<":60,"=":61,">":62,"?":63,"@":64,pb:65,rc:66,tc:67,Rb:68,E:69,xc:70,yc:71,zc:72,Ac:73,Hc:74,Ic:75,Ub:76,Pc:77,Qc:78,Sc:79,Tc:80,Q:81,Zc:82,bd:83,hd:84,jd:85,kd:86,ld:87, nd:88,od:89,Db:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,pd:97,wf:98,xf:99,d:100,e:101,yf:102,zf:103,Af:104,Bf:105,Cf:106,k:107,Df:108,Ef:109,n:110,Ff:111,p:112,q:113,r:114,Gf:115,t:116,If:117,Jf:118,Kf:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,Oe:127}; -function n(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.bc=b.comment;this.wd=b;this.exports={};a=this.id.indexOf(".");0>a?this.$a=this.id:(this.ab=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.G={ready:!1,jb:!1,Eb:!1,ja:!1,error:!1};this.vb=null;this.G.error=!1;this.P={};this.ha=d||0;this.K=this.u=this.H=this.S=this.ta=null;ca.push(this)}function da(a,b,c){ea[a]&&b&&(ea[a][b]=c)}function fa(){return Date.now()||+new Date} +function n(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.bc=b.comment;this.wd=b;this.exports={};this.P=this.bindings={};a=this.id.indexOf(".");0>a?this.$a=this.id:(this.ab=this.id.substr(0,a),this.$a=this.id.substr(a+1));this.G={ready:!1,jb:!1,Eb:!1,ja:!1,error:!1};this.vb=null;this.G.error=!1;this.ha=d||0;this.K=this.u=this.H=this.S=this.ta=null;ca.push(this)}function da(a,b,c){ea[a]&&b&&(ea[a][b]=c)}function fa(){return Date.now()||+new Date} function ga(a,b,c){b||q((c?c+": ":"")+a)}function q(a){window&&window.alert(a)}function ha(a){var b=!1;window&&(b=window.confirm(a));return b}function ja(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b":62,"?":63,"@":64,Ua:65,Sb:66,Ub:67,rb:68,E:69,Xb:70,Yb:71,Zb:72,$b:73,gc:74,hc:75,tb:76,oc:77,pc:78,sc:79,tc:80,Q:81,zc:82,Cc:83,Hc:84,Ic:85,Jc:86,Kc:87, Mc:88,Nc:89,ib:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,Oc:97,Te:98,Ue:99,d:100,e:101,Ve:102,We:103,Xe:104,Ye:105,Ze:106,k:107,$e:108,af:109,n:110,bf:111,p:112,q:113,r:114,cf:115,t:116,df:117,ef:118,ff:119,x:120,y:121,z:122,"{":123,"|":124,"}":125,"~":126,le:127}; -function q(a,b){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Ab=b.comment;this.Rc=b;this.exports={};a=this.id.indexOf(".");0>a?this.Wa=this.id:(this.Ia=this.id.substr(0,a),this.Wa=this.id.substr(a+1));this.i={ready:!1,Ya:!1,kb:!1,U:!1,error:!1};this.ab=null;this.i.error=!1;this.w={};this.J=this.m=this.u=this.F=this.pa=null;r.push(this)}function aa(a,b,c){ba[a]&&b&&(ba[a][b]=c)}function da(){return Date.now()||+new Date}function ea(a,b,c){b||u((c?c+": ":"")+a)} -function u(a){window&&window.alert(a)}function fa(a){var b=!1;window&&(b=window.confirm(a));return b}function ga(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;ba?this.Wa=this.id:(this.Ia=this.id.substr(0,a),this.Wa=this.id.substr(a+1));this.i={ready:!1,Ya:!1,kb:!1,U:!1,error:!1};this.ab=null;this.i.error=!1;this.J=this.m=this.u=this.F=this.pa=null;r.push(this)}function aa(a,b,c){ba[a]&&b&&(ba[a][b]=c)}function da(){return Date.now()||+new Date} +function ea(a,b,c){b||u((c?c+": ":"")+a)}function u(a){window&&window.alert(a)}function fa(a){var b=!1;window&&(b=window.confirm(a));return b}function ga(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b":62,"?":63,"@":64,Ic:65,qg:66,sg:67,Pg:68,E:69,Qg:70,Rg:71,Sg:72,Tg:73,Ug:74,Vg:75,Wg:76,Xg:77,Yg:78,Zg:79,$g:80,Q:81,ah:82,bh:83,dh:84,eh:85,fh:86,gh:87,hh:88,ih:89,Gd:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,jh:97,kh:98,lh:99,d:100,e:101,nh:102,oh:103,ph:104,qh:105,th:106,k:107,uh:108,vh:109,n:110,wh:111,p:112,q:113,r:114,xh:115,t:116,zh:117,Ah:118,Bh:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,xd:127};function q(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Rc=b.comment;this.Fd=b;this.exports={};a=this.id.indexOf(".");0>a?this.lb=this.id:(this.mb=this.id.substr(0,a),this.lb=this.id.substr(a+1));this.A={ready:!1,eb:!1,zc:!1,fa:!1,error:!1};this.dc=null;this.A.error=!1;this.B={};this.ha=d||0;this.F=this.f=this.D=this.J=this.Pa=null;ta.push(this)}function ua(a,b,c){va[a]&&b&&(va[a][b]=c)} +"|":124,"}":125,"~":126,xd:127};function q(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.Rc=b.comment;this.Fd=b;this.exports={};this.B=this.bindings={};a=this.id.indexOf(".");0>a?this.lb=this.id:(this.mb=this.id.substr(0,a),this.lb=this.id.substr(a+1));this.A={ready:!1,eb:!1,zc:!1,fa:!1,error:!1};this.dc=null;this.A.error=!1;this.ha=d||0;this.F=this.f=this.D=this.J=this.Pa=null;ta.push(this)}function ua(a,b,c){va[a]&&b&&(va[a][b]=c)} function xa(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function ya(a){var b=!1;window&&(b=window.confirm(a));return b}function za(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b":62,"?":63,"@":64,hc:65,Gf:66,If:67,eg:68,E:69,fg:70,gg:71,hg:72,ig:73,jg:74,kg:75,lg:76,mg:77,ng:78,og:79,pg:80,Q:81,qg:82,rg:83,sg:84,tg:85,ug:86,vg:87,wg:88,xg:89,Uc:90,"[":91,"\\":92,"]":93,"^":94,_:95,"`":96,yg:97,zg:98,Ag:99,d:100,e:101,Cg:102,Dg:103,Eg:104,Fg:105,Ig:106,k:107,Jg:108,Kg:109,n:110,Lg:111,p:112,q:113,r:114,Mg:115,t:116,Ng:117,Og:118,Pg:119,x:120,y:121,z:122,"{":123, -"|":124,"}":125,"~":126,Jc:127};function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.mc=b.comment;this.Rc=b;this.exports={};a=this.id.indexOf(".");0>a?this.La=this.id:(this.Ma=this.id.substr(0,a),this.La=this.id.substr(a+1));this.l={ready:!1,Ta:!1,Xb:!1,R:!1,error:!1};this.Bb=null;this.l.error=!1;this.j={};this.Kc=d||0;this.D=this.c=this.u=this.A=this.ab=null;u.push(this)}function qa(a,b,c){ra[a]&&b&&(ra[a][b]=c)} +"|":124,"}":125,"~":126,Jc:127};function r(a,b,c,d){this.type=a;b||(b={id:"",name:""});this.id=b.id||"";this.name=b.name;this.mc=b.comment;this.Rc=b;this.exports={};this.j=this.bindings={};a=this.id.indexOf(".");0>a?this.La=this.id:(this.Ma=this.id.substr(0,a),this.La=this.id.substr(a+1));this.l={ready:!1,Ta:!1,Xb:!1,R:!1,error:!1};this.Bb=null;this.l.error=!1;this.Kc=d||0;this.D=this.c=this.u=this.A=this.ab=null;u.push(this)}function qa(a,b,c){ra[a]&&b&&(ra[a][b]=c)} function sa(){return Date.now()||+new Date}function v(a){window&&window.alert(a)}function ta(a){var b=!1;window&&(b=window.confirm(a));return b}function y(a){var b,c=[];a&&(a=0<(b=a.indexOf("."))?a.substr(0,b+1):"");for(b=0;b