Skip to content
Snippets Groups Projects
Commit 02661b1b authored by Goik Martin's avatar Goik Martin
Browse files

toggle answers and highlighting

parent e4e33815
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:d="http://docbook.org/ns/docbook"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="d"
version="1.1">
<xsl:template name="user.webhelp.head.content">
<xsl:param name="node"/>
<script type="text/javascript"> <!-- goiks extension head start -->
function toggleDisplay(inputEl) {
divElem = nextSibling(inputEl);
if (divElem.style.visibility == 'hidden') {
divElem.style.visibility = 'visible';
inputEl.setAttribute('value','-');
} else {
divElem.style.visibility = 'hidden';
inputEl.setAttribute('value','+');
}
}
function nextSibling(n) {
x=n.nextSibling;
while (x.nodeType!=1) {
x=x.nextSibling;
}
return x;
}
</script>
<xsl:if test="//m:math">
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});</script>
<script src="https://prog.mi.hdm-stuttgart.de/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
<xsl:comment>Self closing tags disallowed!</xsl:comment>
</script>
</xsl:if>
</xsl:template>
<!--Allow for opening and closing of answers -->
<xsl:template match="d:answer">
<xsl:variable name="deflabel">
<xsl:apply-templates select="." mode="qanda.defaultlabel"/>
</xsl:variable>
<tr>
<xsl:apply-templates select="." mode="common.html.attributes"/>
<xsl:call-template name="id.attribute"/>
<td align="{$direction.align.start}" valign="top">
<xsl:call-template name="anchor"/>
<xsl:variable name="answer.label">
<xsl:apply-templates select="." mode="label.markup"/>
</xsl:variable>
<xsl:if test="string-length($answer.label) &gt; 0">
<p><strong>
<xsl:copy-of select="$answer.label"/>
</strong></p>
</xsl:if>
</td>
<td align="{$direction.align.start}" valign="top">
<input onclick="toggleDisplay(this)" type="button" value="+"/> <!--goik: start "header" clickable answer modification -->
<div style="visibility:hidden;"> <!--goik: end "header" clickable answer modification -->
<xsl:apply-templates select="*[local-name(.) != 'label' and local-name(.) != 'qandaentry']"/>
<!-- * handle nested answer/qandaentry instances -->
<!-- * (bug 1509043 from Daniel Leidert) -->
<xsl:if test="descendant::d:question">
<xsl:call-template name="process.qandaset"/>
</xsl:if>
</div> <!--goik: "footer" clickable answer modification -->
</td>
</tr>
</xsl:template>
<xsl:template match="m:*">
<xsl:element name="{local-name()}">
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="d:videodata">
<video controls="controls" preload="auto">
<xsl:attribute name="title">
<xsl:value-of select="normalize-space(../../../d:title)"/>
</xsl:attribute>
<xsl:variable name="hdm_ImageFilename"> <!-- hdm_ prefix: do not mess with docbook! -->
<xsl:call-template name="mediaobject.filename">
<xsl:with-param name="object" select=".."/>
</xsl:call-template>
</xsl:variable>
<source src="{$hdm_ImageFilename}" type='video/webm' />
<source src="{$hdm_ImageFilename}.mp4" type='video/mp4'/>
</video>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:d="http://docbook.org/ns/docbook"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
xmlns:exsl="http://exslt.org/common"
xmlns:set="http://exslt.org/sets"
version="1.0"
exclude-result-prefixes="doc exsl set d">
<xsl:import href="../../docbook-xsl/xhtml/chunk.xsl"/>
<xsl:import href="../../docbook-xsl/webhelp/xsl/webhelp-common.xsl"/>
<xsl:import href="../../docbook-xsl/webhelp/xsl/titlepage.templates.xsl"/>
xmlns:d="http://docbook.org/ns/docbook"
xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
xmlns:exsl="http://exslt.org/common"
xmlns:set="http://exslt.org/sets"
version="1.0"
exclude-result-prefixes="doc exsl set d">
<xsl:import href="../../docbook-xsl/xhtml/chunk.xsl"/>
<xsl:import href="../../docbook-xsl/xhtml/highlight.xsl"/>
<xsl:import href="../../docbook-xsl/webhelp/xsl/webhelp-common.xsl"/>
<xsl:import href="../../docbook-xsl/webhelp/xsl/titlepage.templates.xsl"/>
<!--
-->
<xsl:include href="hdmextensions.xsl"/>
</xsl:stylesheet>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment