diff --git a/application/controllers/Simplefle.php b/application/controllers/Simplefle.php index d001a18b5..8864d2c32 100644 --- a/application/controllers/Simplefle.php +++ b/application/controllers/Simplefle.php @@ -38,6 +38,24 @@ 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 ?? 'true'; + + $this->load->view('simplefle/options', $data); + + } + + public function saveOptions() { + + 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'); + } + + } + private function modes_array() { $this->load->model('modes'); @@ -56,5 +74,4 @@ class SimpleFLE extends CI_Controller { return $modes; } - } diff --git a/application/language/bulgarian/qso_lang.php b/application/language/bulgarian/qso_lang.php index e3195d08b..3507024d7 100644 --- a/application/language/bulgarian/qso_lang.php +++ b/application/language/bulgarian/qso_lang.php @@ -99,3 +99,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 0f783539b..698d62d1c 100644 --- a/application/language/chinese_simplified/qso_lang.php +++ b/application/language/chinese_simplified/qso_lang.php @@ -98,4 +98,6 @@ $lang['qso_simplefle_syntax_help_ln6'] = "我们的下一个 QSO 是在 2021 年 $lang['qso_simplefle_syntax_help_ln7'] = "完整的可用指令和语法可在 Wavelog 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 83003cdce..d3391727e 100644 --- a/application/language/czech/qso_lang.php +++ b/application/language/czech/qso_lang.php @@ -98,4 +98,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 c7d5d2e8f..df361dd3b 100644 --- a/application/language/dutch/qso_lang.php +++ b/application/language/dutch/qso_lang.php @@ -98,4 +98,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 4d0e8dd82..2ea00df5b 100644 --- a/application/language/english/qso_lang.php +++ b/application/language/english/qso_lang.php @@ -99,3 +99,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 8fe4ba3bd..af6513e45 100644 --- a/application/language/finnish/qso_lang.php +++ b/application/language/finnish/qso_lang.php @@ -99,3 +99,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 ebeaa9633..9f78b59d9 100644 --- a/application/language/french/qso_lang.php +++ b/application/language/french/qso_lang.php @@ -99,3 +99,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 b6c32ff97..2e2717742 100644 --- a/application/language/german/qso_lang.php +++ b/application/language/german/qso_lang.php @@ -99,3 +99,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 bb81df94b..15c9d06cd 100644 --- a/application/language/greek/qso_lang.php +++ b/application/language/greek/qso_lang.php @@ -99,3 +99,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 61e6f43e3..561923820 100644 --- a/application/language/italian/qso_lang.php +++ b/application/language/italian/qso_lang.php @@ -99,3 +99,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 9092edbfe..4fc1ae05e 100644 --- a/application/language/polish/qso_lang.php +++ b/application/language/polish/qso_lang.php @@ -99,3 +99,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 de0d4b7fd..2acff88e8 100644 --- a/application/language/russian/qso_lang.php +++ b/application/language/russian/qso_lang.php @@ -99,3 +99,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 34dbb686d..042c6d8de 100644 --- a/application/language/spanish/qso_lang.php +++ b/application/language/spanish/qso_lang.php @@ -99,3 +99,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 30b41f789..ab32268df 100644 --- a/application/language/swedish/qso_lang.php +++ b/application/language/swedish/qso_lang.php @@ -99,3 +99,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 9685216d5..8cef43e36 100644 --- a/application/language/turkish/qso_lang.php +++ b/application/language/turkish/qso_lang.php @@ -99,3 +99,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/views/simplefle/index.php b/application/views/simplefle/index.php index 5c8b3d12e..4a60f6c83 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 @@
| @@ -129,7 +131,7 @@ | - | + | * | ${mode} | ${rst_s} | ${rst_r} | -${operator} | +${gridsquare} | ${sotaWwffText} | `); @@ -343,23 +460,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(); @@ -596,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) { @@ -703,57 +820,50 @@ 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`); +function resizeElements() { + var textarea = $('#sfle_textarea'); + var textareaOffset = 40; - if (mycall != null) { - $("#station-call").val(mycall); - } + var tableFrame = $('.sfletable.table'); + var tableFrameOffset = 140; - if (operator != null) { - $("#operator").val(operator); - } + var table = $('#qsoTableBody'); + var tableoOffset = 160; - if (mysotawwff != null) { - $("#my-sota-wwff").val(mysotawwff); - } + if ($(window).width() >= 768) { + var newHeight = $(window).height() - textarea.offset().top - textareaOffset; + textarea.css('height', newHeight + 'px'); - if (qsoarea != null) { - $(".qso-area").val(qsoarea); - } + var newHeight = $(window).height() - tableFrame.offset().top - tableFrameOffset; + tableFrame.css('height', newHeight + 'px'); - if (qsodate != null) { - $("#qsodate").val(qsodate); - } + var newHeight = $(window).height() - table.offset().top - tableoOffset; + table.css('height', newHeight + 'px'); - if (myPower != null) { - $("#my-power").val(myPower); - } + $('.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'); - if (myGrid != null) { - $("#my-grid").val(myGrid); - } + } else { + textarea.css('height', 'auto'); + tableFrame.css('height', '530px'); + table.css('height', '400px'); - if (tabledata != null) { - $("#qsoTable").html(tabledata); - handleInput(); + $('.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)"); + if (textarea.val() === "") { + textarea.css("border", "2px solid rgb(217, 83, 79)"); setTimeout(function () { - $("#textarea").css("border", ""); + textarea.css("border", ""); }, 2000); return false; } @@ -811,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] + @@ -828,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({ @@ -843,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, @@ -870,4 +982,4 @@ $(".js-save-to-log").click(function () { }, }); } -}); +}); \ No newline at end of file
|---|