You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by je...@apache.org on 2002/11/22 13:50:56 UTC
cvs commit: xml-forrest/src/resources/skins/forrest-site/xslt/html book2menu.xsl pathutils.xsl
jefft 2002/11/22 04:50:56
Modified: . Tag: FORREST_02_BRANCH status.xml
src/resources/skins/avalon-tigris/xslt/html Tag:
FORREST_02_BRANCH book2menu.xsl pathutils.xsl
src/resources/skins/basic/xslt/html Tag: FORREST_02_BRANCH
pathutils.xsl
src/resources/skins/forrest-site/xslt/html Tag:
FORREST_02_BRANCH book2menu.xsl pathutils.xsl
Log:
<action dev="JT" type="fix" context="skins">
Fixed a bug where multiple menu entries are highlighted if the filenames
share a common prefix.
</action>
Revision Changes Path
No revision
No revision
1.53.2.4 +4 -0 xml-forrest/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs/xml-forrest/status.xml,v
retrieving revision 1.53.2.3
retrieving revision 1.53.2.4
diff -u -r1.53.2.3 -r1.53.2.4
--- status.xml 22 Nov 2002 10:33:21 -0000 1.53.2.3
+++ status.xml 22 Nov 2002 12:50:56 -0000 1.53.2.4
@@ -106,6 +106,10 @@
</release>
-->
<release version="0.2.1" date="unreleased">
+ <action dev="JT" type="fix" context="skins">
+ Fixed a bug where multiple menu entries are highlighted if the filenames
+ share a common prefix.
+ </action>
<action dev="JT" type="fix" context="shbat" due-to="Omar Belhaj"
due-to-email="belhaj@online.no">
Fixed a bug in forrest.bat, which would fail if run from a different
No revision
No revision
1.2.2.1 +13 -1 xml-forrest/src/resources/skins/avalon-tigris/xslt/html/book2menu.xsl
Index: book2menu.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/avalon-tigris/xslt/html/book2menu.xsl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- book2menu.xsl 9 Nov 2002 13:38:01 -0000 1.2
+++ book2menu.xsl 22 Nov 2002 12:50:56 -0000 1.2.2.1
@@ -10,6 +10,12 @@
</xsl:call-template>
</xsl:variable>
+ <xsl:variable name="path-noext">
+ <xsl:call-template name="path-noext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+
<xsl:template match="book">
<div class="menuBar">
<xsl:apply-templates select="menu"/>
@@ -25,8 +31,14 @@
<xsl:template match="menu-item">
<div class="menuItem">
+ <xsl:variable name="href-noext">
+ <xsl:call-template name="path-noext">
+ <xsl:with-param name="path" select="@href"/>
+ </xsl:call-template>
+ </xsl:variable>
+
<xsl:choose>
- <xsl:when test="starts-with(@href, $filename-noext)">
+ <xsl:when test="$href-noext = $path-noext">
<span class="menuSelected"><xsl:value-of select="@label"/></span>
</xsl:when>
<xsl:otherwise>
1.2.2.1 +18 -1 xml-forrest/src/resources/skins/avalon-tigris/xslt/html/Attic/pathutils.xsl
Index: pathutils.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/avalon-tigris/xslt/html/Attic/pathutils.xsl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- pathutils.xsl 9 Nov 2002 05:10:41 -0000 1.2
+++ pathutils.xsl 22 Nov 2002 12:50:56 -0000 1.2.2.1
@@ -97,6 +97,20 @@
<xsl:value-of select="substring($filename, 1, string-length($filename) - string-length($ext))"/>
</xsl:template>
+<!-- Returns a path with the filename stripped of its last extension.
+Examples:
+'foo/bar/index.dtdx.html' -> 'foo/bar/index.dtdx'
+-->
+<xsl:template name="path-noext">
+ <xsl:param name="path"/>
+ <xsl:variable name="ext">
+ <xsl:call-template name="ext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="substring($path, 1, string-length($path) - string-length($ext))"/>
+</xsl:template>
+
<!--
Uncomment this to test.
Usage: saxon pathutils.xsl pathutils.xsl path=foo/bar
@@ -115,6 +129,9 @@
<xsl:with-param name="path" select="$path"/>
</xsl:call-template>
filename-noext= <xsl:call-template name="filename-noext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ path-noext= <xsl:call-template name="path-noext">
<xsl:with-param name="path" select="$path"/>
</xsl:call-template>
</xsl:message>
No revision
No revision
1.1.2.1 +25 -8 xml-forrest/src/resources/skins/basic/xslt/html/Attic/pathutils.xsl
Index: pathutils.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/basic/xslt/html/Attic/pathutils.xsl,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -r1.1 -r1.1.2.1
--- pathutils.xsl 2 Nov 2002 10:15:02 -0000 1.1
+++ pathutils.xsl 22 Nov 2002 12:50:56 -0000 1.1.2.1
@@ -97,25 +97,42 @@
<xsl:value-of select="substring($filename, 1, string-length($filename) - string-length($ext))"/>
</xsl:template>
+<!-- Returns a path with the filename stripped of its last extension.
+Examples:
+'foo/bar/index.dtdx.html' -> 'foo/bar/index.dtdx'
+-->
+<xsl:template name="path-noext">
+ <xsl:param name="path"/>
+ <xsl:variable name="ext">
+ <xsl:call-template name="ext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="substring($path, 1, string-length($path) - string-length($ext))"/>
+</xsl:template>
+
<!--
Uncomment this to test.
-Usage: saxon resource.xsl resource.xsl resource=foo/bar
+Usage: saxon pathutils.xsl pathutils.xsl path=foo/bar
-<xsl:param name="resource" select="'/foo/bar/index.html'"/>
+<xsl:param name="path" select="'/foo/bar/index.html'"/>
<xsl:template match="/">
<xsl:message>
- resource= <xsl:value-of select="$resource"/>
+ path= <xsl:value-of select="$path"/>
dirname= <xsl:call-template name="dirname">
- <xsl:with-param name="path" select="$resource"/>
+ <xsl:with-param name="path" select="$path"/>
</xsl:call-template>
filename= <xsl:call-template name="filename">
- <xsl:with-param name="path" select="$resource"/>
+ <xsl:with-param name="path" select="$path"/>
</xsl:call-template>
ext= <xsl:call-template name="ext">
- <xsl:with-param name="path" select="$resource"/>
+ <xsl:with-param name="path" select="$path"/>
</xsl:call-template>
filename-noext= <xsl:call-template name="filename-noext">
- <xsl:with-param name="path" select="$resource"/>
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ path-noext= <xsl:call-template name="path-noext">
+ <xsl:with-param name="path" select="$path"/>
</xsl:call-template>
</xsl:message>
</xsl:template>
No revision
No revision
1.6.2.1 +22 -9 xml-forrest/src/resources/skins/forrest-site/xslt/html/book2menu.xsl
Index: book2menu.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/forrest-site/xslt/html/book2menu.xsl,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -r1.6 -r1.6.2.1
--- book2menu.xsl 9 Nov 2002 13:38:01 -0000 1.6
+++ book2menu.xsl 22 Nov 2002 12:50:56 -0000 1.6.2.1
@@ -20,6 +20,13 @@
</xsl:call-template>
</xsl:variable>
+ <xsl:variable name="path-noext">
+ <xsl:call-template name="path-noext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+
<xsl:template match="book">
<div class="menu">
<ul>
@@ -39,14 +46,20 @@
<xsl:template match="menu-item">
<li>
- <xsl:choose>
- <xsl:when test="starts-with(@href, $filename-noext)">
- <span class="sel"><font color="#ffcc00"><xsl:value-of select="@label"/></font></span>
- </xsl:when>
- <xsl:otherwise>
- <a href="{@href}"><xsl:value-of select="@label"/></a>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:variable name="href-noext">
+ <xsl:call-template name="path-noext">
+ <xsl:with-param name="path" select="@href"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="$href-noext = $path-noext">
+ <span class="sel"><font color="#ffcc00"><xsl:value-of select="@label"/></font></span>
+ </xsl:when>
+ <xsl:otherwise>
+ <a href="{@href}"><xsl:value-of select="@label"/></a>
+ </xsl:otherwise>
+ </xsl:choose>
</li>
</xsl:template>
<xsl:template match="external">
1.2.2.1 +18 -1 xml-forrest/src/resources/skins/forrest-site/xslt/html/Attic/pathutils.xsl
Index: pathutils.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/forrest-site/xslt/html/Attic/pathutils.xsl,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- pathutils.xsl 9 Nov 2002 05:10:41 -0000 1.2
+++ pathutils.xsl 22 Nov 2002 12:50:56 -0000 1.2.2.1
@@ -97,6 +97,20 @@
<xsl:value-of select="substring($filename, 1, string-length($filename) - string-length($ext))"/>
</xsl:template>
+<!-- Returns a path with the filename stripped of its last extension.
+Examples:
+'foo/bar/index.dtdx.html' -> 'foo/bar/index.dtdx'
+-->
+<xsl:template name="path-noext">
+ <xsl:param name="path"/>
+ <xsl:variable name="ext">
+ <xsl:call-template name="ext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="substring($path, 1, string-length($path) - string-length($ext))"/>
+</xsl:template>
+
<!--
Uncomment this to test.
Usage: saxon pathutils.xsl pathutils.xsl path=foo/bar
@@ -115,6 +129,9 @@
<xsl:with-param name="path" select="$path"/>
</xsl:call-template>
filename-noext= <xsl:call-template name="filename-noext">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+ path-noext= <xsl:call-template name="path-noext">
<xsl:with-param name="path" select="$path"/>
</xsl:call-template>
</xsl:message>