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() {