forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/src/resources/skins/common/xslt/html book2menu.xsl
Date Thu, 28 Nov 2002 14:22:34 GMT
jefft       2002/11/28 06:22:34

  Modified:    .        status.xml
               src/resources/skins/common/xslt/html book2menu.xsl
  Log:
  Add special handling for tab hrefs with #anchor refs, as found at
  http://incubator.apache.org/
  
  Revision  Changes    Path
  1.72      +4 -0      xml-forrest/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/xml-forrest/status.xml,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- status.xml	28 Nov 2002 13:12:43 -0000	1.71
  +++ status.xml	28 Nov 2002 14:22:34 -0000	1.72
  @@ -24,6 +24,10 @@
   
     <changes>
       <release version="0.3-dev" date="unreleased">
  +      <action dev="JT" type="update" context="skins">
  +        Allow special handling of tab hrefs with #anchor references in them.  By
  +        default, such menu links are always clickable.
  +      </action>
         <action dev="JT" type="fix" context="skins">
           Fixed a bug where the no menu entry is 'selected' when in subdirectories.
         </action>       
  
  
  
  1.7       +35 -2     xml-forrest/src/resources/skins/common/xslt/html/book2menu.xsl
  
  Index: book2menu.xsl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/html/book2menu.xsl,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- book2menu.xsl	28 Nov 2002 13:12:43 -0000	1.6
  +++ book2menu.xsl	28 Nov 2002 14:22:34 -0000	1.7
  @@ -33,6 +33,19 @@
     <!-- These templates CAN be overridden                                -->
     <!-- ================================================================ -->
   
  +  <!-- Eg, if tab href is 'index.html#foo', this will be called when index.html
  +  is selected -->
  +  <xsl:template name="selected-anchor">
  +    <!-- By default, render as unselected so that it is clickable (takes user
  +    to the anchor) -->
  +    <xsl:call-template name="unselected"/>
  +  </xsl:template>
  +
  +  <xsl:template name="unselected-anchor">
  +    <xsl:call-template name="unselected"/>
  +  </xsl:template>
  +
  +
     <xsl:template match="book">
       <xsl:apply-templates select="menu"/>
     </xsl:template>
  @@ -56,10 +69,24 @@
       <xsl:choose>
         <!-- Compare with extensions stripped -->
         <xsl:when test="concat($dirname, $href-noext) = $path-noext">
  -        <xsl:call-template name="selected"/>
  +        <xsl:choose>
  +          <xsl:when test="contains(@href, '#')">
  +            <xsl:call-template name="selected-anchor"/>
  +          </xsl:when>
  +          <xsl:otherwise>
  +            <xsl:call-template name="selected"/>
  +          </xsl:otherwise>
  +        </xsl:choose>
         </xsl:when>
         <xsl:otherwise>
  -        <xsl:call-template name="unselected"/>
  +        <xsl:choose>
  +          <xsl:when test="contains(@href, '#')">
  +            <xsl:call-template name="unselected-anchor"/>
  +          </xsl:when>
  +          <xsl:otherwise>
  +            <xsl:call-template name="unselected"/>
  +          </xsl:otherwise>
  +        </xsl:choose>
         </xsl:otherwise>
       </xsl:choose>
     </xsl:template>
  @@ -72,6 +99,12 @@
     <xsl:param name="path"/>
   
     <xsl:include href="pathutils.xsl"/>
  +
  +  <xsl:variable name="filename">
  +    <xsl:call-template name="filename">
  +      <xsl:with-param name="path" select="$path"/>
  +    </xsl:call-template>
  +  </xsl:variable>
   
     <xsl:variable name="filename-noext">
       <xsl:call-template name="filename-noext">
  
  
  

Mime
View raw message