forked from AkkomaGang/akkoma-fe
Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
251e440dad | |||
ffac376b5a | |||
721e3b016d | |||
469063ff52 | |||
d8643b5b4a | |||
04c744e764 | |||
bda433b006 |
9 changed files with 27 additions and 13 deletions
|
@ -148,6 +148,7 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
copyInstanceOption('showWiderShortcuts')
|
copyInstanceOption('showWiderShortcuts')
|
||||||
copyInstanceOption('showNavShortcuts')
|
copyInstanceOption('showNavShortcuts')
|
||||||
copyInstanceOption('showPanelNavShortcuts')
|
copyInstanceOption('showPanelNavShortcuts')
|
||||||
|
copyInstanceOption('stopGifs')
|
||||||
copyInstanceOption('logo')
|
copyInstanceOption('logo')
|
||||||
|
|
||||||
store.dispatch('setInstanceOption', {
|
store.dispatch('setInstanceOption', {
|
||||||
|
|
|
@ -178,7 +178,7 @@ const EmojiInput = {
|
||||||
textAtCaret: async function (newWord) {
|
textAtCaret: async function (newWord) {
|
||||||
const firstchar = newWord.charAt(0)
|
const firstchar = newWord.charAt(0)
|
||||||
this.suggestions = []
|
this.suggestions = []
|
||||||
if (newWord === firstchar) return
|
if (newWord === firstchar && firstchar !== '$') return
|
||||||
const matchedSuggestions = await this.suggest(newWord)
|
const matchedSuggestions = await this.suggest(newWord)
|
||||||
// Async: cancel if textAtCaret has changed during wait
|
// Async: cancel if textAtCaret has changed during wait
|
||||||
if (this.textAtCaret !== newWord) return
|
if (this.textAtCaret !== newWord) return
|
||||||
|
@ -277,7 +277,6 @@ const EmojiInput = {
|
||||||
},
|
},
|
||||||
replaceText (e, suggestion) {
|
replaceText (e, suggestion) {
|
||||||
const len = this.suggestions.length || 0
|
const len = this.suggestions.length || 0
|
||||||
if (this.textAtCaret.length === 1) { return }
|
|
||||||
if (len > 0 || suggestion) {
|
if (len > 0 || suggestion) {
|
||||||
const chosenSuggestion = suggestion || this.suggestions[this.highlighted]
|
const chosenSuggestion = suggestion || this.suggestions[this.highlighted]
|
||||||
const replacement = chosenSuggestion.replacement
|
const replacement = chosenSuggestion.replacement
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
:class="{ highlighted: index === highlighted }"
|
:class="{ highlighted: index === highlighted }"
|
||||||
@click.stop.prevent="onClick($event, suggestion)"
|
@click.stop.prevent="onClick($event, suggestion)"
|
||||||
>
|
>
|
||||||
<span class="image">
|
<span v-if="!suggestion.mfm" class="image">
|
||||||
<img
|
<img
|
||||||
v-if="suggestion.img"
|
v-if="suggestion.img"
|
||||||
:src="suggestion.img"
|
:src="suggestion.img"
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
const MFM_TAGS = ['blur', 'bounce', 'flip', 'font', 'jelly', 'jump', 'rainbow', 'rotate', 'shake', 'sparkle', 'spin', 'tada', 'twitch', 'x2', 'x3', 'x4']
|
||||||
|
.map(tag => ({ displayText: tag, detailText: '$[' + tag + ' ]', replacement: '$[' + tag + ' ]', mfm: true }))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* suggest - generates a suggestor function to be used by emoji-input
|
* suggest - generates a suggestor function to be used by emoji-input
|
||||||
* data: object providing source information for specific types of suggestions:
|
* data: object providing source information for specific types of suggestions:
|
||||||
|
@ -21,6 +24,10 @@ export default data => {
|
||||||
if (firstChar === '@' && usersCurry) {
|
if (firstChar === '@' && usersCurry) {
|
||||||
return usersCurry(input)
|
return usersCurry(input)
|
||||||
}
|
}
|
||||||
|
if (firstChar === '$') {
|
||||||
|
return MFM_TAGS
|
||||||
|
.filter(({ replacement }) => replacement.toLowerCase().indexOf(input) !== -1)
|
||||||
|
}
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { filter, trim } from 'lodash'
|
import { filter, trim, debounce } from 'lodash'
|
||||||
import BooleanSetting from '../helpers/boolean_setting.vue'
|
import BooleanSetting from '../helpers/boolean_setting.vue'
|
||||||
import ChoiceSetting from '../helpers/choice_setting.vue'
|
import ChoiceSetting from '../helpers/choice_setting.vue'
|
||||||
import IntegerSetting from '../helpers/integer_setting.vue'
|
import IntegerSetting from '../helpers/integer_setting.vue'
|
||||||
|
@ -27,13 +27,13 @@ const FilteringTab = {
|
||||||
get () {
|
get () {
|
||||||
return this.muteWordsStringLocal
|
return this.muteWordsStringLocal
|
||||||
},
|
},
|
||||||
set (value) {
|
set: debounce(function (value) {
|
||||||
this.muteWordsStringLocal = value
|
this.muteWordsStringLocal = value
|
||||||
this.$store.dispatch('setOption', {
|
this.$store.dispatch('setOption', {
|
||||||
name: 'muteWords',
|
name: 'muteWords',
|
||||||
value: filter(value.split('\n'), (word) => trim(word).length > 0)
|
value: filter(value.split('\n'), (word) => trim(word).length > 0)
|
||||||
})
|
})
|
||||||
}
|
}, 500)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Updating nested properties
|
// Updating nested properties
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
class="StatusBody"
|
class="StatusBody"
|
||||||
:class="{ '-compact': compact }"
|
:class="{ '-compact': compact, 'mfm-disabled': !renderMisskeyMarkdown }"
|
||||||
>
|
>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -82,9 +82,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&.mfm-disabled {
|
&.mfm-disabled {
|
||||||
|
span {
|
||||||
|
font-size: 100% !important;
|
||||||
|
}
|
||||||
.mfm {
|
.mfm {
|
||||||
animation: none !important;
|
animation: none !important;
|
||||||
}
|
}
|
||||||
|
.emoji {
|
||||||
|
width: 32px !important;
|
||||||
|
height: 32px !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ export const defaultState = {
|
||||||
alwaysShowNewPostButton: false,
|
alwaysShowNewPostButton: false,
|
||||||
autohideFloatingPostButton: false,
|
autohideFloatingPostButton: false,
|
||||||
pauseOnUnfocused: true,
|
pauseOnUnfocused: true,
|
||||||
stopGifs: true,
|
stopGifs: undefined,
|
||||||
replyVisibility: 'all',
|
replyVisibility: 'all',
|
||||||
thirdColumnMode: 'notifications',
|
thirdColumnMode: 'notifications',
|
||||||
notificationVisibility: {
|
notificationVisibility: {
|
||||||
|
|
Loading…
Reference in a new issue