bugfixes, design changes

This commit is contained in:
NoobishSVK
2024-05-04 00:37:39 +02:00
parent a557961998
commit 57b276e136
12 changed files with 114 additions and 61 deletions
+19 -2
View File
@@ -49,6 +49,7 @@ $(document).ready(function () {
// Start updating the canvas
initCanvas();
fillPresets();
signalToggle.on("change", function () {
const signalText = localStorage.getItem('signalUnit');
@@ -150,6 +151,10 @@ $(document).ready(function () {
toggleButtonState("ims");
});
$("#volumeSlider").on('mouseup', function() {
$('#volumeSlider').blur();
})
$(freqUpButton).on("click", tuneUp);
$(freqDownButton).on("click", tuneDown);
$(psContainer).on("click", copyPs);
@@ -421,11 +426,13 @@ function getCurrentFreq() {
function checkKey(e) {
e = e || window.event;
if ($('#password:focus').length > 0 || $('#chat-send-message:focus').length > 0) {
if ($('#password:focus').length > 0
|| $('#chat-send-message:focus').length > 0
|| $('#volumeSlider:focus').length > 0
|| $('#chat-nickname:focus').length > 0) {
return;
}
$('#volumeSlider').blur();
getCurrentFreq();
if (socket.readyState === WebSocket.OPEN) {
@@ -893,3 +900,13 @@ function initTooltips() {
$('.tooltiptext').css({ top: posY, left: posX });
});
}
function fillPresets() {
for (let i = 1; i <= 4; i++) {
let presetText = localStorage.getItem(`preset${i}`);
$(`#preset${i}`).text(presetText);
$(`#preset${i}`).click(function() {
tuneTo(Number(presetText));
});
}
}