mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
ChatLeaveAction is now called on unloading
This commit is contained in:
parent
a7e6bab0cd
commit
409c6c068f
@ -64,6 +64,7 @@ consoleMock ?=
|
|||||||
# Binds all the events needed for Tims Chat.
|
# Binds all the events needed for Tims Chat.
|
||||||
###
|
###
|
||||||
bindEvents: () ->
|
bindEvents: () ->
|
||||||
|
# Mark window as focused
|
||||||
$(window).focus $.proxy () ->
|
$(window).focus $.proxy () ->
|
||||||
document.title = @titleTemplate.fetch
|
document.title = @titleTemplate.fetch
|
||||||
title: $('#timsChatRoomList .activeMenuItem a').text()
|
title: $('#timsChatRoomList .activeMenuItem a').text()
|
||||||
@ -71,10 +72,16 @@ consoleMock ?=
|
|||||||
@isActive = true
|
@isActive = true
|
||||||
, @
|
, @
|
||||||
|
|
||||||
|
# Mark window as blurred
|
||||||
$(window).blur $.proxy () ->
|
$(window).blur $.proxy () ->
|
||||||
@isActive = false
|
@isActive = false
|
||||||
, @
|
, @
|
||||||
|
|
||||||
|
# Unload the chat
|
||||||
|
$(window).unload $.proxy () ->
|
||||||
|
@unload()
|
||||||
|
, @
|
||||||
|
|
||||||
# Insert a smiley
|
# Insert a smiley
|
||||||
$('.smiley').click $.proxy (event) ->
|
$('.smiley').click $.proxy (event) ->
|
||||||
@insertText ' ' + $(event.target).attr('alt') + ' '
|
@insertText ' ' + $(event.target).attr('alt') + ' '
|
||||||
@ -449,4 +456,11 @@ consoleMock ?=
|
|||||||
else
|
else
|
||||||
li.addClass 'activeMenuItem'
|
li.addClass 'activeMenuItem'
|
||||||
li.find('.timsChatUserMenu').wcfBlindIn 'vertical'
|
li.find('.timsChatUserMenu').wcfBlindIn 'vertical'
|
||||||
|
###
|
||||||
|
# Unloads the chat.
|
||||||
|
###
|
||||||
|
unload: () ->
|
||||||
|
$.ajax @config.unloadURL,
|
||||||
|
type: 'POST'
|
||||||
|
async: false
|
||||||
)(jQuery, @, consoleMock)
|
)(jQuery, @, consoleMock)
|
||||||
|
@ -186,8 +186,7 @@
|
|||||||
// populate config
|
// populate config
|
||||||
TimWolla.WCF.Chat.config = {
|
TimWolla.WCF.Chat.config = {
|
||||||
reloadTime: {@CHAT_RELOADTIME},
|
reloadTime: {@CHAT_RELOADTIME},
|
||||||
animations: {@CHAT_ANIMATIONS},
|
unloadURL: '{link controller='Chat' action='Leave'}{/link}'
|
||||||
maxTextLength: {@CHAT_LENGTH}
|
|
||||||
}
|
}
|
||||||
WCF.Language.addObject({
|
WCF.Language.addObject({
|
||||||
'wcf.chat.query': '{lang}wcf.chat.query{/lang}',
|
'wcf.chat.query': '{lang}wcf.chat.query{/lang}',
|
||||||
|
Loading…
Reference in New Issue
Block a user