Commit 64e898cf authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Fixed bug in gateway settings page (unable to enable/disable transports)

Cosmetic tweaks.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@6423 b35dd754-fafc-0310-a699-88a17e54d16e
parent 45dbbfad
...@@ -144,6 +144,7 @@ ...@@ -144,6 +144,7 @@
## Added key: 'gateway.irc.errorreceivedwithcode' ## Added key: 'gateway.irc.errorreceivedwithcode'
## Added key: 'gateway.base.notloggedin' ## Added key: 'gateway.base.notloggedin'
## Added key: 'gateway.base.enterusername' ## Added key: 'gateway.base.enterusername'
## Added key: 'gateway.web.settings.cancelledchanges'
# Temporary Tags Until Fixed Properly # Temporary Tags Until Fixed Properly
...@@ -247,6 +248,7 @@ gateway.web.settings.groups=Groups ...@@ -247,6 +248,7 @@ gateway.web.settings.groups=Groups
gateway.web.settings.savepermissions=Save Permissions gateway.web.settings.savepermissions=Save Permissions
gateway.web.settings.title=Gateway Settings gateway.web.settings.title=Gateway Settings
gateway.web.settings.settingssaved=Settings Saved gateway.web.settings.settingssaved=Settings Saved
gateway.web.settings.cancelledchanges=Cancelled Changes
gateway.web.settings.success=Success gateway.web.settings.success=Success
gateway.web.settings.failed=Failed gateway.web.settings.failed=Failed
gateway.web.settings.permissionssaved=Permissions Saved gateway.web.settings.permissionssaved=Permissions Saved
......
...@@ -104,6 +104,7 @@ gateway.web.settings.groups=Groups ...@@ -104,6 +104,7 @@ gateway.web.settings.groups=Groups
gateway.web.settings.savepermissions=Save Permissions gateway.web.settings.savepermissions=Save Permissions
gateway.web.settings.title=Gateway Settings gateway.web.settings.title=Gateway Settings
gateway.web.settings.settingssaved=Settings Saved gateway.web.settings.settingssaved=Settings Saved
gateway.web.settings.cancelledchanges=Cancelled Changes
gateway.web.settings.success=Success gateway.web.settings.success=Success
gateway.web.settings.failed=Failed gateway.web.settings.failed=Failed
gateway.web.settings.permissionssaved=Permissions Saved gateway.web.settings.permissionssaved=Permissions Saved
......
...@@ -96,11 +96,11 @@ public class ConfigManager { ...@@ -96,11 +96,11 @@ public class ConfigManager {
Attribute type = node.attribute("type"); Attribute type = node.attribute("type");
if (type.getText().equals("text")) { if (type.getText().equals("text")) {
// Required fields // Required fields
Attribute desc = node.attribute("desc"); Attribute desckey = node.attribute("desckey");
Attribute var = node.attribute("var"); Attribute var = node.attribute("var");
Attribute sysprop = node.attribute("sysprop"); Attribute sysprop = node.attribute("sysprop");
if (desc == null || var == null || sysprop == null) { if (desckey == null || var == null || sysprop == null) {
Log.error("Missing variable from options config."); Log.error("Missing variable from options config.");
return; return;
} }
...@@ -118,11 +118,11 @@ public class ConfigManager { ...@@ -118,11 +118,11 @@ public class ConfigManager {
} }
else if (type.getText().equals("toggle")) { else if (type.getText().equals("toggle")) {
// Required fields // Required fields
Attribute desc = node.attribute("desc"); Attribute desckey = node.attribute("desckey");
Attribute var = node.attribute("var"); Attribute var = node.attribute("var");
Attribute sysprop = node.attribute("sysprop"); Attribute sysprop = node.attribute("sysprop");
if (desc == null || var == null || sysprop == null) { if (desckey == null || var == null || sysprop == null) {
Log.error("Missing variable from options config."); Log.error("Missing variable from options config.");
return; return;
} }
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
<!-- BEGIN gateway - <%= this.gatewayType.toString().toUpperCase() %> --> <!-- BEGIN gateway - <%= this.gatewayType.toString().toUpperCase() %> -->
<div <%= ((!this.gwEnabled) ? " class='jive-gateway jive-gatewayDisabled'" : "class='jive-gateway'") %> id="jive<%= this.gatewayType.toString().toUpperCase() %>"> <div <%= ((!this.gwEnabled) ? " class='jive-gateway jive-gatewayDisabled'" : "class='jive-gateway'") %> id="jive<%= this.gatewayType.toString().toUpperCase() %>">
<label for="jive<%= this.gatewayType.toString().toUpperCase() %>checkbox"> <label for="jive<%= this.gatewayType.toString().toUpperCase() %>checkbox">
<input type="checkbox" name="gateway" value="<%= this.gatewayType.toString().toLowerCase() %>" id="jive<%= this.gatewayType.toString().toUpperCase() %>checkbox" <%= ((this.gwEnabled) ? "checked" : "") %> onClick="ConfigManager.toggleTransport('<%= this.gatewayType.toString().toLowerCase() %>'); checkToggle('jive<%= this.gatewayType.toString().toUpperCase() %>'); return true"> <input type="checkbox" name="gateway" value="<%= this.gatewayType.toString().toLowerCase() %>" id="jive<%= this.gatewayType.toString().toUpperCase() %>checkbox" <%= ((this.gwEnabled) ? "checked" : "") %> onClick="ConfigManager.toggleTransport('<%= this.gatewayType.toString().toLowerCase() %>'); checkToggle(jive<%= this.gatewayType.toString().toUpperCase() %>); return true">
<img src="images/<%= this.gatewayType.toString().toLowerCase() %>.gif" alt="" border="0"> <img src="images/<%= this.gatewayType.toString().toLowerCase() %>.gif" alt="" border="0">
<strong><%= this.description %></strong> <strong><%= this.description %></strong>
</label> </label>
...@@ -259,8 +259,8 @@ ...@@ -259,8 +259,8 @@
<span style="font-weight: bold"><%= LocaleUtils.getLocalizedString("gateway.web.settings.connecttohost", "gateway") %>:</span> <span id="<%= this.gatewayType.toString() %>testhost"><%= connectHost %></span><br /> <span style="font-weight: bold"><%= LocaleUtils.getLocalizedString("gateway.web.settings.connecttohost", "gateway") %>:</span> <span id="<%= this.gatewayType.toString() %>testhost"><%= connectHost %></span><br />
<span style="font-weight: bold"><%= LocaleUtils.getLocalizedString("gateway.web.settings.connecttoport", "gateway") %>:</span> <span id="<%= this.gatewayType.toString() %>testport"><%= connectPort %></span><br /> <span style="font-weight: bold"><%= LocaleUtils.getLocalizedString("gateway.web.settings.connecttoport", "gateway") %>:</span> <span id="<%= this.gatewayType.toString() %>testport"><%= connectPort %></span><br />
<input type="submit" name="submit" value="<%= LocaleUtils.getLocalizedString("gateway.web.settings.testconnection", "gateway") %>" onclick="testConnect('<%= this.gatewayType.toString() %>'); return false" class="jive-formButton">
<span id="<%= this.gatewayType.toString() %>testsresults" class="saveResultsMsg"></span> <span id="<%= this.gatewayType.toString() %>testsresults" class="saveResultsMsg"></span>
<input type="submit" name="submit" value="<%= LocaleUtils.getLocalizedString("gateway.web.settings.testconnection", "gateway") %>" onclick="testConnect('<%= this.gatewayType.toString() %>'); return false" class="jive-formButton">
</form> </form>
</div> </div>
</div> </div>
...@@ -302,16 +302,17 @@ ...@@ -302,16 +302,17 @@
</td> </td>
</tr> </tr>
</table> </table>
<input type="submit" name="submit" value="<%= LocaleUtils.getLocalizedString("gateway.web.settings.saveoptions", "gateway") %>" onclick="saveOptions('<%= this.gatewayType.toString() %>'); return false" class="jive-formButton">
<input type="reset" name="cancel" value="<%= LocaleUtils.getLocalizedString("gateway.web.settings.cancelchanges", "gateway") %>" class="jive-formButton">
<span id="<%= this.gatewayType.toString() %>optionsresults" class="saveResultsMsg"></span> <span id="<%= this.gatewayType.toString() %>optionsresults" class="saveResultsMsg"></span>
<input type="submit" name="submit" value="<%= LocaleUtils.getLocalizedString("gateway.web.settings.saveoptions", "gateway") %>" onclick="saveOptions('<%= this.gatewayType.toString() %>'); return false" class="jive-formButton">
<input type="reset" name="cancel" value="<%= LocaleUtils.getLocalizedString("gateway.web.settings.cancelchanges", "gateway") %>" onclick="cancelOptions('<%= this.gatewayType.toString() %>'); return true" class="jive-formButton">
</form> </form>
</div> </div>
</div> </div>
<!-- Permissions Window --> <!-- Permissions Window -->
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>perms" style="display: none;" onSubmit="return false"> <div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>perms" style="display: none;">
<div> <div>
<form id="jive<%= this.gatewayType.toString().toUpperCase() %>permsform" action=""> <form id="jive<%= this.gatewayType.toString().toUpperCase() %>permsform" action="" onSubmit="return false">
<input type="radio" name="<%= this.gatewayType.toString() %>userreg" value="all" onClick="hideSpecificChoices('<%= this.gatewayType.toString() %>')" <%= (this.globalPermSetting == 1 ? "checked='checked'" : "") %> /> <%= LocaleUtils.getLocalizedString("gateway.web.settings.registerall", "gateway") %><br> <input type="radio" name="<%= this.gatewayType.toString() %>userreg" value="all" onClick="hideSpecificChoices('<%= this.gatewayType.toString() %>')" <%= (this.globalPermSetting == 1 ? "checked='checked'" : "") %> /> <%= LocaleUtils.getLocalizedString("gateway.web.settings.registerall", "gateway") %><br>
<input type="radio" name="<%= this.gatewayType.toString() %>userreg" value="specific" onClick="showSpecificChoices('<%= this.gatewayType.toString() %>')" <%= (this.globalPermSetting == 2 ? "checked='checked'" : "") %> /> <%= LocaleUtils.getLocalizedString("gateway.web.settings.registersome", "gateway") %><br> <input type="radio" name="<%= this.gatewayType.toString() %>userreg" value="specific" onClick="showSpecificChoices('<%= this.gatewayType.toString() %>')" <%= (this.globalPermSetting == 2 ? "checked='checked'" : "") %> /> <%= LocaleUtils.getLocalizedString("gateway.web.settings.registersome", "gateway") %><br>
<div id="<%= this.gatewayType.toString() %>userreg_specific" style="<%= (this.globalPermSetting == 2 ? "" : "display: none; ") %>margin: 0; padding: 0; font-size: 80%"> <div id="<%= this.gatewayType.toString() %>userreg_specific" style="<%= (this.globalPermSetting == 2 ? "" : "display: none; ") %>margin: 0; padding: 0; font-size: 80%">
...@@ -332,9 +333,9 @@ ...@@ -332,9 +333,9 @@
</div> </div>
<input type="radio" name="<%= this.gatewayType.toString() %>userreg" value="manual" onClick="hideSpecificChoices('<%= this.gatewayType.toString() %>')" <%= (this.globalPermSetting == 3 ? "checked='checked'" : "") %> /> <%= LocaleUtils.getLocalizedString("gateway.web.settings.registernone", "gateway") %><br> <input type="radio" name="<%= this.gatewayType.toString() %>userreg" value="manual" onClick="hideSpecificChoices('<%= this.gatewayType.toString() %>')" <%= (this.globalPermSetting == 3 ? "checked='checked'" : "") %> /> <%= LocaleUtils.getLocalizedString("gateway.web.settings.registernone", "gateway") %><br>
<span id="<%= this.gatewayType.toString() %>permsresults" class="saveResultsMsg"></span>
<input type="submit" name="submit" value="<%= LocaleUtils.getLocalizedString("gateway.web.settings.savepermissions", "gateway") %>" onclick="savePermissions('<%= this.gatewayType.toString() %>'); return false" class="jive-formButton"> <input type="submit" name="submit" value="<%= LocaleUtils.getLocalizedString("gateway.web.settings.savepermissions", "gateway") %>" onclick="savePermissions('<%= this.gatewayType.toString() %>'); return false" class="jive-formButton">
<input type="reset" name="cancel" value="<%= LocaleUtils.getLocalizedString("gateway.web.settings.cancelchanges", "gateway") %>" onclick="cancelPermissions('<%= this.gatewayType.toString() %>'); return true" class="jive-formButton"> <input type="reset" name="cancel" value="<%= LocaleUtils.getLocalizedString("gateway.web.settings.cancelchanges", "gateway") %>" onclick="cancelPermissions('<%= this.gatewayType.toString() %>'); return true" class="jive-formButton">
<span id="<%= this.gatewayType.toString() %>permsresults" class="saveResultsMsg"></span>
</form> </form>
</div> </div>
</div> </div>
...@@ -406,6 +407,12 @@ ...@@ -406,6 +407,12 @@
setTimeout("to_saveOptions('"+transportID+"')", 5000); setTimeout("to_saveOptions('"+transportID+"')", 5000);
} }
function cancelOptions(transportID) {
document.getElementById(transportID+"optionsresults").style.display = "";
document.getElementById(transportID+"optionsresults").innerHTML = "<span class='warningresults'><img src='images/warning-16x16.gif' align='absmiddle' /><fmt:message key='gateway.web.settings.cancelledchanges' /></span>";
setTimeout("to_saveOptions('"+transportID+"')", 5000);
}
function to_saveOptions(transportID) { function to_saveOptions(transportID) {
Effect.Fade(transportID+"optionsresults"); Effect.Fade(transportID+"optionsresults");
} }
...@@ -462,7 +469,7 @@ ...@@ -462,7 +469,7 @@
deactivateModifyUsers(transportID); deactivateModifyUsers(transportID);
deactivateModifyGroups(transportID); deactivateModifyGroups(transportID);
document.getElementById(transportID+"permsresults").style.display = ""; document.getElementById(transportID+"permsresults").style.display = "";
document.getElementById(transportID+"permsresults").innerHTML = "<span class='warningresults'><img src='images/warning-16x16.gif' align='absmiddle' /><fmt:message key='gateway.web.settings.cancelchanges' /></span>"; document.getElementById(transportID+"permsresults").innerHTML = "<span class='warningresults'><img src='images/warning-16x16.gif' align='absmiddle' /><fmt:message key='gateway.web.settings.cancelledchanges' /></span>";
setTimeout("to_savePermissions('"+transportID+"')", 5000); setTimeout("to_savePermissions('"+transportID+"')", 5000);
} }
......
...@@ -62,14 +62,8 @@ function checkToggle(theID) { ...@@ -62,14 +62,8 @@ function checkToggle(theID) {
$(testLink).style.display = 'block'; $(testLink).style.display = 'block';
$(optsLink).style.display = 'block'; $(optsLink).style.display = 'block';
$(permLink).style.display = 'block'; $(permLink).style.display = 'block';
/* the below doesn't work right in IE, work on later */
//$(optsLink).setAttribute('onclick',"togglePanel($(optsPanel),$(permPanel))");
//$(permLink).setAttribute('onclick',"togglePanel($(permPanel),$(optsPanel))");
} else { } else {
$(theID).className = "jive-gateway jive-gatewayDisabled"; $(theID).className = "jive-gateway jive-gatewayDisabled";
/* the below doesn't work right in IE, work on later */
//$(optsLink).removeAttribute('onclick');
//$(permLink).removeAttribute('onclick');
$(testLink).style.display = 'none'; $(testLink).style.display = 'none';
$(optsLink).style.display = 'none'; $(optsLink).style.display = 'none';
$(permLink).style.display = 'none'; $(permLink).style.display = 'none';
......
...@@ -103,14 +103,15 @@ a.jive-gatewayButtonOn { ...@@ -103,14 +103,15 @@ a.jive-gatewayButtonOn {
.saveResultsMsg { .saveResultsMsg {
margin: 10px 5px 5px 0px; margin: 10px 5px 5px 0px;
padding: 0px; padding: 0px;
padding-top: 2px;
font-weight: bold; font-weight: bold;
float: right;
} }
.saveResultsMsg .successresults { .saveResultsMsg .successresults {
border: 1.0px solid #009900; border: 1.0px solid #009900;
background-color: #aaffaa; background-color: #aaffaa;
color: #009900; color: #009900;
padding: 3.0px; padding: 3.0px;
float: right;
} }
.saveResultsMsg .successresults img { .saveResultsMsg .successresults img {
margin-right: 3px; margin-right: 3px;
...@@ -121,7 +122,6 @@ a.jive-gatewayButtonOn { ...@@ -121,7 +122,6 @@ a.jive-gatewayButtonOn {
background-color: #ffaaaa; background-color: #ffaaaa;
color: #ff0000; color: #ff0000;
padding: 3.0px; padding: 3.0px;
float: right;
} }
.saveResultsMsg .failureresults img { .saveResultsMsg .failureresults img {
margin-right: 3px; margin-right: 3px;
...@@ -132,7 +132,6 @@ a.jive-gatewayButtonOn { ...@@ -132,7 +132,6 @@ a.jive-gatewayButtonOn {
background-color: #FFE9B2; background-color: #FFE9B2;
color: #915a15; color: #915a15;
padding: 3.0px; padding: 3.0px;
float: right;
} }
.saveResultsMsg .warningresults img { .saveResultsMsg .warningresults img {
margin-right: 3px; margin-right: 3px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment