1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <xsl:stylesheet version="1.0"
|
---|
3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
4 | xmlns:java="http://xml.apache.org/xslt/java"
|
---|
5 | xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
|
---|
6 | xmlns:gslib="http://www.greenstone.org/skinning"
|
---|
7 | xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
|
---|
8 | extension-element-prefixes="java util"
|
---|
9 | exclude-result-prefixes="java util gsf">
|
---|
10 |
|
---|
11 | <!-- use the 'main' layout -->
|
---|
12 | <xsl:import href="layouts/main.xsl"/>
|
---|
13 |
|
---|
14 | <!-- style includes global params interface_name, library_name -->
|
---|
15 | <xsl:include href=".old/berrytools.xsl"/>
|
---|
16 |
|
---|
17 | <xsl:variable name="bookswitch">
|
---|
18 | <xsl:choose>
|
---|
19 | <xsl:when test="/page/pageRequest/paramList/param[@name='book']/@value">
|
---|
20 | <xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/>
|
---|
21 | </xsl:when>
|
---|
22 | <xsl:otherwise>off</xsl:otherwise>
|
---|
23 | </xsl:choose>
|
---|
24 | </xsl:variable>
|
---|
25 |
|
---|
26 | <!-- set page title -->
|
---|
27 | <xsl:template name="pageTitle"><gslib:documentTitle/></xsl:template>
|
---|
28 |
|
---|
29 | <!-- set page breadcrumbs -->
|
---|
30 | <xsl:template name="breadcrumbs">
|
---|
31 | <gslib:siteLink/><gslib:rightArrow/>
|
---|
32 | <gslib:collectionNameLinked/><gslib:rightArrow/>
|
---|
33 | <a>
|
---|
34 | <xsl:attribute name="href">
|
---|
35 | <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collName"/>/document/<xsl:value-of select="/page/pageResponse/document/documentNode[1]/@nodeID"/>
|
---|
36 | </xsl:attribute>
|
---|
37 | <xsl:variable name="documentTitleVar">
|
---|
38 | <gslib:documentTitle/>
|
---|
39 | </xsl:variable>
|
---|
40 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.document')"/>
|
---|
41 | </a>
|
---|
42 | </xsl:template>
|
---|
43 |
|
---|
44 | <xsl:template match="/">
|
---|
45 | <xsl:choose>
|
---|
46 | <!-- if this is the realistic books version of the page -->
|
---|
47 | <xsl:when test="$bookswitch = 'flashxml'">
|
---|
48 | <html>
|
---|
49 | <body>
|
---|
50 | <xsl:apply-templates select="/page/pageResponse/document"/>
|
---|
51 | </body>
|
---|
52 | </html>
|
---|
53 | </xsl:when>
|
---|
54 | <!-- if this is the regular version of the page -->
|
---|
55 | <xsl:otherwise>
|
---|
56 | <xsl:apply-imports/>
|
---|
57 | </xsl:otherwise>
|
---|
58 | </xsl:choose>
|
---|
59 | </xsl:template>
|
---|
60 |
|
---|
61 | <!-- Used to make sure that regardless what the collection designer uses for the title and content we can wrap it properly -->
|
---|
62 | <!-- If editing, be aware that the Document Basket looks for specific classes that this template bakes in (key points marked with ***) -->
|
---|
63 | <xsl:template name="wrapDocumentNodes">
|
---|
64 | <a name="{@nodeID}"><xsl:text> </xsl:text></a>
|
---|
65 | <!-- Section header -->
|
---|
66 | <table class="sectionHeader"><tr>
|
---|
67 |
|
---|
68 | <!-- Expand/collapse button -->
|
---|
69 | <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'">
|
---|
70 | <td class="headerTD">
|
---|
71 | <img id="dtoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
|
---|
72 | <xsl:attribute name="src">
|
---|
73 | <xsl:choose>
|
---|
74 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent(@nodeID, /page/pageResponse/document/@selectedNode)">
|
---|
75 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
76 | </xsl:when>
|
---|
77 | <xsl:otherwise>
|
---|
78 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
79 | </xsl:otherwise>
|
---|
80 | </xsl:choose>
|
---|
81 | </xsl:attribute>
|
---|
82 | </img>
|
---|
83 | </td>
|
---|
84 | </xsl:if>
|
---|
85 |
|
---|
86 | <!-- Title -->
|
---|
87 | <td id="header{@nodeID}" class="headerTD sectionTitle"><!-- *** -->
|
---|
88 | <!-- Get the title from the title sectionTitle template -->
|
---|
89 | <xsl:choose>
|
---|
90 | <xsl:when test="not(/page/pageRequest/paramList/param[@name = 'dmd']) or /page/pageRequest/paramList/param[@name = 'dmd']/@value = 'false'">
|
---|
91 | <xsl:apply-templates select="." mode="sectionTitleFormat"/>
|
---|
92 | </xsl:when>
|
---|
93 | <xsl:otherwise>
|
---|
94 | <xsl:apply-templates select="." mode="sectionTitle"/>
|
---|
95 | </xsl:otherwise>
|
---|
96 | </xsl:choose>
|
---|
97 | </td>
|
---|
98 |
|
---|
99 | <!-- "back to top" link -->
|
---|
100 | <xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle'">
|
---|
101 | <td class="backToTop headerTD">
|
---|
102 | <a href="javascript:scrollToTop();">
|
---|
103 | <xsl:text disable-output-escaping="yes">▲</xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.back_to_top')"/>
|
---|
104 | </a>
|
---|
105 | </td>
|
---|
106 | </xsl:if>
|
---|
107 | </tr></table>
|
---|
108 |
|
---|
109 | <div id="doc{@nodeID}"><!-- *** -->
|
---|
110 | <xsl:choose>
|
---|
111 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID">
|
---|
112 | <xsl:attribute name="class">
|
---|
113 | <xsl:text>sectionContainer hasText</xsl:text>
|
---|
114 | </xsl:attribute>
|
---|
115 | <xsl:attribute name="style">
|
---|
116 | <xsl:text>display:block;</xsl:text>
|
---|
117 | </xsl:attribute>
|
---|
118 | </xsl:when>
|
---|
119 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or util:oidIsMatchOrParent(@nodeID, /page/pageResponse/document/@selectedNode)">
|
---|
120 | <xsl:attribute name="class">
|
---|
121 | <xsl:text>sectionContainer noText</xsl:text>
|
---|
122 | </xsl:attribute>
|
---|
123 | <xsl:attribute name="style">
|
---|
124 | <xsl:text>display:block;</xsl:text>
|
---|
125 | </xsl:attribute>
|
---|
126 | </xsl:when>
|
---|
127 | <xsl:otherwise>
|
---|
128 | <xsl:attribute name="class">
|
---|
129 | <xsl:text>sectionContainer noText</xsl:text>
|
---|
130 | </xsl:attribute>
|
---|
131 | <xsl:attribute name="style">
|
---|
132 | <xsl:text>display:none;</xsl:text>
|
---|
133 | </xsl:attribute>
|
---|
134 | </xsl:otherwise>
|
---|
135 | </xsl:choose>
|
---|
136 |
|
---|
137 | <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))">
|
---|
138 | <table id="meta{@nodeID}">
|
---|
139 | <xsl:attribute name="style">
|
---|
140 | <xsl:choose>
|
---|
141 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'dmd']/@value = 'true'">
|
---|
142 | <xsl:text>display:block;</xsl:text>
|
---|
143 | </xsl:when>
|
---|
144 | <xsl:otherwise>
|
---|
145 | <xsl:text>display:none;</xsl:text>
|
---|
146 | </xsl:otherwise>
|
---|
147 | </xsl:choose>
|
---|
148 | </xsl:attribute>
|
---|
149 | <xsl:value-of select="util:clearMetadataStorage()"/>
|
---|
150 | <xsl:for-each select="metadataList/metadata">
|
---|
151 | <xsl:sort select="@name"/>
|
---|
152 | <xsl:if test="util:checkMetadataNotDuplicate(@name, .)">
|
---|
153 | <tr>
|
---|
154 | <td class="metaTableCellName"><xsl:value-of select="@name"/></td>
|
---|
155 | <td class="metaTableCell"><xsl:value-of select="."/></td>
|
---|
156 | </tr>
|
---|
157 | </xsl:if>
|
---|
158 | </xsl:for-each>
|
---|
159 | </table>
|
---|
160 | </xsl:if>
|
---|
161 |
|
---|
162 | <xsl:for-each select=".">
|
---|
163 | <xsl:call-template name="sectionImage"/>
|
---|
164 | </xsl:for-each>
|
---|
165 |
|
---|
166 | <div id="text{@nodeID}" class="sectionText"><!-- *** -->
|
---|
167 | <xsl:attribute name="style">
|
---|
168 | <xsl:choose>
|
---|
169 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'">
|
---|
170 | <xsl:text>display:none;</xsl:text>
|
---|
171 | </xsl:when>
|
---|
172 | <xsl:otherwise>
|
---|
173 | <xsl:text>display:block;</xsl:text>
|
---|
174 | </xsl:otherwise>
|
---|
175 | </xsl:choose>
|
---|
176 | </xsl:attribute>
|
---|
177 | <!-- Get the section content from the document template -->
|
---|
178 | <xsl:apply-templates select="." mode="document"/>
|
---|
179 | </div>
|
---|
180 | <xsl:if test="documentNode">
|
---|
181 | <xsl:for-each select="documentNode">
|
---|
182 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
183 | </xsl:for-each>
|
---|
184 | </xsl:if>
|
---|
185 | </div>
|
---|
186 | </xsl:template>
|
---|
187 |
|
---|
188 | <!-- the page content -->
|
---|
189 | <xsl:template match="/page/pageResponse/document">
|
---|
190 | <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))">
|
---|
191 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts.js"><xsl:text> </xsl:text></script>
|
---|
192 | <script type="text/javascript" src="interfaces/{$interface_name}/js/documentmaker_scripts_util.js"><xsl:text> </xsl:text></script>
|
---|
193 | <script type="text/javascript">
|
---|
194 | <xsl:text disable-output-escaping="yes">
|
---|
195 | $(window).load(function()
|
---|
196 | {
|
---|
197 | if(gs.cgiParams.docEdit == "1")
|
---|
198 | {
|
---|
199 | readyPageForEditing();
|
---|
200 | }
|
---|
201 | });
|
---|
202 | </xsl:text>
|
---|
203 | </script>
|
---|
204 | <gsf:metadata name="all"/>
|
---|
205 | </xsl:if>
|
---|
206 |
|
---|
207 | <xsl:if test="$bookswitch = 'off'">
|
---|
208 | <div id="bookdiv" style="visibility:hidden; height:0px; display:inline;"><xsl:text> </xsl:text></div>
|
---|
209 |
|
---|
210 | <script type="text/javascript" src="interfaces/{$interface_name}/js/document_scripts.js"><xsl:text> </xsl:text></script>
|
---|
211 |
|
---|
212 | <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
|
---|
213 | <script type="text/javascript">
|
---|
214 | <xsl:text disable-output-escaping="yes">
|
---|
215 | if(document.URL.indexOf("book=on") != -1)
|
---|
216 | {
|
---|
217 | loadBook();
|
---|
218 | }
|
---|
219 | </xsl:text>
|
---|
220 | </script>
|
---|
221 | </xsl:if>
|
---|
222 |
|
---|
223 | <!-- show the little berries for this document -->
|
---|
224 | <xsl:call-template name="documentBerryForDocumentPage"/>
|
---|
225 |
|
---|
226 | <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))">
|
---|
227 | <xsl:call-template name="editBar"/>
|
---|
228 | </xsl:if>
|
---|
229 |
|
---|
230 | <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'">
|
---|
231 | <xsl:call-template name="rightSidebar"/>
|
---|
232 | </xsl:if>
|
---|
233 | </xsl:if>
|
---|
234 |
|
---|
235 | <!-- display the document -->
|
---|
236 | <xsl:choose>
|
---|
237 | <xsl:when test="@external != ''">
|
---|
238 | <xsl:call-template name="externalPage">
|
---|
239 | <xsl:with-param name="external" select="@external"/>
|
---|
240 | </xsl:call-template>
|
---|
241 | </xsl:when>
|
---|
242 | <xsl:when test="$bookswitch = 'flashxml'">
|
---|
243 | <xsl:apply-templates mode="flashxml"/>
|
---|
244 | </xsl:when>
|
---|
245 | <xsl:when test="$bookswitch = 'on'">
|
---|
246 | <div id="bookdiv" style="display:inline;"><xsl:text> </xsl:text></div>
|
---|
247 | <!-- *** in document-scripts.js *** -->
|
---|
248 | <script type="text/javascript">
|
---|
249 | <xsl:text disable-output-escaping="yes">
|
---|
250 | if(document.URL.indexOf("book=on") != -1)
|
---|
251 | {
|
---|
252 | loadBook();
|
---|
253 | }
|
---|
254 | </xsl:text>
|
---|
255 | </script>
|
---|
256 | </xsl:when>
|
---|
257 | <xsl:otherwise>
|
---|
258 | <xsl:choose>
|
---|
259 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or not(util:contains(/page/pageResponse/document/@selectedNode, '.'))">
|
---|
260 | <div id="gs-document">
|
---|
261 | <xsl:call-template name="documentPre"/>
|
---|
262 | <div id="gs-document-text" class="documenttext" collection="{/page/pageResponse/collection/@name}"><!-- *** -->
|
---|
263 | <xsl:for-each select="documentNode">
|
---|
264 | <xsl:call-template name="wrapDocumentNodes"/>
|
---|
265 | </xsl:for-each>
|
---|
266 | </div>
|
---|
267 | </div>
|
---|
268 | </xsl:when>
|
---|
269 | <xsl:otherwise>
|
---|
270 | <div id="gs-document">
|
---|
271 | <div id="tocLoadingImage" style="text-align:center;">
|
---|
272 | <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>
|
---|
273 | </div>
|
---|
274 | </div>
|
---|
275 | <script type="text/javascript">
|
---|
276 | <xsl:text disable-output-escaping="yes">
|
---|
277 | $(window).load(function()
|
---|
278 | {
|
---|
279 | loadTopLevelPage(function()
|
---|
280 | {
|
---|
281 | //Don't focus the section until the table of contents is loaded
|
---|
282 | var tocCheck = function()
|
---|
283 | {
|
---|
284 | if(gs.variables.tocLoaded)
|
---|
285 | {
|
---|
286 | focusSection("</xsl:text><xsl:value-of select="/page/pageResponse/document/@selectedNode"/><xsl:text disable-output-escaping="yes">");
|
---|
287 | }
|
---|
288 | else
|
---|
289 | {
|
---|
290 | setTimeout(tocCheck, 500);
|
---|
291 | }
|
---|
292 | }
|
---|
293 | tocCheck();
|
---|
294 | });
|
---|
295 | });
|
---|
296 | </xsl:text>
|
---|
297 | </script>
|
---|
298 | </xsl:otherwise>
|
---|
299 | </xsl:choose>
|
---|
300 | </xsl:otherwise>
|
---|
301 | </xsl:choose>
|
---|
302 |
|
---|
303 | <div class="clear"><xsl:text> </xsl:text></div>
|
---|
304 | </xsl:template>
|
---|
305 |
|
---|
306 | <xsl:template name="editBar">
|
---|
307 | <table style="width:100%"><tr>
|
---|
308 | <td id="editBarLeft" style="width:70%"><xsl:text> </xsl:text></td>
|
---|
309 | <td id="editBarRight">
|
---|
310 | <div style="text-align:center;">
|
---|
311 | <div style="margin:5px;" class="ui-state-default ui-corner-all">
|
---|
312 | <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>
|
---|
313 | </div>
|
---|
314 | <div style="margin:5px;" class="ui-state-default ui-corner-all">
|
---|
315 | <a id="editContentButton" style="padding: 3px; text-decoration:none;">
|
---|
316 | <xsl:attribute name="href">
|
---|
317 | <xsl:value-of select="$library_name"/>
|
---|
318 | <xsl:text>/collection/</xsl:text>
|
---|
319 | <xsl:value-of select="$collName"/>
|
---|
320 | <xsl:text>/document/</xsl:text>
|
---|
321 | <xsl:value-of select="/page/pageResponse/document/documentNode/@nodeID"/>
|
---|
322 | <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1')">
|
---|
323 | <xsl:text>?ed=1&docEdit=1</xsl:text>
|
---|
324 | </xsl:if>
|
---|
325 | </xsl:attribute>
|
---|
326 | <xsl:choose>
|
---|
327 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1'">
|
---|
328 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.hide_editor')"/>
|
---|
329 | </xsl:when>
|
---|
330 | <xsl:otherwise>
|
---|
331 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.edit_content')"/>
|
---|
332 | </xsl:otherwise>
|
---|
333 | </xsl:choose>
|
---|
334 | </a>
|
---|
335 | </div>
|
---|
336 | </div>
|
---|
337 | </td>
|
---|
338 | </tr></table>
|
---|
339 | <gslib:langfrag name="dse"/><!--<xsl:call-template name="document-editor-language-fragments"/>-->
|
---|
340 | </xsl:template>
|
---|
341 |
|
---|
342 | <xsl:template name="rightSidebar">
|
---|
343 | <table id="rightSidebar">
|
---|
344 | <tr><td>
|
---|
345 | <xsl:call-template name="viewOptions"/>
|
---|
346 | </td></tr>
|
---|
347 | <tr><td>
|
---|
348 | <div id="contentsArea">
|
---|
349 | <!-- show the berry basket if it's turned on -->
|
---|
350 | <gslib:berryBasket/>
|
---|
351 |
|
---|
352 | <!-- Need to be in the context of the top-level documentNode rather than the document for the gsf:metadata call to work -->
|
---|
353 | <xsl:for-each select="documentNode">
|
---|
354 | <xsl:variable name="hasCover"><gsf:metadata name="hascover"/></xsl:variable>
|
---|
355 | <xsl:if test="$hasCover = '1'">
|
---|
356 | <!-- the book's cover image -->
|
---|
357 | <div id="coverImage">
|
---|
358 | <xsl:attribute name="class">
|
---|
359 | <xsl:choose>
|
---|
360 | <xsl:when test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']) or /page/pageResponse/format[@type='display']/gsf:option[@name='coverImage']/@value='true'">visible</xsl:when>
|
---|
361 | <xsl:otherwise>hidden</xsl:otherwise>
|
---|
362 | </xsl:choose>
|
---|
363 | </xsl:attribute>
|
---|
364 | <gslib:coverImage/><xsl:text> </xsl:text>
|
---|
365 | </div>
|
---|
366 | </xsl:if>
|
---|
367 | </xsl:for-each>
|
---|
368 |
|
---|
369 | <!-- the contents (if enabled) -->
|
---|
370 | <xsl:choose>
|
---|
371 | <xsl:when test="/page/pageResponse/document/documentNode/@docType = 'paged'">
|
---|
372 | <gsf:image type="Thumb"/>
|
---|
373 | <!-- Table of contents will be dynamically retrieved when viewing a paged document -->
|
---|
374 | <script type="text/javascript">
|
---|
375 | <xsl:text disable-output-escaping="yes">
|
---|
376 | $(window).load(function()
|
---|
377 | {
|
---|
378 | retrieveTableOfContentsAndTitles();
|
---|
379 | });
|
---|
380 | </xsl:text>
|
---|
381 | </script>
|
---|
382 | <div id="tableOfContents"><xsl:text> </xsl:text></div>
|
---|
383 | <div id="tocLoadingImage" style="text-align:center;">
|
---|
384 | <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>
|
---|
385 | </div>
|
---|
386 | <table style="width:100%;"><tbody><tr>
|
---|
387 | <td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.filter_pages')"/><xsl:text>: </xsl:text><input id="filterText" type="text" size="27"/></td>
|
---|
388 | </tr></tbody></table>
|
---|
389 | </xsl:when>
|
---|
390 | <xsl:when test="not(/page/pageRequest/paramList/param[@name = 'ed']/@value = '1')">
|
---|
391 | <div id="tableOfContents">
|
---|
392 | <div id="tocLoadingImage" style="text-align:center;">
|
---|
393 | <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>
|
---|
394 | </div>
|
---|
395 | </div>
|
---|
396 | <script type="text/javascript">
|
---|
397 | <xsl:text disable-output-escaping="yes">
|
---|
398 | $(window).load(function()
|
---|
399 | {
|
---|
400 | retrieveFullTableOfContents();
|
---|
401 | });
|
---|
402 | </xsl:text>
|
---|
403 | </script>
|
---|
404 | </xsl:when>
|
---|
405 | <xsl:otherwise>
|
---|
406 | <div id="tableOfContents">
|
---|
407 | <xsl:attribute name="class">
|
---|
408 | <xsl:choose>
|
---|
409 | <xsl:when test="count(//documentNode) > 1 and not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">visible</xsl:when>
|
---|
410 | <xsl:otherwise>hidden</xsl:otherwise>
|
---|
411 | </xsl:choose>
|
---|
412 | </xsl:attribute>
|
---|
413 | <xsl:apply-templates select="documentNode" mode="TOC"/>
|
---|
414 | </div>
|
---|
415 | </xsl:otherwise>
|
---|
416 | </xsl:choose>
|
---|
417 | </div>
|
---|
418 | </td></tr>
|
---|
419 | </table>
|
---|
420 | </xsl:template>
|
---|
421 |
|
---|
422 | <!-- Highlight annotations if requested -->
|
---|
423 | <xsl:template match="annotation">
|
---|
424 | <xsl:choose>
|
---|
425 | <xsl:when test="/page/pageRequest/paramList/param[@name='hl' and @value='on']">
|
---|
426 | <span class="termHighlight"><xsl:value-of select="."/></span>
|
---|
427 | </xsl:when>
|
---|
428 | <xsl:otherwise>
|
---|
429 | <span class="noTermHighlight"><xsl:value-of select="."/></span>
|
---|
430 | </xsl:otherwise>
|
---|
431 | </xsl:choose>
|
---|
432 | </xsl:template>
|
---|
433 |
|
---|
434 | <xsl:template match="documentNode" mode="sectionTitleFormat">
|
---|
435 | <p>
|
---|
436 | <xsl:attribute name="class"><xsl:value-of select="util:hashToDepthClass(@nodeID)"/> sectionHeader</xsl:attribute>
|
---|
437 |
|
---|
438 | <xsl:if test="util:hashToSectionId(@nodeID)">
|
---|
439 | <span class="sectionNumberSpan">
|
---|
440 | <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
|
---|
441 | <xsl:text> </xsl:text>
|
---|
442 | </span>
|
---|
443 | </xsl:if>
|
---|
444 | <!-- Display the title for the section regardless of whether automatic section numbering is turned on -->
|
---|
445 | <span><xsl:apply-templates select="." mode="sectionTitle"/></span>
|
---|
446 | </p>
|
---|
447 | </xsl:template>
|
---|
448 |
|
---|
449 | <!-- The default template for displaying section titles -->
|
---|
450 | <xsl:template match="documentNode" mode="sectionTitle">
|
---|
451 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
|
---|
452 | </xsl:template>
|
---|
453 |
|
---|
454 | <xsl:template name="sectionImage">
|
---|
455 | <gsf:variable name="screenImageWidth"><gsf:metadata name="ScreenWidth"/></gsf:variable>
|
---|
456 | <gsf:variable name="screenImageHeight"><gsf:metadata name="ScreenHeight"/></gsf:variable>
|
---|
457 | <gsf:variable name="imageWidth"><gsf:metadata name="ImageWidth"/></gsf:variable>
|
---|
458 | <gsf:variable name="imageHeight"><gsf:metadata name="ImageHeight"/></gsf:variable>
|
---|
459 |
|
---|
460 | <xsl:choose>
|
---|
461 | <xsl:when test="metadataList/metadata[@name = 'Screen'] and metadataList/metadata[@name = 'Source']">
|
---|
462 | <div id="wrap{util:replace(@nodeID, '.', '_')}" class="zoomImage" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
463 | <div id="small{util:replace(@nodeID, '.', '_')}" style="position:relative; width: {$screenImageWidth}px; height: {$screenImageHeight}px;">
|
---|
464 | <gsf:image type="screen"/>
|
---|
465 | </div>
|
---|
466 | <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;">
|
---|
467 | <div id="overlay{util:replace(@nodeID, '.', '_')}" style="width: 200px; height: 200px; position: absolute; top: 0; left: 0; z-index: 200;">
|
---|
468 | <xsl:text> </xsl:text>
|
---|
469 | </div>
|
---|
470 | <div id="large{util:replace(@nodeID, '.', '_')}" style="position: relative;">
|
---|
471 | <gsf:image type="source"/>
|
---|
472 | </div>
|
---|
473 | </div>
|
---|
474 | </div>
|
---|
475 | <script type="text/javascript">
|
---|
476 | <xsl:text disable-output-escaping="yes">
|
---|
477 | {
|
---|
478 | var nodeID = "</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">";
|
---|
479 | nodeID = nodeID.replace(/\./g, "_");
|
---|
480 |
|
---|
481 | var bigHeight = </xsl:text><xsl:value-of select="$imageHeight"/><xsl:text disable-output-escaping="yes">;
|
---|
482 | var smallHeight = </xsl:text><xsl:value-of select="$screenImageHeight"/><xsl:text disable-output-escaping="yes">;
|
---|
483 |
|
---|
484 | var multiplier = bigHeight / smallHeight;
|
---|
485 |
|
---|
486 | $("#wrap" + nodeID).anythingZoomer({
|
---|
487 | smallArea: "#small" + nodeID,
|
---|
488 | largeArea: "#large" + nodeID,
|
---|
489 | zoomPort: "#overlay" + nodeID,
|
---|
490 | mover: "#mover" + nodeID,
|
---|
491 | expansionSize:50,
|
---|
492 | speedMultiplier:multiplier
|
---|
493 | });
|
---|
494 | }
|
---|
495 | </xsl:text>
|
---|
496 | </script>
|
---|
497 | </xsl:when>
|
---|
498 | <xsl:when test="metadataList/metadata[@name = 'Screen']">
|
---|
499 | <div id="image{@nodeID}">
|
---|
500 | <xsl:attribute name="style">
|
---|
501 | <xsl:choose>
|
---|
502 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'">
|
---|
503 | <xsl:text>display:none;</xsl:text>
|
---|
504 | </xsl:when>
|
---|
505 | <xsl:otherwise>
|
---|
506 | <xsl:text>display:block;</xsl:text>
|
---|
507 | </xsl:otherwise>
|
---|
508 | </xsl:choose>
|
---|
509 | </xsl:attribute>
|
---|
510 | <gsf:image type="screen"/>
|
---|
511 | </div>
|
---|
512 | </xsl:when>
|
---|
513 | </xsl:choose>
|
---|
514 | </xsl:template>
|
---|
515 |
|
---|
516 | <!-- The default template for displaying the document content -->
|
---|
517 | <xsl:template match="documentNode" mode="document">
|
---|
518 | <!-- Hides the "This document has no text." message -->
|
---|
519 | <xsl:variable name="noText"><gsf:metadata name="NoText"/></xsl:variable>
|
---|
520 |
|
---|
521 | <!-- Section text -->
|
---|
522 | <xsl:for-each select="nodeContent">
|
---|
523 | <xsl:for-each select="node()">
|
---|
524 | <xsl:choose>
|
---|
525 | <xsl:when test="not(name())">
|
---|
526 | <xsl:if test="not($noText = '1')">
|
---|
527 | <xsl:value-of select="." disable-output-escaping="yes"/>
|
---|
528 | </xsl:if>
|
---|
529 | </xsl:when>
|
---|
530 | <xsl:otherwise>
|
---|
531 | <xsl:apply-templates select="."/>
|
---|
532 | </xsl:otherwise>
|
---|
533 | </xsl:choose>
|
---|
534 | </xsl:for-each>
|
---|
535 | </xsl:for-each><xsl:text> </xsl:text>
|
---|
536 | </xsl:template>
|
---|
537 |
|
---|
538 | <!-- This template is used to display the table of contents -->
|
---|
539 | <xsl:template match="documentNode" mode="TOC">
|
---|
540 |
|
---|
541 | <!-- check if this is the currently selected table of contents item -->
|
---|
542 | <xsl:variable name="isCurrent" select="nodeContent"/>
|
---|
543 |
|
---|
544 | <!-- formulate the link -->
|
---|
545 | <xsl:variable name="contentsLink">
|
---|
546 | <xsl:value-of select='$library_name'/>?a=d&c=<gslib:collectionNameShort/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&sib=1
|
---|
547 | </xsl:variable>
|
---|
548 |
|
---|
549 | <ul>
|
---|
550 | <table><tr>
|
---|
551 | <!-- The expand/collapse button (not displayed for the top level node) -->
|
---|
552 | <xsl:if test="util:hashToDepthClass(@nodeID) != 'sectionHeaderDepthTitle'">
|
---|
553 | <td>
|
---|
554 | <xsl:choose>
|
---|
555 | <xsl:when test="not(nodeContent and not(documentNode))">
|
---|
556 | <img id="ttoggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon">
|
---|
557 | <xsl:attribute name="src">
|
---|
558 | <xsl:choose>
|
---|
559 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID">
|
---|
560 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
561 | </xsl:when>
|
---|
562 | <xsl:otherwise>
|
---|
563 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
564 | </xsl:otherwise>
|
---|
565 | </xsl:choose>
|
---|
566 | </xsl:attribute>
|
---|
567 | </img>
|
---|
568 | </xsl:when>
|
---|
569 | <xsl:otherwise>
|
---|
570 | <xsl:attribute name="class">emptyIcon</xsl:attribute>
|
---|
571 | </xsl:otherwise>
|
---|
572 | </xsl:choose>
|
---|
573 | </td>
|
---|
574 | </xsl:if>
|
---|
575 |
|
---|
576 | <!-- The chapter/page icon -->
|
---|
577 | <td>
|
---|
578 | <img>
|
---|
579 | <xsl:if test="nodeContent and not(documentNode)">
|
---|
580 | <xsl:attribute name="class">leafNode</xsl:attribute>
|
---|
581 | </xsl:if>
|
---|
582 |
|
---|
583 | <xsl:attribute name="src">
|
---|
584 | <xsl:choose>
|
---|
585 | <xsl:when test="nodeContent and not(documentNode)">
|
---|
586 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'page_image')"/>
|
---|
587 | </xsl:when>
|
---|
588 | <xsl:otherwise>
|
---|
589 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'chapter_image')"/>
|
---|
590 | </xsl:otherwise>
|
---|
591 | </xsl:choose>
|
---|
592 | </xsl:attribute>
|
---|
593 | </img>
|
---|
594 | </td>
|
---|
595 |
|
---|
596 | <!-- The section name, links to the section in the document -->
|
---|
597 | <td>
|
---|
598 | <a id="toclink{@nodeID}">
|
---|
599 | <xsl:choose>
|
---|
600 | <xsl:when test="/page/pageResponse/document/@docType = 'paged'">
|
---|
601 | <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&d=<xsl:value-of select="@nodeID"/>&dt=<xsl:value-of select="@docType"/>&p.a=b&p.s=<xsl:value-of select="/page/pageResponse/service/@name"/></xsl:attribute>
|
---|
602 | </xsl:when>
|
---|
603 | <xsl:otherwise>
|
---|
604 | <xsl:attribute name="href">javascript:focusSection('<xsl:value-of select="@nodeID"/>');</xsl:attribute>
|
---|
605 | </xsl:otherwise>
|
---|
606 | </xsl:choose>
|
---|
607 | <xsl:if test="util:hashToSectionId(@nodeID)">
|
---|
608 | <xsl:value-of select="util:hashToSectionId(@nodeID)"/>
|
---|
609 | <xsl:text> </xsl:text>
|
---|
610 | </xsl:if>
|
---|
611 | <xsl:apply-templates select="." mode="sectionTitle"/>
|
---|
612 | </a>
|
---|
613 | </td>
|
---|
614 | </tr></table>
|
---|
615 |
|
---|
616 | <!-- display any child items -->
|
---|
617 | <xsl:if test="documentNode">
|
---|
618 | <li id="toc{@nodeID}">
|
---|
619 | <xsl:attribute name="style">
|
---|
620 | <xsl:choose>
|
---|
621 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'ed']/@value = '1' or /page/pageResponse/document/@selectedNode = @nodeID">
|
---|
622 | <xsl:text>display:block;</xsl:text>
|
---|
623 | </xsl:when>
|
---|
624 | <xsl:otherwise>
|
---|
625 | <xsl:text>display:none;</xsl:text>
|
---|
626 | </xsl:otherwise>
|
---|
627 | </xsl:choose>
|
---|
628 | </xsl:attribute>
|
---|
629 | <xsl:apply-templates select="documentNode" mode="TOC"/>
|
---|
630 | </li>
|
---|
631 | </xsl:if>
|
---|
632 |
|
---|
633 | </ul>
|
---|
634 | </xsl:template>
|
---|
635 |
|
---|
636 | <!-- Used to produce a version of the page in a format that can be read by the realistic books plugin -->
|
---|
637 | <xsl:template match="documentNode" mode="flashxml">
|
---|
638 | <xsl:text disable-output-escaping="yes">
|
---|
639 | <Section>
|
---|
640 | <Description>
|
---|
641 | <Metadata name="Title">
|
---|
642 | </xsl:text>
|
---|
643 | <xsl:value-of select="normalize-space(metadataList/metadata[@name = 'Title'])"/>
|
---|
644 | <xsl:text disable-output-escaping="yes">
|
---|
645 | </Metadata>
|
---|
646 | </Description>
|
---|
647 | </xsl:text>
|
---|
648 |
|
---|
649 | <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/>
|
---|
650 |
|
---|
651 | <xsl:if test="documentNode">
|
---|
652 | <xsl:apply-templates select="documentNode" mode="flashxml"/>
|
---|
653 | </xsl:if>
|
---|
654 |
|
---|
655 | <xsl:text disable-output-escaping="yes">
|
---|
656 | </Section>
|
---|
657 | </xsl:text>
|
---|
658 | </xsl:template>
|
---|
659 |
|
---|
660 | <xsl:template name="externalPage">
|
---|
661 | <xsl:param name="external"/>
|
---|
662 | <xsl:variable name="go_forward_link">
|
---|
663 | <a>
|
---|
664 | <xsl:attribute name="href">
|
---|
665 | <xsl:value-of select="$external"/>
|
---|
666 | </xsl:attribute>
|
---|
667 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/>
|
---|
668 | </a>
|
---|
669 | </xsl:variable>
|
---|
670 | <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
|
---|
671 | <p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/></p>
|
---|
672 | </xsl:template>
|
---|
673 |
|
---|
674 | <xsl:template match="/page"><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
|
---|
675 |
|
---|
676 | <xsl:template name="viewOptions">
|
---|
677 | <table class="viewOptions ui-state-default ui-corner-all"><tr>
|
---|
678 |
|
---|
679 | <!-- Paged-image options -->
|
---|
680 | <xsl:if test="count(//documentNode/metadataList/metadata[@name = 'Screen']) > 0 or /page/pageResponse/document/documentNode/@docType = 'paged'">
|
---|
681 | <td>
|
---|
682 | <select id="viewSelection" onchange="changeView();">
|
---|
683 | <xsl:choose>
|
---|
684 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'image'">
|
---|
685 | <option>Default view</option>
|
---|
686 | <option selected="true">Image view</option>
|
---|
687 | <option>Text view</option>
|
---|
688 | </xsl:when>
|
---|
689 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'view']/@value = 'text'">
|
---|
690 | <option>Default view</option>
|
---|
691 | <option>Image view</option>
|
---|
692 | <option selected="true">Text view</option>
|
---|
693 | </xsl:when>
|
---|
694 | <xsl:otherwise>
|
---|
695 | <option selected="true">Default view</option>
|
---|
696 | <option>Image view</option>
|
---|
697 | <option>Text view</option>
|
---|
698 | </xsl:otherwise>
|
---|
699 | </xsl:choose>
|
---|
700 | </select>
|
---|
701 | </td>
|
---|
702 | </xsl:if>
|
---|
703 |
|
---|
704 | <!-- Realistic books link -->
|
---|
705 | <xsl:if test="/page/pageResponse/collection[@name = $collName]/metadataList/metadata[@name = 'tidyoption'] = 'tidy'">
|
---|
706 | <td>
|
---|
707 | <img>
|
---|
708 | <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'realistic_books_image')"/></xsl:attribute>
|
---|
709 | </img>
|
---|
710 | <input id="rbOption" type="checkbox" onclick="bookInit();" class="optionCheckBox"/>
|
---|
711 | </td>
|
---|
712 | </xsl:if>
|
---|
713 |
|
---|
714 | <!-- Highlight on/off button -->
|
---|
715 | <xsl:if test="/page/pageRequest/paramList/param[@name = 'p.a']/@value = 'q' or /page/pageRequest/paramList/param[@name = 's1.query']">
|
---|
716 | <td>
|
---|
717 | <img>
|
---|
718 | <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'highlight_image')"/></xsl:attribute>
|
---|
719 | </img>
|
---|
720 | <input id="highlightOption" type="checkbox" class="optionCheckBox">
|
---|
721 | <xsl:choose>
|
---|
722 | <xsl:when test="/page/pageRequest/paramList/param[@name = 'hl']/@value = 'on'">
|
---|
723 | <xsl:attribute name="onclick">
|
---|
724 | <xsl:text>removeHighlight();</xsl:text>
|
---|
725 | </xsl:attribute>
|
---|
726 | <xsl:attribute name="checked">true</xsl:attribute>
|
---|
727 | </xsl:when>
|
---|
728 | <xsl:otherwise>
|
---|
729 | <xsl:attribute name="onclick">
|
---|
730 | <xsl:text>addHighlight();</xsl:text>
|
---|
731 | </xsl:attribute>
|
---|
732 | </xsl:otherwise>
|
---|
733 | </xsl:choose>
|
---|
734 | </input>
|
---|
735 | </td>
|
---|
736 | </xsl:if>
|
---|
737 | <td style="vertical-align:top; text-align:right;">
|
---|
738 | <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='TOC']) or /page/pageResponse/format[@type='display']/gsf:option[@name='TOC']/@value='true'">
|
---|
739 | <span class="tableOfContentsTitle"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.table_of_contents')"/></span>
|
---|
740 |
|
---|
741 | <a id="sidebarMinimizeButton" href="javascript:minimizeSidebar();" style="float: right; font-size:0.6em;">
|
---|
742 | <img class="icon" style="padding-top:3px;">
|
---|
743 | <xsl:attribute name="src">
|
---|
744 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'collapse_image')"/>
|
---|
745 | </xsl:attribute>
|
---|
746 | </img>
|
---|
747 | </a>
|
---|
748 | <a id="sidebarMaximizeButton" href="javascript:maximizeSidebar();" style="float: right; font-size:0.6em; display:none;">
|
---|
749 | <img class="icon" style="padding-top:3px;">
|
---|
750 | <xsl:attribute name="src">
|
---|
751 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/>
|
---|
752 | </xsl:attribute>
|
---|
753 | </img>
|
---|
754 | </a>
|
---|
755 | </xsl:if>
|
---|
756 | </td>
|
---|
757 | </tr>
|
---|
758 | <tr id="zoomOptions">
|
---|
759 | <xsl:attribute name="style">
|
---|
760 | <xsl:choose>
|
---|
761 | <xsl:when test="count(//documentNode/metadataList/metadata[@name = 'Screen']) > 0 and count(//documentNode/metadataList/metadata[@name = 'Source']) > 0">
|
---|
762 | <xsl:text>display: table-row;</xsl:text>
|
---|
763 | </xsl:when>
|
---|
764 | <xsl:otherwise>
|
---|
765 | <xsl:text>display: none;</xsl:text>
|
---|
766 | </xsl:otherwise>
|
---|
767 | </xsl:choose>
|
---|
768 | </xsl:attribute>
|
---|
769 | <td style="width:40%;">
|
---|
770 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.zoom')"/><input id="zoomToggle" type="checkbox"/>
|
---|
771 | <script type="text/javascript">
|
---|
772 | <xsl:text disable-output-escaping="yes">
|
---|
773 | $("#zoomToggle").change(function()
|
---|
774 | {
|
---|
775 | _imageZoomEnabled = !_imageZoomEnabled;
|
---|
776 | });
|
---|
777 | </xsl:text>
|
---|
778 | </script>
|
---|
779 | </td>
|
---|
780 | <td style="width:60%;">
|
---|
781 | <div>
|
---|
782 | <div style="float:left; width:30%;"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.zoom_size')"/><xsl:text>:</xsl:text></div>
|
---|
783 | <div id="zoomSlider" style="float:right; width:65%; height:5px; margin-top:6px;"><xsl:text> </xsl:text></div>
|
---|
784 | <script type="text/javascript">
|
---|
785 | <xsl:text disable-output-escaping="yes">
|
---|
786 | $("#zoomSlider").slider(
|
---|
787 | {
|
---|
788 | change: function(event, ui)
|
---|
789 | {
|
---|
790 | var sliderValue = ui.value;
|
---|
791 | var divs = document.getElementsByTagName("DIV");
|
---|
792 | for(var i = 0; i < divs.length; i++)
|
---|
793 | {
|
---|
794 | if(divs[i].getAttribute("id") && divs[i].getAttribute("id").search(/^mover.*/) != -1)
|
---|
795 | {
|
---|
796 | divs[i].style.height = 200 + (2 * sliderValue) + "px";
|
---|
797 | divs[i].style.width = 200 + (2 * sliderValue) + "px";
|
---|
798 | }
|
---|
799 | }
|
---|
800 | }
|
---|
801 | });
|
---|
802 | </xsl:text>
|
---|
803 | </script>
|
---|
804 | <style>.ui-slider .ui-slider-handle{height:0.8em; width:1.0em;}</style>
|
---|
805 | <div style="float:clear;"><xsl:text> </xsl:text></div>
|
---|
806 | </div>
|
---|
807 | </td>
|
---|
808 | </tr>
|
---|
809 | </table>
|
---|
810 | </xsl:template>
|
---|
811 |
|
---|
812 | <xsl:template name="documentPre">
|
---|
813 | <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
|
---|
814 | <xsl:call-template name="mapFeatures"/>
|
---|
815 | </xsl:if>
|
---|
816 | </xsl:template>
|
---|
817 |
|
---|
818 | <xsl:template name="mapFeatures">
|
---|
819 | <div id="map_canvas" class="map_canvas_full"><xsl:text> </xsl:text></div>
|
---|
820 |
|
---|
821 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
822 | <div style="background:#BBFFBB; padding: 5px; margin:0px auto; width:890px;">
|
---|
823 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.maps.nearby_docs')"/>
|
---|
824 | <img id="nearbyDocumentsToggle" src="interfaces/oran/images/expand.png">
|
---|
825 | <xsl:attribute name="onclick">
|
---|
826 | <xsl:text>performDistanceSearch('</xsl:text>
|
---|
827 | <xsl:value-of select="@nodeID"/>
|
---|
828 | <xsl:text>', '</xsl:text>
|
---|
829 | <gsf:metadata name="Latitude"/>
|
---|
830 | <xsl:text>', '</xsl:text>
|
---|
831 | <gsf:metadata name="Longitude"/>
|
---|
832 | <xsl:text>', 2);</xsl:text>
|
---|
833 | </xsl:attribute>
|
---|
834 | </img>
|
---|
835 | <div id="nearbyDocuments"><xsl:text> </xsl:text></div>
|
---|
836 | </div>
|
---|
837 | </xsl:if>
|
---|
838 |
|
---|
839 | <div id="jsonNodes" style="display:none;">
|
---|
840 | <xsl:text>[</xsl:text>
|
---|
841 | <xsl:for-each select="//documentNode">
|
---|
842 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
843 | <xsl:text>{</xsl:text>
|
---|
844 | <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
845 | <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>
|
---|
846 | <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>
|
---|
847 | <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
|
---|
848 | <xsl:text>}</xsl:text>
|
---|
849 | <xsl:if test="not(position() = count(//documentNode))">
|
---|
850 | <xsl:text>,</xsl:text>
|
---|
851 | </xsl:if>
|
---|
852 | </xsl:if>
|
---|
853 | </xsl:for-each>
|
---|
854 | <xsl:text>]</xsl:text>
|
---|
855 | </div>
|
---|
856 | </xsl:template>
|
---|
857 | </xsl:stylesheet>
|
---|