From 3b3430ddced99ef7344f560769d8520fd479fe42 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Thu, 18 Jan 2018 22:34:42 +0100 Subject: [PATCH] Merged FullScreenDetect into PlayerDetect. Youtube: switching between theater mode, full screen and normal mode works properly. Vimeo still broken. --- js/conf/Keybinds.js | 2 +- js/lib/FullScreenDetect.js | 10 --- js/lib/PlayerDetect.js | 31 ++++++--- js/modules/ArDetect.js | 4 +- js/modules/Resizer.js | 51 +++----------- js/uw.js | 132 +++++++++++++++++++------------------ manifest.json | 1 - 7 files changed, 102 insertions(+), 129 deletions(-) delete mode 100644 js/lib/FullScreenDetect.js diff --git a/js/conf/Keybinds.js b/js/conf/Keybinds.js index 8d99012..eacb75d 100644 --- a/js/conf/Keybinds.js +++ b/js/conf/Keybinds.js @@ -37,7 +37,7 @@ var _kbd_process = function (event) { // Tukaj ugotovimo, katero tipko // Tipke upoštevamo samo, če smo v celozaslonskem načinu oz. če ne pišemo komentarja // v nasprotnem primeru ne naredimo nič. // We only take actions if we're in full screen or not writing a comment - if( !(FullScreenDetect.isFullScreen() || ( + if( !(PlayerDetect.isFullScreen() || ( (document.activeElement.getAttribute("role") != "textbox") && (document.activeElement.getAttribute("type") != "text") ))){ diff --git a/js/lib/FullScreenDetect.js b/js/lib/FullScreenDetect.js deleted file mode 100644 index b417441..0000000 --- a/js/lib/FullScreenDetect.js +++ /dev/null @@ -1,10 +0,0 @@ -if(Debug.debug) - console.log("Loading: FullScreenDetect.js"); - -var _fsd_isFullScreen = function(){ - return ( window.innerHeight == window.screen.height && window.innerWidth == window.screen.width); -} - -var FullScreenDetect = { - isFullScreen: _fsd_isFullScreen -} diff --git a/js/lib/PlayerDetect.js b/js/lib/PlayerDetect.js index c59bcb9..da92c24 100644 --- a/js/lib/PlayerDetect.js +++ b/js/lib/PlayerDetect.js @@ -1,3 +1,10 @@ +if(Debug.debug) + console.log("Loading: FullScreenDetect.js"); + +var _pd_isFullScreen = function(){ + return ( window.innerHeight == window.screen.height && window.innerWidth == window.screen.width); +} + /* sprejme