]> granicus.if.org Git - docbook-dsssl/commitdiff
Added a show/hide TOC button.
authorKasun Gajasinghe <kasunbg@gmail.com>
Tue, 13 Jul 2010 22:03:04 +0000 (22:03 +0000)
committerKasun Gajasinghe <kasunbg@gmail.com>
Tue, 13 Jul 2010 22:03:04 +0000 (22:03 +0000)
Put next/prev buttons in the banner header.

xsl/webhelp/template/common/css/positioning.css
xsl/webhelp/template/common/main.js
xsl/webhelp/xsl/webhelp.xsl

index d989469120ab4a56da65fa14b9699be8bebe1259..a9a6b9140aa77c5966f947036ff7e0dca1803a60 100755 (executable)
@@ -17,7 +17,7 @@ h2 {
     background: white url(../images/gov-header-bg.gif) repeat-x;
     position: fixed;
     width: 100%;
-    height: 80px;
+    height: 88px;
     top: 0;
     right: 0;
     bottom: auto;
@@ -30,7 +30,7 @@ h2 {
     overflow: auto;
     position: fixed;
     height: auto;
-    top: 80px;
+    top: 88px;
     bottom: 0;
     left: 0;
     width: 230px;
@@ -40,10 +40,10 @@ h2 {
 
 #content {
     position: relative;
-    top: 80px;
-    left: auto;
+    top: 88px;
+   /* left: 240px;*/
     right: auto;
-    bottom: 20px;
+  /*  bottom: 20px;  */
     margin: 0px 0px 0px 240px;
     width: auto;
     height: inherit;
@@ -59,11 +59,24 @@ h2 {
 }
 
 .navfooter {
-    bottom: 2%;
-    content: attr;
+    bottom: 2%; 
 }
 
 .searchFieldSet {
     font-size: 68.75%;
 }
\ No newline at end of file
+
+.pointLeft{
+    background:url("../images/showHideTreeIcons.png") 0 0 no-repeat ; 
+    height:28px;
+    width:15px;
+    display:block;
+    font-size:0;
+}
+
+.pointRight{
+    background: url("../images/showHideTreeIcons.png") -15px 0 no-repeat;
+    height:28px;
+    display:block;
+    font-size:0;
+}
\ No newline at end of file
index 8427e35080bd4b3cc28fad693244db0affb44525..e2318f35eae31a73580c0a1b00e00aee60d40bcc 100755 (executable)
@@ -86,4 +86,28 @@ function syncToc(){
             a = parentNode;
         }
     }
+}
+
+/**
+ * Code for Show/Hide TOC
+ *
+ */
+function showHideToc() {
+    var showHideButton = $("#showHideButton");
+    var leftNavigation = $("#leftnavigation");
+    var content = $("#content");
+
+    if (showHideButton != undefined && showHideButton.hasClass("pointLeft")) {
+        //Hide TOC
+        showHideButton.removeClass('pointLeft').addClass('pointRight');
+        content.css("margin", "0 0 0 0");
+        leftNavigation.css("display","none");
+        showHideButton.attr("title", "Hide the TOC tree");
+    } else {
+        //Show the TOC
+        showHideButton.removeClass('pointRight').addClass('pointLeft');
+        content.css("margin", "0 0 0 240px");
+        leftNavigation.css("display","block");
+        showHideButton.attr("title", "Show the TOC Tree");
+    }
 }
\ No newline at end of file
index da644a09d96a2602d8efd1f8279f78a21aacb234..6d6a9d2c7233e98d752332baecb2da4caa8fe45b 100755 (executable)
@@ -82,7 +82,7 @@
                 </xsl:call-template>";
             txt_results_for = "<xsl:call-template name="gentext">
                 <xsl:with-param name="key" select="'txt_results_for'"/>
-                </xsl:call-template>";
+                </xsl:call-template>"; 
         </script>
         <style type="text/css">
             input {
         </script>
     </xsl:template>
 
-    <xsl:template name="user.header.navigation"> 
-        <xsl:call-template name="webhelpheader"/>
+    <xsl:template name="user.header.navigation">
+        <xsl:param name="prev"/>
+        <xsl:param name="next"/>
+        <xsl:param name="nav.context"/>
+        <xsl:call-template name="webhelpheader">
+            <xsl:with-param name="prev" select="$prev"/>
+            <xsl:with-param name="next" select="$next"/>
+            <xsl:with-param name="nav.context" select="$nav.context"/>
+        </xsl:call-template>
         <!--xsl:call-template name="webhelptoc"/-->
 
         <!--testing toc in the content page>
         </xsl:if--> 
     </xsl:template>
 
+    <xsl:template name="user.header.content">
+        <div> 
+            <a id="showHideButton" onclick="showHideToc();" class="pointLeft" title="Hide TOC tree">.</a>
+        </div>
+    </xsl:template>
+
     <xsl:template name="user.footer.navigation"> 
        <xsl:call-template name="webhelptoc">
                  <xsl:with-param name="currentid" select="generate-id(.)"/>
     <body>
       <xsl:call-template name="body.attributes"/>
 
-      <xsl:call-template name="user.header.navigation"/>
+      <xsl:call-template name="user.header.navigation">
+          <xsl:with-param name="prev" select="$prev"/>
+          <xsl:with-param name="next" select="$next"/>
+          <xsl:with-param name="nav.context" select="$nav.context"/>
+      </xsl:call-template>
+
 
       <div id="content">
-          <xsl:call-template name="header.navigation">
-              <xsl:with-param name="prev" select="$prev"/>
-              <xsl:with-param name="next" select="$next"/>
-              <xsl:with-param name="nav.context" select="$nav.context"/>
-          </xsl:call-template>
 
           <xsl:call-template name="user.header.content"/>
 
 
 <!-- The Header with the company logo -->
 <xsl:template name="webhelpheader">
+    <xsl:param name="prev"/>
+    <xsl:param name="next"/>
+    <xsl:param name="nav.context"/>
 
-      <xsl:variable name="home" select="/*[1]"/>
+    <xsl:variable name="home" select="/*[1]"/>
       <xsl:variable name="up" select="parent::*"/>
 
         <div id="header">
             <img style='margin-right: 2px; height: 59px; padding-right: 25px; padding-top: 8px' align="right"
-                 src='../common/images/logo.png' alt="DocBook"/>
+                 src='../common/images/logo.png' alt="Company Logo"/>
 
             <!-- Display the page title and the main heading(parent) of it-->
             <h1 align="center">
                     <xsl:otherwise>&#160;</xsl:otherwise>
                 </xsl:choose>
             </h1>
+
+             <!-- Prev and Next links generation-->
+            <div id="navheader" align="right">
+                <!--xsl:with-param name="prev" select="$prev"/>
+                <xsl:with-param name="next" select="$next"/>
+                <xsl:with-param name="nav.context" select="$nav.context"/-->
+                <xsl:if test="count($prev) &gt; 0
+                                or (count($up) &gt; 0
+                                    and generate-id($up) != generate-id($home)
+                                    and $navig.showtitles != 0)
+                                or count($next) &gt; 0">
+                    <xsl:if test="count($prev)>0">
+                        <a accesskey="p">
+                            <xsl:attribute name="href">
+                                <xsl:call-template name="href.target">
+                                    <xsl:with-param name="object" select="$prev"/>
+                                </xsl:call-template>
+                            </xsl:attribute>
+                            <xsl:call-template name="navig.content">
+                                <xsl:with-param name="direction" select="'prev'"/>
+                            </xsl:call-template>
+                        </a>
+                    </xsl:if>
+
+                    <!-- "Up" link-->
+                    <xsl:choose>
+                        <xsl:when test="count($up)&gt;0
+                                  and generate-id($up) != generate-id($home)">
+                             | 
+                            <a accesskey="u">
+                                <xsl:attribute name="href">
+                                    <xsl:call-template name="href.target">
+                                        <xsl:with-param name="object" select="$up"/>
+                                    </xsl:call-template>
+                                </xsl:attribute>
+                                <xsl:call-template name="navig.content">
+                                    <xsl:with-param name="direction" select="'up'"/>
+                                </xsl:call-template>
+                            </a>
+                        </xsl:when>
+                        <xsl:otherwise>&#160;</xsl:otherwise>
+                    </xsl:choose>
+
+
+                    <xsl:if test="count($next)>0">
+                        |
+                        <a accesskey="n">
+                            <xsl:attribute name="href">
+                                <xsl:call-template name="href.target">
+                                    <xsl:with-param name="object" select="$next"/>
+                                </xsl:call-template>
+                            </xsl:attribute>
+                            <xsl:call-template name="navig.content">
+                                <xsl:with-param name="direction" select="'next'"/>
+                            </xsl:call-template>
+                        </a>
+                    </xsl:if>
+                </xsl:if>
+            </div>
+            
         </div>
     </xsl:template>