Initial commit (a clone of the jsmachines project as of v1.15.3)

This commit is contained in:
jeffpar 2014-09-27 14:52:57 -07:00
commit a5e3e6a59d
714 changed files with 130602 additions and 0 deletions

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2012-08-28" license="http://www.gnu.org/licenses/gpl.html" -->
<!DOCTYPE xsl:stylesheet [
<!-- XSLT understands these entities only: lt, gt, apos, quot, and amp. Other useful entities are defined below (see entities.dtd). -->
<!ENTITY nbsp "&#160;"> <!ENTITY sect "&#167;"> <!ENTITY copy "&#169;"> <!ENTITY para "&#182;"> <!ENTITY ndash "&#8211;"> <!ENTITY mdash "&#8212;">
<!ENTITY lsquo "&#8216;"> <!ENTITY rsquo "&#8217;"> <!ENTITY ldquo "&#8220;"> <!ENTITY rdquo "&#8221;"> <!ENTITY dagger "&#8224;"> <!ENTITY Dagger "&#8225;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="rootDir" select="''"/>
<xsl:param name="generator" select="'client'"/>
<xsl:output doctype-system="about:legacy-compat"/>
<xsl:include href="../../../my_modules/shared/templates/common.xsl"/>
<xsl:include href="components.xsl"/>
<xsl:include href="register.xsl"/>
<xsl:template match="/">
<html lang="en">
<head>
<title>jsmachines.net</title>
<xsl:call-template name="commonStyles"/>
<xsl:call-template name="componentIncludes"><xsl:with-param name="component" select="'components'"/></xsl:call-template>
<xsl:if test="//register">
<xsl:call-template name="registerIncludes"/>
</xsl:if>
</head>
<body>
<div class="page justified">
<xsl:apply-templates/>
<h4>Return to <a href="/outline.xml">Outline</a></h4>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,79 @@
.component:before, .component:after {
content:"";
display:table;
}
.component:after {
clear:both;
}
.component {
zoom:1; /* For IE 6/7 (trigger hasLayout) */
font-size: medium;
}
.component .label {
margin-bottom: 2px;
}
.label.left {
float: left;
margin-right: 1em;
width: 2em;
}
.component .container {
display: inline-block;
}
.controls, .controls div, .controls input, .controls button {
float: left;
margin: 2px;
margin-left: 0px;
}
input.value {
width: 16em;
height: 1em;
font-size: medium;
border: 1px solid black;
line-height: 1em; /* the equivalent of "vertical-align: middle" for single-line elements */
text-align: right;
}
.status, .value {
vertical-align: middle;
}
.status span, .value span {
font-size: small;
vertical-align: 10%;
}
.status sup {
vertical-align: baseline;
position: relative;
bottom: .33em;
}
.status sub {
vertical-align: baseline;
position: relative;
bottom: -.33em;
}
.selector {
float: left;
border: 1px solid black;
background-color: white;
}
.selector:before, .selector:after {
content:"";
display:table;
}
.selector:after {
clear:both;
}
/* For IE 6/7 (trigger hasLayout) */
.selector {
zoom:1;
}
.gateSmall, .gateLarge {
float: left;
}
.gateSmall, .gateSmall img {
width: 19px;
height: 19px;
}
.gateLarge, .gateLarge img {
width: 38px;
height: 38px;
}

View file

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-03-28" license="http://www.gnu.org/licenses/gpl.html" -->
<!DOCTYPE xsl:stylesheet [
<!-- XSLT understands these entities only: lt, gt, apos, quot, and amp. Other required entities may be defined below (see entities.dtd). -->
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="componentStyles">
<xsl:param name="component"></xsl:param>
<link rel="stylesheet" type="text/css" href="/my_modules/ecpjs-client/templates/{$component}.css"/>
</xsl:template>
<xsl:template name="componentScripts">
<xsl:param name="component"></xsl:param>
<xsl:choose>
<xsl:when test="$component = 'components'">
<script type="text/javascript" src="/my_modules/shared/lib/component.js"></script>
<script type="text/javascript" src="/my_modules/ecpjs-client/lib/stepper.js"></script>
</xsl:when>
<xsl:otherwise>
<script type="text/javascript" src="/my_modules/ecpjs-client/lib/{$component}.js"></script>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="componentIncludes">
<xsl:param name="component"></xsl:param>
<xsl:call-template name="componentStyles"><xsl:with-param name="component" select="$component"/></xsl:call-template>
<xsl:call-template name="componentScripts"><xsl:with-param name="component" select="$component"/></xsl:call-template>
</xsl:template>
<xsl:template match="component[@ref]">
<xsl:variable name="component" select="name(.)"/>
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
<xsl:apply-templates select="document($componentFile)"/>
</xsl:template>
<xsl:template match="component[not(@ref)]">
<xsl:call-template name="component">
<xsl:with-param name="class" select="@class"/>
<xsl:with-param name="parms" select="@parms"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="component">
<xsl:param name="class"></xsl:param>
<xsl:param name="parms">none:null</xsl:param>
<xsl:variable name="id">
<!-- Values allowed: ID of component, blank if none (default) -->
<xsl:choose>
<xsl:when test="@id"><xsl:value-of select="@id"/></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="name">
<!-- Values allowed: name of component, blank if none (default) -->
<xsl:choose>
<xsl:when test="name"><xsl:value-of select="name"/></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="pos">
<!-- Values allowed: left (default), center, or blank for no relative positional preference -->
<xsl:choose>
<xsl:when test="@pos"><xsl:value-of select="@pos"/></xsl:when>
<xsl:otherwise>left</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="step">
<!-- Values allowed: number of milliseconds per step, 0 for quick/quiet stepping with yields (default), -1 for no yields -->
<xsl:choose>
<xsl:when test="@step"><xsl:value-of select="@step"/></xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="log">
<!-- Values allowed: true to enable console logging, false to disable (default) -->
<xsl:choose>
<xsl:when test="@log"><xsl:value-of select="@log"/></xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div class="component {$pos}">
<xsl:apply-templates select="name"/>
<div class="container">
<xsl:if test="control[@pos = 'top']">
<div class="controls">
<xsl:apply-templates select="control[@pos = 'top']" mode="component"/>
</div>
<div style="clear:both"></div>
</xsl:if>
<xsl:if test="control[@pos = 'left']">
<div class="controls">
<xsl:apply-templates select="control[@pos = 'left']" mode="component"/>
</div>
</xsl:if>
<div class="{$class}" data-value="id:'{$id}',name:'{$name}',step:{$step},log:{$log},{$parms}"></div>
<xsl:if test="control[@pos = 'right']">
<div class="controls">
<xsl:apply-templates select="control[@pos = 'right']" mode="component"/>
</div>
</xsl:if>
<xsl:if test="control[not(@pos)]">
<div style="clear:both"></div>
<div class="controls">
<xsl:apply-templates select="control[not(@pos)]" mode="component"/>
</div>
</xsl:if>
<xsl:if test="control[@pos = 'bottom']">
<div style="clear:both"></div>
<div class="controls">
<xsl:apply-templates select="control[@pos = 'bottom']" mode="component"/>
</div>
</xsl:if>
</div>
</div>
</xsl:template>
<xsl:template match="name">
<xsl:variable name="pos">
<xsl:choose>
<xsl:when test="@pos"><xsl:value-of select="@pos"/></xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<div class="label {$pos}"><xsl:apply-templates/></div>
</xsl:template>
<xsl:template match="control" mode="component">
<xsl:choose>
<xsl:when test="@type = 'input'">
<input class="{@class}" type="text" value=""/>
</xsl:when>
<xsl:when test="@type = 'output'">
<div class="{@class}"></div>
</xsl:when>
<xsl:when test="@type = 'button'">
<button class="{@class}"><xsl:value-of select="."/></button>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2012-08-28" license="http://www.gnu.org/licenses/gpl.html" -->
<!DOCTYPE xsl:stylesheet [
<!-- XSLT understands these entities only: lt, gt, apos, quot, and amp. Other useful entities are defined below (see entities.dtd). -->
<!ENTITY nbsp "&#160;"> <!ENTITY sect "&#167;"> <!ENTITY copy "&#169;"> <!ENTITY para "&#182;"> <!ENTITY ndash "&#8211;"> <!ENTITY mdash "&#8212;">
<!ENTITY lsquo "&#8216;"> <!ENTITY rsquo "&#8217;"> <!ENTITY ldquo "&#8220;"> <!ENTITY rdquo "&#8221;"> <!ENTITY dagger "&#8224;"> <!ENTITY Dagger "&#8225;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="rootDir" select="''"/>
<xsl:param name="generator" select="'client'"/>
<xsl:output doctype-system="about:legacy-compat"/>
<xsl:include href="../../../my_modules/shared/templates/common.xsl"/>
<xsl:include href="components.xsl"/>
<xsl:include href="register.xsl"/>
<xsl:template match="/device">
<html lang="en">
<head>
<title>jsmachines.net</title>
<xsl:call-template name="commonStyles"/>
<xsl:call-template name="componentIncludes"><xsl:with-param name="component" select="'components'"/></xsl:call-template>
<xsl:if test="//register">
<xsl:call-template name="registerIncludes"/>
</xsl:if>
<xsl:if test="//component[@class='parallelAdder']">
<xsl:call-template name="componentScripts"><xsl:with-param name="component" select="'parallelAdder'"/></xsl:call-template>
</xsl:if>
<xsl:if test="//component[@class='selector']">
<xsl:call-template name="componentScripts"><xsl:with-param name="component" select="'selector'"/></xsl:call-template>
</xsl:if>
</head>
<body>
<div class="page justified">
<xsl:apply-templates/>
<h4>Return to <a href="/outline.xml">Outline</a></h4>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- author="Jeff Parsons" creator="http://www.pcjs.org/" created="2012-05-05T19:53:00" modified="2012-05-05T19:53:00" license="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" -->
<!DOCTYPE xsl:stylesheet [
<!-- XSLT understands these entities only: lt, gt, apos, quot, and amp. Other useful entities are defined below (see entities.dtd). -->
<!ENTITY nbsp "&#160;"> <!ENTITY sect "&#167;"> <!ENTITY copy "&#169;"> <!ENTITY para "&#182;"> <!ENTITY ndash "&#8211;"> <!ENTITY mdash "&#8212;">
<!ENTITY lsquo "&#8216;"> <!ENTITY rsquo "&#8217;"> <!ENTITY ldquo "&#8220;"> <!ENTITY rdquo "&#8221;"> <!ENTITY dagger "&#8224;"> <!ENTITY Dagger "&#8225;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="rootDir" select="''"/>
<xsl:param name="generator" select="'client'"/>
<xsl:output doctype-system="about:legacy-compat"/>
<xsl:include href="../../../my_modules/shared/templates/common.xsl"/>
<!-- The next two lines were added to support embedding components in documents -->
<xsl:include href="components.xsl"/>
<xsl:include href="register.xsl"/>
<xsl:template match="/document">
<html lang="en">
<head>
<title><xsl:value-of select="title"/><xsl:text> | jsmachines.net</xsl:text></title>
<xsl:call-template name="commonStyles"/>
<!-- The next two lines were added to support embedding components in documents -->
<xsl:call-template name="componentIncludes"><xsl:with-param name="component" select="'components'"/></xsl:call-template>
<xsl:call-template name="registerIncludes"/>
</head>
<body>
<div class="page justified">
<h4 style="float:right">Return to <a href="/manuals/ecp/outline.xml">Outline</a></h4>
<xsl:call-template name="document"><xsl:with-param name="parent" select="'true'"/></xsl:call-template>
<h4>Return to <a href="/manuals/ecp/outline.xml">Outline</a></h4>
</div>
</body>
</html>
</xsl:template>
<xsl:template name="document">
<xsl:param name="parent">false</xsl:param>
<xsl:param name="ref"></xsl:param>
<xsl:if test="not(parent)">
<h1><xsl:value-of select="title"/><xsl:apply-templates select="title/footlink"/></h1>
<xsl:if test="author"><p><xsl:text>By </xsl:text><xsl:call-template name="authors"/></p></xsl:if>
<xsl:apply-templates select="date"/>
<xsl:apply-templates select="synopsis"/>
</xsl:if>
<xsl:if test="parent">
<xsl:choose>
<xsl:when test="$parent = 'true'">
<h2><xsl:apply-templates select="parent"/></h2>
<h3><xsl:apply-templates select="title"/></h3>
</xsl:when>
<xsl:otherwise>
<h2>
<xsl:choose>
<xsl:when test="$ref = ''"><xsl:apply-templates select="title"/></xsl:when>
<xsl:otherwise><a href="{$ref}"><xsl:apply-templates select="title"/></a></xsl:otherwise>
</xsl:choose>
</h2>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="excerpt">
<h4><xsl:apply-templates select="excerpt"/></h4>
</xsl:if>
<xsl:if test="@ref">
<xsl:choose>
<xsl:when test="contains(@ref,'.pdf')">
<a href="{@ref}"><img src="/my_modules/shared/images/pdf-192.jpg"/></a>
</xsl:when>
<xsl:otherwise>
<p>[<a href="{@ref}">Link</a>]</p>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="content">
<xsl:if test="content/p[@name]">
<h4><xsl:text>Discusses: </xsl:text>
<xsl:for-each select="content/p[@name]">
<xsl:if test="position() != 1"><xsl:text>, </xsl:text></xsl:if>
<a href="#{@id}"><xsl:value-of select="@name"/></a>
</xsl:for-each>
</h4>
</xsl:if>
<xsl:apply-templates select="content"/>
</xsl:if>
<xsl:apply-templates select="include"/>
<xsl:apply-templates select="video"/>
</xsl:template>
<xsl:template match="date">
<p><xsl:call-template name="formatDate"><xsl:with-param name="date" select="."/></xsl:call-template></p>
</xsl:template>
<xsl:template match="author">
<p><xsl:text>By </xsl:text><xsl:value-of select="."/></p>
</xsl:template>
<xsl:template match="synopsis">
<p><xsl:text>Synopsis: </xsl:text><em><xsl:value-of select="."/></em></p>
</xsl:template>
<xsl:template match="content">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="video">
<xsl:variable name="controls"><xsl:if test="@controls">controls</xsl:if></xsl:variable>
<div class="center">
<video width="{@width}" height="{@height}" controls="{$controls}">
<xsl:apply-templates select="source"/>
Your browser does not support HTML5 video play-back.
</video>
</div>
</xsl:template>
<xsl:template match="source">
<source src="{@src}" type="{@type}"/>
</xsl:template>
<xsl:template match="include">
<xsl:if test="@ref">
<xsl:variable name="documentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
<xsl:apply-templates select="document($documentFile)/document" mode="include">
<xsl:with-param name="parent" select="@parent"/>
<xsl:with-param name="link" select="@link"/>
<xsl:with-param name="ref" select="@ref"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<xsl:template match="document" mode="include">
<xsl:param name="parent">false</xsl:param>
<xsl:param name="link">false</xsl:param>
<xsl:param name="ref"></xsl:param>
<xsl:choose>
<xsl:when test="$link = 'true'">
<xsl:if test="$parent = 'true'">
<h2><xsl:apply-templates select="parent"/></h2>
</xsl:if>
<h3><a href="{$ref}"><xsl:value-of select="title"/></a></h3>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="document"><xsl:with-param name="parent" select="$parent"/><xsl:with-param name="ref" select="$ref"/></xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<hr/>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- author="Jeff Parsons" creator="http://www.pcjs.org/" created="2012-05-05T19:53:00" modified="2012-05-05T19:53:00" license="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" -->
<!DOCTYPE xsl:stylesheet [
<!-- XSLT understands these entities only: lt, gt, apos, quot, and amp. Other useful entities are defined below (see entities.dtd). -->
<!ENTITY nbsp "&#160;"> <!ENTITY sect "&#167;"> <!ENTITY copy "&#169;"> <!ENTITY para "&#182;"> <!ENTITY ndash "&#8211;"> <!ENTITY mdash "&#8212;">
<!ENTITY lsquo "&#8216;"> <!ENTITY rsquo "&#8217;"> <!ENTITY ldquo "&#8220;"> <!ENTITY rdquo "&#8221;"> <!ENTITY dagger "&#8224;"> <!ENTITY Dagger "&#8225;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="rootDir" select="''"/>
<xsl:param name="generator" select="'client'"/>
<xsl:output doctype-system="about:legacy-compat"/>
<xsl:include href="../../../my_modules/shared/templates/common.xsl"/>
<xsl:template match="/outline">
<html lang="en">
<head>
<title><xsl:value-of select="title"/><xsl:text> | jsmachines.net</xsl:text></title>
<xsl:call-template name="commonStyles"/>
</head>
<body>
<div class="page">
<xsl:apply-templates/>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View file

@ -0,0 +1,25 @@
.register {
float: left;
}
.bitBucket {
float: left;
width: 19px;
height: 38px;
}
.bitCell {
float: left;
width: 19px;
height: 19px;
margin-right: -1px;
margin-bottom: -1px;
border: 1px solid black;
text-align: center;
line-height: 19px; /* the equivalent of "vertical-align: middle" for single-line elements */
}
.bitCellLeft {
border-left: 1px solid black;
}
.bitLabel {
font-size: xx-small;
text-align: center;
}

View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- author="Jeff Parsons (@jeffpar)" website="http://www.pcjs.org/" created="2012-05-05" modified="2014-03-28" license="http://www.gnu.org/licenses/gpl.html" -->
<!DOCTYPE xsl:stylesheet [
<!-- XSLT understands these entities only: lt, gt, apos, quot, and amp. Other required entities may be defined below (see entities.dtd). -->
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template name="registerIncludes">
<link rel="stylesheet" type="text/css" href="/my_modules/ecpjs-client/templates/register.css"/>
<script type="text/javascript" src="/my_modules/ecpjs-client/lib/register.js"></script>
</xsl:template>
<xsl:template match="register[@ref]">
<xsl:variable name="component" select="name(.)"/>
<xsl:variable name="componentFile"><xsl:value-of select="$rootDir"/><xsl:value-of select="@ref"/></xsl:variable>
<xsl:apply-templates select="document($componentFile)"/>
</xsl:template>
<xsl:template match="register[not(@ref)]">
<xsl:variable name="nBits">
<!-- Values allowed: positive integer defining number of bits, default of 40 (ECP default) -->
<xsl:choose>
<xsl:when test="nBits"><xsl:value-of select="nBits"/></xsl:when>
<xsl:when test="@nBits"><xsl:value-of select="@nBits"/></xsl:when>
<xsl:otherwise>40</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="signed">
<!-- Values allowed: true if left-most bit is sign bit (ECP default), false if not -->
<xsl:choose>
<xsl:when test="signed"><xsl:value-of select="signed"/></xsl:when>
<xsl:when test="@signed"><xsl:value-of select="@signed"/></xsl:when>
<xsl:otherwise>true</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="bit0Exp">
<!-- Values allowed: integer power of two corresponding to right-most bit, default of -39 (ECP default) -->
<xsl:choose>
<xsl:when test="bit0Exp"><xsl:value-of select="bit0Exp"/></xsl:when>
<xsl:when test="@bit0Exp"><xsl:value-of select="@bit0Exp"/></xsl:when>
<xsl:otherwise>-39</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="labels">
<!-- Values allowed: true if bits should be labeled, false if not (default)-->
<xsl:choose>
<xsl:when test="labels"><xsl:value-of select="labels"/></xsl:when>
<xsl:when test="@labels"><xsl:value-of select="@labels"/></xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:call-template name="component">
<xsl:with-param name="class">register</xsl:with-param>
<xsl:with-param name="parms">nBits:<xsl:value-of select="$nBits"/>,signed:<xsl:value-of select="$signed"/>,bit0Exp:<xsl:value-of select="$bit0Exp"/>,labels:<xsl:value-of select="$labels"/></xsl:with-param>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>