フッター保持機能の実装

This commit is contained in:
sliver 2024-03-31 23:28:41 +09:00
parent a2fd146023
commit 6261d06cb2
3 changed files with 27 additions and 2 deletions

View file

@ -220,7 +220,8 @@ const PostStatusForm = {
idempotencyKey: '',
activeEmojiInput: undefined,
activeTextInput: undefined,
subjectVisible: showSubject
subjectVisible: showSubject,
hashtagText: ''
}
},
computed: {
@ -386,7 +387,7 @@ const PostStatusForm = {
}
const postingOptions = {
status: newStatus.status,
status: newStatus.status + ' ' + (this.hashtagText || ''),
spoilerText: newStatus.spoilerText || null,
visibility: newStatus.visibility,
sensitive: newStatus.nsfw,
@ -695,6 +696,10 @@ const PostStatusForm = {
this.activeEmojiInput = 'subject-emoji-input'
this.activeTextInput = 'subject-input'
},
focusHashtagInput() {
this.activeEmojiInput = 'hashtag-emoji-input'
this.activeTextInput = 'hashtag-input'
},
toggleSubjectVisible() {
// If hiding CW, then we need to clear the subject and reset focus
if (this.subjectVisible)

View file

@ -187,6 +187,25 @@
{{ charactersLeft }}
</p>
</EmojiInput>
<EmojiInput
ref="hashtag-emoji-input"
v-model="hashtagText"
enable-emoji-picker
hide-emoji-button
:suggest="emojiSuggestor"
class="form-control"
>
<input
ref="hashtag-input"
v-model="hashtagText"
type="text"
:placeholder="$t('post_status.footer_text')"
:disabled="posting && !optimisticPosting"
size="1"
class="form-post-subject"
@focus="focusHashtagInput()"
>
</EmojiInput>
<div
v-if="!disableScopeSelector"
class="visibility-tray"

View file

@ -379,6 +379,7 @@
"text/x.misskeymarkdown": "MFM"
},
"content_warning": "CW (省略可)",
"footer_text": "フッター (省略可)",
"default": "いま、なにをしていますか?",
"direct_warning_to_all": "この投稿は、メンションされたすべてのユーザーが見ることができます。",
"direct_warning_to_first_only": "この投稿は、メッセージの冒頭でメンションされたユーザーだけが見ることができます。",