diff --git a/locales/index.d.ts b/locales/index.d.ts index 2c56932e52..077a0e271e 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -4993,7 +4993,7 @@ export interface Locale extends ILocale { */ "copyEmbedCode": string; /** - * このユーザーのノート + * このユーザーのノート一覧 */ "noteOfThisUser": string; "_delivery": { diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 9e8fd95cae..07f8ac4bac 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1244,7 +1244,7 @@ alwaysConfirmFollow: "フォローの際常に確認する" inquiry: "お問い合わせ" fromX: "{x}から" copyEmbedCode: "埋め込みコードをコピー" -noteOfThisUser: "このユーザーのノート" +noteOfThisUser: "このユーザーのノート一覧" _delivery: status: "配信状態" diff --git a/packages/frontend/src/pages/clip.vue b/packages/frontend/src/pages/clip.vue index fd64a55c65..0f30a3be77 100644 --- a/packages/frontend/src/pages/clip.vue +++ b/packages/frontend/src/pages/clip.vue @@ -44,6 +44,7 @@ import MkButton from '@/components/MkButton.vue'; import { clipsCache } from '@/cache.js'; import { isSupportShare } from '@/scripts/navigator.js'; import copyToClipboard from '@/scripts/copy-to-clipboard.js'; +import { copyEmbedCode } from '@/scripts/get-embed-code.js'; const props = defineProps<{ clipId: string, @@ -127,21 +128,33 @@ const headerActions = computed(() => clip.value && isOwned.value ? [{ clipsCache.delete(); }, }, ...(clip.value.isPublic ? [{ - icon: 'ti ti-link', - text: i18n.ts.copyUrl, - handler: async (): Promise => { - copyToClipboard(`${url}/clips/${clip.value.id}`); - os.success(); - }, -}] : []), ...(clip.value.isPublic && isSupportShare() ? [{ icon: 'ti ti-share', text: i18n.ts.share, - handler: async (): Promise => { - navigator.share({ - title: clip.value.name, - text: clip.value.description, - url: `${url}/clips/${clip.value.id}`, - }); + handler: (ev: MouseEvent): void => { + os.popupMenu([{ + icon: 'ti ti-link', + text: i18n.ts.copyUrl, + action: () => { + copyToClipboard(`${url}/clips/${clip.value!.id}`); + os.success(); + }, + }, { + icon: 'ti ti-code', + text: i18n.ts.copyEmbedCode, + action: () => { + copyEmbedCode('clips', clip.value!.id); + }, + }, ...(isSupportShare() ? [{ + icon: 'ti ti-share', + text: i18n.ts.share, + action: async () => { + navigator.share({ + title: clip.value!.name, + text: clip.value!.description ?? '', + url: `${url}/clips/${clip.value!.id}`, + }); + }, + }] : [])], ev.currentTarget ?? ev.target); }, }] : []), { icon: 'ti ti-trash', diff --git a/packages/frontend/src/pages/tag.vue b/packages/frontend/src/pages/tag.vue index 9b77392872..56bb6deae8 100644 --- a/packages/frontend/src/pages/tag.vue +++ b/packages/frontend/src/pages/tag.vue @@ -28,6 +28,7 @@ import { i18n } from '@/i18n.js'; import { $i } from '@/account.js'; import { defaultStore } from '@/store.js'; import * as os from '@/os.js'; +import { copyEmbedCode } from '@/scripts/get-embed-code.js'; const props = defineProps<{ tag: string; @@ -51,7 +52,19 @@ async function post() { notes.value?.pagingComponent?.reload(); } -const headerActions = computed(() => []); +const headerActions = computed(() => [{ + icon: 'ti ti-dots', + label: i18n.ts.more, + handler: (ev: MouseEvent) => { + os.popupMenu([{ + text: i18n.ts.copyEmbedCode, + icon: 'ti ti-code', + action: () => { + copyEmbedCode('tags', props.tag); + }, + }], ev.currentTarget ?? ev.target); + } +}]); const headerTabs = computed(() => []); diff --git a/packages/frontend/src/scripts/get-embed-code.ts b/packages/frontend/src/scripts/get-embed-code.ts index 5e54b3be6d..33e0601e12 100644 --- a/packages/frontend/src/scripts/get-embed-code.ts +++ b/packages/frontend/src/scripts/get-embed-code.ts @@ -13,16 +13,16 @@ import MkEmbedCodeGenDialog from '@/components/MkEmbedCodeGenDialog.vue'; const embeddableEntities = [ 'notes', 'user-timeline', - 'clip', - 'tag', + 'clips', + 'tags', ] as const; export type EmbeddableEntity = typeof embeddableEntities[number]; // 内部でスクロールがあるページ export const embedRouteWithScrollbar: EmbeddableEntity[] = [ - 'clip', - 'tag', + 'clips', + 'tags', 'user-timeline' ]; diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 342b7b809d..6e7de69cfc 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -316,19 +316,18 @@ export function getNoteMenu(props: { action: () => { window.open(appearNote.url ?? appearNote.uri, '_blank', 'noopener'); }, - } : undefined, - ...(isSupportShare() ? [{ - icon: 'ti ti-share', - text: i18n.ts.share, - action: share, - }] : []), - (!appearNote.url && !appearNote.uri) ? { + } : { icon: 'ti ti-code', text: i18n.ts.copyEmbedCode, action: () => { copyEmbedCode('notes', appearNote.id); }, - } : undefined, + }, + ...(isSupportShare() ? [{ + icon: 'ti ti-share', + text: i18n.ts.share, + action: share, + }] : []), $i && $i.policies.canUseTranslator && instance.translatorAvailable ? { icon: 'ti ti-language-hiragana', text: i18n.ts.translate, @@ -456,14 +455,20 @@ export function getNoteMenu(props: { icon: 'ti ti-copy', text: i18n.ts.copyContent, action: copyContent, - }, getCopyNoteLinkMenu(appearNote, i18n.ts.copyLink) - , (appearNote.url || appearNote.uri) ? { + }, getCopyNoteLinkMenu(appearNote, i18n.ts.copyLink), + (appearNote.url || appearNote.uri) ? { icon: 'ti ti-external-link', text: i18n.ts.showOnRemote, action: () => { window.open(appearNote.url ?? appearNote.uri, '_blank', 'noopener'); }, - } : undefined] + } : { + icon: 'ti ti-code', + text: i18n.ts.copyEmbedCode, + action: () => { + copyEmbedCode('notes', appearNote.id); + }, + }] .filter(x => x !== undefined); }