From 59689f80cca22597b05bf46681b4b04887df7ac0 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Tue, 1 Aug 2023 16:18:56 +0100 Subject: [PATCH] Only show CW functions if using SSL and only when mode is CW --- application/views/qso/index.php | 2 +- assets/js/winkey.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 506627c0..585fe0c8 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -516,7 +516,7 @@
-
+

Winkey diff --git a/assets/js/winkey.js b/assets/js/winkey.js index a91e0489..daa04398 100644 --- a/assets/js/winkey.js +++ b/assets/js/winkey.js @@ -1,3 +1,34 @@ +// Lets see if CW is selected + +const ModeSelected = document.getElementById('mode'); + +if (location.protocol == 'http:') { + // Do something if the page is being served over SSL + $('#winkey').hide(); // Hide the CW buttons +} + +if (ModeSelected.value == 'CW') { + // Show the CW buttons + $('#winkey').show(); +} else { + // Hide the CW buttons + $('#winkey').hide(); +} + +ModeSelected.addEventListener('change', (event) => { + + if (event.target.value == 'CW') { + // Show the CW buttons + $('#winkey').show(); + + } else { + // Hide the CW buttons + $('#winkey').hide(); + } +}); + + + let function1Name, function1Macro, function2Name, function2Macro, function3Name, function3Macro, function4Name, function4Macro, function5Name, function5Macro; getMacros();