diff --git a/application/config/cloudlog.php b/application/config/cloudlog.php index 0d2f6bf9..9fda1c61 100644 --- a/application/config/cloudlog.php +++ b/application/config/cloudlog.php @@ -124,3 +124,19 @@ $config['qso_date_format'] = "d/m/y"; */ $config['map_6digit_grids'] = FALSE; + + +/* +|-------------------------------------------------------------------------- +| Automatically populate the QTH +|-------------------------------------------------------------------------- +| +| Setting this to TRUE allows the QTH locator to be pre-filled +| based on the person's location when creating new QSO. +| OSM's Nominatim API is being used for that purpose +| +| Default is: TRUE +| +*/ + +$config['qso_auto_qth'] = TRUE; diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 648f1af8..51e4b628 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -486,7 +486,7 @@ $(document).on('keypress',function(e) { }) } } - +config->item('qso_auto_qth')) { ?> $('#qth').focusout(function() { if ($('#locator').val() === '') { var lat = 0; @@ -548,8 +548,8 @@ $(document).on('keypress',function(e) { if (num >= 8) qthloc += ' ' + String.fromCharCode(yn[6] + 0x30) + String.fromCharCode(yn[7] + 0x30); if (num >= 10) qthloc += String.fromCharCode(yn[8] + 0x61) + String.fromCharCode(yn[9] + 0x61); return qthloc; - } + $("#callsign").focusout(function() {