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

Remove fullscreen button, when fullscreen is not supported

This commit is contained in:
Tim Düsterhus 2012-06-17 17:37:58 +02:00
parent a95896ae28
commit fc378725e7

View File

@ -172,29 +172,32 @@ window.console ?=
icon.attr 'src', icon.attr('src').replace /disabled(Inverse)?.([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 if document.fullscreen or document.mozFullScreen or document.webkitIsFullScreen
$('#timsChatFullscreen').click (event) -> # Enable fullscreen-mode on #main
if $(@).data 'status' $('#timsChatFullscreen').click (event) ->
main = $('#main')[0] if $(@).data 'status'
if typeof main.requestFullscreen isnt 'undefined' main = $('#main')[0]
main.requestFullscreen() if typeof main.requestFullscreen isnt 'undefined'
else if typeof main.mozRequestFullScreen isnt 'undefined' main.requestFullscreen()
main.mozRequestFullScreen() else if typeof main.mozRequestFullScreen isnt 'undefined'
else if typeof main.webkitRequestFullScreen isnt 'undefined' main.mozRequestFullScreen()
main.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT) else if typeof main.webkitRequestFullScreen isnt 'undefined'
else main.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)
if typeof document.exitFullscreen isnt 'undefined' else
document.exitFullscreen() if typeof document.exitFullscreen isnt 'undefined'
else if typeof document.mozCancelFullScreen isnt 'undefined' document.exitFullscreen()
document.mozCancelFullScreen() else if typeof document.mozCancelFullScreen isnt 'undefined'
else if typeof document.webkitCancelFullScreen isnt 'undefined' document.mozCancelFullScreen()
document.webkitCancelFullScreen() else if typeof document.webkitCancelFullScreen isnt 'undefined'
document.webkitCancelFullScreen()
# Bind Fullscreen-change event
$(document).on 'fullscreenchange mozfullscreenchange webkitfullscreenchange', (event) -> # Bind Fullscreen-change event
if $('#timsChatFullscreen').data 'status' $(document).on 'fullscreenchange mozfullscreenchange webkitfullscreenchange', (event) ->
unless document.fullscreen or document.mozFullScreen or document.webkitIsFullScreen if $('#timsChatFullscreen').data 'status'
$('#timsChatFullscreen').click(); unless document.fullscreen or document.mozFullScreen or document.webkitIsFullScreen
$('#timsChatFullscreen').click()
else
$('#timsChatFullscreen').remove()
# Immediatly scroll down when activating autoscroll # Immediatly scroll down when activating autoscroll
$('#timsChatAutoscroll').click (event) -> $('#timsChatAutoscroll').click (event) ->