Merge pull request 'Show MFM Cheatsheet on note dialogue.' (#9528) from Skystryder/chakey:feature/formattingtips into develop

Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9528
This commit is contained in:
Kainoa Kanter 2023-01-30 04:51:15 +00:00
commit 80f48f4dd5
1 changed files with 9 additions and 0 deletions

View File

@ -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;