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 @@
## Added key: 'gateway.irc.errorreceivedwithcode'
## Added key: 'gateway.base.notloggedin'
## Added key: 'gateway.base.enterusername'
## Added key: 'gateway.web.settings.cancelledchanges'
# Temporary Tags Until Fixed Properly
......@@ -247,6 +248,7 @@ gateway.web.settings.groups=Groups
gateway.web.settings.savepermissions=Save Permissions
gateway.web.settings.title=Gateway Settings
gateway.web.settings.settingssaved=Settings Saved
gateway.web.settings.cancelledchanges=Cancelled Changes
gateway.web.settings.success=Success
gateway.web.settings.failed=Failed
gateway.web.settings.permissionssaved=Permissions Saved
......
......@@ -104,6 +104,7 @@ gateway.web.settings.groups=Groups
gateway.web.settings.savepermissions=Save Permissions
gateway.web.settings.title=Gateway Settings
gateway.web.settings.settingssaved=Settings Saved
gateway.web.settings.cancelledchanges=Cancelled Changes
gateway.web.settings.success=Success
gateway.web.settings.failed=Failed
gateway.web.settings.permissionssaved=Permissions Saved
......
......@@ -96,11 +96,11 @@ public class ConfigManager {
Attribute type = node.attribute("type");
if (type.getText().equals("text")) {
// Required fields
Attribute desc = node.attribute("desc");
Attribute desckey = node.attribute("desckey");
Attribute var = node.attribute("var");
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.");
return;
}
......@@ -118,11 +118,11 @@ public class ConfigManager {
}
else if (type.getText().equals("toggle")) {
// Required fields
Attribute desc = node.attribute("desc");
Attribute desckey = node.attribute("desckey");
Attribute var = node.attribute("var");
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.");
return;
}
......
......@@ -242,7 +242,7 @@
<!-- BEGIN gateway - <%= 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">
<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">
<strong><%= this.description %></strong>
</label>
......@@ -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.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>
<input type="submit" name="submit" value="<%= LocaleUtils.getLocalizedString("gateway.web.settings.testconnection", "gateway") %>" onclick="testConnect('<%= this.gatewayType.toString() %>'); return false" class="jive-formButton">
</form>
</div>
</div>
......@@ -302,16 +302,17 @@
</td>
</tr>
</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>
<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>
</div>
</div>
<!-- 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>
<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="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%">
......@@ -332,9 +333,9 @@
</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>
<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="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>
</div>
</div>
......@@ -406,6 +407,12 @@
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) {
Effect.Fade(transportID+"optionsresults");
}
......@@ -462,7 +469,7 @@
deactivateModifyUsers(transportID);
deactivateModifyGroups(transportID);
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);
}
......
......@@ -62,14 +62,8 @@ function checkToggle(theID) {
$(testLink).style.display = 'block';
$(optsLink).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 {
$(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';
$(optsLink).style.display = 'none';
$(permLink).style.display = 'none';
......
......@@ -103,14 +103,15 @@ a.jive-gatewayButtonOn {
.saveResultsMsg {
margin: 10px 5px 5px 0px;
padding: 0px;
padding-top: 2px;
font-weight: bold;
float: right;
}
.saveResultsMsg .successresults {
border: 1.0px solid #009900;
background-color: #aaffaa;
color: #009900;
padding: 3.0px;
float: right;
}
.saveResultsMsg .successresults img {
margin-right: 3px;
......@@ -121,7 +122,6 @@ a.jive-gatewayButtonOn {
background-color: #ffaaaa;
color: #ff0000;
padding: 3.0px;
float: right;
}
.saveResultsMsg .failureresults img {
margin-right: 3px;
......@@ -132,7 +132,6 @@ a.jive-gatewayButtonOn {
background-color: #FFE9B2;
color: #915a15;
padding: 3.0px;
float: right;
}
.saveResultsMsg .warningresults img {
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