ui: fix files link & title (#773)

This commit is contained in:
panda authored and GitHub committed 2024-04-01 20:17:11 +08:00
1 parent b540412382
commit 64c858cdf7
2 files changed
+4 -1

No files matched your search

@@ -46,7 +46,8 @@ const dialogAction = (id) => [
];
function bindCopyLink(id, src: string) {
const url = !(window.location.href.endsWith('file') || window.location.href.endsWith('files')) || window.location.href.match('contest/.*/file')
const url = !(window.location.href.endsWith('file') || window.location.href.endsWith('files'))
|| window.location.href.match('homework/.*/file') || window.location.href.match('training/.*/file')
? `file://${src.substring(src.lastIndexOf('/') + 1)}` : src;
const clip = new Clipboard(`#copy-${id}`, { text: () => `${url}` });
clip.on('success', () => Notification.success(i18n(`${url.startsWith('file://') ? 'Reference' : 'Download'} link copied to clipboard!`)));