Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

57 lines (50 sloc) 1.307 kB
<html>
<head>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<style type="text/css">
body {
font-family: Helvetica;
font-size: 11pt;
}
#messages {
list-style-type: none;
margin: 0;
padding: 0;
}
#messages li {
margin: 0;
padding: 5px 0;
border-bottom: 1px #ddd solid;
}
#messages .from {
color: #74b5ca;
}
#messages .unsynced {
color: #bbb;
}
</style>
</head>
<body>
<script type="text/javascript">
function receiveMessage(data) {
$("#loading").hide();
if($('#msg_'+data.date).length == 0) {
$("#messages").append('<li><span class="from" id="msg_'+data.date+'">'+data.from+'</span> <span class="text">'+data.text+'</span></li>');
window.scrollTo(document.body.scrollWidth, document.body.scrollHeight);
}
}
function sentMessage(data) {
$("#messages").append('<li class="unsynced" id="tag_'+data.tag+'"><span class="from">You</span> <span class="text">'+data.text+'</span></li>');
window.scrollTo(document.body.scrollWidth, document.body.scrollHeight);
}
function confirmMessage(tag) {
$("#tag_"+tag).removeClass("unsynced");
}
</script>
<!-- <div id="loading"><img src="ajax-loader.gif" /></div> -->
<ul id="messages">
<li>This is a message</li>
<li>This is another message</li>
</ul>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.