From d13271276363544446379368aea8fcaafa5a798f Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Tue, 28 May 2024 13:36:12 +0200 Subject: [PATCH 1/8] new button bar and options dialog --- application/controllers/Simplefle.php | 15 ++++++- application/views/simplefle/index.php | 17 ++++---- application/views/simplefle/options.php | 18 ++++++++ assets/js/sections/simplefle.js | 57 +++++++++++++++++++++++++ 4 files changed, 97 insertions(+), 10 deletions(-) create mode 100644 application/views/simplefle/options.php diff --git a/application/controllers/Simplefle.php b/application/controllers/Simplefle.php index d001a18b5..6927c4706 100644 --- a/application/controllers/Simplefle.php +++ b/application/controllers/Simplefle.php @@ -38,6 +38,20 @@ class SimpleFLE extends CI_Controller { $this->load->view('simplefle/syntax_help'); } + public function displayOptions() { + + $data['callbook_lookup'] = $this->user_options_model->get_options('SimpleFLE',array('option_name'=>'callbook_lookup','option_key'=>'boolean'))->row()->option_value; + + $this->load->view('simplefle/options', $data); + + } + + public function saveOptions() { + + $this->user_options_model->set_option('SimpleFLE', 'callbook_lookup', array('boolean' => xss_clean($this->input->post('callbook_lookup')))); + + } + private function modes_array() { $this->load->model('modes'); @@ -56,5 +70,4 @@ class SimpleFLE extends CI_Controller { return $modes; } - } diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php index 0dae91312..765c50a87 100644 --- a/application/views/simplefle/index.php +++ b/application/views/simplefle/index.php @@ -16,7 +16,9 @@ var lang_qso_simplefle_syntax_help = ""; var lang_qso_simplefle_syntax_help_title = ""; var lang_qso_simplefle_syntax_help_close_w_sample = ""; + var lang_qso_simplefle_options = ""; var lang_admin_close = ""; + var lang_admin_save = ""; var lang_qso_simplefle_error_band = ""; var lang_qso_simplefle_error_mode = ""; var lang_qso_simplefle_error_time = ""; @@ -56,7 +58,7 @@
- +
@@ -109,7 +111,7 @@

