Merge branch 'chat-refactor' into shigusegubu-themes3
This commit is contained in:
commit
9f15f4fa42
13 changed files with 51 additions and 11 deletions
|
|
@ -186,7 +186,7 @@ export default {
|
||||||
return useShoutStore().joined
|
return useShoutStore().joined
|
||||||
},
|
},
|
||||||
isChats() {
|
isChats() {
|
||||||
return this.$route.name === 'chat' || this.$route.name === 'chats'
|
return this.$route.name === 'chat' || this.$route.name === 'chats' || this.$route.name === 'conversation2'
|
||||||
},
|
},
|
||||||
isListEdit() {
|
isListEdit() {
|
||||||
return this.$route.name === 'lists-edit'
|
return this.$route.name === 'lists-edit'
|
||||||
|
|
@ -205,7 +205,7 @@ export default {
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
hideShoutbox() {
|
hideShoutbox() {
|
||||||
return useMergedConfigStore().mergedConfig.hideShoutbox
|
return this.isChats || useMergedConfigStore().mergedConfig.hideShoutbox
|
||||||
},
|
},
|
||||||
reverseLayout() {
|
reverseLayout() {
|
||||||
const { thirdColumnMode, sidebarRight: reverseSetting } =
|
const { thirdColumnMode, sidebarRight: reverseSetting } =
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ const ChatListItem = {
|
||||||
name: 'chat',
|
name: 'chat',
|
||||||
params: {
|
params: {
|
||||||
username: this.currentUser.screen_name,
|
username: this.currentUser.screen_name,
|
||||||
recipient_id: this.chat.account.id,
|
chatUserId: this.chat.account.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.attachments {
|
.attachments {
|
||||||
min-width: 30em;
|
min-width: 10em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.quoted-post {
|
.quoted-post {
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@
|
||||||
fixed-pinned
|
fixed-pinned
|
||||||
use-default-buttons
|
use-default-buttons
|
||||||
hide-labels
|
hide-labels
|
||||||
|
in-chat-view
|
||||||
@toggle-replying="$emit('replyRequested', message)"
|
@toggle-replying="$emit('replyRequested', message)"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
.chat-view {
|
.chat-view {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin-bottom: -1em;
|
|
||||||
margin-top: -1em;
|
|
||||||
|
|
||||||
.chat-list-wrapper {
|
.chat-list-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -103,11 +103,11 @@
|
||||||
:disable-preview="!isConversation"
|
:disable-preview="!isConversation"
|
||||||
:disable-draft="!isConversation"
|
:disable-draft="!isConversation"
|
||||||
|
|
||||||
:disable-submit="isConversation ? false : (errorLoadingChat || !chat)"
|
:disable-submit="isConversation ? !!replyStatus : (errorLoadingChat || !chat)"
|
||||||
:optimistic-posting="!isConversation"
|
:optimistic-posting="!isConversation"
|
||||||
|
|
||||||
:submit-on-enter="!mobileLayout"
|
chat-view
|
||||||
:preserve-focus="!mobileLayout"
|
preserve-focus
|
||||||
:auto-focus="!mobileLayout"
|
:auto-focus="!mobileLayout"
|
||||||
:placeholder="formPlaceholder"
|
:placeholder="formPlaceholder"
|
||||||
:file-limit="isConversation ? null : 1"
|
:file-limit="isConversation ? null : 1"
|
||||||
|
|
|
||||||
|
|
@ -98,13 +98,13 @@ const PostStatusForm = {
|
||||||
draftId: String, // ID of the draft to be used
|
draftId: String, // ID of the draft to be used
|
||||||
|
|
||||||
// Chats stuff
|
// Chats stuff
|
||||||
|
chatView: Boolean, // Used for the "submit on enter" user setting
|
||||||
maxHeight: Number,
|
maxHeight: Number,
|
||||||
placeholder: String,
|
placeholder: String,
|
||||||
postHandler: Function, // Used to override poster to use chats one instead of status one
|
postHandler: Function, // Used to override poster to use chats one instead of status one
|
||||||
preserveFocus: Boolean, // Keep focus on form after posting
|
preserveFocus: Boolean, // Keep focus on form after posting
|
||||||
autoFocus: Boolean, // Steal focus when form is opened
|
autoFocus: Boolean, // Steal focus when form is opened
|
||||||
fileLimit: Number, // Chats only support 1 attachment :(
|
fileLimit: Number, // Chats only support 1 attachment :(
|
||||||
submitOnEnter: Boolean,
|
|
||||||
emojiPickerPlacement: String,
|
emojiPickerPlacement: String,
|
||||||
optimisticPosting: Boolean, // Don't wait for confirmation that post is done
|
optimisticPosting: Boolean, // Don't wait for confirmation that post is done
|
||||||
|
|
||||||
|
|
@ -562,6 +562,9 @@ const PostStatusForm = {
|
||||||
useMergedConfigStore().mergedConfig.hideScopeNotice
|
useMergedConfigStore().mergedConfig.hideScopeNotice
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
submitOnEnter() {
|
||||||
|
return this.chatView && this.mergedConfig.chatSubmitOnEnter
|
||||||
|
},
|
||||||
|
|
||||||
// Global stuff
|
// Global stuff
|
||||||
currentUser() {
|
currentUser() {
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,13 @@
|
||||||
{{ $t('settings.subject_line_behavior') }}
|
{{ $t('settings.subject_line_behavior') }}
|
||||||
</ChoiceSetting>
|
</ChoiceSetting>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<BooleanSetting
|
||||||
|
path="chatSubmitOnEnter"
|
||||||
|
>
|
||||||
|
{{ $t('settings.submit_on_enter_in_chats') }}
|
||||||
|
</BooleanSetting>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3 v-if="expertLevel > 0">
|
<h3 v-if="expertLevel > 0">
|
||||||
{{ $t('settings.attachments') }}
|
{{ $t('settings.attachments') }}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import {
|
||||||
faChevronDown,
|
faChevronDown,
|
||||||
faChevronRight,
|
faChevronRight,
|
||||||
faComments,
|
faComments,
|
||||||
|
faList,
|
||||||
faExternalLinkAlt,
|
faExternalLinkAlt,
|
||||||
faEye,
|
faEye,
|
||||||
faEyeSlash,
|
faEyeSlash,
|
||||||
|
|
@ -58,6 +59,7 @@ library.add(
|
||||||
faPencil,
|
faPencil,
|
||||||
faShareAlt,
|
faShareAlt,
|
||||||
faComments,
|
faComments,
|
||||||
|
faList,
|
||||||
faExternalLinkAlt,
|
faExternalLinkAlt,
|
||||||
faHistory,
|
faHistory,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -222,13 +222,30 @@ export const BUTTONS = [
|
||||||
// =========
|
// =========
|
||||||
// OPEN IN CHAT VIEW
|
// OPEN IN CHAT VIEW
|
||||||
// =========
|
// =========
|
||||||
name: 'edit',
|
name: 'chat_view',
|
||||||
icon: 'comments',
|
icon: 'comments',
|
||||||
label: 'status.open_in_chat_view',
|
label: 'status.open_in_chat_view',
|
||||||
|
if({ chatView }) {
|
||||||
|
return !chatView
|
||||||
|
},
|
||||||
action({ router, status }) {
|
action({ router, status }) {
|
||||||
router.push({ name: 'conversation2', params: { statusId: status.id } })
|
router.push({ name: 'conversation2', params: { statusId: status.id } })
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// =========
|
||||||
|
// OPEN IN THREAD VIEW
|
||||||
|
// =========
|
||||||
|
name: 'thread_view',
|
||||||
|
icon: 'list',
|
||||||
|
label: 'status.open_in_thread_view',
|
||||||
|
if({ chatView }) {
|
||||||
|
return chatView
|
||||||
|
},
|
||||||
|
action({ router, status }) {
|
||||||
|
router.push({ name: 'conversation', params: { id: status.id } })
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// =========
|
// =========
|
||||||
// DELETE
|
// DELETE
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,10 @@ const StatusActionButtons = {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
inChatView: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
emits: ['toggleReplying', 'onSuccess', 'onError'],
|
emits: ['toggleReplying', 'onSuccess', 'onError'],
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -98,6 +102,7 @@ const StatusActionButtons = {
|
||||||
router: this.$router,
|
router: this.$router,
|
||||||
currentUser: this.currentUser,
|
currentUser: this.currentUser,
|
||||||
loggedIn: !!this.currentUser,
|
loggedIn: !!this.currentUser,
|
||||||
|
chatView: !!this.inChatView,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
triggerAttrs() {
|
triggerAttrs() {
|
||||||
|
|
|
||||||
|
|
@ -780,6 +780,7 @@
|
||||||
"subject_line_email": "Like email: \"re: subject\"",
|
"subject_line_email": "Like email: \"re: subject\"",
|
||||||
"subject_line_mastodon": "Like mastodon: copy as is",
|
"subject_line_mastodon": "Like mastodon: copy as is",
|
||||||
"subject_line_noop": "Do not copy",
|
"subject_line_noop": "Do not copy",
|
||||||
|
"submit_on_enter_in_chats": "Send message on Enter in chats",
|
||||||
"force_theme_recompilation_debug": "Disable theme cahe, force recompile on each boot",
|
"force_theme_recompilation_debug": "Disable theme cahe, force recompile on each boot",
|
||||||
"conversation_display": "Conversation display style",
|
"conversation_display": "Conversation display style",
|
||||||
"conversation_display_tree": "Tree-style",
|
"conversation_display_tree": "Tree-style",
|
||||||
|
|
@ -1648,6 +1649,7 @@
|
||||||
"edit": "Edit status",
|
"edit": "Edit status",
|
||||||
"edited_at": "(last edited {time})",
|
"edited_at": "(last edited {time})",
|
||||||
"open_in_chat_view": "Open in chat view",
|
"open_in_chat_view": "Open in chat view",
|
||||||
|
"open_in_thread_view": "Open in thread view",
|
||||||
"pin": "Pin on profile",
|
"pin": "Pin on profile",
|
||||||
"unpin": "Unpin from profile",
|
"unpin": "Unpin from profile",
|
||||||
"pinned": "Pinned",
|
"pinned": "Pinned",
|
||||||
|
|
|
||||||
|
|
@ -673,6 +673,11 @@ export const LOCAL_DEFAULT_CONFIG_DEFINITIONS = {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
chatSubmitOnEnter: {
|
||||||
|
description: 'Post status on enter key in chats and chat view',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
themeDebug: {
|
themeDebug: {
|
||||||
description:
|
description:
|
||||||
'Debug mode that uses computed backgrounds instead of real ones to debug contrast functions',
|
'Debug mode that uses computed backgrounds instead of real ones to debug contrast functions',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue