From c80e106fb5b54bf27f8c80b3025b7c5d2fc82768 Mon Sep 17 00:00:00 2001 From: Freeplay Date: Sat, 3 Jun 2023 17:12:08 -0400 Subject: [PATCH] Advanced MFM toggle --- locales/en-US.yml | 2 + .../src/components/MkSubNoteContent.vue | 9 +- .../global/MkMisskeyFlavoredMarkdown.vue | 506 +++++++++--------- .../client/src/pages/settings/general.vue | 20 +- packages/client/src/store.ts | 4 + 5 files changed, 290 insertions(+), 251 deletions(-) diff --git a/locales/en-US.yml b/locales/en-US.yml index 127b2d0fe..716936754 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1211,6 +1211,8 @@ _mfm: intro: "MFM is a markup language used on Misskey, Calckey, Akkoma, and more that\ \ can be used in many places. Here you can view a list of all available MFM syntax." dummy: "Calckey expands the world of the Fediverse" + advanced: "Advanced MFM" + advancedDescription: "If disabled, only allows for basic markup unless animated MFM is playing" mention: "Mention" mentionDescription: "You can specify a user by using an At-Symbol and a username." hashtag: "Hashtag" diff --git a/packages/client/src/components/MkSubNoteContent.vue b/packages/client/src/components/MkSubNoteContent.vue index 5c965972a..5dc443c49 100644 --- a/packages/client/src/components/MkSubNoteContent.vue +++ b/packages/client/src/components/MkSubNoteContent.vue @@ -42,7 +42,8 @@ isLong, manyImages: note.files.length > 4, showContent: note.cw && !showContent, - disableAnim: disableMfm, + animatedMfm: !disableMfm, + advancedMfm, }" > 0); -let disableMfm = $ref(hasMfm && defaultStore.state.animatedMfm); +let disableMfm = $ref(defaultStore.state.animatedMfm); + +const advancedMfm = defaultStore.state.advancedMfm; async function toggleMfm() { if (disableMfm) { @@ -385,7 +388,7 @@ function focusFooter(ev) { } } - &.disableAnim :deep(span) { + &:not(.animatedMfm) :deep(span) { animation: none !important; } } diff --git a/packages/client/src/components/global/MkMisskeyFlavoredMarkdown.vue b/packages/client/src/components/global/MkMisskeyFlavoredMarkdown.vue index 4a5c2ec0f..81dbeb89d 100644 --- a/packages/client/src/components/global/MkMisskeyFlavoredMarkdown.vue +++ b/packages/client/src/components/global/MkMisskeyFlavoredMarkdown.vue @@ -6,7 +6,7 @@ :author="author" :customEmojis="customEmojis" :isNote="isNote" - class="havbbuyv" + class="mfm-object" :class="{ nowrap }" /> @@ -34,284 +34,306 @@ const props = withDefaults(