mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
ui: fix files link & title (#773)
This commit is contained in:
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!`)));
|
||||
|
||||
Reference in new issue
Block a user