Changeset 38258 for main/trunk/greenstone3/web
- Timestamp:
- 2023-09-30T21:32:17+13:00 (8 months ago)
- Location:
- main/trunk/greenstone3/web/interfaces/default/transform
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/javascript-global-setup.xsl
r38256 r38258 167 167 if (typeof gs.userInformation === "undefined") { 168 168 gs.userInformation={}; 169 gs.userInformation.username = "</xsl:text><xsl:value-of select="/page/pageRequest/userContext/@username"/><xsl:text disable-output-escaping="yes">";170 gs.userInformation.groups = "</xsl:text><xsl:value-of select="/page/pageRequest/userContext/@groups"/><xsl:text disable-output-escaping="yes">";171 169 } 170 gs.userInformation.username = "</xsl:text><xsl:value-of select="/page/pageRequest/userContext/@username"/><xsl:text disable-output-escaping="yes">"; 171 gs.userInformation.groups = "</xsl:text><xsl:value-of select="/page/pageRequest/userContext/@groups"/><xsl:text disable-output-escaping="yes">"; 172 172 173 gs.userInformation.uid = "</xsl:text><xsl:value-of select="/page/pageRequest/userContext/@uid"/><xsl:text disable-output-escaping="yes">"; 173 174 </xsl:text> -
main/trunk/greenstone3/web/interfaces/default/transform/pages/webswing-gli.xsl
r38256 r38258 100 100 </div> 101 101 102 <gsf:script> 102 <gsf:script> 103 console.log("username " + gs.userInformation.username); 104 console.log("groups " + gs.userInformation.groups); 105 console.log("uid " + gs.userInformation.uid); 106 103 107 var webswingInstance0 = { 104 108 options: { … … 123 127 $('#webswing-gli').css("cursor",cursor_type); 124 128 } 129 else if (actionName == "jsConsoleLog") { 130 console.log("Got message from java:\n" + data); 131 } 125 132 } 126 133 } … … 132 139 webswingInstance0.options.args = "-load " + gs.cgiParams.c + "/gli.col"; 133 140 } 134 if(gs.userInformation.uid) { 135 webswingInstance0.options.args = " -username " + gs.userInformation.username; 136 webswingInstance0.options.args = " -groups " + gs.userInformation.groups.replace(/\s/g, ''); 137 webswingInstance0.options.args = " -uid " + gs.userInformation.uid; 141 if(gs.userInformation.username && gs.userInformation.uid) { // true if defined and not empty string etc 142 // doing "args +=" adds "undefined" parameter iff it's first argument attached to webswing customArgs 143 // This then has the effect of switching of the previous argument, -webswing 144 if (gs.cgiParams.c) { 145 webswingInstance0.options.args += " -username " + gs.userInformation.username; 146 } else { 147 webswingInstance0.options.args = "-username " + gs.userInformation.username; 148 } 149 webswingInstance0.options.args += " -groups " + gs.userInformation.groups.replace(/\s/g, ''); 150 webswingInstance0.options.args += " -uid " + gs.userInformation.uid; 138 151 } 139 152 function getParam(name) {
Note:
See TracChangeset
for help on using the changeset viewer.