feat: add schedule post button to publish widget

This commit is contained in:
TAKAHASHI Shuuji 2024-03-01 02:11:13 +09:00
parent 8ad05dfd47
commit 4ba756946c
No known key found for this signature in database
GPG key ID: F15C887632129F5E
2 changed files with 20 additions and 1 deletions

View file

@ -129,6 +129,8 @@ const expiresInOptions = computed(() => [
const expiresInDefaultOptionIndex = 2
const scheduleDateTime = ref('')
const characterCount = computed(() => {
const text = htmlToText(editor.value?.getHTML() || '')
@ -456,7 +458,23 @@ function stopQuestionMarkPropagation(e: KeyboardEvent) {
<PublishEditorTools v-if="editor" :editor="editor" />
<div flex-auto />
<CommonDropdown placement="bottom">
<CommonTooltip placement="top" :content="$t('tooltip.schedule_post')" no-auto-focus>
<button btn-action-icon :aria-label="$t('tooltip.schedule_post')">
<div i-ri:calendar-schedule-line />
</button>
</CommonTooltip>
<template #popper>
<input
v-model="scheduleDateTime"
p2
type="datetime-local"
name="schedule-datetime"
>
</template>
</CommonDropdown>
<div flex-auto />
<PublishCharacterCounter :max="characterLimit" :length="characterCount" />

View file

@ -736,6 +736,7 @@
"pick_an_icon": "Pick an icon",
"publish_failed": "Close failed messages at the top of editor to republish posts",
"remove_thread_item": "Remove item from thread",
"schedule_post": "Schedule post",
"start_thread": "Start thread",
"toggle_bold": "Toggle bold",
"toggle_code_block": "Toggle code block",