You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-27 06:23:53 +01:00
bugfixes
This commit is contained in:
@@ -11,10 +11,10 @@ $(document).ready(function() {
|
||||
|
||||
chatSocket.onmessage = function(event) {
|
||||
const messageData = JSON.parse(event.data);
|
||||
const isAdmin = messageData.admin ? '<span style="color: lime">[ADMIN]</span>' : '';
|
||||
const isAdmin = messageData.admin ? '<span style="color: #bada55">[ADMIN]</span>' : '';
|
||||
|
||||
if (messageData.type === 'clientIp') {
|
||||
chatIdentityNickname.html(isAdmin + " " + savedNickname.length > 0 ? savedNickname : 'Anonymous User');
|
||||
chatIdentityNickname.html(isAdmin + " " + (savedNickname.length > 0 ? savedNickname : 'Anonymous User'));
|
||||
chatIdentityNickname.attr('title', messageData.ip);
|
||||
} else {
|
||||
const chatMessage = `
|
||||
|
||||
@@ -254,7 +254,7 @@ function submitData() {
|
||||
});
|
||||
|
||||
$('#audio-software-mode').prop("checked", data.audio.softwareMode || false);
|
||||
$('#startup-volume').val(data.audio.startupVolume || 100);
|
||||
$('#startup-volume').val(data.audio.startupVolume || 1);
|
||||
$('#volume-percentage-value').text(data.audio.startupVolume !== undefined ? (data.audio.startupVolume * 100).toFixed(0) + '%' : '100%');
|
||||
|
||||
$('#webserver-name').val(data.identification.tunerName);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
var currentDate = new Date('March 28, 2024 22:00:00');
|
||||
var currentDate = new Date('April 6, 2024 01:00:00');
|
||||
var day = currentDate.getDate();
|
||||
var month = currentDate.getMonth() + 1; // Months are zero-indexed, so add 1
|
||||
var year = currentDate.getFullYear();
|
||||
@@ -12,10 +12,8 @@ function getInitialSettings() {
|
||||
url: './static_data',
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
// Use the received data (data.qthLatitude, data.qthLongitude) as needed
|
||||
localStorage.setItem('qthLatitude', data.qthLatitude);
|
||||
localStorage.setItem('qthLongitude', data.qthLongitude);
|
||||
localStorage.setItem('streamEnabled', data.streamEnabled);
|
||||
localStorage.setItem('defaultTheme', data.defaultTheme);
|
||||
localStorage.setItem('preset1', data.presets[0]);
|
||||
localStorage.setItem('preset2', data.presets[1]);
|
||||
|
||||
@@ -805,10 +805,10 @@ function createListItem(element) {
|
||||
|
||||
function updateButtonState(buttonId, value) {
|
||||
var button = $("#" + buttonId);
|
||||
if (value === 0) {
|
||||
button.addClass("btn-disabled");
|
||||
if (value == 0) {
|
||||
button.hasClass("btn-disabled") ? null : button.addClass("btn-disabled");
|
||||
} else {
|
||||
button.removeClass("btn-disabled");
|
||||
button.hasClass("btn-disabled") ? button.removeClass("btn-disabled") : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ const signalUnits = {
|
||||
};
|
||||
|
||||
$(document).ready(() => {
|
||||
// Theme Selector
|
||||
const themeSelector = $('#theme-selector');
|
||||
const savedTheme = localStorage.getItem('theme');
|
||||
const defaultTheme = localStorage.getItem('defaultTheme');
|
||||
@@ -47,7 +46,6 @@ $(document).ready(() => {
|
||||
setBg();
|
||||
});
|
||||
|
||||
// Signal Selector
|
||||
const signalSelector = $('#signal-selector');
|
||||
|
||||
if (localStorage.getItem('signalUnit')) {
|
||||
@@ -88,7 +86,6 @@ $(document).ready(() => {
|
||||
});
|
||||
});
|
||||
|
||||
// Assuming you have an anchor tag with id 'logout-link'
|
||||
$('.logout-link').click(function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
@@ -97,11 +94,10 @@ $(document).ready(() => {
|
||||
type: 'GET', // Assuming the logout is a GET request, adjust accordingly
|
||||
url: './logout',
|
||||
success: function (data) {
|
||||
// Update the content on the page with the message from the response
|
||||
$('#login-message').text(data.message);
|
||||
setTimeout(function () {
|
||||
location.reload(true);
|
||||
}, 1750);
|
||||
}, 1000);
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
// Handle error response
|
||||
@@ -121,7 +117,6 @@ $(document).ready(() => {
|
||||
$("#extended-frequency-range").prop("checked", true);
|
||||
}
|
||||
|
||||
// Save the value of the checkbox into local storage when its state changes
|
||||
$("#extended-frequency-range").change(function() {
|
||||
var isChecked = $(this).is(":checked");
|
||||
localStorage.setItem("extendedFreqRange", isChecked);
|
||||
@@ -137,7 +132,6 @@ $(document).ready(() => {
|
||||
$("#smooth-signal").prop("checked", true);
|
||||
}
|
||||
|
||||
// Save the value of the checkbox into local storage when its state changes
|
||||
$("#ps-underscores").change(function() {
|
||||
var isChecked = $(this).is(":checked");
|
||||
localStorage.setItem("psUnderscores", isChecked);
|
||||
@@ -160,7 +154,6 @@ function setTheme(themeName) {
|
||||
// Extracting the RGBA components and opacity value
|
||||
const rgbaComponents = themeColors[2].match(/(\d+(\.\d+)?)/g);
|
||||
const opacity = parseFloat(rgbaComponents[3]);
|
||||
// Calculating 80% of the opacity
|
||||
const newOpacity = opacity * 0.75;
|
||||
// Constructing the new RGBA string with the adjusted opacity
|
||||
const textColor2 = `rgba(${rgbaComponents[0]}, ${rgbaComponents[1]}, ${rgbaComponents[2]}, ${newOpacity})`;
|
||||
|
||||
@@ -10,7 +10,6 @@ $(document).ready(function() {
|
||||
fetchData();
|
||||
|
||||
$('#startup-volume').on('change', function() {
|
||||
console.log('changed');
|
||||
var value = $(this).val(); // Get the value of the range input
|
||||
var percentage = value * 100; // Convert to percentage
|
||||
$('#volume-percentage-value').text(percentage.toFixed(0) + '%'); // Display the percentage value
|
||||
|
||||
Reference in New Issue
Block a user