From 450f4d7978578e9c263af522587cbf611c38a5b6 Mon Sep 17 00:00:00 2001 From: sostler Date: Mon, 4 Jan 2010 04:08:37 -0500 Subject: Added additional rooms --- static/pichat.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'static') 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, -- cgit v1.2.3-70-g09d2