Remote copy button
This commit is contained in:
parent
0428e449b5
commit
b35a8cb9a2
|
@ -45,6 +45,7 @@ pin: "Pin to profile"
|
|||
unpin: "Unpin from profile"
|
||||
copyContent: "Copy contents"
|
||||
copyLink: "Copy link"
|
||||
copyLinkRemote: "Copy remote link"
|
||||
copyLinkRenote: "Copy renote link"
|
||||
delete: "Delete"
|
||||
deleteAndEdit: "Delete and edit"
|
||||
|
|
|
@ -117,6 +117,17 @@ export function getCopyNoteLinkMenu(note: misskey.entities.Note, text: string):
|
|||
};
|
||||
}
|
||||
|
||||
export function getCopyNoteLinkRemoteMenu(note: misskey.entities.Note, text: string): MenuItem {
|
||||
return note.url ? {
|
||||
icon: 'ti ti-link',
|
||||
text,
|
||||
action: (): void => {
|
||||
copyToClipboard(note.url);
|
||||
os.success();
|
||||
},
|
||||
} : undefined;
|
||||
}
|
||||
|
||||
export function getNoteMenu(props: {
|
||||
note: Misskey.entities.Note;
|
||||
menuButton: Ref<HTMLElement>;
|
||||
|
@ -272,6 +283,7 @@ export function getNoteMenu(props: {
|
|||
text: i18n.ts.copyContent,
|
||||
action: copyContent,
|
||||
}, getCopyNoteLinkMenu(appearNote, i18n.ts.copyLink)
|
||||
, getCopyNoteLinkRemoteMenu(appearNote, i18n.ts.copyLinkRemote)
|
||||
, (appearNote.url || appearNote.uri) ? {
|
||||
icon: 'ti ti-external-link',
|
||||
text: i18n.ts.showOnRemote,
|
||||
|
@ -376,6 +388,7 @@ export function getNoteMenu(props: {
|
|||
text: i18n.ts.copyContent,
|
||||
action: copyContent,
|
||||
}, getCopyNoteLinkMenu(appearNote, i18n.ts.copyLink)
|
||||
, getCopyNoteLinkRemoteMenu(appearNote, i18n.ts.copyLinkRemote)
|
||||
, (appearNote.url || appearNote.uri) ? {
|
||||
icon: 'ti ti-external-link',
|
||||
text: i18n.ts.showOnRemote,
|
||||
|
|
Loading…
Reference in New Issue