diff --git a/Gruntfile.js b/Gruntfile.js index b9619dfc0..b5a462bf7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -30,14 +30,14 @@ /* * Overview - * --- + * -------- * Based on the specified version in package.json, we build a matching version folder in /versions * for each of the machine simulations; each of those folders in turn receives compiled versions of * the corresponding machine simulation scripts (c1p*.js and pc*.js), along with copies of both the * shared and machine-specific CSS and XSL stylesheets that the scripts rely on. * * Usage - * --- + * ----- * grunt [task[:target] ...] [--rebuild] * * If no tasks are specified, the "default" task alias will be run. If --rebuild is present, @@ -53,7 +53,7 @@ * it's also possible I didn't have it configured properly at the time. * * Utility Tasks - * --- + * ------------- * grunt compile: runs "closureCompiler" to produce compiled c1p*.js and pc*.js scripts * grunt nocompile: runs "concat" to produce uncompiled c1p*.js and pc*.js scripts * grunt promote: runs "replace" to promote all machine XML files to the current version @@ -62,13 +62,13 @@ * a final "grunt compile" (or "grunt --rebuild") and retest before pushing out a new release. * * The "manifester" Task - * --- + * --------------------- * I added the "manifester" task to process manifest.xml files, which I use to record the existence * application archives. "manifester" walks all the manifests and verifies that they're still valid, * and optionally fetches local copies of everything described. * * The "prepjs" Task - * --- + * ----------------- * I added the "prepjs" task to perform the same constant inlining that my old PHP script "inline.php" * used to do as part of the old "jsmachines.net" build process. Unfortunately, Grunt appears to be * a real memory hog, and so "prepjs" had to be disabled until I could resolve that issue (see my notes @@ -120,11 +120,11 @@ module.exports = function(grunt) { */ var pkg = grunt.file.readJSON("package.json"); - var tmpC1Pjs = "./tmp/c1pjs/" + pkg.version + "/c1p.js"; - var tmpPCx86 = "./tmp/pcx86/" + pkg.version + "/pcx86.js"; - var tmpPC8080 = "./tmp/pc8080/" + pkg.version + "/pc8080.js"; - var tmpPDP10 = "./tmp/pdpjs/" + pkg.version + "/pdp10.js"; - var tmpPDP11 = "./tmp/pdpjs/" + pkg.version + "/pdp11.js"; + var tmpC1Pjs = "./versions/c1pjs/" + pkg.version + "/c1p-uncompiled.js"; + var tmpPCx86 = "./versions/pcx86/" + pkg.version + "/pcx86-uncompiled.js"; + var tmpPC8080 = "./versions/pc8080/" + pkg.version + "/pc8080-uncompiled.js"; + var tmpPDP10 = "./versions/pdpjs/" + pkg.version + "/pdp10-uncompiled.js"; + var tmpPDP11 = "./versions/pdpjs/" + pkg.version + "/pdp11-uncompiled.js"; grunt.initConfig({ pkg: pkg, // pass the "package.json" object to initConfig() as a property, too @@ -380,11 +380,11 @@ module.exports = function(grunt) { * If/when that issue is fixed, this feature may be removed. */ TEMPcompilerOpts: { - // create_source_map: "./tmp/c1pjs/" + pkg.version + "/c1p.map", + create_source_map: "./versions/c1pjs/" + pkg.version + "/c1p.map", define: ["\"APPVERSION='" + pkg.version + "'\"", "DEBUGGER=false", "\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false"], - // output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/c1pjs/" + pkg.version + "/c1p.map\"" - output_wrapper: "\"(function(){%output%})();\"" + output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/versions/c1pjs/" + pkg.version + "/c1p.map\"" + // output_wrapper: "\"(function(){%output%})();\"" }, // src: pkg.c1pJSFiles, src: tmpC1Pjs, @@ -392,11 +392,11 @@ module.exports = function(grunt) { }, "c1p-dbg.js": { TEMPcompilerOpts: { - // create_source_map: "./tmp/c1pjs/" + pkg.version + "/c1p-dbg.map", + create_source_map: "./versions/c1pjs/" + pkg.version + "/c1p-dbg.map", define: ["\"APPVERSION='" + pkg.version + "'\"", "\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false"], - // output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/c1pjs/" + pkg.version + "/c1p-dbg.map\"" - output_wrapper: "\"(function(){%output%})();\"" + output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/versions/c1pjs/" + pkg.version + "/c1p-dbg.map\"" + // output_wrapper: "\"(function(){%output%})();\"" }, // src: pkg.c1pJSFiles, src: tmpC1Pjs, @@ -404,11 +404,11 @@ module.exports = function(grunt) { }, "pcx86.js": { TEMPcompilerOpts: { - // create_source_map: "./tmp/pcx86/" + pkg.version + "/pcx86.map", + create_source_map: "./versions/pcx86/" + pkg.version + "/pcx86.map", define: ["\"APPVERSION='" + pkg.version + "'\"", "DEBUGGER=false", "\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false", "BACKTRACK=false", "I386=true"], - // output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/pcx86/" + pkg.version + "/pcx86.map\"" - output_wrapper: "\"(function(){%output%})();\"" + output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/versions/pcx86/" + pkg.version + "/pcx86.map\"" + // output_wrapper: "\"(function(){%output%})();\"" }, // src: pkg.pcX86Files, src: tmpPCx86, @@ -419,11 +419,11 @@ module.exports = function(grunt) { * Technically, this is the one case we don't need to override the default 'define' settings, but maybe it's best to be explicit. */ TEMPcompilerOpts: { - // create_source_map: "./tmp/pcx86/" + pkg.version + "/pcx86-dbg.map", + create_source_map: "./versions/pcx86/" + pkg.version + "/pcx86-dbg.map", define: ["\"APPVERSION='" + pkg.version + "'\"", "\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false", "BACKTRACK=false", "I386=true"], - // output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/pcx86/" + pkg.version + "/pcx86-dbg.map\"" - output_wrapper: "\"(function(){%output%})();\"" + output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/versions/pcx86/" + pkg.version + "/pcx86-dbg.map\"" + // output_wrapper: "\"(function(){%output%})();\"" }, // src: pkg.pcX86Files, src: tmpPCx86, @@ -431,11 +431,11 @@ module.exports = function(grunt) { }, "pc8080.js": { TEMPcompilerOpts: { - // create_source_map: "./tmp/pc8080/" + pkg.version + "/pc8080.map", + create_source_map: "./versions/pc8080/" + pkg.version + "/pc8080.map", define: ["\"APPVERSION='" + pkg.version + "'\"", "\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false", "DEBUGGER=false"], - // output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/pc8080/" + pkg.version + "/pc8080.map\"" - output_wrapper: "\"(function(){%output%})();\"" + output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/versions/pc8080/" + pkg.version + "/pc8080.map\"" + // output_wrapper: "\"(function(){%output%})();\"" }, // src: pkg.pc8080Files, src: tmpPC8080, @@ -446,11 +446,11 @@ module.exports = function(grunt) { * Technically, this is the one case we don't need to override the default 'define' settings, but maybe it's best to be explicit. */ TEMPcompilerOpts: { - // create_source_map: "./tmp/pc8080/" + pkg.version + "/pc8080-dbg.map", + create_source_map: "./versions/pc8080/" + pkg.version + "/pc8080-dbg.map", define: ["\"APPVERSION='" + pkg.version + "'\"", "\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false", "DEBUGGER=true"], - // output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/pc8080/" + pkg.version + "/pc8080-dbg.map\"" - output_wrapper: "\"(function(){%output%})();\"" + output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/versions/pc8080/" + pkg.version + "/pc8080-dbg.map\"" + // output_wrapper: "\"(function(){%output%})();\"" }, // src: pkg.pc8080Files, src: tmpPC8080, @@ -458,11 +458,11 @@ module.exports = function(grunt) { }, "pdp10.js": { TEMPcompilerOpts: { - create_source_map: "./tmp/pdpjs/" + pkg.version + "/pdp10.map", + create_source_map: "./versions/pdpjs/" + pkg.version + "/pdp10.map", define: ["\"APPVERSION='" + pkg.version + "'\"", "\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false", "DEBUGGER=false"], - output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/pdpjs/" + pkg.version + "/pdp10.map\"" - // output_wrapper: "\"(function(){%output%})();\"" + output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/versions/pdpjs/" + pkg.version + "/pdp10.map\"" + // output_wrapper: "\"(function(){%output%})();\"" }, // src: pkg.pdp10Files, src: tmpPDP10, @@ -473,11 +473,11 @@ module.exports = function(grunt) { * Technically, this is the one case we don't need to override the default 'define' settings, but maybe it's best to be explicit. */ TEMPcompilerOpts: { - create_source_map: "./tmp/pdpjs/" + pkg.version + "/pdp10-dbg.map", + create_source_map: "./versions/pdpjs/" + pkg.version + "/pdp10-dbg.map", define: ["\"APPVERSION='" + pkg.version + "'\"", "\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false", "DEBUGGER=true"], - output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/pdpjs/" + pkg.version + "/pdp10-dbg.map\"" - // output_wrapper: "\"(function(){%output%})();\"" + output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/versions/pdpjs/" + pkg.version + "/pdp10-dbg.map\"" + // output_wrapper: "\"(function(){%output%})();\"" }, // src: pkg.pdp10Files, src: tmpPDP10, @@ -485,11 +485,11 @@ module.exports = function(grunt) { }, "pdp11.js": { TEMPcompilerOpts: { - create_source_map: "./tmp/pdpjs/" + pkg.version + "/pdp11.map", + create_source_map: "./versions/pdpjs/" + pkg.version + "/pdp11.map", define: ["\"APPVERSION='" + pkg.version + "'\"", "\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false", "DEBUGGER=false"], - output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/pdpjs/" + pkg.version + "/pdp11.map\"" - // output_wrapper: "\"(function(){%output%})();\"" + output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/versions/pdpjs/" + pkg.version + "/pdp11.map\"" + // output_wrapper: "\"(function(){%output%})();\"" }, // src: pkg.pdp11Files, src: tmpPDP11, @@ -500,11 +500,11 @@ module.exports = function(grunt) { * Technically, this is the one case we don't need to override the default 'define' settings, but maybe it's best to be explicit. */ TEMPcompilerOpts: { - create_source_map: "./tmp/pdpjs/" + pkg.version + "/pdp11-dbg.map", + create_source_map: "./versions/pdpjs/" + pkg.version + "/pdp11-dbg.map", define: ["\"APPVERSION='" + pkg.version + "'\"", "\"SITEHOST='www.pcjs.org'\"", "COMPILED=true", "DEBUG=false", "DEBUGGER=true"], - output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/tmp/pdpjs/" + pkg.version + "/pdp11-dbg.map\"" - // output_wrapper: "\"(function(){%output%})();\"" + output_wrapper: "\"(function(){%output%})();//# sourceMappingURL=/versions/pdpjs/" + pkg.version + "/pdp11-dbg.map\"" + // output_wrapper: "\"(function(){%output%})();\"" }, // src: pkg.pdp11Files, src: tmpPDP11, @@ -713,16 +713,16 @@ module.exports = function(grunt) { replace: { "fix-source-maps": { src: [ - "./tmp/c1pjs/" + pkg.version + "/c1p*.map", - "./tmp/pcx86/" + pkg.version + "/pc*.map", - "./tmp/pcx8008/" + pkg.version + "/pc*.map", - "./tmp/pdpjs/" + pkg.version + "/pdp*.map" + "./versions/c1pjs/" + pkg.version + "/c1p*.map", + "./versions/pcx86/" + pkg.version + "/pc*.map", + "./versions/pcx8008/" + pkg.version + "/pc*.map", + "./versions/pdpjs/" + pkg.version + "/pdp*.map" ], overwrite: true, replacements: [ { - from: /"sources":\s*\["\.\/tmp\//g, - to: '"sources":["/tmp/' + from: /"sources":\s*\["\.\/versions\//g, + to: '"sources":["/versions/' } ] }, diff --git a/_includes/head.html b/_includes/head.html index 85288e0a5..1c0601bc4 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -1,6 +1,7 @@ - + + {% if page.title %}PCjs: {{ page.title }}{% else %}{{ site.title }}{% endif %} diff --git a/_includes/machine-engines.html b/_includes/machine-engines.html index c8da7e19e..bb470f59e 100644 --- a/_includes/machine-engines.html +++ b/_includes/machine-engines.html @@ -90,9 +90,9 @@ of our Markdown or XML documents. Examples: 'automount' becomes 'autoMount', 'a {% assign machine_autoStart = "" %} {% endif %} {% if machine.autotype != nil %} - {% capture machine_autoType %},autoType:"{{ machine.autotype }}"{% endcapture %} + {% capture machine_autoType %},autoType:"{{ machine.autotype | replace:"\r":"\\\\r" | replace:"\n":"\\\\n" | replace:"\t":"\\\\t" | replace:"\x":"\\\\x" }}"{% endcapture %} {% elsif machine.autoType != nil %} - {% capture machine_autoType %},autoType:"{{ machine.autoType }}"{% endcapture %} + {% capture machine_autoType %},autoType:"{{ machine.autoType | replace:"\r":"\\\\r" | replace:"\n":"\\\\n" | replace:"\t":"\\\\t" | replace:"\x":"\\\\x" }}"{% endcapture %} {% else %} {% assign machine_autoType = "" %} {% endif %} @@ -122,37 +122,61 @@ of our Markdown or XML documents. Examples: 'automount' becomes 'autoMount', 'a {% capture machine_template %}{{ site.baseurl }}/versions/{{ machine_app }}/{{ site.pcjs.version }}/components.xsl{% endcapture %} {% endif %} {% else %} - {% if machine_type == "c1p" %}{% assign array_scripts = site.pcjs.c1p_scripts %}{% endif %} - {% if machine_type == "pcx86" %}{% assign array_scripts = site.pcjs.pcx86_scripts %}{% endif %} - {% if machine_type == "pc8080" %}{% assign array_scripts = site.pcjs.pc8080_scripts %}{% endif %} - {% if machine_type == "pdp10" %}{% assign array_scripts = site.pcjs.pdp10_scripts %}{% endif %} - {% if machine_type == "pdp11" %}{% assign array_scripts = site.pcjs.pdp11_scripts %}{% endif %} - {% for script in array_scripts %} - {% if script != "/modules/shared/lib/nodebug.js" or machine.debug != true and site.pcjs.debug != true %} - {% capture machine_script %}{% endcapture %} - {% unless machine_scripts contains machine_script %} - {{ machine_script }} - {% if script contains "shared/lib/defines.js" %} - {% if site.pcjs.private %} - {{ machine_script | replace:"defines.js","private.js" }} - {% endif %} - {% endif %} - {% if script contains "js/lib/defines.js" %} - {% if machine_debugger != true %} - {{ machine_script | replace:"defines.js","nodebugger.js" }} - {% endif %} - {% endif %} - {% endunless %} - {% capture machine_scripts %}{{ machine_scripts }}{{ machine_script }}{% endcapture %} - {% endif %} - {% endfor %} + {% capture machine_file_uncompiled %}{{ machine_file | remove:"-dbg" | append:"-uncompiled" }}{% endcapture %} + {% capture machine_script %} + {% endcapture %} + {% unless machine_scripts contains machine_script %} + {{ machine_script }} + {% endunless %} + {% capture machine_scripts %}{{ machine_scripts }}{{ machine_script }}{% endcapture %} {% if machine_template == "" %} - {% if machine_app != "c1pjs" %} - {% capture machine_template %}{{ site.baseurl }}/modules/shared/templates/components.xsl{% endcapture %} - {% else %} - {% capture machine_template %}{{ site.baseurl }}/modules/{{ machine_app }}/templates/components.xsl{% endcapture %} - {% endif %} + {% capture machine_template %}{{ site.baseurl }}/versions/{{ machine_app }}/{{ site.pcjs.version }}/components.xsl{% endcapture %} {% endif %} + {% comment %} + + The following approach worked well before we converted most of the code to ES6 classes. Unfortunately, ES6 classes + don't coexist well with the conditional Node require() statements inside the individual scripts. Since we were already + stripping all the Node-related code from the scripts to build monolithic scripts that we could feed into the Closure + Compiler, we have simply moved those monolithic scripts from the /tmp folder to the /versions folder, with "-uncompiled" + suffixes. And since they are now checked in alongside the compiled files, there's the added benefit that we can always + reference them from source maps. + + So, the following template code is no longer of any use, but we'll leave it here for historical reference. Note that + our Node web server still serves up individual scripts, because it has the ability to strip all Node references from the + scripts before delivering them to the web browser. But that's not really feasible in the Jekyll environment. + + {% if machine_type == "c1p" %}{% assign array_scripts = site.pcjs.c1p_scripts %}{% endif %} + {% if machine_type == "pcx86" %}{% assign array_scripts = site.pcjs.pcx86_scripts %}{% endif %} + {% if machine_type == "pc8080" %}{% assign array_scripts = site.pcjs.pc8080_scripts %}{% endif %} + {% if machine_type == "pdp10" %}{% assign array_scripts = site.pcjs.pdp10_scripts %}{% endif %} + {% if machine_type == "pdp11" %}{% assign array_scripts = site.pcjs.pdp11_scripts %}{% endif %} + {% for script in array_scripts %} + {% if script != "/modules/shared/lib/nodebug.js" or machine.debug != true and site.pcjs.debug != true %} + {% capture machine_script %}{% endcapture %} + {% unless machine_scripts contains machine_script %} + {{ machine_script }} + {% if script contains "shared/lib/defines.js" %} + {% if site.pcjs.private %} + {{ machine_script | replace:"defines.js","private.js" }} + {% endif %} + {% endif %} + {% if script contains "js/lib/defines.js" %} + {% if machine_debugger != true %} + {{ machine_script | replace:"defines.js","nodebugger.js" }} + {% endif %} + {% endif %} + {% endunless %} + {% capture machine_scripts %}{{ machine_scripts }}{{ machine_script }}{% endcapture %} + {% endif %} + {% endfor %} + {% if machine_template == "" %} + {% if machine_app != "c1pjs" %} + {% capture machine_template %}{{ site.baseurl }}/modules/shared/templates/components.xsl{% endcapture %} + {% else %} + {% capture machine_template %}{{ site.baseurl }}/modules/{{ machine_app }}/templates/components.xsl{% endcapture %} + {% endif %} + {% endif %} + {% endcomment %} {% endif %} {% if machine.sticky == "top" %} diff --git a/_layouts/default.html b/_layouts/default.html index 66d847c16..ed5601775 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,5 +1,5 @@ - + {% include head.html %} diff --git a/disks/pcx86/apps/ibm/topview/1.01/README.md b/disks/pcx86/apps/ibm/topview/1.01/README.md index e5a867576..8af383845 100644 --- a/disks/pcx86/apps/ibm/topview/1.01/README.md +++ b/disks/pcx86/apps/ibm/topview/1.01/README.md @@ -11,10 +11,20 @@ machines: path: /disks/pcx86/dos/ibm/2.00/PCDOS200-DISK1.json B: path: /disks/pcx86/apps/ibm/topview/1.01/TOPVIEW101-PROGRAM.json + autoType: \r\rb:\rtv\r --- TopView 1.01 ---- +------------ + +NOTE: Even though we've made every effort to mark all PCjs pages as English, Google's Chrome web browser (v59) +mistakenly thinks this page is in French and will attempt to translate it to English. That translation process +interferes with elements of the machine; for example, it may change the name of the first diskette drive from +"A:" to "AT:". + +So, if you notice any rendering problems, check the top of your web browser, and if you see the message *This page +has been translated from French to English*, click **Show Original**. Ironically, the addition of these two +paragraphs of English text will likely eliminate the problem. {% include machine.html id="ibm5160" %} diff --git a/docs/pcx86/examples/pcx86-dbg.js b/docs/pcx86/examples/pcx86-dbg.js index 65ab7e752..124e8b65d 100644 --- a/docs/pcx86/examples/pcx86-dbg.js +++ b/docs/pcx86/examples/pcx86-dbg.js @@ -893,4 +893,4 @@ window.processMachineScript=function(a,b){var c=!1;a+=".machine";if("string"==ty function uC(a,b,c,d){if(!c&&b){d.push(b);a=pb[d[0]];b=null;for(var e in a)if(wa(e,"components.xsl")){b=e.replace(".xsl",".css");break}b?Ka(b,null,!0,function(a,b){vC(b,d)}):vC(null,d)}else gb("Error ("+c+") requesting "+a)} function vC(a,b){var c,d,e,f=b[0],g=b[1];c=b[4];c=c.match(/^(\s*\(function\(\)\{)([\s\S]*)(}\)\(\);\s*)$/);var h=pb[f],k={},m;for(m in h){var p=h[m],v=va(m);if("xml"==v){for(v=/[ \t]*]*path=(['"])(.*?)\1.*?<\/disk>\n?/g;d=v.exec(h[m]);){var u=d[2];u&&(h[u]||(p=p.replace(d[0],"")))}d=m=ta(m)}else"xsl"==v&&(e=m=ta(m));k[m]=p}a&&(k[m="css"]=a);b[2]&&(k[m="parms"]=b[2]);b[3]&&(k[m="state"]=b[3]);d&&e?(a=JSON.stringify(k),g+=".js",c=c[1]+"var resources="+a+";"+c[2]+c[3],c=c.replace(/\u00A9/g, "©"),a=Wa(c,"javascript",!1,g),a=a+(', copy it to your web server as "'+g+'", and then add the following to your web page:\n\n')+('
\n')+"...\n",a=a+('