Changeset 38964 for main/trunk/greenstone3/web/interfaces/default
- Timestamp:
- 2024-04-30T18:49:50+12:00 (3 weeks ago)
- Location:
- main/trunk/greenstone3/web/interfaces/default/transform
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/layouts/webswing-collage.xsl
r38956 r38964 164 164 webswingParams["height"] = stripUnitOffAttribute("px", h); 165 165 166 166 // Webswing only uses the width and height set on the webswing-collage element 167 // Override this with any dimensions set on any applet element, as that is user-controlled 168 // from GLI. style.setProperty failed without the important parameter to force the setting. 169 // https://stackoverflow.com/questions/5191478/changing-element-style-attribute-dynamically-using-javascript 170 document.getElementById("webswing-collage").style.setProperty("width", webswingParams["width"] + "px", "important"); 171 document.getElementById("webswing-collage").style.setProperty("height", webswingParams["height"] + "px", "important"); 172 167 173 // Having collected all the webswingParams, we can finally build up the single webswing customArgs string 168 174 var _args = ""; -
main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl
r38950 r38964 151 151 <xsl:template name="collage-applet-shim"> 152 152 <!--<xsl:text>TODO: Here is the collage applet</xsl:text>--> 153 153 154 <!-- Copied from GS2.88's about.dm (document.dm has more applet params). 154 155 … … 173 174 id="collage-applet-element" 174 175 code="org.greenstone.applet.GsdlCollageApplet.GsdlCollageApplet.class" 175 archive="GsdlCollageApplet.jar, webswing-api.jar" 176 width="800" 177 height="400"> 176 archive="GsdlCollageApplet.jar, webswing-api.jar"> 178 177 <xsl:attribute name="codebase">/<xsl:value-of select="$servlet_context"/>/applet</xsl:attribute> 179 178 <xsl:choose> 179 <xsl:when test="option[@name='geometry']/@value"> 180 <xsl:attribute name="width"> 181 <xsl:value-of select="substring-before(option[@name='geometry']/@value, 'x')" /> 182 </xsl:attribute> 183 <xsl:attribute name="height"> 184 <xsl:value-of select="substring-after(option[@name='geometry']/@value, 'x')" /> 185 </xsl:attribute> 186 </xsl:when> 187 </xsl:choose> 188 180 189 <!-- declaring some local variables --> 181 190 <xsl:variable name="coll_name"> … … 183 192 </xsl:variable> 184 193 <xsl:variable name="classifier"> 185 194 <xsl:value-of select="/page/pageRequest/paramList/param[@name='cl']/@value"/> 186 195 </xsl:variable> 187 196 <xsl:variable name="fullURL"> 188 197 <xsl:value-of select="/page/pageRequest/@fullURL"/> 189 198 </xsl:variable> 190 199 <xsl:variable name="url_protocol_prefix"> 191 192 </xsl:variable> 193 200 <xsl:value-of select="substring-before (/page/pageRequest/@fullURL,'/')"/> 201 </xsl:variable> 202 194 203 <!-- setting the applet parameters: first the dynamic ones --> 195 204 … … 218 227 219 228 <!-- applet parameters that can be manually adjusted --> 220 <param name="imageType" value=".jpg%.png" /> 229 <!-- 230 <param name="imageType" value=".jpg%.png" /> 221 231 <param name="verbosity" value="3" /> 222 232 <param name="maxDepth" value="500"/> … … 225 235 <param name="isJava2" value="auto"/> 226 236 <param name="bgcolor" value="#96c29a" /> 227 The Collage Applet. 228 237 --> 238 <!--<param name="imageType" value="{option[@name='imageType']/@value}" />--> 239 <xsl:call-template name="add-applet-param"> 240 <xsl:with-param name="paramName">imageType</xsl:with-param> 241 <xsl:with-param name="paramDefaultValue">.jpg%.png</xsl:with-param> 242 </xsl:call-template> 243 <xsl:call-template name="add-applet-param"> 244 <xsl:with-param name="paramName">verbosity</xsl:with-param> 245 <xsl:with-param name="paramDefaultValue">3</xsl:with-param> 246 </xsl:call-template> 247 <xsl:call-template name="add-applet-param"> 248 <xsl:with-param name="paramName">maxDepth</xsl:with-param> 249 <xsl:with-param name="paramDefaultValue">500</xsl:with-param> 250 </xsl:call-template> 251 <xsl:call-template name="add-applet-param"> 252 <xsl:with-param name="paramName">maxDisplay</xsl:with-param> 253 <xsl:with-param name="paramDefaultValue">25</xsl:with-param> 254 </xsl:call-template> 255 <xsl:call-template name="add-applet-param"> 256 <xsl:with-param name="paramName">refreshDelay</xsl:with-param> 257 <xsl:with-param name="paramDefaultValue">1500</xsl:with-param> 258 </xsl:call-template> 259 <xsl:call-template name="add-applet-param"> 260 <xsl:with-param name="paramName">isJava2</xsl:with-param> 261 <xsl:with-param name="paramDefaultValue">auto</xsl:with-param> 262 </xsl:call-template> 263 <xsl:call-template name="add-applet-param"> 264 <xsl:with-param name="paramName">bgcolor</xsl:with-param> 265 <xsl:with-param name="paramDefaultValue">#96c29a</xsl:with-param> 266 </xsl:call-template> 267 The Collage Applet. 229 268 </applet> 230 269 </xsl:template> 231 270 271 <!-- https://our.umbraco.com/forum/developers/xslt/9274-Return-Value-from-a-Template --> 272 <xsl:template name="add-applet-param"> 273 <xsl:param name = "paramName" /> 274 <xsl:param name = "paramDefaultValue" /> 275 <param name="{$paramName}"> 276 <xsl:attribute name="value"> 277 <xsl:choose> 278 <xsl:when test="option[@name=$paramName]/@value"> 279 <xsl:value-of select="option[@name=$paramName]/@value"/> 280 </xsl:when> 281 <xsl:otherwise> 282 <xsl:value-of select="$paramDefaultValue"/> 283 </xsl:otherwise> 284 </xsl:choose> 285 </xsl:attribute> 286 </param> 287 </xsl:template> 288 289 232 290 <xsl:template name="Collage_javascript_deprecated"> 233 291 <script type="text/javascript" src="interfaces/{$interface_name}/js/collage_scripts.js"><xsl:text> </xsl:text></script> … … 348 406 <xsl:when test="@childType = 'Collage'"> 349 407 <xsl:choose> 350 <xsl:when test="not(*)"> 408 <!--test of not(*) means has no children, not(classNode) has no subelements classNode--> 409 <xsl:when test="not(classifierNode)"> 351 410 <!-- the order of calling these templates now matters since the collage applet now 352 411 serves as a shim in the javascript that gets loaded in the 2nd template call:
Note:
See TracChangeset
for help on using the changeset viewer.