source: main/trunk/model-interfaces-dev/heritage-nz/transform/pages/classifier.xsl@ 33200

Last change on this file since 33200 was 33200, checked in by davidb, 5 years ago

Introduction of fix-to-the-side option for berry-basket, similar to TOC feature in documents

  • Property svn:mime-type set to application/xml
File size: 7.7 KB
Line 
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
12 <!-- set page title -->
13 <xsl:template name="pageTitle"><gslib:collectionNameLinked/><gslib:rightArrow/><gslib:serviceName/></xsl:template>
14
15
16 <!-- the page content -->
17 <xsl:template match="/page/pageResponse">
18 <xsl:call-template name="classifierPre"/>
19
20 <script type="text/javascript" src="interfaces/{$interface_name}/js/classifier_scripts.js"><xsl:text> </xsl:text></script>
21 <script type="text/javascript">$(window).load(openStoredClassifiers);</script>
22
23 <!-- **** Customized **** -->
24 <xsl:variable name="clName"><xsl:value-of select="classifier/@name"/></xsl:variable>
25 <xsl:variable name="floatRightWidth">
26 <xsl:choose>
27 <xsl:when test="$clName = 'CL4'">20</xsl:when>
28 <xsl:otherwise>20</xsl:otherwise> <!-- used to be 30 -->
29 </xsl:choose>
30 </xsl:variable>
31 <xsl:variable name="floatLeftWidth">
32 <xsl:choose>
33 <xsl:when test="$clName = 'CL4'">58</xsl:when>
34 <xsl:otherwise>77</xsl:otherwise> <!-- used to be 67 -->
35 </xsl:choose>
36 </xsl:variable>
37
38 <!-- **** Customized **** -->
39 <div id="float-anchor" style="width: {$floatRightWidth}%; min-width:180px; float:right; margin: 0 0 10px 20px;">
40
41 <!-- this right sidebar -->
42 <div id="rightSidebar">
43 <xsl:comment>Filler needed for div</xsl:comment>
44 <xsl:call-template name="viewOptions"/>
45 <xsl:if test="$berryBasketOn or ($documentBasketOn 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)))">
46 <xsl:if test="$berryBasketOn">
47 <!-- show the berry basket if it's turned on -->
48 <div class="tableOfContentsContainer" style="position:relative; z-index: 2;"> <!-- **** -->
49 <gslib:berryBasket/>
50 <xsl:text> </xsl:text>
51 </div>
52 </xsl:if>
53
54 <xsl:if test="$documentBasketOn">
55 <gslib:documentBasket/>
56 <xsl:text> </xsl:text>
57 </xsl:if>
58 </xsl:if>
59 </div>
60 </div>
61
62 <!--
63 show the clasifier results -
64 you can change the appearance of the results by editing
65 the two templates at the bottom of this file
66 -->
67 <!-- **** Customized **** -->
68 <div id="results" style="width: {$floatLeftWidth}%">
69 <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
70 <xsl:variable name="serviceName"><xsl:value-of select="service/@name"/></xsl:variable>
71
72 <xsl:call-template name="classifierResultsPre"/>
73
74 <xsl:apply-templates select="classifier">
75 <xsl:with-param name="collName" select="$collName"/>
76 <xsl:with-param name="serviceName" select="$serviceName"/>
77 </xsl:apply-templates>
78 </div>
79
80 <div class="clear"><xsl:text> </xsl:text></div>
81 </xsl:template>
82
83
84
85 <xsl:template name="viewOptions">
86
87 <div id="viewAndZoomOptions" class="ui-state-default ui-corner-all">
88 <ul id="viewOptions">
89
90 <!-- Zoom on/off button -->
91
92 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']) or /page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']/@value='false'">
93
94 <!-- **** Customized **** -->
95 <xsl:variable name="clName"><xsl:value-of select="classifier/@name"/></xsl:variable>
96 <xsl:if test="$clName = 'CL4'">
97 <li id="zoomOptions" style="display:none;">
98<!--
99 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.zoomTooltip')"/></xsl:attribute>
100-->
101 <xsl:attribute name="title">Enable/disable Zoom feature over map</xsl:attribute>
102 <img id="zoomToggleImage">
103 <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'zoom_image')"/></xsl:attribute>
104 </img>
105
106 <input id="zoomToggle" type="checkbox" checked="checked"/>
107 <script type="text/javascript">
108 <xsl:text disable-output-escaping="yes">
109 $("#zoomToggle").change(function()
110 {
111 //console.log("**** zoomToggle.change()");
112 _imageZoomEnabled = $("#zoomToggle").prop("checked");
113 //console.log("**** imageZoomEnable now = " + _imageZoomEnabled);
114 });
115
116 $("#zoomToggleImage").click(function()
117 {
118 //console.log("**** zoomToggle.click()");
119 $("#zoomToggle").prop("checked", !$("#zoomToggle").prop("checked"));
120 _imageZoomEnabled = $("#zoomToggle").prop("checked");
121 //console.log("**** imageZoomEnable now = " + _imageZoomEnabled);
122 });
123 </xsl:text>
124 </script>
125 </li>
126 </xsl:if>
127 </xsl:if>
128
129
130 <!-- Floating TOC on/off button -->
131 <xsl:if test="$berryBasketOn">
132 <li id="floatingTOCOptions">
133<!--
134 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.floatingTooltip')"/></xsl:attribute>
135-->
136 <xsl:attribute name="title">Fix the berry basket to the right side of the screen</xsl:attribute>
137 <img id="floatTOCToggleImage">
138 <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'float_berrybasket_image')"/></xsl:attribute>
139 </img>
140
141 <input id="floatTOCToggle" type="checkbox"/>
142 <script type="text/javascript">
143 <xsl:text disable-output-escaping="yes">
144 $("#floatTOCToggle").prop("checked", false);
145 $("#floatTOCToggle").click(function()
146 {
147 floatMenu($("#floatTOCToggle").prop("checked"));
148 });
149
150 $("#floatTOCToggleImage").click(function()
151 {
152 $("#floatTOCToggle").prop("checked", !$("#floatTOCToggle").prop("checked"))
153 floatMenu($("#floatTOCToggle").prop("checked"));
154 });
155 </xsl:text>
156 </script>
157 </li>
158 <xsl:if test="/page/pageRequest/paramList/param[@name='ftoc']/@value = '1'">
159 <script type="text/javascript">
160 <xsl:text disable-output-escaping="yes">
161 $(window).load(function()
162 {
163 $("#floatTOCToggle").prop("checked", true);
164 floatMenu(true);
165 });
166 </xsl:text>
167 </script>
168 </xsl:if>
169 </xsl:if>
170 </ul>
171 <div style="clear:both;"><xsl:text> </xsl:text></div>
172 </div>
173 </xsl:template>
174
175
176
177
178 <xsl:template match="classifier">
179 <xsl:param name="collName"/>
180 <xsl:param name="serviceName"/>
181 <div id="classifiers">
182 <!-- **** Customized **** -->
183 <xsl:variable name="clName"><xsl:value-of select="@name"/></xsl:variable>
184 <xsl:choose>
185 <xsl:when test="@childType = 'HList'">
186 <xsl:call-template name="HList">
187 <xsl:with-param name='collName' select='$collName'/>
188 <xsl:with-param name='serviceName' select='$serviceName'/>
189 </xsl:call-template>
190 </xsl:when>
191 <xsl:otherwise>
192 <!-- **** Customized **** -->
193 <div style="position: relative">
194 <xsl:if test="$clName = 'CL4'">
195 <!--
196 width="1380.2666"
197 height="1746.2094"
198 -->
199 <iframe src="interfaces/{$interface_name}/iframe/nz-territories.svg"
200 style="float:right; width: 345px; height: 436px; border: none; ">
201 <gsf:comment>filler</gsf:comment>
202 </iframe>
203 </xsl:if>
204
205 <table id="classifiernodelist">
206 <xsl:text> </xsl:text>
207 <xsl:call-template name="processNodeChildren">
208 <xsl:with-param name='collName' select='$collName'/>
209 <xsl:with-param name='serviceName' select='$serviceName'/>
210 </xsl:call-template>
211 </table>
212 </div>
213 </xsl:otherwise>
214 </xsl:choose>
215 </div>
216 </xsl:template>
217
218
219</xsl:stylesheet>
220
Note: See TracBrowser for help on using the repository browser.