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(); }