From 98576b9c4065ef1a0e5ae07573905d227b3ea3e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 13 Jun 2012 18:13:54 +0200 Subject: [PATCH] Adding JS for Fullscreen-Mode --- file/js/be.bastelstu.WCF.Chat.coffee | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/file/js/be.bastelstu.WCF.Chat.coffee b/file/js/be.bastelstu.WCF.Chat.coffee index 958990c..de20c7a 100644 --- a/file/js/be.bastelstu.WCF.Chat.coffee +++ b/file/js/be.bastelstu.WCF.Chat.coffee @@ -171,7 +171,25 @@ window.console ?= element.data 'status', 1 icon.attr 'src', icon.attr('src').replace /disabled(\d?).([a-z]{3})$/, 'enabled$1.$2' 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 $('#timsChatAutoscroll').click (event) -> $(this).removeClass 'active'