First step moving toward a shared component template and stylesheet across multiple machines

This commit is contained in:
Jeff Parsons 2016-04-19 17:04:53 -07:00
commit f390bdb76b
7 changed files with 12 additions and 16 deletions

1
.gitignore vendored
View file

@ -18,6 +18,7 @@ node_modules
archive/ archive/
c64/ c64/
ecp/ ecp/
projects/
private/ private/
src/ src/
tmp/ tmp/

View file

@ -365,7 +365,7 @@ module.exports = function(grunt) {
"pcjs": { "pcjs": {
files: [ files: [
{ {
cwd: "modules/pcjs/templates/", cwd: "modules/shared/templates/",
src: ["components.*"], src: ["components.*"],
dest: "versions/pcjs/<%= pkg.version %>/", dest: "versions/pcjs/<%= pkg.version %>/",
expand: true expand: true

View file

@ -1205,7 +1205,11 @@ MarkOut.prototype.convertMDMachineLinks = function(sBlock)
*/ */
if (!sMachineXSLFile || sMachineXSLFile.indexOf("components.xsl") >= 0) { if (!sMachineXSLFile || sMachineXSLFile.indexOf("components.xsl") >= 0) {
if (this.fDebug) { if (this.fDebug) {
sMachineXSLFile = "/modules/" + sMachineClass + "js/templates/components.xsl"; if (sMachineClass == "c1p") {
sMachineXSLFile = "/modules/c1pjs/templates/components.xsl";
} else {
sMachineXSLFile = "/modules/shared/templates/components.xsl";
}
} }
} }

View file

@ -1,14 +0,0 @@
PCjs Templates
===
Template folders contain a variety of XML and HTML templates and supporting files, including:
- DTD files (Document Type Definitions)
- XSD files (XML schemas -- eventually)
- XSL files (XML stylesheets)
- CSS files (stylesheets that the XSL files rely upon)
- HTML files (HTML fragments used to generate part or all of a web page)
[*components.xsl*](components.xsl) transforms all the elements of a machine XML file into an HTML fragment
that includes a series of **DIV** tags with corresponding *id* and *data-value* attributes that allow our
JavaScript components to bind themselves to visual elements (eg, virtual screen, virtual keyboard, control
panel) on a web page.

View file

@ -15,6 +15,11 @@ or none of the above.
[*common.xsl*](common.xsl) is a collection of XSL templates used by *machine.xsl* (and deprecated *outline.xsl*) [*common.xsl*](common.xsl) is a collection of XSL templates used by *machine.xsl* (and deprecated *outline.xsl*)
files. files.
[*components.xsl*](components.xsl) transforms all the elements of a machine XML file into an HTML fragment
that includes a series of **DIV** tags with corresponding *id* and *data-value* attributes that allow our
JavaScript components to bind themselves to visual elements (eg, virtual screen, virtual keyboard, control
panel) on a web page.
[*machine.xsl*](machine.xsl) is an XML stylesheet that takes things a step further and transforms a machine XML [*machine.xsl*](machine.xsl) is an XML stylesheet that takes things a step further and transforms a machine XML
into a stand-alone HTML document, which also includes all necessary compiled scripts (eg, c1p.js, c1p-dbg.js, into a stand-alone HTML document, which also includes all necessary compiled scripts (eg, c1p.js, c1p-dbg.js,
pc.js or pc-dbg.js). Most machine XML files explicitly link to this stylesheet, so that simply loading the XML pc.js or pc-dbg.js). Most machine XML files explicitly link to this stylesheet, so that simply loading the XML