mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge pull request #3089 from AndreasK79/winkey_visibility_fix
[Winkey] Trigger visibility if mode is set by cat
This commit is contained in:
@@ -132,7 +132,7 @@ $(document).ready(function() {
|
|||||||
reconnectAttempts = 0;
|
reconnectAttempts = 0;
|
||||||
websocketEnabled = true;
|
websocketEnabled = true;
|
||||||
activeWebSocketProtocol = protocol; // Remember which protocol worked
|
activeWebSocketProtocol = protocol; // Remember which protocol worked
|
||||||
|
|
||||||
// Debug log if connected in Hybrid/Auto mode
|
// Debug log if connected in Hybrid/Auto mode
|
||||||
if (isHybridMode) {
|
if (isHybridMode) {
|
||||||
console.log("CAT: Hybrid WebSocket connected successfully.");
|
console.log("CAT: Hybrid WebSocket connected successfully.");
|
||||||
@@ -1098,6 +1098,11 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
cat2UI($mode,newMode,false,false);
|
cat2UI($mode,newMode,false,false);
|
||||||
|
|
||||||
|
// Update winkey visibility directly
|
||||||
|
if (typeof updateWinkeyVisibility === 'function') {
|
||||||
|
updateWinkeyVisibility(newMode);
|
||||||
|
}
|
||||||
|
|
||||||
// Update RST fields when mode changes
|
// Update RST fields when mode changes
|
||||||
// Check if mode was actually updated (catValue changed after cat2UI call)
|
// Check if mode was actually updated (catValue changed after cat2UI call)
|
||||||
var currentMode = $mode.data('catValue');
|
var currentMode = $mode.data('catValue');
|
||||||
@@ -1295,7 +1300,7 @@ $(document).ready(function() {
|
|||||||
reconnectAttempts = 0; // Reset reconnect attempts
|
reconnectAttempts = 0; // Reset reconnect attempts
|
||||||
hasTriedWsFallback = false; // Reset WSS failover state - try WSS first again
|
hasTriedWsFallback = false; // Reset WSS failover state - try WSS first again
|
||||||
isHybridMode = false; // Explicitly NOT hybrid
|
isHybridMode = false; // Explicitly NOT hybrid
|
||||||
|
|
||||||
// Set DX Waterfall CAT state to websocket if variable exists
|
// Set DX Waterfall CAT state to websocket if variable exists
|
||||||
if (typeof dxwaterfall_cat_state !== 'undefined') {
|
if (typeof dxwaterfall_cat_state !== 'undefined') {
|
||||||
dxwaterfall_cat_state = "websocket";
|
dxwaterfall_cat_state = "websocket";
|
||||||
@@ -1314,7 +1319,7 @@ $(document).ready(function() {
|
|||||||
dxwaterfall_cat_state = "polling";
|
dxwaterfall_cat_state = "polling";
|
||||||
}
|
}
|
||||||
$('#toggleCatTracking').prop('disabled', false).removeClass('disabled');
|
$('#toggleCatTracking').prop('disabled', false).removeClass('disabled');
|
||||||
|
|
||||||
// Start standard polling
|
// Start standard polling
|
||||||
CATInterval = setInterval(updateFromCAT, CAT_CONFIG.POLL_INTERVAL);
|
CATInterval = setInterval(updateFromCAT, CAT_CONFIG.POLL_INTERVAL);
|
||||||
|
|
||||||
@@ -1325,7 +1330,7 @@ $(document).ready(function() {
|
|||||||
reconnectAttempts = 0;
|
reconnectAttempts = 0;
|
||||||
hasTriedWsFallback = false;
|
hasTriedWsFallback = false;
|
||||||
isHybridMode = true; // Activate Hybrid Mode restrictions (limited retries, no UI errors)
|
isHybridMode = true; // Activate Hybrid Mode restrictions (limited retries, no UI errors)
|
||||||
|
|
||||||
initializeWebSocketConnection();
|
initializeWebSocketConnection();
|
||||||
|
|
||||||
if ((window.CAT_COMPACT_MODE === 'ultra-compact' || window.CAT_COMPACT_MODE === 'icon-only') && typeof window.isCatTrackingEnabled !== 'undefined' && !window.isCatTrackingEnabled) {
|
if ((window.CAT_COMPACT_MODE === 'ultra-compact' || window.CAT_COMPACT_MODE === 'icon-only') && typeof window.isCatTrackingEnabled !== 'undefined' && !window.isCatTrackingEnabled) {
|
||||||
@@ -1343,7 +1348,7 @@ $(document).ready(function() {
|
|||||||
/**
|
/**
|
||||||
* Broadcast Callsign Lookup Result via WebSocket
|
* Broadcast Callsign Lookup Result via WebSocket
|
||||||
* Triggered when Wavelog completes a callsign lookup.
|
* Triggered when Wavelog completes a callsign lookup.
|
||||||
*
|
*
|
||||||
* @param {object} data - The lookup data object
|
* @param {object} data - The lookup data object
|
||||||
*/
|
*/
|
||||||
window.broadcastLookupResult = function(data) {
|
window.broadcastLookupResult = function(data) {
|
||||||
@@ -1381,5 +1386,5 @@ $(document).ready(function() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn('Failed to broadcast lookup result:', error);
|
console.warn('Failed to broadcast lookup result:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,24 +9,22 @@ $(document).ready(function() {
|
|||||||
$('#winkey').hide(); // Hide the CW buttons
|
$('#winkey').hide(); // Hide the CW buttons
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ModeSelected.value == 'CW') {
|
// Function to update winkey visibility based on mode
|
||||||
// Show the CW buttons
|
// Can be called directly from other scripts (e.g., cat.js)
|
||||||
$('#winkey').show();
|
window.updateWinkeyVisibility = function(mode) {
|
||||||
} else {
|
if (mode == 'CW') {
|
||||||
// Hide the CW buttons
|
|
||||||
$('#winkey').hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
ModeSelected.addEventListener('change', (event) => {
|
|
||||||
|
|
||||||
if (event.target.value == 'CW') {
|
|
||||||
// Show the CW buttons
|
|
||||||
$('#winkey').show();
|
$('#winkey').show();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Hide the CW buttons
|
|
||||||
$('#winkey').hide();
|
$('#winkey').hide();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Initial check
|
||||||
|
updateWinkeyVisibility(ModeSelected.value);
|
||||||
|
|
||||||
|
// Listen for manual changes from dropdown
|
||||||
|
ModeSelected.addEventListener('change', (event) => {
|
||||||
|
updateWinkeyVisibility(event.target.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#winkeycwspeed').change(function (event) {
|
$('#winkeycwspeed').change(function (event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user