From e831a7863099142588383a8200465fc05ffef427 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Sun, 15 Oct 2023 18:30:51 -0400 Subject: [PATCH] Updating list of reports sizing. --- htdocs/css/map.css | 5 +++-- htdocs/lib/MapLocators.js | 2 +- htdocs/lib/MapManager.js | 2 +- htdocs/lib/Utils.js | 11 +++++++++-- htdocs/map-google.js | 1 - htdocs/map-leaflet.js | 1 - htdocs/openwebrx.js | 4 ++++ owrx/connection.py | 1 + 8 files changed, 19 insertions(+), 8 deletions(-) diff --git a/htdocs/css/map.css b/htdocs/css/map.css index 88ead965..4d5700e9 100644 --- a/htdocs/css/map.css +++ b/htdocs/css/map.css @@ -90,8 +90,9 @@ ul { } .openwebrx-map-info td { - padding-left: 10px; - padding-right: 10px; + padding-left: 5px; + padding-right: 5px; text-align: center; white-space: nowrap; + font-size: 1vw; } diff --git a/htdocs/lib/MapLocators.js b/htdocs/lib/MapLocators.js index 63fa36c3..5c586f08 100644 --- a/htdocs/lib/MapLocators.js +++ b/htdocs/lib/MapLocators.js @@ -307,5 +307,5 @@ Locator.prototype.getInfoHTML = function(locator, pos, receiverMarker = null) { return '

Locator ' + locator + distance + '

' + '
' + lastReport + '
' + Utils.makeListTitle('Active Callsigns') - + '' + list + '
'; + + '' + list + '
'; }; diff --git a/htdocs/lib/MapManager.js b/htdocs/lib/MapManager.js index 2ddba844..f99726ca 100644 --- a/htdocs/lib/MapManager.js +++ b/htdocs/lib/MapManager.js @@ -95,7 +95,7 @@ MapManager.prototype.process = function(e) { retention_time = this.config.map_position_retention_time * 1000; } if ('callsign_url' in this.config) { - callsign_url = this.config.callsign_url; + Utils.setCallsignUrl(this.config.callsign_url); } if ('vessel_url' in this.config) { vessel_url = this.config.vessel_url; diff --git a/htdocs/lib/Utils.js b/htdocs/lib/Utils.js index 4c83b57f..e38665b4 100644 --- a/htdocs/lib/Utils.js +++ b/htdocs/lib/Utils.js @@ -4,6 +4,13 @@ function Utils() {} +Utils.callsign_url = null; + +// Set URL for linkifying callsigns +Utils.setCallsignUrl = function(url) { + this.callsign_url = url; +}; + // Escape HTML code. Utils.htmlEscape = function(input) { return $('
').text(input).html() @@ -31,7 +38,7 @@ Utils.linkifyCallsign = function(callsign) { // Strip callsign of modifiers var id = callsign.replace(new RegExp('[-/].*$'), ''); // Add country name as a tooltip - return this.linkify(id, callsign_url, callsign, Utils.call2country(id)); + return this.linkify(id, this.callsign_url, callsign, this.call2country(id)); }; // Create link to tune OWRX to the given frequency and modulation. @@ -121,7 +128,7 @@ Utils.getOpacityScale = function(age) { Utils.call2country = function(callsign) { for (var j=4 ; j>0 ; j--) { var pfx = callsign.substring(0, j) - if (pfx in Utils.PFX2COUNTRY) return Utils.PFX2COUNTRY[pfx]; + if (pfx in this.PFX2COUNTRY) return this.PFX2COUNTRY[pfx]; } return ''; }; diff --git a/htdocs/map-google.js b/htdocs/map-google.js index 4df0a460..af44e109 100644 --- a/htdocs/map-google.js +++ b/htdocs/map-google.js @@ -1,5 +1,4 @@ // Marker.linkify() uses these URLs -var callsign_url = null; var vessel_url = null; var flight_url = null; var modes_url = null; diff --git a/htdocs/map-leaflet.js b/htdocs/map-leaflet.js index 22dfa252..944247a8 100644 --- a/htdocs/map-leaflet.js +++ b/htdocs/map-leaflet.js @@ -1,5 +1,4 @@ // Marker.linkify() uses these URLs -var callsign_url = null; var vessel_url = null; var flight_url = null; var modes_url = null; diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index ccd9324a..57d0fce5 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1133,6 +1133,10 @@ function on_ws_recv(evt) { adsb_panel.setModeSUrl(config['modes_url']); } + if ('callsign_url' in config) { + Utils.setCallsignUrl(config['callsign_url']); + } + break; case "secondary_config": var s = json['value']; diff --git a/owrx/connection.py b/owrx/connection.py index c907281f..2a52d461 100644 --- a/owrx/connection.py +++ b/owrx/connection.py @@ -146,6 +146,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient): "allow_center_freq_changes", "allow_audio_recording", "magic_key", + "callsign_url", "flight_url", "modes_url", "receiver_gps",