corrade-http-templates – Diff between revs 5 and 22
?pathlinks?
Rev 5 | Rev 22 | |||
---|---|---|---|---|
Line 40... | Line 40... | |||
40 | } |
40 | } |
|
41 | // Polls the chatlog every second for changes. |
41 | // Polls the chatlog every second for changes. |
|
42 | (function retrieveMessages() { |
42 | (function retrieveMessages() { |
|
43 | $.get("chat.log?t=" + Math.random(), function(data) { |
43 | $.get("chat.log?t=" + Math.random(), function(data) { |
|
44 | $("#chat").html(data); |
44 | $("#chat").html(data); |
|
45 | $("#chat").animate({ |
- | ||
46 | scrollTop:$("#chat")[0].scrollHeight - $("#chat").height() |
45 | $("#chat").scrollTop($("#chat")[0].scrollHeight); |
|
47 | },1000); |
- | ||
48 | setTimeout(retrieveMessages, 1000); |
46 | setTimeout(retrieveMessages, 1000); |
|
49 | }); |
47 | }); |
|
50 | }()); |
48 | }()); |
|
51 | // When the send button is pressed, then call the sendGroupMessage function to |
49 | // When the send button is pressed, then call the sendGroupMessage function to |
|
52 | // send the message to the PHP script, which then send the message to Corrade. |
50 | // send the message to the PHP script, which then send the message to Corrade. |