From e796d24292a70d110c40f2734e269ebff8585f00 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 19 Sep 2020 17:13:48 +0900 Subject: [PATCH] wip --- src/client/components/autocomplete.vue | 2 +- src/client/components/reaction-picker.vue | 5 ++++- src/client/default.vue | 5 ++++- src/client/pages/messaging/messaging-room.form.vue | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/client/components/autocomplete.vue b/src/client/components/autocomplete.vue index 5d6e363902..fb1eee5e4c 100644 --- a/src/client/components/autocomplete.vue +++ b/src/client/components/autocomplete.vue @@ -35,6 +35,7 @@ import { twemojiSvgBase } from '../../misc/twemoji-base'; import { getStaticImageUrl } from '@/scripts/get-static-image-url'; import MkUserSelect from './user-select.vue'; import { acct } from '../filters/user'; +import * as os from '@/os'; type EmojiDef = { emoji: string; @@ -74,7 +75,6 @@ for (const x of lib) { } emjdb.sort((a, b) => a.name.length - b.name.length); -import * as os from '@/os'; export default defineComponent({ props: { diff --git a/src/client/components/reaction-picker.vue b/src/client/components/reaction-picker.vue index 96549fd67a..587196f7bc 100644 --- a/src/client/components/reaction-picker.vue +++ b/src/client/components/reaction-picker.vue @@ -3,7 +3,7 @@
- + @@ -12,6 +12,7 @@ import { defineComponent } from 'vue'; import { emojiRegex } from '../../misc/emoji-regex'; import XReactionIcon from './reaction-icon.vue'; import * as os from '@/os'; +import { Autocomplete } from '@/scripts/autocomplete'; export default defineComponent({ components: { @@ -69,6 +70,8 @@ export default defineComponent({ mounted() { this.focus = 0; + + new Autocomplete(this.$refs.text, this, { model: 'text' }); }, methods: { diff --git a/src/client/default.vue b/src/client/default.vue index 9e2ed34876..269b52f5de 100644 --- a/src/client/default.vue +++ b/src/client/default.vue @@ -16,7 +16,7 @@ @@ -95,6 +95,7 @@ import { search } from '@/scripts/search'; import { StickySidebar } from '@/scripts/sticky-sidebar'; import { widgets } from './widgets'; import XSidebar from '@/components/sidebar.vue'; +import { Autocomplete } from '@/scripts/autocomplete'; import * as os from './os'; const DESKTOP_THRESHOLD = 1100; @@ -240,6 +241,8 @@ export default defineComponent({ // widget follow this.attachSticky(); + new Autocomplete(this.$refs.search, this, { model: 'searchQuery' }); + this.$nextTick(() => { this.calcHeaderWidth(); }); diff --git a/src/client/pages/messaging/messaging-room.form.vue b/src/client/pages/messaging/messaging-room.form.vue index 21a73cd40f..fd4119a727 100644 --- a/src/client/pages/messaging/messaging-room.form.vue +++ b/src/client/pages/messaging/messaging-room.form.vue @@ -9,7 +9,6 @@ @keypress="onKeypress" @paste="onPaste" :placeholder="$t('inputMessageHere')" - v-autocomplete="{ model: 'text' }" >
{{ file.name }}
@@ -30,6 +29,7 @@ import * as autosize from 'autosize'; import { formatTimeString } from '../../../misc/format-time-string'; import { selectFile } from '@/scripts/select-file'; import * as os from '@/os'; +import { Autocomplete } from '@/scripts/autocomplete'; export default defineComponent({ components: { @@ -79,6 +79,8 @@ export default defineComponent({ mounted() { autosize(this.$refs.text); + new Autocomplete(this.$refs.text, this, { model: 'text' }); + // 書きかけの投稿を復元 const draft = JSON.parse(localStorage.getItem('message_drafts') || '{}')[this.draftKey]; if (draft) {