From 93bfb2e65cfa3c33056bdecd86514f0b09c3a637 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Mon, 22 Apr 2024 22:25:39 -0400 Subject: [PATCH] Now linkifying all callsigns in FT8/FT4 data. --- htdocs/lib/MessagePanel.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/lib/MessagePanel.js b/htdocs/lib/MessagePanel.js index 13f5f3df..8aa6411f 100644 --- a/htdocs/lib/MessagePanel.js +++ b/htdocs/lib/MessagePanel.js @@ -91,12 +91,14 @@ WsjtMessagePanel.prototype.pushMessage = function(msg) { var matches; if (this.qsoModes.indexOf(msg['mode']) >= 0) { - matches = linkedmsg.match(/(.*)\s([A-Z0-9]+)\s([A-R]{2}[0-9]{2})$/); + matches = linkedmsg.match(/^(.*?)([A-Z0-9]+)\s([A-Z0-9]+)\s(([A-R]{2}[0-9]{2})|(R?[+\-]?[0-9]{2})|(RRR))$/); if (matches) { - var locator = matches[3]!=='RR73'? - Utils.linkifyLocator(matches[3]) : matches[3]; - linkedmsg = Utils.htmlEscape(matches[1]) - + ' ' + Utils.linkifyCallsign(matches[2]) + var destination = matches[2]!=='CQ' && matches[2]!=='DX'? + Utils.linkifyCallsign(matches[2]) : matches[2]; + var locator = matches[5] && matches[5]!=='RR73'? + Utils.linkifyLocator(matches[5]) : matches[4]; + linkedmsg = Utils.htmlEscape(matches[1]) + destination + + ' ' + Utils.linkifyCallsign(matches[3]) + ' ' + locator; } else { linkedmsg = Utils.htmlEscape(linkedmsg);