mirror of
https://github.com/github/awesome-copilot.git
synced 2026-02-21 10:55:13 +00:00
feat: add VS Code and VS Code Insiders install buttons
- Fix VS Code install URL format to match README links - Add separate buttons for VS Code and VS Code Insiders - Support install links for agents, prompts, and instructions - Add VS Code icon SVG to buttons
This commit is contained in:
@@ -46,7 +46,8 @@ export async function openFileModal(filePath: string, type: string): Promise<voi
|
||||
const modal = document.getElementById('file-modal');
|
||||
const title = document.getElementById('modal-title');
|
||||
const contentEl = document.getElementById('modal-content')?.querySelector('code');
|
||||
const installBtn = document.getElementById('install-vscode-btn') as HTMLAnchorElement | null;
|
||||
const installBtn = document.getElementById('install-btn') as HTMLAnchorElement | null;
|
||||
const installInsidersBtn = document.getElementById('install-insiders-btn') as HTMLAnchorElement | null;
|
||||
|
||||
if (!modal || !title || !contentEl) return;
|
||||
|
||||
@@ -58,14 +59,23 @@ export async function openFileModal(filePath: string, type: string): Promise<voi
|
||||
contentEl.textContent = 'Loading...';
|
||||
modal.classList.remove('hidden');
|
||||
|
||||
// Setup install button
|
||||
const installUrl = getVSCodeInstallUrl(type, filePath);
|
||||
// Setup install buttons (VS Code and VS Code Insiders)
|
||||
const installUrl = getVSCodeInstallUrl(type, filePath, false);
|
||||
const installInsidersUrl = getVSCodeInstallUrl(type, filePath, true);
|
||||
|
||||
if (installUrl && installBtn) {
|
||||
installBtn.href = installUrl;
|
||||
installBtn.style.display = 'inline-flex';
|
||||
} else if (installBtn) {
|
||||
installBtn.style.display = 'none';
|
||||
}
|
||||
|
||||
if (installInsidersUrl && installInsidersBtn) {
|
||||
installInsidersBtn.href = installInsidersUrl;
|
||||
installInsidersBtn.style.display = 'inline-flex';
|
||||
} else if (installInsidersBtn) {
|
||||
installInsidersBtn.style.display = 'none';
|
||||
}
|
||||
|
||||
// Fetch and display content
|
||||
const fileContent = await fetchFileContent(filePath);
|
||||
|
||||
Reference in New Issue
Block a user