Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions sloccount.html
Original file line number Diff line number Diff line change
Expand Up @@ -552,21 +552,8 @@ <h3>Language Breakdown</h3>
analyzeZipBtn.textContent = 'Analyze ZIP';
analyzeZipBtn.disabled = false;

// Check for ?repo= query parameter and auto-run
const params = new URLSearchParams(window.location.search);
const repoParam = params.get('repo');
// If ?repo= was provided, auto-run analysis now that assets are ready
if (repoParam) {
// Switch to GitHub tab
tabs.forEach(t => t.classList.remove('active'));
document.querySelector('[data-tab="github"]').classList.add('active');
pasteTab.classList.remove('active');
githubTab.classList.add('active');
zipTab.classList.remove('active');

// Fill in the repo URL
repoInput.value = repoParam;

// Auto-run analysis
analyzeGitHubRepo();
} else {
showStatus('Ready to analyze code!', 'success');
Expand Down Expand Up @@ -1198,6 +1185,21 @@ <h3>Language Breakdown</h3>
}
}, 100);

// Check for ?repo= query parameter immediately and switch tab
const params = new URLSearchParams(window.location.search);
const repoParam = params.get('repo');
if (repoParam) {
// Switch to GitHub tab instantly, before assets load
tabs.forEach(t => t.classList.remove('active'));
document.querySelector('[data-tab="github"]').classList.add('active');
pasteTab.classList.remove('active');
githubTab.classList.add('active');
zipTab.classList.remove('active');

// Fill in the repo URL
repoInput.value = repoParam;
}

// Initialize when page loads
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initializeWebPerl);
Expand Down
Loading