summaryrefslogtreecommitdiff
path: root/static/pichat.js
diff options
context:
space:
mode:
authorsostler <sbostler@gmail.com>2010-01-04 04:08:37 -0500
committersostler <sbostler@gmail.com>2010-01-04 04:08:37 -0500
commit450f4d7978578e9c263af522587cbf611c38a5b6 (patch)
tree99e05199bb60a605cbbaedafa3c7c8a4b4cbf778 /static/pichat.js
parent5c4d9aaf8c674183e38f5b7b499784714d025dc1 (diff)
Added additional rooms
Diffstat (limited to 'static/pichat.js')
-rwxr-xr-xstatic/pichat.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/static/pichat.js b/static/pichat.js
index 81882fe..5a40c62 100755
--- a/static/pichat.js
+++ b/static/pichat.js
@@ -75,8 +75,8 @@ function submitMessage() {
$.ajax({
type: 'GET',
timeout: 5000,
- url: 'msg',
- data: { 'content': content },
+ url: '/msg',
+ data: { 'room': Room, 'content': content },
cache: false,
dataType: 'json',
success: onSuccess,
@@ -107,7 +107,7 @@ function delayedScrollToBottom(delay) {
}
function updateUI(msgs, users) {
- if (msgs && msgs.length > 0) {
+ if (msgs !== null) {
var msgStr = $.map(msgs, buildMessageDiv).join('');
var wasScrolledToBottom = isScrolledToBottom($('#messageList')[0]);
$('#messageList').append(msgStr);
@@ -116,7 +116,7 @@ function updateUI(msgs, users) {
delayedScrollToBottom(500);
}
}
- if (users && users.length > 0) {
+ if (users !== null) {
$("#userList").html($.map(users, buildUserDiv).join(''));
}
}
@@ -136,7 +136,8 @@ function refresh() {
$.ajax({
type: 'GET',
timeout: 5000,
- url: 'refresh',
+ url: '/refresh',
+ data: { 'room': Room },
cache: false,
dataType: 'json',
success: onSuccess,