source: main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl@ 37084

Last change on this file since 37084 was 37084, checked in by davidb, 17 months ago

Templates and vars move into their '-core.xsl' counterparts

File size: 43.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
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 <!-- use the 'main' layout -->
12 <xsl:import href="layouts/main.xsl"/>
13 <xsl:import href="layouts/toc.xsl"/>
14
15 <!-- templates for adding user comments -->
16 <xsl:import href="layouts/usercomments.xsl"/>
17
18 <!-- We technically need this include. However, it is already imported with toc.xsl -->
19 <!-- <xsl:include href="document-shared.xsl" /> -->
20
21 <xsl:include href="pages/document-core.xsl" />
22
23
24 <!--
25 The 'bookswitch' variable was invented for the Flash-based Realistic Books project:
26
27 * If set to 'on' then this triggers in JavaScript loadBook(), which creates a version
28 of the document URL that sets 'bookswitch; to flashxml (&book=flashxml)
29 The Flash plugin uses this version of the URL to load in the doc for the Flash plugin
30
31 * If not set, then defaults to 'off'
32
33 * Subsequent to its invention for Realistic Books, the book/bookswitch variable has
34 been extended to other alternative (richly interative) views of the document, such
35 as with the Mirador document viewer, for IIIF compliant books
36 -->
37
38 <xsl:variable name="bookswitch">
39 <xsl:choose>
40 <xsl:when test="/page/pageRequest/paramList/param[@name='book']/@value">
41 <xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/>
42 </xsl:when>
43 <xsl:otherwise>off</xsl:otherwise>
44 </xsl:choose>
45 </xsl:variable>
46
47 <xsl:variable name="canDoEditing">
48 <xsl:if test="$isEditingAllowed = '1' and (/page/pageRequest/userInformation and /page/pageRequest/userInformation/@editEnabled = 'true' 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)))">true</xsl:if>
49 </xsl:variable>
50 <xsl:variable name="editingTurnedOn">
51 <xsl:if test="/page/pageRequest/paramList/param[@name='docEdit']/@value = '1'">true</xsl:if>
52 </xsl:variable>
53
54 <!-- optional cgi-params for links to document pages -->
55 <xsl:variable name="opt-doc-link-args"></xsl:variable>
56 <!-- set page title -->
57 <xsl:template name="pageTitle"><gslib:documentTitle/></xsl:template>
58
59 <!-- set page breadcrumbs -->
60 <xsl:template name="breadcrumbs">
61 <gslib:siteLink/><gslib:rightArrow/>
62 <gslib:groupLinks/>
63 <gslib:collectionNameLinked/><gslib:rightArrow/>
64 <a>
65 <xsl:attribute name="href">
66 <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/document/<xsl:value-of select="/page/pageResponse/document/documentNode[1]/@nodeID"/>
67 </xsl:attribute>
68 <xsl:variable name="documentTitleVar">
69 <gslib:documentTitle/>
70 </xsl:variable>
71 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.document')"/>
72 </a>
73 </xsl:template>
74
75 <xsl:template match="/">
76 <xsl:choose>
77 <!-- if this is the realistic books version of the page -->
78 <xsl:when test="$bookswitch = 'flashxml'">
79 <html>
80 <body>
81 <xsl:apply-templates select="/page/pageResponse/document"/>
82 </body>
83 </html>
84 </xsl:when>
85 <!-- if this is the regular version of the page -->
86 <xsl:otherwise>
87 <xsl:call-template name="mainTemplate"/>
88 </xsl:otherwise>
89 </xsl:choose>
90 </xsl:template>
91
92 <!-- **** Rules for document-core.xsl taken from here -->
93 <xsl:template name="sectionContentForEditing">
94 <xsl:call-template name="wrappedSectionImage"/>
95 <xsl:call-template name="wrappedSectionTextForEditing"/>
96 </xsl:template>
97
98 <xsl:template name="wrappedSectionTextForEditing">
99 <!-- <br /><br /> --> <!-- **** better to do with CSS .sectionText -->
100 <div id="text{@nodeID}" class="sectionText" style="display:block;"><!-- *** -->
101 <xsl:attribute name="contenteditable">
102 <xsl:text>true</xsl:text>
103 </xsl:attribute>
104 <xsl:call-template name="documentNodeTextForEditing"/>
105 </div>
106 </xsl:template>
107
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">
111 <xsl:variable name="nodeID" select="@nodeID"/>
112 <a name="{@nodeID}"><xsl:text> </xsl:text></a>
113
114 <!-- Section header -->
115 <table class="sectionHeader"><tr>
116
117 <!-- Expand/collapse button -->
118 <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'">
119 <td class="headerTD">
120 <img id="dtoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
121 <xsl:attribute name="src">
122 <xsl:choose>
123 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent($nodeID, /page/pageResponse/document/@selectedNode)">
124 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
125 </xsl:when>
126 <xsl:otherwise>
127 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
128 </xsl:otherwise>
129 </xsl:choose>
130 </xsl:attribute>
131 </img>
132 </td>
133 </xsl:if>
134
135 <!-- Title -->
136 <td id="header{@nodeID}" class="headerTD sectionTitle"><!-- *** -->
137 <p>
138 <xsl:attribute name="class"><xsl:value-of select="util:hashToDepthClass(@nodeID)"/> sectionHeader</xsl:attribute>
139
140 <xsl:if test="util:hashToSectionId(@nodeID)">
141 <span class="sectionNumberSpan">
142 <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
143 <xsl:text> </xsl:text>
144 </span>
145 </xsl:if>
146 <!-- Display the title for the section regardless of whether automatic section numbering is turned on -->
147 <span><xsl:call-template name="sectionHeading"/></span>
148 </p>
149 </td>
150
151 <!-- "back to top" link -->
152 <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'">
153 <td class="backToTop headerTD">
154 <a href="javascript:scrollToTop();">
155 <xsl:text disable-output-escaping="yes">&#9650;</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.back_to_top')"/>
156 </a>
157 </td>
158 </xsl:if>
159 </tr></table>
160
161 <div id="doc{@nodeID}"><!-- *** -->
162 <xsl:choose>
163 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID">
164 <xsl:attribute name="class">
165 <xsl:text>sectionContainer hasText</xsl:text>
166 </xsl:attribute>
167 <xsl:attribute name="style">
168 <xsl:text>display:block;</xsl:text>
169 </xsl:attribute>
170 </xsl:when>
171 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent(@nodeID, /page/pageResponse/document/@selectedNode)">
172 <xsl:attribute name="class">
173 <xsl:text>sectionContainer noText</xsl:text>
174 </xsl:attribute>
175 <xsl:attribute name="style">
176 <xsl:text>display:block;</xsl:text>
177 </xsl:attribute>
178 </xsl:when>
179 <xsl:otherwise>
180 <xsl:attribute name="class">
181 <xsl:text>sectionContainer noText</xsl:text>
182 </xsl:attribute>
183 <xsl:attribute name="style">
184 <xsl:text>display:none;</xsl:text>
185 </xsl:attribute>
186 </xsl:otherwise>
187 </xsl:choose>
188
189 <xsl:choose>
190 <xsl:when test="$canDoEditing = 'true' and $editingTurnedOn = 'true'">
191 <table id="meta{@nodeID}">
192 <xsl:attribute name="style">
193 <xsl:choose>
194 <xsl:when test="/page/pageRequest/paramList/param[@name = 'dmd']/@value = 'true'">
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>
202 <xsl:value-of select="util:clearMetadataStorage()"/>
203 <xsl:for-each select="metadataList/metadata">
204 <xsl:sort select="@name"/>
205 <tr>
206 <td class="metaTableCellName"><xsl:value-of select="@name"/></td>
207 <td class="metaTableCell"> <textarea autocomplete="off"><xsl:attribute name="class">metaTableCellArea <xsl:value-of select="translate(@name, '.-', '')"/></xsl:attribute><xsl:value-of select="."/></textarea></td>
208 </tr>
209 </xsl:for-each>
210 </table>
211 <xsl:if test="$isMapGPSEditingAllowed = '1'">
212 <div id="map-and-controls-{@nodeID}" tabindex="-1">
213 <div id="map-{@nodeID}" style="height: 300px;"><xsl:text> </xsl:text></div>
214
215
216 <div id="ControlPanel-{@nodeID}" class="ControlPanel" >
217 <div id="ControlButtons">
218
219 <button onclick="gsmap_store['map-{@nodeID}'].deleteAllShapes()" >Clear All</button>
220 <button onclick="gsmap_store['map-{@nodeID}'].deleteSelectedShapes()" >Delete Selected</button>
221 <button onclick="gsmap_store['map-{@nodeID}'].mapEditorHistory.undo()" >Undo</button>
222 <button onclick="gsmap_store['map-{@nodeID}'].mapEditorHistory.redo()" >Redo</button>
223 <input type="checkbox" name="draggableCB" id="draggableCB-{@nodeID}" value="false" /> Lock all shapes location <br/>
224 </div>
225
226 <div id="SecondRow">
227 <div id="LineThickness">
228 <p class="valueEditor">Line thickness:
229 <div class="valueChanger">
230 <input type="number" class="valueInput" id="thicknessRangeVal-{@nodeID}" min="1.00" max="5.00" value="1.00" step="0.01" />
231 <span class="unit" style="display:none">%</span>
232 <!-- % sign added above, to keep the thickness field width equal to that of the opacity field -->
233 <!-- setting the step attribute to 0.01 means we allow 2 decimal places
234 (then Firefox won't make the box red/invalid for values with 2 dec places)
235 -->
236 </div>
237 <input type="range" size="2" min="20" max="100" value="1" class="slider" id="thicknessRange-{@nodeID}" />
238 </p>
239 </div>
240
241 <div id="ColourOpacity">
242 <p class="valueEditor">Colour opacity:
243 <div class="valueChanger">
244 <input type="number" class="valueInput" id="opacityRangeVal-{@nodeID}" min="0.0" max="100.0" value="40" />
245 <span class="unit">%</span>
246 </div>
247 <input type="range" min="0" max="100" value="40" class="slider" id="colourOpacity-{@nodeID}" />
248 </p>
249 </div>
250 </div>
251 <div id = "ThirdRow">
252 <div id="FillColour">
253 <p> Fill Colour:</p> <div id="color-palette1-{@nodeID}"><xsl:text> </xsl:text></div>
254 </div>
255 </div>
256 <div id = "FourthRow">
257 <p>Label Text:
258 <input type="text" class="description" id="description-{@nodeID}" value="" />
259 </p>
260 </div>
261
262 </div>
263 <!--
264 <div id="style-selector-control-{@nodeID}" class="map-control">
265 <select id="style-selector-{@nodeID}" class="selector-control">
266 <option value="default" selected="selected">Default</option>
267 <option value="silver">Silver</option>
268 <option value="night">Night mode</option>
269 <option value="retro">Retro</option>
270 <option value="paleDawn">Pale Dawn</option>
271 <option value="avocadoWorld">Avocado World</option>
272 <option value="bright">Bright</option>
273 <option value="turquoise">Turquoise</option>
274 <option value="hiding">Hide features</option>
275 </select>
276 </div>
277 -->
278 </div>
279 </xsl:if>
280 <xsl:call-template name="sectionContentForEditing"/>
281 </xsl:when>
282 <xsl:otherwise>
283 <xsl:choose>
284 <xsl:when test="../../document">
285 <xsl:call-template name="topLevelSectionContent"/>
286 </xsl:when>
287 <xsl:otherwise>
288 <xsl:call-template name="sectionContent"/>
289 </xsl:otherwise>
290 </xsl:choose>
291 </xsl:otherwise>
292 </xsl:choose>
293 <xsl:if test="documentNode">
294 <xsl:for-each select="documentNode">
295 <xsl:call-template name="wrapDocumentNodes"/>
296 </xsl:for-each>
297 </xsl:if>
298 </div>
299 </xsl:template>
300
301 <xsl:template name="javascriptForDocumentView">
302 <script type="text/javascript" src="interfaces/{$interface_name}/js/utility_scripts.js"><xsl:text> </xsl:text></script>
303 <script type="text/javascript" src="interfaces/{$interface_name}/js/document_scripts.js"><xsl:text> </xsl:text></script>
304 <gsf:metadata name="Thumb" hidden="true"/>
305 <script type="text/javascript">
306 <xsl:text disable-output-escaping="yes">
307 function goToAnchor(sectionID,anchor)
308 {
309 var docIdentifier = '</xsl:text><xsl:value-of select="//documentNode[@nodeType = 'root']/@nodeID"/><xsl:text disable-output-escaping="yes">';
310 focusAnchor(docIdentifier + "."+ sectionID,0,1,anchor);
311 }
312 </xsl:text>
313 </script>
314 <xsl:call-template name="customJavascriptForDocumentView"/>
315 </xsl:template>
316
317 <!-- Use this to add in extra javascript/files for an interface, site, collection -->
318 <xsl:template name="customJavascriptForDocumentView">
319 </xsl:template>
320
321 <xsl:template name="javascriptForDocumentEditing">
322 <!-- <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts.js"><xsl:text> </xsl:text></script>-->
323 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentedit_scripts.js"><xsl:text> </xsl:text></script>
324 <script type="text/javascript" src="interfaces/{$interface_name}/js/documentedit_scripts_util.js"><xsl:text> </xsl:text></script>
325
326 <xsl:if test="/page/pageResponse/format/gsf:option[@name='allowMapGPSEditing']/@value = 'true'">
327 <script type="text/javascript" src="interfaces/{$interface_name}/js/map-scripts-editor-history.js"><xsl:text> </xsl:text></script>
328 <script type="text/javascript" src="interfaces/{$interface_name}/js/map-scripts-editor-themes.js"><xsl:text> </xsl:text></script>
329 <!-- LEAVE THIS NEXT LINE IN, IF USING CUSTOM OVERLAYS TO SHOW LABELS ON THE MAP -->
330 <!--<script type="text/javascript" src="interfaces/{$interface_name}/js/label-overlay-class.js"><xsl:text> </xsl:text></script>-->
331 <script type="text/javascript" src="interfaces/{$interface_name}/js/map-scripts-editor.js"><xsl:text> </xsl:text></script>
332 <link rel="stylesheet" href="interfaces/{$interface_name}/style/map-editors.css" type="text/css"/>
333 </xsl:if>
334
335 <script type="text/javascript" src="interfaces/{$interface_name}/js/hierarchy.js"><xsl:text> </xsl:text></script>
336
337
338 <script type="text/javascript">
339 <xsl:text disable-output-escaping="yes">
340
341 $(window).on("load", function()
342 {
343 if(gs.cgiParams.docEdit == "1")
344 {
345 readyPageForEditing(</xsl:text><xsl:value-of select="$isMapGPSEditingAllowed"/><xsl:text disable-output-escaping="yes">);
346 }
347 });
348 </xsl:text>
349 <!-- download and process hierarchy files -->
350 <xsl:text disable-output-escaping="yes">$(document).ready(function(){</xsl:text>
351 <xsl:for-each select="//classifier[@hfile]">
352 <xsl:if test="@hfile != ''">
353 <xsl:text disable-output-escaping="yes">downloadAndProcessHierarchyFile('</xsl:text>
354 <xsl:text>sites/localsite/collect/</xsl:text><xsl:value-of select="$collName"/><xsl:text>/etc/</xsl:text><xsl:value-of select="@hfile"/>
355 <xsl:text disable-output-escaping="yes">','</xsl:text><xsl:value-of select="@metadata"/><xsl:text disable-output-escaping="yes">');</xsl:text>
356 </xsl:if>
357 </xsl:for-each>
358 <xsl:text disable-output-escaping="yes">});</xsl:text>
359
360 </script>
361 <xsl:call-template name="customJavascriptForDocumentEditing"/>
362 </xsl:template>
363
364 <!-- Use this to add in extra javascript/files for an interface, site, collection -->
365 <xsl:template name="customJavascriptForDocumentEditing">
366 </xsl:template>
367
368 <!-- the page content -->
369 <xsl:template match="/page/pageResponse/document">
370 <xsl:if test="$bookswitch = 'off' or ($bookswitch != 'on' and $bookswitch != 'flashxml')"> <!-- true when bookswitch=mirador, for example -->
371 <xsl:call-template name="javascriptForDocumentView"/>
372 <gslib:langfrag name="doc"/>
373 <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
374 <script type="text/javascript">
375 <xsl:text disable-output-escaping="yes">
376 if(document.URL.indexOf("book=on") != -1)
377 {
378 loadBook();
379 }
380 </xsl:text>
381 </script>
382 </xsl:if>
383 </xsl:if>
384 <xsl:if test="$canDoEditing = 'true'">
385 <xsl:call-template name="javascriptForDocumentEditing"/>
386 <gslib:langfrag name="dse"/>
387 <gslib:langfrag name="de"/>
388 </xsl:if>
389
390 <xsl:if test="$bookswitch = 'off' or ($bookswitch != 'on' and $bookswitch != 'flashxml')">
391 <div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div>
392
393 <div id="float-anchor" style="width: 30%; min-width:180px; float:right; margin: 0 0 10px 20px;">
394 <xsl:if test="$canDoEditing = 'true'">
395 <xsl:call-template name="editBar"/>
396 </xsl:if>
397 <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'">
398 <xsl:call-template name="rightSidebarTOC"/>
399 </xsl:if>
400 <!-- add in some text just in case nothing has been added to this div-->
401 <xsl:text> </xsl:text>
402 </div>
403 <xsl:if test="$canDoEditing = 'true'">
404 <script type="text/javascript">
405 if (keep_editing_controls_visible) {
406 $(function() {
407 moveScroller();
408 });
409 }
410 </script>
411 </xsl:if>
412 </xsl:if>
413
414 <!-- display the document -->
415 <xsl:choose>
416 <xsl:when test="@external != ''">
417 <xsl:call-template name="externalPage">
418 <xsl:with-param name="external" select="@external"/>
419 </xsl:call-template>
420 </xsl:when>
421 <xsl:when test="$bookswitch = 'flashxml'">
422 <xsl:call-template name="documentNodeFlashXML"/>
423 </xsl:when>
424 <xsl:when test="$bookswitch = 'on'">
425 <div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div>
426 <script type="text/javascript">
427 <xsl:text disable-output-escaping="yes">
428 if(document.URL.indexOf("book=on") != -1)
429 {
430 <!-- in document_scripts.js -->
431 loadBook();
432 }
433 </xsl:text>
434 </script>
435 </xsl:when>
436 <!-- we want to do this stuff even if docType is simple or paged. Don't want to just set dt=hierarchy as that gives other unnecessary stuff-->
437 <!-- This is the first choice from wrappedDocument template-->
438 <xsl:when test="$canDoEditing = 'true' and $editingTurnedOn = 'true' ">
439 <div id="gs-document" style="width: 67%">
440 <xsl:call-template name="documentPre"/>
441 <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
442 <xsl:choose>
443 <xsl:when test="@docType='simple'">
444 <xsl:call-template name="wrapDocumentNodes"/>
445 </xsl:when>
446 <xsl:otherwise>
447 <xsl:for-each select="documentNode">
448 <xsl:call-template name="wrapDocumentNodes"/>
449 </xsl:for-each>
450 </xsl:otherwise>
451 </xsl:choose>
452 </div>
453 <xsl:call-template name="documentPost"/>
454 </div>
455 </xsl:when>
456 <xsl:when test="@docType='simple'">
457 <xsl:call-template name="documentHeading"/><br/>
458 <xsl:call-template name="documentContentTopLevel"/>
459 <br /><xsl:call-template name="userCommentsSection"/>
460 </xsl:when>
461 <xsl:otherwise> <!-- display the standard greenstone document -->
462 <xsl:call-template name="wrappedDocumentTopLevel"/>
463 <br /><xsl:call-template name="userCommentsSection"/>
464 </xsl:otherwise>
465 </xsl:choose>
466 </xsl:template>
467
468 <xsl:template name="wrappedDocument">
469 <xsl:choose>
470 <!-- NOTE: alb = ajax load bypass -->
471 <!--
472 If we have asked for expanded document, then do this.
473 OR If the docType is hierarchy and we want to bypass the ajax load then do this
474 OR If the docType is hierarchy and we have asked for the top level document then do this
475 -->
476 <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or (/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 not(util:contains(/page/pageResponse/document/@selectedNode, '.')))))">
477 <div id="gs-document">
478 <xsl:call-template name="documentPre"/>
479 <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
480 <xsl:for-each select="documentNode">
481 <xsl:call-template name="wrapDocumentNodes"/>
482 </xsl:for-each>
483 </div>
484 <xsl:call-template name="documentPost"/>
485 </div>
486 </xsl:when>
487 <xsl:when test="/page/pageResponse/document/@docType = 'paged' or /page/pageResponse/document/@docType = 'pagedhierarchy'">
488 <div id="gs-document">
489 <div id="tocLoadingImage" style="text-align:center;">
490 <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>
491 </div>
492 </div>
493 <script type="text/javascript">
494 <xsl:text disable-output-escaping="yes">
495 $(window).on("load", function()
496 {
497 var sectionID = gs.cgiParams.d;
498 var callbackFunction = null;
499 if(sectionID.indexOf(".") != -1)
500 {
501 callbackFunction = function()
502 {
503 focusSection(sectionID);
504 };
505 }
506 else {
507 callbackFunction = function()
508 {
509
510 expandAndExecute(sectionID+".1", null, null, null);
511 };
512 }
513 var docID = sectionID.replace(/([^.]*)\..*/, "$1");
514 var url = gs.xsltParams.library_name + "?a=d&amp;c=" + gs.cgiParams.c + "&amp;excerptid=gs-document&amp;dt=hierarchy&amp;d=" + docID;
515 if(gs.cgiParams.p_s) {
516 url += "&amp;p.s="+gs.cgiParams.p_s;
517 }
518 loadTopLevelPage(callbackFunction, url);
519 });
520 </xsl:text>
521 </script>
522 </xsl:when>
523 <xsl:otherwise>
524 <div id="gs-document">
525 <div id="tocLoadingImage" style="text-align:center;">
526 <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>
527 </div>
528 </div>
529 <script type="text/javascript">
530 <xsl:text disable-output-escaping="yes">
531 $(window).on("load", function()
532 {
533 loadTopLevelPage(function()
534 {
535 //Don't focus the section until the table of contents is loaded
536 var tocCheck = function()
537 {
538 if(gs.variables.tocLoaded)
539 {
540 focusSection("</xsl:text><xsl:value-of select="/page/pageResponse/document/@selectedNode"/><xsl:text disable-output-escaping="yes">");
541 }
542 else
543 {
544 setTimeout(tocCheck, 500);
545 }
546 }
547 tocCheck();
548 });
549 });
550 </xsl:text>
551 </script>
552 </xsl:otherwise>
553 </xsl:choose>
554
555 <div class="clear"><xsl:text> </xsl:text></div>
556 </xsl:template>
557
558 <!--
559 The follow is a useful template to redefine in an interface/site/collection
560 through which extra tests can be introduced to drive new document displays,
561 such as the IIIF Manifest based Mirador viewer
562 -->
563 <xsl:template name="wrappedDocumentTopLevel">
564 <xsl:call-template name="wrappedDocument"/>
565 </xsl:template>
566
567 <xsl:template name="editBar">
568 <table style="width:100%; border:none;" id="editBar" class="ui-widget-content"><tr>
569 <td id="editBarLeft" style="width:70%"><xsl:text> </xsl:text></td>
570 <td id="editBarRight">
571 <div style="text-align:center;">
572 <!-- edit structure button -->
573 <!-- comment this out as its not working -->
574 <!-- <div style="margin:5px;" class="ui-state-default ui-corner-all">
575 <a style="padding: 3px; text-decoration:none;" href="{$library_name}?a=g&amp;sa=documentbasket&amp;c=&amp;s=DisplayDocumentList&amp;rt=r&amp;p.c={/page/pageResponse/collection/@name}&amp;docToEdit={/page/pageResponse/document/documentNode/@nodeID}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'dse.edit_structure')"/></a>
576 </div>-->
577 <!-- edit content button -->
578 <div style="margin:5px;" class="ui-state-default ui-corner-all">
579 <a id="editContentButton" style="padding: 3px; text-decoration:none;">
580 <xsl:attribute name="href">
581 <xsl:value-of select="$library_name"/>
582 <xsl:text>/collection/</xsl:text>
583 <xsl:value-of select="$collName"/>
584 <xsl:text>/document/</xsl:text>
585 <xsl:choose>
586 <xsl:when test="count(//documentNode) > 0">
587 <xsl:value-of select="/page/pageResponse/document/documentNode/@nodeID"/>
588 </xsl:when>
589 <xsl:otherwise>
590 <xsl:value-of select="/page/pageResponse/document/@nodeID"/>
591 </xsl:otherwise>
592 </xsl:choose>
593 <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1')">
594 <xsl:text>?ed=1&amp;docEdit=1</xsl:text>
595 </xsl:if>
596 </xsl:attribute>
597 <xsl:choose>
598 <xsl:when test="/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1'">
599 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.hide_editor')"/>
600 </xsl:when>
601 <xsl:otherwise>
602 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.edit_content')"/>
603 </xsl:otherwise>
604 </xsl:choose>
605 </a>
606 </div>
607 </div>
608 </td>
609 </tr></table>
610 <gslib:langfrag name="dse"/>
611 </xsl:template>
612
613 <xsl:template name="wrappedSectionImage">
614 <gsf:variable name="screenImageWidth"><gsf:metadata name="ScreenWidth"/></gsf:variable>
615 <gsf:variable name="screenImageHeight"><gsf:metadata name="ScreenHeight"/></gsf:variable>
616 <gsf:variable name="imageWidth"><gsf:metadata name="ImageWidth"/></gsf:variable>
617 <gsf:variable name="imageHeight"><gsf:metadata name="ImageHeight"/></gsf:variable>
618 <gsf:variable name="docNodeID"><xsl:value-of select="@nodeID"/></gsf:variable> <!-- used to make each 'tidyDiv' unique -->
619
620 <xsl:choose>
621 <!-- **** Should the test of 'Source' perhaps be changed to 'Image' to be more consistent with usage else where for showing an web friendy Image-->
622 <xsl:when test="metadataList/metadata[@name = 'Screen'] and (metadataList/metadata[@name = 'Source'] or metadataList/metadata[@name = 'Image']) and ($imageWidth div $screenImageWidth > 1.2) and (not(/page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']) or /page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']/@value='false')">
623 <gsf:div id="tidyDiv-{@nodeID}" />
624 <!-- adding a div with clear:both when the image doesn't nicely fit in beside the side bar. Otherwise, the divs stays up, but the image moves down and everything looks and acts weird. -->
625 <script type="text/javascript">
626 <xsl:text disable-output-escaping="yes">
627
628 var containerWidth = document.getElementById("container").offsetWidth;
629 var rightSidebar = document.getElementById("rightSidebar");
630 if (rightSidebar) {
631 var rightSidebarWidth = rightSidebar.offsetWidth;
632 if (containerWidth - rightSidebarWidth &lt; </xsl:text><xsl:value-of select="$screenImageWidth"/><xsl:text disable-output-escaping="yes">) {
633 $("#tidyDiv-"+gs.variables.docNodeID).css("clear", "both");
634 }
635 }
636 </xsl:text>
637 </script>
638 <gsf:div id="image{@nodeID}">
639 <!-- when we ask for an individual section content we set ed=1. putting this test here prevents downloading all the screen and full images for each section of the document when we are just looking at the contents list. ed is not set for simple docs, so do this if doctype is simple -->
640 <xsl:if test="/page/pageResponse/document[@docType='simple'] or /page/pageRequest/paramList/param[@name = 'ed']/@value='1'">
641
642 <div id="wrap{util:replace(@nodeID, '.', '_')}" class="zoomImage" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
643 <div id="small{util:replace(@nodeID, '.', '_')}" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
644 <gsf:link type="source" target="_blank"><gsf:image type="screen"/></gsf:link>
645 </div>
646 <div id="mover{util:replace(@nodeID, '.', '_')}" style="border: 1px solid green; position: absolute; top: 0; left: 0; width: 598px; height: 598px; overflow: hidden; z-index: 100; background: white; display: none;">
647 <div id="overlay{util:replace(@nodeID, '.', '_')}" style="width: 600px; height: 600px; position: absolute; top: 0; left: 0; z-index: 200;">
648 <xsl:text> </xsl:text>
649 </div>
650 <div id="large{util:replace(@nodeID, '.', '_')}" style="position: relative; width: {$imageWidth}px; height: {$imageHeight}px;">
651 <gsf:link type="source"><gsf:image type="image"/></gsf:link>
652 </div>
653 </div>
654 </div>
655 <script type="text/javascript">
656 <xsl:text disable-output-escaping="yes">
657 {
658 var nodeID = "</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">";
659 nodeID = nodeID.replace(/\./g, "_");
660
661 var bigHeight = </xsl:text><xsl:value-of select="$imageHeight"/><xsl:text disable-output-escaping="yes">;
662 var smallHeight = </xsl:text><xsl:value-of select="$screenImageHeight"/><xsl:text disable-output-escaping="yes">;
663
664 var multiplier = bigHeight / smallHeight;
665
666 $("#wrap" + nodeID).anythingZoomer({
667 smallArea: "#small" + nodeID,
668 largeArea: "#large" + nodeID,
669 zoomPort: "#overlay" + nodeID,
670 mover: "#mover" + nodeID,
671 expansionSize:50,
672 speedMultiplier:multiplier
673 });
674
675 $("#zoomOptions input").prop("checked", false);
676 $("#zoomOptions").css("display", "");
677 }
678 </xsl:text>
679 </script>
680 </xsl:if>
681 </gsf:div>
682 </xsl:when>
683 <xsl:otherwise>
684 <gsf:div id="image{@nodeID}">
685 <xsl:attribute name="style">
686 <xsl:choose>
687 <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'">
688 <xsl:text>display:none;</xsl:text>
689 </xsl:when>
690 <xsl:otherwise>
691 <xsl:text>display:block;</xsl:text>
692 </xsl:otherwise>
693 </xsl:choose>
694 </xsl:attribute>
695 <xsl:call-template name="sectionImage"/><xsl:text> </xsl:text>
696 </gsf:div>
697 </xsl:otherwise>
698 </xsl:choose>
699 </xsl:template>
700
701 <!-- The default template for displaying the document node text -->
702 <!-- equivalent to gsf:text -->
703 <xsl:template name="documentNodeText">
704 <xsl:param name="force">0</xsl:param>
705 <!-- Hides the "This document has no text." message -->
706 <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
707 <xsl:choose>
708 <xsl:when test="$force = '1' or not($noText = '1')">
709
710 <!-- Section text -->
711 <xsl:for-each select="nodeContent">
712 <xsl:call-template name="displayMarkedUpTextAndAnnotations"/>
713 </xsl:for-each>
714 </xsl:when>
715 <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='ImageType'])">
716 <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link>
717 </xsl:when>
718 </xsl:choose>
719 <xsl:text> </xsl:text>
720 </xsl:template>
721
722 <!-- The default template for displaying the document node text in
723 editing mode -->
724 <!-- Note: we need to put some content in if the nodeContent is empty, otherwise you end up with an empty div, it gets changed to <div> and the ckeditor ends up being attached to everything else afterwards. -->
725 <!-- equivalent to gsf:text -->
726 <xsl:template name="documentNodeTextForEditing">
727 <!-- Section text -->
728 <xsl:for-each select="nodeContent">
729 <xsl:if test="not(node())"><gsf:space/></xsl:if>
730 <xsl:for-each select="node()">
731 <xsl:choose>
732 <xsl:when test="not(name())">
733 <xsl:value-of select="." disable-output-escaping="yes"/>
734 </xsl:when>
735 <xsl:otherwise>
736 <xsl:apply-templates/>
737 </xsl:otherwise>
738 </xsl:choose>
739 </xsl:for-each>
740 </xsl:for-each>
741 </xsl:template>
742
743 <!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
744 <xsl:template name="documentNodeFlashXML">
745 <xsl:text disable-output-escaping="yes">
746 &lt;Section&gt;
747 &lt;Description&gt;
748 &lt;Metadata name="Title"&gt;
749 </xsl:text>
750 <xsl:value-of select="normalize-space(metadataList/metadata[@name = 'Title'])"/>
751 <xsl:text disable-output-escaping="yes">
752 &lt;/Metadata&gt;
753 &lt;/Description&gt;
754 </xsl:text>
755
756 <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/>
757
758 <xsl:for-each select="documentNode">
759 <xsl:call-template name="documentNodeFlashXML"/>
760 </xsl:for-each>
761
762 <xsl:text disable-output-escaping="yes">
763 &lt;/Section&gt;
764 </xsl:text>
765 </xsl:template>
766
767 <xsl:template name="externalPage">
768 <xsl:param name="external"/>
769 <xsl:variable name="go_forward_link">
770 <a>
771 <xsl:attribute name="href">
772 <xsl:value-of select="$external"/>
773 </xsl:attribute>
774 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/>
775 </a>
776 </xsl:variable>
777 <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
778 <p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/></p>
779 </xsl:template>
780
781 <xsl:template match="/page"><gslib:displayErrorsIfAny/><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
782
783 <xsl:template name="documentPre">
784 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
785 <xsl:call-template name="mapFeatures"/>
786 </xsl:if>
787 </xsl:template>
788
789 <xsl:template name="documentPost">
790 <!-- empty by default, to be overridden as needed -->
791 </xsl:template>
792
793
794 <xsl:template name="mapFeatures">
795 <div id="map_canvas" class="map_canvas_full"><xsl:text> </xsl:text></div>
796
797 <xsl:choose>
798 <!-- HIERARCHICAL DOCUMENTS -->
799 <xsl:when test="count(//documentNode) > 0">
800 <xsl:for-each select="documentNode">
801 <xsl:call-template name="mapPlacesNearHere"/>
802 </xsl:for-each>
803 </xsl:when>
804 <!-- SIMPLE DOCUMENTS -->
805 <xsl:otherwise>
806 <xsl:call-template name="mapPlacesNearHere"/>
807 </xsl:otherwise>
808 </xsl:choose>
809
810 <div id="jsonNodes" style="display:none;">
811 <xsl:text>[</xsl:text>
812 <xsl:choose>
813 <!-- HIERARCHICAL DOCUMENTS -->
814 <xsl:when test="count(//documentNode) > 0">
815 <xsl:for-each select="//documentNode">
816 <xsl:if test="(metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']) or metadataList/metadata[@name = 'Coordinate'] or metadataList/metadata[@name = 'GPS.mapOverlay'] or metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
817 <xsl:text>{</xsl:text>
818 <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
819 <xsl:text disable-output-escaping="yes">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
820 <xsl:text disable-output-escaping="yes">"</xsl:text>
821 <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
822 <xsl:text disable-output-escaping="yes">,</xsl:text>
823 <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>
824 <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
825 </xsl:if>
826 <!--
827 <xsl:if test="metadataList/metadata[@name = 'Coordinate']">
828 <xsl:text disable-output-escaping="yes">,</xsl:text>
829 <xsl:text disable-output-escaping="yes">"coords":</xsl:text>
830 <xsl:text>[</xsl:text>
831 <xsl:for-each select="metadataList/metadata[@name = 'Coordinate']">
832 <xsl:text disable-output-escaping="yes">"</xsl:text>
833 <xsl:value-of disable-output-escaping="yes" select="current()"/>
834 <xsl:text disable-output-escaping="yes">"</xsl:text>
835 <xsl:text disable-output-escaping="yes">,</xsl:text>
836 </xsl:for-each>
837 <xsl:text>]</xsl:text>
838 </xsl:if>
839 -->
840 <xsl:if test="metadataList/metadata[@name = 'GPS.mapOverlay']">
841 <xsl:text disable-output-escaping="yes">,</xsl:text>
842 <xsl:text disable-output-escaping="yes">"mapoverlay":</xsl:text>
843 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'GPS.mapOverlay']"/>
844 </xsl:if>
845
846 <xsl:if test="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
847 <xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'descendants_GPS.mapOverlay'])"/></xsl:variable>
848 <xsl:text disable-output-escaping="yes">,</xsl:text>
849 <xsl:text disable-output-escaping="yes">"descendantsMapoverlays":[</xsl:text>
850 <xsl:for-each select="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
851 <xsl:value-of disable-output-escaping="yes" select="current()"/>
852 <xsl:if test="not(position() = $count)">
853 <xsl:text disable-output-escaping="yes">,</xsl:text>
854 </xsl:if>
855 </xsl:for-each>
856 <xsl:text disable-output-escaping="yes">]</xsl:text>
857 </xsl:if>
858
859 <xsl:text>}</xsl:text>
860
861 <xsl:if test="not(position() = count(//documentNode))">
862 <xsl:text>,</xsl:text>
863 </xsl:if>
864
865 </xsl:if>
866 </xsl:for-each>
867 </xsl:when>
868 <!-- SIMPLE DOCUMENTS -->
869 <xsl:otherwise>
870 <xsl:for-each select="/page/pageResponse/document">
871 <xsl:if test="(metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']) or metadataList/metadata[@name = 'Coordinate'] or metadataList/metadata[@name = 'GPS.mapOverlay'] or metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
872 <xsl:text>{</xsl:text>
873 <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@selectedNode"/><xsl:text disable-output-escaping="yes">",</xsl:text>
874 <xsl:text disable-output-escaping="yes">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
875 <xsl:text disable-output-escaping="yes">"</xsl:text>
876 <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
877 <xsl:text disable-output-escaping="yes">,</xsl:text>
878 <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>
879 <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
880 </xsl:if>
881 <!--
882 <xsl:if test="metadataList/metadata[@name = 'Coordinate']">
883 <xsl:text disable-output-escaping="yes">,</xsl:text>
884 <xsl:text disable-output-escaping="yes">"coords":</xsl:text>
885 <xsl:text>[</xsl:text>
886 <xsl:for-each select="metadataList/metadata[@name = 'Coordinate']">
887 <xsl:text disable-output-escaping="yes">"</xsl:text>
888 <xsl:value-of disable-output-escaping="yes" select="current()"/>
889 <xsl:text disable-output-escaping="yes">"</xsl:text>
890 <xsl:text disable-output-escaping="yes">,</xsl:text>
891 </xsl:for-each>
892 <xsl:text>]</xsl:text>
893 </xsl:if>
894 -->
895 <xsl:if test="metadataList/metadata[@name = 'GPS.mapOverlay']">
896 <xsl:text disable-output-escaping="yes">,</xsl:text>
897 <xsl:text disable-output-escaping="yes">"mapoverlay":</xsl:text>
898 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'GPS.mapOverlay']"/>
899 </xsl:if>
900
901 <xsl:if test="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
902 <xsl:variable name="count"><xsl:value-of select="count(metadataList/metadata[@name = 'descendants_GPS.mapOverlay'])"/></xsl:variable>
903 <xsl:text disable-output-escaping="yes">,</xsl:text>
904 <xsl:text disable-output-escaping="yes">"descendantsMapoverlays":[</xsl:text>
905 <xsl:for-each select="metadataList/metadata[@name = 'descendants_GPS.mapOverlay']">
906 <xsl:value-of disable-output-escaping="yes" select="current()"/>
907 <xsl:if test="not(position() = $count)">
908 <xsl:text disable-output-escaping="yes">,</xsl:text>
909 </xsl:if>
910 </xsl:for-each>
911 <xsl:text disable-output-escaping="yes">]</xsl:text>
912 </xsl:if>
913
914 <xsl:text>}</xsl:text>
915 </xsl:if>
916 </xsl:for-each>
917 </xsl:otherwise>
918 </xsl:choose>
919 <xsl:text>]</xsl:text>
920 </div>
921
922 <!-- TODO: Why do we have to do this to see Coordinate meta appear in extraMetadataList on o=xml page, when Lat and Lng appear without doing the same???
923 Furthermore, map-tools.xsl already requests Coordinate meta, and map-tools.xsl is always included when format statement for collection in
924 search|browse|doc display view has mapEnabled=true -->
925 <gsf:metadata name="Coordinate" hidden="true"/>
926 <gsf:metadata name="GPS.mapOverlay" hidden="true"/>
927 <gsf:metadata name="GPS.mapOverlay" select="descendants" hidden="true"/>
928 </xsl:template>
929
930 <xsl:template name="mapPlacesNearHere">
931 <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
932 <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
933 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.map_nearby_docs')"/>
934 <img id="nearbyDocumentsToggle" style="margin-left:5px;" src="interfaces/{$interface_name}/images/expand.png">
935 <xsl:attribute name="onclick">
936 <xsl:text>performDistanceSearch('</xsl:text>
937 <xsl:value-of select="@nodeID"/>
938 <xsl:text>', '</xsl:text>
939 <gsf:metadata name="Latitude"/>
940 <xsl:text>', '</xsl:text>
941 <gsf:metadata name="Longitude"/>
942 <xsl:text>', 2);</xsl:text>
943 </xsl:attribute>
944 </img>
945 <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
946 </div>
947 </xsl:if>
948
949 <xsl:if test="metadataList/metadata[@name = 'Coordinate']">
950 <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
951 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.map_nearby_docs')"/>
952 <xsl:for-each select="metadataList/metadata[@name = 'Coordinate']">
953
954 <xsl:variable name="coordinate"><xsl:value-of select="current()"/></xsl:variable>
955
956
957 <img id="nearbyDocumentsToggle" style="margin-left:5px;" src="interfaces/{$interface_name}/images/expand.png">
958 <xsl:attribute name="onclick">
959 <xsl:text>performDistanceSearchWithCoordinates('</xsl:text>
960 <xsl:value-of select="@nodeID"/>
961 <xsl:text>', '</xsl:text>
962 <xsl:value-of select="$coordinate"/><!--<gsf:metadata name="Coordinate"/>-->
963 <xsl:text>', 2);</xsl:text>
964 </xsl:attribute>
965 </img>
966 </xsl:for-each>
967 <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
968 </div>
969 </xsl:if>
970 </xsl:template>
971</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.