[19856] | 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 |
|
---|
[23989] | 11 | <!-- use the 'main' layout -->
|
---|
| 12 | <xsl:import href="layouts/main.xsl"/>
|
---|
[25660] | 13 | <xsl:import href="layouts/toc.xsl"/>
|
---|
[23989] | 14 |
|
---|
| 15 | <xsl:variable name="bookswitch">
|
---|
| 16 | <xsl:choose>
|
---|
| 17 | <xsl:when test="/page/pageRequest/paramList/param[@name='book']/@value">
|
---|
| 18 | <xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/>
|
---|
| 19 | </xsl:when>
|
---|
| 20 | <xsl:otherwise>off</xsl:otherwise>
|
---|
| 21 | </xsl:choose>
|
---|
| 22 | </xsl:variable>
|
---|
[19856] | 23 |
|
---|
[19988] | 24 | <!-- set page title -->
|
---|
| 25 | <xsl:template name="pageTitle"><gslib:documentTitle/></xsl:template>
|
---|
[19856] | 26 |
|
---|
[19988] | 27 | <!-- set page breadcrumbs -->
|
---|
[23813] | 28 | <xsl:template name="breadcrumbs">
|
---|
| 29 | <gslib:siteLink/><gslib:rightArrow/>
|
---|
| 30 | <gslib:collectionNameLinked/><gslib:rightArrow/>
|
---|
| 31 | <a>
|
---|
| 32 | <xsl:attribute name="href">
|
---|
[25371] | 33 | <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/document/<xsl:value-of select="/page/pageResponse/document/documentNode[1]/@nodeID"/>
|
---|
[23813] | 34 | </xsl:attribute>
|
---|
| 35 | <xsl:variable name="documentTitleVar">
|
---|
| 36 | <gslib:documentTitle/>
|
---|
| 37 | </xsl:variable>
|
---|
[24009] | 38 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.document')"/>
|
---|
[23813] | 39 | </a>
|
---|
| 40 | </xsl:template>
|
---|
[23989] | 41 |
|
---|
| 42 | <xsl:template match="/">
|
---|
| 43 | <xsl:choose>
|
---|
| 44 | <!-- if this is the realistic books version of the page -->
|
---|
| 45 | <xsl:when test="$bookswitch = 'flashxml'">
|
---|
| 46 | <html>
|
---|
| 47 | <body>
|
---|
| 48 | <xsl:apply-templates select="/page/pageResponse/document"/>
|
---|
| 49 | </body>
|
---|
| 50 | </html>
|
---|
| 51 | </xsl:when>
|
---|
| 52 | <!-- if this is the regular version of the page -->
|
---|
| 53 | <xsl:otherwise>
|
---|
[25917] | 54 | <xsl:call-template name="mainTemplate"/>
|
---|
[23989] | 55 | </xsl:otherwise>
|
---|
| 56 | </xsl:choose>
|
---|
| 57 | </xsl:template>
|
---|
[24650] | 58 |
|
---|
[26020] | 59 | <xsl:template name="documentHeading">
|
---|
| 60 | <b><gsf:metadata name="Title"/></b><br/>
|
---|
| 61 | </xsl:template>
|
---|
| 62 |
|
---|
| 63 | <xsl:template name="documentContent">
|
---|
| 64 | <xsl:choose>
|
---|
| 65 | <xsl:when test="@docType='simple'">
|
---|
| 66 | <div id="gs-document">
|
---|
| 67 | <xsl:call-template name="wrappedSectionImage"/>
|
---|
| 68 | <div id="gs-document-text">
|
---|
| 69 | <xsl:call-template name="documentNodeText"/>
|
---|
| 70 | </div>
|
---|
| 71 | </div>
|
---|
| 72 | </xsl:when>
|
---|
| 73 | <xsl:otherwise>
|
---|
| 74 | <xsl:call-template name="wrappedDocument"/>
|
---|
| 75 | </xsl:otherwise>
|
---|
| 76 | </xsl:choose>
|
---|
| 77 | </xsl:template>
|
---|
| 78 |
|
---|
[25936] | 79 | <xsl:template name="sectionHeader">
|
---|
| 80 | <xsl:call-template name="sectionTitle"/>
|
---|
| 81 | </xsl:template>
|
---|
| 82 |
|
---|
[26020] | 83 | <xsl:template name="topLevelSectionContent">
|
---|
| 84 | <xsl:call-template name="wrappedSectionImage"/>
|
---|
| 85 | <xsl:call-template name="wrappedSectionText"/>
|
---|
| 86 | </xsl:template>
|
---|
| 87 |
|
---|
| 88 | <xsl:template name="sectionContent">
|
---|
| 89 | <xsl:call-template name="wrappedSectionImage"/>
|
---|
| 90 | <xsl:call-template name="wrappedSectionText"/>
|
---|
| 91 | </xsl:template>
|
---|
| 92 |
|
---|
| 93 | <xsl:template name="wrappedSectionText">
|
---|
| 94 | <div id="text{@nodeID}" class="sectionText"><!-- *** -->
|
---|
| 95 | <xsl:attribute name="style">
|
---|
| 96 | <xsl:choose>
|
---|
| 97 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'">
|
---|
| 98 | <xsl:text>display:none;</xsl:text>
|
---|
| 99 | </xsl:when>
|
---|
| 100 | <xsl:otherwise>
|
---|
| 101 | <xsl:text>display:block;</xsl:text>
|
---|
| 102 | </xsl:otherwise>
|
---|
| 103 | </xsl:choose>
|
---|
| 104 | </xsl:attribute>
|
---|
| 105 |
|
---|
| 106 | <xsl:call-template name="documentNodeText"/>
|
---|
| 107 | </div>
|
---|
| 108 | </xsl:template>
|
---|
| 109 |
|
---|
| 110 | <xsl:template name="sectionImage">
|
---|
| 111 | <gsf:image type="screen"/>
|
---|
| 112 | </xsl:template>
|
---|
| 113 |
|
---|
[24650] | 114 | <!-- Used to make sure that regardless what the collection designer uses for the title and content we can wrap it properly -->
|
---|
| 115 | <!-- If editing, be aware that the Document Basket looks for specific classes that this template bakes in (key points marked with ***) -->
|
---|
| 116 | <xsl:template name="wrapDocumentNodes">
|
---|
[25433] | 117 | <a name="{@nodeID}"><xsl:text> </xsl:text></a>
|
---|
[25936] | 118 |
|
---|
[25433] | 119 | <!-- Section header -->
|
---|
| 120 | <table class="sectionHeader"><tr>
|
---|
[25936] | 121 |
|
---|
[25433] | 122 | <!-- Expand/collapse button -->
|
---|
| 123 | <xsl:if test="not(/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='sectionExpandCollapse']/@value) or /page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='sectionExpandCollapse']/@value = 'true'">
|
---|
| 124 | <td class="headerTD">
|
---|
| 125 | <img id="dtoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
|
---|
| 126 | <xsl:attribute name="src">
|
---|
[25143] | 127 | <xsl:choose>
|
---|
[25433] | 128 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent(@nodeID, /page/pageResponse/document/@selectedNode)">
|
---|
| 129 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
[25143] | 130 | </xsl:when>
|
---|
| 131 | <xsl:otherwise>
|
---|
[25433] | 132 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
[25143] | 133 | </xsl:otherwise>
|
---|
| 134 | </xsl:choose>
|
---|
| 135 | </xsl:attribute>
|
---|
[25433] | 136 | </img>
|
---|
| 137 | </td>
|
---|
| 138 | </xsl:if>
|
---|
[25936] | 139 |
|
---|
[25433] | 140 | <!-- Title -->
|
---|
| 141 | <td id="header{@nodeID}" class="headerTD sectionTitle"><!-- *** -->
|
---|
[25936] | 142 | <p>
|
---|
| 143 | <xsl:attribute name="class"><xsl:value-of select="util:hashToDepthClass(@nodeID)"/> sectionHeader</xsl:attribute>
|
---|
| 144 |
|
---|
| 145 | <xsl:if test="util:hashToSectionId(@nodeID)">
|
---|
| 146 | <span class="sectionNumberSpan">
|
---|
| 147 | <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
|
---|
| 148 | <xsl:text> </xsl:text>
|
---|
| 149 | </span>
|
---|
| 150 | </xsl:if>
|
---|
| 151 | <!-- Display the title for the section regardless of whether automatic section numbering is turned on -->
|
---|
| 152 | <span><xsl:call-template name="sectionHeader"/></span>
|
---|
| 153 | </p>
|
---|
[25433] | 154 | </td>
|
---|
| 155 |
|
---|
| 156 | <!-- "back to top" link -->
|
---|
| 157 | <xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle'">
|
---|
| 158 | <td class="backToTop headerTD">
|
---|
| 159 | <a href="javascript:scrollToTop();">
|
---|
| 160 | <xsl:text disable-output-escaping="yes">▲</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.back_to_top')"/>
|
---|
| 161 | </a>
|
---|
| 162 | </td>
|
---|
| 163 | </xsl:if>
|
---|
| 164 | </tr></table>
|
---|
[25936] | 165 |
|
---|
[25433] | 166 | <div id="doc{@nodeID}"><!-- *** -->
|
---|
| 167 | <xsl:choose>
|
---|
| 168 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID">
|
---|
| 169 | <xsl:attribute name="class">
|
---|
| 170 | <xsl:text>sectionContainer hasText</xsl:text>
|
---|
| 171 | </xsl:attribute>
|
---|
[25177] | 172 | <xsl:attribute name="style">
|
---|
[25433] | 173 | <xsl:text>display:block;</xsl:text>
|
---|
| 174 | </xsl:attribute>
|
---|
| 175 | </xsl:when>
|
---|
| 176 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent(@nodeID, /page/pageResponse/document/@selectedNode)">
|
---|
| 177 | <xsl:attribute name="class">
|
---|
| 178 | <xsl:text>sectionContainer noText</xsl:text>
|
---|
| 179 | </xsl:attribute>
|
---|
| 180 | <xsl:attribute name="style">
|
---|
| 181 | <xsl:text>display:block;</xsl:text>
|
---|
| 182 | </xsl:attribute>
|
---|
| 183 | </xsl:when>
|
---|
| 184 | <xsl:otherwise>
|
---|
| 185 | <xsl:attribute name="class">
|
---|
| 186 | <xsl:text>sectionContainer noText</xsl:text>
|
---|
| 187 | </xsl:attribute>
|
---|
| 188 | <xsl:attribute name="style">
|
---|
| 189 | <xsl:text>display:none;</xsl:text>
|
---|
| 190 | </xsl:attribute>
|
---|
| 191 | </xsl:otherwise>
|
---|
| 192 | </xsl:choose>
|
---|
| 193 |
|
---|
| 194 | <xsl:if test="/page/pageRequest/userInformation and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">
|
---|
| 195 | <table id="meta{@nodeID}">
|
---|
| 196 | <xsl:attribute name="style">
|
---|
[25177] | 197 | <xsl:choose>
|
---|
[25433] | 198 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'dmd']/@value = 'true'">
|
---|
| 199 | <xsl:text>display:block;</xsl:text>
|
---|
[25177] | 200 | </xsl:when>
|
---|
| 201 | <xsl:otherwise>
|
---|
[25433] | 202 | <xsl:text>display:none;</xsl:text>
|
---|
[25177] | 203 | </xsl:otherwise>
|
---|
| 204 | </xsl:choose>
|
---|
| 205 | </xsl:attribute>
|
---|
[25433] | 206 | <xsl:value-of select="util:clearMetadataStorage()"/>
|
---|
| 207 | <xsl:for-each select="metadataList/metadata">
|
---|
| 208 | <xsl:sort select="@name"/>
|
---|
| 209 | <xsl:if test="util:checkMetadataNotDuplicate(@name, .)">
|
---|
| 210 | <tr>
|
---|
| 211 | <td class="metaTableCellName"><xsl:value-of select="@name"/></td>
|
---|
[25543] | 212 | <td class="metaTableCell"><xsl:value-of disable-output-escaping="yes" select="."/></td>
|
---|
[25433] | 213 | </tr>
|
---|
| 214 | </xsl:if>
|
---|
| 215 | </xsl:for-each>
|
---|
| 216 | </table>
|
---|
| 217 | </xsl:if>
|
---|
| 218 |
|
---|
[26020] | 219 | <xsl:choose>
|
---|
| 220 | <xsl:when test="../../document">
|
---|
| 221 | <xsl:call-template name="topLevelSectionContent"/>
|
---|
| 222 | </xsl:when>
|
---|
| 223 | <xsl:otherwise>
|
---|
| 224 | <xsl:call-template name="sectionContent"/>
|
---|
| 225 | </xsl:otherwise>
|
---|
| 226 | </xsl:choose>
|
---|
[25433] | 227 |
|
---|
| 228 | <xsl:if test="documentNode">
|
---|
| 229 | <xsl:for-each select="documentNode">
|
---|
[24650] | 230 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
[25433] | 231 | </xsl:for-each>
|
---|
| 232 | </xsl:if>
|
---|
| 233 | </div>
|
---|
[24650] | 234 | </xsl:template>
|
---|
[19988] | 235 |
|
---|
| 236 | <!-- the page content -->
|
---|
[19856] | 237 | <xsl:template match="/page/pageResponse/document">
|
---|
[25177] | 238 | <xsl:if test="/page/pageRequest/userInformation and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">
|
---|
[25142] | 239 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts.js"><xsl:text> </xsl:text></script>
|
---|
| 240 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts_util.js"><xsl:text> </xsl:text></script>
|
---|
[25462] | 241 | <script type="text/javascript">
|
---|
| 242 | <xsl:text disable-output-escaping="yes">
|
---|
| 243 | $(window).load(function()
|
---|
| 244 | {
|
---|
| 245 | if(gs.cgiParams.docEdit == "1")
|
---|
| 246 | {
|
---|
| 247 | readyPageForEditing();
|
---|
| 248 | }
|
---|
| 249 | });
|
---|
| 250 | </xsl:text>
|
---|
| 251 | </script>
|
---|
[24791] | 252 | <gsf:metadata name="all"/>
|
---|
| 253 | </xsl:if>
|
---|
| 254 |
|
---|
[23989] | 255 | <xsl:if test="$bookswitch = 'off'">
|
---|
[24018] | 256 | <div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div>
|
---|
| 257 |
|
---|
[24467] | 258 | <script type="text/javascript" src="interfaces/{$interface_name}/js/document_scripts.js"><xsl:text> </xsl:text></script>
|
---|
| 259 |
|
---|
[24018] | 260 | <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
|
---|
[24467] | 261 | <script type="text/javascript">
|
---|
| 262 | <xsl:text disable-output-escaping="yes">
|
---|
| 263 | if(document.URL.indexOf("book=on") != -1)
|
---|
| 264 | {
|
---|
| 265 | loadBook();
|
---|
| 266 | }
|
---|
| 267 | </xsl:text>
|
---|
| 268 | </script>
|
---|
[24018] | 269 | </xsl:if>
|
---|
[26014] | 270 |
|
---|
[25177] | 271 | <xsl:if test="/page/pageRequest/userInformation and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor))">
|
---|
[25371] | 272 | <xsl:call-template name="editBar"/>
|
---|
[25072] | 273 | </xsl:if>
|
---|
| 274 |
|
---|
[24791] | 275 | <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='sideBar']) or /page/pageResponse/format[@type='display']/gsf:option[@name='sideBar']/@value='true'">
|
---|
[25371] | 276 | <xsl:call-template name="rightSidebar"/>
|
---|
[24650] | 277 | </xsl:if>
|
---|
[23989] | 278 | </xsl:if>
|
---|
| 279 |
|
---|
[19856] | 280 | <!-- display the document -->
|
---|
[23813] | 281 | <xsl:choose>
|
---|
[19856] | 282 | <xsl:when test="@external != ''">
|
---|
| 283 | <xsl:call-template name="externalPage">
|
---|
| 284 | <xsl:with-param name="external" select="@external"/>
|
---|
| 285 | </xsl:call-template>
|
---|
| 286 | </xsl:when>
|
---|
[23989] | 287 | <xsl:when test="$bookswitch = 'flashxml'">
|
---|
[25720] | 288 | <xsl:call-template name="documentNodeFlashXML"/>
|
---|
[23989] | 289 | </xsl:when>
|
---|
| 290 | <xsl:when test="$bookswitch = 'on'">
|
---|
[24018] | 291 | <div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div>
|
---|
[24791] | 292 | <!-- *** in document-scripts.js *** -->
|
---|
[24467] | 293 | <script type="text/javascript">
|
---|
| 294 | <xsl:text disable-output-escaping="yes">
|
---|
| 295 | if(document.URL.indexOf("book=on") != -1)
|
---|
| 296 | {
|
---|
| 297 | loadBook();
|
---|
| 298 | }
|
---|
| 299 | </xsl:text>
|
---|
| 300 | </script>
|
---|
[23989] | 301 | </xsl:when>
|
---|
[25837] | 302 | <xsl:when test="@docType='simple'">
|
---|
| 303 | <xsl:call-template name="documentHeading"/><br/>
|
---|
| 304 | <xsl:call-template name="documentContent"/>
|
---|
| 305 | </xsl:when>
|
---|
| 306 | <xsl:otherwise> <!-- display the standard greenstone document -->
|
---|
| 307 | <xsl:call-template name="documentContent"/>
|
---|
| 308 | </xsl:otherwise>
|
---|
| 309 | </xsl:choose>
|
---|
| 310 | </xsl:template>
|
---|
[25949] | 311 |
|
---|
[25824] | 312 | <xsl:template name="wrappedDocument">
|
---|
[25837] | 313 | <xsl:choose>
|
---|
[25936] | 314 | <!-- NOTE: alb = ajax load bypass -->
|
---|
| 315 | <xsl:when test="/page/pageResponse/document/@docType = 'hierarchy' and (/page/pageRequest/paramList/param[@name = 'alb']/@value = '1' or (string-length(/page/pageRequest/paramList/param[@name = 'd']/@value) > 0 and (/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or not(util:contains(/page/pageResponse/document/@selectedNode, '.')))))">
|
---|
[25837] | 316 | <div id="gs-document">
|
---|
| 317 | <xsl:call-template name="documentPre"/>
|
---|
| 318 | <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
|
---|
| 319 | <xsl:for-each select="documentNode">
|
---|
| 320 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
| 321 | </xsl:for-each>
|
---|
| 322 | </div>
|
---|
| 323 | </div>
|
---|
| 324 | </xsl:when>
|
---|
[25972] | 325 | <xsl:when test="/page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'">
|
---|
[25936] | 326 | <div id="gs-document">
|
---|
| 327 | <div id="tocLoadingImage" style="text-align:center;">
|
---|
| 328 | <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>
|
---|
| 329 | </div>
|
---|
| 330 | </div>
|
---|
| 331 | <script type="text/javascript">
|
---|
| 332 | <xsl:text disable-output-escaping="yes">
|
---|
| 333 | $(window).load(function()
|
---|
| 334 | {
|
---|
| 335 | var url = gs.xsltParams.library_name + "?a=d&c=" + gs.cgiParams.c + "&excerptid=gs-document&dt=hierarchy&d=" + gs.cgiParams.d.replace(/([^.]*)\..*/, "$1");
|
---|
| 336 | loadTopLevelPage(null, url);
|
---|
| 337 | });
|
---|
| 338 | </xsl:text>
|
---|
| 339 | </script>
|
---|
| 340 | </xsl:when>
|
---|
[25837] | 341 | <xsl:otherwise>
|
---|
| 342 | <div id="gs-document">
|
---|
| 343 | <div id="tocLoadingImage" style="text-align:center;">
|
---|
| 344 | <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>
|
---|
| 345 | </div>
|
---|
| 346 | </div>
|
---|
| 347 | <script type="text/javascript">
|
---|
| 348 | <xsl:text disable-output-escaping="yes">
|
---|
| 349 | $(window).load(function()
|
---|
| 350 | {
|
---|
| 351 | loadTopLevelPage(function()
|
---|
| 352 | {
|
---|
| 353 | //Don't focus the section until the table of contents is loaded
|
---|
| 354 | var tocCheck = function()
|
---|
[25371] | 355 | {
|
---|
[25837] | 356 | if(gs.variables.tocLoaded)
|
---|
[25371] | 357 | {
|
---|
[25837] | 358 | focusSection("</xsl:text><xsl:value-of select="/page/pageResponse/document/@selectedNode"/><xsl:text disable-output-escaping="yes">");
|
---|
| 359 | }
|
---|
| 360 | else
|
---|
| 361 | {
|
---|
| 362 | setTimeout(tocCheck, 500);
|
---|
| 363 | }
|
---|
| 364 | }
|
---|
| 365 | tocCheck();
|
---|
| 366 | });
|
---|
| 367 | });
|
---|
| 368 | </xsl:text>
|
---|
| 369 | </script>
|
---|
| 370 | </xsl:otherwise>
|
---|
[19856] | 371 | </xsl:choose>
|
---|
[24791] | 372 |
|
---|
[19856] | 373 | <div class="clear"><xsl:text> </xsl:text></div>
|
---|
[23989] | 374 | </xsl:template>
|
---|
| 375 |
|
---|
[25371] | 376 | <xsl:template name="editBar">
|
---|
| 377 | <table style="width:100%"><tr>
|
---|
| 378 | <td id="editBarLeft" style="width:70%"><xsl:text> </xsl:text></td>
|
---|
| 379 | <td id="editBarRight">
|
---|
| 380 | <div style="text-align:center;">
|
---|
| 381 | <div style="margin:5px;" class="ui-state-default ui-corner-all">
|
---|
| 382 | <a style="padding: 3px; text-decoration:none;" href="{$library_name}?a=g&sa=documentbasket&c=&s=DisplayDocumentList&rt=r&p.c={/page/pageResponse/collection/@name}&docToEdit={/page/pageResponse/document/documentNode/@nodeID}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.edit_structure')"/></a>
|
---|
| 383 | </div>
|
---|
| 384 | <div style="margin:5px;" class="ui-state-default ui-corner-all">
|
---|
[25462] | 385 | <a id="editContentButton" style="padding: 3px; text-decoration:none;">
|
---|
| 386 | <xsl:attribute name="href">
|
---|
| 387 | <xsl:value-of select="$library_name"/>
|
---|
| 388 | <xsl:text>/collection/</xsl:text>
|
---|
| 389 | <xsl:value-of select="$collName"/>
|
---|
| 390 | <xsl:text>/document/</xsl:text>
|
---|
| 391 | <xsl:value-of select="/page/pageResponse/document/documentNode/@nodeID"/>
|
---|
| 392 | <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1')">
|
---|
| 393 | <xsl:text>?ed=1&docEdit=1</xsl:text>
|
---|
| 394 | </xsl:if>
|
---|
| 395 | </xsl:attribute>
|
---|
| 396 | <xsl:choose>
|
---|
| 397 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1'">
|
---|
| 398 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.hide_editor')"/>
|
---|
| 399 | </xsl:when>
|
---|
| 400 | <xsl:otherwise>
|
---|
| 401 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.edit_content')"/>
|
---|
| 402 | </xsl:otherwise>
|
---|
| 403 | </xsl:choose>
|
---|
| 404 | </a>
|
---|
[25371] | 405 | </div>
|
---|
| 406 | </div>
|
---|
| 407 | </td>
|
---|
| 408 | </tr></table>
|
---|
[25720] | 409 | <gslib:langfrag name="dse"/>
|
---|
[25371] | 410 | </xsl:template>
|
---|
| 411 |
|
---|
[23989] | 412 | <!-- Highlight annotations if requested -->
|
---|
[25720] | 413 | <xsl:template name="displayAnnotation">
|
---|
[23989] | 414 | <xsl:choose>
|
---|
[25720] | 415 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'on'">
|
---|
[23989] | 416 | <span class="termHighlight"><xsl:value-of select="."/></span>
|
---|
| 417 | </xsl:when>
|
---|
| 418 | <xsl:otherwise>
|
---|
| 419 | <span class="noTermHighlight"><xsl:value-of select="."/></span>
|
---|
| 420 | </xsl:otherwise>
|
---|
| 421 | </xsl:choose>
|
---|
| 422 | </xsl:template>
|
---|
[25660] | 423 |
|
---|
[24650] | 424 | <!-- The default template for displaying section titles -->
|
---|
[25720] | 425 | <xsl:template name="sectionTitle">
|
---|
[24650] | 426 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
|
---|
| 427 | </xsl:template>
|
---|
| 428 |
|
---|
[26020] | 429 | <xsl:template name="wrappedSectionImage">
|
---|
[25433] | 430 | <gsf:variable name="screenImageWidth"><gsf:metadata name="ScreenWidth"/></gsf:variable>
|
---|
| 431 | <gsf:variable name="screenImageHeight"><gsf:metadata name="ScreenHeight"/></gsf:variable>
|
---|
| 432 | <gsf:variable name="imageWidth"><gsf:metadata name="ImageWidth"/></gsf:variable>
|
---|
| 433 | <gsf:variable name="imageHeight"><gsf:metadata name="ImageHeight"/></gsf:variable>
|
---|
| 434 |
|
---|
| 435 | <xsl:choose>
|
---|
[26024] | 436 | <xsl:when test="metadataList/metadata[@name = 'Screen'] and metadataList/metadata[@name = 'SourceFile'] and ($imageWidth div $screenImageWidth > 1.2)">
|
---|
[25936] | 437 | <div id="image{@nodeID}">
|
---|
| 438 | <div id="wrap{util:replace(@nodeID, '.', '_')}" class="zoomImage" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
| 439 | <div id="small{util:replace(@nodeID, '.', '_')}" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
| 440 | <gsf:image type="screen"/>
|
---|
[25433] | 441 | </div>
|
---|
[25936] | 442 | <div id="mover{util:replace(@nodeID, '.', '_')}" style="border: 1px solid green; position: absolute; top: 0; left: 0; width: 198px; height: 198px; overflow: hidden; z-index: 100; background: white; display: none;">
|
---|
| 443 | <div id="overlay{util:replace(@nodeID, '.', '_')}" style="width: 200px; height: 200px; position: absolute; top: 0; left: 0; z-index: 200;">
|
---|
| 444 | <xsl:text> </xsl:text>
|
---|
| 445 | </div>
|
---|
| 446 | <div id="large{util:replace(@nodeID, '.', '_')}" style="position: relative; width: {$imageWidth}px; height: {$imageHeight}px;">
|
---|
| 447 | <gsf:image type="source"/>
|
---|
| 448 | </div>
|
---|
[25433] | 449 | </div>
|
---|
| 450 | </div>
|
---|
[25936] | 451 | <script type="text/javascript">
|
---|
| 452 | <xsl:text disable-output-escaping="yes">
|
---|
| 453 | {
|
---|
| 454 | var nodeID = "</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">";
|
---|
| 455 | nodeID = nodeID.replace(/\./g, "_");
|
---|
[25462] | 456 |
|
---|
[25936] | 457 | var bigHeight = </xsl:text><xsl:value-of select="$imageHeight"/><xsl:text disable-output-escaping="yes">;
|
---|
| 458 | var smallHeight = </xsl:text><xsl:value-of select="$screenImageHeight"/><xsl:text disable-output-escaping="yes">;
|
---|
[25462] | 459 |
|
---|
[25936] | 460 | var multiplier = bigHeight / smallHeight;
|
---|
[25433] | 461 |
|
---|
[25936] | 462 | $("#wrap" + nodeID).anythingZoomer({
|
---|
| 463 | smallArea: "#small" + nodeID,
|
---|
| 464 | largeArea: "#large" + nodeID,
|
---|
| 465 | zoomPort: "#overlay" + nodeID,
|
---|
| 466 | mover: "#mover" + nodeID,
|
---|
| 467 | expansionSize:50,
|
---|
| 468 | speedMultiplier:multiplier
|
---|
| 469 | });
|
---|
[26024] | 470 |
|
---|
| 471 | $("#zoomOptions").css("display", "block");
|
---|
[25936] | 472 | }
|
---|
| 473 | </xsl:text>
|
---|
| 474 | </script>
|
---|
| 475 | </div>
|
---|
[25433] | 476 | </xsl:when>
|
---|
[26020] | 477 | <xsl:otherwise>
|
---|
[25433] | 478 | <div id="image{@nodeID}">
|
---|
| 479 | <xsl:attribute name="style">
|
---|
| 480 | <xsl:choose>
|
---|
| 481 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'">
|
---|
| 482 | <xsl:text>display:none;</xsl:text>
|
---|
| 483 | </xsl:when>
|
---|
| 484 | <xsl:otherwise>
|
---|
| 485 | <xsl:text>display:block;</xsl:text>
|
---|
| 486 | </xsl:otherwise>
|
---|
| 487 | </xsl:choose>
|
---|
| 488 | </xsl:attribute>
|
---|
[26020] | 489 | <xsl:call-template name="sectionImage"/><xsl:text> </xsl:text>
|
---|
[25433] | 490 | </div>
|
---|
[26020] | 491 | </xsl:otherwise>
|
---|
[25433] | 492 | </xsl:choose>
|
---|
| 493 | </xsl:template>
|
---|
[25837] | 494 |
|
---|
[25824] | 495 | <!-- The default template for displaying the document node text -->
|
---|
[25837] | 496 | <!-- equivalent to gsf:text -->
|
---|
[25824] | 497 | <xsl:template name="documentNodeText">
|
---|
[25433] | 498 | <!-- Hides the "This document has no text." message -->
|
---|
| 499 | <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
|
---|
[25837] | 500 | <xsl:if test="not($noText = '1')">
|
---|
| 501 | <!-- Section text -->
|
---|
| 502 | <xsl:for-each select="nodeContent">
|
---|
| 503 | <xsl:for-each select="node()">
|
---|
| 504 | <xsl:choose>
|
---|
| 505 | <xsl:when test="not(name())">
|
---|
[25433] | 506 | <xsl:value-of select="." disable-output-escaping="yes"/>
|
---|
[25837] | 507 | </xsl:when>
|
---|
| 508 | <xsl:when test="name() = 'annotation'">
|
---|
| 509 | <xsl:call-template name="displayAnnotation"/>
|
---|
| 510 | </xsl:when>
|
---|
| 511 | <xsl:otherwise>
|
---|
| 512 | <xsl:apply-templates/>
|
---|
| 513 | </xsl:otherwise>
|
---|
| 514 | </xsl:choose>
|
---|
| 515 | </xsl:for-each>
|
---|
[23989] | 516 | </xsl:for-each>
|
---|
[25837] | 517 | </xsl:if><xsl:text> </xsl:text>
|
---|
[19856] | 518 | </xsl:template>
|
---|
[25824] | 519 |
|
---|
[23989] | 520 | <!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
|
---|
[25720] | 521 | <xsl:template name="documentNodeFlashXML">
|
---|
[23989] | 522 | <xsl:text disable-output-escaping="yes">
|
---|
| 523 | <Section>
|
---|
| 524 | <Description>
|
---|
| 525 | <Metadata name="Title">
|
---|
| 526 | </xsl:text>
|
---|
| 527 | <xsl:value-of select="normalize-space(metadataList/metadata[@name = 'Title'])"/>
|
---|
| 528 | <xsl:text disable-output-escaping="yes">
|
---|
| 529 | </Metadata>
|
---|
| 530 | </Description>
|
---|
| 531 | </xsl:text>
|
---|
| 532 |
|
---|
| 533 | <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/>
|
---|
| 534 |
|
---|
[25660] | 535 | <xsl:for-each select="documentNode">
|
---|
[25720] | 536 | <xsl:call-template name="documentNodeFlashXML"/>
|
---|
[25660] | 537 | </xsl:for-each>
|
---|
[23989] | 538 |
|
---|
| 539 | <xsl:text disable-output-escaping="yes">
|
---|
| 540 | </Section>
|
---|
| 541 | </xsl:text>
|
---|
| 542 | </xsl:template>
|
---|
| 543 |
|
---|
[23813] | 544 | <xsl:template name="externalPage">
|
---|
| 545 | <xsl:param name="external"/>
|
---|
| 546 | <xsl:variable name="go_forward_link">
|
---|
| 547 | <a>
|
---|
| 548 | <xsl:attribute name="href">
|
---|
| 549 | <xsl:value-of select="$external"/>
|
---|
| 550 | </xsl:attribute>
|
---|
| 551 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/>
|
---|
| 552 | </a>
|
---|
| 553 | </xsl:variable>
|
---|
| 554 | <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
|
---|
| 555 | <p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/></p>
|
---|
| 556 | </xsl:template>
|
---|
[19856] | 557 |
|
---|
| 558 | <xsl:template match="/page"><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
|
---|
[23989] | 559 |
|
---|
[25371] | 560 | <xsl:template name="documentPre">
|
---|
[24996] | 561 | <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
|
---|
| 562 | <xsl:call-template name="mapFeatures"/>
|
---|
| 563 | </xsl:if>
|
---|
| 564 | </xsl:template>
|
---|
| 565 |
|
---|
| 566 | <xsl:template name="mapFeatures">
|
---|
[25462] | 567 | <div id="map_canvas" class="map_canvas_full"><xsl:text> </xsl:text></div>
|
---|
[24996] | 568 |
|
---|
[25711] | 569 | <xsl:for-each select="documentNode">
|
---|
| 570 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
| 571 | <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
|
---|
| 572 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.maps.nearby_docs')"/>
|
---|
[25837] | 573 | <img id="nearbyDocumentsToggle" style="margin-left:5px;" src="interfaces/{$interface_name}/images/expand.png">
|
---|
[25711] | 574 | <xsl:attribute name="onclick">
|
---|
| 575 | <xsl:text>performDistanceSearch('</xsl:text>
|
---|
| 576 | <xsl:value-of select="@nodeID"/>
|
---|
| 577 | <xsl:text>', '</xsl:text>
|
---|
| 578 | <gsf:metadata name="Latitude"/>
|
---|
| 579 | <xsl:text>', '</xsl:text>
|
---|
| 580 | <gsf:metadata name="Longitude"/>
|
---|
| 581 | <xsl:text>', 2);</xsl:text>
|
---|
| 582 | </xsl:attribute>
|
---|
| 583 | </img>
|
---|
| 584 | <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
|
---|
| 585 | </div>
|
---|
| 586 | </xsl:if>
|
---|
| 587 | </xsl:for-each>
|
---|
[24996] | 588 |
|
---|
| 589 | <div id="jsonNodes" style="display:none;">
|
---|
| 590 | <xsl:text>[</xsl:text>
|
---|
| 591 | <xsl:for-each select="//documentNode">
|
---|
| 592 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
| 593 | <xsl:text>{</xsl:text>
|
---|
| 594 | <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
| 595 | <xsl:text disable-output-escaping="yes">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
| 596 | <xsl:text disable-output-escaping="yes">"lat":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Latitude']"/><xsl:text>,</xsl:text>
|
---|
| 597 | <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
|
---|
| 598 | <xsl:text>}</xsl:text>
|
---|
| 599 | <xsl:if test="not(position() = count(//documentNode))">
|
---|
| 600 | <xsl:text>,</xsl:text>
|
---|
| 601 | </xsl:if>
|
---|
| 602 | </xsl:if>
|
---|
| 603 | </xsl:for-each>
|
---|
| 604 | <xsl:text>]</xsl:text>
|
---|
| 605 | </div>
|
---|
| 606 | </xsl:template>
|
---|
[19856] | 607 | </xsl:stylesheet>
|
---|