smack_1_5_1
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2639 b35dd754-fafc-0310-a699-88a17e54d16e
116
CopyOftrunk/apps/webchat/source/web/account_creation.jsp
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
<%--
|
||||
-
|
||||
-
|
||||
--%>
|
||||
|
||||
<%@ page import="java.util.*" %>
|
||||
|
||||
<% // Get error map as a request attribute:
|
||||
Map errors = (Map)request.getAttribute("messenger.servlet.errors");
|
||||
if (errors == null) { errors = new HashMap(); }
|
||||
%>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Create an account</title>
|
||||
|
||||
<link rel="stylesheet" href="<%= request.getContextPath() %>/style_sheet.jsp"
|
||||
type="text/css">
|
||||
</head>
|
||||
|
||||
<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>Jive Account Creation</h3>
|
||||
|
||||
<% if (errors.get("general") != null) { %>
|
||||
<p>
|
||||
<span class="error-text">
|
||||
Error creating account. <%= errors.get("general") %>
|
||||
</span>
|
||||
</p>
|
||||
<br>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<form action="<%= request.getContextPath() %>/ChatServlet"
|
||||
method="post" name="createform">
|
||||
<input type="hidden" name="command" value="create_account">
|
||||
|
||||
<table cellpadding="2" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>Desired username:</td>
|
||||
<td>
|
||||
<input type="text" size="40" name="username"
|
||||
class="text">
|
||||
<% if (errors.get("empty_username") != null) { %>
|
||||
<span class="error-text"><br>
|
||||
Please enter a username.
|
||||
</span>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Desired password:</td>
|
||||
<td>
|
||||
<input type="password" size="40" name="password"
|
||||
class="text">
|
||||
<% if (errors.get("empty_password") != null) { %>
|
||||
<span class="error-text"><br>
|
||||
Please enter a password.
|
||||
</span>
|
||||
<% } %>
|
||||
<% if (errors.get("mismatch_password") != null) { %>
|
||||
<span class="error-text"><br>
|
||||
Your passwords did not match.
|
||||
</span>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Retype your password:</td>
|
||||
<td>
|
||||
<input type="password" size="40" name="password_zwei"
|
||||
class="text">
|
||||
<% if (errors.get("empty_password_two") != null) { %>
|
||||
<span class="error-text"><br>
|
||||
You must retype your password.
|
||||
</span>
|
||||
<% } %>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<br>
|
||||
<input type="submit" name="" value="Create account"
|
||||
class="submit">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<br><a href="index.jsp">Click here to return to the login page.</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
document.createform.username.focus();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
19
CopyOftrunk/apps/webchat/source/web/chat-hiddenform.jsp
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Chat Form</title>
|
||||
|
||||
<link rel="stylesheet" href="<%= request.getContextPath() %>/style_sheet.jsp"
|
||||
type="text/css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<form name="chatform" action="<%= request.getContextPath() %>/ChatServlet" method="post">
|
||||
<input type="hidden" name="command" value="write">
|
||||
<input type="hidden" name="message" value="">
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
39
CopyOftrunk/apps/webchat/source/web/chat-launcher.jsp
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<title>Web Chat Session</title>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
|
||||
function launchWin() {
|
||||
var newWin = window.open("frame_master.jsp", "chatWin",
|
||||
"location=no,status=no,toolbar=no,personalbar=no,menubar=no,width=650,height=430");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="<%= request.getContextPath() %>/style_sheet.jsp"
|
||||
type="text/css">
|
||||
</head>
|
||||
|
||||
<body class="deffr" onload="launchWin();">
|
||||
|
||||
<h3>Chat Session Options</h3>
|
||||
|
||||
Your chat session should have already started. If for some reason it did
|
||||
not, click <a href="#" onclick="launchWin(); return false;">this link</a>
|
||||
to start your chat session.
|
||||
|
||||
<br><br>
|
||||
|
||||
Other options:
|
||||
|
||||
<ul>
|
||||
<li><a href="email" onclick="alert('Coming soon'); return false;">Email Transcript</a>
|
||||
<li><a href="index.jsp">Return to the login page.</a>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
182
CopyOftrunk/apps/webchat/source/web/common.js
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
function addChatText (someText, isAnnouncement) {
|
||||
var yakDiv = window.parent.frames['yak'].document.getElementById('ytext');
|
||||
var children = yakDiv.childNodes.length;
|
||||
var appendFailed = false;
|
||||
var spanElement = document.createElement("span");
|
||||
|
||||
if (! isAnnouncement) {
|
||||
spanElement.setAttribute("class", "chat_text");
|
||||
} else {
|
||||
spanElement.setAttribute("class", "chat_announcement");
|
||||
}
|
||||
// it's easier to dump the possibily html-containing text into the innerHTML
|
||||
// of the span element than deciphering and building sub-elements.
|
||||
spanElement.innerHTML = someText;
|
||||
|
||||
try {
|
||||
// various versions of IE crash out on this, and safari
|
||||
yakDiv.appendChild(spanElement);
|
||||
} catch (exception) {
|
||||
appendFailed = true;
|
||||
}
|
||||
|
||||
if (! appendFailed) {
|
||||
// really make sure the browser appended
|
||||
appendFailed = (children == yakDiv.childNodes.length);
|
||||
}
|
||||
|
||||
if (appendFailed) {
|
||||
// try this, the only way left
|
||||
var inn = yakDiv.innerHTML;
|
||||
|
||||
inn += "<span class=\"";
|
||||
inn += (isAnnouncement ? "chat_announcement\">" : "chat_text\">");
|
||||
inn += someText + "</span><br>";
|
||||
|
||||
yakDiv.innerHTML = inn;
|
||||
} else {
|
||||
yakDiv.appendChild(document.createElement("br"));
|
||||
}
|
||||
|
||||
scrollYakToEnd();
|
||||
}
|
||||
|
||||
function addUserName (userName) {
|
||||
var yakDiv = window.parent.frames['yak'].document.getElementById('ytext');
|
||||
var children = yakDiv.childNodes.length;
|
||||
var appendFailed = false;
|
||||
var spanElement = document.createElement("span");
|
||||
var userIsClientOwner = false;
|
||||
var announcement = false;
|
||||
|
||||
if (userName == "") {
|
||||
announcement = true;
|
||||
|
||||
spanElement.setAttribute("class", "chat_announcement");
|
||||
|
||||
userName = "room announcement";
|
||||
} else if (userName == nickname) {
|
||||
userIsClientOwner = true;
|
||||
|
||||
spanElement.setAttribute("class", "chat_owner");
|
||||
} else {
|
||||
spanElement.setAttribute("class", "chat_participant");
|
||||
}
|
||||
|
||||
try {
|
||||
spanElement.appendChild(document.createTextNode(userName + ": "));
|
||||
|
||||
// various versions of IE crash out on this, and safari
|
||||
yakDiv.appendChild(spanElement);
|
||||
} catch (exception) {
|
||||
appendFailed = true;
|
||||
}
|
||||
|
||||
if (! appendFailed) {
|
||||
// really make sure the browser appended
|
||||
appendFailed = (children == yakDiv.childNodes.length);
|
||||
}
|
||||
|
||||
if (appendFailed) {
|
||||
// try this, the only way left
|
||||
var inn = yakDiv.innerHTML
|
||||
|
||||
inn += "<span class=\"";
|
||||
|
||||
if (announcement) {
|
||||
inn += "chat_announcement"
|
||||
} else if (userIsClientOwner) {
|
||||
inn += "chat_owner";
|
||||
} else {
|
||||
inn += "chat_participant";
|
||||
}
|
||||
|
||||
inn += "\">" + userName + ": </span>";
|
||||
|
||||
yakDiv.innerHTML = inn;
|
||||
}
|
||||
}
|
||||
|
||||
function scrollYakToEnd () {
|
||||
var endDiv = window.parent.frames['yak'].document.getElementById('enddiv');
|
||||
|
||||
window.parent.frames['yak'].window.scrollTo(0, endDiv.offsetTop);
|
||||
}
|
||||
|
||||
function userJoined (username) {
|
||||
var parentDIV = window.parent.frames['participants'].document.getElementById('par__list');
|
||||
var children = parentDIV.childNodes.length;
|
||||
var appendFailed = false;
|
||||
var divElement = document.createElement("div");
|
||||
|
||||
divElement.setAttribute("id", username);
|
||||
|
||||
try {
|
||||
divElement.appendChild(document.createTextNode(username));
|
||||
divElement.appendChild(document.createElement("br"));
|
||||
|
||||
parentDIV.appendChild(divElement);
|
||||
} catch (exception) {
|
||||
appendFailed = true;
|
||||
}
|
||||
|
||||
if (! appendFailed) {
|
||||
// really make sure the browser appended
|
||||
appendFailed = (children == parentDIV.childNodes.length);
|
||||
}
|
||||
|
||||
if (appendFailed) {
|
||||
// try this, the only way left
|
||||
var inn = parentDIV.innerHTML;
|
||||
|
||||
inn += "<div id=\"" + username + "\"> · " + username + "<br></div>";
|
||||
|
||||
parentDIV.innerHTML = inn;
|
||||
}
|
||||
}
|
||||
|
||||
function userDeparted (username) {
|
||||
var partDoc = window.parent.frames['participants'].document;
|
||||
var parentDIV = partDoc.getElementById('par__list');
|
||||
var userDIV = partDoc.getElementById(username);
|
||||
var children = parentDIV.childNodes.length;
|
||||
var removeFailed = false;
|
||||
|
||||
// MAY RETURN THIS BLOCK
|
||||
if (userDIV == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
parentDIV.removeChild(userDIV);
|
||||
} catch (exception) {
|
||||
removeFailed = true;
|
||||
}
|
||||
|
||||
if (! removeFailed) {
|
||||
// really make sure the browser appended
|
||||
removeFailed = (children == parentDIV.childNodes.length);
|
||||
}
|
||||
|
||||
if (removeFailed) {
|
||||
// try this, the only way left
|
||||
var inn = parentDIV.innerHTML;
|
||||
var openingTag = "<div id=\"" + username + "\">";
|
||||
var index = inn.toLowerCase().indexOf(openingTag);
|
||||
var patchedHTML = inn.substring(0, index);
|
||||
var secondIndex = openingTag.length + username.length + 13;
|
||||
|
||||
patchedHTML += inn.substring(secondIndex, (inn.length));
|
||||
|
||||
parentDIV.innerHTML = inn;
|
||||
}
|
||||
}
|
||||
|
||||
function writeDate () {
|
||||
var msg = "This frame loaded at: ";
|
||||
var now = new Date();
|
||||
|
||||
msg += now + "<br><hr>";
|
||||
|
||||
document.write(msg);
|
||||
}
|
||||
33
CopyOftrunk/apps/webchat/source/web/frame_master.jsp
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<html>
|
||||
<head>
|
||||
<title><%= request.getSession().getAttribute("messenger.servlet.room") %>
|
||||
- Jive Web Chat Client</title>
|
||||
|
||||
<script>
|
||||
|
||||
function frameSetLoaded () {
|
||||
window.frames['poller'].location.href
|
||||
= "<%= request.getContextPath() %>/ChatServlet?command=read";
|
||||
}
|
||||
|
||||
function attemptLogout () {
|
||||
window.frames['participants'].document.logout.submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="<%= request.getContextPath() %>/style_sheet.jsp"
|
||||
type="text/css">
|
||||
</head>
|
||||
|
||||
<frameset cols="*, 125" border="0" frameborder="0" framespacing="0"
|
||||
onLoad="frameSetLoaded();" onUnload="attemptLogout();">
|
||||
<frameset rows="0, 200, *, 0" border="0" frameborder="0" framespacing="0">
|
||||
<frame name="submitter" src="chat-hiddenform.jsp" frameborder="0">
|
||||
<frame name="yak" src="transcript_frame.html" frameborder="0">
|
||||
<frame name="input" src="input_frame.jsp" frameborder="0">
|
||||
<frame name="poller" src="" frameborder="0">
|
||||
</frameset>
|
||||
<frame name="participants" src="participants_frame.jsp" class="bordered_left">
|
||||
</frameset>
|
||||
</html>
|
||||
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/angry.gif
Normal file
|
After Width: | Height: | Size: 692 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/blush.gif
Normal file
|
After Width: | Height: | Size: 688 B |
|
After Width: | Height: | Size: 688 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/cool.gif
Normal file
|
After Width: | Height: | Size: 687 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/cry.gif
Normal file
|
After Width: | Height: | Size: 693 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/devil.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/grin.gif
Normal file
|
After Width: | Height: | Size: 680 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/happy.gif
Normal file
|
After Width: | Height: | Size: 675 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/laugh.gif
Normal file
|
After Width: | Height: | Size: 670 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/love.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 693 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/plain.gif
Normal file
|
After Width: | Height: | Size: 678 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/sad.gif
Normal file
|
After Width: | Height: | Size: 694 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/shocked.gif
Normal file
|
After Width: | Height: | Size: 688 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/silly.gif
Normal file
|
After Width: | Height: | Size: 685 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/emoticons/wink.gif
Normal file
|
After Width: | Height: | Size: 634 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/logo.gif
Normal file
|
After Width: | Height: | Size: 925 B |
BIN
CopyOftrunk/apps/webchat/source/web/images/logout-16x16.gif
Normal file
|
After Width: | Height: | Size: 325 B |
164
CopyOftrunk/apps/webchat/source/web/index.jsp
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
<%--
|
||||
-
|
||||
-
|
||||
--%>
|
||||
|
||||
<%@ page import="java.util.*" %>
|
||||
|
||||
<% // 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>Jive Web Chat Client Login</title>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
function submitForm (el) {
|
||||
el.form.submit();
|
||||
}
|
||||
|
||||
function anonClick () {
|
||||
document.loginform.command.value = "anon_login";
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="<%= request.getContextPath() %>/style_sheet.jsp"
|
||||
type="text/css">
|
||||
</head>
|
||||
|
||||
<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">
|
||||
|
||||
<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>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<% if (allowLogin) { %>
|
||||
document.loginform.username.focus();
|
||||
<% } else { %>
|
||||
document.loginform.nickname.focus();
|
||||
<% } %>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
75
CopyOftrunk/apps/webchat/source/web/input_frame.jsp
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
<%@ page import="javax.servlet.*" %>
|
||||
|
||||
<% // Get error map as a request attribute:
|
||||
String logoFilename = application.getInitParameter("logoFilename");
|
||||
if (logoFilename == null) {
|
||||
logoFilename = "images/logo.gif";
|
||||
}
|
||||
%>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="expires" content="0">
|
||||
|
||||
<script>
|
||||
function updateButtonState (textAreaElement) {
|
||||
if (textAreaElement.value != '') {
|
||||
textAreaElement.form.send.disabled = false;
|
||||
} else {
|
||||
textAreaElement.form.send.disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
function handleKeyEvent (event, textAreaElement) {
|
||||
var form = textAreaElement.form;
|
||||
var keyCode = event.keyCode;
|
||||
|
||||
if (keyCode == null) {
|
||||
keyCode = event.which;
|
||||
}
|
||||
|
||||
if (keyCode == 13) {
|
||||
submitForm(form);
|
||||
|
||||
form.message.value = '';
|
||||
}
|
||||
|
||||
updateButtonState(textAreaElement);
|
||||
}
|
||||
|
||||
function submitForm (formElement) {
|
||||
var textAreaElement = formElement.message;
|
||||
var text = textAreaElement.value;
|
||||
var sForm = window.parent.frames['submitter'].document.chatform;
|
||||
|
||||
sForm.message.value = text;
|
||||
sForm.submit();
|
||||
|
||||
textAreaElement.value = '';
|
||||
|
||||
updateButtonState(textAreaElement);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="<%= request.getContextPath() %>/style_sheet.jsp"
|
||||
type="text/css">
|
||||
</head>
|
||||
|
||||
<body class="deffr">
|
||||
<center>
|
||||
<form name="chat" onsubmit="return submitForm(this);">
|
||||
<textarea name="message"
|
||||
onkeyup="handleKeyEvent(event, this);"
|
||||
onchange="updateButtonState(this);"></textarea>
|
||||
<br>
|
||||
<input type="submit" name="send" value="Send" class="submit_right" disabled>
|
||||
</form>
|
||||
</center>
|
||||
|
||||
<img src="<%= logoFilename %>" class="logo">
|
||||
</body>
|
||||
|
||||
</html>
|
||||
46
CopyOftrunk/apps/webchat/source/web/participants_frame.jsp
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="expires" content="0">
|
||||
|
||||
<script>
|
||||
|
||||
function verifyLogout () {
|
||||
if (confirm("Are you sure you'd like to logout")) {
|
||||
// hacky solution to avoid logging out twice due to parent frame's onUnload
|
||||
try {
|
||||
document.logout.command.value = "silence";
|
||||
} catch (e) { }
|
||||
|
||||
window.parent.close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="<%= request.getContextPath() %>/style_sheet.jsp"
|
||||
type="text/css">
|
||||
</head>
|
||||
|
||||
<body class="deffr">
|
||||
<center>In the room:</center>
|
||||
<br>
|
||||
<hr width=67%>
|
||||
|
||||
<div id="par__list"> </div>
|
||||
|
||||
<form name="logout" action="<%= request.getContextPath() %>/ChatServlet" method="post">
|
||||
<input type="hidden" name="command" value="logout">
|
||||
</form>
|
||||
|
||||
<span class="logout">
|
||||
<a href="<%= request.getContextPath() %>/ChatServlet?command=logout"
|
||||
onclick="return verifyLogout();" >
|
||||
<img src="images/logout-16x16.gif" border="0" class="logout"> Logout</a></span>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
132
CopyOftrunk/apps/webchat/source/web/style_sheet.jsp
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
<% // Set the content type of the this page to be CSS
|
||||
String contentType = "text/css";
|
||||
String chatAnnouncementColor = application.getInitParameter("chat.announcement-color");
|
||||
String chatOwnerLabelColor = application.getInitParameter("chat.owner-label-color");
|
||||
String chatParticipantLabelColor = application.getInitParameter("chat.participant-label-color");
|
||||
String chatTextColor = application.getInitParameter("chat.text-color");
|
||||
String errorTextColor = application.getInitParameter("error.text-color");
|
||||
String linkColor = application.getInitParameter("link.color");
|
||||
String linkHoverColor = application.getInitParameter("link.hover-color");
|
||||
String linkVisitedColor = application.getInitParameter("link.visited-color");
|
||||
String bodyBGColor = application.getInitParameter("body.background-color");
|
||||
String bodyTextColor = application.getInitParameter("body.text-color");
|
||||
String frameDividerColor = application.getInitParameter("frame.divider-color");
|
||||
String buttonColor = application.getInitParameter("button.color");
|
||||
String buttonTextColor = application.getInitParameter("button.text-color");
|
||||
String textFieldColor = application.getInitParameter("textfield.color");
|
||||
String textFieldTextColor = application.getInitParameter("textfield.text-color");
|
||||
response.setContentType(contentType);
|
||||
if (chatAnnouncementColor == null) {
|
||||
chatAnnouncementColor = "#009d00";
|
||||
}
|
||||
if (chatOwnerLabelColor == null) {
|
||||
chatOwnerLabelColor = "#aa0000";
|
||||
}
|
||||
if (chatParticipantLabelColor == null) {
|
||||
chatParticipantLabelColor = "#0000aa";
|
||||
}
|
||||
if (chatTextColor == null) {
|
||||
chatTextColor = "#434343";
|
||||
}
|
||||
if (errorTextColor == null) {
|
||||
errorTextColor = "#ff0000";
|
||||
}
|
||||
if (linkColor == null) {
|
||||
linkColor = "#045d30";
|
||||
}
|
||||
if (linkHoverColor == null) {
|
||||
linkHoverColor = "#350000";
|
||||
}
|
||||
if (linkVisitedColor == null) {
|
||||
linkVisitedColor = "#3b3757";
|
||||
}
|
||||
if (bodyBGColor == null) {
|
||||
bodyBGColor = "#ffffff";
|
||||
}
|
||||
if (bodyTextColor == null) {
|
||||
bodyTextColor = "#362f2d";
|
||||
}
|
||||
if (frameDividerColor == null) {
|
||||
frameDividerColor = "#83272b";
|
||||
}
|
||||
if (buttonColor == null) {
|
||||
buttonColor = "#d6dfdf";
|
||||
}
|
||||
if (buttonTextColor == null) {
|
||||
buttonTextColor = "#333333";
|
||||
}
|
||||
if (textFieldColor == null) {
|
||||
textFieldColor = "#f7f7fb";
|
||||
}
|
||||
if (textFieldTextColor == null) {
|
||||
textFieldTextColor = "#333333";
|
||||
}
|
||||
%>
|
||||
|
||||
BODY, TD, TH { font-family : Tahoma, Arial, Verdana, sans serif; font-size: 13px; }
|
||||
|
||||
H3 { font-size : 1.2em; }
|
||||
|
||||
.error-text { color : <%= errorTextColor %>; }
|
||||
|
||||
|
||||
/* default unvisited, visited and hover link presentation */
|
||||
A:link { background: transparent; color: <%= linkColor %>;
|
||||
text-decoration: none; }
|
||||
A:visited { background: transparent; color: <%= linkVisitedColor %>;
|
||||
text-decoration: none; }
|
||||
A:hover { background: transparent; color: <%= linkHoverColor %>;
|
||||
text-decoration: underline; }
|
||||
|
||||
/**
|
||||
* site wide BODY style rule; the scrollbar stuff only works in IE for windows,
|
||||
* but doesn't seem to hurt on other browsers..
|
||||
*/
|
||||
BODY.deffr { background-color: <%= bodyBGColor %>; color: <%= bodyTextColor %>;
|
||||
scrollbar-face-color: <%= bodyBGColor %>;
|
||||
scrollbar-shadow-color: <%= bodyTextColor %>;
|
||||
scrollbar-highlight-color: <%= bodyBGColor %>;
|
||||
scrollbar-darkshadow-color: <%= bodyBGColor %>;
|
||||
scrollbar-track-color: <%= bodyBGColor %>;
|
||||
scrollbar-arrow-color: <%= bodyTextColor %>; }
|
||||
|
||||
|
||||
FRAME.bordered_left { border-left: 3px solid <%= frameDividerColor %>; }
|
||||
|
||||
|
||||
IMG.logo { position: absolute; bottom: 12px; left: 10px; }
|
||||
|
||||
IMG.logout { vertical-align: middle; }
|
||||
|
||||
|
||||
INPUT.submit { background-color: <%= buttonColor %>; color: <%= buttonTextColor %>;
|
||||
font-size: 12px; font-family: Arial, Verdana, sans serif;
|
||||
border-style: ridge; margin: 1px 5px 1px 5px; }
|
||||
|
||||
INPUT.submit_right { background-color: <%= buttonColor %>; color: <%= buttonTextColor %>;
|
||||
font-size: 12px; font-family: Arial, Verdana, sans serif;
|
||||
border-style: ridge; margin: 1px 5px 1px 5px;
|
||||
position: absolute; right: 10px; }
|
||||
|
||||
INPUT.text { background-color: <%= textFieldColor %>; color: <%= textFieldTextColor %>;
|
||||
font: normal 12px Arial, Verdana, sans serif; height: 20px; width: 271px;
|
||||
border-style: groove; margin-left: 10px; }
|
||||
|
||||
|
||||
SPAN.chat_text { font: normal 11px Arial, Verdana, sans serif;
|
||||
color: <%= chatTextColor %>; }
|
||||
|
||||
SPAN.chat_announcement { font: italic 11px Arial, Verdana, sans serif;
|
||||
color: <%= chatAnnouncementColor %>; }
|
||||
|
||||
SPAN.chat_owner { font: bold 11px Arial, Verdana, sans serif;
|
||||
color: <%= chatOwnerLabelColor %>; }
|
||||
|
||||
SPAN.chat_participant { font: bold 11px Arial, Verdana, sans serif;
|
||||
color: <%= chatParticipantLabelColor %>; }
|
||||
|
||||
SPAN.logout { position: absolute; bottom: 12px; right: 15px; }
|
||||
|
||||
|
||||
TEXTAREA { color: <%= textFieldTextColor %>; font: normal 12px Arial, Verdana, sans serif;
|
||||
width: 500px; height: 130px; }
|
||||
13
CopyOftrunk/apps/webchat/source/web/transcript_frame.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="expires" content="0">
|
||||
|
||||
<link rel="stylesheet" href="style_sheet.jsp" type="text/css" media="screen">
|
||||
</head>
|
||||
|
||||
<body class="deffr">
|
||||
<div id="ytext"> <br></div><div id="enddiv"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||