From b4eb71f296206f5bcd164f2b2a88eb2066c8c765 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Sat, 16 Sep 2023 13:49:12 -0400 Subject: [PATCH] Added linkToMap() method. --- htdocs/lib/MessagePanel.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/htdocs/lib/MessagePanel.js b/htdocs/lib/MessagePanel.js index aff68b1b..6cee4e71 100644 --- a/htdocs/lib/MessagePanel.js +++ b/htdocs/lib/MessagePanel.js @@ -56,6 +56,12 @@ MessagePanel.prototype.scrollToBottom = function() { $t.scrollTop($t[0].scrollHeight); }; +MessagePanel.prototype.linkToMap = function(id, contents = null, attrs = "") { + return '' + + (contents!=null? contents : id) + ''; +}; + function WsjtMessagePanel(el) { MessagePanel.call(this, el); this.initClearTimer(); @@ -212,7 +218,7 @@ PacketMessagePanel.prototype.pushMessage = function(msg) { 'style="' + stylesToString(styles) + '"' ].join(' '); if (msg.lat && msg.lon) { - link = '' + overlay + ''; + link = this.linkToMap(source, overlay, attrs); } else { link = '
' + overlay + '
' } @@ -358,14 +364,14 @@ HfdlMessagePanel.prototype.setModeSUrl = function(url) { HfdlMessagePanel.prototype.linkify = function(id, url) { // Do not linkify empty strings - if (id.len<=0) return id; + if (id.len <= 0) return id; // Must have valid lookup URL if ((url == null) || (url == '')) return id; else - return '' + id + ''; + return '' + id + ''; }; HfdlMessagePanel.prototype.render = function() {