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;
/**
* {x}稿
*/
"scheduleToPostOnX": ParameterizedString<"x">;
/**
*
*/
"schedule": string;
"_compression": {
"_quality": {
/**

View File

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

View File

@ -43,7 +43,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template v-if="posted"></template>
<template v-else-if="posting"><MkEllipsis/></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>
</button>
</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>
</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>
<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">
@ -263,13 +264,19 @@ const placeholder = computed((): string => {
});
const submitText = computed((): string => {
return renoteTargetNote.value
return scheduledAt.value != null
? i18n.ts.schedule
: renoteTargetNote.value
? i18n.ts.quote
: 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 => {
return (text.value + imeText.value).length;
});
@ -1232,10 +1239,12 @@ function showDraftMenu(ev: MouseEvent) {
}
async function schedule() {
const { canceled, result } = await os.inputDate({
const { canceled, result } = await os.inputDatetime({
title: i18n.ts.schedulePost,
});
if (canceled) return;
scheduledAt.value = result.getTime();
}
onMounted(() => {
@ -1538,6 +1547,10 @@ html[data-color-scheme=light] .preview {
margin: 0 20px 16px 20px;
}
.scheduledAt {
margin: 0 20px 16px 20px;
}
.cw,
.hashtags,
.text {

View File

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