From b63ebc02be31b8d181ccaad7254771e56c19bee4 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Tue, 12 Oct 2021 13:10:54 +0200 Subject: [PATCH 1/2] [Contest Logging] Started work on adding DOK to exchange --- application/controllers/Contesting.php | 1 + application/views/contesting/index.php | 19 +++++- assets/js/sections/contesting.js | 81 ++++++++++++-------------- 3 files changed, 53 insertions(+), 48 deletions(-) diff --git a/application/controllers/Contesting.php b/application/controllers/Contesting.php index 6beb4edf..0200380a 100644 --- a/application/controllers/Contesting.php +++ b/application/controllers/Contesting.php @@ -22,6 +22,7 @@ class Contesting extends CI_Controller { $this->load->model('contesting_model'); $data['my_gridsquare'] = $this->stations->find_gridsquare(); + $data['my_dok'] = ""; // For now, this is set to blank, but need function to get $data['radios'] = $this->cat->radios(); $data['modes'] = $this->modes->active(); $data['contestnames'] = $this->contesting_model->getActivecontests(); diff --git a/application/views/contesting/index.php b/application/views/contesting/index.php index ddac3236..140d9a04 100644 --- a/application/views/contesting/index.php +++ b/application/views/contesting/index.php @@ -13,6 +13,9 @@
- diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index ff64a89e..8f6086d9 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -26,6 +26,7 @@ function reset_contest_session() { setExchangetype("None"); $("#contestname").val("Other").change(); $(".contest_qso_table_contents").empty(); + $('#copyexchangetodok').prop('checked', false); localStorage.removeItem("contestid"); localStorage.removeItem("exchangetype"); @@ -36,6 +37,7 @@ function reset_contest_session() { localStorage.removeItem("serialsent"); localStorage.removeItem("gridsquarereceived"); localStorage.removeItem("gridsquaresent"); + localStorage.removeItem("copytodok"); } // Storing the contestid in contest session @@ -240,8 +242,6 @@ function setExchangetype(exchangetype) { $(".serialr").hide(); $(".gridsquarer").hide(); $(".gridsquares").hide(); - $(".doks").hide(); - $(".dokr").hide(); $("#exch_serial_s").val(""); var serialsent = localStorage.getItem("serialsent"); @@ -258,23 +258,6 @@ function setExchangetype(exchangetype) { $(".serials").show(); $(".serialr").show(); } - else if (exchangetype == 'Dok') { - $(".doks").show(); - $(".dokr").show(); - } - else if (exchangetype == 'Serialdok') { - $("#exch_serial_s").val(serialsent); - $(".serials").show(); - $(".serialr").show(); - $(".doks").show(); - $(".dokr").show(); - } - else if (exchangetype == 'Dokgridsquare') { - $(".gridsquarer").show(); - $(".gridsquares").show(); - $(".doks").show(); - $(".dokr").show(); - } else if (exchangetype == 'Serialexchange') { $("#exch_serial_s").val(serialsent); $(".exchanger").show(); @@ -365,6 +348,7 @@ function logQso() { localStorage.setItem("serialsent", $("#exch_serial_s").val()); localStorage.setItem("gridsquarereceived", $("#exch_gridsquare_r").val()); localStorage.setItem("gridsquaresent", $("#exch_gridsquare_s").val()); + localStorage.setItem("copytodok", $('#copyexchangetodok').is(":checked")); } }); } @@ -372,14 +356,17 @@ function logQso() { // We are restoring the settings in the contest logging form here function restoreContestSession() { - var contestname = localStorage.getItem("contestid"); + var dokcopy = localStorage.getItem("copytodok"); + if (dokcopy != null) { + $('#copyexchangetodok').prop('checked', true); + } + var contestname = localStorage.getItem("contestid"); if (contestname != null) { $("#contestname").val(contestname); } var exchangetype = localStorage.getItem("exchangetype"); - if (exchangetype != null) { $("#exchangetype").val(exchangetype); setExchangetype(exchangetype);