1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-18 16:47:58 +01:00
Smack/apps/webchat/source/web/iframe.html

56 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">
<meta http-equiv="cache-control" content="no-cache">
<title>Chat Session</title>
<script language="JavaScript" type="text/javascript">
var currUsername = window.parent.frames['data'].currUsername;
var data = window.parent.frames['data'].data;
function printChat() {
for (var i in data) {
if (data[i][0] == '') {
// server message
document.write("<div class='chat-statement'><span class='server-message'>"
+ data[i][1] + "</span></div>");
}
else {
// conversation part
var partialClassName = (data[i][0] == currUsername) ? "-user" : "";
document.write("<div class='chat-statement'><span class='chat-username"
+ partialClassName + "'>" + data[i][0]
+ ":</span> <span class='chat-text"+ partialClassName
+ "'>" + data[i][1] + "</span></div>");
}
}
window.focus();
}
</script>
<style type="text/css">
.chat-username { font-weight : bold; color : blue; }
.chat-username-user { font-weight : bold; color : red; }
.chat-statement { padding-bottom : 3px; }
.server-message { font-color : #999; font-style : italic; }
</style>
</head>
<body bgcolor="#ffffff" leftmargin="5">
<script language="JavaScript" type="text/javascript">
printChat();
</script>
&nbsp;
<script language="JavaScript" type="text/javascript">
var data = window.parent.frames['data'].data;
if (data != null) {
self.scrollTo(0,(30*data.length));
// Do not delete second line! IE needs it for some reason...
self.scrollTo(0,(30*data.length));
}
</script>
</body>
</html>