forked from Mirrors/elk
feat: add 'copy original link to this post' menu item (#1318)
This commit is contained in:
parent
61f2237121
commit
c200abcc90
3 changed files with 15 additions and 0 deletions
|
@ -42,6 +42,12 @@ const copyLink = async (status: mastodon.v1.Status) => {
|
||||||
await clipboard.copy(url)
|
await clipboard.copy(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const copyOriginalLink = async (status: mastodon.v1.Status) => {
|
||||||
|
const url = status.url
|
||||||
|
if (url)
|
||||||
|
await clipboard.copy(url)
|
||||||
|
}
|
||||||
|
|
||||||
const { share, isSupported: isShareSupported } = useShare()
|
const { share, isSupported: isShareSupported } = useShare()
|
||||||
const shareLink = async (status: mastodon.v1.Status) => {
|
const shareLink = async (status: mastodon.v1.Status) => {
|
||||||
const url = getPermalinkUrl(status)
|
const url = getPermalinkUrl(status)
|
||||||
|
@ -169,6 +175,13 @@ const showFavoritedAndBoostedBy = () => {
|
||||||
@click="copyLink(status)"
|
@click="copyLink(status)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<CommonDropdownItem
|
||||||
|
:text="$t('menu.copy_original_link_to_post')"
|
||||||
|
icon="i-ri:links-fill"
|
||||||
|
:command="command"
|
||||||
|
@click="copyOriginalLink(status)"
|
||||||
|
/>
|
||||||
|
|
||||||
<CommonDropdownItem
|
<CommonDropdownItem
|
||||||
v-if="isShareSupported"
|
v-if="isShareSupported"
|
||||||
:text="$t('menu.share_post')"
|
:text="$t('menu.share_post')"
|
||||||
|
|
|
@ -117,6 +117,7 @@
|
||||||
"block_account": "Block {0}",
|
"block_account": "Block {0}",
|
||||||
"block_domain": "Block domain {0}",
|
"block_domain": "Block domain {0}",
|
||||||
"copy_link_to_post": "Copy link to this post",
|
"copy_link_to_post": "Copy link to this post",
|
||||||
|
"copy_original_link_to_post": "Copy original link to this post",
|
||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"delete_and_redraft": "Delete & re-draft",
|
"delete_and_redraft": "Delete & re-draft",
|
||||||
"direct_message_account": "Direct message {0}",
|
"direct_message_account": "Direct message {0}",
|
||||||
|
|
|
@ -172,6 +172,7 @@
|
||||||
"block_account": "Block {0}",
|
"block_account": "Block {0}",
|
||||||
"block_domain": "Block domain {0}",
|
"block_domain": "Block domain {0}",
|
||||||
"copy_link_to_post": "Copy link to this post",
|
"copy_link_to_post": "Copy link to this post",
|
||||||
|
"copy_original_link_to_post": "Copy original link to this post",
|
||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
"delete_and_redraft": "Delete & re-draft",
|
"delete_and_redraft": "Delete & re-draft",
|
||||||
"direct_message_account": "Direct message {0}",
|
"direct_message_account": "Direct message {0}",
|
||||||
|
|
Loading…
Reference in a new issue