This commit is contained in:
NoriDev 2023-12-05 19:12:27 +09:00
parent 16ec2754ab
commit d9ec54a397
4 changed files with 18 additions and 18 deletions

View file

@ -74,7 +74,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkInfo v-if="hasNotSpecifiedMentions && showForm" warn :class="$style.hasNotSpecifiedMentions">{{ i18n.ts.notSpecifiedMentionWarning }} - <button class="_textButton" @click="addMissingMention()">{{ i18n.ts.add }}</button></MkInfo> <MkInfo v-if="hasNotSpecifiedMentions && showForm" warn :class="$style.hasNotSpecifiedMentions">{{ i18n.ts.notSpecifiedMentionWarning }} - <button class="_textButton" @click="addMissingMention()">{{ i18n.ts.add }}</button></MkInfo>
<input v-show="useCw && showForm" ref="cwInputEl" v-model="cw" :class="$style.cw" :placeholder="i18n.ts.annotation" @keydown="onKeydown"> <input v-show="useCw && showForm" ref="cwInputEl" v-model="cw" :class="$style.cw" :placeholder="i18n.ts.annotation" @keydown="onKeydown">
<div :class="[$style.textOuter, { [$style.withCw]: useCw, [$style.showForm]: !showForm }]"> <div :class="[$style.textOuter, { [$style.withCw]: useCw, [$style.showForm]: !showForm }]">
<textarea ref="textareaEl" v-model="text" :class="[$style.text]" :disabled="posting || posted" :readonly="textAreaReadOnly" :placeholder="placeholder" data-cy-post-form-text @keydown="onKeydown" @paste="onPaste" @compositionupdate="onCompositionUpdate" @compositionend="onCompositionEnd"/> <textarea ref="textareaEl" v-model="text" :class="[$style.text]" :disabled="posting || posted" :readonly="textAreaReadOnly" :placeholder="placeholder" data-cy-post-form-text @keydown="onKeydown" @paste="onPaste" @compositionupdate="onCompositionUpdate" @compositionend="onCompositionEnd"/>
<div v-if="maxTextLength - textLength < 100" :class="['_acrylic', $style.textCount, { [$style.textOver]: textLength > maxTextLength }]">{{ maxTextLength - textLength }}</div> <div v-if="maxTextLength - textLength < 100" :class="['_acrylic', $style.textCount, { [$style.textOver]: textLength > maxTextLength }]">{{ maxTextLength - textLength }}</div>
<button v-if="!showForm" v-click-anime class="_button" :class="$style.submit" style="position: absolute; bottom: 0; right: 12px;" :disabled="!canPost && $i" data-cy-open-post-form-submit @click="$i ? post : signin()"> <button v-if="!showForm" v-click-anime class="_button" :class="$style.submit" style="position: absolute; bottom: 0; right: 12px;" :disabled="!canPost && $i" data-cy-open-post-form-submit @click="$i ? post : signin()">
<div :class="$style.submitInner"> <div :class="$style.submitInner">
@ -416,7 +416,7 @@ function checkMissingMention() {
} }
} }
} }
hasNotSpecifiedMentions = false; hasNotSpecifiedMentions = false;
} }
function addMissingMention() { function addMissingMention() {
@ -934,18 +934,18 @@ function insertMention() {
} }
async function insertEmoji(ev: MouseEvent) { async function insertEmoji(ev: MouseEvent) {
textAreaReadOnly.value = true; textAreaReadOnly.value = true;
emojiPicker.show( emojiPicker.show(
ev.currentTarget ?? ev.target, ev.currentTarget ?? ev.target,
emoji => { emoji => {
insertTextAtCursor(textareaEl, emoji); insertTextAtCursor(textareaEl, emoji);
}, },
() => { () => {
textAreaReadOnly.value = false; textAreaReadOnly.value = false;
focus(); focus();
}, },
); );
} }
function showActions(ev) { function showActions(ev) {

View file

@ -283,7 +283,7 @@ function invite() {
os.api('admin/invite/create').then(x => { os.api('admin/invite/create').then(x => {
os.alert({ os.alert({
type: 'info', type: 'info',
text: x?.[0].code, text: x[0].code,
}); });
}).catch(err => { }).catch(err => {
os.alert({ os.alert({

View file

@ -97,10 +97,10 @@ async function createWithOptions() {
os.alert({ os.alert({
type: 'success', type: 'success',
title: i18n.ts.inviteCodeCreated, title: i18n.ts.inviteCodeCreated,
text: tickets?.map(x => x.code).join('\n'), text: tickets.map(x => x.code).join('\n'),
}); });
tickets?.forEach(ticket => pagingComponent.value?.prepend(ticket)); tickets.forEach(ticket => pagingComponent.value?.prepend(ticket));
} }
function deleted(id: string) { function deleted(id: string) {

View file

@ -128,13 +128,13 @@ async function fetch() {
endpoint: 'messaging/messages', endpoint: 'messaging/messages',
limit: 20, limit: 20,
params: { params: {
groupId: group?.id, groupId: group.id,
}, },
reversed: true, reversed: true,
pageEl: $$(rootEl).value, pageEl: $$(rootEl).value,
}; };
connection = useStream().useChannel('messaging', { connection = useStream().useChannel('messaging', {
group: group?.id, group: group.id,
}); });
} }