From 85a6a680b99023f1a111fb624040bdf5c0cf0d44 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Sat, 20 Jan 2018 22:59:31 +0100 Subject: [PATCH] Optimizations and changes. --- js/conf/Keybinds.js | 7 +++--- js/lib/PlayerDetect.js | 7 ------ js/modules/Resizer.js | 52 +++++++++++++++--------------------------- js/run/GlobalVars.js | 5 ++++ js/uw.js | 44 ++++++++++++++++++++++++++++------- manifest.json | 1 + 6 files changed, 64 insertions(+), 52 deletions(-) create mode 100644 js/run/GlobalVars.js diff --git a/js/conf/Keybinds.js b/js/conf/Keybinds.js index eacb75d..268428c 100644 --- a/js/conf/Keybinds.js +++ b/js/conf/Keybinds.js @@ -34,6 +34,10 @@ var DEFAULT_KEYBINDINGS = { var _kbd_process = function (event) { // Tukaj ugotovimo, katero tipko smo pritisnili + if(Debug.debug && Debug.keyboard ){ + console.log("%c[Keybinds::_kbd_process] we pressed a key: ", "color: #ff0", event.key , " | keydown: ", event.keydown, "event:", event); + } + // 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 @@ -46,9 +50,6 @@ var _kbd_process = function (event) { // Tukaj ugotovimo, katero tipko return; } - if(Debug.debug && Debug.keyboard ){ - console.log("[Keybinds::_kbd_process] we pressed a key: ", event.key , " | keydown: ", event.keydown, "event:", event); - } // building modifiers list: var modlist = ""; diff --git a/js/lib/PlayerDetect.js b/js/lib/PlayerDetect.js index da92c24..f2cda9a 100644 --- a/js/lib/PlayerDetect.js +++ b/js/lib/PlayerDetect.js @@ -35,19 +35,12 @@ var _pd_isFullScreen = function(){ var _pd_getPlayerDimensions = function(element){ if(_pd_isFullScreen()){ - if(Debug.debug){ - console.log("[PlayerDetect::_pd_getPlayerDimensions] video is full screen, returning player dimensions!"); - } return { width: screen.width, height: screen.height }; } - if(Debug.debug){ - console.log("[PlayerDetect::_pd_getPlayerDimensions] video is not full screen. Looking for player."); - } - var playerCandidateNode = element; // in case our