mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
use cordis@4
This commit is contained in:
18 files changed
+284
-168
No files matched your search
@@ -46,8 +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('homework/.*/file') || window.location.href.match('training/.*/file')
|
||||
const url = !['file', 'files'].some((i) => window.location.href.endsWith(i))
|
||||
|| ['homework', 'training'].some((i) => window.location.href.match(`${i}/.*/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