click-through to selected locator on the map

This commit is contained in:
Jakob Ketterl
2019-07-07 22:36:34 +02:00
parent 94afa94428
commit 2201daaa20
2 changed files with 32 additions and 21 deletions

View File

@ -1379,7 +1379,11 @@ function update_wsjt_panel(msg) {
var $b = $('#openwebrx-panel-wsjt-message tbody');
var t = new Date(msg['timestamp']);
var pad = function(i) { return ('' + i).padStart(2, "0"); }
var linkedmsg = msg['msg'].replace(/(.*\s[A-Z0-9]+\s)([A-R]{2}[0-9]{2})$/, '$1<a href="/map?locator=$2" target="_blank">$2</a>');
var linkedmsg = msg['msg'];
var matches = linkedmsg.match(/(.*\s[A-Z0-9]+\s)([A-R]{2}[0-9]{2})$/);
if (matches && matches[2] != 'RR73') {
linkedmsg = matches[1] + '<a href="/map?locator=' + matches[2] + '" target="_blank">' + matches[2] + '</a>';
}
$b.append($(
'<tr data-timestamp="' + msg['timestamp'] + '">' +
'<td>' + pad(t.getUTCHours()) + pad(t.getUTCMinutes()) + pad(t.getUTCSeconds()) + '</td>' +