mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-26 06:10:20 +01:00
CWと本文を入れ替えるボタン
This commit is contained in:
parent
dac3b1f405
commit
61f1740b19
1 changed files with 31 additions and 1 deletions
|
@ -65,7 +65,19 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</div>
|
||||
</div>
|
||||
<MkInfo v-if="hasNotSpecifiedMentions" warn :class="$style.hasNotSpecifiedMentions">{{ i18n.ts.notSpecifiedMentionWarning }} - <button class="_textButton" @click="addMissingMention()">{{ i18n.ts.add }}</button></MkInfo>
|
||||
<input v-show="useCw" ref="cwInputEl" v-model="cw" :class="$style.cw" :placeholder="i18n.ts.annotation" @keydown="onKeydown" @keyup="onKeyup" @compositionend="onCompositionEnd">
|
||||
<div v-show="useCw" style="display: flex">
|
||||
<input
|
||||
ref="cwInputEl"
|
||||
v-model="cw"
|
||||
:class="$style.cw"
|
||||
:placeholder="i18n.ts.annotation"
|
||||
@keydown="onKeydown"
|
||||
@compositionend="onCompositionEnd"
|
||||
/>
|
||||
<button class="_button" :class="$style.cwSwapButton" @click="swapCwText">
|
||||
<i class="ti ti-switch-vertical"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div :class="[$style.textOuter, { [$style.withCw]: useCw }]">
|
||||
<div v-if="channel" :class="$style.colorBar" :style="{ background: channel.color }"></div>
|
||||
<textarea ref="textareaEl" v-model="text" :class="[$style.text]" :disabled="posting || posted" :readonly="textAreaReadOnly" :placeholder="placeholder" data-cy-post-form-text @keydown="onKeydown" @keyup="onKeyup" @paste="onPaste" @compositionupdate="onCompositionUpdate" @compositionend="onCompositionEnd"/>
|
||||
|
@ -386,6 +398,15 @@ function addMissingMention() {
|
|||
}
|
||||
}
|
||||
|
||||
function swapCwText() {
|
||||
if (useCw.value) {
|
||||
// textの一行目を取り出す
|
||||
const temp = text.value.split(/\r?\n/).join(" ");
|
||||
text.value = cw.value ?? "";
|
||||
cw.value = temp;
|
||||
}
|
||||
}
|
||||
|
||||
function togglePoll() {
|
||||
if (poll.value) {
|
||||
poll.value = null;
|
||||
|
@ -1192,6 +1213,15 @@ defineExpose({
|
|||
}
|
||||
//#endregion
|
||||
|
||||
.cwSwapButton {
|
||||
margin-left: 8px;
|
||||
padding: 8px;
|
||||
border-radius: 6px;
|
||||
&:hover {
|
||||
background: var(--X4);
|
||||
}
|
||||
}
|
||||
|
||||
.preview {
|
||||
padding: 16px 20px 0 20px;
|
||||
min-height: 75px;
|
||||
|
|
Loading…
Reference in a new issue