diff --git a/TGBeta.ps1 b/TGBeta.ps1 index 3f4470e..6a4b816 100644 --- a/TGBeta.ps1 +++ b/TGBeta.ps1 @@ -681,6 +681,36 @@ function GetHtmlContent { }); } + function updateSelectAllonboard() { + const selectAllCheckbox = document.getElementById('selectAllonboardCheckbox'); + const checkboxes = document + .getElementById('onboardTab') + .querySelectorAll('input[type="checkbox"]:not(#selectAllonboardCheckbox)'); + + // If any checkbox is unchecked, uncheck "Select All" + selectAllCheckbox.checked = Array.from(checkboxes).every(checkbox => checkbox.checked); + } + + // Attach the updateSelectAllonboard function to all individual checkboxes + document.querySelectorAll('#onboardTab input[type="checkbox"]:not(#selectAllonboardCheckbox)').forEach(checkbox => { + checkbox.addEventListener('change', updateSelectAllonboard); + }); + + function updateSelectAllOffboard() { + const selectAllCheckbox = document.getElementById('selectAllOffboardCheckbox'); + const checkboxes = document + .getElementById('offboardTab') + .querySelectorAll('input[type="checkbox"]:not(#selectAllOffboardCheckbox)'); + + // If any checkbox is unchecked, uncheck "Select All" + selectAllCheckbox.checked = Array.from(checkboxes).every(checkbox => checkbox.checked); + } + + // Attach the updateSelectAllOffboard function to all individual checkboxes + document.querySelectorAll('#offboardTab input[type="checkbox"]:not(#selectAllOffboardCheckbox)').forEach(checkbox => { + checkbox.addEventListener('change', updateSelectAllOffboard); + }); + function toggleTweaksCheckboxes(selectAllCheckbox) { // Get all checkboxes inside the tweaksTab container const checkboxes = document