mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Simulating fullscreen mode
It works now in every modern browser and does not throw a warning.
This commit is contained in:
parent
ec8843fa1e
commit
32d16f4213
@ -174,32 +174,12 @@ window.console ?=
|
||||
icon.attr 'src', icon.attr('src').replace /disabled(Inverse)?.([a-z]{3})$/, 'enabled$1.$2'
|
||||
element.attr 'title', element.data 'disableMessage'
|
||||
|
||||
main = $('#main')[0]
|
||||
if typeof main.requestFullscreen isnt 'undefined' or typeof main.mozRequestFullScreen isnt 'undefined' or typeof main.webkitRequestFullScreen isnt 'undefined'
|
||||
# Enable fullscreen-mode on #main
|
||||
# Enable fullscreen-mode
|
||||
$('#timsChatFullscreen').click (event) ->
|
||||
if $(@).data 'status'
|
||||
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(Element.ALLOW_KEYBOARD_INPUT)
|
||||
$('html').addClass('fullscreen');
|
||||
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()
|
||||
|
||||
# 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()
|
||||
else
|
||||
$('#timsChatFullscreen').parent().remove()
|
||||
$('html').removeClass('fullscreen');
|
||||
|
||||
# Immediatly scroll down when activating autoscroll
|
||||
$('#timsChatAutoscroll').click (event) ->
|
||||
|
@ -279,8 +279,19 @@ .sidebarContent {
|
||||
}
|
||||
}
|
||||
|
||||
#tplChat {
|
||||
#main:-moz-full-screen {
|
||||
html.fullscreen {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
#pageHeader, #pageFooter {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tplChat {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
#main {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
@ -289,20 +300,5 @@ #tplChat {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
#main:-webkit-full-screen {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
> div, .sidebar, #sidebarContainer {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
#main:fullscreen {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
> div, .sidebar, #sidebarContainer {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user