mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
parent
a7e63a5954
commit
be1479940f
@ -31,6 +31,7 @@ exposed by a function if necessary.
|
|||||||
|
|
||||||
isActive = true
|
isActive = true
|
||||||
newMessageCount = 0
|
newMessageCount = 0
|
||||||
|
scrollUpNotifications = off
|
||||||
chatSession = Date.now()
|
chatSession = Date.now()
|
||||||
errorVisible = false
|
errorVisible = false
|
||||||
|
|
||||||
@ -57,7 +58,6 @@ exposed by a function if necessary.
|
|||||||
titleTemplate: null
|
titleTemplate: null
|
||||||
messageTemplate: null
|
messageTemplate: null
|
||||||
userTemplate: null
|
userTemplate: null
|
||||||
|
|
||||||
config: null
|
config: null
|
||||||
|
|
||||||
Initialize **Tims Chat**. Bind needed DOM events and initialize data structures.
|
Initialize **Tims Chat**. Bind needed DOM events and initialize data structures.
|
||||||
@ -271,10 +271,13 @@ Scroll down when autoscroll is being activated.
|
|||||||
|
|
||||||
if scrollTop < scrollHeight - height - 25
|
if scrollTop < scrollHeight - height - 25
|
||||||
if $('#timsChatAutoscroll').data('status') is 1
|
if $('#timsChatAutoscroll').data('status') is 1
|
||||||
|
scrollUpNotifications = on
|
||||||
$('#timsChatAutoscroll').click()
|
$('#timsChatAutoscroll').click()
|
||||||
|
|
||||||
if scrollTop > scrollHeight - height - 10
|
if scrollTop > scrollHeight - height - 10
|
||||||
if $('#timsChatAutoscroll').data('status') is 0
|
if $('#timsChatAutoscroll').data('status') is 0
|
||||||
|
scrollUpNotifications = off
|
||||||
|
$(@).removeClass 'notification'
|
||||||
$('#timsChatAutoscroll').click()
|
$('#timsChatAutoscroll').click()
|
||||||
|
|
||||||
Enable duplicate tab detection.
|
Enable duplicate tab detection.
|
||||||
@ -380,7 +383,6 @@ Fetch new messages from the server and pass them to `handleMessages`. The userli
|
|||||||
console.error 'To many failures, aborting'
|
console.error 'To many failures, aborting'
|
||||||
|
|
||||||
showError WCF.Language.get 'chat.error.onMessageLoad'
|
showError WCF.Language.get 'chat.error.onMessageLoad'
|
||||||
|
|
||||||
complete: ->
|
complete: ->
|
||||||
loading = false
|
loading = false
|
||||||
|
|
||||||
@ -500,10 +502,12 @@ the existing text. If `options.submit` is true the message will be sent to the s
|
|||||||
else
|
else
|
||||||
$('#timsChatInput').focus()
|
$('#timsChatInput').focus()
|
||||||
|
|
||||||
|
|
||||||
Send out notifications for the given `message`. The number of unread messages will be prepended to `document.title` and if available desktop notifications will be sent.
|
Send out notifications for the given `message`. The number of unread messages will be prepended to `document.title` and if available desktop notifications will be sent.
|
||||||
|
|
||||||
notify = (message) ->
|
notify = (message) ->
|
||||||
|
if scrollUpNotifications
|
||||||
|
$('#timsChatMessageContainer').addClass 'notification'
|
||||||
|
|
||||||
return if isActive or $('#timsChatNotify').data('status') is 0
|
return if isActive or $('#timsChatNotify').data('status') is 0
|
||||||
|
|
||||||
document.title = v.titleTemplate.fetch
|
document.title = v.titleTemplate.fetch
|
||||||
@ -640,7 +644,6 @@ And finally export the public methods and variables.
|
|||||||
add: addListener
|
add: addListener
|
||||||
remove: removeListener
|
remove: removeListener
|
||||||
|
|
||||||
|
|
||||||
window.be ?= {}
|
window.be ?= {}
|
||||||
be.bastelstu ?= {}
|
be.bastelstu ?= {}
|
||||||
window.be.bastelstu.Chat = Chat
|
window.be.bastelstu.Chat = Chat
|
||||||
|
@ -6,6 +6,16 @@
|
|||||||
* @license Creative Commons Attribution-NonCommercial-ShareAlike <http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode>
|
* @license Creative Commons Attribution-NonCommercial-ShareAlike <http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode>
|
||||||
* @package be.bastelstu.wcf.chat
|
* @package be.bastelstu.wcf.chat
|
||||||
*/
|
*/
|
||||||
|
@keyframes timsChatNotify {
|
||||||
|
from {
|
||||||
|
border-color: @wcfContainerBorderColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
border-color: @wcfInputHoverBorderColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#tplChat {
|
#tplChat {
|
||||||
#main > div {
|
#main > div {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -251,6 +261,15 @@
|
|||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
min-height: 150px;
|
min-height: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.notification {
|
||||||
|
animation-duration: .2s;
|
||||||
|
animation-name: timsChatNotify;
|
||||||
|
animation-iteration-count: 5;
|
||||||
|
animation-direction: alternate;
|
||||||
|
animation-timing-function: linear;
|
||||||
|
border-color: @wcfInputHoverBorderColor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
html.fullscreen {
|
html.fullscreen {
|
||||||
|
Loading…
Reference in New Issue
Block a user