From 50fc45dd8017f1dd0dd18b6f7b7617f9b583d521 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Tue, 13 Aug 2019 22:02:36 +0100 Subject: [PATCH] Added the start of the callsign suggest feature --- application/views/interface_assets/footer.php | 16 +++++++++++++++- application/views/qso/index.php | 6 ++++++ assets/css/general.css | 4 ++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 5b42b480..fed032be 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -239,10 +239,24 @@ $(document).ready(function(){ }); + // On Key up check and suggest callsigns + $("#callsign").keyup(function() { + if ($(this).val().length >= 3) { + $('.callsign-suggest').show(); + $.get('lookup/scp/' + $(this).val().toUpperCase(), function(result) { + + $('.callsign-suggestions').text(result); + }); + } + }); + $("#callsign").focusout(function() { + if ($(this).val().length >= 3) { /* Find and populate DXCC */ - $.getJSON('logbook/json/' + $(this).val(), function(result) + $('.callsign-suggest').hide(); + + $.getJSON('logbook/json/' + $(this).val().toUpperCase(), function(result) { //$('#country').val(result); lotw_info if(result.dxcc.entity != undefined) { diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 1afc8149..36b4c307 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -303,6 +303,12 @@
+
+

Suggestions

+ +
+
+

Previous Contacts

diff --git a/assets/css/general.css b/assets/css/general.css index 0b6dee9a..8e3c01b1 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -133,5 +133,9 @@ TD.lotw{ margin-bottom: 10px; } +.callsign-suggest { + margin-bottom: 10px; +} +