Fixed XSLT issue uncovered by a recent Microsoft Edge release

This commit is contained in:
Jeff Parsons 2015-12-13 11:06:38 -08:00
commit 51d187f145
14 changed files with 1027 additions and 1000 deletions

View file

@ -1,7 +1,4 @@
---
layout: page
title: About JavaScript Machines
permalink: /docs/about/
About JavaScript Machines
---
The JavaScript Machines Project (originally at [jsmachines.net](http://jsmachines.net/)) is a collection of computer

View file

@ -3,12 +3,15 @@
<!DOCTYPE xsl:stylesheet [
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:param name="rootDir" select="''"/>
<xsl:param name="generator" select="'client'"/>
<xsl:variable name="MACHINECLASS">pc</xsl:variable>
<xsl:variable name="APPCLASS">pcjs</xsl:variable>
<xsl:variable name="APPVERSION">1.20.1</xsl:variable>
<xsl:variable name="APPVERSION">1.20.2</xsl:variable>
<xsl:variable name="SITEHOST">www.pcjs.org</xsl:variable>
<xsl:template name="componentStyles">

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -4,6 +4,9 @@
<!-- XSLT understands these entities only: lt, gt, apos, quot, and amp. Other required entities may be defined below (see http://www.pcjs.org/modules/shared/templates/entities.dtd). -->
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:param name="rootDir" select="''"/>
<xsl:param name="generator" select="'client'"/>

View file

@ -349,19 +349,20 @@ MarkOut.prototype.convertMD = function(sIndent)
sMD = sMD.replace(/<!--[\s\S]*?-->/g, "");
/*
* If the Markdown begins with a triple-dash, we assume there's a "Front Matter" header at the
* top of the file that we don't want to output, either. One wrinkle: we assume that if a
* "title" element exists in the Front Matter, then we should auto-generate a top-level heading
* with the same value.
* If the Markdown begins with a triple-dash, see if there's a "Front Matter" header at the
* top of the file that we should suppress.
*/
if (sMD.substr(0, 3) == "---") {
aMatch = sMD.match(/^---([\s\S]*?)---[ \t]*\n*/);
if (aMatch) {
sMD = sMD.replace(aMatch[0], "");
aMatch = aMatch[1].match(/title:\s*(.*?)\s*?\n/);
if (aMatch) {
sMD = aMatch[1] + "\n---\n\n" + sMD;
}
/*
* If a "title" element existed in the Front Matter, then you can enable this code to
* auto-generate a top-level heading with the same value.
*
* aMatch = aMatch[1].match(/title:\s*(.*?)\s*?\n/);
* if (aMatch) sMD = aMatch[1] + "\n---\n\n" + sMD;
*/
}
}

View file

@ -1403,7 +1403,7 @@ FDC.prototype.doneLoadDiskette = function onFDCLoadNotify(drive, disk, sDiskette
FDC.prototype.addDiskette = function(sName, sPath)
{
var controlDisks = this.bindings["listDisks"];
if (controlDisks) {
if (controlDisks && controlDisks.options) {
for (var i = 0; i < controlDisks.options.length; i++) {
if (controlDisks.options[i].value == sPath) return;
}
@ -1433,7 +1433,7 @@ FDC.prototype.displayDiskette = function(iDrive, fUpdateDrive)
/*
* Next, make sure controls for both drives and disks exist.
*/
if (controlDisks && controlDrives) {
if (controlDisks && controlDrives && controlDisks.options && controlDrives.options) {
/*
* Next, make sure the drive whose disk we're updating is the currently selected drive.
*/

View file

@ -4,6 +4,9 @@
<!-- XSLT understands these entities only: lt, gt, apos, quot, and amp. Other required entities may be defined below (see http://www.pcjs.org/modules/shared/templates/entities.dtd). -->
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:param name="rootDir" select="''"/>
<xsl:param name="generator" select="'client'"/>

View file

@ -403,6 +403,14 @@ function embedMachine(sName, sVersion, idElement, sXMLFile, sXSLFile, sStateFile
xsltProcessor['importStylesheet'](xsl);
var eFragment = xsltProcessor['transformToFragment'](xml, window.document);
if (eFragment) {
/*
* This fails in Microsoft Edge...
*
var machine = eFragment.getElementById(idElement);
if (!machine) {
displayError("machine generation failed: " + idElement);
} else
*/
if (eMachine.parentNode) {
eMachine.parentNode.replaceChild(eFragment, eMachine);
doneMachine();

View file

@ -8,6 +8,8 @@
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template name="commonStyles">
<meta charset="utf-8"/>
<link rel="shortcut icon" href="/versions/images/current/favicon.ico" type="image/x-icon"/>

View file

@ -8,6 +8,8 @@
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template name="documentStyles">
<link rel="stylesheet" type="text/css" href="document.css"/>
</xsl:template>

View file

@ -7,7 +7,7 @@
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output doctype-system="about:legacy-compat"/>
<xsl:output doctype-system="about:legacy-compat" method="html"/>
<xsl:include href="common.xsl"/>
<!-- There is no "shared" components.xsl, so we just pick one to eliminate IDE inspection warnings -->

View file

@ -7,7 +7,7 @@
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output doctype-system="about:legacy-compat"/>
<xsl:output doctype-system="about:legacy-compat" method="html"/>
<xsl:include href="common.xsl"/>
<!-- There is no "shared" components.xsl, so we just pick one to eliminate IDE inspection warnings -->

View file

@ -7,7 +7,7 @@
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output doctype-system="about:legacy-compat"/>
<xsl:output doctype-system="about:legacy-compat" method="html"/>
<xsl:include href="common.xsl"/>
<xsl:include href="document.xsl"/>