This commit is contained in:
syuilo 2025-09-24 14:10:29 +09:00
parent 8b1f889d1d
commit d9d90a04e2
4 changed files with 32 additions and 9 deletions

8
locales/index.d.ts vendored
View File

@ -5557,6 +5557,14 @@ export interface Locale extends ILocale {
* 稿 * 稿
*/ */
"schedulePost": string; "schedulePost": string;
/**
* {x}稿
*/
"scheduleToPostOnX": ParameterizedString<"x">;
/**
*
*/
"schedule": string;
"_compression": { "_compression": {
"_quality": { "_quality": {
/** /**

View File

@ -1384,6 +1384,8 @@ themeIsDefaultBecauseSafeMode: "セーフモードが有効な間はデフォル
thankYouForTestingBeta: "ベータ版の検証にご協力いただきありがとうございます!" thankYouForTestingBeta: "ベータ版の検証にご協力いただきありがとうございます!"
createUserSpecifiedNote: "ユーザー指定ノートを作成" createUserSpecifiedNote: "ユーザー指定ノートを作成"
schedulePost: "投稿を予約" schedulePost: "投稿を予約"
scheduleToPostOnX: "{x}に投稿を予約します"
schedule: "予約"
_compression: _compression:
_quality: _quality:

View File

@ -43,7 +43,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template v-if="posted"></template> <template v-if="posted"></template>
<template v-else-if="posting"><MkEllipsis/></template> <template v-else-if="posting"><MkEllipsis/></template>
<template v-else>{{ submitText }}</template> <template v-else>{{ submitText }}</template>
<i style="margin-left: 6px;" :class="posted ? 'ti ti-check' : replyTargetNote ? 'ti ti-arrow-back-up' : renoteTargetNote ? 'ti ti-quote' : 'ti ti-send'"></i> <i style="margin-left: 6px;" :class="submitIcon"></i>
</div> </div>
</button> </button>
</div> </div>
@ -61,6 +61,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<button class="_buttonPrimary" style="padding: 4px; border-radius: 8px;" @click="addVisibleUser"><i class="ti ti-plus ti-fw"></i></button> <button class="_buttonPrimary" style="padding: 4px; border-radius: 8px;" @click="addVisibleUser"><i class="ti ti-plus ti-fw"></i></button>
</div> </div>
</div> </div>
<MkInfo v-if="scheduledAt != null" :class="$style.scheduledAt">{{ i18n.tsx.scheduleToPostOnX({ x: new Date(scheduledAt).toLocaleString() }) }} - <button class="_textButton" @click="cancelSchedule()">{{ i18n.ts.cancel }}</button></MkInfo>
<MkInfo v-if="hasNotSpecifiedMentions" warn :class="$style.hasNotSpecifiedMentions">{{ i18n.ts.notSpecifiedMentionWarning }} - <button class="_textButton" @click="addMissingMention()">{{ i18n.ts.add }}</button></MkInfo> <MkInfo v-if="hasNotSpecifiedMentions" warn :class="$style.hasNotSpecifiedMentions">{{ i18n.ts.notSpecifiedMentionWarning }} - <button class="_textButton" @click="addMissingMention()">{{ i18n.ts.add }}</button></MkInfo>
<div v-show="useCw" :class="$style.cwOuter"> <div v-show="useCw" :class="$style.cwOuter">
<input ref="cwInputEl" v-model="cw" :class="$style.cw" :placeholder="i18n.ts.annotation" @keydown="onKeydown" @keyup="onKeyup" @compositionend="onCompositionEnd"> <input ref="cwInputEl" v-model="cw" :class="$style.cw" :placeholder="i18n.ts.annotation" @keydown="onKeydown" @keyup="onKeyup" @compositionend="onCompositionEnd">
@ -263,11 +264,17 @@ const placeholder = computed((): string => {
}); });
const submitText = computed((): string => { const submitText = computed((): string => {
return renoteTargetNote.value return scheduledAt.value != null
? i18n.ts.quote ? i18n.ts.schedule
: replyTargetNote.value : renoteTargetNote.value
? i18n.ts.reply ? i18n.ts.quote
: i18n.ts.note; : replyTargetNote.value
? i18n.ts.reply
: i18n.ts.note;
});
const submitIcon = computed((): string => {
return posted.value ? 'ti ti-check' : scheduledAt.value != null ? 'ti ti-calendar-time' : replyTargetNote.value ? 'ti ti-arrow-back-up' : renoteTargetNote.value ? 'ti ti-quote' : 'ti ti-send';
}); });
const textLength = computed((): number => { const textLength = computed((): number => {
@ -1232,10 +1239,12 @@ function showDraftMenu(ev: MouseEvent) {
} }
async function schedule() { async function schedule() {
const { canceled, result } = await os.inputDate({ const { canceled, result } = await os.inputDatetime({
title: i18n.ts.schedulePost, title: i18n.ts.schedulePost,
}); });
if (canceled) return; if (canceled) return;
scheduledAt.value = result.getTime();
} }
onMounted(() => { onMounted(() => {
@ -1538,6 +1547,10 @@ html[data-color-scheme=light] .preview {
margin: 0 20px 16px 20px; margin: 0 20px 16px 20px;
} }
.scheduledAt {
margin: 0 20px 16px 20px;
}
.cw, .cw,
.hashtags, .hashtags,
.text { .text {

View File

@ -460,7 +460,7 @@ export function inputNumber(props: {
}); });
} }
export function inputDate(props: { export function inputDatetime(props: {
title?: string; title?: string;
text?: string; text?: string;
placeholder?: string | null; placeholder?: string | null;
@ -475,7 +475,7 @@ export function inputDate(props: {
title: props.title, title: props.title,
text: props.text, text: props.text,
input: { input: {
type: 'date', type: 'datetime-local',
placeholder: props.placeholder, placeholder: props.placeholder,
default: props.default ?? null, default: props.default ?? null,
}, },