Author: artdaw
Date: 2008-10-01 10:27:48 -0400 (Wed, 01 Oct 2008)
New Revision: 10592
Modified:
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/common.xsl
trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css
Log:
https://jira.jboss.org/jira/browse/JBDS-399 - 2 templates for adding 'added',
'changed' icons to all of the titles are done
Modified:
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/common.xsl
===================================================================
---
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/common.xsl 2008-10-01
14:10:39 UTC (rev 10591)
+++
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/org/jboss/tools/common.xsl 2008-10-01
14:27:48 UTC (rev 10592)
@@ -91,27 +91,17 @@
</xsl:attribute>
<xsl:choose>
- <xsl:when test="@role='new'">
+ <xsl:when test="@role='new' or
@role='updated'">
<xsl:attribute name="class">
<xsl:value-of select="@role"/>
</xsl:attribute>
</xsl:when>
- <xsl:when test="@role='updated'">
+ <!-- For mkdiff compatibility-->
+ <xsl:when test="@revisionflag='added' or
@revisionflag='changed'">
<xsl:attribute name="class">
- <xsl:value-of select="@role"/>
- </xsl:attribute>
- </xsl:when>
- <!-- For mkdiff compatibility-->
- <xsl:when test="@revisionflag='added'">
- <xsl:attribute name="class">
<xsl:value-of select="@revisionflag"/>
</xsl:attribute>
- </xsl:when>
- <xsl:when test="@revisionflag='changed'">
- <xsl:attribute name="class">
- <xsl:value-of select="@revisionflag"/>
- </xsl:attribute>
- </xsl:when>
+ </xsl:when>
</xsl:choose>
<!-- * if $autotoc.label.in.hyperlink is non-zero, then output the label
-->
@@ -188,4 +178,132 @@
</xsl:with-param>
</xsl:call-template>
</xsl:template>
+
+<!-- THERE ARE 2 TEMPLATES FOR ADDING 'ADDED', 'CHANGED' ICONS TO ALL
OF THE TITLES-->
+
+<xsl:template name="component.title">
+ <xsl:param name="node" select="."/>
+
+ <xsl:variable name="level">
+ <xsl:choose>
+ <xsl:when test="ancestor::section">
+ <xsl:value-of select="count(ancestor::section)+1"/>
+ </xsl:when>
+ <xsl:when test="ancestor::sect5">6</xsl:when>
+ <xsl:when test="ancestor::sect4">5</xsl:when>
+ <xsl:when test="ancestor::sect3">4</xsl:when>
+ <xsl:when test="ancestor::sect2">3</xsl:when>
+ <xsl:when test="ancestor::sect1">2</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- Let's handle the case where a component (bibliography, for example)
+ occurs inside a section; will we need parameters for this? -->
+ <xsl:variable name="revflag">
+ <xsl:choose>
+ <xsl:when test="../@role='new' or
../@role='updated'">
+ <xsl:value-of select="../@role"/>
+ </xsl:when>
+ <!-- For mkdiff compatibility-->
+ <xsl:when test="../@revisionflag='added' or
../@revisionflag='changed'">
+ <xsl:value-of select="../@revisionflag"/>
+ </xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="h{$level+1}">
+ <xsl:attribute name="class">
+ title
+ <xsl:value-of select="$revflag" />
+ </xsl:attribute>
+ <xsl:if test="$generate.id.attributes = 0">
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="conditional" select="0"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:apply-templates select="$node"
mode="object.title.markup">
+ <xsl:with-param name="allow-anchors" select="1"/>
+ </xsl:apply-templates>
+ </xsl:element>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<xsl:template name="section.heading">
+ <xsl:param name="section" select="."/>
+ <xsl:param name="level" select="1"/>
+ <xsl:param name="allow-anchors" select="1"/>
+ <xsl:param name="title"/>
+ <xsl:param name="class" select="'title'"/>
+
+ <xsl:variable name="id">
+ <xsl:choose>
+ <!-- if title is in an *info wrapper, get the grandparent -->
+ <xsl:when test="contains(local-name(..), 'info')">
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select="../.."/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select=".."/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- HTML H level is one higher than section level -->
+ <xsl:variable name="hlevel">
+ <xsl:choose>
+ <!-- highest valid HTML H level is H6; so anything nested deeper
+ than 5 levels down just becomes H6 -->
+ <xsl:when test="$level > 5">6</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$level + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="revflag">
+ <xsl:choose>
+ <xsl:when test="../@role='new' or
../@role='updated'">
+ <xsl:value-of select="../@role"/>
+ </xsl:when>
+ <!-- For mkdiff compatibility-->
+ <xsl:when test="../@revisionflag='added' or
../@revisionflag='changed'">
+ <xsl:value-of select="../@revisionflag"/>
+ </xsl:when>
+ <xsl:otherwise></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:element name="h{$hlevel}">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$class"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$revflag"/>
+ </xsl:attribute>
+ <xsl:if test="$css.decoration != '0'">
+ <xsl:if test="$hlevel<3">
+ <xsl:attribute name="style">clear: both</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="$allow-anchors != 0 and $generate.id.attributes = 0">
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select="$section"/>
+ <xsl:with-param name="conditional" select="0"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$generate.id.attributes != 0 and not(local-name(.) =
'appendix')">
+ <xsl:attribute name="id"><xsl:value-of
select="$id"/></xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$title"/>
+ </xsl:element>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+
</xsl:stylesheet>
Modified: trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css
===================================================================
---
trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css 2008-10-01
14:10:39 UTC (rev 10591)
+++
trunk/documentation/jbosstools-jdocbook-style/src/main/org/css/css/tools.css 2008-10-01
14:27:48 UTC (rev 10592)
@@ -82,11 +82,11 @@
display:block;
}
-a.new, a.added {
+.new, .added {
background:transparent url(../images/new.png) no-repeat scroll right top;
padding-right:70px;
}
-a.updated, a.changed {
+.updated, .changed {
background:transparent url(../images/updated.png) no-repeat scroll right top;
padding-right:70px;
}