1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-26 22:13:53 +01:00

Several fixes

* Fixed rare unprompted auto-restart stream bug (bkram) [/web/js/3las/main.js]
* Fixed multiple tooltip bug while RDS PS is tentatively loaded [/web/js/main.js]
* Changed copying of plugin files to symlinks (junction for Windows) [/server/plugins.js]
* Auto-reconnect audio stream on restored/changed internet connection [/web/js/3las/3las.js]
* Main WebSocket connection can be shared with plugins [/web/js/websocket.js] [/web/index.ejs]
This commit is contained in:
AmateurAudioDude
2024-07-14 19:52:12 +10:00
committed by GitHub
parent 8b2f489fbe
commit e510ce61e6
6 changed files with 178 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
var url = new URL('text', window.location.href);
url.protocol = url.protocol.replace('http', 'ws');
var socketAddress = url.href;
var socket = new WebSocket(socketAddress);
// WebSocket connection located in ./websocket.js
var parsedData, signalChart, previousFreq;
var signalData = [];
var data = [];
@@ -10,7 +10,7 @@ let updateCounter = 0;
const europe_programmes = [
"No PTY", "News", "Current Affairs", "Info",
"Sport", "Education", "Drama", "Culture", "Science", "Varied",
"Pop M", "Rock M", "Easy Listening", "Light Classical",
"Pop Music", "Rock Music", "Easy Listening", "Light Classical",
"Serious Classical", "Other Music", "Weather", "Finance",
"Children's Programmes", "Social Affairs", "Religion", "Phone-in",
"Travel", "Leisure", "Jazz Music", "Country Music", "National Music",
@@ -881,7 +881,7 @@ function initTooltips() {
// Add a delay of 500 milliseconds before creating and appending the tooltip
$(this).data('timeout', setTimeout(() => {
var tooltip = $('<div class="tooltiptext"></div>').html(tooltipText);
$('body').append(tooltip);
if ($('.tooltiptext').length === 0) { $('body').append(tooltip); } // Don't allow more than one tooltip
var posX = e.pageX;
var posY = e.pageY;
@@ -896,6 +896,7 @@ function initTooltips() {
// Clear the timeout if the mouse leaves before the delay completes
clearTimeout($(this).data('timeout'));
$('.tooltiptext').remove();
setTimeout(() => { $('.tooltiptext').remove(); }, 500); // Ensure no tooltips remain stuck
}).mousemove(function(e){
var tooltipWidth = $('.tooltiptext').outerWidth();
var tooltipHeight = $('.tooltiptext').outerHeight();