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