document.addEventListener('DOMContentLoaded', function () { const scanBtn = document.getElementById('scanRepoBtn'); if (scanBtn) { scanBtn.addEventListener('click', function (e) { e.preventDefault(); const spinner = scanBtn.querySelector('.spinner-border'); const buttonText = scanBtn.querySelector('.button-text'); const buttonIcon = scanBtn.querySelector('.bi-search'); // Show spinner, hide icon, and update text if (spinner) spinner.style.display = 'inline-block'; if (buttonIcon) buttonIcon.style.display = 'none'; if (buttonText) buttonText.textContent = 'Scanning...'; // Disable button scanBtn.disabled = true; // Redirect to trigger the scan and show success message window.location.href = 'index.php?scan=success'; }); } });