QSO-Windowdetection / basics
这个提交包含在:
父节点
e34640a006
当前提交
7455ee6f46
共有 2 个文件被更改,包括 37 次插入 和 4 次删除
|
|
@ -118,10 +118,25 @@ $(function() {
|
|||
}
|
||||
});
|
||||
|
||||
var qso_window_last_seen=Date.now()-3600;
|
||||
|
||||
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();
|
||||
}
|
||||
};
|
||||
|
||||
setInterval(function () { bc_qsowin.postMessage('ping') },500);
|
||||
var bc2qso = new BroadcastChannel('qso_wish');
|
||||
|
||||
$(document).on('click','.spotted_call', function() {
|
||||
var bc = new BroadcastChannel('qso_wish');
|
||||
bc.postMessage(this.innerText);
|
||||
console.log(this.innerText);
|
||||
if (Date.now()-qso_window_last_seen < 2000) {
|
||||
bc2qso.postMessage({ call: this.innerText });
|
||||
} else {
|
||||
window.open('https://log.dj7nt.de/index.php/qso?manual=0','_blank');
|
||||
}
|
||||
});
|
||||
|
||||
$("#menutoggle").on("click", function() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,25 @@
|
|||
$( document ).ready(function() {
|
||||
|
||||
|
||||
var bc_bandmap = new BroadcastChannel('qso_window');
|
||||
bc_bandmap.onmessage = function (ev) {
|
||||
console.log(ev.data);
|
||||
if (ev.data == 'ping') {
|
||||
bc_bandmap.postMessage('pong');
|
||||
}
|
||||
}
|
||||
|
||||
var bc = new BroadcastChannel('qso_wish');
|
||||
bc.onmessage = function (ev) { console.log(ev); } /* receive */
|
||||
bc.onmessage = function (ev) {
|
||||
if (ev.data.ping) {
|
||||
let message={};
|
||||
message.pong=true;
|
||||
bc.postMessage(message);
|
||||
} else {
|
||||
$("#callsign").val(ev.data.call);
|
||||
$("#callsign").blur();
|
||||
}
|
||||
} /* receive */
|
||||
|
||||
$("#locator")
|
||||
.popover({ placement: 'top', title: 'Gridsquare Formatting', content: "Enter multiple (4-digit) grids separated with commas. For example: IO77,IO78" })
|
||||
|
|
|
|||
正在加载…
在新工单中引用