From f6f589deee65a548053a983019d657a248b456f4 Mon Sep 17 00:00:00 2001 From: HB9HIL Date: Thu, 8 Aug 2024 13:29:45 +0200 Subject: [PATCH] dxcc warning --- install/assets/css/installer.css | 5 +++++ install/index.php | 25 ++++++++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/install/assets/css/installer.css b/install/assets/css/installer.css index 3fca0c954..fbdf737e7 100644 --- a/install/assets/css/installer.css +++ b/install/assets/css/installer.css @@ -243,6 +243,11 @@ div.alert-danger { border-color: #ffc107; } +#dxcc_button.has-warning { + border: 1px solid; + border-color: #ffc107; +} + .uppercase { text-transform: uppercase; } diff --git a/install/index.php b/install/index.php index 4bab6e7f4..bf3baf43f 100644 --- a/install/index.php +++ b/install/index.php @@ -1646,7 +1646,7 @@ if (!file_exists('.lock')) { // Documentation: https://davidstutz.github.io/bootstrap-multiselect/index.html // template is needed for bs5 support templates: { - button: '', + button: '', filter: '
', }, enableFiltering: true, @@ -1670,7 +1670,12 @@ if (!file_exists('.lock')) { 'width': '100%', 'height': '39px', 'padding-left': '1px' - }) + }); + + $('#dxcc_id').on('change', function() { + DXCC_Warning(); + }); + DXCC_Warning(); }); function check_for_empty_fields() { @@ -1691,15 +1696,25 @@ if (!file_exists('.lock')) { } + function DXCC_Warning() { + if ($("#dxcc_id option:selected").text().includes("")) { + $('#dxcc_button').addClass('has-warning'); + show_userformwarnings("warning", ""); + } else { + $('#dxcc_button').removeClass('has-warning'); + hide_userformwarnings(); + } + } + function show_userformwarnings(status, message) { - userFormWarnings.css('display', 'block'); + userFormWarnings.show(); userFormWarnings.removeClass('alert-warning alert-danger'); userFormWarnings.addClass('alert-' + status); userFormWarnings.html(message); } function hide_userformwarnings() { - userFormWarnings.css('display', 'none'); + userFormWarnings.hide(); userFormWarnings.removeClass('alert-warning alert-danger'); } @@ -1897,7 +1912,7 @@ if (!file_exists('.lock')) { } if (checklist_firstuser) { - if (passwordField.hasClass('has-warning')) { + if (passwordField.hasClass('has-warning') || $('#dxcc_button').hasClass('has-warning')) { checklistFirstUser.removeClass('fa-times-circle'); checklistFirstUser.removeClass('fa-check-circle'); checklistFirstUser.addClass('fa-exclamation-triangle').css('color', '#ffc107');