From 4cd9adca3d8e4a16022da82756b59fdef761e43e Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Sun, 1 Mar 2020 00:11:19 +0100 Subject: [PATCH] noIsolation and noSidebar URL query options sidebarWidth=440px : shows sidebar and sets width. hideButtons : hide all the buttons --- html/config.js | 2 ++ html/defaults.js | 2 ++ html/index.html | 4 ++-- html/script.js | 24 +++++++++++++++++++++++- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/html/config.js b/html/config.js index a1c01bb..7278340 100644 --- a/html/config.js +++ b/html/config.js @@ -228,3 +228,5 @@ HideCols = [ // Display only the last leg of a flight in globeIndex mode. //lastLeg = true; +// +//hideButtons = false; diff --git a/html/defaults.js b/html/defaults.js index 09bc15a..89178ba 100644 --- a/html/defaults.js +++ b/html/defaults.js @@ -249,3 +249,5 @@ var showPictures = false; var enableDWD = true; var lastLeg = true; + +var hideButtons = false; diff --git a/html/index.html b/html/index.html index b8ac4d7..faf5d57 100644 --- a/html/index.html +++ b/html/index.html @@ -688,7 +688,7 @@ - +
Search: @@ -711,7 +711,7 @@
- +
diff --git a/html/script.js b/html/script.js index ff12272..b3daef9 100644 --- a/html/script.js +++ b/html/script.js @@ -572,6 +572,13 @@ function initialize() { if (!isNaN(tmp)) largeMode = tmp; } + + if (search.has('hideSidebar')) + localStorage['sidebar_visible'] = "false"; + if (search.has('sidebarWidth')) { + localStorage['sidebar_width'] = search.get('sidebarWidth'); + localStorage['sidebar_visible'] = "true"; + } } catch (error) { console.log(error); } @@ -1099,6 +1106,17 @@ function parse_history() { } else { sortByAltitude(); } + + + if (hideButtons) { + $('#large_mode_control').hide(); + $('#header_top').hide(); + $('#header_side').hide(); + $('#splitter').hide(); + $('#jumpSearch').hide(); + $('#filterButton').hide(); + $('.ol-control').hide(); + } } // Make a LineString with 'points'-number points @@ -3428,7 +3446,8 @@ function processURLParams(){ } if (icao != null) { - toggleIsolation("on", false); + if (!search.has('noIsolation')) + toggleIsolation("on", false); if (Planes[icao] || globeIndex) { console.log('Selected ICAO id: '+ icao); var selectOptions = {follow: follow}; @@ -3452,6 +3471,9 @@ function processURLParams(){ OLMap.getView().setZoom(zoom); } + if (search.has('hideButtons')) + hideButtons = true; + } catch (error) { console.log(error); }