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 @@ ...@@ -37,7 +37,9 @@
long regId = ParamUtils.getLongParameter(request, "deleteid", -1); long regId = ParamUtils.getLongParameter(request, "deleteid", -1);
try { try {
Registration reg = new Registration(regId); 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()); plugin.getTransportInstance(reg.getTransportType().toString()).getTransport().deleteRegistration(reg.getJID());
response.sendRedirect("gateway-registrations.jsp?success=true"); response.sendRedirect("gateway-registrations.jsp?success=true");
return; return;
...@@ -467,8 +469,8 @@ ...@@ -467,8 +469,8 @@
<td><%= result.jid %></td> <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><span class="jive-gateway-<%= result.linestatus %> jive-gateway-<%= result.type.toUpperCase() %><%= ((result.sessionActive) ? "on" : "off") %>"><%= result.username %></span></td>
<td><%= result.lastLogin %></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"><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 (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"><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>
<tr id="jiveRegistrationEdit<%= result.id %>" style="display: none;"> <tr id="jiveRegistrationEdit<%= result.id %>" style="display: none;">
<td align="center"><img src="images/im_<%= result.status %>.gif" alt="<%= result.status %>" border="0"></td> <td align="center"><img src="images/im_<%= result.status %>.gif" alt="<%= result.status %>" border="0"></td>
......
...@@ -37,15 +37,25 @@ ...@@ -37,15 +37,25 @@
<strong><%= this.description %></strong> <strong><%= this.description %></strong>
</label> </label>
<div class="jive-gatewayButtons"> <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() %>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() %>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() %>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() %>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> </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() %>options" style="display: none;">
<div> <div>
<i>This is not yet functional.</i><br />
<form action=""> <form action="">
<!-- <input type="checkbox" name="filetransfer" value="enabled"> Enable file transfer<br> --> <!-- <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="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"> <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> </form>
...@@ -53,6 +63,7 @@ ...@@ -53,6 +63,7 @@
</div> </div>
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>perms" style="display: none;"> <div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>perms" style="display: none;">
<div> <div>
<i>This is not yet functional.</i><br />
<form action=""> <form action="">
<input type="radio" name="userreg" value="all" checked> All users can register<br> <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="specific"> These users and/or groups can register<br>
...@@ -62,7 +73,7 @@ ...@@ -62,7 +73,7 @@
</form> </form>
</div> </div>
</div> </div>
<!-- END gateway 1 - <%= this.gatewayType.toString().toUpperCase() %> --> <!-- END gateway - <%= this.gatewayType.toString().toUpperCase() %> -->
<% <%
} }
......
...@@ -7,11 +7,14 @@ This toggles toggles an individual panel (slides up and down), or switches ...@@ -7,11 +7,14 @@ This toggles toggles an individual panel (slides up and down), or switches
between the two if one's already open. between the two if one's already open.
*/ */
function togglePanel(thisID,thatID) { lastID = "";
activeLink = thisID.id+"Link"; function togglePanel(thisID) {
oldLink = thatID.id+"Link";
activeLink = thisID.id+"Link";
if (lastID != "") {
thatID = lastID;
oldLink = thatID.id+"Link";
if ($(thisID).style.display != 'none' && $(thatID).style.display == 'none') { if ($(thisID).style.display != 'none' && $(thatID).style.display == 'none') {
Effect.toggle($(thisID),'slide', {duration: .4}); Effect.toggle($(thisID),'slide', {duration: .4});
$(activeLink).className = ""; $(activeLink).className = "";
...@@ -24,6 +27,18 @@ oldLink = thatID.id+"Link"; ...@@ -24,6 +27,18 @@ oldLink = thatID.id+"Link";
Effect.toggle($(thisID),'slide', {duration: .4}); Effect.toggle($(thisID),'slide', {duration: .4});
$(activeLink).className = "jive-gatewayButtonOn"; $(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,14 +50,17 @@ unchecks a gateway the box goes grey panels aren't accessible. ...@@ -35,14 +50,17 @@ unchecks a gateway the box goes grey panels aren't accessible.
*/ */
function checkToggle(theID) { function checkToggle(theID) {
theCheckbox = theID.id+"checkbox"; theCheckbox = theID.id+"checkbox";
optsLink = theID.id+"optionsLink"; testLink = theID.id+"testsLink";
permLink = theID.id+"permsLink"; optsLink = theID.id+"optionsLink";
optsPanel = theID.id+"options"; permLink = theID.id+"permsLink";
permPanel = theID.id+"perms"; testPanel = theID.id+"tests";
optsPanel = theID.id+"options";
permPanel = theID.id+"perms";
if ($(theCheckbox).checked) { if ($(theCheckbox).checked) {
$(theID).className = "jive-gateway"; $(theID).className = "jive-gateway";
$(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 */ /* the below doesn't work right in IE, work on later */
...@@ -53,15 +71,19 @@ permPanel = theID.id+"perms"; ...@@ -53,15 +71,19 @@ permPanel = theID.id+"perms";
/* the below doesn't work right in IE, work on later */ /* the below doesn't work right in IE, work on later */
//$(optsLink).removeAttribute('onclick'); //$(optsLink).removeAttribute('onclick');
//$(permLink).removeAttribute('onclick'); //$(permLink).removeAttribute('onclick');
$(testLink).style.display = 'none';
$(optsLink).style.display = 'none'; $(optsLink).style.display = 'none';
$(permLink).style.display = 'none'; $(permLink).style.display = 'none';
/* fix the panels so they roll up and the buttons go back to default states */ /* fix the panels so they roll up and the buttons go back to default states */
$(testLink).className = "";
$(optsLink).className = ""; $(optsLink).className = "";
$(permLink).className = ""; $(permLink).className = "";
if ($(optsPanel).style.display != 'none') { if ($(optsPanel).style.display != 'none') {
Effect.toggle($(optsPanel), 'slide', {duration: .1}); Effect.toggle($(optsPanel), 'slide', {duration: .1});
} else if ($(permPanel).style.display != 'none') { } else if ($(permPanel).style.display != 'none') {
Effect.toggle($(permPanel), 'slide', {duration: .1}); 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