Allow a default machine name to appear as a placeholder while the script(s) load

This commit is contained in:
Jeff Parsons 2016-02-09 13:39:57 -08:00
commit 71fa2547be
5 changed files with 38 additions and 5 deletions

View file

@ -1,3 +1,25 @@
{% comment %}
As documented in /modules/markout/lib/markout.js, the following machine properties are recognized in Front Matter:
'id' (eg, "ibm5150")
'name' (eg, "IBM PC (Model 5150) with Monochrome Display")
'type' (eg, "pc" or "pc-dbg")
'config' (eg, "machine.xml")
'template' (eg, "machine.xsl")
'uncompiled' (eg, true)
'parms'
and the following properties (along with any property not listed above) will be added to the 'parms' property:
'automount' (eg, {"A":{"name":"OS/2 FOOTBALL Boot Disk (v7.68.17)","path":"/disks/pc/os2/misc/football/debugger/FOOTBALL-7.68.17.json"}})
'state' (eg, "state.json")
'messages' (eg, "disk")
Of all the above properties, the following are purely cosmetic:
'name' (used by machine.html, not machine-engines.html)
{% endcomment %}
{% for machine in page.machines %} {% for machine in page.machines %}
{% capture machine_embed %}window.embed{{ machine.type | remove:'-dbg' | upcase }}{% endcapture %} {% capture machine_embed %}window.embed{{ machine.type | remove:'-dbg' | upcase }}{% endcapture %}
{% unless machine.config %} {% unless machine.config %}

View file

@ -1 +1,10 @@
<div class="machine" id="{{ include.id }}"></div> <div class="machine" id="{{ include.id }}">
{% assign machine_name = "PCjs: The Virtual IBM PC" %}
{% for machine in page.machines %}
{% if include.id == machine.id and machine.name%}
{% assign machine_name = machine.name %}
{% break %}
{% endif %}
{% endfor %}
[{{ machine_name }}]
</div>

View file

@ -21,5 +21,5 @@ with the *format* parameter set to `img` instead of `json`. For example:
In fact, when browsing the disk archives, the PCjs web server automatically provides "onclick" handlers In fact, when browsing the disk archives, the PCjs web server automatically provides "onclick" handlers
for links to JSON-encoded disk images, which will invoke the API for you. for links to JSON-encoded disk images, which will invoke the API for you.
See **Creating PCjs-Compatible Disk Images** in the [PCjs Documentation](/docs/pcjs/) for more information See **Creating PCjs-Compatible Disk Images** in the [PCjs Documentation](/docs/pcjs/#creating-pcjs-compatible-disk-images)
about supported disks and formats. for more information about supported disks and formats.

View file

@ -4,6 +4,7 @@ permalink: /
machines: machines:
- type: pc - type: pc
id: ibm5150 id: ibm5150
name: "IBM PC (Model 5150) with Monochrome Display"
config: /devices/pc/machine/5150/mda/64kb/machine.xml config: /devices/pc/machine/5150/mda/64kb/machine.xml
- type: c1p - type: c1p
id: demoC1P id: demoC1P

View file

@ -314,7 +314,8 @@ MarkOut.aHTMLEntities = {
* to the 'parms' object as a string property. * to the 'parms' object as a string property.
* *
* 'id' (eg, "ibm5150") * 'id' (eg, "ibm5150")
* 'type' (eg, "pc") * 'name' (eg, "IBM PC (Model 5150) with Monochrome Display")
* 'type' (eg, "pc" or "pc-dbg")
* 'config' (eg, "machine.xml") * 'config' (eg, "machine.xml")
* 'template' (eg, "machine.xsl") * 'template' (eg, "machine.xsl")
* 'uncompiled' (eg, true) * 'uncompiled' (eg, true)
@ -328,7 +329,7 @@ MarkOut.aHTMLEntities = {
* *
* and any other string-based property you wish to pass through to PCjs (via the embedPC() sParms parameter). * and any other string-based property you wish to pass through to PCjs (via the embedPC() sParms parameter).
*/ */
MarkOut.aFMReservedMachineProps = ['id', 'type', 'config', 'template', 'uncompiled', 'automount', 'parms']; MarkOut.aFMReservedMachineProps = ['id', 'name', 'type', 'config', 'template', 'uncompiled', 'automount', 'parms'];
/** /**
* convertMD() * convertMD()