From 0805c7ceb0dcfa58d0d090ccc4e3bdab8372a42b Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 20 Jun 2022 08:18:52 +0200 Subject: [PATCH] Add grind count to map view --- application/views/gridsquares/index.php | 4 ++-- application/views/interface_assets/footer.php | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/application/views/gridsquares/index.php b/application/views/gridsquares/index.php index 3639272e..e6502443 100644 --- a/application/views/gridsquares/index.php +++ b/application/views/gridsquares/index.php @@ -25,13 +25,13 @@
uri->segment(2) == "satellites") { ?> uri->segment(2) == "band") { ?> diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 0bb54f05..047b172d 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -1256,10 +1256,29 @@ $(document).ready(function(){ var grid_four = ; var grid_six = ; + var grid_two_count = grid_two.length; + var grid_four_count = grid_four.length; + var grid_six_count = grid_six.length; + var grid_two_confirmed = ; var grid_four_confirmed = ; var grid_six_confirmed = ; + var grid_two_confirmed_count = grid_two_confirmed.length; + var grid_four_confirmed_count = grid_four_confirmed.length; + var grid_six_confirmed_count = grid_six_confirmed.length; + + if (grid_four_confirmed_count > 0) { + var span = document.getElementById('confirmed_grids'); + span.innerText = span.textContent = '('+grid_four_confirmed_count+' grid squares)'; + } + if ((grid_four_count-grid_four_confirmed_count) > 0) { + var span = document.getElementById('worked_grids'); + span.innerText = span.textContent = '('+(grid_four_count-grid_four_confirmed_count)+' grid squares)'; + } + var span = document.getElementById('sum_grids'); + span.innerText = span.textContent = '| Total Count: '+grid_four_count+' grid squares'; + var maidenhead = L.maidenhead().addTo(map); map.on('click', onMapClick);