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