mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Codeformat and fullscreen-event
This commit is contained in:
parent
f5a5d21f6d
commit
a95896ae28
@ -165,16 +165,16 @@ window.console ?=
|
|||||||
icon = element.find 'img'
|
icon = element.find 'img'
|
||||||
if element.data('status') is 1
|
if element.data('status') is 1
|
||||||
element.data 'status', 0
|
element.data 'status', 0
|
||||||
icon.attr 'src', icon.attr('src').replace /enabled(\d?).([a-z]{3})$/, 'disabled$1.$2'
|
icon.attr 'src', icon.attr('src').replace /enabled(Inverse)?.([a-z]{3})$/, 'disabled$1.$2'
|
||||||
element.attr 'title', element.data 'enableMessage'
|
element.attr 'title', element.data 'enableMessage'
|
||||||
else
|
else
|
||||||
element.data 'status', 1
|
element.data 'status', 1
|
||||||
icon.attr 'src', icon.attr('src').replace /disabled(\d?).([a-z]{3})$/, 'enabled$1.$2'
|
icon.attr 'src', icon.attr('src').replace /disabled(Inverse)?.([a-z]{3})$/, 'enabled$1.$2'
|
||||||
element.attr 'title', element.data 'disableMessage'
|
element.attr 'title', element.data 'disableMessage'
|
||||||
|
|
||||||
# Enable fullscreen-mode on #main
|
# Enable fullscreen-mode on #main
|
||||||
$('#timsChatFullscreen').click (event) ->
|
$('#timsChatFullscreen').click (event) ->
|
||||||
if $(this).data 'status'
|
if $(@).data 'status'
|
||||||
main = $('#main')[0]
|
main = $('#main')[0]
|
||||||
if typeof main.requestFullscreen isnt 'undefined'
|
if typeof main.requestFullscreen isnt 'undefined'
|
||||||
main.requestFullscreen()
|
main.requestFullscreen()
|
||||||
@ -190,17 +190,23 @@ window.console ?=
|
|||||||
else if typeof document.webkitCancelFullScreen isnt 'undefined'
|
else if typeof document.webkitCancelFullScreen isnt 'undefined'
|
||||||
document.webkitCancelFullScreen()
|
document.webkitCancelFullScreen()
|
||||||
|
|
||||||
|
# Bind Fullscreen-change event
|
||||||
|
$(document).on 'fullscreenchange mozfullscreenchange webkitfullscreenchange', (event) ->
|
||||||
|
if $('#timsChatFullscreen').data 'status'
|
||||||
|
unless document.fullscreen or document.mozFullScreen or document.webkitIsFullScreen
|
||||||
|
$('#timsChatFullscreen').click();
|
||||||
|
|
||||||
# Immediatly scroll down when activating autoscroll
|
# Immediatly scroll down when activating autoscroll
|
||||||
$('#timsChatAutoscroll').click (event) ->
|
$('#timsChatAutoscroll').click (event) ->
|
||||||
$(this).removeClass 'active'
|
$(@).removeClass 'active'
|
||||||
if $(this).data 'status'
|
if $(@).data 'status'
|
||||||
$('.timsChatMessageContainer').scrollTop $('.timsChatMessageContainer ul').height()
|
$('.timsChatMessageContainer').scrollTop $('.timsChatMessageContainer ul').height()
|
||||||
@oldScrollTop = $('.timsChatMessageContainer').scrollTop()
|
@oldScrollTop = $('.timsChatMessageContainer').scrollTop()
|
||||||
|
|
||||||
# Desktop Notifications
|
# Desktop Notifications
|
||||||
unless typeof window.webkitNotifications is 'undefined'
|
unless typeof window.webkitNotifications is 'undefined'
|
||||||
$('#timsChatNotify').click (event) ->
|
$('#timsChatNotify').click (event) ->
|
||||||
window.webkitNotifications.requestPermission() if $(this).data 'status'
|
window.webkitNotifications.requestPermission() if $(@).data 'status'
|
||||||
|
|
||||||
###
|
###
|
||||||
# Changes the chat-room.
|
# Changes the chat-room.
|
||||||
|
Loading…
Reference in New Issue
Block a user