Author: artdaw
Date: 2008-10-01 11:26:10 -0400 (Wed, 01 Oct 2008)
New Revision: 10595
Modified:
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/common.xsl
trunk/documentation/jbosstools-jdocbook-style/src/main/com/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/com/jboss/tools/common.xsl
===================================================================
---
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/common.xsl 2008-10-01
15:12:54 UTC (rev 10594)
+++
trunk/documentation/jbosstools-docbook-xslt/src/main/resources/xslt/com/jboss/tools/common.xsl 2008-10-01
15:26:10 UTC (rev 10595)
@@ -187,4 +187,131 @@
</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/com/css/css/tools.css
===================================================================
---
trunk/documentation/jbosstools-jdocbook-style/src/main/com/css/css/tools.css 2008-10-01
15:12:54 UTC (rev 10594)
+++
trunk/documentation/jbosstools-jdocbook-style/src/main/com/css/css/tools.css 2008-10-01
15:26:10 UTC (rev 10595)
@@ -93,11 +93,20 @@
text-align:right;
}
-a.new {
+.new, .added {
background:transparent url(../images/new.png) no-repeat scroll right top;
padding-right:70px;
}
-a.updated {
+.updated, .changed {
background:transparent url(../images/updated.png) no-repeat scroll right top;
padding-right:70px;
}
+span.diffmkwrapper{
+ background-color: #cce2f6;
+}
+
+div.diffmkwrapper p{
+ background-color: #c8d7e4;
+ padding:0px;
+ margin-left:56px;
+}