1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Load new messages every X seconds

This commit is contained in:
max-m 2011-12-26 18:46:48 +01:00
parent 461be89d85
commit ae88c3246c

View File

@ -18,6 +18,7 @@ TimWolla.WCF ?= {}
@bindEvents() @bindEvents()
@refreshRoomList() @refreshRoomList()
new WCF.PeriodicalExecuter $.proxy(@refreshRoomList, this), 60e3 new WCF.PeriodicalExecuter $.proxy(@refreshRoomList, this), 60e3
new WCF.PeriodicalExecuter $.proxy(@getMessages, this), @config.reloadTime * 1000
$('#chatInput').focus() $('#chatInput').focus()
### ###
@ -208,7 +209,7 @@ TimWolla.WCF ?= {}
# break if input contains only whitespace # break if input contains only whitespace
return false if $('#chatInput').val().trim().length is 0 return false if $('#chatInput').val().trim().length is 0
@freeTheFish() if $('#chatInput').val().trim() is '/free the fish' @freeTheFish() if $('#chatInput').val().trim().toLowerCase() is '/free the fish'
$.ajax $('#chatForm').attr('action'), $.ajax $('#chatForm').attr('action'),
data: data: