1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-15 05:19:58 +00:00

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 expiresInDefaultOptionIndex = 2
const scheduleDateTime = ref('')
const characterCount = computed(() => { const characterCount = computed(() => {
const text = htmlToText(editor.value?.getHTML() || '') const text = htmlToText(editor.value?.getHTML() || '')
@ -456,6 +458,22 @@ function stopQuestionMarkPropagation(e: KeyboardEvent) {
<PublishEditorTools v-if="editor" :editor="editor" /> <PublishEditorTools v-if="editor" :editor="editor" />
<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 /> <div flex-auto />
<PublishCharacterCounter :max="characterLimit" :length="characterCount" /> <PublishCharacterCounter :max="characterLimit" :length="characterCount" />

View file

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