1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-19 17:17:57 +01:00
Smack/CopyOftrunk/apps/webchat/source/web/input_frame.jsp
Gaston Dombiak 7ae75258be smack_1_5_1
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2639 b35dd754-fafc-0310-a699-88a17e54d16e
2005-08-12 21:09:32 +00:00

75 lines
1.7 KiB
Text

<%@ 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>