diff options
| author | Mar0xy <marie@kaifa.ch> | 2023-10-02 00:55:29 +0200 |
|---|---|---|
| committer | Mar0xy <marie@kaifa.ch> | 2023-10-02 00:55:29 +0200 |
| commit | 0c248a955c2c8744d0a4fc74238bc64a2a48d337 (patch) | |
| tree | 8ebb13cc6205a3363b51f6a52b3c0629e77bfac8 /packages | |
| parent | fix: notes and replies not showing replies (diff) | |
| download | sharkey-0c248a955c2c8744d0a4fc74238bc64a2a48d337.tar.gz sharkey-0c248a955c2c8744d0a4fc74238bc64a2a48d337.tar.bz2 sharkey-0c248a955c2c8744d0a4fc74238bc64a2a48d337.zip | |
add: copy link to origin note/remote note
Closes transfem-org/Sharkey#40
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/frontend/src/scripts/get-note-menu.ts | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 4889efe104..6b33719db8 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -117,6 +117,17 @@ export function getCopyNoteLinkMenu(note: misskey.entities.Note, text: string): }; } +export function getCopyNoteOriginLinkMenu(note: misskey.entities.Note, text: string): MenuItem { + return { + icon: 'ph-link ph-bold ph-lg', + text, + action: (): void => { + copyToClipboard(note.url ?? note.uri); + os.success(); + }, + }; +} + export function getNoteMenu(props: { note: Misskey.entities.Note; menuButton: Ref<HTMLElement>; @@ -281,7 +292,10 @@ export function getNoteMenu(props: { text: i18n.ts.copyContent, action: copyContent, }, getCopyNoteLinkMenu(appearNote, i18n.ts.copyLink) - , (appearNote.url || appearNote.uri) ? { + , (appearNote.url || appearNote.uri) ? + getCopyNoteOriginLinkMenu(appearNote, 'Copy link (Origin)') + : undefined, + (appearNote.url || appearNote.uri) ? { icon: 'ph-arrow-square-out ph-bold ph-lg', text: i18n.ts.showOnRemote, action: () => { @@ -391,7 +405,10 @@ export function getNoteMenu(props: { text: i18n.ts.copyContent, action: copyContent, }, getCopyNoteLinkMenu(appearNote, i18n.ts.copyLink) - , (appearNote.url || appearNote.uri) ? { + , (appearNote.url || appearNote.uri) ? + getCopyNoteOriginLinkMenu(appearNote, 'Copy link (Origin)') + : undefined, + (appearNote.url || appearNote.uri) ? { icon: 'ph-arrow-square-out ph-bold ph-lg', text: i18n.ts.showOnRemote, action: () => { |