mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-08 12:01:09 +01:00
new smack web client browser side
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1964 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
a7a2b90b1b
commit
34acbe9cee
19 changed files with 777 additions and 466 deletions
|
|
@ -7,100 +7,158 @@
|
|||
|
||||
<% // Get error map as a request attribute:
|
||||
Map errors = (Map)request.getAttribute("messenger.servlet.errors");
|
||||
boolean allowAnonymous = true;
|
||||
boolean allowAccountCreate = true;
|
||||
boolean allowLogin = true;
|
||||
String param = null;
|
||||
if (errors == null) { errors = new HashMap(); }
|
||||
param = application.getInitParameter("allowAnonymous");
|
||||
if ((param != null) && (param.equalsIgnoreCase("false"))) {
|
||||
allowAnonymous = false;
|
||||
}
|
||||
param = application.getInitParameter("allowAccountCreation");
|
||||
if ((param != null) && (param.equalsIgnoreCase("false"))) {
|
||||
allowAccountCreate = false;
|
||||
}
|
||||
param = application.getInitParameter("allowLogin");
|
||||
if ((param != null) && (param.equalsIgnoreCase("false"))) {
|
||||
allowLogin = false;
|
||||
}
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Chat</title>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
function submitForm(el) {
|
||||
el.form.submit();
|
||||
}
|
||||
</script>
|
||||
<link rel="stylesheet" href="<%= request.getContextPath() %>/style.css" type="text/css">
|
||||
</head>
|
||||
<head>
|
||||
<title>Jive Web Chat Client Login</title>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
function submitForm (el) {
|
||||
el.form.submit();
|
||||
}
|
||||
|
||||
<body>
|
||||
function anonClick () {
|
||||
document.loginform.command.value = "anon_login";
|
||||
|
||||
<h3>Jive Chat Login</h3>
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<% if (errors.get("general") != null) { %>
|
||||
<link rel="stylesheet" href="<%= request.getContextPath() %>/style_sheet.jsp"
|
||||
type="text/css">
|
||||
</head>
|
||||
|
||||
<p class="error-text">
|
||||
Error logging in. Make sure your username and password is correct.
|
||||
</p>
|
||||
<body class="deffr">
|
||||
|
||||
<% } %>
|
||||
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td align="center" valign="middle">
|
||||
<table cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<h3>Welcome to the Jive Web Chat Client - Please Login</h3>
|
||||
<% if (errors.get("general") != null) { %>
|
||||
<p class="error-text">
|
||||
Error logging in. Make sure your username and
|
||||
password are correct. <%= errors.get("general") %>
|
||||
</p>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<form action="<%= request.getContextPath() %>/ChatServlet"
|
||||
method="post" name="loginform">
|
||||
<input type="hidden" name="command" value="login">
|
||||
|
||||
<form action="<%= request.getContextPath() %>/servlet/ChatServlet" method="post" name="loginform">
|
||||
<input type="hidden" name="command" value="login">
|
||||
<table cellpadding="2" cellspacing="0" border="0">
|
||||
<% if (allowLogin) { %>
|
||||
<tr>
|
||||
<td>Username:</td>
|
||||
<td>
|
||||
<input type="text" size="40" name="username"
|
||||
class="text">
|
||||
<% if (errors.get("username") != null) { %>
|
||||
<span class="error-text"><br>
|
||||
Please enter a valid username.
|
||||
</span>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Password:</td>
|
||||
<td>
|
||||
<input type="password" size="40" name="password"
|
||||
class="text">
|
||||
<% if (errors.get("password") != null) { %>
|
||||
<span class="error-text"><br>
|
||||
Please enter a valid password.
|
||||
</span>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
<tr>
|
||||
<td>Nickname:</td>
|
||||
<td>
|
||||
<input type="text" size="40" name="nickname"
|
||||
class="text">
|
||||
<% if (errors.get("nickname") != null) { %>
|
||||
<span class="error-text"><br>
|
||||
Please enter a nickname.
|
||||
</span>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Room:</td>
|
||||
<td>
|
||||
<input type="text" size="40" name="room"
|
||||
value="test@chat.jivesoftware.com" class="text">
|
||||
<% if (errors.get("room") != null) { %>
|
||||
<span class="error-text"><br>
|
||||
Please enter a valid room.
|
||||
</span>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<br>
|
||||
<% if (allowLogin) { %>
|
||||
<input type="submit" name="" value="Login and Chat"
|
||||
class="submit">
|
||||
<% } %>
|
||||
<% if (allowAnonymous) { %>
|
||||
<input type="submit" name="" value="Anonymously Chat"
|
||||
onClick="return anonClick();" class="submit">
|
||||
<% } %>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<% if (allowAccountCreate) { %>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<br>Don't have an account and would like to create one?
|
||||
<a href="account_creation.jsp">Click here.</a>
|
||||
</td>
|
||||
</tr>
|
||||
<% } %>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table cellpadding="2" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>Username:</td>
|
||||
<td>
|
||||
<input type="text" size="40" name="username">
|
||||
<% if (errors.get("username") != null) { %>
|
||||
|
||||
<span class="error-text"><br>
|
||||
Please enter a valid username.
|
||||
</span>
|
||||
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Password:</td>
|
||||
<td>
|
||||
<input type="password" size="40" name="password">
|
||||
<% if (errors.get("password") != null) { %>
|
||||
|
||||
<span class="error-text"><br>
|
||||
Please enter a valid password.
|
||||
</span>
|
||||
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nickname:</td>
|
||||
<td>
|
||||
<input type="text" size="40" name="nickname">
|
||||
<% if (errors.get("nickname") != null) { %>
|
||||
|
||||
<span class="error-text"><br>
|
||||
Please enter a valid nickname.
|
||||
</span>
|
||||
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Room:</td>
|
||||
<td>
|
||||
<input type="text" size="40" name="room" value="test@chat.jivesoftware.com">
|
||||
<% if (errors.get("room") != null) { %>
|
||||
|
||||
<span class="error-text"><br>
|
||||
Please enter a valid room.
|
||||
</span>
|
||||
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<% if (allowLogin) { %>
|
||||
document.loginform.username.focus();
|
||||
<% } else { %>
|
||||
document.loginform.nickname.focus();
|
||||
<% } %>
|
||||
</script>
|
||||
|
||||
<br>
|
||||
|
||||
<input type="submit" name="" value="Start Chat">
|
||||
</form>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
document.loginform.username.focus();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue