From 17703e16d3c9675877dea53ba914a17a50cccf96 Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 26 Jul 2023 19:50:52 +0000 Subject: [PATCH] click on call -> copy call and qrg to add_qso --- assets/js/sections/bandmap_list.js | 11 ++++++++--- assets/js/sections/qso.js | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js index 59ecb8aa..91824082 100644 --- a/assets/js/sections/bandmap_list.js +++ b/assets/js/sections/bandmap_list.js @@ -122,7 +122,6 @@ $(function() { var bc_qsowin = new BroadcastChannel('qso_window'); bc_qsowin.onmessage = function (ev) { - // console.log(ev.data); if (ev.data == 'pong') { qso_window_last_seen=Date.now(); } @@ -133,9 +132,15 @@ $(function() { $(document).on('click','.spotted_call', function() { if (Date.now()-qso_window_last_seen < 2000) { - bc2qso.postMessage({ call: this.innerText }); + bc2qso.postMessage({ frequency: this.parentNode.cells[1].textContent*1000, call: this.innerText }); } else { - window.open('https://log.dj7nt.de/index.php/qso?manual=0','_blank'); + let cl={}; + cl.qrg=this.parentNode.cells[1].textContent*1000; + cl.call=this.innerText; + window.open(base_url + 'qso?manual=0','_blank'); + setTimeout(function () { + bc2qso.postMessage({ frequency: cl.qrg, call: cl.call }) + },2500); // Wait at least 2500ms for new-Window to appear, before posting data to it } }); diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js index 23087aab..9dd906f6 100644 --- a/assets/js/sections/qso.js +++ b/assets/js/sections/qso.js @@ -16,6 +16,12 @@ $( document ).ready(function() { message.pong=true; bc.postMessage(message); } else { + $('#frequency').val(ev.data.frequency); + $("#band").val(frequencyToBand(ev.data.frequency)); + if (ev.data.frequency_rx != "") { + $('#frequency_rx').val(ev.data.frequency_rx); + $("#band_rx").val(frequencyToBand(ev.data.frequency_rx)); + } $("#callsign").val(ev.data.call); $("#callsign").blur(); }