MCPcopy Create free account
hub / github.com/BrainicHQ/DoHSpeedTest / setButtonState

Function setButtonState

script.js:524–544  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

522// ─── DNS Speed Test Logic ────────────────────────────────────────────────────
523
524function setButtonState(state) {
525 const spinnerSVG = '<svg class="w-4 h-4 btn-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"/><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"/></svg>';
526 const playSVG = '<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>';
527
528 if (state === 'warmup') {
529 btnIcon.innerHTML = spinnerSVG;
530 btnText.textContent = 'Warming up...';
531 checkButton.disabled = true;
532 } else if (state === 'testing') {
533 btnIcon.innerHTML = spinnerSVG;
534 // btnText updated per-server in performDNSTests
535 } else if (state === 'done') {
536 btnIcon.innerHTML = playSVG;
537 btnText.textContent = 'Run Again';
538 checkButton.disabled = false;
539 } else {
540 btnIcon.innerHTML = playSVG;
541 btnText.textContent = 'Run Speed Test';
542 checkButton.disabled = false;
543 }
544}
545
546checkButton.addEventListener('click', async function () {
547 if (testRunning) return;

Callers 1

script.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected