Commit 64621f13 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

Some web interface improvements. Made disabled stuff visible so folk can at...

Some web interface improvements.  Made disabled stuff visible so folk can at least see what's coming.  =)

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk/src/plugins/gateway@5745 b35dd754-fafc-0310-a699-88a17e54d16e
parent d2fb2a01
......@@ -37,7 +37,9 @@
long regId = ParamUtils.getLongParameter(request, "deleteid", -1);
try {
Registration reg = new Registration(regId);
// TODO: Check if transport is enabled
if (!trEnabled.get(reg.getTransportType().toString())) {
response.sendRedirect("gateway-registrations.jsp?success=false");
}
plugin.getTransportInstance(reg.getTransportType().toString()).getTransport().deleteRegistration(reg.getJID());
response.sendRedirect("gateway-registrations.jsp?success=true");
return;
......@@ -467,8 +469,8 @@
<td><%= result.jid %></td>
<td><span class="jive-gateway-<%= result.linestatus %> jive-gateway-<%= result.type.toUpperCase() %><%= ((result.sessionActive) ? "on" : "off") %>"><%= result.username %></span></td>
<td><%= result.lastLogin %></td>
<td align="center"><a href="" onClick="toggleEdit(<%= result.id %>); return false"><img src="images/edit-16x16.gif" alt="" border="0"></a></td>
<td align="center"><form method="post" id="deleteRegistration<%= result.id %>" name="deleteRegistration<%= result.id %>" action="gateway-registrations.jsp"><input type="hidden" name="action" value="delete" /><input type="hidden" name="deleteid" value="<%= result.id %>" /><a href="" onClick="if (confirm('<fmt:message key="gateway.web.registrations.confirmdelete" />')) { document.getElementById('deleteRegistration<%= result.id %>').submit(); return false; } else { return false; }"><img src="images/delete-16x16.gif" alt="" border="0"></a></form></td>
<td align="center"><a href="" onClick="<% if (!trEnabled.get(result.type)) { %>alert('You must enable this transport to modify registrations.'); return false;<% } else { %>toggleEdit(<%= result.id %>); return false<% } %>"><img src="images/edit-16x16.gif" alt="" border="0"></a></td>
<td align="center"><form method="post" id="deleteRegistration<%= result.id %>" name="deleteRegistration<%= result.id %>" action="gateway-registrations.jsp"><input type="hidden" name="action" value="delete" /><input type="hidden" name="deleteid" value="<%= result.id %>" /><a href="" onClick="<% if (!trEnabled.get(result.type)) { %>alert('You must enable this transport to modify registrations.'); return false;<% } else { %>if (confirm('<fmt:message key="gateway.web.registrations.confirmdelete" />')) { document.getElementById('deleteRegistration<%= result.id %>').submit(); return false; } else { return false; }<% } %>"><img src="images/delete-16x16.gif" alt="" border="0"></a></form></td>
</tr>
<tr id="jiveRegistrationEdit<%= result.id %>" style="display: none;">
<td align="center"><img src="images/im_<%= result.status %>.gif" alt="<%= result.status %>" border="0"></td>
......
......@@ -37,15 +37,25 @@
<strong><%= this.description %></strong>
</label>
<div class="jive-gatewayButtons">
<!--<a href="#" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>options,jive<%= this.gatewayType.toString().toUpperCase() %>perms); return false" id="jive<%= this.gatewayType.toString().toUpperCase() %>optionsLink" <%= ((!this.gwEnabled) ? "style='display:none'" : "") %>>Options</a>-->
<!--<a href="#" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>perms,jive<%= this.gatewayType.toString().toUpperCase() %>options); return false" id="jive<%= this.gatewayType.toString().toUpperCase() %>permsLink" <%= ((!this.gwEnabled) ? "style='display:none'" : "") %>>Permissions</a>-->
<a href="#" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>tests); return false" id="jive<%= this.gatewayType.toString().toUpperCase() %>testsLink" <%= ((!this.gwEnabled) ? "style='display:none'" : "") %>>Tests</a>
<a href="#" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>options); return false" id="jive<%= this.gatewayType.toString().toUpperCase() %>optionsLink" <%= ((!this.gwEnabled) ? "style='display:none'" : "") %>>Options</a>
<a href="#" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>perms); return false" id="jive<%= this.gatewayType.toString().toUpperCase() %>permsLink" <%= ((!this.gwEnabled) ? "style='display:none'" : "") %>>Permissions</a>
</div>
</div>
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>options" style="display: none;">
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>tests" style="display: none;">
<div>
<i>This is not yet functional.</i><br />
<form action="">
<input type="submit" name="submit" value="Test Connection" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>tests,jive<%= this.gatewayType.toString().toUpperCase() %>tests); return false" class="jive-formButton">
</form>
</div>
</div>
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>options" style="display: none;">
<div>
<form action="">
<i>This is not yet functional.</i><br />
<form action="">
<!-- <input type="checkbox" name="filetransfer" value="enabled"> Enable file transfer<br> -->
<input type="checkbox" name="reconnect" value="enabled"> Reconnect on disconnect<br>
<!-- <input type="checkbox" name="reconnect" value="enabled"> Reconnect on disconnect<br> -->
<input type="submit" name="submit" value="Save Options" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>options,jive<%= this.gatewayType.toString().toUpperCase() %>perms); return false" class="jive-formButton">
<input type="reset" name="cancel" value="Cancel" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>options,jive<%= this.gatewayType.toString().toUpperCase() %>perms); return false" class="jive-formButton">
</form>
......@@ -53,7 +63,8 @@
</div>
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>perms" style="display: none;">
<div>
<form action="">
<i>This is not yet functional.</i><br />
<form action="">
<input type="radio" name="userreg" value="all" checked> All users can register<br>
<input type="radio" name="userreg" value="specific"> These users and/or groups can register<br>
<input type="radio" name="userreg" value="manual"> Manual registration only (see the Registrations section to manage)<br>
......@@ -62,7 +73,7 @@
</form>
</div>
</div>
<!-- END gateway 1 - <%= this.gatewayType.toString().toUpperCase() %> -->
<!-- END gateway - <%= this.gatewayType.toString().toUpperCase() %> -->
<%
}
......
......@@ -7,23 +7,38 @@ This toggles toggles an individual panel (slides up and down), or switches
between the two if one's already open.
*/
function togglePanel(thisID,thatID) {
activeLink = thisID.id+"Link";
oldLink = thatID.id+"Link";
if ($(thisID).style.display != 'none' && $(thatID).style.display == 'none') {
Effect.toggle($(thisID),'slide', {duration: .4});
$(activeLink).className = "";
} else if ($(thisID).style.display == 'none' && $(thatID).style.display != 'none') {
$(thatID).style.display = 'none';
$(thisID).style.display = 'block';
$(oldLink).className = "";
$(activeLink).className = "jive-gatewayButtonOn";
} else {
Effect.toggle($(thisID),'slide', {duration: .4});
$(activeLink).className = "jive-gatewayButtonOn";
}
lastID = "";
function togglePanel(thisID) {
activeLink = thisID.id+"Link";
if (lastID != "") {
thatID = lastID;
oldLink = thatID.id+"Link";
if ($(thisID).style.display != 'none' && $(thatID).style.display == 'none') {
Effect.toggle($(thisID),'slide', {duration: .4});
$(activeLink).className = "";
} else if ($(thisID).style.display == 'none' && $(thatID).style.display != 'none') {
$(thatID).style.display = 'none';
$(thisID).style.display = 'block';
$(oldLink).className = "";
$(activeLink).className = "jive-gatewayButtonOn";
} else {
Effect.toggle($(thisID),'slide', {duration: .4});
$(activeLink).className = "jive-gatewayButtonOn";
}
}
else {
if ($(thisID).style.display != 'none') {
Effect.toggle($(thisID),'slide', {duration: .4});
$(activeLink).className = "";
} else {
Effect.toggle($(thisID),'slide', {duration: .4});
$(activeLink).className = "jive-gatewayButtonOn";
}
}
lastID = thisID;
}
......@@ -35,15 +50,18 @@ unchecks a gateway the box goes grey panels aren't accessible.
*/
function checkToggle(theID) {
theCheckbox = theID.id+"checkbox";
optsLink = theID.id+"optionsLink";
permLink = theID.id+"permsLink";
optsPanel = theID.id+"options";
permPanel = theID.id+"perms";
theCheckbox = theID.id+"checkbox";
testLink = theID.id+"testsLink";
optsLink = theID.id+"optionsLink";
permLink = theID.id+"permsLink";
testPanel = theID.id+"tests";
optsPanel = theID.id+"options";
permPanel = theID.id+"perms";
if ($(theCheckbox).checked) {
$(theID).className = "jive-gateway";
$(optsLink).style.display = 'block';
$(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))");
......@@ -53,18 +71,22 @@ permPanel = theID.id+"perms";
/* the below doesn't work right in IE, work on later */
//$(optsLink).removeAttribute('onclick');
//$(permLink).removeAttribute('onclick');
$(optsLink).style.display = 'none';
$(testLink).style.display = 'none';
$(optsLink).style.display = 'none';
$(permLink).style.display = 'none';
/* fix the panels so they roll up and the buttons go back to default states */
$(optsLink).className = "";
$(testLink).className = "";
$(optsLink).className = "";
$(permLink).className = "";
if ($(optsPanel).style.display != 'none') {
Effect.toggle($(optsPanel), 'slide', {duration: .1});
} else if ($(permPanel).style.display != 'none') {
Effect.toggle($(permPanel), 'slide', {duration: .1});
}
}
} else if ($(testPanel).style.display != 'none') {
Effect.toggle($(testPanel), 'slide', {duration: .1});
}
}
}
......
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