diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-03-18T21·04+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-03-18T21·04+0000 |
commit | 3f3c4cce5a6552016a040999f64dc989d203a9ef (patch) | |
tree | c6b57dfa79f336a746bddb8110132b312da375e5 /src/log2xml/log2html.xsl | |
parent | 84c617966b8a78b7385aff04f1ac9b3bb7391898 (diff) |
* Added an extra escape code to signal "unimportant" messages. If a tree only has
unimportant messages, it is collapsed by the default. * Also added an optional integer argument to the escape code for opening a nesting level to indicate lack of importance. If set, the tree is collapsed by default.
Diffstat (limited to 'src/log2xml/log2html.xsl')
-rw-r--r-- | src/log2xml/log2html.xsl | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/log2xml/log2html.xsl b/src/log2xml/log2html.xsl index 667eb5998135..f75b2eb86fb5 100644 --- a/src/log2xml/log2html.xsl +++ b/src/log2xml/log2html.xsl @@ -24,11 +24,25 @@ </xsl:template> <xsl:template match="nest"> - <script type='text/javascript'>showTreeToggle("show","hide")</script> + + <!-- The tree should be collapsed by default if all children are + unimportant or if the header is unimportant. --> + <xsl:variable name="collapsed" + select="count(.//line[not(@priority = 3)]) = 0 or ./head[@priority = 3]" /> + + <xsl:variable name="style"><xsl:if test="$collapsed">display: none;</xsl:if></xsl:variable> + <xsl:variable name="arg"><xsl:choose><xsl:when test="$collapsed">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:variable> + + <script type='text/javascript'>showTreeToggle(<xsl:value-of select="$collapsed"/>)</script> <xsl:apply-templates select='head'/> - <ul class='nesting'> + + <ul class='nesting' style="{$style}"> <xsl:for-each select='line|nest'> - <xsl:param name="class"><xsl:choose><xsl:when test="position() != last()">line</xsl:when><xsl:otherwise>lastline</xsl:otherwise></xsl:choose></xsl:param> + + <!-- Is this the last line? If so, mark it as such so that it + can be rendered differently. --> + <xsl:variable name="class"><xsl:choose><xsl:when test="position() != last()">line</xsl:when><xsl:otherwise>lastline</xsl:otherwise></xsl:choose></xsl:variable> + <li class='{$class}'> <span class='lineconn' /> <span class='linebody'> |