Ignore:
Timestamp:
2024-04-30T18:49:50+12:00 (7 weeks ago)
Author:
anupama
Message:

Certain user-customised GLI Collage classifier options need to go into the pageResponse to be incorporated into the applet shim. 1. buildConfigxml.pm modified to push these options out into buildConfig.xml. 2. AbstractBrowse.java (classifier Service) has been modified to push out any classifier option subelements out into the pageResponse. 3. classifier.xsl has been modified to construct its applet HTML element's parameter elements taking into account any customised values in the pageResponse or using the old defaults for fallback. 4. The JavaScript code in webswing-collage.xsl doesn't have ready access to the pageResponse elements (this may need revisiting for if the applet element was accidentally removed from the page), but was already taking into account any applet parameters. webswing-collage.xsl has been modified to use any static/dynamic width and height attributes set on the applet parameter to reset the width and height on the div id=webswing-collage element, as webswing uses the dimensions set on the HTML element housing the webswing instance if running the instance as an applet. It does not resize the webswing applet thereafter. So the most transparent way to allow the user customised dimensions to control the dimensions of the webswing application as intended by the user, is to modify the dimensions set on the webswing-collage element's div before launching the webswing application.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/layouts/webswing-collage.xsl

    r38956 r38964  
    164164       webswingParams["height"] = stripUnitOffAttribute("px", h);
    165165
    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
    167173       // Having collected all the webswingParams, we can finally build up the single webswing customArgs string
    168174       var _args = "";
Note: See TracChangeset for help on using the changeset viewer.