引用を書き換えられないように/InsertMentionを追加(誤削除)

This commit is contained in:
GrapeApple0 2024-08-15 12:03:49 +00:00
parent 884b0ae9c3
commit 59bad17cb1
1 changed files with 7 additions and 3 deletions

View File

@ -27,7 +27,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</header> </header>
<MkNoteSimple v-if="reply" :class="$style.targetNote" :note="reply"/> <MkNoteSimple v-if="reply" :class="$style.targetNote" :note="reply"/>
<MkNoteSimple v-if="renote" :class="$style.targetNote" :note="renote"/> <MkNoteSimple v-if="renote" :class="$style.targetNote" :note="renote"/>
<div v-if="quoteId" :class="$style.withQuote"><i class="ti ti-quote"></i> {{ i18n.ts.quoteAttached }}<button @click="quoteId = null"><i class="ti ti-x"></i></button></div> <div v-if="quoteId" :class="$style.withQuote"><i class="ti ti-quote"></i>{{ i18n.ts.quoteAttached }}</div>
<input v-show="useCw" ref="cwInputEl" v-model="cw" :class="$style.cw" :placeholder="i18n.ts.annotation" @keydown="onKeydown"> <input v-show="useCw" ref="cwInputEl" v-model="cw" :class="$style.cw" :placeholder="i18n.ts.annotation" @keydown="onKeydown">
<div :class="[$style.textOuter, { [$style.withCw]: useCw }]"> <div :class="[$style.textOuter, { [$style.withCw]: useCw }]">
<div v-if="channel" :class="$style.colorBar" :style="{ background: channel.color }"></div> <div v-if="channel" :class="$style.colorBar" :style="{ background: channel.color }"></div>
@ -368,8 +368,6 @@ async function onPaste(ev: ClipboardEvent) {
insertTextAtCursor(textareaEl.value, paste); insertTextAtCursor(textareaEl.value, paste);
return; return;
} }
quoteId.value = paste.substring(url.length).match(/^\/notes\/(.+?)\/?$/)?.[1] ?? null;
}); });
} }
@ -608,6 +606,12 @@ function cancel() {
emit('cancel'); emit('cancel');
} }
function insertMention() {
os.selectUser({ localOnly: localOnly.value, includeSelf: true }).then(user => {
insertTextAtCursor(textareaEl.value, '@' + Misskey.acct.toString(user) + ' ');
});
}
async function insertEmoji(ev: MouseEvent) { async function insertEmoji(ev: MouseEvent) {
textAreaReadOnly.value = true; textAreaReadOnly.value = true;
const target = ev.currentTarget ?? ev.target; const target = ev.currentTarget ?? ev.target;