From ad4af9a9466d7322f95883d440ca8a7a976f44f9 Mon Sep 17 00:00:00 2001 From: Skystryder <sky@chakat.ca> Date: Sat, 28 Jan 2023 18:56:48 -0800 Subject: [PATCH] Show MFM Cheatsheet on note dialogue. --- packages/client/src/components/MkPostForm.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index 4c1388418..ace079b25 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -54,6 +54,7 @@ <button v-tooltip="i18n.ts.hashtags" class="_button" :class="{ active: withHashtags }" @click="withHashtags = !withHashtags"><i class="ph-hash-bold ph-lg"></i></button> <button v-tooltip="i18n.ts.emoji" class="_button" @click="insertEmoji"><i class="ph-smiley-bold ph-lg"></i></button> <button v-if="postFormActions.length > 0" v-tooltip="i18n.ts.plugin" class="_button" @click="showActions"><i class="ph-plug-bold ph-lg"></i></button> + <button v-tooltip="i18n.ts._mfm.cheatSheet" class="_button right" @click="openCheatSheet"><i class="ph-question-bold ph-lg"></i></button> </footer> <datalist id="hashtags"> <option v-for="hashtag in recentHashtags" :key="hashtag" :value="hashtag"/> @@ -90,6 +91,7 @@ import { instance } from '@/instance'; import { $i, getAccounts, openAccountMenu as openAccountMenu_ } from '@/account'; import { uploadFile } from '@/scripts/upload'; import { deepClone } from '@/scripts/clone'; +import MfmCheatSheet from '@/pages/mfm-cheat-sheet.vue'; const modal = inject('modal'); @@ -624,6 +626,10 @@ async function insertEmoji(ev: MouseEvent) { os.openEmojiPicker(ev.currentTarget ?? ev.target, {}, textareaEl); } +async function openCheatSheet(ev: MouseEvent) { + window.open(url + '/mfm-cheat-sheet', '_blank'); +} + function showActions(ev) { os.popupMenu(postFormActions.map(action => ({ text: action.title, @@ -711,6 +717,9 @@ onMounted(() => { </script> <style lang="scss" scoped> +.right { + float:right +} .gafaadew { position: relative;