[25660] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <xsl:stylesheet version="1.0"
|
---|
| 3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 4 | xmlns:java="http://xml.apache.org/xslt/java"
|
---|
| 5 | xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
|
---|
| 6 | xmlns:gslib="http://www.greenstone.org/skinning"
|
---|
| 7 | xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
|
---|
| 8 | extension-element-prefixes="java util"
|
---|
| 9 | exclude-result-prefixes="java util gsf">
|
---|
| 10 |
|
---|
| 11 | <xsl:template name="rightSidebar">
|
---|
[25922] | 12 | <div id="rightSidebar">
|
---|
| 13 | <xsl:call-template name="displayCoverImage"/>
|
---|
| 14 | <xsl:call-template name="viewOptions"/>
|
---|
[25932] | 15 |
|
---|
| 16 | <xsl:if test="@docType != 'simple'">
|
---|
| 17 | <xsl:call-template name="displayTOC"/>
|
---|
| 18 | </xsl:if>
|
---|
[25922] | 19 | </div>
|
---|
| 20 | </xsl:template>
|
---|
| 21 |
|
---|
| 22 | <xsl:template name="displayCoverImage">
|
---|
| 23 | <!-- Need to be in the context of the top-level documentNode rather than the document for the gsf:metadata call to work -->
|
---|
| 24 | <xsl:for-each select="documentNode">
|
---|
| 25 | <xsl:variable name="hasCover"><gsf:metadata name="hascover"/></xsl:variable>
|
---|
| 26 | <xsl:if test="$hasCover = '1' and (not(/page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']) or /page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']/@value='true')">
|
---|
| 27 | <!-- the book's cover image -->
|
---|
| 28 | <div id="coverImage">
|
---|
| 29 | <img>
|
---|
| 30 | <xsl:attribute name="src"><xsl:value-of select="$httpPath"/>/index/assoc/<gsf:metadata name="assocfilepath"/>/cover.jpg</xsl:attribute>
|
---|
| 31 | </img><xsl:text> </xsl:text>
|
---|
| 32 | </div>
|
---|
| 33 | </xsl:if>
|
---|
| 34 | </xsl:for-each>
|
---|
| 35 | </xsl:template>
|
---|
| 36 |
|
---|
| 37 | <xsl:template name="displayTOC">
|
---|
| 38 | <div class="tableOfContentsContainer ui-state-default">
|
---|
| 39 | <table class="tocTable ui-widget-content">
|
---|
| 40 | <tr>
|
---|
| 41 | <td style="vertical-align:top; text-align:right;">
|
---|
| 42 | <a id="sidebarMinimizeButton" href="javascript:minimizeSidebar();" style="float: right; font-size:0.6em;">
|
---|
| 43 | <img class="icon" style="padding-top:3px;">
|
---|
| 44 | <xsl:attribute name="src">
|
---|
| 45 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
[25660] | 46 | </xsl:attribute>
|
---|
[25922] | 47 | </img>
|
---|
| 48 | </a>
|
---|
| 49 | <a id="sidebarMaximizeButton" href="javascript:maximizeSidebar();" style="float: right; font-size:0.6em; display:none;">
|
---|
| 50 | <img class="icon" style="padding-top:3px;">
|
---|
| 51 | <xsl:attribute name="src">
|
---|
| 52 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
| 53 | </xsl:attribute>
|
---|
| 54 | </img>
|
---|
| 55 | </a>
|
---|
| 56 | </td>
|
---|
| 57 | </tr>
|
---|
| 58 | <tr><td>
|
---|
| 59 | <div id="contentsArea">
|
---|
| 60 | <!-- show the berry basket if it's turned on -->
|
---|
| 61 | <gslib:berryBasket/>
|
---|
[25660] | 62 |
|
---|
[25922] | 63 | <!-- the contents (if enabled) -->
|
---|
| 64 | <xsl:choose>
|
---|
[25972] | 65 | <xsl:when test="/page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'">
|
---|
[25922] | 66 | <gsf:image type="Thumb"/>
|
---|
| 67 | <!-- Table of contents will be dynamically retrieved when viewing a paged document -->
|
---|
| 68 | <script type="text/javascript">
|
---|
| 69 | <xsl:text disable-output-escaping="yes">
|
---|
| 70 | $(window).load(function()
|
---|
| 71 | {
|
---|
| 72 | retrieveTableOfContentsAndTitles();
|
---|
| 73 | });
|
---|
| 74 | </xsl:text>
|
---|
| 75 | </script>
|
---|
| 76 | <div id="tableOfContents"><xsl:text> </xsl:text></div>
|
---|
[25660] | 77 | <div id="tocLoadingImage" style="text-align:center;">
|
---|
| 78 | <img src="{util:getInterfaceText($interface_name, /page/@lang, 'loading_image')}"/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.loading')"/><xsl:text>...</xsl:text>
|
---|
| 79 | </div>
|
---|
[25922] | 80 | <table style="width:100%;"><tbody><tr>
|
---|
| 81 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.filter_pages')"/><xsl:text>: </xsl:text><input id="filterText" type="text" size="27"/></td>
|
---|
| 82 | </tr></tbody></table>
|
---|
| 83 | </xsl:when>
|
---|
| 84 | <xsl:when test="not(/page/pageRequest/paramList/param[@name = 'ed']/@value = '1')">
|
---|
| 85 | <div id="tableOfContents">
|
---|
| 86 | <div id="tocLoadingImage" style="text-align:center;">
|
---|
| 87 | <img src="{util:getInterfaceText($interface_name, /page/@lang, 'loading_image')}"/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.loading')"/><xsl:text>...</xsl:text>
|
---|
| 88 | </div>
|
---|
| 89 | </div>
|
---|
| 90 | <script type="text/javascript">
|
---|
| 91 | <xsl:text disable-output-escaping="yes">
|
---|
| 92 | $(window).load(function()
|
---|
| 93 | {
|
---|
| 94 | retrieveFullTableOfContents();
|
---|
| 95 | });
|
---|
| 96 | </xsl:text>
|
---|
| 97 | </script>
|
---|
| 98 | </xsl:when>
|
---|
| 99 | <xsl:otherwise>
|
---|
| 100 | <div id="tableOfContents">
|
---|
| 101 | <xsl:attribute name="class">
|
---|
| 102 | <xsl:choose>
|
---|
| 103 | <xsl:when test="count(//documentNode) > 1 and not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">visible</xsl:when>
|
---|
| 104 | <xsl:otherwise>hidden</xsl:otherwise>
|
---|
| 105 | </xsl:choose>
|
---|
| 106 | </xsl:attribute>
|
---|
| 107 | <xsl:for-each select="documentNode">
|
---|
| 108 | <xsl:call-template name="documentNodeTOC"/>
|
---|
| 109 | </xsl:for-each>
|
---|
| 110 | </div>
|
---|
| 111 | </xsl:otherwise>
|
---|
| 112 | </xsl:choose>
|
---|
| 113 | </div>
|
---|
| 114 | </td></tr>
|
---|
| 115 | </table>
|
---|
| 116 | </div>
|
---|
[25660] | 117 | </xsl:template>
|
---|
| 118 |
|
---|
| 119 | <!-- This template is used to display the table of contents -->
|
---|
[25720] | 120 | <xsl:template name="documentNodeTOC">
|
---|
[25660] | 121 |
|
---|
| 122 | <!-- check if this is the currently selected table of contents item -->
|
---|
| 123 | <xsl:variable name="isCurrent" select="nodeContent"/>
|
---|
| 124 |
|
---|
| 125 | <!-- formulate the link -->
|
---|
| 126 | <xsl:variable name="contentsLink">
|
---|
| 127 | <xsl:value-of select='$library_name'/>?a=d&c=<gslib:collectionNameShort/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&sib=1
|
---|
| 128 | </xsl:variable>
|
---|
| 129 |
|
---|
| 130 | <ul>
|
---|
| 131 | <table><tr>
|
---|
| 132 | <!-- The expand/collapse button (not displayed for the top level node) -->
|
---|
| 133 | <xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle'">
|
---|
| 134 | <td>
|
---|
| 135 | <xsl:choose>
|
---|
| 136 | <xsl:when test="not(nodeContent and not(documentNode))">
|
---|
| 137 | <img id="ttoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
|
---|
| 138 | <xsl:attribute name="src">
|
---|
| 139 | <xsl:choose>
|
---|
| 140 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID">
|
---|
| 141 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
| 142 | </xsl:when>
|
---|
| 143 | <xsl:otherwise>
|
---|
| 144 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
| 145 | </xsl:otherwise>
|
---|
| 146 | </xsl:choose>
|
---|
| 147 | </xsl:attribute>
|
---|
| 148 | </img>
|
---|
| 149 | </xsl:when>
|
---|
| 150 | <xsl:otherwise>
|
---|
| 151 | <xsl:attribute name="class">emptyIcon</xsl:attribute>
|
---|
| 152 | </xsl:otherwise>
|
---|
| 153 | </xsl:choose>
|
---|
| 154 | </td>
|
---|
| 155 | </xsl:if>
|
---|
| 156 |
|
---|
| 157 | <!-- The chapter/page icon -->
|
---|
| 158 | <td>
|
---|
| 159 | <img>
|
---|
| 160 | <xsl:if test="nodeContent and not(documentNode)">
|
---|
| 161 | <xsl:attribute name="class">leafNode</xsl:attribute>
|
---|
| 162 | </xsl:if>
|
---|
| 163 |
|
---|
| 164 | <xsl:attribute name="src">
|
---|
| 165 | <xsl:choose>
|
---|
| 166 | <xsl:when test="nodeContent and not(documentNode)">
|
---|
| 167 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'page_image')"/>
|
---|
| 168 | </xsl:when>
|
---|
| 169 | <xsl:otherwise>
|
---|
| 170 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'chapter_image')"/>
|
---|
| 171 | </xsl:otherwise>
|
---|
| 172 | </xsl:choose>
|
---|
| 173 | </xsl:attribute>
|
---|
| 174 | </img>
|
---|
| 175 | </td>
|
---|
| 176 |
|
---|
| 177 | <!-- The section name, links to the section in the document -->
|
---|
| 178 | <td>
|
---|
[25936] | 179 | <a id="toclink{@nodeID}" href="javascript:focusSection('{@nodeID}');">
|
---|
[25660] | 180 | <xsl:if test="util:hashToSectionId(@nodeID)">
|
---|
| 181 | <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
|
---|
| 182 | <xsl:text> </xsl:text>
|
---|
| 183 | </xsl:if>
|
---|
[26175] | 184 | <xsl:call-template name="sectionHeading"/>
|
---|
[25660] | 185 | </a>
|
---|
| 186 | </td>
|
---|
| 187 | </tr></table>
|
---|
| 188 |
|
---|
| 189 | <!-- display any child items -->
|
---|
| 190 | <xsl:if test="documentNode">
|
---|
| 191 | <li id="toc{@nodeID}">
|
---|
| 192 | <xsl:attribute name="style">
|
---|
| 193 | <xsl:choose>
|
---|
| 194 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID">
|
---|
| 195 | <xsl:text>display:block;</xsl:text>
|
---|
| 196 | </xsl:when>
|
---|
| 197 | <xsl:otherwise>
|
---|
| 198 | <xsl:text>display:none;</xsl:text>
|
---|
| 199 | </xsl:otherwise>
|
---|
| 200 | </xsl:choose>
|
---|
| 201 | </xsl:attribute>
|
---|
[25720] | 202 | <xsl:for-each select="documentNode">
|
---|
[25660] | 203 | <xsl:call-template name="documentNodeTOC"/>
|
---|
| 204 | </xsl:for-each>
|
---|
| 205 | </li>
|
---|
| 206 | </xsl:if>
|
---|
| 207 |
|
---|
| 208 | </ul>
|
---|
| 209 | </xsl:template>
|
---|
| 210 |
|
---|
| 211 | <xsl:template name="viewOptions">
|
---|
[25922] | 212 | <div id="viewAndZoomOptions" class="ui-state-default ui-corner-all">
|
---|
| 213 | <ul id="viewOptions">
|
---|
| 214 | <!-- Paged-image options -->
|
---|
[25936] | 215 | <li id="pagedImageOptions">
|
---|
| 216 | <xsl:attribute name="style">
|
---|
| 217 | <xsl:choose>
|
---|
[25972] | 218 | <xsl:when test="count(//documentNode/metadataList/metadata[@name = 'Screen']) > 0 or /page/pageResponse/document/documentNode/@docType = 'paged' or /page/pageResponse/document/documentNode/@docType = 'pagedhierarchy'">
|
---|
[25936] | 219 | </xsl:when>
|
---|
| 220 | <xsl:otherwise>
|
---|
| 221 | display:none;
|
---|
| 222 | </xsl:otherwise>
|
---|
| 223 | </xsl:choose>
|
---|
| 224 | </xsl:attribute>
|
---|
| 225 | <select id="viewSelection" onchange="changeView();">
|
---|
| 226 | <xsl:choose>
|
---|
| 227 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'">
|
---|
| 228 | <option>Default view</option>
|
---|
| 229 | <option selected="true">Image view</option>
|
---|
| 230 | <option>Text view</option>
|
---|
| 231 | </xsl:when>
|
---|
| 232 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'">
|
---|
| 233 | <option>Default view</option>
|
---|
| 234 | <option>Image view</option>
|
---|
| 235 | <option selected="true">Text view</option>
|
---|
| 236 | </xsl:when>
|
---|
| 237 | <xsl:otherwise>
|
---|
| 238 | <option selected="true">Default view</option>
|
---|
| 239 | <option>Image view</option>
|
---|
| 240 | <option>Text view</option>
|
---|
| 241 | </xsl:otherwise>
|
---|
| 242 | </xsl:choose>
|
---|
| 243 | </select>
|
---|
| 244 | </li>
|
---|
[25660] | 245 |
|
---|
[25922] | 246 | <!-- Realistic books link -->
|
---|
| 247 | <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
|
---|
| 248 | <li>
|
---|
| 249 | <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.realisticBooksTooltip')"/></xsl:attribute>
|
---|
| 250 | <img>
|
---|
| 251 | <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'realistic_books_image')"/></xsl:attribute>
|
---|
[25660] | 252 | </img>
|
---|
[25922] | 253 | <input id="rbOption" type="checkbox" onclick="bookInit();" class="optionCheckBox"/>
|
---|
| 254 | </li>
|
---|
| 255 | </xsl:if>
|
---|
| 256 |
|
---|
| 257 | <!-- Highlight on/off button -->
|
---|
| 258 | <xsl:if test="util:contains(/page/pageRequest/paramList/param[@name = 'p.s']/@value, 'Query')">
|
---|
| 259 | <li>
|
---|
| 260 | <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.highlightTooltip')"/></xsl:attribute>
|
---|
| 261 | <img>
|
---|
| 262 | <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'highlight_image')"/></xsl:attribute>
|
---|
[25660] | 263 | </img>
|
---|
[25922] | 264 | <input id="highlightOption" type="checkbox" class="optionCheckBox" onclick="swapHighlight();">
|
---|
| 265 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'on'">
|
---|
| 266 | <xsl:attribute name="checked">true</xsl:attribute>
|
---|
| 267 | </xsl:if>
|
---|
| 268 | </input>
|
---|
| 269 | </li>
|
---|
[25936] | 270 | </xsl:if><xsl:text> </xsl:text>
|
---|
[25922] | 271 | </ul>
|
---|
| 272 | <ul id="zoomOptions">
|
---|
| 273 | <!-- This is invisible unless it is made visible by Javascript controlling the image zooming -->
|
---|
| 274 | <xsl:attribute name="style">display: none;</xsl:attribute>
|
---|
| 275 | <li style="width:10%;">
|
---|
| 276 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.zoom')"/>
|
---|
| 277 | </li>
|
---|
| 278 | <li style="width:5%;">
|
---|
| 279 | <input id="zoomToggle" type="checkbox"/>
|
---|
| 280 | <script type="text/javascript">
|
---|
| 281 | <xsl:text disable-output-escaping="yes">
|
---|
| 282 | $("#zoomToggle").change(function()
|
---|
| 283 | {
|
---|
| 284 | _imageZoomEnabled = !_imageZoomEnabled;
|
---|
| 285 | });
|
---|
| 286 | </xsl:text>
|
---|
| 287 | </script>
|
---|
| 288 | </li>
|
---|
| 289 | <li style="width:15%;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.zoom_size')"/><xsl:text>:</xsl:text></li>
|
---|
| 290 | <li id="zoomSlider" style="width:50%; height:5px;"><xsl:text> </xsl:text></li>
|
---|
[25660] | 291 | <script type="text/javascript">
|
---|
| 292 | <xsl:text disable-output-escaping="yes">
|
---|
[25922] | 293 | $("#zoomSlider").slider(
|
---|
[25660] | 294 | {
|
---|
[25922] | 295 | change: function(event, ui)
|
---|
[25660] | 296 | {
|
---|
[25922] | 297 | var sliderValue = ui.value;
|
---|
| 298 | var divs = document.getElementsByTagName("DIV");
|
---|
| 299 | for(var i = 0; i < divs.length; i++)
|
---|
[25660] | 300 | {
|
---|
[25922] | 301 | if(divs[i].getAttribute("id") && divs[i].getAttribute("id").search(/^mover.*/) != -1)
|
---|
[25660] | 302 | {
|
---|
[25922] | 303 | divs[i].style.height = 200 + (2 * sliderValue) + "px";
|
---|
| 304 | divs[i].style.width = 200 + (2 * sliderValue) + "px";
|
---|
[25660] | 305 | }
|
---|
| 306 | }
|
---|
[25922] | 307 | }
|
---|
| 308 | });
|
---|
| 309 | </xsl:text>
|
---|
| 310 | </script>
|
---|
| 311 | <style>.ui-slider .ui-slider-handle{height:0.8em; width:1.0em;}</style>
|
---|
| 312 | </ul>
|
---|
| 313 | </div>
|
---|
[25660] | 314 | </xsl:template>
|
---|
| 315 | </xsl:stylesheet> |
---|