diff --git a/locales/index.d.ts b/locales/index.d.ts index 3b56563149..0c6e73aac4 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -2810,6 +2810,10 @@ export interface Locale extends ILocale { * コピー */ "copy": string; + /** + * クリップボードにコピーされました + */ + "copiedToClipboard": string; /** * メトリクス */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index ad96549160..d6af72ab57 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -698,6 +698,7 @@ userSaysSomethingAbout: "{name}が「{word}」について何かを言いまし makeActive: "アクティブにする" display: "表示" copy: "コピー" +copiedToClipboard: "クリップボードにコピーされました" metrics: "メトリクス" overview: "概要" logs: "ログ" diff --git a/packages/frontend/src/components/MkCode.vue b/packages/frontend/src/components/MkCode.vue index 9708b78a30..d2d9f320ee 100644 --- a/packages/frontend/src/components/MkCode.vue +++ b/packages/frontend/src/components/MkCode.vue @@ -48,7 +48,6 @@ const XCode = defineAsyncComponent(() => import('@/components/MkCode.core.vue')) function copy() { copyToClipboard(props.code); - os.success(); } </script> diff --git a/packages/frontend/src/components/MkEmbedCodeGenDialog.vue b/packages/frontend/src/components/MkEmbedCodeGenDialog.vue index a53c9c7904..e038b84ba7 100644 --- a/packages/frontend/src/components/MkEmbedCodeGenDialog.vue +++ b/packages/frontend/src/components/MkEmbedCodeGenDialog.vue @@ -194,7 +194,6 @@ function generate() { function doCopy() { copyToClipboard(result.value); - os.success(); } //#endregion diff --git a/packages/frontend/src/components/MkInviteCode.vue b/packages/frontend/src/components/MkInviteCode.vue index 0f53d1573d..ab797459cc 100644 --- a/packages/frontend/src/components/MkInviteCode.vue +++ b/packages/frontend/src/components/MkInviteCode.vue @@ -90,7 +90,6 @@ function deleteCode() { function copyInviteCode() { copyToClipboard(props.invite.code); - os.success(); } </script> diff --git a/packages/frontend/src/components/MkKeyValue.vue b/packages/frontend/src/components/MkKeyValue.vue index 275b153e4a..b4185d2d0a 100644 --- a/packages/frontend/src/components/MkKeyValue.vue +++ b/packages/frontend/src/components/MkKeyValue.vue @@ -31,7 +31,6 @@ const props = withDefaults(defineProps<{ const copy_ = () => { copyToClipboard(props.copy); - os.success(); }; </script> diff --git a/packages/frontend/src/components/global/MkCustomEmoji.vue b/packages/frontend/src/components/global/MkCustomEmoji.vue index 65d6e9a3f6..af8f1d035e 100644 --- a/packages/frontend/src/components/global/MkCustomEmoji.vue +++ b/packages/frontend/src/components/global/MkCustomEmoji.vue @@ -100,7 +100,6 @@ function onClick(ev: MouseEvent) { icon: 'ti ti-copy', action: () => { copyToClipboard(`:${props.name}:`); - os.success(); }, }); diff --git a/packages/frontend/src/components/global/MkEmoji.vue b/packages/frontend/src/components/global/MkEmoji.vue index 37df945233..ca67a28b70 100644 --- a/packages/frontend/src/components/global/MkEmoji.vue +++ b/packages/frontend/src/components/global/MkEmoji.vue @@ -50,7 +50,6 @@ function onClick(ev: MouseEvent) { icon: 'ti ti-copy', action: () => { copyToClipboard(props.emoji); - os.success(); }, }); diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index a009a3f3d1..8e4c97e59f 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -63,7 +63,6 @@ export const apiWithDialog = (<E extends keyof Misskey.Endpoints, P extends Miss }); if (result === 'copy') { copyToClipboard(`Endpoint: ${endpoint}\nInfo: ${JSON.stringify(err.info)}\nDate: ${date}`); - success(); } return; } else if (err.code === 'RATE_LIMIT_EXCEEDED') { diff --git a/packages/frontend/src/pages/channel.vue b/packages/frontend/src/pages/channel.vue index c5951f0e13..1245561169 100644 --- a/packages/frontend/src/pages/channel.vue +++ b/packages/frontend/src/pages/channel.vue @@ -210,7 +210,6 @@ const headerActions = computed(() => { return; } copyToClipboard(`${url}/channels/${channel.value.id}`); - os.success(); }, }); diff --git a/packages/frontend/src/pages/clip.vue b/packages/frontend/src/pages/clip.vue index 590a506a55..772ed6bd11 100644 --- a/packages/frontend/src/pages/clip.vue +++ b/packages/frontend/src/pages/clip.vue @@ -148,7 +148,6 @@ const headerActions = computed(() => clip.value && isOwned.value ? [{ text: i18n.ts.copyUrl, action: () => { copyToClipboard(`${url}/clips/${clip.value!.id}`); - os.success(); }, }, { icon: 'ti ti-code', diff --git a/packages/frontend/src/pages/drop-and-fusion.game.vue b/packages/frontend/src/pages/drop-and-fusion.game.vue index 364006e9ad..e30e381ce1 100644 --- a/packages/frontend/src/pages/drop-and-fusion.game.vue +++ b/packages/frontend/src/pages/drop-and-fusion.game.vue @@ -849,7 +849,6 @@ function exportLog() { l: DropAndFusionGame.serializeLogs(logs), }); copyToClipboard(data); - os.success(); } function updateSettings< diff --git a/packages/frontend/src/pages/emojis.emoji.vue b/packages/frontend/src/pages/emojis.emoji.vue index bedb0b64f9..d5570eb20a 100644 --- a/packages/frontend/src/pages/emojis.emoji.vue +++ b/packages/frontend/src/pages/emojis.emoji.vue @@ -25,7 +25,7 @@ import MkCustomEmojiDetailedDialog from '@/components/MkCustomEmojiDetailedDialo import { $i } from '@/i.js'; const props = defineProps<{ - emoji: Misskey.entities.EmojiSimple; + emoji: Misskey.entities.EmojiSimple; }>(); function menu(ev) { @@ -38,7 +38,6 @@ function menu(ev) { icon: 'ti ti-copy', action: () => { copyToClipboard(`:${props.emoji.name}:`); - os.success(); }, }, { text: i18n.ts.info, diff --git a/packages/frontend/src/pages/flash/flash.vue b/packages/frontend/src/pages/flash/flash.vue index 08ac913958..96e43b0205 100644 --- a/packages/frontend/src/pages/flash/flash.vue +++ b/packages/frontend/src/pages/flash/flash.vue @@ -129,7 +129,6 @@ function copyLink() { if (!flash.value) return; copyToClipboard(`${url}/play/${flash.value.id}`); - os.success(); } function shareWithNavigator() { diff --git a/packages/frontend/src/pages/gallery/post.vue b/packages/frontend/src/pages/gallery/post.vue index eb01aadbcc..6a9737e30f 100644 --- a/packages/frontend/src/pages/gallery/post.vue +++ b/packages/frontend/src/pages/gallery/post.vue @@ -111,7 +111,6 @@ function fetchPost() { function copyLink() { copyToClipboard(`${url}/gallery/${post.value.id}`); - os.success(); } function share() { diff --git a/packages/frontend/src/pages/page.vue b/packages/frontend/src/pages/page.vue index 00c664d2a0..523d443359 100644 --- a/packages/frontend/src/pages/page.vue +++ b/packages/frontend/src/pages/page.vue @@ -190,7 +190,6 @@ function copyLink() { if (!page.value) return; copyToClipboard(`${url}/@${page.value.user.username}/pages/${page.value.name}`); - os.success(); } function shareWithNote() { diff --git a/packages/frontend/src/pages/settings/theme.manage.vue b/packages/frontend/src/pages/settings/theme.manage.vue index e2b48ea232..c68c04bb44 100644 --- a/packages/frontend/src/pages/settings/theme.manage.vue +++ b/packages/frontend/src/pages/settings/theme.manage.vue @@ -33,12 +33,12 @@ SPDX-License-Identifier: AGPL-3.0-only <script lang="ts" setup> import { computed, ref } from 'vue'; import JSON5 from 'json5'; +import type { Theme } from '@/theme.js'; import MkTextarea from '@/components/MkTextarea.vue'; import MkSelect from '@/components/MkSelect.vue'; import MkInput from '@/components/MkInput.vue'; import MkButton from '@/components/MkButton.vue'; import { getBuiltinThemesRef } from '@/theme.js'; -import type { Theme } from '@/theme.js'; import { copyToClipboard } from '@/utility/copy-to-clipboard.js'; import * as os from '@/os.js'; import { getThemes, removeTheme } from '@/theme-store.js'; @@ -63,7 +63,6 @@ const selectedThemeCode = computed(() => { function copyThemeCode() { copyToClipboard(selectedThemeCode.value); - os.success(); } function uninstall() { diff --git a/packages/frontend/src/utility/copy-to-clipboard.ts b/packages/frontend/src/utility/copy-to-clipboard.ts index 7e0bb25606..08a759588e 100644 --- a/packages/frontend/src/utility/copy-to-clipboard.ts +++ b/packages/frontend/src/utility/copy-to-clipboard.ts @@ -3,9 +3,15 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +import * as os from '@/os.js'; +import { i18n } from '@/i18n.js'; + /** * Clipboardに値をコピー(TODO: 文字列以外も対応) */ export function copyToClipboard(input: string | null) { - if (input) navigator.clipboard.writeText(input); + if (input) { + navigator.clipboard.writeText(input); + os.toast(i18n.ts.copiedToClipboard); + } }; diff --git a/packages/frontend/src/utility/get-drive-file-menu.ts b/packages/frontend/src/utility/get-drive-file-menu.ts index 0212a051ce..3c6cbba002 100644 --- a/packages/frontend/src/utility/get-drive-file-menu.ts +++ b/packages/frontend/src/utility/get-drive-file-menu.ts @@ -65,7 +65,6 @@ function toggleSensitive(file: Misskey.entities.DriveFile) { function copyUrl(file: Misskey.entities.DriveFile) { copyToClipboard(file.url); - os.success(); } /* diff --git a/packages/frontend/src/utility/get-embed-code.ts b/packages/frontend/src/utility/get-embed-code.ts index 9021520da8..d458e64f19 100644 --- a/packages/frontend/src/utility/get-embed-code.ts +++ b/packages/frontend/src/utility/get-embed-code.ts @@ -4,11 +4,11 @@ */ import { defineAsyncComponent } from 'vue'; import { v4 as uuid } from 'uuid'; -import type { EmbedParams, EmbeddableEntity } from '@@/js/embed-page.js'; import { url } from '@@/js/config.js'; +import { defaultEmbedParams, embedRouteWithScrollbar } from '@@/js/embed-page.js'; +import type { EmbedParams, EmbeddableEntity } from '@@/js/embed-page.js'; import * as os from '@/os.js'; import { copyToClipboard } from '@/utility/copy-to-clipboard.js'; -import { defaultEmbedParams, embedRouteWithScrollbar } from '@@/js/embed-page.js'; const MOBILE_THRESHOLD = 500; @@ -74,7 +74,6 @@ export function genEmbedCode(entity: EmbeddableEntity, id: string, params?: Embe // PCじゃない場合はコードカスタマイズ画面を出さずにそのままコピー if (window.innerWidth < MOBILE_THRESHOLD) { copyToClipboard(getEmbedCode(`/embed/${entity}/${id}`, _params)); - os.success(); } else { const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkEmbedCodeGenDialog.vue')), { entity, diff --git a/packages/frontend/src/utility/get-note-menu.ts b/packages/frontend/src/utility/get-note-menu.ts index dea9bc39ad..9e1ae7e9ac 100644 --- a/packages/frontend/src/utility/get-note-menu.ts +++ b/packages/frontend/src/utility/get-note-menu.ts @@ -157,7 +157,6 @@ export function getCopyNoteLinkMenu(note: Misskey.entities.Note, text: string): text, action: (): void => { copyToClipboard(`${url}/notes/${note.id}`); - os.success(); }, }; } @@ -237,7 +236,6 @@ export function getNoteMenu(props: { function copyContent(): void { copyToClipboard(appearNote.text); - os.success(); } function togglePin(pin: boolean): void { @@ -324,7 +322,6 @@ export function getNoteMenu(props: { text: i18n.ts.copyRemoteLink, action: () => { copyToClipboard(appearNote.url ?? appearNote.uri); - os.success(); }, }, { icon: 'ti ti-external-link', @@ -483,7 +480,6 @@ export function getNoteMenu(props: { text: i18n.ts.copyRemoteLink, action: () => { copyToClipboard(appearNote.url ?? appearNote.uri); - os.success(); }, }, { icon: 'ti ti-external-link', @@ -516,7 +512,6 @@ export function getNoteMenu(props: { text: i18n.ts.copyNoteId, action: () => { copyToClipboard(appearNote.id); - os.success(); }, }); }