mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40: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'
|
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'
|
||||||
|
|
||||||
main = $('#main')[0]
|
# Enable fullscreen-mode
|
||||||
if typeof main.requestFullscreen isnt 'undefined' or typeof main.mozRequestFullScreen isnt 'undefined' or typeof main.webkitRequestFullScreen isnt 'undefined'
|
|
||||||
# Enable fullscreen-mode on #main
|
|
||||||
$('#timsChatFullscreen').click (event) ->
|
$('#timsChatFullscreen').click (event) ->
|
||||||
if $(@).data 'status'
|
if $(@).data 'status'
|
||||||
if typeof main.requestFullscreen isnt 'undefined'
|
$('html').addClass('fullscreen');
|
||||||
main.requestFullscreen()
|
|
||||||
else if typeof main.mozRequestFullScreen isnt 'undefined'
|
|
||||||
main.mozRequestFullScreen()
|
|
||||||
else if typeof main.webkitRequestFullScreen isnt 'undefined'
|
|
||||||
main.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)
|
|
||||||
else
|
else
|
||||||
if typeof document.exitFullscreen isnt 'undefined'
|
$('html').removeClass('fullscreen');
|
||||||
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()
|
|
||||||
|
|
||||||
# Immediatly scroll down when activating autoscroll
|
# Immediatly scroll down when activating autoscroll
|
||||||
$('#timsChatAutoscroll').click (event) ->
|
$('#timsChatAutoscroll').click (event) ->
|
||||||
|
@ -279,8 +279,19 @@ .sidebarContent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html.fullscreen {
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
#pageHeader, #pageFooter {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#tplChat {
|
#tplChat {
|
||||||
#main:-moz-full-screen {
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
#main {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@ -289,20 +300,5 @@ #tplChat {
|
|||||||
height: 100%;
|
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