diff --git a/htdocs/features.js b/htdocs/features.js index 6da77c8..5ab0972 100644 --- a/htdocs/features.js +++ b/htdocs/features.js @@ -1,6 +1,6 @@ $(function(){ var converter = new showdown.Converter(); - $.ajax('/api/features').done(function(data){ + $.ajax('api/features').done(function(data){ var $table = $('table.features'); $.each(data, function(name, details) { var requirements = $.map(details.requirements, function(r, name){ @@ -21,4 +21,4 @@ $(function(){ ); }) }); -}); \ No newline at end of file +}); diff --git a/htdocs/include/header.include.html b/htdocs/include/header.include.html index 21fc308..a86e4b4 100644 --- a/htdocs/include/header.include.html +++ b/htdocs/include/header.include.html @@ -18,7 +18,7 @@

  • Status

  • Log

  • Receiver
  • -

  • Map
  • +

  • Map
  • diff --git a/htdocs/lib/AprsMarker.js b/htdocs/lib/AprsMarker.js index d31dadd..f6720c1 100644 --- a/htdocs/lib/AprsMarker.js +++ b/htdocs/lib/AprsMarker.js @@ -9,7 +9,7 @@ AprsMarker.prototype.draw = function() { if (this.symbol) { var tableId = this.symbol.table === '/' ? 0 : 1; - div.style.background = 'url(/aprs-symbols/aprs-symbols-24-' + tableId + '@2x.png)'; + div.style.background = 'url(aprs-symbols/aprs-symbols-24-' + tableId + '@2x.png)'; div.style['background-size'] = '384px 144px'; div.style['background-position-x'] = -(this.symbol.index % 16) * 24 + 'px'; div.style['background-position-y'] = -Math.floor(this.symbol.index / 16) * 24 + 'px'; @@ -63,7 +63,7 @@ AprsMarker.prototype.onAdd = function() { var overlay = this.overlay = document.createElement('div'); overlay.style.width = '24px'; overlay.style.height = '24px'; - overlay.style.background = 'url(/aprs-symbols/aprs-symbols-24-2@2x.png)'; + overlay.style.background = 'url(aprs-symbols/aprs-symbols-24-2@2x.png)'; overlay.style['background-size'] = '384px 144px'; overlay.style.display = 'none'; diff --git a/htdocs/map.js b/htdocs/map.js index 41c1105..0089f47 100644 --- a/htdocs/map.js +++ b/htdocs/map.js @@ -18,8 +18,10 @@ var expectedLocator; if (query.locator) expectedLocator = query.locator; - var ws_url = protocol + "://" + (window.location.origin.split("://")[1]) + "/ws/"; - if (!("WebSocket" in window)) return; + var base = protocol + "://" + (window.location.href.split("://")[1]); + base = base.replace(/\/map$/, ''); + if (!base.endsWith('/')) base += '/'; + var ws_url = base + "ws/"; //guess automatically -> now default behaviour var map; var markers = {}; @@ -216,11 +218,11 @@ }, zoom: 5 }); - $.getScript("/static/lib/nite-overlay.js").done(function(){ + $.getScript("static/lib/nite-overlay.js").done(function(){ nite.init(map); setInterval(function() { nite.refresh() }, 10000); // every 10s }); - $.getScript('/static/lib/AprsMarker.js').done(function(){ + $.getScript('static/lib/AprsMarker.js').done(function(){ processUpdates(updateQueue); updateQueue = []; }); @@ -353,4 +355,4 @@ }); }, 1000); -})(); \ No newline at end of file +})(); diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 6512862..8d13b43 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -1532,7 +1532,9 @@ function open_websocket() { protocol = 'wss'; } - var ws_url = protocol + "://" + (window.location.origin.split("://")[1]) + "/ws/"; //guess automatically -> now default behaviour + var base = protocol + "://" + (window.location.href.split("://")[1]); + if (!base.endsWith('/')) base += '/'; + var ws_url = base + "ws/"; //guess automatically -> now default behaviour if (!("WebSocket" in window)) divlog("Your browser does not support WebSocket, which is required for WebRX to run. Please upgrade to a HTML5 compatible browser."); ws = new WebSocket(ws_url);