aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorIlja <ilja@ilja.space>2022-07-18 12:33:03 +0200
committerIlja <ilja@ilja.space>2022-07-18 12:42:40 +0200
commit18d69f93d38dc15a74db81ee4c10b4766bebfc35 (patch)
tree56763764de2ef984f498d3507c6ebead3099c57d /src/components
parente594252668256197d9b68f1db1f7108c5255d275 (diff)
parent9ddb43296f3fbb6621e646a20e86e05b6c730ad2 (diff)
Merge branch 'develop' of https://git.pleroma.social/pleroma/pleroma-fe into feat/report-notification
Diffstat (limited to 'src/components')
-rw-r--r--src/components/about/about.vue2
-rw-r--r--src/components/account_actions/account_actions.js2
-rw-r--r--src/components/account_actions/account_actions.vue4
-rw-r--r--src/components/async_component_error/async_component_error.vue1
-rw-r--r--src/components/attachment/attachment.scss2
-rw-r--r--src/components/auth_form/auth_form.js5
-rw-r--r--src/components/basic_user_card/basic_user_card.vue2
-rw-r--r--src/components/bookmark_timeline/bookmark_timeline.js2
-rw-r--r--src/components/chat/chat.js99
-rw-r--r--src/components/chat/chat.scss88
-rw-r--r--src/components/chat/chat.vue125
-rw-r--r--src/components/chat/chat_layout_utils.js27
-rw-r--r--src/components/chat_list/chat_list.vue2
-rw-r--r--src/components/chat_list_item/chat_list_item.scss4
-rw-r--r--src/components/chat_message/chat_message.js1
-rw-r--r--src/components/chat_new/chat_new.scss8
-rw-r--r--src/components/chat_new/chat_new.vue7
-rw-r--r--src/components/chat_title/chat_title.js9
-rw-r--r--src/components/chat_title/chat_title.vue22
-rw-r--r--src/components/checkbox/checkbox.vue13
-rw-r--r--src/components/color_input/color_input.vue23
-rw-r--r--src/components/conversation/conversation.vue58
-rw-r--r--src/components/desktop_nav/desktop_nav.scss16
-rw-r--r--src/components/desktop_nav/desktop_nav.vue2
-rw-r--r--src/components/dialog_modal/dialog_modal.vue9
-rw-r--r--src/components/emoji_input/emoji_input.js31
-rw-r--r--src/components/emoji_input/emoji_input.vue2
-rw-r--r--src/components/emoji_picker/emoji_picker.js14
-rw-r--r--src/components/emoji_picker/emoji_picker.scss8
-rw-r--r--src/components/emoji_picker/emoji_picker.vue1
-rw-r--r--src/components/exporter/exporter.js14
-rw-r--r--src/components/exporter/exporter.vue4
-rw-r--r--src/components/font_control/font_control.js11
-rw-r--r--src/components/font_control/font_control.vue3
-rw-r--r--src/components/gallery/gallery.js4
-rw-r--r--src/components/gallery/gallery.vue1
-rw-r--r--src/components/global_notice_list/global_notice_list.vue11
-rw-r--r--src/components/image_cropper/image_cropper.js2
-rw-r--r--src/components/importer/importer.js21
-rw-r--r--src/components/importer/importer.vue28
-rw-r--r--src/components/interactions/interactions.js4
-rw-r--r--src/components/interface_language_switcher/interface_language_switcher.vue39
-rw-r--r--src/components/link-preview/link-preview.vue2
-rw-r--r--src/components/login_form/login_form.vue14
-rw-r--r--src/components/media_modal/media_modal.js2
-rw-r--r--src/components/media_modal/media_modal.vue4
-rw-r--r--src/components/media_upload/media_upload.vue8
-rw-r--r--src/components/mention_link/mention_link.vue6
-rw-r--r--src/components/mentions_line/mentions_line.vue2
-rw-r--r--src/components/mfa_form/recovery_form.vue12
-rw-r--r--src/components/mfa_form/totp_form.vue14
-rw-r--r--src/components/mobile_nav/mobile_nav.js3
-rw-r--r--src/components/mobile_nav/mobile_nav.vue20
-rw-r--r--src/components/mobile_post_status_button/mobile_post_status_button.js4
-rw-r--r--src/components/mobile_post_status_button/mobile_post_status_button.vue57
-rw-r--r--src/components/modal/modal.vue2
-rw-r--r--src/components/moderation_tools/moderation_tools.vue4
-rw-r--r--src/components/notification/notification.vue51
-rw-r--r--src/components/notifications/notification_filters.vue22
-rw-r--r--src/components/notifications/notifications.js18
-rw-r--r--src/components/notifications/notifications.scss23
-rw-r--r--src/components/notifications/notifications.vue116
-rw-r--r--src/components/opacity_input/opacity_input.vue13
-rw-r--r--src/components/password_reset/password_reset.vue10
-rw-r--r--src/components/poll/poll.js2
-rw-r--r--src/components/poll/poll.vue19
-rw-r--r--src/components/poll/poll_form.vue1
-rw-r--r--src/components/popover/popover.js2
-rw-r--r--src/components/popover/popover.vue67
-rw-r--r--src/components/post_status_form/post_status_form.js8
-rw-r--r--src/components/post_status_form/post_status_form.vue88
-rw-r--r--src/components/public_and_external_timeline/public_and_external_timeline.js2
-rw-r--r--src/components/public_timeline/public_timeline.js2
-rw-r--r--src/components/range_input/range_input.vue15
-rw-r--r--src/components/react_button/react_button.js3
-rw-r--r--src/components/react_button/react_button.vue3
-rw-r--r--src/components/registration/registration.js26
-rw-r--r--src/components/registration/registration.vue63
-rw-r--r--src/components/remote_follow/remote_follow.vue2
-rw-r--r--src/components/rich_content/rich_content.jsx22
-rw-r--r--src/components/scope_selector/scope_selector.vue3
-rw-r--r--src/components/search/search.js4
-rw-r--r--src/components/select/select.js7
-rw-r--r--src/components/select/select.vue15
-rw-r--r--src/components/selectable_list/selectable_list.vue8
-rw-r--r--src/components/settings_modal/helpers/boolean_setting.vue5
-rw-r--r--src/components/settings_modal/helpers/choice_setting.vue5
-rw-r--r--src/components/settings_modal/helpers/integer_setting.js2
-rw-r--r--src/components/settings_modal/helpers/integer_setting.vue1
-rw-r--r--src/components/settings_modal/settings_modal.js4
-rw-r--r--src/components/settings_modal/settings_modal.scss19
-rw-r--r--src/components/settings_modal/settings_modal.vue35
-rw-r--r--src/components/settings_modal/settings_modal_content.js9
-rw-r--r--src/components/settings_modal/settings_modal_content.vue1
-rw-r--r--src/components/settings_modal/tabs/data_import_export_tab.js29
-rw-r--r--src/components/settings_modal/tabs/data_import_export_tab.vue61
-rw-r--r--src/components/settings_modal/tabs/filtering_tab.vue14
-rw-r--r--src/components/settings_modal/tabs/general_tab.js11
-rw-r--r--src/components/settings_modal/tabs/general_tab.vue26
-rw-r--r--src/components/settings_modal/tabs/mutes_and_blocks_tab.js2
-rw-r--r--src/components/settings_modal/tabs/mutes_and_blocks_tab.scss2
-rw-r--r--src/components/settings_modal/tabs/notifications_tab.vue5
-rw-r--r--src/components/settings_modal/tabs/profile_tab.js46
-rw-r--r--src/components/settings_modal/tabs/profile_tab.scss8
-rw-r--r--src/components/settings_modal/tabs/profile_tab.vue49
-rw-r--r--src/components/settings_modal/tabs/security_tab/security_tab.js55
-rw-r--r--src/components/settings_modal/tabs/security_tab/security_tab.vue108
-rw-r--r--src/components/settings_modal/tabs/theme_tab/preview.vue11
-rw-r--r--src/components/settings_modal/tabs/theme_tab/theme_tab.js19
-rw-r--r--src/components/settings_modal/tabs/theme_tab/theme_tab.scss49
-rw-r--r--src/components/settings_modal/tabs/theme_tab/theme_tab.vue58
-rw-r--r--src/components/settings_modal/tabs/version_tab.vue2
-rw-r--r--src/components/shadow_control/shadow_control.js11
-rw-r--r--src/components/shadow_control/shadow_control.vue7
-rw-r--r--src/components/shout_panel/shout_panel.vue21
-rw-r--r--src/components/side_drawer/side_drawer.js2
-rw-r--r--src/components/status/status.js18
-rw-r--r--src/components/status/status.scss21
-rw-r--r--src/components/status/status.vue18
-rw-r--r--src/components/status_body/status_body.scss2
-rw-r--r--src/components/status_body/status_body.vue10
-rw-r--r--src/components/status_content/status_content.js6
-rw-r--r--src/components/status_popover/status_popover.js5
-rw-r--r--src/components/sticker_picker/sticker_picker.js2
-rw-r--r--src/components/still-image/still-image.vue8
-rw-r--r--src/components/tab_switcher/tab_switcher.jsx (renamed from src/components/tab_switcher/tab_switcher.js)75
-rw-r--r--src/components/tab_switcher/tab_switcher.scss10
-rw-r--r--src/components/tag_timeline/tag_timeline.js2
-rw-r--r--src/components/thread_tree/thread_tree.vue50
-rw-r--r--src/components/timeago/timeago.vue4
-rw-r--r--src/components/timeline/timeline.js21
-rw-r--r--src/components/timeline/timeline.scss28
-rw-r--r--src/components/timeline/timeline.vue110
-rw-r--r--src/components/timeline/timeline_quick_settings.vue24
-rw-r--r--src/components/timeline_menu/timeline_menu.vue4
-rw-r--r--src/components/user_avatar/user_avatar.vue96
-rw-r--r--src/components/user_card/user_card.scss323
-rw-r--r--src/components/user_card/user_card.vue321
-rw-r--r--src/components/user_list_popover/user_list_popover.js8
-rw-r--r--src/components/user_list_popover/user_list_popover.vue2
-rw-r--r--src/components/user_panel/user_panel.vue3
-rw-r--r--src/components/user_profile/user_profile.js10
-rw-r--r--src/components/user_profile/user_profile.vue27
-rw-r--r--src/components/user_reporting_modal/user_reporting_modal.vue17
144 files changed, 1909 insertions, 1493 deletions
diff --git a/src/components/about/about.vue b/src/components/about/about.vue
index 518f6184..5d5d6479 100644
--- a/src/components/about/about.vue
+++ b/src/components/about/about.vue
@@ -1,5 +1,5 @@
<template>
- <div class="sidebar">
+ <div class="column-inner">
<instance-specific-panel v-if="showInstanceSpecificPanel" />
<staff-panel />
<terms-of-service-panel />
diff --git a/src/components/account_actions/account_actions.js b/src/components/account_actions/account_actions.js
index e53c4f77..99762562 100644
--- a/src/components/account_actions/account_actions.js
+++ b/src/components/account_actions/account_actions.js
@@ -40,7 +40,7 @@ const AccountActions = {
openChat () {
this.$router.push({
name: 'chat',
- params: { recipient_id: this.user.id }
+ params: { username: this.$store.state.users.currentUser.screen_name, recipient_id: this.user.id }
})
}
},
diff --git a/src/components/account_actions/account_actions.vue b/src/components/account_actions/account_actions.vue
index 1e31151c..c35d01af 100644
--- a/src/components/account_actions/account_actions.vue
+++ b/src/components/account_actions/account_actions.vue
@@ -74,10 +74,6 @@
<style lang="scss">
@import '../../_variables.scss';
.AccountActions {
- button.dropdown-item {
- margin-left: 0;
- }
-
.ellipsis-button {
width: 2.5em;
margin: -0.5em 0;
diff --git a/src/components/async_component_error/async_component_error.vue b/src/components/async_component_error/async_component_error.vue
index b1b59638..26ab5d21 100644
--- a/src/components/async_component_error/async_component_error.vue
+++ b/src/components/async_component_error/async_component_error.vue
@@ -19,6 +19,7 @@
<script>
export default {
+ emits: ['resetAsyncComponent'],
methods: {
retry () {
this.$emit('resetAsyncComponent')
diff --git a/src/components/attachment/attachment.scss b/src/components/attachment/attachment.scss
index dfda15bf..b2dea98d 100644
--- a/src/components/attachment/attachment.scss
+++ b/src/components/attachment/attachment.scss
@@ -173,7 +173,7 @@
margin: 8px;
word-break: break-all;
h1 {
- font-size: 14px;
+ font-size: 1rem;
margin: 0px;
}
}
diff --git a/src/components/auth_form/auth_form.js b/src/components/auth_form/auth_form.js
index e9a6e2d5..a86a3dca 100644
--- a/src/components/auth_form/auth_form.js
+++ b/src/components/auth_form/auth_form.js
@@ -1,3 +1,4 @@
+import { h, resolveComponent } from 'vue'
import LoginForm from '../login_form/login_form.vue'
import MFARecoveryForm from '../mfa_form/recovery_form.vue'
import MFATOTPForm from '../mfa_form/totp_form.vue'
@@ -5,8 +6,8 @@ import { mapGetters } from 'vuex'
const AuthForm = {
name: 'AuthForm',
- render (createElement) {
- return createElement('component', { is: this.authForm })
+ render () {
+ return h(resolveComponent(this.authForm))
},
computed: {
authForm () {
diff --git a/src/components/basic_user_card/basic_user_card.vue b/src/components/basic_user_card/basic_user_card.vue
index 53deb1df..eeca7828 100644
--- a/src/components/basic_user_card/basic_user_card.vue
+++ b/src/components/basic_user_card/basic_user_card.vue
@@ -4,7 +4,7 @@
<UserAvatar
class="avatar"
:user="user"
- @click.prevent.native="toggleUserExpanded"
+ @click.prevent="toggleUserExpanded"
/>
</router-link>
<div
diff --git a/src/components/bookmark_timeline/bookmark_timeline.js b/src/components/bookmark_timeline/bookmark_timeline.js
index 64b69e5d..5ac43d90 100644
--- a/src/components/bookmark_timeline/bookmark_timeline.js
+++ b/src/components/bookmark_timeline/bookmark_timeline.js
@@ -9,7 +9,7 @@ const Bookmarks = {
components: {
Timeline
},
- destroyed () {
+ unmounted () {
this.$store.commit('clearTimeline', { timeline: 'bookmarks' })
}
}
diff --git a/src/components/chat/chat.js b/src/components/chat/chat.js
index b54f5fb2..9f6e64e3 100644
--- a/src/components/chat/chat.js
+++ b/src/components/chat/chat.js
@@ -6,7 +6,7 @@ import PostStatusForm from '../post_status_form/post_status_form.vue'
import ChatTitle from '../chat_title/chat_title.vue'
import chatService from '../../services/chat_service/chat_service.js'
import { promiseInterval } from '../../services/promise_interval/promise_interval.js'
-import { getScrollPosition, getNewTopPosition, isBottomedOut, scrollableContainerHeight, isScrollable } from './chat_layout_utils.js'
+import { getScrollPosition, getNewTopPosition, isBottomedOut, isScrollable } from './chat_layout_utils.js'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
faChevronDown,
@@ -20,7 +20,7 @@ library.add(
)
const BOTTOMED_OUT_OFFSET = 10
-const JUMP_TO_BOTTOM_BUTTON_VISIBILITY_OFFSET = 150
+const JUMP_TO_BOTTOM_BUTTON_VISIBILITY_OFFSET = 10
const SAFE_RESIZE_TIME_OFFSET = 100
const MARK_AS_READ_DELAY = 1500
const MAX_RETRIES = 10
@@ -43,7 +43,7 @@ const Chat = {
},
created () {
this.startFetching()
- window.addEventListener('resize', this.handleLayoutChange)
+ window.addEventListener('resize', this.handleResize)
},
mounted () {
window.addEventListener('scroll', this.handleScroll)
@@ -52,15 +52,11 @@ const Chat = {
}
this.$nextTick(() => {
- this.updateScrollableContainerHeight()
this.handleResize()
})
- this.setChatLayout()
},
- destroyed () {
+ unmounted () {
window.removeEventListener('scroll', this.handleScroll)
- window.removeEventListener('resize', this.handleLayoutChange)
- this.unsetChatLayout()
if (typeof document.hidden !== 'undefined') document.removeEventListener('visibilitychange', this.handleVisibilityChange, false)
this.$store.dispatch('clearCurrentChat')
},
@@ -96,8 +92,7 @@ const Chat = {
...mapState({
backendInteractor: state => state.api.backendInteractor,
mastoUserSocketStatus: state => state.api.mastoUserSocketStatus,
- mobileLayout: state => state.interface.mobileLayout,
- layoutHeight: state => state.interface.layoutHeight,
+ mobileLayout: state => state.interface.layoutType === 'mobile',
currentUser: state => state.users.currentUser
})
},
@@ -115,9 +110,6 @@ const Chat = {
'$route': function () {
this.startFetching()
},
- layoutHeight () {
- this.handleResize({ expand: true })
- },
mastoUserSocketStatus (newValue) {
if (newValue === WSConnectionStatus.JOINED) {
this.fetchChat({ isFirstFetch: true })
@@ -132,7 +124,6 @@ const Chat = {
onFilesDropped () {
this.$nextTick(() => {
this.handleResize()
- this.updateScrollableContainerHeight()
})
},
handleVisibilityChange () {
@@ -142,43 +133,7 @@ const Chat = {
}
})
},
- setChatLayout () {
- // This is a hacky way to adjust the global layout to the mobile chat (without modifying the rest of the app).
- // This layout prevents empty spaces from being visible at the bottom
- // of the chat on iOS Safari (`safe-area-inset`) when
- // - the on-screen keyboard appears and the user starts typing
- // - the user selects the text inside the input area
- // - the user selects and deletes the text that is multiple lines long
- // TODO: unify the chat layout with the global layout.
- let html = document.querySelector('html')
- if (html) {
- html.classList.add('chat-layout')
- }
-
- this.$nextTick(() => {
- this.updateScrollableContainerHeight()
- })
- },
- unsetChatLayout () {
- let html = document.querySelector('html')
- if (html) {
- html.classList.remove('chat-layout')
- }
- },
- handleLayoutChange () {
- this.$nextTick(() => {
- this.updateScrollableContainerHeight()
- this.scrollDown()
- })
- },
- // Ensures the proper position of the posting form in the mobile layout (the mobile browser panel does not overlap or hide it)
- updateScrollableContainerHeight () {
- const header = this.$refs.header
- const footer = this.$refs.footer
- const inner = this.mobileLayout ? window.document.body : this.$refs.inner
- this.scrollableContainerHeight = scrollableContainerHeight(inner, header, footer) + 'px'
- },
- // Preserves the scroll position when OSK appears or the posting form changes its height.
+ // "Sticks" scroll to bottom instead of top, helps with OSK resizing the viewport
handleResize (opts = {}) {
const { expand = false, delayed = false } = opts
@@ -190,29 +145,20 @@ const Chat = {
}
this.$nextTick(() => {
- this.updateScrollableContainerHeight()
-
- const { offsetHeight = undefined } = this.lastScrollPosition
- this.lastScrollPosition = getScrollPosition(this.$refs.scrollable)
-
+ const { offsetHeight = undefined } = getScrollPosition()
const diff = this.lastScrollPosition.offsetHeight - offsetHeight
- if (diff < 0 || (!this.bottomedOut() && expand)) {
+ if (diff !== 0 || (!this.bottomedOut() && expand)) {
this.$nextTick(() => {
- this.updateScrollableContainerHeight()
- this.$refs.scrollable.scrollTo({
- top: this.$refs.scrollable.scrollTop - diff,
- left: 0
- })
+ window.scrollTo({ top: window.scrollY + diff })
})
}
+ this.lastScrollPosition = getScrollPosition()
})
},
scrollDown (options = {}) {
const { behavior = 'auto', forceRead = false } = options
- const scrollable = this.$refs.scrollable
- if (!scrollable) { return }
this.$nextTick(() => {
- scrollable.scrollTo({ top: scrollable.scrollHeight, left: 0, behavior })
+ window.scrollTo({ top: document.documentElement.scrollHeight, behavior })
})
if (forceRead) {
this.readChat()
@@ -228,11 +174,10 @@ const Chat = {
})
},
bottomedOut (offset) {
- return isBottomedOut(this.$refs.scrollable, offset)
+ return isBottomedOut(offset)
},
reachedTop () {
- const scrollable = this.$refs.scrollable
- return scrollable && scrollable.scrollTop <= 0
+ return window.scrollY <= 0
},
cullOlderCheck () {
window.setTimeout(() => {
@@ -263,10 +208,9 @@ const Chat = {
}
}, 200),
handleScrollUp (positionBeforeLoading) {
- const positionAfterLoading = getScrollPosition(this.$refs.scrollable)
- this.$refs.scrollable.scrollTo({
- top: getNewTopPosition(positionBeforeLoading, positionAfterLoading),
- left: 0
+ const positionAfterLoading = getScrollPosition()
+ window.scrollTo({
+ top: getNewTopPosition(positionBeforeLoading, positionAfterLoading)
})
},
fetchChat ({ isFirstFetch = false, fetchLatest = false, maxId }) {
@@ -285,22 +229,18 @@ const Chat = {
chatService.clear(chatMessageService)
}
- const positionBeforeUpdate = getScrollPosition(this.$refs.scrollable)
+ const positionBeforeUpdate = getScrollPosition()
this.$store.dispatch('addChatMessages', { chatId, messages }).then(() => {
this.$nextTick(() => {
if (fetchOlderMessages) {
this.handleScrollUp(positionBeforeUpdate)
}
- if (isFirstFetch) {
- this.updateScrollableContainerHeight()
- }
-
// In vertical screens, the first batch of fetched messages may not always take the
// full height of the scrollable container.
// If this is the case, we want to fetch the messages until the scrollable container
// is fully populated so that the user has the ability to scroll up and load the history.
- if (!isScrollable(this.$refs.scrollable) && messages.length > 0) {
+ if (!isScrollable() && messages.length > 0) {
this.fetchChat({ maxId: this.currentChatMessageService.minId })
}
})
@@ -336,9 +276,6 @@ const Chat = {
this.handleResize()
// When the posting form size changes because of a media attachment, we need an extra resize
// to account for the potential delay in the DOM update.
- setTimeout(() => {
- this.updateScrollableContainerHeight()
- }, SAFE_RESIZE_TIME_OFFSET)
this.scrollDown({ forceRead: true })
})
},
diff --git a/src/components/chat/chat.scss b/src/components/chat/chat.scss
index 3a26686c..f2e154ab 100644
--- a/src/components/chat/chat.scss
+++ b/src/components/chat/chat.scss
@@ -1,28 +1,22 @@
.chat-view {
display: flex;
- height: calc(100vh - 60px);
- width: 100%;
-
- .chat-title {
- // prevents chat header jumping on when the user avatar loads
- height: 28px;
- }
+ height: 100%;
.chat-view-inner {
height: auto;
width: 100%;
overflow: visible;
display: flex;
- margin: 0.5em 0.5em 0 0.5em;
}
.chat-view-body {
+ box-sizing: border-box;
background-color: var(--chatBg, $fallback--bg);
display: flex;
flex-direction: column;
width: 100%;
overflow: visible;
- min-height: 100%;
+ min-height: calc(100vh - var(--navbar-height));
margin: 0 0 0 0;
border-radius: 10px 10px 0 0;
border-radius: var(--panelRadius, 10px) var(--panelRadius, 10px) 0 0;
@@ -32,36 +26,32 @@
}
}
- .scrollable-message-list {
+ .message-list {
padding: 0 0.8em;
height: 100%;
- overflow-y: scroll;
- overflow-x: hidden;
display: flex;
flex-direction: column;
+ justify-content: end;
}
.footer {
position: sticky;
bottom: 0;
+ background-color: $fallback--bg;
+ background-color: var(--bg, $fallback--bg);
+ z-index: 1;
}
.chat-view-heading {
- align-items: center;
- justify-content: space-between;
- top: 50px;
- display: flex;
- z-index: 2;
- position: sticky;
- overflow: hidden;
+ grid-template-columns: auto minmax(50%, 1fr);
}
.go-back-button {
- cursor: pointer;
- width: 28px;
text-align: center;
- padding: 0.6em;
- margin: -0.6em 0.6em -0.6em -0.6em;
+ line-height: 1;
+ height: 100%;
+ align-self: start;
+ width: var(--__panel-heading-height-inner);
}
.jump-to-bottom-button {
@@ -115,56 +105,4 @@
}
}
}
-
- @media all and (max-width: 800px) {
- height: 100%;
- overflow: hidden;
-
- .chat-view-inner {
- overflow: hidden;
- height: 100%;
- margin-top: 0;
- margin-left: 0;
- margin-right: 0;
- }
-
- .chat-view-body {
- display: flex;
- min-height: auto;
- overflow: hidden;
- height: 100%;
- margin: 0;
- border-radius: 0;
- }
-
- .chat-view-heading {
- box-sizing: border-box;
- position: static;
- z-index: 9999;
- top: 0;
- margin-top: 0;
- border-radius: 0;
-
- /* This practically overlays the panel heading color over panel background
- * color. This is needed because we allow transparent panel background and
- * it doesn't work well in this "disjointed panel header" case
- */
- background:
- linear-gradient(to top, var(--panel), var(--panel)),
- linear-gradient(to top, var(--bg), var(--bg));
- height: 50px;
- }
-
- .scrollable-message-list {
- display: unset;
- overflow-y: scroll;
- overflow-x: hidden;
- -webkit-overflow-scrolling: touch;
- }
-
- .footer {
- position: sticky;
- bottom: auto;
- }
- }
}
diff --git a/src/components/chat/chat.vue b/src/components/chat/chat.vue
index 94a0097c..2e7df7bd 100644
--- a/src/components/chat/chat.vue
+++ b/src/components/chat/chat.vue
@@ -2,23 +2,22 @@
<div class="chat-view">
<div class="chat-view-inner">
<div
- id="nav"
ref="inner"
class="panel-default panel chat-view-body"
>
<div
ref="header"
- class="panel-heading chat-view-heading mobile-hidden"
+ class="panel-heading -sticky chat-view-heading"
>
- <a
- class="go-back-button"
+ <button
+ class="button-unstyled go-back-button"
@click="goBack"
>
<FAIcon
size="lg"
icon="chevron-left"
/>
- </a>
+ </button>
<div class="title text-center">
<ChatTitle
:user="recipient"
@@ -26,73 +25,69 @@
/>
</div>
</div>
- <template>
+ <div
+ class="message-list"
+ :style="{ height: scrollableContainerHeight }"
+ >
+ <template v-if="!errorLoadingChat">
+ <ChatMessage
+ v-for="chatViewItem in chatViewItems"
+ :key="chatViewItem.id"
+ :author="recipient"
+ :chat-view-item="chatViewItem"
+ :hovered-message-chain="chatViewItem.messageChainId === hoveredMessageChainId"
+ @hover="onMessageHover"
+ />
+ </template>
<div
- ref="scrollable"
- class="scrollable-message-list"
- :style="{ height: scrollableContainerHeight }"
- @scroll="handleScroll"
+ v-else
+ class="chat-loading-error"
>
- <template v-if="!errorLoadingChat">
- <ChatMessage
- v-for="chatViewItem in chatViewItems"
- :key="chatViewItem.id"
- :author="recipient"
- :chat-view-item="chatViewItem"
- :hovered-message-chain="chatViewItem.messageChainId === hoveredMessageChainId"
- @hover="onMessageHover"
- />
- </template>
- <div
- v-else
- class="chat-loading-error"
- >
- <div class="alert error">
- {{ $t('chats.error_loading_chat') }}
- </div>
+ <div class="alert error">
+ {{ $t('chats.error_loading_chat') }}
</div>
</div>
+ </div>
+ <div
+ ref="footer"
+ class="panel-body footer"
+ >
<div
- ref="footer"
- class="panel-body footer"
+ class="jump-to-bottom-button"
+ :class="{ 'visible': jumpToBottomButtonVisible }"
+ @click="scrollDown({ behavior: 'smooth' })"
>
- <div
- class="jump-to-bottom-button"
- :class="{ 'visible': jumpToBottomButtonVisible }"
- @click="scrollDown({ behavior: 'smooth' })"
- >
- <span>
- <FAIcon icon="chevron-down" />
- <div
- v-if="newMessageCount"
- class="badge badge-notification unread-chat-count unread-message-count"
- >
- {{ newMessageCount }}
- </div>
- </span>
- </div>
- <PostStatusForm
- :disable-subject="true"
- :disable-scope-selector="true"
- :disable-notice="true"
- :disable-lock-warning="true"
- :disable-polls="true"
- :disable-sensitivity-checkbox="true"
- :disable-submit="errorLoadingChat || !currentChat"
- :disable-preview="true"
- :optimistic-posting="true"
- :post-handler="sendMessage"
- :submit-on-enter="!mobileLayout"
- :preserve-focus="!mobileLayout"
- :auto-focus="!mobileLayout"
- :placeholder="formPlaceholder"
- :file-limit="1"
- max-height="160"
- emoji-picker-placement="top"
- @resize="handleResize"
- />
+ <span>
+ <FAIcon icon="chevron-down" />
+ <div
+ v-if="newMessageCount"
+ class="badge badge-notification unread-chat-count unread-message-count"
+ >
+ {{ newMessageCount }}
+ </div>
+ </span>
</div>
- </template>
+ <PostStatusForm
+ :disable-subject="true"
+ :disable-scope-selector="true"
+ :disable-notice="true"
+ :disable-lock-warning="true"
+ :disable-polls="true"
+ :disable-sensitivity-checkbox="true"
+ :disable-submit="errorLoadingChat || !currentChat"
+ :disable-preview="true"
+ :optimistic-posting="true"
+ :post-handler="sendMessage"
+ :submit-on-enter="!mobileLayout"
+ :preserve-focus="!mobileLayout"
+ :auto-focus="!mobileLayout"
+ :placeholder="formPlaceholder"
+ :file-limit="1"
+ max-height="160"
+ emoji-picker-placement="top"
+ @resize="handleResize"
+ />
+ </div>
</div>
</div>
</div>
diff --git a/src/components/chat/chat_layout_utils.js b/src/components/chat/chat_layout_utils.js
index 50a933ac..c187892d 100644
--- a/src/components/chat/chat_layout_utils.js
+++ b/src/components/chat/chat_layout_utils.js
@@ -1,9 +1,9 @@
// Captures a scroll position
-export const getScrollPosition = (el) => {
+export const getScrollPosition = () => {
return {
- scrollTop: el.scrollTop,
- scrollHeight: el.scrollHeight,
- offsetHeight: el.offsetHeight
+ scrollTop: window.scrollY,
+ scrollHeight: document.documentElement.scrollHeight,
+ offsetHeight: window.innerHeight
}
}
@@ -13,21 +13,12 @@ export const getNewTopPosition = (previousPosition, newPosition) => {
return previousPosition.scrollTop + (newPosition.scrollHeight - previousPosition.scrollHeight)
}
-export const isBottomedOut = (el, offset = 0) => {
- if (!el) { return }
- const scrollHeight = el.scrollTop + offset
- const totalHeight = el.scrollHeight - el.offsetHeight
+export const isBottomedOut = (offset = 0) => {
+ const scrollHeight = window.scrollY + offset
+ const totalHeight = document.documentElement.scrollHeight - window.innerHeight
return totalHeight <= scrollHeight
}
-
-// Height of the scrollable container. The dynamic height is needed to ensure the mobile browser panel doesn't overlap or hide the posting form.
-export const scrollableContainerHeight = (inner, header, footer) => {
- return inner.offsetHeight - header.clientHeight - footer.clientHeight
-}
-
// Returns whether or not the scrollbar is visible.
-export const isScrollable = (el) => {
- if (!el) return
-
- return el.scrollHeight > el.clientHeight
+export const isScrollable = () => {
+ return document.documentElement.scrollHeight > window.innerHeight
}
diff --git a/src/components/chat_list/chat_list.vue b/src/components/chat_list/chat_list.vue
index f98b7ed2..58e8d0b3 100644
--- a/src/components/chat_list/chat_list.vue
+++ b/src/components/chat_list/chat_list.vue
@@ -6,7 +6,7 @@
v-else
class="chat-list panel panel-default"
>
- <div class="panel-heading">
+ <div class="panel-heading -sticky">
<span class="title">
{{ $t("chats.chats") }}
</span>
diff --git a/src/components/chat_list_item/chat_list_item.scss b/src/components/chat_list_item/chat_list_item.scss
index 57332bed..c6b45c34 100644
--- a/src/components/chat_list_item/chat_list_item.scss
+++ b/src/components/chat_list_item/chat_list_item.scss
@@ -43,7 +43,7 @@
white-space: nowrap;
overflow: hidden;
flex-shrink: 1;
- line-height: 1.4em;
+ line-height: var(--post-line-height);
}
.chat-preview {
@@ -82,7 +82,7 @@
}
.time-wrapper {
- line-height: 1.4em;
+ line-height: var(--post-line-height);
}
.chat-preview-body {
diff --git a/src/components/chat_message/chat_message.js b/src/components/chat_message/chat_message.js
index eb195bc1..5bac7736 100644
--- a/src/components/chat_message/chat_message.js
+++ b/src/components/chat_message/chat_message.js
@@ -27,6 +27,7 @@ const ChatMessage = {
'chatViewItem',
'hoveredMessageChain'
],
+ emits: ['hover'],
components: {
Popover,
Attachment,
diff --git a/src/components/chat_new/chat_new.scss b/src/components/chat_new/chat_new.scss
index 5506143d..240e1a38 100644
--- a/src/components/chat_new/chat_new.scss
+++ b/src/components/chat_new/chat_new.scss
@@ -22,10 +22,10 @@
}
.go-back-button {
- cursor: pointer;
- width: 28px;
text-align: center;
- padding: 0.6em;
- margin: -0.6em 0.6em -0.6em -0.6em;
+ line-height: 1;
+ height: 100%;
+ align-self: start;
+ width: var(--__panel-heading-height-inner);
}
}
diff --git a/src/components/chat_new/chat_new.vue b/src/components/chat_new/chat_new.vue
index f3894a3a..bf09a379 100644
--- a/src/components/chat_new/chat_new.vue
+++ b/src/components/chat_new/chat_new.vue
@@ -1,21 +1,20 @@
<template>
<div
- id="nav"
class="panel-default panel chat-new"
>
<div
ref="header"
class="panel-heading"
>
- <a
- class="go-back-button"
+ <button
+ class="button-unstyled go-back-button"
@click="goBack"
>
<FAIcon
size="lg"
icon="chevron-left"
/>
- </a>
+ </button>
</div>
<div class="input-wrap">
<div class="input-search">
diff --git a/src/components/chat_title/chat_title.js b/src/components/chat_title/chat_title.js
index edfbe7a4..f6e299ad 100644
--- a/src/components/chat_title/chat_title.js
+++ b/src/components/chat_title/chat_title.js
@@ -1,11 +1,12 @@
-import Vue from 'vue'
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
import UserAvatar from '../user_avatar/user_avatar.vue'
+import RichContent from 'src/components/rich_content/rich_content.jsx'
-export default Vue.component('chat-title', {
+export default {
name: 'ChatTitle',
components: {
- UserAvatar
+ UserAvatar,
+ RichContent
},
props: [
'user', 'withAvatar'
@@ -23,4 +24,4 @@ export default Vue.component('chat-title', {
return generateProfileLink(user.id, user.screen_name)
}
}
-})
+}
diff --git a/src/components/chat_title/chat_title.vue b/src/components/chat_title/chat_title.vue
index a92028e8..7f6aaaa4 100644
--- a/src/components/chat_title/chat_title.vue
+++ b/src/components/chat_title/chat_title.vue
@@ -4,20 +4,21 @@
:title="title"
>
<router-link
+ class="avatar-container"
v-if="withAvatar && user"
:to="getUserProfileLink(user)"
>
<UserAvatar
+ class="titlebar-avatar"
:user="user"
- width="23px"
- height="23px"
/>
</router-link>
<RichContent
+ v-if="user"
class="username"
- :title="'@'+user.screen_name_ui"
+ :title="'@'+(user && user.screen_name_ui)"
:html="htmlTitle"
- :emoji="user.emoji"
+ :emoji="user.emoji || []"
/>
</div>
</template>
@@ -32,7 +33,6 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
- align-items: center;
--emoji-size: 14px;
@@ -45,11 +45,15 @@
overflow: hidden;
}
- .Avatar {
- width: 23px;
- height: 23px;
- margin-right: 0.5em;
+ .avatar-container {
+ align-self: center;
+ line-height: 1;
+ }
+ .titlebar-avatar {
+ margin-right: 0.5em;
+ height: 1.5em;
+ width: 1.5em;
border-radius: $fallback--avatarAltRadius;
border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
diff --git a/src/components/checkbox/checkbox.vue b/src/components/checkbox/checkbox.vue
index d28c2cfd..83695912 100644
--- a/src/components/checkbox/checkbox.vue
+++ b/src/components/checkbox/checkbox.vue
@@ -6,9 +6,9 @@
<input
type="checkbox"
:disabled="disabled"
- :checked="checked"
- :indeterminate.prop="indeterminate"
- @change="$emit('change', $event.target.checked)"
+ :checked="modelValue"
+ :indeterminate="indeterminate"
+ @change="$emit('update:modelValue', $event.target.checked)"
>
<i class="checkbox-indicator" />
<span
@@ -22,12 +22,9 @@
<script>
export default {
- model: {
- prop: 'checked',
- event: 'change'
- },
+ emits: ['update:modelValue'],
props: [
- 'checked',
+ 'modelValue',
'indeterminate',
'disabled'
]
diff --git a/src/components/color_input/color_input.vue b/src/components/color_input/color_input.vue
index 8fb16113..e84603c3 100644
--- a/src/components/color_input/color_input.vue
+++ b/src/components/color_input/color_input.vue
@@ -11,28 +11,28 @@
</label>
<Checkbox
v-if="typeof fallback !== 'undefined' && showOptionalTickbox"
- :checked="present"
+ :model-value="present"
:disabled="disabled"
class="opt"
- @change="$emit('input', typeof value === 'undefined' ? fallback : undefined)"
+ @update:modelValue="$emit('update:modelValue', typeof modelValue === 'undefined' ? fallback : undefined)"
/>
<div class="input color-input-field">
<input
:id="name + '-t'"
class="textColor unstyled"
type="text"
- :value="value || fallback"
+ :value="modelValue || fallback"
:disabled="!present || disabled"
- @input="$emit('input', $event.target.value)"
+ @input="$emit('update:modelValue', $event.target.value)"
>
<input
v-if="validColor"
:id="name"
class="nativeColor unstyled"
type="color"
- :value="value || fallback"
+ :value="modelValue || fallback"
:disabled="!present || disabled"
- @input="$emit('input', $event.target.value)"
+ @input="$emit('update:modelValue', $event.target.value)"
>
<div
v-if="transparentColor"
@@ -67,7 +67,7 @@ export default {
},
// Color value, should be required but vue cannot tell the difference
// between "property missing" and "property set to undefined"
- value: {
+ modelValue: {
required: false,
type: String,
default: undefined
@@ -91,18 +91,19 @@ export default {
default: true
}
},
+ emits: ['update:modelValue'],
computed: {
present () {
- return typeof this.value !== 'undefined'
+ return typeof this.modelValue !== 'undefined'
},
validColor () {
- return hex2rgb(this.value || this.fallback)
+ return hex2rgb(this.modelValue || this.fallback)
},
transparentColor () {
- return this.value === 'transparent'
+ return this.modelValue === 'transparent'
},
computedColor () {
- return this.value && this.value.startsWith('--')
+ return this.modelValue && this.modelValue.startsWith('--')
}
}
}
diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue
index 7628ceaa..6088e1ca 100644
--- a/src/components/conversation/conversation.vue
+++ b/src/components/conversation/conversation.vue
@@ -7,7 +7,7 @@
>
<div
v-if="isExpanded"
- class="panel-heading conversation-heading"
+ class="panel-heading conversation-heading -sticky"
>
<span class="title"> {{ $t('timeline.conversation') }} </span>
<button
@@ -27,20 +27,24 @@
v-if="shouldShowAllConversationButton"
class="conversation-dive-to-top-level-box"
>
- <i18n
- path="status.show_all_conversation_with_icon"
+ <i18n-t
+ keypath="status.show_all_conversation_with_icon"
tag="button"
class="button-unstyled -link"
@click.prevent="diveToTopLevel"
+ scope="global"
>
- <FAIcon
- place="icon"
- icon="angle-double-left"
- />
- <span place="text">
- {{ $tc('status.show_all_conversation', otherTopLevelCount, { numStatus: otherTopLevelCount }) }}
- </span>
- </i18n>
+ <template #icon>
+ <FAIcon
+ icon="angle-double-left"
+ />
+ </template>
+ <template #text>
+ <span>
+ {{ $tc('status.show_all_conversation', otherTopLevelCount, { numStatus: otherTopLevelCount }) }}
+ </span>
+ </template>
+ </i18n-t>
</div>
<div
v-if="shouldShowAncestors"
@@ -96,20 +100,24 @@
<div
class="thread-ancestor-dive-box-inner"
>
- <i18n
+ <i18n-t
tag="button"
- path="status.ancestor_follow_with_icon"
+ scope="global"
+ keypath="status.ancestor_follow_with_icon"
class="button-unstyled -link thread-tree-show-replies-button"
@click.prevent="diveIntoStatus(status.id)"
>
- <FAIcon
- place="icon"
- icon="angle-double-right"
- />
- <span place="text">
- {{ $tc('status.ancestor_follow', getReplies(status.id).length - 1, { numReplies: getReplies(status.id).length - 1 }) }}
- </span>
- </i18n>
+ <template #icon>
+ <FAIcon
+ icon="angle-double-right"
+ />
+ </template>
+ <template #text>
+ <span>
+ {{ $tc('status.ancestor_follow', getReplies(status.id).length - 1, { numReplies: getReplies(status.id).length - 1 }) }}
+ </span>
+ </template>
+ </i18n-t>
</div>
</div>
</div>
@@ -193,6 +201,8 @@
@import '../../_variables.scss';
.Conversation {
+ z-index: 1;
+
.conversation-dive-to-top-level-box {
padding: var(--status-margin, $status-margin);
border-bottom-width: 1px;
@@ -215,6 +225,7 @@
--text: var(--faint);
color: var(--text);
}
+
.thread-ancestor-dive-box {
padding-left: var(--status-margin, $status-margin);
border-bottom-width: 1px;
@@ -242,6 +253,7 @@
.thread-ancestor-has-other-replies .conversation-status,
.thread-ancestor:last-child .conversation-status,
.thread-ancestor:last-child .thread-ancestor-dive-box,
+ &:last-child .conversation-status,
&.-expanded .thread-tree .conversation-status {
border-bottom: none;
}
@@ -262,5 +274,9 @@
border-radius: 0 0 var(--panelRadius, $fallback--panelRadius) var(--panelRadius, $fallback--panelRadius);
border-bottom: 1px solid var(--border, $fallback--border);
}
+
+ &.-expanded.status-fadein {
+ margin: calc(var(--status-margin, $status-margin) / 2);
+ }
}
</style>
diff --git a/src/components/desktop_nav/desktop_nav.scss b/src/components/desktop_nav/desktop_nav.scss
index 2d468588..eddd9707 100644
--- a/src/components/desktop_nav/desktop_nav.scss
+++ b/src/components/desktop_nav/desktop_nav.scss
@@ -1,9 +1,11 @@
@import '../../_variables.scss';
.DesktopNav {
- height: 50px;
width: 100%;
- position: fixed;
+
+ input {
+ color: var(--inputTopbarText, var(--inputText));
+ }
a {
color: var(--topBarLink, $fallback--link);
@@ -11,7 +13,7 @@
.inner-nav {
display: grid;
- grid-template-rows: 50px;
+ grid-template-rows: var(--navbar-height);
grid-template-columns: 2fr auto 2fr;
grid-template-areas: "sitename logo actions";
box-sizing: border-box;
@@ -20,7 +22,7 @@
max-width: 980px;
}
- &.-logoLeft {
+ &.-logoLeft .inner-nav {
grid-template-columns: auto 2fr 2fr;
grid-template-areas: "logo sitename actions";
}
@@ -77,7 +79,7 @@
img {
display: inline-block;
- height: 50px;
+ height: var(--navbar-height);
}
}
@@ -103,8 +105,8 @@
.item {
flex: 1;
- line-height: 50px;
- height: 50px;
+ line-height: var(--navbar-height);
+ height: var(--navbar-height);
overflow: hidden;
display: flex;
flex-wrap: wrap;
diff --git a/src/components/desktop_nav/desktop_nav.vue b/src/components/desktop_nav/desktop_nav.vue
index 304baf9d..bab3ca81 100644
--- a/src/components/desktop_nav/desktop_nav.vue
+++ b/src/components/desktop_nav/desktop_nav.vue
@@ -34,7 +34,7 @@
<search-bar
v-if="currentUser || !privateMode"
@toggled="onSearchBarToggled"
- @click.stop.native
+ @click.stop
/>
<button
class="button-unstyled nav-icon"
diff --git a/src/components/dialog_modal/dialog_modal.vue b/src/components/dialog_modal/dialog_modal.vue
index 3241ce3e..06b270c3 100644
--- a/src/components/dialog_modal/dialog_modal.vue
+++ b/src/components/dialog_modal/dialog_modal.vue
@@ -58,16 +58,7 @@
background-color: var(--bg, $fallback--bg);
.dialog-modal-heading {
- padding: .5em .5em;
- margin-right: auto;
- margin-bottom: 0;
- white-space: nowrap;
- color: var(--panelText);
- background-color: $fallback--fg;
- background-color: var(--panel, $fallback--fg);
-
.title {
- margin-bottom: 0;
text-align: center;
}
}
diff --git a/src/components/emoji_input/emoji_input.js b/src/components/emoji_input/emoji_input.js
index 902ec384..391cc5b5 100644
--- a/src/components/emoji_input/emoji_input.js
+++ b/src/components/emoji_input/emoji_input.js
@@ -31,6 +31,7 @@ library.add(
*/
const EmojiInput = {
+ emits: ['update:modelValue', 'shown'],
props: {
suggest: {
/**
@@ -57,8 +58,7 @@ const EmojiInput = {
required: true,
type: Function
},
- // TODO VUE3: change to modelValue, change 'input' event to 'input'
- value: {
+ modelValue: {
/**
* Used for v-model
*/
@@ -137,8 +137,8 @@ const EmojiInput = {
return (this.wordAtCaret || {}).word || ''
},
wordAtCaret () {
- if (this.value && this.caret) {
- const word = Completion.wordAtPosition(this.value, this.caret - 1) || {}
+ if (this.modelValue && this.caret) {
+ const word = Completion.wordAtPosition(this.modelValue, this.caret - 1) || {}
return word
}
}
@@ -189,8 +189,11 @@ const EmojiInput = {
img: imageUrl || ''
}))
},
- suggestions (newValue) {
- this.$nextTick(this.resize)
+ suggestions: {
+ handler (newValue) {
+ this.$nextTick(this.resize)
+ },
+ deep: true
}
},
methods: {
@@ -225,13 +228,13 @@ const EmojiInput = {
}
},
replace (replacement) {
- const newValue = Completion.replaceWord(this.value, this.wordAtCaret, replacement)
- this.$emit('input', newValue)
+ const newValue = Completion.replaceWord(this.modelValue, this.wordAtCaret, replacement)
+ this.$emit('update:modelValue', newValue)
this.caret = 0
},
insert ({ insertion, keepOpen, surroundingSpace = true }) {
- const before = this.value.substring(0, this.caret) || ''
- const after = this.value.substring(this.caret) || ''
+ const before = this.modelValue.substring(0, this.caret) || ''
+ const after = this.modelValue.substring(this.caret) || ''
/* Using a bit more smart approach to padding emojis with spaces:
* - put a space before cursor if there isn't one already, unless we
@@ -259,7 +262,7 @@ const EmojiInput = {
after
].join('')
this.keepOpen = keepOpen
- this.$emit('input', newValue)
+ this.$emit('update:modelValue', newValue)
const position = this.caret + (insertion + spaceAfter + spaceBefore).length
if (!keepOpen) {
this.input.focus()
@@ -278,8 +281,8 @@ const EmojiInput = {
if (len > 0 || suggestion) {
const chosenSuggestion = suggestion || this.suggestions[this.highlighted]
const replacement = chosenSuggestion.replacement
- const newValue = Completion.replaceWord(this.value, this.wordAtCaret, replacement)
- this.$emit('input', newValue)
+ const newValue = Completion.replaceWord(this.modelValue, this.wordAtCaret, replacement)
+ this.$emit('update:modelValue', newValue)
this.highlighted = 0
const position = this.wordAtCaret.start + replacement.length
@@ -455,7 +458,7 @@ const EmojiInput = {
this.showPicker = false
this.setCaret(e)
this.resize()
- this.$emit('input', e.target.value)
+ this.$emit('update:modelValue', e.target.value)
},
onClickInput (e) {
this.showPicker = false
diff --git a/src/components/emoji_input/emoji_input.vue b/src/components/emoji_input/emoji_input.vue
index aa2950ce..7d95ab7e 100644
--- a/src/components/emoji_input/emoji_input.vue
+++ b/src/components/emoji_input/emoji_input.vue
@@ -78,7 +78,7 @@
top: 0;
right: 0;
margin: .2em .25em;
- font-size: 16px;
+ font-size: 1.3em;
cursor: pointer;
line-height: 24px;
diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js
index 2716d93f..bd5c2e39 100644
--- a/src/components/emoji_picker/emoji_picker.js
+++ b/src/components/emoji_picker/emoji_picker.js
@@ -1,3 +1,4 @@
+import { defineAsyncComponent } from 'vue'
import Checkbox from '../checkbox/checkbox.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
@@ -5,6 +6,7 @@ import {
faStickyNote,
faSmileBeam
} from '@fortawesome/free-solid-svg-icons'
+import { trim } from 'lodash'
library.add(
faBoxOpen,
@@ -57,7 +59,7 @@ const EmojiPicker = {
}
},
components: {
- StickerPicker: () => import('../sticker_picker/sticker_picker.vue'),
+ StickerPicker: defineAsyncComponent(() => import('../sticker_picker/sticker_picker.vue')),
Checkbox
},
methods: {
@@ -79,7 +81,7 @@ const EmojiPicker = {
},
highlight (key) {
const ref = this.$refs['group-' + key]
- const top = ref[0].offsetTop
+ const top = ref.offsetTop
this.setShowStickers(false)
this.activeGroup = key
this.$nextTick(() => {
@@ -96,7 +98,7 @@ const EmojiPicker = {
}
},
triggerLoadMore (target) {
- const ref = this.$refs['group-end-custom'][0]
+ const ref = this.$refs['group-end-custom']
if (!ref) return
const bottom = ref.offsetTop + ref.offsetHeight
@@ -119,7 +121,7 @@ const EmojiPicker = {
this.$nextTick(() => {
this.emojisView.forEach(group => {
const ref = this.$refs['group-' + group.id]
- if (ref[0].offsetTop <= top) {
+ if (ref.offsetTop <= top) {
this.activeGroup = group.id
}
})
@@ -175,7 +177,7 @@ const EmojiPicker = {
filteredEmoji () {
return filterByKeyword(
this.$store.state.instance.customEmoji || [],
- this.keyword
+ trim(this.keyword)
)
},
customEmojiBuffer () {
@@ -196,7 +198,7 @@ const EmojiPicker = {
id: 'standard',
text: this.$t('emoji.unicode'),
icon: 'box-open',
- emojis: filterByKeyword(standardEmojis, this.keyword)
+ emojis: filterByKeyword(standardEmojis, trim(this.keyword))
}
]
},
diff --git a/src/components/emoji_picker/emoji_picker.scss b/src/components/emoji_picker/emoji_picker.scss
index ec711758..2055e02e 100644
--- a/src/components/emoji_picker/emoji_picker.scss
+++ b/src/components/emoji_picker/emoji_picker.scss
@@ -7,7 +7,7 @@
right: 0;
left: 0;
margin: 0 !important;
- z-index: 1;
+ z-index: 100;
background-color: $fallback--bg;
background-color: var(--popover, $fallback--bg);
color: $fallback--link;
@@ -73,12 +73,13 @@
&-item {
padding: 0 7px;
cursor: pointer;
- font-size: 24px;
+ font-size: 1.85em;
&.disabled {
opacity: 0.5;
pointer-events: none;
}
+
&.active {
border-bottom: 4px solid;
@@ -151,9 +152,10 @@
justify-content: left;
&-title {
- font-size: 12px;
+ font-size: 0.85em;
width: 100%;
margin: 0;
+
&.disabled {
display: none;
}
diff --git a/src/components/emoji_picker/emoji_picker.vue b/src/components/emoji_picker/emoji_picker.vue
index 3262a3d9..a7269120 100644
--- a/src/components/emoji_picker/emoji_picker.vue
+++ b/src/components/emoji_picker/emoji_picker.vue
@@ -47,6 +47,7 @@
type="text"
class="form-control"
:placeholder="$t('emoji.search_emoji')"
+ @input="$event.target.composing = false"
>
</div>
<div
diff --git a/src/components/exporter/exporter.js b/src/components/exporter/exporter.js
index 51912ac3..fc75372e 100644
--- a/src/components/exporter/exporter.js
+++ b/src/components/exporter/exporter.js
@@ -15,18 +15,8 @@ const Exporter = {
type: String,
default: 'export.csv'
},
- exportButtonLabel: {
- type: String,
- default () {
- return this.$t('exporter.export')
- }
- },
- processingMessage: {
- type: String,
- default () {
- return this.$t('exporter.processing')
- }
- }
+ exportButtonLabel: { type: String },
+ processingMessage: { type: String }
},
data () {
return {
diff --git a/src/components/exporter/exporter.vue b/src/components/exporter/exporter.vue
index d6a03088..79defdf6 100644
--- a/src/components/exporter/exporter.vue
+++ b/src/components/exporter/exporter.vue
@@ -7,14 +7,14 @@
spin
/>
- <span>{{ processingMessage }}</span>
+ <span>{{ processingMessage || $t('exporter.processing') }}</span>
</div>
<button
v-else
class="btn button-default"
@click="process"
>
- {{ exportButtonLabel }}
+ {{ exportButtonLabel || $t('exporter.export') }}
</button>
</div>
</template>
diff --git a/src/components/font_control/font_control.js b/src/components/font_control/font_control.js
index 137ef9c0..92ee3f30 100644
--- a/src/components/font_control/font_control.js
+++ b/src/components/font_control/font_control.js
@@ -1,4 +1,4 @@
-import { set } from 'vue'
+import { set } from 'lodash'
import Select from '../select/select.vue'
export default {
@@ -6,11 +6,12 @@ export default {
Select
},
props: [
- 'name', 'label', 'value', 'fallback', 'options', 'no-inherit'
+ 'name', 'label', 'modelValue', 'fallback', 'options', 'no-inherit'
],
+ emits: ['update:modelValue'],
data () {
return {
- lValue: this.value,
+ lValue: this.modelValue,
availableOptions: [
this.noInherit ? '' : 'inherit',
'custom',
@@ -22,7 +23,7 @@ export default {
}
},
beforeUpdate () {
- this.lValue = this.value
+ this.lValue = this.modelValue
},
computed: {
present () {
@@ -37,7 +38,7 @@ export default {
},
set (v) {
set(this.lValue, 'family', v)
- this.$emit('input', this.lValue)
+ this.$emit('update:modelValue', this.lValue)
}
},
isCustom () {
diff --git a/src/components/font_control/font_control.vue b/src/components/font_control/font_control.vue
index 29605084..f100c3a9 100644
--- a/src/components/font_control/font_control.vue
+++ b/src/components/font_control/font_control.vue
@@ -15,13 +15,14 @@
class="opt exlcude-disabled"
type="checkbox"
:checked="present"
- @input="$emit('input', typeof value === 'undefined' ? fallback : undefined)"
+ @change="$emit('update:modelValue', typeof modelValue === 'undefined' ? fallback : undefined)"
>
<label
v-if="typeof fallback !== 'undefined'"
class="opt-l"
:for="name + '-o'"
/>
+ {{ ' ' }}
<Select
:id="name + '-font-switcher'"
v-model="preset"
diff --git a/src/components/gallery/gallery.js b/src/components/gallery/gallery.js
index 094b3e57..4e1bda55 100644
--- a/src/components/gallery/gallery.js
+++ b/src/components/gallery/gallery.js
@@ -1,5 +1,5 @@
import Attachment from '../attachment/attachment.vue'
-import { sumBy } from 'lodash'
+import { sumBy, set } from 'lodash'
const Gallery = {
props: [
@@ -85,7 +85,7 @@ const Gallery = {
},
methods: {
onNaturalSizeLoad ({ id, width, height }) {
- this.$set(this.sizes, id, { width, height })
+ set(this.sizes, id, { width, height })
},
rowStyle (row) {
if (row.audio) {
diff --git a/src/components/gallery/gallery.vue b/src/components/gallery/gallery.vue
index f2e1b5ce..ccf6e3e2 100644
--- a/src/components/gallery/gallery.vue
+++ b/src/components/gallery/gallery.vue
@@ -22,7 +22,6 @@
class="gallery-item"
:nsfw="nsfw"
:attachment="attachment"
- :allow-play="false"
:size="size"
:editable="editable"
:remove="removeAttachment"
diff --git a/src/components/global_notice_list/global_notice_list.vue b/src/components/global_notice_list/global_notice_list.vue
index a45f4586..ddc45b81 100644
--- a/src/components/global_notice_list/global_notice_list.vue
+++ b/src/components/global_notice_list/global_notice_list.vue
@@ -44,20 +44,18 @@
max-width: calc(100% - 3em);
display: flex;
padding-left: 1.5em;
- line-height: 2em;
+ line-height: 2;
+ margin-bottom: 0.5em;
+
.notice-message {
flex: 1 1 100%;
}
- i {
- flex: 0 0;
- width: 1.5em;
- cursor: pointer;
- }
}
.global-error {
background-color: var(--alertPopupError, $fallback--cRed);
color: var(--alertPopupErrorText, $fallback--text);
+
.svg-inline--fa {
color: var(--alertPopupErrorText, $fallback--text);
}
@@ -66,6 +64,7 @@
.global-warning {
background-color: var(--alertPopupWarning, $fallback--cOrange);
color: var(--alertPopupWarningText, $fallback--text);
+
.svg-inline--fa {
color: var(--alertPopupWarningText, $fallback--text);
}
diff --git a/src/components/image_cropper/image_cropper.js b/src/components/image_cropper/image_cropper.js
index e8d5ec6d..05f6fd4c 100644
--- a/src/components/image_cropper/image_cropper.js
+++ b/src/components/image_cropper/image_cropper.js
@@ -117,7 +117,7 @@ const ImageCropper = {
const fileInput = this.$refs.input
fileInput.addEventListener('change', this.readFile)
},
- beforeDestroy: function () {
+ beforeUnmount: function () {
// remove the event listeners
const trigger = this.getTriggerDOM()
if (trigger) {
diff --git a/src/components/importer/importer.js b/src/components/importer/importer.js
index 59f9beb1..da86a223 100644
--- a/src/components/importer/importer.js
+++ b/src/components/importer/importer.js
@@ -15,24 +15,9 @@ const Importer = {
type: Function,
required: true
},
- submitButtonLabel: {
- type: String,
- default () {
- return this.$t('importer.submit')
- }
- },
- successMessage: {
- type: String,
- default () {
- return this.$t('importer.success')
- }
- },
- errorMessage: {
- type: String,
- default () {
- return this.$t('importer.error')
- }
- }
+ submitButtonLabel: { type: String },
+ successMessage: { type: String },
+ errorMessage: { type: String }
},
data () {
return {
diff --git a/src/components/importer/importer.vue b/src/components/importer/importer.vue
index 210823f5..2a63b31a 100644
--- a/src/components/importer/importer.vue
+++ b/src/components/importer/importer.vue
@@ -18,21 +18,31 @@
class="btn button-default"
@click="submit"
>
- {{ submitButtonLabel }}
+ {{ submitButtonLabel || $t('importer.submit') }}
</button>
<div v-if="success">
- <FAIcon
- icon="times"
+ <button
+ class="button-unstyled"
@click="dismiss"
- />
- <p>{{ successMessage }}</p>
+ >
+ <FAIcon
+ icon="times"
+ />
+ </button>
+ {{ ' ' }}
+ <span>{{ successMessage || $t('importer.success') }}</span>
</div>
<div v-else-if="error">
- <FAIcon
- icon="times"
+ <button
+ class="button-unstyled"
@click="dismiss"
- />
- <p>{{ errorMessage }}</p>
+ >
+ <FAIcon
+ icon="times"
+ />
+ </button>
+ {{ ' ' }}
+ <span>{{ errorMessage || $t('importer.error') }}</span>
</div>
</div>
</template>
diff --git a/src/components/interactions/interactions.js b/src/components/interactions/interactions.js
index 53ec7d49..95087eac 100644
--- a/src/components/interactions/interactions.js
+++ b/src/components/interactions/interactions.js
@@ -1,4 +1,5 @@
import Notifications from '../notifications/notifications.vue'
+import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
const tabModeDict = {
mentions: ['mention'],
@@ -23,7 +24,8 @@ const Interactions = {
}
},
components: {
- Notifications
+ Notifications,
+ TabSwitcher
}
}
diff --git a/src/components/interface_language_switcher/interface_language_switcher.vue b/src/components/interface_language_switcher/interface_language_switcher.vue
index cf307a24..7ad1fe2e 100644
--- a/src/components/interface_language_switcher/interface_language_switcher.vue
+++ b/src/components/interface_language_switcher/interface_language_switcher.vue
@@ -1,11 +1,12 @@
<template>
<div>
<label for="interface-language-switcher">
- {{ $t('settings.interfaceLanguage') }}
+ {{ promptText }}
</label>
+ {{ ' ' }}
<Select
id="interface-language-switcher"
- v-model="language"
+ v-model="controlledLanguage"
>
<option
v-for="lang in languages"
@@ -19,39 +20,43 @@
</template>
<script>
-import languagesObject from '../../i18n/messages'
import localeService from '../../services/locale/locale.service.js'
-import ISO6391 from 'iso-639-1'
-import _ from 'lodash'
import Select from '../select/select.vue'
export default {
components: {
Select
},
+ props: {
+ promptText: {
+ type: String,
+ required: true
+ },
+ language: {
+ type: String,
+ required: true
+ },
+ setLanguage: {
+ type: Function,
+ required: true
+ }
+ },
computed: {
languages () {
- return _.map(languagesObject.languages, (code) => ({ code: code, name: this.getLanguageName(code) })).sort((a, b) => a.name.localeCompare(b.name))
+ return localeService.languages
},
- language: {
- get: function () { return this.$store.getters.mergedConfig.interfaceLanguage },
+ controlledLanguage: {
+ get: function () { return this.language },
set: function (val) {
- this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
+ this.setLanguage(val)
}
}
},
methods: {
getLanguageName (code) {
- const specialLanguageNames = {
- 'ja_easy': 'やさしいにほんご',
- 'zh': '简体中文',
- 'zh_Hant': '繁體中文'
- }
- const languageName = specialLanguageNames[code] || ISO6391.getNativeName(code)
- const browserLocale = localeService.internalToBrowserLocale(code)
- return languageName.charAt(0).toLocaleUpperCase(browserLocale) + languageName.slice(1)
+ return localeService.getLanguageName(code)
}
}
}
diff --git a/src/components/link-preview/link-preview.vue b/src/components/link-preview/link-preview.vue
index d3ca39b8..220527f2 100644
--- a/src/components/link-preview/link-preview.vue
+++ b/src/components/link-preview/link-preview.vue
@@ -63,7 +63,7 @@
}
.card-host {
- font-size: 12px;
+ font-size: 0.85em;
}
.card-description {
diff --git a/src/components/login_form/login_form.vue b/src/components/login_form/login_form.vue
index bfabb946..21482977 100644
--- a/src/components/login_form/login_form.vue
+++ b/src/components/login_form/login_form.vue
@@ -76,11 +76,15 @@
>
<div class="alert error">
{{ error }}
- <FAIcon
- class="fa-scale-110 fa-old-padding"
- icon="times"
+ <button
+ class="button-unstyled"
@click="clearError"
- />
+ >
+ <FAIcon
+ class="fa-scale-110 fa-old-padding"
+ icon="times"
+ />
+ </button>
</div>
</div>
</div>
@@ -97,7 +101,7 @@
padding: 0.6em;
.btn {
- min-height: 28px;
+ min-height: 2em;
width: 10em;
}
diff --git a/src/components/media_modal/media_modal.js b/src/components/media_modal/media_modal.js
index 01a90377..ff993664 100644
--- a/src/components/media_modal/media_modal.js
+++ b/src/components/media_modal/media_modal.js
@@ -142,7 +142,7 @@ const MediaModal = {
document.addEventListener('keyup', this.handleKeyupEvent)
document.addEventListener('keydown', this.handleKeydownEvent)
},
- destroyed () {
+ unmounted () {
window.removeEventListener('popstate', this.hide)
document.removeEventListener('keyup', this.handleKeyupEvent)
document.removeEventListener('keydown', this.handleKeydownEvent)
diff --git a/src/components/media_modal/media_modal.vue b/src/components/media_modal/media_modal.vue
index 708a43c6..8b76aafb 100644
--- a/src/components/media_modal/media_modal.vue
+++ b/src/components/media_modal/media_modal.vue
@@ -121,7 +121,7 @@ $modal-view-button-icon-width: 3em;
$modal-view-button-icon-margin: 0.5em;
.modal-view.media-modal-view {
- z-index: 1001;
+ z-index: 9000;
flex-direction: column;
.modal-view-button-arrow,
@@ -234,7 +234,7 @@ $modal-view-button-icon-margin: 0.5em;
position: absolute;
height: $modal-view-button-icon-height;
width: $modal-view-button-icon-width;
- font-size: 14px;
+ font-size: 1rem;
line-height: $modal-view-button-icon-height;
color: #FFF;
text-align: center;
diff --git a/src/components/media_upload/media_upload.vue b/src/components/media_upload/media_upload.vue
index e955aa72..7cc59f5a 100644
--- a/src/components/media_upload/media_upload.vue
+++ b/src/components/media_upload/media_upload.vue
@@ -17,9 +17,9 @@
/>
<input
v-if="uploadReady"
+ class="hidden-input-file"
:disabled="disabled"
type="file"
- style="position: fixed; top: -100em"
multiple="true"
@change="change"
>
@@ -32,6 +32,10 @@
@import '../../_variables.scss';
.media-upload {
- cursor: pointer;
+ cursor: pointer; // We use <label> for interactivity... i wonder if it's fine
+
+ .hidden-input-file {
+ display: none;
+ }
}
</style>
diff --git a/src/components/mention_link/mention_link.vue b/src/components/mention_link/mention_link.vue
index 3562f511..022f04c7 100644
--- a/src/components/mention_link/mention_link.vue
+++ b/src/components/mention_link/mention_link.vue
@@ -41,10 +41,12 @@
class="serverName"
:class="{ '-faded': shouldFadeDomain }"
v-html="'@' + serverName"
- /></span><span
+ />
+ </span>
+ <span
v-if="isYou && shouldShowYous"
:class="{ '-you': shouldBoldenYou }"
- > {{ $t('status.you') }}</span>
+ > {{ ' ' + $t('status.you') }}</span>
<!-- eslint-enable vue/no-v-html -->
</a><span
v-if="shouldShowTooltip"
diff --git a/src/components/mentions_line/mentions_line.vue b/src/components/mentions_line/mentions_line.vue
index f375e3b0..09b6a1d6 100644
--- a/src/components/mentions_line/mentions_line.vue
+++ b/src/components/mentions_line/mentions_line.vue
@@ -6,7 +6,6 @@
class="mention-link"
:content="mention.content"
:url="mention.url"
- :first-mention="false"
/><span
v-if="manyMentions"
class="extraMentions"
@@ -21,7 +20,6 @@
class="mention-link"
:content="mention.content"
:url="mention.url"
- :first-mention="false"
/>
</span><button
v-if="!expanded"
diff --git a/src/components/mfa_form/recovery_form.vue b/src/components/mfa_form/recovery_form.vue
index 7c594228..a9cf39aa 100644
--- a/src/components/mfa_form/recovery_form.vue
+++ b/src/components/mfa_form/recovery_form.vue
@@ -56,11 +56,15 @@
>
<div class="alert error">
{{ error }}
- <FAIcon
- class="fa-scale-110 fa-old-padding"
- icon="times"
+ <button
+ class="button-unstyled"
@click="clearError"
- />
+ >
+ <FAIcon
+ class="fa-scale-110 fa-old-padding"
+ icon="times"
+ />
+ </button>
</div>
</div>
</div>
diff --git a/src/components/mfa_form/totp_form.vue b/src/components/mfa_form/totp_form.vue
index 4ee13992..709eb9b8 100644
--- a/src/components/mfa_form/totp_form.vue
+++ b/src/components/mfa_form/totp_form.vue
@@ -58,12 +58,16 @@
>
<div class="alert error">
{{ error }}
- <FAIcon
- size="lg"
- class="fa-scale-110 fa-old-padding"
- icon="times"
+ <button
+ class="button-unstyled"
@click="clearError"
- />
+ >
+ <FAIcon
+ size="lg"
+ class="fa-scale-110 fa-old-padding"
+ icon="times"
+ />
+ </button>
</div>
</div>
</div>
diff --git a/src/components/mobile_nav/mobile_nav.js b/src/components/mobile_nav/mobile_nav.js
index 9e736cfb..877d52a9 100644
--- a/src/components/mobile_nav/mobile_nav.js
+++ b/src/components/mobile_nav/mobile_nav.js
@@ -78,7 +78,8 @@ const MobileNav = {
this.$store.dispatch('logout')
},
markNotificationsAsSeen () {
- this.$refs.notifications.markAsSeen()
+ // this.$refs.notifications.markAsSeen()
+ this.$store.dispatch('markNotificationsAsSeen')
},
onScroll ({ target: { scrollTop, clientHeight, scrollHeight } }) {
if (scrollTop + clientHeight >= scrollHeight) {
diff --git a/src/components/mobile_nav/mobile_nav.vue b/src/components/mobile_nav/mobile_nav.vue
index 0f0ea457..d2d48a03 100644
--- a/src/components/mobile_nav/mobile_nav.vue
+++ b/src/components/mobile_nav/mobile_nav.vue
@@ -5,7 +5,6 @@
<nav
id="nav"
class="mobile-nav"
- :class="{ 'mobile-hidden': isChat }"
@click="scrollToTop()"
>
<div class="item">
@@ -51,7 +50,7 @@
<div
v-if="currentUser"
class="mobile-notifications-drawer"
- :class="{ 'closed': !notificationsOpen }"
+ :class="{ '-closed': !notificationsOpen }"
@touchstart.stop="notificationsTouchStart"
@touchmove.stop="notificationsTouchMove"
>
@@ -69,12 +68,9 @@
</div>
<div
class="mobile-notifications"
+ id="mobile-notifications"
@scroll="onScroll"
>
- <Notifications
- ref="notifications"
- :no-heading="true"
- />
</div>
</div>
<SideDrawer
@@ -92,13 +88,14 @@
.MobileNav {
.mobile-nav {
display: grid;
- line-height: 50px;
- height: 50px;
+ line-height: var(--navbar-height);
grid-template-rows: 50px;
grid-template-columns: 2fr auto;
width: 100%;
- position: fixed;
box-sizing: border-box;
+ a {
+ color: var(--topBarLink, $fallback--link);
+ }
}
.mobile-inner-nav {
@@ -153,8 +150,9 @@
z-index: 1001;
-webkit-overflow-scrolling: touch;
- &.closed {
+ &.-closed {
transform: translateX(100%);
+ box-shadow: none;
}
}
@@ -182,7 +180,7 @@
.mobile-notifications {
margin-top: 50px;
width: 100vw;
- height: calc(100vh - 50px);
+ height: calc(100vh - var(--navbar-height));
overflow-x: hidden;
overflow-y: scroll;
diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.js b/src/components/mobile_post_status_button/mobile_post_status_button.js
index d27fb3b8..ecf79b64 100644
--- a/src/components/mobile_post_status_button/mobile_post_status_button.js
+++ b/src/components/mobile_post_status_button/mobile_post_status_button.js
@@ -29,7 +29,7 @@ const MobilePostStatusButton = {
}
window.addEventListener('resize', this.handleOSK)
},
- destroyed () {
+ unmounted () {
if (this.autohideFloatingPostButton) {
this.deactivateFloatingPostButtonAutohide()
}
@@ -45,7 +45,7 @@ const MobilePostStatusButton = {
return this.autohideFloatingPostButton && (this.hidden || this.inputActive)
},
isPersistent () {
- return !!this.$store.getters.mergedConfig.showNewPostButton
+ return !!this.$store.getters.mergedConfig.alwaysShowNewPostButton
},
autohideFloatingPostButton () {
return !!this.$store.getters.mergedConfig.autohideFloatingPostButton
diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.vue b/src/components/mobile_post_status_button/mobile_post_status_button.vue
index 37becf4c..9fcdf6f8 100644
--- a/src/components/mobile_post_status_button/mobile_post_status_button.vue
+++ b/src/components/mobile_post_status_button/mobile_post_status_button.vue
@@ -1,13 +1,12 @@
<template>
- <div v-if="isLoggedIn">
- <button
- class="button-default new-status-button"
- :class="{ 'hidden': isHidden, 'always-show': isPersistent }"
- @click="openPostForm"
- >
- <FAIcon icon="pen" />
- </button>
- </div>
+ <button
+ v-if="isLoggedIn"
+ class="MobilePostButton button-default new-status-button"
+ :class="{ 'hidden': isHidden, 'always-show': isPersistent }"
+ @click="openPostForm"
+ >
+ <FAIcon icon="pen" />
+ </button>
</template>
<script src="./mobile_post_status_button.js"></script>
@@ -15,25 +14,27 @@
<style lang="scss">
@import '../../_variables.scss';
-.new-status-button {
- width: 5em;
- height: 5em;
- border-radius: 100%;
- position: fixed;
- bottom: 1.5em;
- right: 1.5em;
- // TODO: this needs its own color, it has to stand out enough and link color
- // is not very optimal for this particular use.
- background-color: $fallback--fg;
- background-color: var(--btn, $fallback--fg);
- display: flex;
- justify-content: center;
- align-items: center;
- box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3), 0px 4px 6px rgba(0, 0, 0, 0.3);
- z-index: 10;
-
- transition: 0.35s transform;
- transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
+.MobilePostButton {
+ &.button-default {
+ width: 5em;
+ height: 5em;
+ border-radius: 100%;
+ position: fixed;
+ bottom: 1.5em;
+ right: 1.5em;
+ // TODO: this needs its own color, it has to stand out enough and link color
+ // is not very optimal for this particular use.
+ background-color: $fallback--fg;
+ background-color: var(--btn, $fallback--fg);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3), 0px 4px 6px rgba(0, 0, 0, 0.3);
+ z-index: 10;
+
+ transition: 0.35s transform;
+ transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
+ }
&.hidden {
transform: translateY(150%);
diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue
index 2b58913f..9394efff 100644
--- a/src/components/modal/modal.vue
+++ b/src/components/modal/modal.vue
@@ -35,7 +35,7 @@ export default {
<style lang="scss">
.modal-view {
- z-index: 1000;
+ z-index: 2000;
position: fixed;
top: 0;
left: 0;
diff --git a/src/components/moderation_tools/moderation_tools.vue b/src/components/moderation_tools/moderation_tools.vue
index 96476abe..96b8c3a3 100644
--- a/src/components/moderation_tools/moderation_tools.vue
+++ b/src/components/moderation_tools/moderation_tools.vue
@@ -132,7 +132,7 @@
</button>
</template>
</Popover>
- <portal to="modal">
+ <teleport to="#modal">
<DialogModal
v-if="showDeleteUserDialog"
:on-cancel="deleteUserDialog.bind(this, false)"
@@ -156,7 +156,7 @@
</button>
</template>
</DialogModal>
- </portal>
+ </teleport>
</div>
</template>
diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue
index e10eff00..ebbe5f95 100644
--- a/src/components/notification/notification.vue
+++ b/src/components/notification/notification.vue
@@ -33,7 +33,7 @@
>
<a
class="avatar-container"
- :href="notification.from_profile.statusnet_profile_url"
+ :href="$router.resolve(userProfileLink).href"
@click.stop.prevent.capture="toggleUserExpanded"
>
<UserAvatar
@@ -65,12 +65,16 @@
v-else
class="username"
:title="'@'+notification.from_profile.screen_name_ui"
- >{{ notification.from_profile.name }}</span>
+ >
+ {{ notification.from_profile.name }}
+ </span>
+ {{ ' ' }}
<span v-if="notification.type === 'like'">
<FAIcon
class="type-icon"
icon="star"
/>
+ {{ ' ' }}
<small>{{ $t('notifications.favorited_you') }}</small>
</span>
<span v-if="notification.type === 'repeat'">
@@ -79,6 +83,7 @@
icon="retweet"
:title="$t('tool_tip.repeat')"
/>
+ {{ ' ' }}
<small>{{ $t('notifications.repeated_you') }}</small>
</span>
<span v-if="notification.type === 'follow'">
@@ -86,6 +91,7 @@
class="type-icon"
icon="user-plus"
/>
+ {{ ' ' }}
<small>{{ $t('notifications.followed_you') }}</small>
</span>
<span v-if="notification.type === 'follow_request'">
@@ -93,6 +99,7 @@
class="type-icon"
icon="user"
/>
+ {{ ' ' }}
<small>{{ $t('notifications.follow_request') }}</small>
</span>
<span v-if="notification.type === 'move'">
@@ -100,18 +107,30 @@
class="type-icon"
icon="suitcase-rolling"
/>
+ {{ ' ' }}
<small>{{ $t('notifications.migrated_to') }}</small>
</span>
<span v-if="notification.type === 'pleroma:emoji_reaction'">
<small>
- <i18n path="notifications.reacted_with">
+ <i18n-t
+ scope="global"
+ keypath="notifications.reacted_with"
+ >
<span class="emoji-reaction-emoji">{{ notification.emoji }}</span>
- </i18n>
+ </i18n-t>
</small>
</span>
<span v-if="notification.type === 'pleroma:report'">
<small>{{ $t('notifications.submitted_report') }}</small>
</span>
+ <span v-if="notification.type === 'poll'">
+ <FAIcon
+ class="type-icon"
+ icon="poll-h"
+ />
+ {{ ' ' }}
+ <small>{{ $t('notifications.poll_ended') }}</small>
+ </span>
</div>
<div
v-if="isStatusNotification"
@@ -164,18 +183,26 @@
v-if="notification.type === 'follow_request'"
style="white-space: nowrap;"
>
- <FAIcon
- icon="check"
- class="fa-scale-110 fa-old-padding follow-request-accept"
+ <button
+ class="button-unstyled"
:title="$t('tool_tip.accept_follow_request')"
@click="approveUser()"
- />
- <FAIcon
- icon="times"
- class="fa-scale-110 fa-old-padding follow-request-reject"
+ >
+ <FAIcon
+ icon="check"
+ class="fa-scale-110 fa-old-padding follow-request-accept"
+ />
+ </button>
+ <button
+ class="button-unstyled"
:title="$t('tool_tip.reject_follow_request')"
@click="denyUser()"
- />
+ >
+ <FAIcon
+ icon="times"
+ class="fa-scale-110 fa-old-padding follow-request-reject"
+ />
+ </button>
</div>
</div>
<div
diff --git a/src/components/notifications/notification_filters.vue b/src/components/notifications/notification_filters.vue
index ba0e90a0..00a531b3 100644
--- a/src/components/notifications/notification_filters.vue
+++ b/src/components/notifications/notification_filters.vue
@@ -61,10 +61,19 @@
:class="{ 'menu-checkbox-checked': filters.moves }"
/>{{ $t('settings.notification_visibility_moves') }}
</button>
+ <button
+ class="button-default dropdown-item"
+ @click="toggleNotificationFilter('polls')"
+ >
+ <span
+ class="menu-checkbox"
+ :class="{ 'menu-checkbox-checked': filters.polls }"
+ />{{ $t('settings.notification_visibility_polls') }}
+ </button>
</div>
</template>
<template v-slot:trigger>
- <button class="button-unstyled">
+ <button class="filter-trigger-button button-unstyled">
<FAIcon icon="filter" />
</button>
</template>
@@ -107,15 +116,14 @@ export default {
align-self: stretch;
> button {
- font-size: 1.2em;
- padding-left: 0.7em;
- padding-right: 0.2em;
line-height: 100%;
height: 100%;
- }
+ width: var(--__panel-heading-height-inner);
+ text-align: center;
- .dropdown-item {
- margin: 0;
+ svg {
+ font-size: 1.2em;
+ }
}
}
diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js
index c8f1ebcb..82aa1489 100644
--- a/src/components/notifications/notifications.js
+++ b/src/components/notifications/notifications.js
@@ -23,13 +23,13 @@ const Notifications = {
NotificationFilters
},
props: {
- // Disables display of panel header
- noHeading: Boolean,
// Disables panel styles, unread mark, potentially other notification-related actions
// meant for "Interactions" timeline
minimalMode: Boolean,
// Custom filter mode, an array of strings, possible values 'mention', 'repeat', 'like', 'follow', used to override global filter for use in "Interactions" timeline
- filterMode: Array
+ filterMode: Array,
+ // Disable teleporting (i.e. for /users/user/notifications)
+ disableTeleport: Boolean
},
data () {
return {
@@ -65,6 +65,18 @@ const Notifications = {
loading () {
return this.$store.state.statuses.notifications.loading
},
+ noHeading () {
+ const { layoutType } = this.$store.state.interface
+ return this.minimalMode || layoutType === 'mobile'
+ },
+ teleportTarget () {
+ const { layoutType } = this.$store.state.interface
+ const map = {
+ wide: '#notifs-column',
+ mobile: '#mobile-notifications'
+ }
+ return map[layoutType] || '#notifs-sidebar'
+ },
notificationsToDisplay () {
return this.filteredNotifications.slice(0, this.unseenCount + this.seenToDisplayCount)
},
diff --git a/src/components/notifications/notifications.scss b/src/components/notifications/notifications.scss
index 47c035f1..f71f9b76 100644
--- a/src/components/notifications/notifications.scss
+++ b/src/components/notifications/notifications.scss
@@ -11,10 +11,6 @@
color: var(--text, $fallback--text);
}
- .notifications-footer {
- border: none;
- }
-
.notification {
position: relative;
@@ -47,6 +43,10 @@
}
}
+ &:last-child .Notification {
+ border-bottom: none;
+ }
+
.non-mention {
display: flex;
flex: 1;
@@ -66,8 +66,6 @@
}
.follow-request-accept {
- cursor: pointer;
-
&:hover {
color: $fallback--text;
color: var(--text, $fallback--text);
@@ -75,8 +73,6 @@
}
.follow-request-reject {
- cursor: pointer;
-
&:hover {
color: $fallback--cRed;
color: var(--cRed, $fallback--cRed);
@@ -119,13 +115,13 @@
}
.emoji-reaction-emoji {
- font-size: 16px;
+ font-size: 1.3em;
}
.notification-details {
- min-width: 0px;
+ min-width: 0;
word-wrap: break-word;
- line-height:18px;
+ line-height: var(--post-line-height);
position: relative;
overflow: hidden;
width: 100%;
@@ -148,7 +144,7 @@
}
.timeago {
- margin-right: .2em;
+ margin-right: 0.2em;
}
.status-content {
@@ -161,7 +157,8 @@
margin: 0 0 0.3em;
padding: 0;
font-size: 1em;
- line-height:20px;
+ line-height: 1.5;
+
small {
font-weight: lighter;
}
diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue
index 2ce5d56f..b46c06aa 100644
--- a/src/components/notifications/notifications.vue
+++ b/src/components/notifications/notifications.vue
@@ -1,69 +1,71 @@
<template>
- <div
- :class="{ minimal: minimalMode }"
- class="Notifications"
- >
- <div :class="mainClass">
- <div
- v-if="!noHeading"
- class="panel-heading"
- >
- <div class="title">
- {{ $t('notifications.notifications') }}
- <span
- v-if="unseenCount"
- class="badge badge-notification unseen-count"
- >{{ unseenCount }}</span>
- </div>
- <button
- v-if="unseenCount"
- class="button-default read-button"
- @click.prevent="markAsSeen"
- >
- {{ $t('notifications.read') }}
- </button>
- <NotificationFilters />
- </div>
- <div class="panel-body">
+ <teleport :disabled="minimalMode || disableTeleport" :to="teleportTarget">
+ <div
+ :class="{ minimal: minimalMode }"
+ class="Notifications"
+ >
+ <div :class="mainClass">
<div
- v-for="notification in notificationsToDisplay"
- :key="notification.id"
- class="notification"
- :class="{&quot;unseen&quot;: !minimalMode && !notification.seen}"
+ v-if="!noHeading"
+ class="notifications-heading panel-heading -sticky"
>
- <div class="notification-overlay" />
- <notification :notification="notification" />
+ <div class="title">
+ {{ $t('notifications.notifications') }}
+ <span
+ v-if="unseenCount"
+ class="badge badge-notification unseen-count"
+ >{{ unseenCount }}</span>
+ </div>
+ <button
+ v-if="unseenCount"
+ class="button-default read-button"
+ @click.prevent="markAsSeen"
+ >
+ {{ $t('notifications.read') }}
+ </button>
+ <NotificationFilters />
</div>
- </div>
- <div class="panel-footer notifications-footer">
- <div
- v-if="bottomedOut"
- class="new-status-notification text-center faint"
- >
- {{ $t('notifications.no_more_notifications') }}
+ <div class="panel-body">
+ <div
+ v-for="notification in notificationsToDisplay"
+ :key="notification.id"
+ class="notification"
+ :class="{unseen: !minimalMode && !notification.seen}"
+ >
+ <div class="notification-overlay" />
+ <notification :notification="notification" />
+ </div>
</div>
- <button
- v-else-if="!loading"
- class="button-unstyled -link -fullwidth"
- @click.prevent="fetchOlderNotifications()"
- >
- <div class="new-status-notification text-center">
- {{ minimalMode ? $t('interactions.load_older') : $t('notifications.load_older') }}
+ <div class="panel-footer">
+ <div
+ v-if="bottomedOut"
+ class="new-status-notification text-center faint"
+ >
+ {{ $t('notifications.no_more_notifications') }}
+ </div>
+ <button
+ v-else-if="!loading"
+ class="button-unstyled -link -fullwidth"
+ @click.prevent="fetchOlderNotifications()"
+ >
+ <div class="new-status-notification text-center">
+ {{ minimalMode ? $t('interactions.load_older') : $t('notifications.load_older') }}
+ </div>
+ </button>
+ <div
+ v-else
+ class="new-status-notification text-center"
+ >
+ <FAIcon
+ icon="circle-notch"
+ spin
+ size="lg"
+ />
</div>
- </button>
- <div
- v-else
- class="new-status-notification text-center"
- >
- <FAIcon
- icon="circle-notch"
- spin
- size="lg"
- />
</div>
</div>
</div>
- </div>
+ </teleport>
</template>
<script src="./notifications.js"></script>
diff --git a/src/components/opacity_input/opacity_input.vue b/src/components/opacity_input/opacity_input.vue
index 3cc3942b..15d08e04 100644
--- a/src/components/opacity_input/opacity_input.vue
+++ b/src/components/opacity_input/opacity_input.vue
@@ -11,21 +11,21 @@
</label>
<Checkbox
v-if="typeof fallback !== 'undefined'"
- :checked="present"
+ :model-value="present"
:disabled="disabled"
class="opt"
- @change="$emit('input', !present ? fallback : undefined)"
+ @update:modelValue="$emit('update:modelValue', !present ? fallback : undefined)"
/>
<input
:id="name"
class="input-number"
type="number"
- :value="value || fallback"
+ :value="modelValue || fallback"
:disabled="!present || disabled"
max="1"
min="0"
step=".05"
- @input="$emit('input', $event.target.value)"
+ @input="$emit('update:modelValue', $event.target.value)"
>
</div>
</template>
@@ -37,11 +37,12 @@ export default {
Checkbox
},
props: [
- 'name', 'value', 'fallback', 'disabled'
+ 'name', 'modelValue', 'fallback', 'disabled'
],
+ emits: ['update:modelValue'],
computed: {
present () {
- return typeof this.value !== 'undefined'
+ return typeof this.modelValue !== 'undefined'
}
}
}
diff --git a/src/components/password_reset/password_reset.vue b/src/components/password_reset/password_reset.vue
index 3ffa5425..90673f44 100644
--- a/src/components/password_reset/password_reset.vue
+++ b/src/components/password_reset/password_reset.vue
@@ -91,14 +91,18 @@
flex-direction: column;
margin-top: 0.6em;
max-width: 18rem;
+
+ > * {
+ min-width: 0;
+ }
}
.form-group {
display: flex;
flex-direction: column;
margin-bottom: 1em;
- padding: 0.3em 0.0em 0.3em;
- line-height: 24px;
+ padding: 0.3em 0;
+ line-height: 1.85em;
}
.error {
@@ -110,7 +114,7 @@
.alert {
padding: 0.5em;
- margin: 0.3em 0.0em 1em;
+ margin: 0.3em 0 1em;
}
.password-reset-required {
diff --git a/src/components/poll/poll.js b/src/components/poll/poll.js
index a69b7886..eda1733a 100644
--- a/src/components/poll/poll.js
+++ b/src/components/poll/poll.js
@@ -21,7 +21,7 @@ export default {
}
this.$store.dispatch('trackPoll', this.pollId)
},
- destroyed () {
+ unmounted () {
this.$store.dispatch('untrackPoll', this.pollId)
},
computed: {
diff --git a/src/components/poll/poll.vue b/src/components/poll/poll.vue
index 63b44e4f..f6b12a54 100644
--- a/src/components/poll/poll.vue
+++ b/src/components/poll/poll.vue
@@ -71,13 +71,18 @@
{{ $tc("polls.votes_count", poll.votes_count, { count: poll.votes_count }) }}&nbsp;·&nbsp;
</template>
</div>
- <i18n :path="expired ? 'polls.expired' : 'polls.expires_in'">
- <Timeago
- :time="expiresAt"
- :auto-update="60"
- :now-threshold="0"
- />
- </i18n>
+ <span>
+ <i18n-t
+ scope="global"
+ :keypath="expired ? 'polls.expired' : 'polls.expires_in'"
+ >
+ <Timeago
+ :time="expiresAt"
+ :auto-update="60"
+ :now-threshold="0"
+ />
+ </i18n-t>
+ </span>
</div>
</div>
</template>
diff --git a/src/components/poll/poll_form.vue b/src/components/poll/poll_form.vue
index 3620075a..f269d60e 100644
--- a/src/components/poll/poll_form.vue
+++ b/src/components/poll/poll_form.vue
@@ -72,6 +72,7 @@
:max="maxExpirationInCurrentUnit"
@change="expiryAmountChange"
>
+ {{ ' ' }}
<Select
v-model="expiryUnit"
unstyled="true"
diff --git a/src/components/popover/popover.js b/src/components/popover/popover.js
index 6ccf32f0..a30a37c9 100644
--- a/src/components/popover/popover.js
+++ b/src/components/popover/popover.js
@@ -178,7 +178,7 @@ const Popover = {
created () {
document.addEventListener('click', this.onClickOutside)
},
- destroyed () {
+ unmounted () {
document.removeEventListener('click', this.onClickOutside)
this.hidePopover()
}
diff --git a/src/components/popover/popover.vue b/src/components/popover/popover.vue
index 8588b351..c2a3e801 100644
--- a/src/components/popover/popover.vue
+++ b/src/components/popover/popover.vue
@@ -5,7 +5,7 @@
>
<button
ref="trigger"
- class="button-unstyled -fullwidth popover-trigger-button"
+ class="button-unstyled popover-trigger-button"
type="button"
@click="onClick"
>
@@ -37,7 +37,7 @@
}
.popover {
- z-index: 8;
+ z-index: 500;
position: absolute;
min-width: 0;
}
@@ -45,8 +45,19 @@
.popover-default {
transition: opacity 0.3s;
- box-shadow: 1px 1px 4px rgba(0,0,0,.6);
- box-shadow: var(--panelShadow);
+ &:after {
+ content: '';
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ z-index: 3;
+ box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
+ box-shadow: var(--panelShadow);
+ pointer-events: none;
+ }
+
border-radius: $fallback--btnRadius;
border-radius: var(--btnRadius, $fallback--btnRadius);
@@ -65,11 +76,11 @@
.dropdown-menu {
display: block;
padding: .5rem 0;
- font-size: 1rem;
+ font-size: 1em;
text-align: left;
list-style: none;
max-width: 100vw;
- z-index: 10;
+ z-index: 200;
white-space: nowrap;
.dropdown-divider {
@@ -82,9 +93,9 @@
.dropdown-item {
line-height: 21px;
- overflow: auto;
+ overflow: hidden;
display: block;
- padding: .5em 0.75em;
+ padding: 0.5em 0.75em;
clear: both;
font-weight: 400;
text-align: inherit;
@@ -110,14 +121,15 @@
&:active, &:hover {
background-color: $fallback--lightBg;
background-color: var(--selectedMenuPopover, $fallback--lightBg);
- color: $fallback--link;
- color: var(--selectedMenuPopoverText, $fallback--link);
+ box-shadow: none;
+ --btnText: var(--selectedMenuPopoverText, $fallback--link);
--faint: var(--selectedMenuPopoverFaintText, $fallback--faint);
--faintLink: var(--selectedMenuPopoverFaintLink, $fallback--faint);
--lightText: var(--selectedMenuPopoverLightText, $fallback--lightText);
--icon: var(--selectedMenuPopoverIcon, $fallback--icon);
svg {
color: var(--selectedMenuPopoverIcon, $fallback--icon);
+ --icon: var(--selectedMenuPopoverIcon, $fallback--icon);
}
}
@@ -142,12 +154,41 @@
content: '✓';
}
- &.menu-checkbox-radio::after {
- font-size: 2em;
- content: '•';
+ &.-radio {
+ border-radius: 9999px;
+
+ &.menu-checkbox-checked::after {
+ font-size: 2em;
+ content: '•';
+ }
}
}
}
+
+ .button-default.dropdown-item {
+ &,
+ i[class*=icon-] {
+ color: $fallback--text;
+ color: var(--btnText, $fallback--text);
+ }
+
+ &:active {
+ background-color: $fallback--lightBg;
+ background-color: var(--selectedMenuPopover, $fallback--lightBg);
+ color: $fallback--link;
+ color: var(--selectedMenuPopoverText, $fallback--link);
+ }
+
+ &:disabled {
+ color: $fallback--text;
+ color: var(--btnDisabledText, $fallback--text);
+ }
+
+ &.toggled {
+ color: $fallback--text;
+ color: var(--btnToggledText, $fallback--text);
+ }
+ }
}
</style>
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index fe07309f..2febf226 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -78,6 +78,12 @@ const PostStatusForm = {
'emojiPickerPlacement',
'optimisticPosting'
],
+ emits: [
+ 'posted',
+ 'resize',
+ 'mediaplay',
+ 'mediapause'
+ ],
components: {
MediaUpload,
EmojiInput,
@@ -480,7 +486,7 @@ const PostStatusForm = {
const bottomBottomPaddingStr = window.getComputedStyle(bottomRef)['padding-bottom']
const bottomBottomPadding = pxStringToNumber(bottomBottomPaddingStr)
- const scrollerRef = this.$el.closest('.sidebar-scroller') ||
+ const scrollerRef = this.$el.closest('.column.-scrollable') ||
this.$el.closest('.post-form-modal-view') ||
window
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index 2e0980a2..62613bd1 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -8,21 +8,13 @@
@submit.prevent
@dragover.prevent="fileDrag"
>
- <div
- v-show="showDropIcon !== 'hide'"
- :style="{ animation: showDropIcon === 'show' ? 'fade-in 0.25s' : 'fade-out 0.5s' }"
- class="drop-indicator"
- @dragleave="fileDragStop"
- @drop.stop="fileDrop"
- >
- <FAIcon :icon="uploadFileLimitReached ? 'ban' : 'upload'" />
- </div>
<div class="form-group">
- <i18n
+ <i18n-t
v-if="!$store.state.users.currentUser.locked && newStatus.visibility == 'private' && !disableLockWarning"
- path="post_status.account_not_locked_warning"
+ keypath="post_status.account_not_locked_warning"
tag="p"
class="visibility-notice"
+ scope="global"
>
<button
class="button-unstyled -link"
@@ -30,7 +22,7 @@
>
{{ $t('post_status.account_not_locked_warning_link') }}
</button>
- </i18n>
+ </i18n-t>
<p
v-if="!hideScopeNotice && newStatus.visibility === 'public'"
class="visibility-notice notice-dismissible"
@@ -277,15 +269,28 @@
</button>
</div>
<div
+ v-show="showDropIcon !== 'hide'"
+ :style="{ animation: showDropIcon === 'show' ? 'fade-in 0.25s' : 'fade-out 0.5s' }"
+ class="drop-indicator"
+ @dragleave="fileDragStop"
+ @drop.stop="fileDrop"
+ >
+ <FAIcon :icon="uploadFileLimitReached ? 'ban' : 'upload'" />
+ </div>
+ <div
v-if="error"
class="alert error"
>
Error: {{ error }}
- <FAIcon
- class="fa-scale-110 fa-old-padding"
- icon="times"
+ <button
+ class="button-unstyled"
@click="clearError"
- />
+ >
+ <FAIcon
+ class="fa-scale-110 fa-old-padding"
+ icon="times"
+ />
+ </button>
</div>
<gallery
v-if="newStatus.files && newStatus.files.length > 0"
@@ -331,7 +336,7 @@
display: flex;
justify-content: space-between;
padding: 0.5em;
- height: 32px;
+ height: 2.5em;
button {
width: 10em;
@@ -389,7 +394,6 @@
border-radius: var(--tooltipRadius, $fallback--tooltipRadius);
padding: 0.5em;
margin: 0;
- line-height: 1.4em;
}
.text-format {
@@ -403,13 +407,16 @@
display: flex;
justify-content: space-between;
padding-top: 5px;
+ align-items: baseline;
}
.media-upload-icon, .poll-icon, .emoji-icon {
- font-size: 26px;
+ font-size: 1.85em;
line-height: 1.1;
flex: 1;
padding: 0 0.1em;
+ display: flex;
+ align-items: center;
&.selected, &:hover {
// needs to be specific to override icon default color
@@ -436,21 +443,17 @@
// Order is not necessary but a good indicator
.media-upload-icon {
order: 1;
- text-align: left;
+ justify-content: left;
}
.emoji-icon {
order: 2;
- text-align: center;
+ justify-content: center;
}
.poll-icon {
order: 3;
- text-align: right;
- }
-
- .poll-icon {
- cursor: pointer;
+ justify-content: right;
}
.error {
@@ -484,10 +487,6 @@
flex-direction: column;
}
- .btn {
- cursor: pointer;
- }
-
.btn[disabled] {
cursor: not-allowed;
}
@@ -503,26 +502,20 @@
display: flex;
flex-direction: column;
padding: 0.25em 0.5em 0.5em;
- line-height:24px;
- }
-
- form textarea.form-cw {
- line-height:16px;
- resize: none;
- overflow: hidden;
- transition: min-height 200ms 100ms;
- min-height: 1px;
+ line-height: 1.85;
}
.form-post-body {
- height: 16px; // Only affects the empty-height
- line-height: 16px;
- resize: none;
+ // TODO: make a resizable textarea component?
+ box-sizing: content-box; // needed for easier computation of dynamic size
overflow: hidden;
transition: min-height 200ms 100ms;
- padding-bottom: 1.75em;
- min-height: 1px;
- box-sizing: content-box;
+ // stock padding + 1 line of text (for counter)
+ padding-bottom: calc(var(--_padding) + var(--post-line-height) * 1em);
+ // two lines of text
+ height: calc(var(--post-line-height) * 1em);
+ min-height: calc(var(--post-line-height) * 1em);
+ resize: none;
&.scrollable-form {
overflow-y: auto;
@@ -546,10 +539,6 @@
}
}
- .btn {
- cursor: pointer;
- }
-
.btn[disabled] {
cursor: not-allowed;
}
@@ -566,7 +555,6 @@
.drop-indicator {
position: absolute;
- z-index: 1;
width: 100%;
height: 100%;
font-size: 5em;
diff --git a/src/components/public_and_external_timeline/public_and_external_timeline.js b/src/components/public_and_external_timeline/public_and_external_timeline.js
index cbd4491b..bfcce6ae 100644
--- a/src/components/public_and_external_timeline/public_and_external_timeline.js
+++ b/src/components/public_and_external_timeline/public_and_external_timeline.js
@@ -9,7 +9,7 @@ const PublicAndExternalTimeline = {
created () {
this.$store.dispatch('startFetchingTimeline', { timeline: 'publicAndExternal' })
},
- destroyed () {
+ unmounted () {
this.$store.dispatch('stopFetchingTimeline', 'publicAndExternal')
}
}
diff --git a/src/components/public_timeline/public_timeline.js b/src/components/public_timeline/public_timeline.js
index 66c40d3a..30693544 100644
--- a/src/components/public_timeline/public_timeline.js
+++ b/src/components/public_timeline/public_timeline.js
@@ -9,7 +9,7 @@ const PublicTimeline = {
created () {
this.$store.dispatch('startFetchingTimeline', { timeline: 'public' })
},
- destroyed () {
+ unmounted () {
this.$store.dispatch('stopFetchingTimeline', 'public')
}
diff --git a/src/components/range_input/range_input.vue b/src/components/range_input/range_input.vue
index 5857a5c1..1e7e42d5 100644
--- a/src/components/range_input/range_input.vue
+++ b/src/components/range_input/range_input.vue
@@ -15,7 +15,7 @@
class="opt"
type="checkbox"
:checked="present"
- @input="$emit('input', !present ? fallback : undefined)"
+ @change="$emit('update:modelValue', !present ? fallback : undefined)"
>
<label
v-if="typeof fallback !== 'undefined'"
@@ -26,23 +26,23 @@
:id="name"
class="input-number"
type="range"
- :value="value || fallback"
+ :value="modelValue || fallback"
:disabled="!present || disabled"
:max="max || hardMax || 100"
:min="min || hardMin || 0"
:step="step || 1"
- @input="$emit('input', $event.target.value)"
+ @input="$emit('update:modelValue', $event.target.value)"
>
<input
:id="name"
class="input-number"
type="number"
- :value="value || fallback"
+ :value="modelValue || fallback"
:disabled="!present || disabled"
:max="hardMax"
:min="hardMin"
:step="step || 1"
- @input="$emit('input', $event.target.value)"
+ @input="$emit('update:modelValue', $event.target.value)"
>
</div>
</template>
@@ -50,11 +50,12 @@
<script>
export default {
props: [
- 'name', 'value', 'fallback', 'disabled', 'label', 'max', 'min', 'step', 'hardMin', 'hardMax'
+ 'name', 'modelValue', 'fallback', 'disabled', 'label', 'max', 'min', 'step', 'hardMin', 'hardMax'
],
+ emits: ['update:modelValue'],
computed: {
present () {
- return typeof this.value !== 'undefined'
+ return typeof this.modelValue !== 'undefined'
}
}
}
diff --git a/src/components/react_button/react_button.js b/src/components/react_button/react_button.js
index ce82c90d..e6f9dbff 100644
--- a/src/components/react_button/react_button.js
+++ b/src/components/react_button/react_button.js
@@ -1,6 +1,7 @@
import Popover from '../popover/popover.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faSmileBeam } from '@fortawesome/free-regular-svg-icons'
+import { trim } from 'lodash'
library.add(faSmileBeam)
@@ -43,7 +44,7 @@ const ReactButton = {
},
emojis () {
if (this.filterWord !== '') {
- const filterWordLowercase = this.filterWord.toLowerCase()
+ const filterWordLowercase = trim(this.filterWord.toLowerCase())
let orderedEmojiList = []
for (const emoji of this.$store.state.instance.emoji) {
if (emoji.replacement === this.filterWord) return [emoji]
diff --git a/src/components/react_button/react_button.vue b/src/components/react_button/react_button.vue
index c69c315b..8a4b4d3b 100644
--- a/src/components/react_button/react_button.vue
+++ b/src/components/react_button/react_button.vue
@@ -12,6 +12,7 @@
<div class="reaction-picker-filter">
<input
v-model="filterWord"
+ @input="$event.target.composing = false"
size="1"
:placeholder="$t('emoji.search_emoji')"
>
@@ -101,7 +102,7 @@
cursor: pointer;
flex-basis: 20%;
- line-height: 1.5em;
+ line-height: 1.5;
align-content: center;
&:hover {
diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js
index 1ac8e8be..6eb316d0 100644
--- a/src/components/registration/registration.js
+++ b/src/components/registration/registration.js
@@ -1,9 +1,11 @@
-import { validationMixin } from 'vuelidate'
-import { required, requiredIf, sameAs } from 'vuelidate/lib/validators'
+import useVuelidate from '@vuelidate/core'
+import { required, requiredIf, sameAs } from '@vuelidate/validators'
import { mapActions, mapState } from 'vuex'
+import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue'
+import localeService from '../../services/locale/locale.service.js'
const registration = {
- mixins: [validationMixin],
+ setup () { return { v$: useVuelidate() } },
data: () => ({
user: {
email: '',
@@ -11,10 +13,14 @@ const registration = {
username: '',
password: '',
confirm: '',
- reason: ''
+ reason: '',
+ language: ''
},
captcha: {}
}),
+ components: {
+ InterfaceLanguageSwitcher
+ },
validations () {
return {
user: {
@@ -24,9 +30,10 @@ const registration = {
password: { required },
confirm: {
required,
- sameAsPassword: sameAs('password')
+ sameAs: sameAs(this.user.password)
},
- reason: { required: requiredIf(() => this.accountApprovalRequired) }
+ reason: { required: requiredIf(() => this.accountApprovalRequired) },
+ language: {}
}
}
},
@@ -64,10 +71,13 @@ const registration = {
this.user.captcha_solution = this.captcha.solution
this.user.captcha_token = this.captcha.token
this.user.captcha_answer_data = this.captcha.answer_data
+ if (this.user.language) {
+ this.user.language = localeService.internalToBackendLocale(this.user.language)
+ }
- this.$v.$touch()
+ this.v$.$touch()
- if (!this.$v.$invalid) {
+ if (!this.v$.$invalid) {
try {
await this.signUp(this.user)
this.$router.push({ name: 'friends' })
diff --git a/src/components/registration/registration.vue b/src/components/registration/registration.vue
index 65b4bb33..cc655c0b 100644
--- a/src/components/registration/registration.vue
+++ b/src/components/registration/registration.vue
@@ -12,7 +12,7 @@
<div class="text-fields">
<div
class="form-group"
- :class="{ 'form-group--error': $v.user.username.$error }"
+ :class="{ 'form-group--error': v$.user.username.$error }"
>
<label
class="form--label"
@@ -20,18 +20,18 @@
>{{ $t('login.username') }}</label>
<input
id="sign-up-username"
- v-model.trim="$v.user.username.$model"
+ v-model.trim="v$.user.username.$model"
:disabled="isPending"
class="form-control"
:placeholder="$t('registration.username_placeholder')"
>
</div>
<div
- v-if="$v.user.username.$dirty"
+ v-if="v$.user.username.$dirty"
class="form-error"
>
<ul>
- <li v-if="!$v.user.username.required">
+ <li v-if="!v$.user.username.required">
<span>{{ $t('registration.validations.username_required') }}</span>
</li>
</ul>
@@ -39,7 +39,7 @@
<div
class="form-group"
- :class="{ 'form-group--error': $v.user.fullname.$error }"
+ :class="{ 'form-group--error': v$.user.fullname.$error }"
>
<label
class="form--label"
@@ -47,18 +47,18 @@
>{{ $t('registration.fullname') }}</label>
<input
id="sign-up-fullname"
- v-model.trim="$v.user.fullname.$model"
+ v-model.trim="v$.user.fullname.$model"
:disabled="isPending"
class="form-control"
:placeholder="$t('registration.fullname_placeholder')"
>
</div>
<div
- v-if="$v.user.fullname.$dirty"
+ v-if="v$.user.fullname.$dirty"
class="form-error"
>
<ul>
- <li v-if="!$v.user.fullname.required">
+ <li v-if="!v$.user.fullname.required">
<span>{{ $t('registration.validations.fullname_required') }}</span>
</li>
</ul>
@@ -66,7 +66,7 @@
<div
class="form-group"
- :class="{ 'form-group--error': $v.user.email.$error }"
+ :class="{ 'form-group--error': v$.user.email.$error }"
>
<label
class="form--label"
@@ -74,18 +74,18 @@
>{{ $t('registration.email') }}</label>
<input
id="email"
- v-model="$v.user.email.$model"
+ v-model="v$.user.email.$model"
:disabled="isPending"
class="form-control"
type="email"
>
</div>
<div
- v-if="$v.user.email.$dirty"
+ v-if="v$.user.email.$dirty"
class="form-error"
>
<ul>
- <li v-if="!$v.user.email.required">
+ <li v-if="!v$.user.email.required">
<span>{{ $t('registration.validations.email_required') }}</span>
</li>
</ul>
@@ -107,7 +107,7 @@
<div
class="form-group"
- :class="{ 'form-group--error': $v.user.password.$error }"
+ :class="{ 'form-group--error': v$.user.password.$error }"
>
<label
class="form--label"
@@ -122,11 +122,11 @@
>
</div>
<div
- v-if="$v.user.password.$dirty"
+ v-if="v$.user.password.$dirty"
class="form-error"
>
<ul>
- <li v-if="!$v.user.password.required">
+ <li v-if="!v$.user.password.required">
<span>{{ $t('registration.validations.password_required') }}</span>
</li>
</ul>
@@ -134,7 +134,7 @@
<div
class="form-group"
- :class="{ 'form-group--error': $v.user.confirm.$error }"
+ :class="{ 'form-group--error': v$.user.confirm.$error }"
>
<label
class="form--label"
@@ -149,20 +149,32 @@
>
</div>
<div
- v-if="$v.user.confirm.$dirty"
+ v-if="v$.user.confirm.$dirty"
class="form-error"
>
<ul>
- <li v-if="!$v.user.confirm.required">
+ <li v-if="!v$.user.confirm.required">
<span>{{ $t('registration.validations.password_confirmation_required') }}</span>
</li>
- <li v-if="!$v.user.confirm.sameAsPassword">
+ <li v-if="!v$.user.confirm.sameAsPassword">
<span>{{ $t('registration.validations.password_confirmation_match') }}</span>
</li>
</ul>
</div>
<div
+ class="form-group"
+ :class="{ 'form-group--error': v$.user.language.$error }"
+ >
+ <interface-language-switcher
+ for="email-language"
+ :prompt-text="$t('registration.email_language')"
+ :language="v$.user.language.$model"
+ :set-language="val => v$.user.language.$model = val"
+ />
+ </div>
+
+ <div
v-if="accountApprovalRequired"
class="form-group"
>
@@ -271,7 +283,10 @@ $validations-cRed: #f04124;
.container {
display: flex;
flex-direction: row;
- //margin-bottom: 1em;
+
+ > * {
+ min-width: 0;
+ }
}
.terms-of-service {
@@ -294,8 +309,8 @@ $validations-cRed: #f04124;
.form-group {
display: flex;
flex-direction: column;
- padding: 0.3em 0.0em 0.3em;
- line-height:24px;
+ padding: 0.3em 0;
+ line-height: 2;
margin-bottom: 1em;
}
@@ -315,7 +330,7 @@ $validations-cRed: #f04124;
text-align: left;
span {
- font-size: 12px;
+ font-size: 0.85em;
}
}
@@ -341,7 +356,7 @@ $validations-cRed: #f04124;
.btn {
margin-top: 0.6em;
- height: 28px;
+ height: 2em;
}
.error {
diff --git a/src/components/remote_follow/remote_follow.vue b/src/components/remote_follow/remote_follow.vue
index be827400..e17aa2e9 100644
--- a/src/components/remote_follow/remote_follow.vue
+++ b/src/components/remote_follow/remote_follow.vue
@@ -32,7 +32,7 @@
.remote-button {
width: 100%;
- min-height: 28px;
+ min-height: 2em;
}
}
</style>
diff --git a/src/components/rich_content/rich_content.jsx b/src/components/rich_content/rich_content.jsx
index 46bc661a..ca075270 100644
--- a/src/components/rich_content/rich_content.jsx
+++ b/src/components/rich_content/rich_content.jsx
@@ -1,4 +1,3 @@
-import Vue from 'vue'
import { unescape, flattenDeep } from 'lodash'
import { getTagName, processTextForEmoji, getAttrs } from 'src/services/html_converter/utility.service.js'
import { convertHtmlToTree } from 'src/services/html_converter/html_tree_converter.service.js'
@@ -27,8 +26,12 @@ import './rich_content.scss'
*
* Apart from that one small hiccup with emit in render this _should_ be vue3-ready
*/
-export default Vue.component('RichContent', {
+export default {
name: 'RichContent',
+ components: {
+ MentionsLine,
+ HashtagLink
+ },
props: {
// Original html content
html: {
@@ -58,7 +61,7 @@ export default Vue.component('RichContent', {
}
},
// NEVER EVER TOUCH DATA INSIDE RENDER
- render (h) {
+ render () {
// Pre-process HTML
const { newHtml: html } = preProcessPerLine(this.html, this.greentext)
let currentMentions = null // Current chain of mentions, we group all mentions together
@@ -76,18 +79,19 @@ export default Vue.component('RichContent', {
const renderImage = (tag) => {
return <StillImage
- {...{ attrs: getAttrs(tag) }}
+ {...getAttrs(tag)}
class="img"
/>
}
const renderHashtag = (attrs, children, encounteredTextReverse) => {
- const linkData = getLinkData(attrs, children, tagsIndex++)
+ const { index, ...linkData } = getLinkData(attrs, children, tagsIndex++)
writtenTags.push(linkData)
if (!encounteredTextReverse) {
lastTags.push(linkData)
}
- return <HashtagLink {...{ props: linkData }}/>
+ const { url, tag, content } = linkData
+ return <HashtagLink url={url} tag={tag} content={content}/>
}
const renderMention = (attrs, children) => {
@@ -222,7 +226,7 @@ export default Vue.component('RichContent', {
attrs.target = '_blank'
const newChildren = [...children].reverse().map(processItemReverse).reverse()
- return <a {...{ attrs }}>
+ return <a {...attrs}>
{ newChildren }
</a>
}
@@ -235,7 +239,7 @@ export default Vue.component('RichContent', {
const newChildren = Array.isArray(children)
? [...children].reverse().map(processItemReverse).reverse()
: children
- return <Tag {...{ attrs: getAttrs(opener) }}>
+ return <Tag {...getAttrs(opener)}>
{ newChildren }
</Tag>
} else {
@@ -266,7 +270,7 @@ export default Vue.component('RichContent', {
return result
}
-})
+}
const getLinkData = (attrs, children, index) => {
const stripTags = (item) => {
diff --git a/src/components/scope_selector/scope_selector.vue b/src/components/scope_selector/scope_selector.vue
index a01242fc..f3bee183 100644
--- a/src/components/scope_selector/scope_selector.vue
+++ b/src/components/scope_selector/scope_selector.vue
@@ -16,6 +16,7 @@
class="fa-scale-110 fa-old-padding"
/>
</button>
+ {{ ' ' }}
<button
v-if="showPrivate"
class="button-unstyled scope"
@@ -29,6 +30,7 @@
class="fa-scale-110 fa-old-padding"
/>
</button>
+ {{ ' ' }}
<button
v-if="showUnlisted"
class="button-unstyled scope"
@@ -42,6 +44,7 @@
class="fa-scale-110 fa-old-padding"
/>
</button>
+ {{ ' ' }}
<button
v-if="showPublic"
class="button-unstyled scope"
diff --git a/src/components/search/search.js b/src/components/search/search.js
index b62bc2c5..76ac30ef 100644
--- a/src/components/search/search.js
+++ b/src/components/search/search.js
@@ -1,6 +1,7 @@
import FollowCard from '../follow_card/follow_card.vue'
import Conversation from '../conversation/conversation.vue'
import Status from '../status/status.vue'
+import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
import map from 'lodash/map'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
@@ -17,7 +18,8 @@ const Search = {
components: {
FollowCard,
Conversation,
- Status
+ Status,
+ TabSwitcher
},
props: [
'query'
diff --git a/src/components/select/select.js b/src/components/select/select.js
index 49535d07..ec571a14 100644
--- a/src/components/select/select.js
+++ b/src/components/select/select.js
@@ -8,12 +8,9 @@ library.add(
)
export default {
- model: {
- prop: 'value',
- event: 'change'
- },
+ emits: ['update:modelValue'],
props: [
- 'value',
+ 'modelValue',
'disabled',
'unstyled',
'kind'
diff --git a/src/components/select/select.vue b/src/components/select/select.vue
index 8d6528ff..92493b0b 100644
--- a/src/components/select/select.vue
+++ b/src/components/select/select.vue
@@ -1,4 +1,3 @@
-
<template>
<label
class="Select input"
@@ -6,11 +5,12 @@
>
<select
:disabled="disabled"
- :value="value"
- @change="$emit('change', $event.target.value)"
+ :value="modelValue"
+ @change="$emit('update:modelValue', $event.target.value)"
>
<slot />
</select>
+ {{ ' ' }}
<FAIcon
class="select-down-icon"
icon="chevron-down"
@@ -23,7 +23,8 @@
<style lang="scss">
@import '../../_variables.scss';
-.Select {
+/* TODO fix order of styles */
+label.Select {
padding: 0;
select {
@@ -38,10 +39,10 @@
padding: 0 2em 0 .2em;
font-family: sans-serif;
font-family: var(--inputFont, sans-serif);
- font-size: 14px;
+ font-size: 1em;
width: 100%;
z-index: 1;
- height: 28px;
+ height: 2em;
line-height: 16px;
}
@@ -54,7 +55,7 @@
width: 0.875em;
color: $fallback--text;
color: var(--inputText, $fallback--text);
- line-height: 28px;
+ line-height: 2;
z-index: 0;
pointer-events: none;
}
diff --git a/src/components/selectable_list/selectable_list.vue b/src/components/selectable_list/selectable_list.vue
index 3f885881..3c80660e 100644
--- a/src/components/selectable_list/selectable_list.vue
+++ b/src/components/selectable_list/selectable_list.vue
@@ -6,9 +6,9 @@
>
<div class="selectable-list-checkbox-wrapper">
<Checkbox
- :checked="allSelected"
+ :model-value="allSelected"
:indeterminate="someSelected"
- @change="toggleAll"
+ @update:model-value="toggleAll"
>
{{ $t('selectable_list.select_all') }}
</Checkbox>
@@ -31,8 +31,8 @@
>
<div class="selectable-list-checkbox-wrapper">
<Checkbox
- :checked="isSelected(item)"
- @change="checked => toggle(checked, item)"
+ :model-value="isSelected(item)"
+ @update:model-value="checked => toggle(checked, item)"
/>
</div>
<slot
diff --git a/src/components/settings_modal/helpers/boolean_setting.vue b/src/components/settings_modal/helpers/boolean_setting.vue
index e0d825f2..69584808 100644
--- a/src/components/settings_modal/helpers/boolean_setting.vue
+++ b/src/components/settings_modal/helpers/boolean_setting.vue
@@ -4,9 +4,9 @@
class="BooleanSetting"
>
<Checkbox
- :checked="state"
+ :model-value="state"
:disabled="disabled"
- @change="update"
+ @update:modelValue="update"
>
<span
v-if="!!$slots.default"
@@ -14,6 +14,7 @@
>
<slot />
</span>
+ {{ ' ' }}
<ModifiedIndicator :changed="isChanged" /><ServerSideIndicator :server-side="isServerSide" /> </Checkbox>
</label>
</template>
diff --git a/src/components/settings_modal/helpers/choice_setting.vue b/src/components/settings_modal/helpers/choice_setting.vue
index 54f5d0a7..258c7422 100644
--- a/src/components/settings_modal/helpers/choice_setting.vue
+++ b/src/components/settings_modal/helpers/choice_setting.vue
@@ -4,10 +4,11 @@
class="ChoiceSetting"
>
<slot />
+ {{ ' ' }}
<Select
- :value="state"
+ :model-value="state"
:disabled="disabled"
- @change="update"
+ @update:modelValue="update"
>
<option
v-for="option in options"
diff --git a/src/components/settings_modal/helpers/integer_setting.js b/src/components/settings_modal/helpers/integer_setting.js
index 4a19bd7c..17dc0e7b 100644
--- a/src/components/settings_modal/helpers/integer_setting.js
+++ b/src/components/settings_modal/helpers/integer_setting.js
@@ -8,7 +8,7 @@ export default {
path: String,
disabled: Boolean,
min: Number,
- expert: Number
+ expert: [Number, String]
},
computed: {
pathDefault () {
diff --git a/src/components/settings_modal/helpers/integer_setting.vue b/src/components/settings_modal/helpers/integer_setting.vue
index 408b0925..e661a025 100644
--- a/src/components/settings_modal/helpers/integer_setting.vue
+++ b/src/components/settings_modal/helpers/integer_setting.vue
@@ -16,6 +16,7 @@
:value="state"
@change="update"
>
+ {{ ' ' }}
<ModifiedIndicator :changed="isChanged" />
</span>
</template>
diff --git a/src/components/settings_modal/settings_modal.js b/src/components/settings_modal/settings_modal.js
index 82ea410e..0a72dca1 100644
--- a/src/components/settings_modal/settings_modal.js
+++ b/src/components/settings_modal/settings_modal.js
@@ -56,8 +56,8 @@ const SettingsModal = {
SettingsModalContent: getResettableAsyncComponent(
() => import('./settings_modal_content.vue'),
{
- loading: PanelLoading,
- error: AsyncComponentError,
+ loadingComponent: PanelLoading,
+ errorComponent: AsyncComponentError,
delay: 0
}
)
diff --git a/src/components/settings_modal/settings_modal.scss b/src/components/settings_modal/settings_modal.scss
index fb466f2f..13cb0e65 100644
--- a/src/components/settings_modal/settings_modal.scss
+++ b/src/components/settings_modal/settings_modal.scss
@@ -2,6 +2,18 @@
.settings-modal {
overflow: hidden;
+ .setting-list,
+ .option-list {
+ list-style-type: none;
+ padding-left: 2em;
+ li {
+ margin-bottom: 0.5em;
+ }
+ .suboptions {
+ margin-top: 0.3em
+ }
+ }
+
&.peek {
.settings-modal-panel {
/* Explanation:
@@ -42,7 +54,7 @@
overflow-y: hidden;
.btn {
- min-height: 28px;
+ min-height: 2em;
min-width: 10em;
padding: 0 2em;
}
@@ -54,5 +66,10 @@
>* {
margin-right: 0.5em;
}
+
+ .extra-content {
+ display: flex;
+ flex-grow: 1;
+ }
}
}
diff --git a/src/components/settings_modal/settings_modal.vue b/src/components/settings_modal/settings_modal.vue
index 1805c77f..d3bed061 100644
--- a/src/components/settings_modal/settings_modal.vue
+++ b/src/components/settings_modal/settings_modal.vue
@@ -11,23 +11,14 @@
{{ $t('settings.settings') }}
</span>
<transition name="fade">
- <template v-if="currentSaveStateNotice">
- <div
- v-if="currentSaveStateNotice.error"
- class="alert error"
- @click.prevent
- >
- {{ $t('settings.saving_err') }}
- </div>
-
- <div
- v-if="!currentSaveStateNotice.error"
- class="alert transparent"
- @click.prevent
- >
- {{ $t('settings.saving_ok') }}
- </div>
- </template>
+ <div
+ v-if="currentSaveStateNotice"
+ class="alert"
+ :class="{ transparent: !currentSaveStateNotice.error, error: currentSaveStateNotice.error}"
+ @click.prevent
+ >
+ {{ currentSaveStateNotice.error ? $t('settings.saving_err') : $t('settings.saving_ok') }}
+ </div>
</transition>
<button
class="btn button-default"
@@ -68,6 +59,7 @@
:title="$t('general.close')"
>
<span>{{ $t("settings.file_export_import.backup_restore") }}</span>
+ {{ ' ' }}
<FAIcon
icon="chevron-down"
/>
@@ -109,9 +101,16 @@
</template>
</Popover>
- <Checkbox v-model="expertLevel">
+ <Checkbox
+ :model-value="!!expertLevel"
+ @update:modelValue="expertLevel = Number($event)"
+ >
{{ $t("settings.expert_mode") }}
</Checkbox>
+ <span
+ id="unscrolled-content"
+ class="extra-content"
+ />
</div>
</div>
</Modal>
diff --git a/src/components/settings_modal/settings_modal_content.js b/src/components/settings_modal/settings_modal_content.js
index 9dcf1b5a..9ac0301f 100644
--- a/src/components/settings_modal/settings_modal_content.js
+++ b/src/components/settings_modal/settings_modal_content.js
@@ -1,4 +1,4 @@
-import TabSwitcher from 'src/components/tab_switcher/tab_switcher.js'
+import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
import DataImportExportTab from './tabs/data_import_export_tab.vue'
import MutesAndBlocksTab from './tabs/mutes_and_blocks_tab.vue'
@@ -53,6 +53,9 @@ const SettingsModalContent = {
},
open () {
return this.$store.state.interface.settingsModalState !== 'hidden'
+ },
+ bodyLock () {
+ return this.$store.state.interface.settingsModalState === 'visible'
}
},
methods: {
@@ -60,8 +63,8 @@ const SettingsModalContent = {
const targetTab = this.$store.state.interface.settingsModalTargetTab
// We're being told to open in specific tab
if (targetTab) {
- const tabIndex = this.$refs.tabSwitcher.$slots.default.findIndex(elm => {
- return elm.data && elm.data.attrs['data-tab-name'] === targetTab
+ const tabIndex = this.$refs.tabSwitcher.$slots.default().findIndex(elm => {
+ return elm.props && elm.props['data-tab-name'] === targetTab
})
if (tabIndex >= 0) {
this.$refs.tabSwitcher.setTab(tabIndex)
diff --git a/src/components/settings_modal/settings_modal_content.vue b/src/components/settings_modal/settings_modal_content.vue
index c9ed2a38..0be76d22 100644
--- a/src/components/settings_modal/settings_modal_content.vue
+++ b/src/components/settings_modal/settings_modal_content.vue
@@ -4,6 +4,7 @@
class="settings_tab-switcher"
:side-tab-bar="true"
:scrollable-tabs="true"
+ :body-scroll-lock="bodyLock"
>
<div
:label="$t('settings.general')"
diff --git a/src/components/settings_modal/tabs/data_import_export_tab.js b/src/components/settings_modal/tabs/data_import_export_tab.js
index f4b736d2..4895733c 100644
--- a/src/components/settings_modal/tabs/data_import_export_tab.js
+++ b/src/components/settings_modal/tabs/data_import_export_tab.js
@@ -7,11 +7,16 @@ const DataImportExportTab = {
data () {
return {
activeTab: 'profile',
- newDomainToMute: ''
+ newDomainToMute: '',
+ listBackupsError: false,
+ addBackupError: false,
+ addedBackup: false,
+ backups: []
}
},
created () {
this.$store.dispatch('fetchTokens')
+ this.fetchBackups()
},
components: {
Importer,
@@ -72,6 +77,28 @@ const DataImportExportTab = {
}
return user.screen_name
}).join('\n')
+ },
+ addBackup () {
+ this.$store.state.api.backendInteractor.addBackup()
+ .then((res) => {
+ this.addedBackup = true
+ this.addBackupError = false
+ })
+ .catch((error) => {
+ this.addedBackup = false
+ this.addBackupError = error
+ })
+ .then(() => this.fetchBackups())
+ },
+ fetchBackups () {
+ this.$store.state.api.backendInteractor.listBackups()
+ .then((res) => {
+ this.backups = res
+ this.listBackupsError = false
+ })
+ .catch((error) => {
+ this.listBackupsError = error.error
+ })
}
}
}
diff --git a/src/components/settings_modal/tabs/data_import_export_tab.vue b/src/components/settings_modal/tabs/data_import_export_tab.vue
index a406077d..e3b7f407 100644
--- a/src/components/settings_modal/tabs/data_import_export_tab.vue
+++ b/src/components/settings_modal/tabs/data_import_export_tab.vue
@@ -53,6 +53,67 @@
:export-button-label="$t('settings.mute_export_button')"
/>
</div>
+ <div class="setting-item">
+ <h2>{{ $t('settings.account_backup') }}</h2>
+ <p>{{ $t('settings.account_backup_description') }}</p>
+ <table>
+ <thead>
+ <tr>
+ <th>{{ $t('settings.account_backup_table_head') }}</th>
+ <th />
+ </tr>
+ </thead>
+ <tbody>
+ <tr
+ v-for="backup in backups"
+ :key="backup.id"
+ >
+ <td>{{ backup.inserted_at }}</td>
+ <td class="actions">
+ <a
+ v-if="backup.processed"
+ target="_blank"
+ :href="backup.url"
+ >
+ {{ $t('settings.download_backup') }}
+ </a>
+ <span
+ v-else
+ >
+ {{ $t('settings.backup_not_ready') }}
+ </span>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <div
+ v-if="listBackupsError"
+ class="alert error"
+ >
+ {{ $t('settings.list_backups_error', { error }) }}
+ <button
+ :title="$t('settings.hide_list_backups_error_action')"
+ @click="listBackupsError = false"
+ >
+ <FAIcon
+ class="fa-scale-110 fa-old-padding"
+ icon="times"
+ />
+ </button>
+ </div>
+ <button
+ class="btn button-default"
+ @click="addBackup"
+ >
+ {{ $t('settings.add_backup') }}
+ </button>
+ <p v-if="addedBackup">
+ {{ $t('settings.added_backup') }}
+ </p>
+ <template v-if="addBackupError !== false">
+ <p>{{ $t('settings.add_backup_error', { error: addBackupError }) }}</p>
+ </template>
+ </div>
</div>
</template>
diff --git a/src/components/settings_modal/tabs/filtering_tab.vue b/src/components/settings_modal/tabs/filtering_tab.vue
index dc48902f..97046ff0 100644
--- a/src/components/settings_modal/tabs/filtering_tab.vue
+++ b/src/components/settings_modal/tabs/filtering_tab.vue
@@ -72,22 +72,10 @@
<div>{{ $t('settings.filtering_explanation') }}</div>
</li>
<h3>{{ $t('settings.attachments') }}</h3>
- <li v-if="expertLevel > 0">
- <label for="maxThumbnails">
- {{ $t('settings.max_thumbnails') }}
- </label>
- <input
- id="maxThumbnails"
- path.number="maxThumbnails"
- class="number-input"
- type="number"
- min="0"
- step="1"
- >
- </li>
<li>
<IntegerSetting
path="maxThumbnails"
+ expert="1"
:min="0"
>
{{ $t('settings.max_thumbnails') }}
diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js
index 62d86176..1e11b9e0 100644
--- a/src/components/settings_modal/tabs/general_tab.js
+++ b/src/components/settings_modal/tabs/general_tab.js
@@ -38,6 +38,11 @@ const GeneralTab = {
value: mode,
label: this.$t(`settings.mention_link_display_${mode}`)
})),
+ thirdColumnModeOptions: ['none', 'notifications', 'postform'].map(mode => ({
+ key: mode,
+ value: mode,
+ label: this.$t(`settings.third_column_mode_${mode}`)
+ })),
loopSilentAvailable:
// Firefox
Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
@@ -72,6 +77,12 @@ const GeneralTab = {
!this.$store.state.users.currentUser.background_image
},
instanceShoutboxPresent () { return this.$store.state.instance.shoutAvailable },
+ language: {
+ get: function () { return this.$store.getters.mergedConfig.interfaceLanguage },
+ set: function (val) {
+ this.$store.dispatch('setOption', { name: 'interfaceLanguage', value: val })
+ }
+ },
...SharedComputedObject()
},
methods: {
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
index a2c6bffa..1fe51b6d 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -4,7 +4,11 @@
<h2>{{ $t('settings.interface') }}</h2>
<ul class="setting-list">
<li>
- <interface-language-switcher />
+ <interface-language-switcher
+ :prompt-text="$t('settings.interfaceLanguage')"
+ :language="language"
+ :set-language="val => language = val"
+ />
</li>
<li v-if="instanceSpecificPanelPresent">
<BooleanSetting path="hideISP">
@@ -61,6 +65,26 @@
</BooleanSetting>
</li>
<li>
+ <BooleanSetting path="disableStickyHeaders">
+ {{ $t('settings.disable_sticky_headers') }}
+ </BooleanSetting>
+ </li>
+ <li>
+ <BooleanSetting path="showScrollbars">
+ {{ $t('settings.show_scrollbars') }}
+ </BooleanSetting>
+ </li>
+ <li>
+ <ChoiceSetting
+ v-if="user"
+ id="thirdColumnMode"
+ path="thirdColumnMode"
+ :options="thirdColumnModeOptions"
+ >
+ {{ $t('settings.third_column_mode') }}
+ </ChoiceSetting>
+ </li>
+ <li>
<BooleanSetting
path="alwaysShowNewPostButton"
expert="1"
diff --git a/src/components/settings_modal/tabs/mutes_and_blocks_tab.js b/src/components/settings_modal/tabs/mutes_and_blocks_tab.js
index 40a87b81..6cfeea35 100644
--- a/src/components/settings_modal/tabs/mutes_and_blocks_tab.js
+++ b/src/components/settings_modal/tabs/mutes_and_blocks_tab.js
@@ -2,7 +2,7 @@ import get from 'lodash/get'
import map from 'lodash/map'
import reject from 'lodash/reject'
import Autosuggest from 'src/components/autosuggest/autosuggest.vue'
-import TabSwitcher from 'src/components/tab_switcher/tab_switcher.js'
+import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
import BlockCard from 'src/components/block_card/block_card.vue'
import MuteCard from 'src/components/mute_card/mute_card.vue'
import DomainMuteCard from 'src/components/domain_mute_card/domain_mute_card.vue'
diff --git a/src/components/settings_modal/tabs/mutes_and_blocks_tab.scss b/src/components/settings_modal/tabs/mutes_and_blocks_tab.scss
index ceb64efb..2adff847 100644
--- a/src/components/settings_modal/tabs/mutes_and_blocks_tab.scss
+++ b/src/components/settings_modal/tabs/mutes_and_blocks_tab.scss
@@ -8,7 +8,7 @@
.bulk-actions {
text-align: right;
padding: 0 1em;
- min-height: 28px;
+ min-height: 2em;
}
.bulk-action-button {
diff --git a/src/components/settings_modal/tabs/notifications_tab.vue b/src/components/settings_modal/tabs/notifications_tab.vue
index 86be6095..dd3806ed 100644
--- a/src/components/settings_modal/tabs/notifications_tab.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -41,6 +41,11 @@
{{ $t('settings.notification_visibility_emoji_reactions') }}
</BooleanSetting>
</li>
+ <li>
+ <BooleanSetting path="notificationVisibility.polls">
+ {{ $t('settings.notification_visibility_polls') }}
+ </BooleanSetting>
+ </li>
</ul>
</li>
</ul>
diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js
index bee8a7bb..8781bb91 100644
--- a/src/components/settings_modal/tabs/profile_tab.js
+++ b/src/components/settings_modal/tabs/profile_tab.js
@@ -8,8 +8,10 @@ import EmojiInput from 'src/components/emoji_input/emoji_input.vue'
import suggestor from 'src/components/emoji_input/suggestor.js'
import Autosuggest from 'src/components/autosuggest/autosuggest.vue'
import Checkbox from 'src/components/checkbox/checkbox.vue'
+import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue'
import BooleanSetting from '../helpers/boolean_setting.vue'
import SharedComputedObject from '../helpers/shared_computed_object.js'
+import localeService from 'src/services/locale/locale.service.js'
import { library } from '@fortawesome/fontawesome-svg-core'
import {
@@ -40,7 +42,8 @@ const ProfileTab = {
banner: null,
bannerPreview: null,
background: null,
- backgroundPreview: null
+ backgroundPreview: null,
+ emailLanguage: this.$store.state.users.currentUser.language || ''
}
},
components: {
@@ -50,7 +53,8 @@ const ProfileTab = {
Autosuggest,
ProgressButton,
Checkbox,
- BooleanSetting
+ BooleanSetting,
+ InterfaceLanguageSwitcher
},
computed: {
user () {
@@ -111,19 +115,25 @@ const ProfileTab = {
},
methods: {
updateProfile () {
+ const params = {
+ note: this.newBio,
+ locked: this.newLocked,
+ // Backend notation.
+ /* eslint-disable camelcase */
+ display_name: this.newName,
+ fields_attributes: this.newFields.filter(el => el != null),
+ bot: this.bot,
+ show_role: this.showRole
+ /* eslint-enable camelcase */
+ }
+
+ if (this.emailLanguage) {
+ params.language = localeService.internalToBackendLocale(this.emailLanguage)
+ }
+
this.$store.state.api.backendInteractor
- .updateProfile({
- params: {
- note: this.newBio,
- locked: this.newLocked,
- // Backend notation.
- /* eslint-disable camelcase */
- display_name: this.newName,
- fields_attributes: this.newFields.filter(el => el != null),
- bot: this.bot,
- show_role: this.showRole
- /* eslint-enable camelcase */
- } }).then((user) => {
+ .updateProfile({ params })
+ .then((user) => {
this.newFields.splice(user.fields.length)
merge(this.newFields, user.fields)
this.$store.commit('addNewUsers', [user])
@@ -193,8 +203,8 @@ const ProfileTab = {
submitAvatar (cropper, file) {
const that = this
return new Promise((resolve, reject) => {
- function updateAvatar (avatar) {
- that.$store.state.api.backendInteractor.updateProfileImages({ avatar })
+ function updateAvatar (avatar, avatarName) {
+ that.$store.state.api.backendInteractor.updateProfileImages({ avatar, avatarName })
.then((user) => {
that.$store.commit('addNewUsers', [user])
that.$store.commit('setCurrentUser', user)
@@ -207,9 +217,9 @@ const ProfileTab = {
}
if (cropper) {
- cropper.getCroppedCanvas().toBlob(updateAvatar, file.type)
+ cropper.getCroppedCanvas().toBlob((data) => updateAvatar(data, file.name), file.type)
} else {
- updateAvatar(file)
+ updateAvatar(file, file.name)
}
})
},
diff --git a/src/components/settings_modal/tabs/profile_tab.scss b/src/components/settings_modal/tabs/profile_tab.scss
index 111eaed3..201f1a76 100644
--- a/src/components/settings_modal/tabs/profile_tab.scss
+++ b/src/components/settings_modal/tabs/profile_tab.scss
@@ -54,16 +54,20 @@
border-radius: var(--tooltipRadius, $fallback--tooltipRadius);
background-color: rgba(0, 0, 0, 0.6);
opacity: 0.7;
- color: white;
width: 1.5em;
height: 1.5em;
text-align: center;
line-height: 1.5em;
font-size: 1.5em;
cursor: pointer;
+
&:hover {
opacity: 1;
}
+
+ svg {
+ color: white;
+ }
}
.oauth-tokens {
@@ -85,7 +89,7 @@
&-bulk-actions {
text-align: right;
padding: 0 1em;
- min-height: 28px;
+ min-height: 2em;
button {
width: 10em;
diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue
index e00f6e5b..4cd93772 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -68,8 +68,9 @@
class="delete-field button-unstyled -hover-highlight"
@click="deleteField(i)"
>
+ <!-- TODO something is wrong with v-show here -->
<FAIcon
- v-show="newFields.length > 1"
+ v-if="newFields.length > 1"
icon="times"
/>
</button>
@@ -88,6 +89,13 @@
{{ $t('settings.bot') }}
</Checkbox>
</p>
+ <p>
+ <interface-language-switcher
+ :prompt-text="$t('settings.email_language')"
+ :language="emailLanguage"
+ :set-language="val => emailLanguage = val"
+ />
+ </p>
<button
:disabled="newName && newName.length === 0"
class="btn button-default"
@@ -106,14 +114,17 @@
:src="user.profile_image_url_original"
class="current-avatar"
>
- <FAIcon
+ <button
v-if="!isDefaultAvatar && pickAvatarBtnVisible"
:title="$t('settings.reset_avatar')"
- class="reset-button"
- icon="times"
- type="button"
@click="resetAvatar"
- />
+ class="button-unstyled reset-button"
+ >
+ <FAIcon
+ icon="times"
+ type="button"
+ />
+ </button>
</div>
<p>{{ $t('settings.set_new_avatar') }}</p>
<button
@@ -135,14 +146,17 @@
<h2>{{ $t('settings.profile_banner') }}</h2>
<div class="banner-background-preview">
<img :src="user.cover_photo">
- <FAIcon
+ <button
v-if="!isDefaultBanner"
+ class="button-unstyled reset-button"
:title="$t('settings.reset_profile_banner')"
- class="reset-button"
- icon="times"
- type="button"
@click="resetBanner"
- />
+ >
+ <FAIcon
+ icon="times"
+ type="button"
+ />
+ </button>
</div>
<p>{{ $t('settings.set_new_profile_banner') }}</p>
<img
@@ -174,14 +188,17 @@
<h2>{{ $t('settings.profile_background') }}</h2>
<div class="banner-background-preview">
<img :src="user.background_image">
- <FAIcon
+ <button
v-if="!isDefaultBackground"
+ class="button-unstyled reset-button"
:title="$t('settings.reset_profile_background')"
- class="reset-button"
- icon="times"
- type="button"
@click="resetBackground"
- />
+ >
+ <FAIcon
+ icon="times"
+ type="button"
+ />
+ </button>
</div>
<p>{{ $t('settings.set_new_profile_background') }}</p>
<img
diff --git a/src/components/settings_modal/tabs/security_tab/security_tab.js b/src/components/settings_modal/tabs/security_tab/security_tab.js
index 65d20fc0..fc732936 100644
--- a/src/components/settings_modal/tabs/security_tab/security_tab.js
+++ b/src/components/settings_modal/tabs/security_tab/security_tab.js
@@ -15,11 +15,21 @@ const SecurityTab = {
deleteAccountError: false,
changePasswordInputs: [ '', '', '' ],
changedPassword: false,
- changePasswordError: false
+ changePasswordError: false,
+ moveAccountTarget: '',
+ moveAccountPassword: '',
+ movedAccount: false,
+ moveAccountError: false,
+ aliases: [],
+ listAliasesError: false,
+ addAliasTarget: '',
+ addedAlias: false,
+ addAliasError: false
}
},
created () {
this.$store.dispatch('fetchTokens')
+ this.fetchAliases()
},
components: {
ProgressButton,
@@ -92,6 +102,49 @@ const SecurityTab = {
}
})
},
+ moveAccount () {
+ const params = {
+ targetAccount: this.moveAccountTarget,
+ password: this.moveAccountPassword
+ }
+ this.$store.state.api.backendInteractor.moveAccount(params)
+ .then((res) => {
+ if (res.status === 'success') {
+ this.movedAccount = true
+ this.moveAccountError = false
+ } else {
+ this.movedAccount = false
+ this.moveAccountError = res.error
+ }
+ })
+ },
+ removeAlias (alias) {
+ this.$store.state.api.backendInteractor.deleteAlias({ alias })
+ .then(() => this.fetchAliases())
+ },
+ addAlias () {
+ this.$store.state.api.backendInteractor.addAlias({ alias: this.addAliasTarget })
+ .then((res) => {
+ this.addedAlias = true
+ this.addAliasError = false
+ this.addAliasTarget = ''
+ })
+ .catch((error) => {
+ this.addedAlias = false
+ this.addAliasError = error
+ })
+ .then(() => this.fetchAliases())
+ },
+ fetchAliases () {
+ this.$store.state.api.backendInteractor.listAliases()
+ .then((res) => {
+ this.aliases = res.aliases
+ this.listAliasesError = false
+ })
+ .catch((error) => {
+ this.listAliasesError = error.error
+ })
+ },
logout () {
this.$store.dispatch('logout')
this.$router.replace('/')
diff --git a/src/components/settings_modal/tabs/security_tab/security_tab.vue b/src/components/settings_modal/tabs/security_tab/security_tab.vue
index 275d4616..c74a0c67 100644
--- a/src/components/settings_modal/tabs/security_tab/security_tab.vue
+++ b/src/components/settings_modal/tabs/security_tab/security_tab.vue
@@ -103,6 +103,114 @@
</table>
</div>
<mfa />
+
+ <div class="setting-item">
+ <h2>{{ $t('settings.account_alias') }}</h2>
+ <table>
+ <thead>
+ <tr>
+ <th>{{ $t('settings.account_alias_table_head') }}</th>
+ <th />
+ </tr>
+ </thead>
+ <tbody>
+ <tr
+ v-for="alias in aliases"
+ :key="alias"
+ >
+ <td>{{ alias }}</td>
+ <td class="actions">
+ <button
+ class="btn button-default"
+ @click="removeAlias(alias)"
+ >
+ {{ $t('settings.remove_alias') }}
+ </button>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <div
+ v-if="listAliasesError"
+ class="alert error"
+ >
+ {{ $t('settings.list_aliases_error', { error }) }}
+ <FAIcon
+ class="fa-scale-110 fa-old-padding"
+ icon="times"
+ :title="$t('settings.hide_list_aliases_error_action')"
+ @click="listAliasesError = false"
+ />
+ </div>
+ <div>
+ <i18n
+ path="settings.new_alias_target"
+ tag="p"
+ >
+ <code
+ place="example"
+ >
+ foo@example.org
+ </code>
+ </i18n>
+ <input
+ v-model="addAliasTarget"
+ >
+ </div>
+ <button
+ class="btn button-default"
+ @click="addAlias"
+ >
+ {{ $t('settings.save') }}
+ </button>
+ <p v-if="addedAlias">
+ {{ $t('settings.added_alias') }}
+ </p>
+ <template v-if="addAliasError !== false">
+ <p>{{ $t('settings.add_alias_error', { error: addAliasError }) }}</p>
+ </template>
+ </div>
+
+ <div class="setting-item">
+ <h2>{{ $t('settings.move_account') }}</h2>
+ <p>{{ $t('settings.move_account_notes') }}</p>
+ <div>
+ <i18n
+ path="settings.move_account_target"
+ tag="p"
+ >
+ <code
+ place="example"
+ >
+ foo@example.org
+ </code>
+ </i18n>
+ <input
+ v-model="moveAccountTarget"
+ >
+ </div>
+ <div>
+ <p>{{ $t('settings.current_password') }}</p>
+ <input
+ v-model="moveAccountPassword"
+ type="password"
+ autocomplete="current-password"
+ >
+ </div>
+ <button
+ class="btn button-default"
+ @click="moveAccount"
+ >
+ {{ $t('settings.save') }}
+ </button>
+ <p v-if="movedAccount">
+ {{ $t('settings.moved_account') }}
+ </p>
+ <template v-if="moveAccountError !== false">
+ <p>{{ $t('settings.move_account_error', { error: moveAccountError }) }}</p>
+ </template>
+ </div>
+
<div class="setting-item">
<h2>{{ $t('settings.delete_account') }}</h2>
<p v-if="!deletingAccount">
diff --git a/src/components/settings_modal/tabs/theme_tab/preview.vue b/src/components/settings_modal/tabs/theme_tab/preview.vue
index 7ac7b9d3..f266b603 100644
--- a/src/components/settings_modal/tabs/theme_tab/preview.vue
+++ b/src/components/settings_modal/tabs/theme_tab/preview.vue
@@ -29,14 +29,14 @@
{{ $t('settings.style.preview.content') }}
</h4>
- <i18n path="settings.style.preview.text">
+ <i18n-t scope="global" keypath="settings.style.preview.text">
<code style="font-family: var(--postCodeFont)">
{{ $t('settings.style.preview.mono') }}
</code>
<a style="color: var(--link)">
{{ $t('settings.style.preview.link') }}
</a>
- </i18n>
+ </i18n-t>
<div class="icons">
<FAIcon
@@ -72,15 +72,16 @@
:^)
</div>
<div class="content">
- <i18n
- path="settings.style.preview.fine_print"
+ <i18n-t
+ keypath="settings.style.preview.fine_print"
tag="span"
class="faint"
+ scope="global"
>
<a style="color: var(--faintLink)">
{{ $t('settings.style.preview.faint_link') }}
</a>
- </i18n>
+ </i18n-t>
</div>
</div>
<div class="separator" />
diff --git a/src/components/settings_modal/tabs/theme_tab/theme_tab.js b/src/components/settings_modal/tabs/theme_tab/theme_tab.js
index 0b6669fc..7e1da7ab 100644
--- a/src/components/settings_modal/tabs/theme_tab/theme_tab.js
+++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.js
@@ -1,4 +1,3 @@
-import { set, delete as del } from 'vue'
import {
rgb2hex,
hex2rgb,
@@ -34,7 +33,7 @@ import OpacityInput from 'src/components/opacity_input/opacity_input.vue'
import ShadowControl from 'src/components/shadow_control/shadow_control.vue'
import FontControl from 'src/components/font_control/font_control.vue'
import ContrastRatio from 'src/components/contrast_ratio/contrast_ratio.vue'
-import TabSwitcher from 'src/components/tab_switcher/tab_switcher.js'
+import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
import Checkbox from 'src/components/checkbox/checkbox.vue'
import Select from 'src/components/select/select.vue'
@@ -320,9 +319,9 @@ export default {
},
set (val) {
if (val) {
- set(this.shadowsLocal, this.shadowSelected, this.currentShadowFallback.map(_ => Object.assign({}, _)))
+ this.shadowsLocal[this.shadowSelected] = this.currentShadowFallback.map(_ => Object.assign({}, _))
} else {
- del(this.shadowsLocal, this.shadowSelected)
+ delete this.shadowsLocal[this.shadowSelected]
}
}
},
@@ -334,7 +333,7 @@ export default {
return this.shadowsLocal[this.shadowSelected]
},
set (v) {
- set(this.shadowsLocal, this.shadowSelected, v)
+ this.shadowsLocal[this.shadowSelected] = v
}
},
themeValid () {
@@ -378,6 +377,10 @@ export default {
// To separate from other random JSON files and possible future source formats
_pleroma_theme_version: 2, theme, source
}
+ },
+ isActive () {
+ const tabSwitcher = this.$parent
+ return tabSwitcher ? tabSwitcher.isActive('theme') : false
}
},
components: {
@@ -557,7 +560,7 @@ export default {
.filter(_ => _.endsWith('ColorLocal') || _.endsWith('OpacityLocal'))
.filter(_ => !v1OnlyNames.includes(_))
.forEach(key => {
- set(this.$data, key, undefined)
+ this.$data[key] = undefined
})
},
@@ -565,7 +568,7 @@ export default {
Object.keys(this.$data)
.filter(_ => _.endsWith('RadiusLocal'))
.forEach(key => {
- set(this.$data, key, undefined)
+ this.$data[key] = undefined
})
},
@@ -573,7 +576,7 @@ export default {
Object.keys(this.$data)
.filter(_ => _.endsWith('OpacityLocal'))
.forEach(key => {
- set(this.$data, key, undefined)
+ this.$data[key] = undefined
})
},
diff --git a/src/components/settings_modal/tabs/theme_tab/theme_tab.scss b/src/components/settings_modal/tabs/theme_tab/theme_tab.scss
index 0db21537..bad6f51b 100644
--- a/src/components/settings_modal/tabs/theme_tab/theme_tab.scss
+++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.scss
@@ -245,36 +245,12 @@
border-color: var(--border, $fallback--border);
}
- .panel-heading {
- .badge, .alert, .btn, .faint {
- margin-left: 1em;
- white-space: nowrap;
- }
- .faint {
- text-overflow: ellipsis;
- min-width: 2em;
- overflow-x: hidden;
- }
- .flex-spacer {
- flex: 1;
- }
- }
.btn {
- margin-left: 0;
- padding: 0 1em;
min-width: 3em;
- min-height: 30px;
}
}
}
- .apply-container {
- justify-content: center;
- position: absolute;
- bottom: 8px;
- right: 5px;
- }
-
.radius-item,
.color-item {
min-width: 20em;
@@ -334,16 +310,25 @@
padding: 20px;
}
- .apply-container {
- .btn {
- min-height: 28px;
- min-width: 10em;
- padding: 0 2em;
- }
- }
-
.btn {
margin-left: .25em;
margin-right: .25em;
}
}
+
+.extra-content {
+ .apply-container {
+ display: flex;
+ flex-direction: row;
+ justify-content: space-around;
+ flex-grow: 1;
+
+ .btn {
+ flex-grow: 1;
+ min-height: 2em;
+ min-width: 0;
+ max-width: 10em;
+ padding: 0;
+ }
+ }
+}
diff --git a/src/components/settings_modal/tabs/theme_tab/theme_tab.vue b/src/components/settings_modal/tabs/theme_tab/theme_tab.vue
index c02986ed..ff2fece9 100644
--- a/src/components/settings_modal/tabs/theme_tab/theme_tab.vue
+++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.vue
@@ -903,6 +903,7 @@
<div class="tab-header shadow-selector">
<div class="select-container">
{{ $t('settings.style.shadows.component') }}
+ {{ ' ' }}
<Select
id="shadow-switcher"
v-model="shadowSelected"
@@ -924,6 +925,7 @@
>
{{ $t('settings.style.shadows.override') }}
</label>
+ {{ ' ' }}
<input
id="override"
v-model="currentShadowOverriden"
@@ -949,27 +951,30 @@
:fallback="currentShadowFallback"
/>
<div v-if="shadowSelected === 'avatar' || shadowSelected === 'avatarStatus'">
- <i18n
- path="settings.style.shadows.filter_hint.always_drop_shadow"
+ <i18n-t
+ scope="global"
+ keypath="settings.style.shadows.filter_hint.always_drop_shadow"
tag="p"
>
<code>filter: drop-shadow()</code>
- </i18n>
+ </i18n-t>
<p>{{ $t('settings.style.shadows.filter_hint.avatar_inset') }}</p>
- <i18n
- path="settings.style.shadows.filter_hint.drop_shadow_syntax"
+ <i18n-t
+ scope="global"
+ keypath="settings.style.shadows.filter_hint.drop_shadow_syntax"
tag="p"
>
<code>drop-shadow</code>
<code>spread-radius</code>
<code>inset</code>
- </i18n>
- <i18n
- path="settings.style.shadows.filter_hint.inset_classic"
+ </i18n-t>
+ <i18n-t
+ scope="global"
+ keypath="settings.style.shadows.filter_hint.inset_classic"
tag="p"
>
<code>box-shadow</code>
- </i18n>
+ </i18n-t>
<p>{{ $t('settings.style.shadows.filter_hint.spread_zero') }}</p>
</div>
</div>
@@ -1016,21 +1021,26 @@
</tab-switcher>
</keep-alive>
- <div class="apply-container">
- <button
- class="btn button-default submit"
- :disabled="!themeValid"
- @click="setCustomTheme"
- >
- {{ $t('general.apply') }}
- </button>
- <button
- class="btn button-default"
- @click="clearAll"
- >
- {{ $t('settings.style.switcher.reset') }}
- </button>
- </div>
+ <teleport
+ v-if="isActive"
+ to="#unscrolled-content"
+ >
+ <div class="apply-container">
+ <button
+ class="btn button-default submit"
+ :disabled="!themeValid"
+ @click="setCustomTheme"
+ >
+ {{ $t('general.apply') }}
+ </button>
+ <button
+ class="btn button-default"
+ @click="clearAll"
+ >
+ {{ $t('settings.style.switcher.reset') }}
+ </button>
+ </div>
+ </teleport>
</div>
</template>
diff --git a/src/components/settings_modal/tabs/version_tab.vue b/src/components/settings_modal/tabs/version_tab.vue
index d35ff25e..0330d49f 100644
--- a/src/components/settings_modal/tabs/version_tab.vue
+++ b/src/components/settings_modal/tabs/version_tab.vue
@@ -28,4 +28,4 @@
</div>
</div>
</template>
-<script src="./version_tab.js">
+<script src="./version_tab.js" />
diff --git a/src/components/shadow_control/shadow_control.js b/src/components/shadow_control/shadow_control.js
index 2d5d6eb1..386a5756 100644
--- a/src/components/shadow_control/shadow_control.js
+++ b/src/components/shadow_control/shadow_control.js
@@ -30,18 +30,19 @@ const toModel = (object = {}) => ({
})
export default {
- // 'Value' and 'Fallback' can be undefined, but if they are
+ // 'modelValue' and 'Fallback' can be undefined, but if they are
// initially vue won't detect it when they become something else
// therefore i'm using "ready" which should be passed as true when
// data becomes available
props: [
- 'value', 'fallback', 'ready'
+ 'modelValue', 'fallback', 'ready'
],
+ emits: ['update:modelValue'],
data () {
return {
selectedId: 0,
// TODO there are some bugs regarding display of array (it's not getting updated when deleting for some reason)
- cValue: (this.value || this.fallback || []).map(toModel)
+ cValue: (this.modelValue || this.fallback || []).map(toModel)
}
},
components: {
@@ -70,7 +71,7 @@ export default {
}
},
beforeUpdate () {
- this.cValue = this.value || this.fallback
+ this.cValue = this.modelValue || this.fallback
},
computed: {
anyShadows () {
@@ -105,7 +106,7 @@ export default {
!this.usingFallback
},
usingFallback () {
- return typeof this.value === 'undefined'
+ return typeof this.modelValue === 'undefined'
},
rgb () {
return hex2rgb(this.selected.color)
diff --git a/src/components/shadow_control/shadow_control.vue b/src/components/shadow_control/shadow_control.vue
index 511e07f3..f2fc7b99 100644
--- a/src/components/shadow_control/shadow_control.vue
+++ b/src/components/shadow_control/shadow_control.vue
@@ -204,12 +204,13 @@
v-model="selected.alpha"
:disabled="!present"
/>
- <i18n
- path="settings.style.shadows.hintV3"
+ <i18n-t
+ scope="global"
+ keypath="settings.style.shadows.hintV3"
tag="p"
>
<code>--variable,mod</code>
- </i18n>
+ </i18n-t>
</div>
</div>
</template>
diff --git a/src/components/shout_panel/shout_panel.vue b/src/components/shout_panel/shout_panel.vue
index c88797d1..1eca88a7 100644
--- a/src/components/shout_panel/shout_panel.vue
+++ b/src/components/shout_panel/shout_panel.vue
@@ -57,7 +57,7 @@
>
<div class="panel panel-default">
<div
- class="panel-heading stub timeline-heading shout-heading"
+ class="panel-heading -stub timeline-heading shout-heading"
@click.stop.prevent="togglePanel"
>
<div class="title">
@@ -79,17 +79,17 @@
.floating-shout {
position: fixed;
- bottom: 0px;
+ bottom: 0.5em;
z-index: 1000;
max-width: 25em;
-}
-.floating-shout.left {
- left: 0px;
-}
+ &.-left {
+ left: 0.5em;
+ }
-.floating-shout:not(.left) {
- right: 0px;
+ &:not(.-left) {
+ right: 0.5em;
+ }
}
.shout-panel {
@@ -98,7 +98,7 @@
.icon {
color: $fallback--text;
- color: var(--text, $fallback--text);
+ color: var(--panelText, $fallback--text);
margin-right: 0.5em;
}
@@ -121,7 +121,7 @@
.shout-message {
display: flex;
- padding: 0.2em 0.5em
+ padding: 0.2em 0.5em;
}
.shout-avatar {
@@ -137,6 +137,7 @@
.shout-input {
display: flex;
+
textarea {
flex: 1;
margin: 0.6em;
diff --git a/src/components/side_drawer/side_drawer.js b/src/components/side_drawer/side_drawer.js
index 89719df3..bad1806b 100644
--- a/src/components/side_drawer/side_drawer.js
+++ b/src/components/side_drawer/side_drawer.js
@@ -49,7 +49,7 @@ const SideDrawer = {
currentUser () {
return this.$store.state.users.currentUser
},
- shout () { return this.$store.state.shout.channel.state === 'joined' },
+ shout () { return this.$store.state.shout.joined },
unseenNotifications () {
return unseenNotificationsFromStore(this.$store)
},
diff --git a/src/components/status/status.js b/src/components/status/status.js
index 4c0ef3e0..a925f30b 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -69,7 +69,7 @@ const controlledOrUncontrolledGetters = list => list.reduce((res, name) => {
const controlledName = `controlled${camelized}`
const uncontrolledName = `uncontrolled${camelized}`
res[name] = function () {
- return this[toggle] ? this[controlledName] : this[uncontrolledName]
+ return ((this.$data[toggle] !== undefined || this.$props[toggle] !== undefined) && this[toggle]) ? this[controlledName] : this[uncontrolledName]
}
return res
}, {})
@@ -225,12 +225,18 @@ const Status = {
muteWordHits () {
return muteWordHits(this.status, this.muteWords)
},
+ rtBotStatus () {
+ return this.statusoid.user.bot
+ },
botStatus () {
return this.status.user.bot
},
botIndicator () {
return this.botStatus && !this.hideBotIndication
},
+ rtBotIndicator () {
+ return this.rtBotStatus && !this.hideBotIndication
+ },
mentionsLine () {
if (!this.headTailLinks) return []
const writtenSet = new Set(this.headTailLinks.writtenMentions.map(_ => _.url))
@@ -305,7 +311,7 @@ const Status = {
return this.mergedConfig.hideWordFilteredPosts
},
hideStatus () {
- return (this.virtualHidden || !this.shouldNotMute) && (
+ return (!this.shouldNotMute) && (
(this.muted && this.hideFilteredStatuses) ||
(this.userIsMuted && this.hideMutedUsers) ||
(this.status.thread_muted && this.hideMutedThreads) ||
@@ -383,6 +389,9 @@ const Status = {
},
threadShowing () {
return this.controlledThreadDisplayStatus === 'showing'
+ },
+ visibilityLocalized () {
+ return this.$i18n.t('general.scope_in_timeline.' + this.status.visibility)
}
},
methods: {
@@ -472,11 +481,6 @@ const Status = {
'isSuspendable': function (val) {
this.suspendable = val
}
- },
- filters: {
- capitalize: function (str) {
- return str.charAt(0).toUpperCase() + str.slice(1)
- }
}
}
diff --git a/src/components/status/status.scss b/src/components/status/status.scss
index 3f647b25..b3ad3818 100644
--- a/src/components/status/status.scss
+++ b/src/components/status/status.scss
@@ -42,6 +42,10 @@
display: flex;
padding: var(--status-margin, $status-margin);
+ > * {
+ min-width: 0;
+ }
+
&.-repeat {
padding-top: 0;
}
@@ -78,7 +82,6 @@
.status-username {
white-space: nowrap;
- font-size: 14px;
overflow: hidden;
max-width: 85%;
font-weight: bold;
@@ -103,7 +106,7 @@
.heading-name-row {
display: flex;
justify-content: space-between;
- line-height: 18px;
+ line-height: 1.3;
a {
display: inline-block;
@@ -156,7 +159,7 @@
& .heading-reply-row {
position: relative;
align-content: baseline;
- font-size: 12px;
+ font-size: 0.85em;
margin-top: 0.2em;
line-height: 130%;
max-width: 100%;
@@ -224,8 +227,8 @@
.replies {
margin-top: 0.25em;
- line-height: 18px;
- font-size: 12px;
+ line-height: 1.3;
+ font-size: 0.85em;
display: flex;
flex-wrap: wrap;
@@ -385,14 +388,14 @@
.stat-title {
color: var(--faint, $fallback--faint);
- font-size: 12px;
+ font-size: 0.85em;
text-transform: uppercase;
position: relative;
}
.stat-number {
font-weight: bolder;
- font-size: 16px;
+ font-size: 1.1em;
line-height: 1em;
}
@@ -406,13 +409,13 @@
margin-left: 20px;
}
- .avatar:not(.repeater-avatar) {
+ .post-avatar {
width: 40px;
height: 40px;
// TODO define those other way somehow?
// stylelint-disable rscss/class-format
- &.avatar-compact {
+ &.-compact {
width: 32px;
height: 32px;
}
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index 1679834e..67ce999a 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -1,6 +1,7 @@
<template>
<div
v-if="!hideStatus"
+ ref="root"
class="Status"
:class="[{ '-focused': isFocused }, { '-conversation': inlineExpanded }]"
>
@@ -77,7 +78,7 @@
<UserAvatar
v-if="retweet"
class="left-side repeater-avatar"
- :bot="botIndicator"
+ :bot="rtBotIndicator"
:better-shadow="betterShadow"
:user="statusoid.user"
/>
@@ -100,6 +101,7 @@
:to="retweeterProfileLink"
>{{ retweeter }}</router-link>
</span>
+ {{ ' ' }}
<FAIcon
icon="retweet"
class="repeat-icon"
@@ -120,17 +122,18 @@
v-if="!noHeading"
class="left-side"
>
- <router-link
- :to="userProfileLink"
- @click.stop.prevent.capture.native="toggleUserExpanded"
+ <a
+ :href="$router.resolve(userProfileLink).href"
+ @click.stop.prevent.capture="toggleUserExpanded"
>
<UserAvatar
+ class="post-avatar"
:bot="botIndicator"
:compact="compact"
:better-shadow="betterShadow"
:user="status.user"
/>
- </router-link>
+ </a>
</div>
<div class="right-side">
<UserCard
@@ -190,7 +193,7 @@
<span
v-if="status.visibility"
class="visibility-icon"
- :title="status.visibility | capitalize"
+ :title="visibilityLocalized"
>
<FAIcon
fixed-width
@@ -273,6 +276,7 @@
icon="reply"
flip="horizontal"
/>
+ {{ ' ' }}
<span
class="reply-to-text"
>
@@ -292,7 +296,6 @@
:url="replyProfileLink"
:user-id="status.in_reply_to_user_id"
:user-screen-name="status.in_reply_to_screen_name"
- :first-mention="false"
/>
</span>
@@ -454,6 +457,7 @@
>
<div class="left-side">
<UserAvatar
+ class="post-avatar"
:compact="compact"
:bot="botIndicator"
/>
diff --git a/src/components/status_body/status_body.scss b/src/components/status_body/status_body.scss
index f261108e..039d4c7f 100644
--- a/src/components/status_body/status_body.scss
+++ b/src/components/status_body/status_body.scss
@@ -19,7 +19,7 @@
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-word;
- line-height: 1.4em;
+ line-height: var(--post-line-height);
}
.summary {
diff --git a/src/components/status_body/status_body.vue b/src/components/status_body/status_body.vue
index 24d842c2..976fe98c 100644
--- a/src/components/status_body/status_body.vue
+++ b/src/components/status_body/status_body.vue
@@ -15,14 +15,14 @@
:emoji="status.emojis"
/>
<button
- v-if="longSubject && showingLongSubject"
+ v-show="longSubject && showingLongSubject"
class="button-unstyled -link tall-subject-hider"
@click.prevent="toggleShowingLongSubject"
>
{{ $t("status.hide_full_subject") }}
</button>
<button
- v-else-if="longSubject"
+ v-show="longSubject && !showingLongSubject"
class="button-unstyled -link tall-subject-hider"
@click.prevent="toggleShowingLongSubject"
>
@@ -34,7 +34,7 @@
class="text-wrapper"
>
<button
- v-if="hideTallStatus"
+ v-show="hideTallStatus"
class="button-unstyled -link tall-status-hider"
:class="{ '-focused': focused }"
@click.prevent="toggleShowMore"
@@ -54,7 +54,7 @@
/>
<button
- v-if="hideSubjectStatus"
+ v-show="hideSubjectStatus"
class="button-unstyled -link cw-status-hider"
@click.prevent="toggleShowMore"
>
@@ -85,7 +85,7 @@
/>
</button>
<button
- v-if="showingMore && !fullContent"
+ v-show="showingMore && !fullContent"
class="button-unstyled -link status-unhider"
@click.prevent="toggleShowMore"
>
diff --git a/src/components/status_content/status_content.js b/src/components/status_content/status_content.js
index cf72ccb8..89f0aa51 100644
--- a/src/components/status_content/status_content.js
+++ b/src/components/status_content/status_content.js
@@ -31,7 +31,7 @@ const controlledOrUncontrolledGetters = list => list.reduce((res, name) => {
const controlledName = `controlled${camelized}`
const uncontrolledName = `uncontrolled${camelized}`
res[name] = function () {
- return this[toggle] ? this[controlledName] : this[uncontrolledName]
+ return ((this.$data[toggle] !== undefined || this.$props[toggle] !== undefined) && this[toggle]) ? this[controlledName] : this[uncontrolledName]
}
return res
}, {})
@@ -59,7 +59,9 @@ const StatusContent = {
'controlledShowingTall',
'controlledExpandingSubject',
'controlledToggleShowingTall',
- 'controlledToggleExpandingSubject'
+ 'controlledToggleExpandingSubject',
+ 'controlledShowingLongSubject',
+ 'controlledToggleShowingLongSubject'
],
data () {
return {
diff --git a/src/components/status_popover/status_popover.js b/src/components/status_popover/status_popover.js
index c47f5631..e0962ccd 100644
--- a/src/components/status_popover/status_popover.js
+++ b/src/components/status_popover/status_popover.js
@@ -1,6 +1,7 @@
import { find } from 'lodash'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons'
+import { defineAsyncComponent } from 'vue'
library.add(
faCircleNotch
@@ -22,8 +23,8 @@ const StatusPopover = {
}
},
components: {
- Status: () => import('../status/status.vue'),
- Popover: () => import('../popover/popover.vue')
+ Status: defineAsyncComponent(() => import('../status/status.vue')),
+ Popover: defineAsyncComponent(() => import('../popover/popover.vue'))
},
methods: {
enter () {
diff --git a/src/components/sticker_picker/sticker_picker.js b/src/components/sticker_picker/sticker_picker.js
index 8daf3f07..3a2d3914 100644
--- a/src/components/sticker_picker/sticker_picker.js
+++ b/src/components/sticker_picker/sticker_picker.js
@@ -1,6 +1,6 @@
/* eslint-env browser */
import statusPosterService from '../../services/status_poster/status_poster.service.js'
-import TabSwitcher from '../tab_switcher/tab_switcher.js'
+import TabSwitcher from '../tab_switcher/tab_switcher.jsx'
const StickerPicker = {
components: {
diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue
index e939b532..ab3080c8 100644
--- a/src/components/still-image/still-image.vue
+++ b/src/components/still-image/still-image.vue
@@ -58,10 +58,10 @@
zoom: var(--_still_image-label-scale, 1);
content: 'gif';
position: absolute;
- line-height: 10px;
- font-size: 10px;
- top: 5px;
- left: 5px;
+ line-height: 1;
+ font-size: 0.7em;
+ top: 0.5em;
+ left: 0.5em;
background: rgba(127, 127, 127, 0.5);
color: #fff;
display: block;
diff --git a/src/components/tab_switcher/tab_switcher.js b/src/components/tab_switcher/tab_switcher.jsx
index 12aac8e6..c8d390bc 100644
--- a/src/components/tab_switcher/tab_switcher.js
+++ b/src/components/tab_switcher/tab_switcher.jsx
@@ -1,10 +1,13 @@
-import Vue from 'vue'
+// eslint-disable-next-line no-unused
+import { h, Fragment } from 'vue'
import { mapState } from 'vuex'
import { FontAwesomeIcon as FAIcon } from '@fortawesome/vue-fontawesome'
import './tab_switcher.scss'
-export default Vue.component('tab-switcher', {
+const findFirstUsable = (slots) => slots.findIndex(_ => _.props)
+
+export default {
name: 'TabSwitcher',
props: {
renderOnlyFocused: {
@@ -31,22 +34,33 @@ export default Vue.component('tab-switcher', {
required: false,
type: Boolean,
default: false
+ },
+ bodyScrollLock: {
+ required: false,
+ type: Boolean,
+ default: false
}
},
data () {
return {
- active: this.$slots.default.findIndex(_ => _.tag)
+ active: findFirstUsable(this.slots())
}
},
computed: {
activeIndex () {
// In case of controlled component
if (this.activeTab) {
- return this.$slots.default.findIndex(slot => this.activeTab === slot.key)
+ return this.slots().findIndex(slot => slot && slot.props && this.activeTab === slot.props.key)
} else {
return this.active
}
},
+ isActive () {
+ return tabName => {
+ const isWanted = slot => slot.props && slot.props['data-tab-name'] === tabName
+ return this.$slots.default().findIndex(isWanted) === this.activeIndex
+ }
+ },
settingsModalVisible () {
return this.settingsModalState === 'visible'
},
@@ -55,9 +69,9 @@ export default Vue.component('tab-switcher', {
})
},
beforeUpdate () {
- const currentSlot = this.$slots.default[this.active]
- if (!currentSlot.tag) {
- this.active = this.$slots.default.findIndex(_ => _.tag)
+ const currentSlot = this.slots()[this.active]
+ if (!currentSlot.props) {
+ this.active = findFirstUsable(this.slots())
}
},
methods: {
@@ -67,9 +81,16 @@ export default Vue.component('tab-switcher', {
this.setTab(index)
}
},
+ // DO NOT put it to computed, it doesn't work (caching?)
+ slots () {
+ if (this.$slots.default()[0].type === Fragment) {
+ return this.$slots.default()[0].children
+ }
+ return this.$slots.default()
+ },
setTab (index) {
if (typeof this.onSwitch === 'function') {
- this.onSwitch.call(null, this.$slots.default[index].key)
+ this.onSwitch.call(null, this.slots()[index].key)
}
this.active = index
if (this.scrollableTabs) {
@@ -77,27 +98,28 @@ export default Vue.component('tab-switcher', {
}
}
},
- render (h) {
- const tabs = this.$slots.default
+ render () {
+ const tabs = this.slots()
.map((slot, index) => {
- if (!slot.tag) return
+ const props = slot.props
+ if (!props) return
const classesTab = ['tab', 'button-default']
const classesWrapper = ['tab-wrapper']
if (this.activeIndex === index) {
classesTab.push('active')
classesWrapper.push('active')
}
- if (slot.data.attrs.image) {
+ if (props.image) {
return (
<div class={classesWrapper.join(' ')}>
<button
- disabled={slot.data.attrs.disabled}
+ disabled={props.disabled}
onClick={this.clickTab(index)}
class={classesTab.join(' ')}
type="button"
>
- <img src={slot.data.attrs.image} title={slot.data.attrs['image-tooltip']}/>
- {slot.data.attrs.label ? '' : slot.data.attrs.label}
+ <img src={props.image} title={props['image-tooltip']}/>
+ {props.label ? '' : props.label}
</button>
</div>
)
@@ -105,25 +127,26 @@ export default Vue.component('tab-switcher', {
return (
<div class={classesWrapper.join(' ')}>
<button
- disabled={slot.data.attrs.disabled}
+ disabled={props.disabled}
onClick={this.clickTab(index)}
class={classesTab.join(' ')}
type="button"
>
- {!slot.data.attrs.icon ? '' : (<FAIcon class="tab-icon" size="2x" fixed-width icon={slot.data.attrs.icon}/>)}
+ {!props.icon ? '' : (<FAIcon class="tab-icon" size="2x" fixed-width icon={props.icon}/>)}
<span class="text">
- {slot.data.attrs.label}
+ {props.label}
</span>
</button>
</div>
)
})
- const contents = this.$slots.default.map((slot, index) => {
- if (!slot.tag) return
+ const contents = this.slots().map((slot, index) => {
+ const props = slot.props
+ if (!props) return
const active = this.activeIndex === index
const classes = [ active ? 'active' : 'hidden' ]
- if (slot.data.attrs.fullHeight) {
+ if (props.fullHeight) {
classes.push('full-height')
}
const renderSlot = (!this.renderOnlyFocused || active)
@@ -134,7 +157,7 @@ export default Vue.component('tab-switcher', {
<div class={classes}>
{
this.sideTabBar
- ? <h1 class="mobile-label">{slot.data.attrs.label}</h1>
+ ? <h1 class="mobile-label">{props.label}</h1>
: ''
}
{renderSlot}
@@ -147,10 +170,14 @@ export default Vue.component('tab-switcher', {
<div class="tabs">
{tabs}
</div>
- <div ref="contents" class={'contents' + (this.scrollableTabs ? ' scrollable-tabs' : '')} v-body-scroll-lock={this.settingsModalVisible}>
+ <div
+ ref="contents"
+ class={'contents' + (this.scrollableTabs ? ' scrollable-tabs' : '')}
+ v-body-scroll-lock={this.bodyScrollLock}
+ >
{contents}
</div>
</div>
)
}
-})
+}
diff --git a/src/components/tab_switcher/tab_switcher.scss b/src/components/tab_switcher/tab_switcher.scss
index 0ed614b7..7a086b26 100644
--- a/src/components/tab_switcher/tab_switcher.scss
+++ b/src/components/tab_switcher/tab_switcher.scss
@@ -25,8 +25,9 @@
border-bottom-color: $fallback--border;
border-bottom-color: var(--border, $fallback--border);
}
+
.tab-wrapper {
- height: 28px;
+ height: 2em;
&:not(.active)::after {
left: 0;
@@ -166,13 +167,6 @@
position: relative;
white-space: nowrap;
padding: 6px 1em;
- background-color: $fallback--fg;
- background-color: var(--tab, $fallback--fg);
-
- &, &:active .tab-icon {
- color: $fallback--text;
- color: var(--tabText, $fallback--text);
- }
&:not(.active) {
z-index: 4;
diff --git a/src/components/tag_timeline/tag_timeline.js b/src/components/tag_timeline/tag_timeline.js
index 400c6a4b..bda61ae0 100644
--- a/src/components/tag_timeline/tag_timeline.js
+++ b/src/components/tag_timeline/tag_timeline.js
@@ -18,7 +18,7 @@ const TagTimeline = {
this.$store.dispatch('startFetchingTimeline', { timeline: 'tag', tag: this.tag })
}
},
- destroyed () {
+ unmounted () {
this.$store.dispatch('stopFetchingTimeline', 'tag')
}
}
diff --git a/src/components/thread_tree/thread_tree.vue b/src/components/thread_tree/thread_tree.vue
index e64455e0..4eaf597d 100644
--- a/src/components/thread_tree/thread_tree.vue
+++ b/src/components/thread_tree/thread_tree.vue
@@ -1,5 +1,5 @@
<template>
- <div class="thread-tree panel-body">
+ <div class="thread-tree">
<status
:key="status.id"
ref="statusComponent"
@@ -74,36 +74,44 @@
v-if="currentReplies.length && !threadShowing"
class="thread-tree-replies thread-tree-replies-hidden"
>
- <i18n
+ <i18n-t
v-if="simple"
+ scope="global"
tag="button"
- path="status.thread_follow_with_icon"
+ keypath="status.thread_follow_with_icon"
class="button-unstyled -link thread-tree-show-replies-button"
@click.prevent="dive(status.id)"
>
- <FAIcon
- place="icon"
- icon="angle-double-right"
- />
- <span place="text">
- {{ $tc('status.thread_follow', totalReplyCount[status.id], { numStatus: totalReplyCount[status.id] }) }}
- </span>
- </i18n>
- <i18n
+ <template #icon>
+ <FAIcon
+ icon="angle-double-right"
+ />
+ </template>
+ <template #text>
+ <span>
+ {{ $tc('status.thread_follow', totalReplyCount[status.id], { numStatus: totalReplyCount[status.id] }) }}
+ </span>
+ </template>
+ </i18n-t>
+ <i18n-t
v-else
+ scope="global"
tag="button"
- path="status.thread_show_full_with_icon"
+ keypath="status.thread_show_full_with_icon"
class="button-unstyled -link thread-tree-show-replies-button"
@click.prevent="showThreadRecursively(status.id)"
>
- <FAIcon
- place="icon"
- icon="angle-double-down"
- />
- <span place="text">
- {{ $tc('status.thread_show_full', totalReplyCount[status.id], { numStatus: totalReplyCount[status.id], depth: totalReplyDepth[status.id] }) }}
- </span>
- </i18n>
+ <template #icon>
+ <FAIcon
+ icon="angle-double-down"
+ />
+ </template>
+ <template #text>
+ <span>
+ {{ $tc('status.thread_show_full', totalReplyCount[status.id], { numStatus: totalReplyCount[status.id], depth: totalReplyDepth[status.id] }) }}
+ </span>
+ </template>
+ </i18n-t>
</div>
</div>
</template>
diff --git a/src/components/timeago/timeago.vue b/src/components/timeago/timeago.vue
index 55a2dd94..2b487dfd 100644
--- a/src/components/timeago/timeago.vue
+++ b/src/components/timeago/timeago.vue
@@ -3,7 +3,7 @@
:datetime="time"
:title="localeDateString"
>
- {{ $t(relativeTime.key, [relativeTime.num]) }}
+ {{ $tc(relativeTime.key, relativeTime.num, [relativeTime.num]) }}
</time>
</template>
@@ -31,7 +31,7 @@ export default {
created () {
this.refreshRelativeTimeObject()
},
- destroyed () {
+ unmounted () {
clearTimeout(this.interval)
},
methods: {
diff --git a/src/components/timeline/timeline.js b/src/components/timeline/timeline.js
index 04f0e7d6..c575e876 100644
--- a/src/components/timeline/timeline.js
+++ b/src/components/timeline/timeline.js
@@ -22,7 +22,8 @@ const Timeline = {
'embedded',
'count',
'pinnedStatusIds',
- 'inProfile'
+ 'inProfile',
+ 'footerSlipgate' // reference to an element where we should put our footer
],
data () {
return {
@@ -40,6 +41,12 @@ const Timeline = {
TimelineQuickSettings
},
computed: {
+ filteredVisibleStatuses () {
+ return this.timeline.visibleStatuses.filter(status => this.timelineName !== 'user' || (status.id >= this.timeline.minId && status.id <= this.timeline.maxId))
+ },
+ filteredPinnedStatusIds () {
+ return (this.pinnedStatusIds || []).filter(statusId => this.timeline.statusesObject[statusId])
+ },
newStatusCount () {
return this.timeline.newStatusCount
},
@@ -54,11 +61,11 @@ const Timeline = {
}
},
classes () {
- let rootClasses = !this.embedded ? ['panel', 'panel-default'] : []
+ let rootClasses = !this.embedded ? ['panel', 'panel-default'] : ['-nonpanel']
if (this.blockingClicks) rootClasses = rootClasses.concat(['-blocked', '_misclick-prevention'])
return {
root: rootClasses,
- header: ['timeline-heading'].concat(!this.embedded ? ['panel-heading'] : []),
+ header: ['timeline-heading'].concat(!this.embedded ? ['panel-heading', '-sticky'] : []),
body: ['timeline-body'].concat(!this.embedded ? ['panel-body'] : []),
footer: ['timeline-footer'].concat(!this.embedded ? ['panel-footer'] : [])
}
@@ -70,8 +77,9 @@ const Timeline = {
statusesToDisplay () {
const amount = this.timeline.visibleStatuses.length
const statusesPerSide = Math.ceil(Math.max(3, window.innerHeight / 80))
- const min = Math.max(0, this.virtualScrollIndex - statusesPerSide)
- const max = Math.min(amount, this.virtualScrollIndex + statusesPerSide)
+ const nonPinnedIndex = this.virtualScrollIndex - this.filteredPinnedStatusIds.length
+ const min = Math.max(0, nonPinnedIndex - statusesPerSide)
+ const max = Math.min(amount, nonPinnedIndex + statusesPerSide)
return this.timeline.visibleStatuses.slice(min, max).map(_ => _.id)
},
virtualScrollingEnabled () {
@@ -104,7 +112,7 @@ const Timeline = {
window.addEventListener('keydown', this.handleShortKey)
setTimeout(this.determineVisibleStatuses, 250)
},
- destroyed () {
+ unmounted () {
window.removeEventListener('scroll', this.handleScroll)
window.removeEventListener('keydown', this.handleShortKey)
if (typeof document.hidden !== 'undefined') document.removeEventListener('visibilitychange', this.handleVisibilityChange, false)
@@ -135,6 +143,7 @@ const Timeline = {
this.$store.commit('showNewStatuses', { timeline: this.timelineName })
this.paused = false
}
+ window.scrollTo({ top: 0 })
},
fetchOlderStatuses: throttle(function () {
const store = this.$store
diff --git a/src/components/timeline/timeline.scss b/src/components/timeline/timeline.scss
index 2c5a67e2..9e009fd3 100644
--- a/src/components/timeline/timeline.scss
+++ b/src/components/timeline/timeline.scss
@@ -9,23 +9,23 @@
cursor: progress;
}
- .timeline-heading {
- max-width: 100%;
- flex-wrap: nowrap;
- align-items: center;
- position: relative;
+ .conversation-heading {
+ top: calc(var(--__panel-heading-height) * var(--currentPanelStack, 2));
+ z-index: 2;
+ }
- .loadmore-button {
- flex-shrink: 0;
+ &.-nonpanel {
+ .timeline-heading {
+ text-align: center;
+ line-height: 2.75em;
+ padding: 0 0.5em;
}
- .loadmore-text {
- flex-shrink: 0;
- line-height: 1em;
+ .timeline-heading {
+ .button-default, .alert {
+ line-height: 2em;
+ width: 100%;
+ }
}
}
-
- .timeline-footer {
- border: none;
- }
}
diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue
index ff16208d..f65881b6 100644
--- a/src/components/timeline/timeline.vue
+++ b/src/components/timeline/timeline.vue
@@ -1,5 +1,5 @@
<template>
- <div :class="[classes.root, 'Timeline']">
+ <div :class="['Timeline', classes.root]">
<div :class="classes.header">
<TimelineMenu v-if="!embedded" />
<button
@@ -10,7 +10,7 @@
{{ loadButtonString }}
</button>
<div
- v-else
+ v-else-if="!embedded"
class="loadmore-text faint"
@click.prevent
>
@@ -23,64 +23,62 @@
ref="timeline"
class="timeline"
>
- <template v-for="statusId in pinnedStatusIds">
- <conversation
- v-if="timeline.statusesObject[statusId]"
- :key="statusId + '-pinned'"
- class="status-fadein"
- :status-id="statusId"
- :collapsable="true"
- :pinned-status-ids-object="pinnedStatusIdsObject"
- :in-profile="inProfile"
- :profile-user-id="userId"
- />
- </template>
- <template v-for="status in timeline.visibleStatuses">
- <conversation
- v-if="timelineName !== 'user' || (status.id >= timeline.minId && status.id <= timeline.maxId)"
- :key="status.id"
- class="status-fadein"
- :status-id="status.id"
- :collapsable="true"
- :in-profile="inProfile"
- :profile-user-id="userId"
- :virtual-hidden="virtualScrollingEnabled && !statusesToDisplay.includes(status.id)"
- />
- </template>
+ <conversation
+ v-for="statusId in filteredPinnedStatusIds"
+ :key="statusId + '-pinned'"
+ class="status-fadein"
+ :status-id="statusId"
+ :collapsable="true"
+ :pinned-status-ids-object="pinnedStatusIdsObject"
+ :in-profile="inProfile"
+ :profile-user-id="userId"
+ />
+ <conversation
+ v-for="status in filteredVisibleStatuses"
+ :key="status.id"
+ class="status-fadein"
+ :status-id="status.id"
+ :collapsable="true"
+ :in-profile="inProfile"
+ :profile-user-id="userId"
+ :virtual-hidden="virtualScrollingEnabled && !statusesToDisplay.includes(status.id)"
+ />
</div>
</div>
<div :class="classes.footer">
- <div
- v-if="count===0"
- class="new-status-notification text-center faint"
- >
- {{ $t('timeline.no_statuses') }}
- </div>
- <div
- v-else-if="bottomedOut"
- class="new-status-notification text-center faint"
- >
- {{ $t('timeline.no_more_statuses') }}
- </div>
- <button
- v-else-if="!timeline.loading"
- class="button-unstyled -link -fullwidth"
- @click.prevent="fetchOlderStatuses()"
- >
- <div class="new-status-notification text-center">
- {{ $t('timeline.load_older') }}
+ <teleport :to="footerSlipgate" :disabled="!embedded || !footerSlipgate">
+ <div
+ v-if="count===0"
+ class="new-status-notification text-center faint"
+ >
+ {{ $t('timeline.no_statuses') }}
</div>
- </button>
- <div
- v-else
- class="new-status-notification text-center"
- >
- <FAIcon
- icon="circle-notch"
- spin
- size="lg"
- />
- </div>
+ <div
+ v-else-if="bottomedOut"
+ class="new-status-notification text-center faint"
+ >
+ {{ $t('timeline.no_more_statuses') }}
+ </div>
+ <button
+ v-else-if="!timeline.loading"
+ class="button-unstyled -link"
+ @click.prevent="fetchOlderStatuses()"
+ >
+ <div class="new-status-notification text-center">
+ {{ $t('timeline.load_older') }}
+ </div>
+ </button>
+ <div
+ v-else
+ class="new-status-notification text-center"
+ >
+ <FAIcon
+ icon="circle-notch"
+ spin
+ size="lg"
+ />
+ </div>
+ </teleport>
</div>
</div>
</template>
diff --git a/src/components/timeline/timeline_quick_settings.vue b/src/components/timeline/timeline_quick_settings.vue
index 4d67e06b..98fab926 100644
--- a/src/components/timeline/timeline_quick_settings.vue
+++ b/src/components/timeline/timeline_quick_settings.vue
@@ -12,8 +12,8 @@
@click="replyVisibilityAll = true"
>
<span
- class="menu-checkbox"
- :class="{ 'menu-checkbox-radio': replyVisibilityAll }"
+ class="menu-checkbox -radio"
+ :class="{ 'menu-checkbox-checked': replyVisibilityAll }"
/>{{ $t('settings.reply_visibility_all') }}
</button>
<button
@@ -21,8 +21,8 @@
@click="replyVisibilityFollowing = true"
>
<span
- class="menu-checkbox"
- :class="{ 'menu-checkbox-radio': replyVisibilityFollowing }"
+ class="menu-checkbox -radio"
+ :class="{ 'menu-checkbox-checked': replyVisibilityFollowing }"
/>{{ $t('settings.reply_visibility_following_short') }}
</button>
<button
@@ -30,8 +30,8 @@
@click="replyVisibilitySelf = true"
>
<span
- class="menu-checkbox"
- :class="{ 'menu-checkbox-radio': replyVisibilitySelf }"
+ class="menu-checkbox -radio"
+ :class="{ 'menu-checkbox-checked': replyVisibilitySelf }"
/>{{ $t('settings.reply_visibility_self_short') }}
</button>
<div
@@ -93,18 +93,16 @@
<style lang="scss">
.TimelineQuickSettings {
- align-self: stretch;
> button {
- font-size: 1.2em;
- padding-left: 0.7em;
- padding-right: 0.2em;
line-height: 100%;
height: 100%;
- }
+ width: var(--__panel-heading-height-inner);
+ text-align: center;
- .dropdown-item {
- margin: 0;
+ svg {
+ font-size: 1.2em;
+ }
}
}
diff --git a/src/components/timeline_menu/timeline_menu.vue b/src/components/timeline_menu/timeline_menu.vue
index 8f14093f..61119482 100644
--- a/src/components/timeline_menu/timeline_menu.vue
+++ b/src/components/timeline_menu/timeline_menu.vue
@@ -43,6 +43,10 @@
min-width: 0;
width: 24rem;
+ .popover-trigger-button {
+ vertical-align: bottom;
+ }
+
.timeline-menu-popover-wrap {
overflow: hidden;
// Match panel heading padding to line up menu with bottom of heading
diff --git a/src/components/user_avatar/user_avatar.vue b/src/components/user_avatar/user_avatar.vue
index 847d654b..f4d294df 100644
--- a/src/components/user_avatar/user_avatar.vue
+++ b/src/components/user_avatar/user_avatar.vue
@@ -1,24 +1,28 @@
<template>
- <StillImage
- v-if="user"
+ <span
class="Avatar"
- :alt="user.screen_name_ui"
- :title="user.screen_name_ui"
- :src="imgSrc(user.profile_image_url_original)"
- :class="{ 'avatar-compact': compact, 'better-shadow': betterShadow }"
- :image-load-error="imageLoadError"
+ :class="{ '-compact': compact }"
>
+ <StillImage
+ v-if="user"
+ class="avatar"
+ :alt="user.screen_name_ui"
+ :title="user.screen_name_ui"
+ :src="imgSrc(user.profile_image_url_original)"
+ :image-load-error="imageLoadError"
+ :class="{ '-compact': compact, '-better-shadow': betterShadow }"
+ />
+ <div
+ v-else
+ class="avatar -placeholder"
+ :class="{ '-compact': compact }"
+ />
<FAIcon
v-if="bot"
icon="robot"
class="bot-indicator"
/>
- </StillImage>
- <div
- v-else
- class="Avatar -placeholder"
- :class="{ 'avatar-compact': compact }"
- />
+ </span>
</template>
<script src="./user_avatar.js"></script>
@@ -31,42 +35,60 @@
--_avatarShadowInset: var(--avatarStatusShadowInset);
--_still-image-label-visibility: hidden;
+ display: inline-block;
+ position: relative;
width: 48px;
height: 48px;
- box-shadow: var(--_avatarShadowBox);
- border-radius: $fallback--avatarRadius;
- border-radius: var(--avatarRadius, $fallback--avatarRadius);
- img {
+ &.-compact {
+ width: 32px;
+ height: 32px;
+ border-radius: $fallback--avatarAltRadius;
+ border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
+ }
+
+ .avatar {
width: 100%;
height: 100%;
- }
+ box-shadow: var(--_avatarShadowBox);
+ border-radius: $fallback--avatarRadius;
+ border-radius: var(--avatarRadius, $fallback--avatarRadius);
- & > .bot-indicator {
- position: absolute;
- bottom: 0;
- right: 0;
- }
+ &.-better-shadow {
+ box-shadow: var(--_avatarShadowInset);
+ filter: var(--_avatarShadowFilter);
+ }
- &.better-shadow {
- box-shadow: var(--_avatarShadowInset);
- filter: var(--_avatarShadowFilter);
- }
+ &.-animated::before {
+ display: none;
+ }
+
+ &.-compact {
+ border-radius: $fallback--avatarAltRadius;
+ border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
+ }
- &.animated::before {
- display: none;
+ &.-placeholder {
+ background-color: $fallback--fg;
+ background-color: var(--fg, $fallback--fg);
+ }
}
- &.avatar-compact {
- width: 32px;
- height: 32px;
- border-radius: $fallback--avatarAltRadius;
- border-radius: var(--avatarAltRadius, $fallback--avatarAltRadius);
+ img {
+ width: 100%;
+ height: 100%;
}
- &.-placeholder {
- background-color: $fallback--fg;
- background-color: var(--fg, $fallback--fg);
+ .bot-indicator {
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ margin: -0.2em;
+ padding: 0.2em;
+ background: rgba(127, 127, 127, 0.5);
+ color: #fff;
+ border-radius: var(--tooltipRadius);
}
+
}
</style>
diff --git a/src/components/user_card/user_card.scss b/src/components/user_card/user_card.scss
new file mode 100644
index 00000000..2e153120
--- /dev/null
+++ b/src/components/user_card/user_card.scss
@@ -0,0 +1,323 @@
+@import '../../_variables.scss';
+
+.user-card {
+ position: relative;
+ z-index: 1;
+
+ &:hover {
+ --_still-image-img-visibility: visible;
+ --_still-image-canvas-visibility: hidden;
+ --_still-image-label-visibility: hidden;
+ }
+
+ .panel-heading {
+ padding: .5em 0;
+ text-align: center;
+ box-shadow: none;
+ background: transparent;
+ flex-direction: column;
+ align-items: stretch;
+ // create new stacking context
+ position: relative;
+ }
+
+ .panel-body {
+ word-wrap: break-word;
+ border-bottom-right-radius: inherit;
+ border-bottom-left-radius: inherit;
+ // create new stacking context
+ position: relative;
+ }
+
+ .background-image {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ mask: linear-gradient(to top, white, transparent) bottom no-repeat,
+ linear-gradient(to top, white, white);
+ // Autoprefixer seem to ignore this one, and also syntax is different
+ -webkit-mask-composite: xor;
+ mask-composite: exclude;
+ background-size: cover;
+ mask-size: 100% 60%;
+ border-top-left-radius: calc(var(--panelRadius) - 1px);
+ border-top-right-radius: calc(var(--panelRadius) - 1px);
+ background-color: var(--profileBg);
+ z-index: -2;
+
+ &.hide-bio {
+ mask-size: 100% 40px;
+ }
+ }
+
+ &-bio {
+ text-align: center;
+ display: block;
+ line-height: 1.3;
+ padding: 1em;
+ margin: 0;
+
+ a {
+ color: $fallback--link;
+ color: var(--postLink, $fallback--link);
+ }
+
+ img {
+ object-fit: contain;
+ vertical-align: middle;
+ max-width: 100%;
+ max-height: 400px;
+ }
+ }
+
+ // Modifiers
+
+ &-rounded-t {
+ border-top-left-radius: $fallback--panelRadius;
+ border-top-left-radius: var(--panelRadius, $fallback--panelRadius);
+ border-top-right-radius: $fallback--panelRadius;
+ border-top-right-radius: var(--panelRadius, $fallback--panelRadius);
+ }
+
+ &-rounded {
+ border-radius: $fallback--panelRadius;
+ border-radius: var(--panelRadius, $fallback--panelRadius);
+ }
+
+ &-bordered {
+ border-width: 1px;
+ border-style: solid;
+ border-color: $fallback--border;
+ border-color: var(--border, $fallback--border);
+ }
+}
+
+.user-info {
+ color: $fallback--lightText;
+ color: var(--lightText, $fallback--lightText);
+ padding: 0 26px;
+
+ .container {
+ min-width: 0;
+ padding: 16px 0 6px;
+ display: flex;
+ align-items: flex-start;
+ max-height: 56px;
+
+ > * {
+ min-width: 0;
+ }
+
+ .Avatar {
+ --_avatarShadowBox: var(--avatarShadow);
+ --_avatarShadowFilter: var(--avatarShadowFilter);
+ --_avatarShadowInset: var(--avatarShadowInset);
+
+ flex: 1 0 100%;
+ width: 56px;
+ height: 56px;
+ object-fit: cover;
+ }
+ }
+
+ &-avatar-link {
+ position: relative;
+ cursor: pointer;
+
+ &-overlay {
+ position: absolute;
+ left: 0;
+ top: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.3);
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border-radius: $fallback--avatarRadius;
+ border-radius: var(--avatarRadius, $fallback--avatarRadius);
+ opacity: 0;
+ transition: opacity .2s ease;
+
+ svg {
+ color: #FFF;
+ }
+ }
+
+ &:hover &-overlay {
+ opacity: 1;
+ }
+ }
+
+ .external-link-button, .edit-profile-button {
+ cursor: pointer;
+ width: 2.5em;
+ text-align: center;
+ margin: -0.5em 0;
+ padding: 0.5em 0;
+
+ &:not(:hover) .icon {
+ color: $fallback--lightText;
+ color: var(--lightText, $fallback--lightText);
+ }
+ }
+
+ .user-summary {
+ display: block;
+ margin-left: 0.6em;
+ text-align: left;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ flex: 1 1 0;
+ // This is so that text doesn't get overlapped by avatar's shadow if it has
+ // big one
+ z-index: 1;
+ line-height: 2em;
+
+ --emoji-size: 1.7em;
+
+ .top-line,
+ .bottom-line {
+ display: flex;
+ }
+ }
+
+ .user-name {
+ text-overflow: ellipsis;
+ overflow: hidden;
+ flex: 1 1 auto;
+ margin-right: 1em;
+ font-size: 1.1em;
+ }
+
+ .bottom-line {
+ font-weight: light;
+ font-size: 1.1em;
+ align-items: baseline;
+
+ .lock-icon {
+ margin-left: 0.5em;
+ }
+
+ .user-screen-name {
+ min-width: 1px;
+ flex: 0 1 auto;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ color: $fallback--lightText;
+ color: var(--lightText, $fallback--lightText);
+ }
+
+ .dailyAvg {
+ min-width: 1px;
+ flex: 0 0 auto;
+ margin-left: 1em;
+ font-size: 0.7em;
+ color: $fallback--text;
+ color: var(--text, $fallback--text);
+ }
+
+ .user-role {
+ flex: none;
+ color: $fallback--text;
+ color: var(--alertNeutralText, $fallback--text);
+ background-color: $fallback--fg;
+ background-color: var(--alertNeutral, $fallback--fg);
+ }
+ }
+
+ .user-meta {
+ margin-bottom: .15em;
+ display: flex;
+ align-items: baseline;
+ line-height: 22px;
+ flex-wrap: wrap;
+
+ .following {
+ flex: 1 0 auto;
+ margin: 0;
+ margin-bottom: .25em;
+ text-align: left;
+ }
+
+ .highlighter {
+ flex: 0 1 auto;
+ display: flex;
+ flex-wrap: wrap;
+ margin-right: -.5em;
+ align-self: start;
+
+ .userHighlightCl {
+ padding: 2px 10px;
+ flex: 1 0 auto;
+ }
+
+ .userHighlightSel {
+ padding-top: 0;
+ padding-bottom: 0;
+ flex: 1 0 auto;
+ }
+
+ .userHighlightText {
+ width: 70px;
+ flex: 1 0 auto;
+ }
+
+ .userHighlightCl,
+ .userHighlightText,
+ .userHighlightSel {
+ vertical-align: top;
+ margin-right: .5em;
+ margin-bottom: .25em;
+ }
+ }
+ }
+ .user-interactions {
+ position: relative;
+ display: flex;
+ flex-flow: row wrap;
+ margin-right: -.75em;
+
+ > * {
+ margin: 0 .75em .6em 0;
+ white-space: nowrap;
+ min-width: 95px;
+ }
+
+ button {
+ margin: 0;
+ }
+ }
+}
+
+.sidebar .edit-profile-button {
+ display: none;
+}
+
+.user-counts {
+ display: flex;
+ line-height:16px;
+ padding: .5em 1.5em 0em 1.5em;
+ text-align: center;
+ justify-content: space-between;
+ color: $fallback--lightText;
+ color: var(--lightText, $fallback--lightText);
+ flex-wrap: wrap;
+}
+
+.user-count {
+ flex: 1 0 auto;
+ padding: .5em 0 .5em 0;
+ margin: 0 .5em;
+
+ h5 {
+ font-size:1em;
+ font-weight: bolder;
+ margin: 0 0 0.25em;
+ }
+ a {
+ text-decoration: none;
+ }
+}
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 0708f387..67837845 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -8,7 +8,7 @@
:style="style"
class="background-image"
/>
- <div class="panel-heading">
+ <div class="panel-heading -flexible-height">
<div class="user-info">
<div class="container">
<a
@@ -141,6 +141,7 @@
class="userHighlightCl"
type="color"
>
+ {{ ' ' }}
<Select
:id="'userHighlightSel'+user.id"
v-model="userHighlightType"
@@ -283,320 +284,4 @@
<script src="./user_card.js"></script>
-<style lang="scss">
-@import '../../_variables.scss';
-
-.user-card {
- position: relative;
-
- &:hover {
- --_still-image-img-visibility: visible;
- --_still-image-canvas-visibility: hidden;
- --_still-image-label-visibility: hidden;
- }
-
- .panel-heading {
- padding: .5em 0;
- text-align: center;
- box-shadow: none;
- background: transparent;
- flex-direction: column;
- align-items: stretch;
- // create new stacking context
- position: relative;
- }
-
- .panel-body {
- word-wrap: break-word;
- border-bottom-right-radius: inherit;
- border-bottom-left-radius: inherit;
- // create new stacking context
- position: relative;
- }
-
- .background-image {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- mask: linear-gradient(to top, white, transparent) bottom no-repeat,
- linear-gradient(to top, white, white);
- // Autoprefixed seem to ignore this one, and also syntax is different
- -webkit-mask-composite: xor;
- mask-composite: exclude;
- background-size: cover;
- mask-size: 100% 60%;
- border-top-left-radius: calc(var(--panelRadius) - 1px);
- border-top-right-radius: calc(var(--panelRadius) - 1px);
- background-color: var(--profileBg);
-
- &.hide-bio {
- mask-size: 100% 40px;
- }
- }
-
- &-bio {
- text-align: center;
- display: block;
- line-height: 18px;
- padding: 1em;
- margin: 0;
-
- a {
- color: $fallback--link;
- color: var(--postLink, $fallback--link);
- }
-
- img {
- object-fit: contain;
- vertical-align: middle;
- max-width: 100%;
- max-height: 400px;
- }
- }
-
- // Modifiers
-
- &-rounded-t {
- border-top-left-radius: $fallback--panelRadius;
- border-top-left-radius: var(--panelRadius, $fallback--panelRadius);
- border-top-right-radius: $fallback--panelRadius;
- border-top-right-radius: var(--panelRadius, $fallback--panelRadius);
- }
-
- &-rounded {
- border-radius: $fallback--panelRadius;
- border-radius: var(--panelRadius, $fallback--panelRadius);
- }
-
- &-bordered {
- border-width: 1px;
- border-style: solid;
- border-color: $fallback--border;
- border-color: var(--border, $fallback--border);
- }
-}
-
-.user-info {
- color: $fallback--lightText;
- color: var(--lightText, $fallback--lightText);
- padding: 0 26px;
-
- .container {
- padding: 16px 0 6px;
- display: flex;
- align-items: flex-start;
- max-height: 56px;
-
- .Avatar {
- --_avatarShadowBox: var(--avatarShadow);
- --_avatarShadowFilter: var(--avatarShadowFilter);
- --_avatarShadowInset: var(--avatarShadowInset);
-
- flex: 1 0 100%;
- width: 56px;
- height: 56px;
- object-fit: cover;
- }
- }
-
- &-avatar-link {
- position: relative;
- cursor: pointer;
-
- &-overlay {
- position: absolute;
- left: 0;
- top: 0;
- right: 0;
- bottom: 0;
- background-color: rgba(0, 0, 0, 0.3);
- display: flex;
- justify-content: center;
- align-items: center;
- border-radius: $fallback--avatarRadius;
- border-radius: var(--avatarRadius, $fallback--avatarRadius);
- opacity: 0;
- transition: opacity .2s ease;
-
- svg {
- color: #FFF;
- }
- }
-
- &:hover &-overlay {
- opacity: 1;
- }
- }
-
- .external-link-button, .edit-profile-button {
- cursor: pointer;
- width: 2.5em;
- text-align: center;
- margin: -0.5em 0;
- padding: 0.5em 0;
-
- &:not(:hover) .icon {
- color: $fallback--lightText;
- color: var(--lightText, $fallback--lightText);
- }
- }
-
- .user-summary {
- display: block;
- margin-left: 0.6em;
- text-align: left;
- text-overflow: ellipsis;
- white-space: nowrap;
- flex: 1 1 0;
- // This is so that text doesn't get overlapped by avatar's shadow if it has
- // big one
- z-index: 1;
-
- .top-line {
- display: flex;
- }
- }
-
- .user-name {
- text-overflow: ellipsis;
- overflow: hidden;
- flex: 1 1 auto;
- margin-right: 1em;
- font-size: 15px;
-
- --emoji-size: 14px;
- }
-
- .bottom-line {
- display: flex;
- font-weight: light;
- font-size: 15px;
-
- .lock-icon {
- margin-left: 0.5em;
- }
-
- .user-screen-name {
- min-width: 1px;
- flex: 0 1 auto;
- text-overflow: ellipsis;
- overflow: hidden;
- color: $fallback--lightText;
- color: var(--lightText, $fallback--lightText);
- }
-
- .dailyAvg {
- min-width: 1px;
- flex: 0 0 auto;
- margin-left: 1em;
- font-size: 0.7em;
- color: $fallback--text;
- color: var(--text, $fallback--text);
- }
-
- .user-role {
- flex: none;
- color: $fallback--text;
- color: var(--alertNeutralText, $fallback--text);
- background-color: $fallback--fg;
- background-color: var(--alertNeutral, $fallback--fg);
- }
- }
-
- .user-meta {
- margin-bottom: .15em;
- display: flex;
- align-items: baseline;
- font-size: 14px;
- line-height: 22px;
- flex-wrap: wrap;
-
- .following {
- flex: 1 0 auto;
- margin: 0;
- margin-bottom: .25em;
- text-align: left;
- }
-
- .highlighter {
- flex: 0 1 auto;
- display: flex;
- flex-wrap: wrap;
- margin-right: -.5em;
- align-self: start;
-
- .userHighlightCl {
- padding: 2px 10px;
- flex: 1 0 auto;
- }
-
- .userHighlightSel {
- padding-top: 0;
- padding-bottom: 0;
- flex: 1 0 auto;
- }
-
- .userHighlightText {
- width: 70px;
- flex: 1 0 auto;
- }
-
- .userHighlightCl,
- .userHighlightText,
- .userHighlightSel {
- vertical-align: top;
- margin-right: .5em;
- margin-bottom: .25em;
- }
- }
- }
- .user-interactions {
- position: relative;
- display: flex;
- flex-flow: row wrap;
- margin-right: -.75em;
-
- > * {
- margin: 0 .75em .6em 0;
- white-space: nowrap;
- min-width: 95px;
- }
-
- button {
- margin: 0;
- }
- }
-}
-
-.sidebar .edit-profile-button {
- display: none;
-}
-
-.user-counts {
- display: flex;
- line-height:16px;
- padding: .5em 1.5em 0em 1.5em;
- text-align: center;
- justify-content: space-between;
- color: $fallback--lightText;
- color: var(--lightText, $fallback--lightText);
- flex-wrap: wrap;
-}
-
-.user-count {
- flex: 1 0 auto;
- padding: .5em 0 .5em 0;
- margin: 0 .5em;
-
- h5 {
- font-size:1em;
- font-weight: bolder;
- margin: 0 0 0.25em;
- }
- a {
- text-decoration: none;
- }
-}
-</style>
+<style lang="scss" src="./user_card.scss" />
diff --git a/src/components/user_list_popover/user_list_popover.js b/src/components/user_list_popover/user_list_popover.js
index 32ca2b8d..e24eb9f7 100644
--- a/src/components/user_list_popover/user_list_popover.js
+++ b/src/components/user_list_popover/user_list_popover.js
@@ -1,3 +1,6 @@
+import { defineAsyncComponent } from 'vue'
+import RichContent from 'src/components/rich_content/rich_content.jsx'
+
import { library } from '@fortawesome/fontawesome-svg-core'
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons'
@@ -11,8 +14,9 @@ const UserListPopover = {
'users'
],
components: {
- Popover: () => import('../popover/popover.vue'),
- UserAvatar: () => import('../user_avatar/user_avatar.vue')
+ RichContent,
+ Popover: defineAsyncComponent(() => import('../popover/popover.vue')),
+ UserAvatar: defineAsyncComponent(() => import('../user_avatar/user_avatar.vue'))
},
computed: {
usersCapped () {
diff --git a/src/components/user_list_popover/user_list_popover.vue b/src/components/user_list_popover/user_list_popover.vue
index 8706d0ff..bdc3aa92 100644
--- a/src/components/user_list_popover/user_list_popover.vue
+++ b/src/components/user_list_popover/user_list_popover.vue
@@ -73,7 +73,7 @@
}
.user-list-screen-name {
- font-size: 9px;
+ font-size: 0.65em;
}
}
}
diff --git a/src/components/user_panel/user_panel.vue b/src/components/user_panel/user_panel.vue
index 5685916a..243de387 100644
--- a/src/components/user_panel/user_panel.vue
+++ b/src/components/user_panel/user_panel.vue
@@ -2,7 +2,7 @@
<div class="user-panel">
<div
v-if="signedIn"
- key="user-panel"
+ key="user-panel-signed"
class="panel panel-default signed-in"
>
<UserCard
@@ -24,5 +24,6 @@
<style lang="scss">
.user-panel .signed-in {
overflow: visible;
+ z-index: 10;
}
</style>
diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js
index 7a475609..f779b823 100644
--- a/src/components/user_profile/user_profile.js
+++ b/src/components/user_profile/user_profile.js
@@ -3,7 +3,7 @@ import UserCard from '../user_card/user_card.vue'
import FollowCard from '../follow_card/follow_card.vue'
import Timeline from '../timeline/timeline.vue'
import Conversation from '../conversation/conversation.vue'
-import TabSwitcher from 'src/components/tab_switcher/tab_switcher.js'
+import TabSwitcher from 'src/components/tab_switcher/tab_switcher.jsx'
import RichContent from 'src/components/rich_content/rich_content.jsx'
import List from '../list/list.vue'
import withLoadMore from '../../hocs/with_load_more/with_load_more'
@@ -39,7 +39,8 @@ const UserProfile = {
return {
error: false,
userId: null,
- tab: defaultTabKey
+ tab: defaultTabKey,
+ footerRef: null
}
},
created () {
@@ -47,7 +48,7 @@ const UserProfile = {
this.load(routeParams.name || routeParams.id)
this.tab = get(this.$route, 'query.tab', defaultTabKey)
},
- destroyed () {
+ unmounted () {
this.stopFetching()
},
computed: {
@@ -78,6 +79,9 @@ const UserProfile = {
}
},
methods: {
+ setFooterRef (el) {
+ this.footerRef = el
+ },
load (userNameOrId) {
const startFetchingTimeline = (timeline, userId) => {
// Clear timeline only if load another user's profile
diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue
index 726216ff..62792599 100644
--- a/src/components/user_profile/user_profile.vue
+++ b/src/components/user_profile/user_profile.vue
@@ -56,6 +56,7 @@
:user-id="userId"
:pinned-status-ids="user.pinnedStatusIds"
:in-profile="true"
+ :footerSlipgate="footerRef"
/>
<div
v-if="followsTabVisible"
@@ -94,6 +95,7 @@
:timeline="media"
:user-id="userId"
:in-profile="true"
+ :footerSlipgate="footerRef"
/>
<Timeline
v-if="isUs"
@@ -105,8 +107,10 @@
timeline-name="favorites"
:timeline="favorites"
:in-profile="true"
+ :footerSlipgate="footerRef"
/>
</tab-switcher>
+ <div class="panel-footer" :ref="setFooterRef"></div>
</div>
<div
v-else
@@ -138,6 +142,9 @@
flex: 2;
flex-basis: 500px;
+ // No sticky header on user profile
+ --currentPanelStack: 1;
+
.user-profile-fields {
margin: 0 0.5em;
@@ -176,7 +183,7 @@
}
.user-profile-field-name, .user-profile-field-value {
- line-height: 18px;
+ line-height: 1.3;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
@@ -192,24 +199,6 @@
align-items: middle;
padding: 2em;
}
-
- .timeline-heading {
- display: flex;
- justify-content: center;
-
- .loadmore-button, .alert {
- flex: 1;
- }
-
- .loadmore-button {
- height: 28px;
- margin: 10px .6em;
- }
-
- .title, .loadmore-text {
- display: none
- }
- }
}
.user-profile-placeholder {
.panel-body {
diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue
index 1f67a5cc..030ce2c4 100644
--- a/src/components/user_reporting_modal/user_reporting_modal.vue
+++ b/src/components/user_reporting_modal/user_reporting_modal.vue
@@ -53,8 +53,8 @@
:statusoid="item"
/>
<Checkbox
- :checked="isChecked(item.id)"
- @change="checked => toggleStatus(checked, item.id)"
+ :model-value="isChecked(item.id)"
+ @update:model-value="checked => toggleStatus(checked, item.id)"
/>
</div>
</template>
@@ -76,17 +76,6 @@
min-height: 20vh;
max-height: 80vh;
- .panel-heading {
- .title {
- text-align: center;
- // TODO: Consider making these as default of panel
- flex: 1;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
-
.panel-body {
display: flex;
flex-direction: column-reverse;
@@ -98,7 +87,7 @@
&-left {
padding: 1.1em 0.7em 0.7em;
- line-height: 1.4em;
+ line-height: var(--post-line-height);
box-sizing: border-box;
> div {