1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-14 16:22:07 +01:00
Smack/apps/webchat/source/web/chat-main.html

67 lines
1.7 KiB
HTML
Raw Normal View History

<!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 Session</title>
<script language="JavaScript" type="text/javascript">
// update the send button to be disabled/enabled
function updateButton(el) {
if (el.value != '') {
el.form.send.disabled = false;
}
else {
el.form.send.disabled = true;
}
}
function handleSubmit(el) {
// el is the form
var chatform = window.parent.frames['form'].document.chatform;
chatform.message.value = el.message.value;
chatform.submit();
el.message.value = '';
el.message.focus();
updateButton(el.message);
// return false so this form does not sumbmit:
return false;
}
</script>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<form name="chatform" onsubmit="return handleSubmit(this);">
<tr valign="top">
<td colspan="2" style="padding:8px;">
<iframe src="chat-conv.html" frameborder="0"
id="chatconv"
style="border:1px #ccc solid;width:100%;height:250px;" scrolling="yes"
height="100%" width="100%"></iframe>
</td>
</tr>
<tr>
<td width="99%" style="padding:0px 2px 0px 8px;">
<textarea name="message" cols="50" rows="4" style="width:100%" wrap="virtual"
onkeyup="updateButton(this);"
onchange="updateButton(this);"></textarea>
</td>
<td width="1%" nowrap style="padding:0px 8px 0px 2px;">
<input type="submit" name="send" value="Send" style="padding-left:5px;padding-right:5px;" disabled>
</td>
</tr>
</form>
</table>
<script language="JavaScript" type="text/javascript">
document.chatform.message.focus();
</script>
</body>
</html>