From ea2080b6241f961dfd51b43e95b874c174e48c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sun, 21 Jan 2024 17:39:47 +0900 Subject: [PATCH] =?UTF-8?q?feat(tools):=20=E3=82=AB=E3=82=B9=E3=82=BF?= =?UTF-8?q?=E3=83=A0=E7=B5=B5=E6=96=87=E5=AD=97=E3=83=97=E3=83=AC=E3=83=93?= =?UTF-8?q?=E3=83=A5=E3=83=BC=20(#111)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * wip * 完成 * fix --- assets/data/toolsNav.ts | 16 +- components/mk/CustomEmoji.vue | 6 +- components/mk/Mfm.ts | 12 +- .../{avatar-decoration => mocks}/MkNote.vue | 24 ++- .../{avatar-decoration => mocks}/MkProf.vue | 10 +- locales/ja-JP.yml | 16 ++ pages/tools/avatar-decoration-preview.vue | 4 +- pages/tools/custom-emoji-preview.vue | 162 ++++++++++++++++++ 8 files changed, 234 insertions(+), 16 deletions(-) rename components/tools/{avatar-decoration => mocks}/MkNote.vue (73%) rename components/tools/{avatar-decoration => mocks}/MkProf.vue (92%) create mode 100644 pages/tools/custom-emoji-preview.vue diff --git a/assets/data/toolsNav.ts b/assets/data/toolsNav.ts index ae47aef4..1601d657 100644 --- a/assets/data/toolsNav.ts +++ b/assets/data/toolsNav.ts @@ -15,9 +15,9 @@ export default [ to: "/tools/avatar-decoration-preview/", }, { - i18n: "_aidConverter.title", - description: "_aidConverter.description", - to: "/tools/aid-converter/", + i18n: "_customEmojiPreview.title", + description: "_customEmojiPreview.description", + to: "/tools/custom-emoji-preview/", }, { i18n: "_shareLinkGenerator.title", @@ -26,4 +26,14 @@ export default [ }, ], }, + { + title: "_tools._forAdmin.title", + items: [ + { + i18n: "_aidConverter.title", + description: "_aidConverter.description", + to: "/tools/aid-converter/", + }, + ], + } ]; \ No newline at end of file diff --git a/components/mk/CustomEmoji.vue b/components/mk/CustomEmoji.vue index 585aa15a..aaf5fd54 100644 --- a/components/mk/CustomEmoji.vue +++ b/components/mk/CustomEmoji.vue @@ -38,6 +38,10 @@ const rawUrl = computed(() => { const url = computed(() => { if (rawUrl.value == null) return null; + if (props.url) { + return rawUrl.value; + } + const proxied = (rawUrl.value.startsWith('/emoji/') || (props.useOriginalSize && isLocal.value)) ? parseURL(rawUrl.value).host ? rawUrl.value : 'https://misskey.io' + rawUrl.value @@ -51,7 +55,7 @@ const url = computed(() => { }); const alt = computed(() => `:${customEmojiName.value}:`); -const errored = ref(props.host == null); +const errored = ref(props.host == null && !props.url);