[QSO] Fixed Badge colours not functioning correctly

This commit is contained in:
Peter Goodhall 2023-11-26 15:01:34 +00:00
parent 2350cc07d3
commit 64e8c28a17
2 changed files with 22 additions and 22 deletions

View File

@ -110,7 +110,7 @@
<div class="mb-3 col-md-9">
<label for="callsign"><?php echo lang('gen_hamradio_callsign'); ?></label><?php if ($this->optionslib->get_option('dxcache_url') != '') { ?>&nbsp;<i id="check_cluster" data-bs-toggle="tooltip" title="Search DXCluster for latest Spot" class="fas fa-search"></i> <?php } ?>
<input type="text" class="form-control" id="callsign" name="callsign" required>
<small id="callsign_info" class="badge text-bg-danger"></small> <a id="lotw_link"><small id="lotw_info" class="badge text-bg-success"></small></a>
<small id="callsign_info" class="badge text-bg-secondary"></small> <a id="lotw_link"><small id="lotw_info" class="badge text-bg-success"></small></a>
</div>
<div class="mb-3 col-md-3 align-self-center">
<small id="qrz_info" class="badge text-bg-secondary"></small>

View File

@ -425,20 +425,20 @@ function changebadge(entityname) {
{
$('#callsign_info').removeClass("lotw_info_orange");
$('#callsign_info').removeClass("badge-secondary");
$('#callsign_info').removeClass("badge-success");
$('#callsign_info').removeClass("badge-danger");
$('#callsign_info').removeClass("text-bg-secondary");
$('#callsign_info').removeClass("text-bg-success");
$('#callsign_info').removeClass("text-bg-danger");
$('#callsign_info').attr('title', '');
if (result.confirmed) {
$('#callsign_info').addClass("badge-success");
$('#callsign_info').addClass("text-bg-success");
$('#callsign_info').attr('title', 'DXCC was already worked and confirmed in the past on this band and mode!');
} else if (result.workedBefore) {
$('#callsign_info').addClass("badge-success");
$('#callsign_info').addClass("text-bg-success");
$('#callsign_info').addClass("lotw_info_orange");
$('#callsign_info').attr('title', 'DXCC was already worked in the past on this band and mode!');
} else {
$('#callsign_info').addClass("badge-danger");
$('#callsign_info').addClass("text-bg-danger");
$('#callsign_info').attr('title', 'New DXCC, not worked on this band and mode!');
}
})
@ -447,20 +447,20 @@ function changebadge(entityname) {
{
// Reset CSS values before updating
$('#callsign_info').removeClass("lotw_info_orange");
$('#callsign_info').removeClass("badge-secondary");
$('#callsign_info').removeClass("badge-success");
$('#callsign_info').removeClass("badge-danger");
$('#callsign_info').removeClass("text-bg-secondary");
$('#callsign_info').removeClass("text-bg-success");
$('#callsign_info').removeClass("text-bg-danger");
$('#callsign_info').attr('title', '');
if (result.confirmed) {
$('#callsign_info').addClass("badge-success");
$('#callsign_info').addClass("text-bg-success");
$('#callsign_info').attr('title', 'DXCC was already worked and confirmed in the past on this band and mode!');
} else if (result.workedBefore) {
$('#callsign_info').addClass("badge-success");
$('#callsign_info').addClass("text-bg-success");
$('#callsign_info').addClass("lotw_info_orange");
$('#callsign_info').attr('title', 'DXCC was already worked in the past on this band and mode!');
} else {
$('#callsign_info').addClass("badge-danger");
$('#callsign_info').addClass("text-bg-danger");
$('#callsign_info').attr('title', 'New DXCC, not worked on this band and mode!');
}
})
@ -493,9 +493,9 @@ function reset_fields() {
$("#callsign").removeClass("confirmedGrid");
$("#callsign").removeClass("workedGrid");
$("#callsign").removeClass("newGrid");
$('#callsign_info').removeClass("badge-secondary");
$('#callsign_info').removeClass("badge-success");
$('#callsign_info').removeClass("badge-danger");
$('#callsign_info').removeClass("text-bg-secondary");
$('#callsign_info').removeClass("text-bg-success");
$('#callsign_info').removeClass("text-bg-danger");
$('#callsign-image').attr('style', 'display: none;');
$('#callsign-image-content').text("");
$('#qsl_via').val("");
@ -960,9 +960,9 @@ $('#dxcc_id').on('change', function() {
$('#country').val(convert_case(result.dxcc.name));
$('#cqz').val(convert_case(result.dxcc.cqz));
$('#callsign_info').removeClass("badge-secondary");
$('#callsign_info').removeClass("badge-success");
$('#callsign_info').removeClass("badge-danger");
$('#callsign_info').removeClass("text-bg-secondary");
$('#callsign_info').removeClass("text-bg-success");
$('#callsign_info').removeClass("text-bg-danger");
$('#callsign_info').attr('title', '');
$('#callsign_info').text(convert_case(result.dxcc.name));
@ -1031,9 +1031,9 @@ function resetDefaultQSOFields() {
$("#callsign").removeClass("workedGrid");
$("#callsign").removeClass("confirmedGrid");
$("#callsign").removeClass("newGrid");
$('#callsign_info').removeClass("badge-secondary");
$('#callsign_info').removeClass("badge-success");
$('#callsign_info').removeClass("badge-danger");
$('#callsign_info').removeClass("text-bg-secondary");
$('#callsign_info').removeClass("text-bg-success");
$('#callsign_info').removeClass("text-bg-danger");
$('#input_usa_state').val("");
$('#callsign-image').attr('style', 'display: none;');
$('#callsign-image-content').text("");