1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2025-01-09 00:20:08 +00:00

Adding JS for Fullscreen-Mode

This commit is contained in:
Tim Düsterhus 2012-06-13 18:13:54 +02:00
parent 4a5adc9645
commit 98576b9c40

View File

@ -171,7 +171,25 @@ window.console ?=
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(\d?).([a-z]{3})$/, 'enabled$1.$2'
element.attr 'title', element.data 'disableMessage' element.attr 'title', element.data 'disableMessage'
# Enable fullscreen-mode on #main
$('#timsChatFullscreen').click (event) ->
if $(this).data 'status'
main = $('#main')[0]
if typeof main.requestFullscreen isnt 'undefined'
main.requestFullscreen()
else if typeof main.mozRequestFullScreen isnt 'undefined'
main.mozRequestFullScreen()
else if typeof main.webkitRequestFullScreen isnt 'undefined'
main.webkitRequestFullScreen()
else
if typeof document.exitFullscreen isnt 'undefined'
document.exitFullscreen()
else if typeof document.mozCancelFullScreen isnt 'undefined'
document.mozCancelFullScreen()
else if typeof document.webkitCancelFullScreen isnt 'undefined'
document.webkitCancelFullScreen()
# Immediatly scroll down when activating autoscroll # Immediatly scroll down when activating autoscroll
$('#timsChatAutoscroll').click (event) -> $('#timsChatAutoscroll').click (event) ->
$(this).removeClass 'active' $(this).removeClass 'active'