From 5ffdfe77e50f2fcc7c646c6791542295ead69ec5 Mon Sep 17 00:00:00 2001 From: Vincent Date: Thu, 12 Nov 2020 09:58:33 +0100 Subject: [PATCH] . --- .idea/workspace.xml | 32 ++++++++++++++++++-------------- js/cordova.js | 14 +++++++++++++- js/home.js | 3 +++ scripts/lib/lib.php | 15 +++++++-------- scripts/lib/remoteinfos.php | 9 ++++++--- 5 files changed, 47 insertions(+), 26 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 8744732..3a15a4b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,11 @@ - + + + + + @@ -1296,12 +1300,12 @@ - + - + @@ -1325,11 +1329,11 @@ - + - + diff --git a/js/cordova.js b/js/cordova.js index e0872a3..2b0cfe4 100644 --- a/js/cordova.js +++ b/js/cordova.js @@ -5,7 +5,6 @@ function onDeviceReady() { } function initCordova() { - try { screen.orientation.lock('landscape'); } catch (e) { @@ -17,6 +16,19 @@ function initCordova() { } catch (e) { console.log(e); } + console.log(location.host); + + if (location.host === 'home.tortuga.enhydra.fr') { + var last = localStorage.getItem('lastconfig'); + if (last === null) { + last = 'salon'; + } + location.host = last + '.home.tortuga.enhydra.fr'; + } else { + var e = location.host.split('.'); + localStorage.setItem('lastconfig', e[0]); + } + try { window.plugins.intentShim.onIntent(function (intent) { diff --git a/js/home.js b/js/home.js index dcca7e9..0621e40 100644 --- a/js/home.js +++ b/js/home.js @@ -272,6 +272,7 @@ $(function () { default: break; } + menudrawer.close(); return false; }); @@ -855,6 +856,8 @@ function resize() { $("section").css('fontSize', s); if ($('section:visible .col').length > 0) { var minWidth = baseCellWidth * s * $('section:visible .col').length + 40; + } else { + minWidth = ww; } $("main").css({ height: hh, diff --git a/scripts/lib/lib.php b/scripts/lib/lib.php index 68e603f..dcf3b14 100644 --- a/scripts/lib/lib.php +++ b/scripts/lib/lib.php @@ -77,20 +77,19 @@ function getCurrentConfig() $_GET['c'] = $forceConfig; } + $expires = time() + 60 * 60 * 24 * 30; if (isset($_GET['c'])) { - setcookie('config', $_GET['c'], 0, '/'); - $_COOKIE['config'] = $_GET['c']; + setcookie('homeconfig', $_GET['c'], $expires, '/', 'enhydra.fr'); + $_COOKIE['homeconfig'] = $_GET['c']; } - if (!isset($_COOKIE['config'])) { + if (!isset($_COOKIE['homeconfig'])) { if (!headers_sent()) { - setcookie('config', 'default', 0, '/'); + setcookie('homeconfig', 'salon', $expires, '/', 'enhydra.fr'); } - - $_COOKIE['config'] = 'default'; - + $_COOKIE['homeconfig'] = 'salon'; } - return $_COOKIE['config']; + return $_COOKIE['homeconfig']; } function config($key = null, $value = null) diff --git a/scripts/lib/remoteinfos.php b/scripts/lib/remoteinfos.php index 829c73a..da2874e 100644 --- a/scripts/lib/remoteinfos.php +++ b/scripts/lib/remoteinfos.php @@ -9,11 +9,11 @@ function remoteInfos() } else { if (($p === 'netflix' || $p === 'tv') && config('TVPLAYER') === 'shield') { $res = ['type' => 'shield', 'can_seek' => false]; - }else { + } else { if ($p == 'mediarasp') { - if(config('VIDEOPLAYER')==='shield'){ + if (config('VIDEOPLAYER') === 'shield') { $res = ['type' => 'shieldmedia', 'can_seek' => false]; - }else { + } else { $res = mediaraspRemoteInfos(); } } else { @@ -23,6 +23,9 @@ function remoteInfos() } $res['playing'] = $playing; $res['device'] = config('DEVICE'); + if ($res['type'] === 'mycanal') { + $res['type'] = 'shield'; + } $json = json_encode($res); $cacheName = 'remote_infos_' . config('DEVICE'); -- 2.39.5