- +
@@ -148,17 +150,14 @@
-
+
+ -
-
-
-
-
-
+ +
diff --git a/application/views/simplefle/options.php b/application/views/simplefle/options.php new file mode 100644 index 000000000..28ceef350 --- /dev/null +++ b/application/views/simplefle/options.php @@ -0,0 +1,18 @@ + + + + + + + + + + + + + +
OptionValue
Auto Callbook Lookup +
+ > +
+
\ No newline at end of file diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index 810b75038..9b35ff640 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -88,6 +88,63 @@ ssb }); }); +$("#js-options").click(function (event) { + $("#js-options").prop("disabled", false); + $.ajax({ + url: base_url + "index.php/simplefle/displayOptions", + type: "post", + success: function (html) { + BootstrapDialog.show({ + title: "

" + lang_qso_simplefle_options + "

", + nl2br: false, + message: html, + buttons: [ + { + label: lang_admin_save, + cssClass: 'btn-primary btn-sm', + id: 'saveButton', + action: function (dialogItself) { + $('#optionButton').prop("disabled", false); + $('#closeButton').prop("disabled", true); + saveOptions(); + dialogItself.close(); + location.reload(); + } + }, + { + label: lang_admin_close, + cssClass: 'btn-sm', + id: 'closeButton', + action: function (dialogItself) { + $('#optionButton').prop("disabled", false); + dialogItself.close(); + } + }, + ], + }); + }, + }); +}); + +function saveOptions() { + $('#saveButton').prop("disabled", true); + $('#closeButton').prop("disabled", true); + $.ajax({ + url: base_url + 'index.php/simplefle/saveOptions', + type: 'post', + data: { + callbook_lookup: $('input[name="callbook_lookup"]').is(':checked') ? true : false, + }, + success: function(data) { + $('#saveButton').prop("disabled", false); + $('#closeButton').prop("disabled", false); + }, + error: function() { + $('#saveButton').prop("disabled", false); + }, + }); +} + function updateUTCTime() { const utcTimeElement = document.getElementById("utc-time"); const now = new Date(); From e16fc97753536caa9ee2c1f0439cf7146c35d1bf Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Tue, 28 May 2024 13:36:24 +0200 Subject: [PATCH 2/8] simplefle language --- application/language/bulgarian/qso_lang.php | 2 ++ application/language/chinese_simplified/qso_lang.php | 4 +++- application/language/czech/qso_lang.php | 4 +++- application/language/dutch/qso_lang.php | 4 +++- application/language/english/qso_lang.php | 2 ++ application/language/finnish/qso_lang.php | 2 ++ application/language/french/qso_lang.php | 2 ++ application/language/german/qso_lang.php | 2 ++ application/language/greek/qso_lang.php | 2 ++ application/language/italian/qso_lang.php | 2 ++ application/language/polish/qso_lang.php | 2 ++ application/language/russian/qso_lang.php | 2 ++ application/language/spanish/qso_lang.php | 2 ++ application/language/swedish/qso_lang.php | 2 ++ application/language/turkish/qso_lang.php | 2 ++ 15 files changed, 33 insertions(+), 3 deletions(-) diff --git a/application/language/bulgarian/qso_lang.php b/application/language/bulgarian/qso_lang.php index dd4aa9789..070c6daec 100644 --- a/application/language/bulgarian/qso_lang.php +++ b/application/language/bulgarian/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "The first QSO was at 21:34, and the se $lang['qso_simplefle_syntax_help_ln8'] = "For our next QSO at 21:40 on 14th May, 2021, we changed the band to 40m but still on SSB. If no RST information is given, the syntax will use 59 for every new QSO. Therefore we can add another QSO which took place at the exact same time two days later. The date must be in format YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/chinese_simplified/qso_lang.php b/application/language/chinese_simplified/qso_lang.php index f38c1a20a..e4e67dab8 100644 --- a/application/language/chinese_simplified/qso_lang.php +++ b/application/language/chinese_simplified/qso_lang.php @@ -97,4 +97,6 @@ $lang['qso_simplefle_syntax_help_ln6'] = "我们的下一个 QSO 是在 2021 年 $lang['qso_simplefle_syntax_help_ln7'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; $lang['qso_simplefle_syntax_help_ln8'] = ""; $lang['qso_simplefle_syntax_help_ln9'] = ""; - + +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/czech/qso_lang.php b/application/language/czech/qso_lang.php index 0117139a0..93ebee375 100644 --- a/application/language/czech/qso_lang.php +++ b/application/language/czech/qso_lang.php @@ -97,4 +97,6 @@ $lang['qso_simplefle_syntax_help_ln6'] = "If you don't provide any RST informati $lang['qso_simplefle_syntax_help_ln7'] = "The first QSO was at 21:34, and the second one 2 minutes later at 21:36. We write down 6 because this is the only data that changed here. The information about band and mode didn't change, so this data is omitted."; $lang['qso_simplefle_syntax_help_ln8'] = "For our next QSO at 21:40 on 14th May, 2021, we changed the band to 40m but still on SSB. If no RST information is given, the syntax will use 59 for every new QSO. Therefore we can add another QSO which took place at the exact same time two days later. The date must be in format YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; - + +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/dutch/qso_lang.php b/application/language/dutch/qso_lang.php index e2e30f317..ef484c85d 100644 --- a/application/language/dutch/qso_lang.php +++ b/application/language/dutch/qso_lang.php @@ -97,4 +97,6 @@ $lang['qso_simplefle_syntax_help_ln6'] = "If you don't provide any RST informati $lang['qso_simplefle_syntax_help_ln7'] = "The first QSO was at 21:34, and the second one 2 minutes later at 21:36. We write down 6 because this is the only data that changed here. The information about band and mode didn't change, so this data is omitted."; $lang['qso_simplefle_syntax_help_ln8'] = "For our next QSO at 21:40 on 14th May, 2021, we changed the band to 40m but still on SSB. If no RST information is given, the syntax will use 59 for every new QSO. Therefore we can add another QSO which took place at the exact same time two days later. The date must be in format YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; - + +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/english/qso_lang.php b/application/language/english/qso_lang.php index e97395515..704d78512 100644 --- a/application/language/english/qso_lang.php +++ b/application/language/english/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "The first QSO was at 21:34, and the se $lang['qso_simplefle_syntax_help_ln8'] = "For our next QSO at 21:40 on 14th May, 2021, we changed the band to 40m but still on SSB. If no RST information is given, the syntax will use 59 for every new QSO. Therefore we can add another QSO which took place at the exact same time two days later. The date must be in format YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/finnish/qso_lang.php b/application/language/finnish/qso_lang.php index bfdb7906c..e08952437 100644 --- a/application/language/finnish/qso_lang.php +++ b/application/language/finnish/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "The first QSO was at 21:34, and the se $lang['qso_simplefle_syntax_help_ln8'] = "For our next QSO at 21:40 on 14th May, 2021, we changed the band to 40m but still on SSB. If no RST information is given, the syntax will use 59 for every new QSO. Therefore we can add another QSO which took place at the exact same time two days later. The date must be in format YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/french/qso_lang.php b/application/language/french/qso_lang.php index e70249a11..e19e305ec 100644 --- a/application/language/french/qso_lang.php +++ b/application/language/french/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "The first QSO was at 21:34, and the se $lang['qso_simplefle_syntax_help_ln8'] = "For our next QSO at 21:40 on 14th May, 2021, we changed the band to 40m but still on SSB. If no RST information is given, the syntax will use 59 for every new QSO. Therefore we can add another QSO which took place at the exact same time two days later. The date must be in format YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/german/qso_lang.php b/application/language/german/qso_lang.php index c1218251c..86e1f1e85 100644 --- a/application/language/german/qso_lang.php +++ b/application/language/german/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "Das erste QSO war um 21:34 Uhr, und da $lang['qso_simplefle_syntax_help_ln8'] = "Für unser nächstes QSO um 21:40 Uhr am 14.05.2021 haben wir das Band auf 40m geändert, sind aber immer noch auf SSB. Wenn keine RST-Informationen angegeben sind, verwendet die Syntax bei jedem neuen QSO 59. Daher können wir ein weiteres QSO hinzufügen welches um die exakt selbe Zeit zwei Tage später stattfand. Das Datum muss im Format YYYY-MM-DD eingegeben werden."; $lang['qso_simplefle_syntax_help_ln9'] = "Eine vollständige Übersicht aller Befehle und der notwendigen Syntax findest du in diesem Artikel in unserem Wiki."; +$lang['qso_simplefle_options'] = 'Optionen'; + diff --git a/application/language/greek/qso_lang.php b/application/language/greek/qso_lang.php index 3533ae37c..3e4dfc4c5 100644 --- a/application/language/greek/qso_lang.php +++ b/application/language/greek/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "The first QSO was at 21:34, and the se $lang['qso_simplefle_syntax_help_ln8'] = "For our next QSO at 21:40 on 14th May, 2021, we changed the band to 40m but still on SSB. If no RST information is given, the syntax will use 59 for every new QSO. Therefore we can add another QSO which took place at the exact same time two days later. The date must be in format YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/italian/qso_lang.php b/application/language/italian/qso_lang.php index ebf0f9d09..83bf1d1bf 100644 --- a/application/language/italian/qso_lang.php +++ b/application/language/italian/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "The first QSO was at 21:34, and the se $lang['qso_simplefle_syntax_help_ln8'] = "For our next QSO at 21:40 on 14th May, 2021, we changed the band to 40m but still on SSB. If no RST information is given, the syntax will use 59 for every new QSO. Therefore we can add another QSO which took place at the exact same time two days later. The date must be in format YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/polish/qso_lang.php b/application/language/polish/qso_lang.php index c27eab374..d0be43f11 100644 --- a/application/language/polish/qso_lang.php +++ b/application/language/polish/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "The first QSO was at 21:34, and the se $lang['qso_simplefle_syntax_help_ln8'] = "For our next QSO at 21:40 on 14th May, 2021, we changed the band to 40m but still on SSB. If no RST information is given, the syntax will use 59 for every new QSO. Therefore we can add another QSO which took place at the exact same time two days later. The date must be in format YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/russian/qso_lang.php b/application/language/russian/qso_lang.php index b17557542..29b95be5f 100644 --- a/application/language/russian/qso_lang.php +++ b/application/language/russian/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "Первое QSO состоялось $lang['qso_simplefle_syntax_help_ln8'] = "Для следующего QSO в 21:40 14 мая 2021 года мы сменили диапазон на 40 м, но по-прежнему на SSB. Если информация о RST не указана, то синтаксис будет использовать 59 для каждого нового QSO. Поэтому мы можем добавить еще одно QSO, состоявшееся точно в это же время двумя днями позже. Дата должна быть в формате YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/spanish/qso_lang.php b/application/language/spanish/qso_lang.php index bff79b9c8..8e66a62e3 100644 --- a/application/language/spanish/qso_lang.php +++ b/application/language/spanish/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "El primer QSL fue a las 21:34, y el se $lang['qso_simplefle_syntax_help_ln8'] = "Para nuestro siguiente QSO a las 21:40 el 14 de mayo de 2021, cambiamos la banda a 40m pero seguimos en SSB. Si no se ingresa datos de RST, la sintaxis usará 59 para cada nuevo QSO. Por lo tanto podemos añadir un nuevo QSO que ocurrió a la misma hora dos días después. La fecha debe estar en el formato YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/swedish/qso_lang.php b/application/language/swedish/qso_lang.php index d751d3c43..2fa60407c 100644 --- a/application/language/swedish/qso_lang.php +++ b/application/language/swedish/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "The first QSO was at 21:34, and the se $lang['qso_simplefle_syntax_help_ln8'] = "For our next QSO at 21:40 on 14th May, 2021, we changed the band to 40m but still on SSB. If no RST information is given, the syntax will use 59 for every new QSO. Therefore we can add another QSO which took place at the exact same time two days later. The date must be in format YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; +$lang['qso_simplefle_options'] = 'Options'; + diff --git a/application/language/turkish/qso_lang.php b/application/language/turkish/qso_lang.php index 38f110e5f..223f43620 100644 --- a/application/language/turkish/qso_lang.php +++ b/application/language/turkish/qso_lang.php @@ -98,3 +98,5 @@ $lang['qso_simplefle_syntax_help_ln7'] = "The first QSO was at 21:34, and the se $lang['qso_simplefle_syntax_help_ln8'] = "For our next QSO at 21:40 on 14th May, 2021, we changed the band to 40m but still on SSB. If no RST information is given, the syntax will use 59 for every new QSO. Therefore we can add another QSO which took place at the exact same time two days later. The date must be in format YYYY-MM-DD."; $lang['qso_simplefle_syntax_help_ln9'] = "A full summary of all commands and the necessary syntax can be found in this article of our Wiki."; +$lang['qso_simplefle_options'] = 'Options'; + From 4c5379704796cb709ebad0ec56a254032f4a1c28 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Tue, 28 May 2024 13:47:06 +0200 Subject: [PATCH 3/8] standarize textarea in js --- application/views/simplefle/index.php | 2 +- assets/js/sections/simplefle.js | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php index 765c50a87..31b0b11c2 100644 --- a/application/views/simplefle/index.php +++ b/application/views/simplefle/index.php @@ -111,7 +111,7 @@

- +
diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index 9b35ff640..83cc498d1 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -1,4 +1,4 @@ -var $textarea = $("textarea"); +var textarea = $("#sfle_textarea"); var qsodate = ""; var qsotime = ""; var band = ""; @@ -67,7 +67,7 @@ ssb 33 ok1xxx 4 3 `; - $textarea.val(logData.trim()); + textarea.val(logData.trim()); handleInput(); BootstrapDialog.closeAll(); } @@ -175,7 +175,7 @@ function handleInput() { qsoList = []; $("#qsoTable tbody").empty(); - var text = $textarea.val().trim(); + var text = textarea.val().trim(); lines = text.split("\n"); lines.forEach((row) => { var rst_s = null; @@ -400,23 +400,23 @@ function checkMainFieldsErrors() { $("#operator").css("border", ""); $("#warningOperatorField").hide(); } - if ($("textarea").val() === "") { - $("#textarea").css("border", "2px solid rgb(217, 83, 79)"); + if (textarea.val() === "") { + textarea.css("border", "2px solid rgb(217, 83, 79)"); setTimeout(function () { - $("#textarea").css("border", ""); + textarea.css("border", ""); }, 2000); } else { - $("#textarea").css("border", ""); + textarea.css("border", ""); } } -$textarea.keydown(function (event) { +textarea.keydown(function (event) { if (event.which == 13) { handleInput(); } }); -$textarea.focus(function () { +textarea.focus(function () { errors = []; checkMainFieldsErrors(); showErrors(); @@ -807,10 +807,10 @@ $(document).ready(function () { }); $(".js-save-to-log").click(function () { - if ($("textarea").val() === "") { - $("#textarea").css("border", "2px solid rgb(217, 83, 79)"); + if (textarea.val() === "") { + textarea.css("border", "2px solid rgb(217, 83, 79)"); setTimeout(function () { - $("#textarea").css("border", ""); + textarea.css("border", ""); }, 2000); return false; } From c0bfe3cf298c2596bb16cec1b983753c20b48b68 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Tue, 28 May 2024 21:36:56 +0200 Subject: [PATCH 4/8] use more of the screen --- application/views/simplefle/index.php | 4 +- assets/css/general.css | 57 +++++++++++++++++---------- assets/js/sections/simplefle.js | 43 ++++++++++++++++++++ 3 files changed, 81 insertions(+), 23 deletions(-) diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php index 31b0b11c2..a091e3ac6 100644 --- a/application/views/simplefle/index.php +++ b/application/views/simplefle/index.php @@ -122,7 +122,7 @@
- +
@@ -144,7 +144,7 @@
-
+
diff --git a/assets/css/general.css b/assets/css/general.css index c0e24a07b..a14ff3175 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -716,31 +716,46 @@ div#station_logbooks_linked_table_paginate { margin-right: 30px; } -.sfletable { - height: 470px; +@media (min-width: 768px) { + + .sfletable.table { + width: 100%; + } + + .sfletable.table thead, + .sfletable.table tbody tr { + display: block; + width: 100%; + table-layout: fixed; + display: inline-table; + } + + .sfletable.table tbody { + width: 95%; + overflow-y: scroll; + position: absolute; + } + + .simplefle { + --bs-card-bg: none; + } + + #sfle_textarea { + width: 100%; + box-sizing: border-box; + } } -.sfletable.table { - width: 100%; -} +@media (max-width: 767px) { -.sfletable.table thead, -.sfletable.table tbody tr { - display: block; - width: 100%; - table-layout: fixed; - display: inline-table; -} + .sfletable.table { + overflow-x: auto; + font-size: 0.8em; + } -.sfletable.table tbody { - width: 95%; - overflow-y: scroll; - max-height: 440px; - position: absolute; -} - -.simplefle { - --bs-card-bg: none; + #refs_hint { + font-size: 0.8em; + } } .red { diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index 83cc498d1..fa4c77000 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -804,8 +804,51 @@ $(document).ready(function () { $("#qsoTable").html(tabledata); handleInput(); } + + $(window).on('resize', resizeElements); + $(document).ready(resizeElements); + }); +function resizeElements() { + var textarea = $('#sfle_textarea'); + var textareaOffset = 40; + + var tableFrame = $('.sfletable.table'); + var tableFrameOffset = 140; + + var table = $('#qsoTableBody'); + var tableoOffset = 160; + + if ($(window).width() >= 768) { + var newHeight = $(window).height() - textarea.offset().top - textareaOffset; + textarea.css('height', newHeight + 'px'); + + var newHeight = $(window).height() - tableFrame.offset().top - tableFrameOffset; + tableFrame.css('height', newHeight + 'px'); + + var newHeight = $(window).height() - table.offset().top - tableoOffset; + table.css('height', newHeight + 'px'); + + $('.js-reload-qso').removeClass('btn-sm'); + $('.js-save-to-log').removeClass('btn-sm'); + $('.js-empty-qso').removeClass('btn-sm'); + $('#js-syntax').removeClass('btn-sm'); + $('#js-options').removeClass('btn-sm'); + + } else { + textarea.css('height', 'auto'); + tableFrame.css('height', '530px'); + table.css('height', '400px'); + + $('.js-reload-qso').addClass('btn-sm'); + $('.js-save-to-log').addClass('btn-sm'); + $('.js-empty-qso').addClass('btn-sm'); + $('#js-syntax').addClass('btn-sm'); + $('#js-options').addClass('btn-sm'); + } +} + $(".js-save-to-log").click(function () { if (textarea.val() === "") { textarea.css("border", "2px solid rgb(217, 83, 79)"); From 78cc99d5b9ea26fa077681ac07bd76fb53f8e874 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Tue, 28 May 2024 21:39:22 +0200 Subject: [PATCH 5/8] move document.ready function to the top so it's easier to find --- assets/js/sections/simplefle.js | 100 ++++++++++++++++---------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index fa4c77000..0463d9693 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -9,6 +9,56 @@ var errors = []; var qsoList = []; var modes_regex = modes_regex(Modes); +$(document).ready(function () { + setInterval(updateUTCTime, 1000); + updateUTCTime(); + var tabledata = localStorage.getItem(`user_${user_id}_tabledata`); + var mycall = localStorage.getItem(`user_${user_id}_my-call`); + var operator = localStorage.getItem(`user_${user_id}_operator`); + var mysotawwff = localStorage.getItem(`user_${user_id}_my-sota-wwff`); + var qsoarea = localStorage.getItem(`user_${user_id}_qso-area`); + var qsodate = localStorage.getItem(`user_${user_id}_qsodate`); + var myPower = localStorage.getItem(`user_${user_id}_my-power`); + var myGrid = localStorage.getItem(`user_${user_id}_my-grid`); + + if (mycall != null) { + $("#station-call").val(mycall); + } + + if (operator != null) { + $("#operator").val(operator); + } + + if (mysotawwff != null) { + $("#my-sota-wwff").val(mysotawwff); + } + + if (qsoarea != null) { + $(".qso-area").val(qsoarea); + } + + if (qsodate != null) { + $("#qsodate").val(qsodate); + } + + if (myPower != null) { + $("#my-power").val(myPower); + } + + if (myGrid != null) { + $("#my-grid").val(myGrid); + } + + if (tabledata != null) { + $("#qsoTable").html(tabledata); + handleInput(); + } + + $(window).on('resize', resizeElements); + $(document).ready(resizeElements); + +}); + $("#simpleFleInfoButton").click(function (event) { var awardInfoLines = [ lang_qso_simplefle_info_ln2, @@ -760,56 +810,6 @@ function isWWFF(value) { return false; } -$(document).ready(function () { - setInterval(updateUTCTime, 1000); - updateUTCTime(); - var tabledata = localStorage.getItem(`user_${user_id}_tabledata`); - var mycall = localStorage.getItem(`user_${user_id}_my-call`); - var operator = localStorage.getItem(`user_${user_id}_operator`); - var mysotawwff = localStorage.getItem(`user_${user_id}_my-sota-wwff`); - var qsoarea = localStorage.getItem(`user_${user_id}_qso-area`); - var qsodate = localStorage.getItem(`user_${user_id}_qsodate`); - var myPower = localStorage.getItem(`user_${user_id}_my-power`); - var myGrid = localStorage.getItem(`user_${user_id}_my-grid`); - - if (mycall != null) { - $("#station-call").val(mycall); - } - - if (operator != null) { - $("#operator").val(operator); - } - - if (mysotawwff != null) { - $("#my-sota-wwff").val(mysotawwff); - } - - if (qsoarea != null) { - $(".qso-area").val(qsoarea); - } - - if (qsodate != null) { - $("#qsodate").val(qsodate); - } - - if (myPower != null) { - $("#my-power").val(myPower); - } - - if (myGrid != null) { - $("#my-grid").val(myGrid); - } - - if (tabledata != null) { - $("#qsoTable").html(tabledata); - handleInput(); - } - - $(window).on('resize', resizeElements); - $(document).ready(resizeElements); - -}); - function resizeElements() { var textarea = $('#sfle_textarea'); var textareaOffset = 40; From 2dd366f9b934d384bc6895aa4f844ae35592cd29 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Tue, 28 May 2024 23:27:06 +0200 Subject: [PATCH 6/8] gridsquare support --- application/views/simplefle/index.php | 2 +- assets/js/sections/simplefle.js | 46 +++++++++++++++++---------- 2 files changed, 30 insertions(+), 18 deletions(-) diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php index a091e3ac6..603b07143 100644 --- a/application/views/simplefle/index.php +++ b/application/views/simplefle/index.php @@ -132,7 +132,7 @@ - + diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index 0463d9693..232156c0e 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -5,6 +5,7 @@ var band = ""; var mode = ""; var freq = ""; var callsign = ""; +var gridsquare = ""; var errors = []; var qsoList = []; var modes_regex = modes_regex(Modes); @@ -221,6 +222,7 @@ function handleInput() { var mode = ""; var freq = ""; var callsign = ""; + var gridsquare = ""; var sotaWwff = ""; qsoList = []; $("#qsoTable tbody").empty(); @@ -230,8 +232,10 @@ function handleInput() { lines.forEach((row) => { var rst_s = null; var rst_r = null; + var gridsquare = ""; items = row.startsWith("day ") ? [row] : row.split(" "); var itemNumber = 0; + var call_rec = false; items.forEach((item) => { if (item === "") { @@ -286,9 +290,14 @@ function handleInput() { } else if ( item.match( /([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|.*\/([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])|([a-zA-Z0-9]{1,3}[0-9][a-zA-Z0-9]{0,3}[a-zA-Z])\/.*/ - ) + ) && call_rec !== true ) { callsign = item.toUpperCase(); + call_rec = true; + } else if ( + item.match(/^[A-R]{2}[0-9]{2}([A-X]{2}([0-9]{2}([A-X]{2})?)?)?$/i) + ) { + gridsquare = item.toUpperCase(); } else if (itemNumber > 0 && item.match(/^[-+]\d{1,2}|\d{1,3}$|\d{1,3}[-+]d{1,2}$/)) { if (rst_s === null) { rst_s = item; @@ -337,6 +346,7 @@ function handleInput() { freq, band, mode, + gridsquare, rst_s, rst_r, sotaWwff, @@ -362,7 +372,7 @@ function handleInput() { - + `); @@ -703,11 +713,11 @@ function isTimeEntered() { } function isExampleDataEntered() { - let isExampleData = false; - if (textarea.value.startsWith("*example-data*")) { - isExampleData = true; - } - return isExampleData; + let isExampleData = false; + if (textarea.val().startsWith("*example-data*")) { + isExampleData = true; + } + return isExampleData; } function getAdifTag(tagName, value) { @@ -911,8 +921,9 @@ $(".js-save-to-log").click(function () { qsoList.forEach((item) => { var callsign = item[2]; + var gridsquare = item[6]; var rst_rcvd = item[7].replace(/dB$/, ''); // we don't want 'dB' in the database - var rst_sent = item[6].replace(/dB$/, ''); // * + var rst_sent = item[8].replace(/dB$/, ''); // * var start_date = item[0]; var start_time = item[1][0] + @@ -928,14 +939,14 @@ $(".js-save-to-log").click(function () { var iota_ref = ""; var pota_ref = ""; var wwff_ref = ""; - if (isSOTA(item[8])) { - sota_ref = item[8]; - } else if (isIOTA(item[8])) { - iota_ref = item[8]; - } else if (isPOTA(item[8])) { - pota_ref = item[8]; - } else if (isWWFF(item[8])) { - wwff_ref = item[8]; + if (isSOTA(item[9])) { + sota_ref = item[9]; + } else if (isIOTA(item[9])) { + iota_ref = item[9]; + } else if (isPOTA(item[9])) { + pota_ref = item[9]; + } else if (isWWFF(item[9])) { + wwff_ref = item[9]; } $.ajax({ @@ -943,6 +954,7 @@ $(".js-save-to-log").click(function () { type: "post", data: { callsign: callsign, + locator: gridsquare, rst_rcvd: rst_rcvd, rst_sent: rst_sent, start_date: start_date, @@ -970,4 +982,4 @@ $(".js-save-to-log").click(function () { }, }); } -}); +}); \ No newline at end of file From 6e6a74b96770addf433cf7df0e44a1ec9891e7ad Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Wed, 29 May 2024 23:20:56 +0200 Subject: [PATCH 7/8] temporary disable options button --- application/views/simplefle/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php index 603b07143..fb46c26ac 100644 --- a/application/views/simplefle/index.php +++ b/application/views/simplefle/index.php @@ -156,7 +156,7 @@ - + From 4a4537a74d3b5d88764d74ff2e82eaa1ddbf9764 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Wed, 29 May 2024 23:37:46 +0200 Subject: [PATCH 8/8] some adjustments --- application/controllers/Simplefle.php | 8 ++++++-- application/views/simplefle/index.php | 2 +- application/views/simplefle/options.php | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/application/controllers/Simplefle.php b/application/controllers/Simplefle.php index 6927c4706..8864d2c32 100644 --- a/application/controllers/Simplefle.php +++ b/application/controllers/Simplefle.php @@ -40,7 +40,7 @@ class SimpleFLE extends CI_Controller { public function displayOptions() { - $data['callbook_lookup'] = $this->user_options_model->get_options('SimpleFLE',array('option_name'=>'callbook_lookup','option_key'=>'boolean'))->row()->option_value; + $data['callbook_lookup'] = $this->user_options_model->get_options('SimpleFLE',array('option_name'=>'callbook_lookup','option_key'=>'boolean'))->row()->option_value ?? 'true'; $this->load->view('simplefle/options', $data); @@ -48,7 +48,11 @@ class SimpleFLE extends CI_Controller { public function saveOptions() { - $this->user_options_model->set_option('SimpleFLE', 'callbook_lookup', array('boolean' => xss_clean($this->input->post('callbook_lookup')))); + if($this->input->post('callbook_lookup')) { + $this->user_options_model->set_option('SimpleFLE', 'callbook_lookup', array('boolean' => xss_clean($this->input->post('callbook_lookup')))); + } else { + log_message('debug', 'SimpleFLE, saveOptions(); No Options to save. No Post Data'); + } } diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php index fb46c26ac..603b07143 100644 --- a/application/views/simplefle/index.php +++ b/application/views/simplefle/index.php @@ -156,7 +156,7 @@ - + diff --git a/application/views/simplefle/options.php b/application/views/simplefle/options.php index 28ceef350..9a0974f24 100644 --- a/application/views/simplefle/options.php +++ b/application/views/simplefle/options.php @@ -1,4 +1,4 @@ -
*
${mode} ${rst_s} ${rst_r}${operator}${gridsquare} ${sotaWwffText}
+ + +

No Options yet

\ No newline at end of file