GitHub like repo home page (#32213)

Move some components (description, license, release, language stats) to sidebar

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
yp05327 2024-12-06 23:29:04 +09:00 committed by GitHub
parent 3c4a06273f
commit faf5705d29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 1248 additions and 1046 deletions

View file

@ -41,35 +41,28 @@ export async function initCitationFileCopyContent() {
citationCopyApa.classList.toggle('primary', !isBibtex);
};
document.querySelector('#cite-repo-button')?.addEventListener('click', async (e: MouseEvent & {target: HTMLAnchorElement}) => {
const dropdownBtn = e.target.closest('.ui.dropdown.button');
dropdownBtn.classList.add('is-loading');
document.querySelector('#cite-repo-button')?.addEventListener('click', async () => {
try {
try {
await initInputCitationValue(citationCopyApa, citationCopyBibtex);
} catch (e) {
console.error(`initCitationFileCopyContent error: ${e}`, e);
return;
}
updateUi();
citationCopyApa.addEventListener('click', () => {
localStorage.setItem('citation-copy-format', 'apa');
updateUi();
});
citationCopyBibtex.addEventListener('click', () => {
localStorage.setItem('citation-copy-format', 'bibtex');
updateUi();
});
inputContent.addEventListener('click', () => {
inputContent.select();
});
} finally {
dropdownBtn.classList.remove('is-loading');
await initInputCitationValue(citationCopyApa, citationCopyBibtex);
} catch (e) {
console.error(`initCitationFileCopyContent error: ${e}`, e);
return;
}
updateUi();
citationCopyApa.addEventListener('click', () => {
localStorage.setItem('citation-copy-format', 'apa');
updateUi();
});
citationCopyBibtex.addEventListener('click', () => {
localStorage.setItem('citation-copy-format', 'bibtex');
updateUi();
});
inputContent.addEventListener('click', () => {
inputContent.select();
});
fomanticQuery('#cite-repo-modal').modal('show');
});