diff --git a/src/App.scss b/src/App.scss
index 7db9461c45..120eea5332 100644
--- a/src/App.scss
+++ b/src/App.scss
@@ -860,54 +860,6 @@ nav {
}
}
-// DELETE
-.setting-item {
- border-bottom: 2px solid var(--fg, $fallback--fg);
- margin: 1em 1em 1.4em;
- padding-bottom: 1.4em;
-
- > div {
- margin-bottom: .5em;
- &:last-child {
- margin-bottom: 0;
- }
- }
-
- &:last-child {
- border-bottom: none;
- padding-bottom: 0;
- margin-bottom: 1em;
- }
-
- select {
- min-width: 10em;
- }
-
-
- textarea {
- width: 100%;
- max-width: 100%;
- height: 100px;
- }
-
- .unavailable,
- .unavailable i {
- color: var(--cRed, $fallback--cRed);
- color: $fallback--cRed;
- }
-
- .btn {
- min-height: 28px;
- min-width: 10em;
- padding: 0 2em;
- }
-
- .number-input {
- max-width: 6em;
- }
-}
-// DELETE
-
.select-multiple {
display: flex;
.option-list {
diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue
index cee24241b0..e5ecc0c054 100644
--- a/src/components/modal/modal.vue
+++ b/src/components/modal/modal.vue
@@ -3,6 +3,7 @@
v-show="isOpen"
v-body-scroll-lock="isOpen"
class="modal-view"
+ :class="{ 'modal-background': !noBackground }"
@click.self="$emit('backdropClicked')"
>
@@ -15,6 +16,10 @@ export default {
isOpen: {
type: Boolean,
default: true
+ },
+ noBackground: {
+ type: Boolean,
+ default: false
}
}
}
@@ -32,10 +37,19 @@ export default {
justify-content: center;
align-items: center;
overflow: auto;
+ pointer-events: none;
animation-duration: 0.2s;
- background-color: rgba(0, 0, 0, 0.5);
animation-name: modal-background-fadein;
+ > * {
+ pointer-events: initial;
+ }
+
+ &.modal-background {
+ pointer-events: initial;
+ background-color: rgba(0, 0, 0, 0.5);
+ }
+
body:not(.scroll-locked) & {
opacity: 0;
}
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js
deleted file mode 100644
index 31a9e9be79..0000000000
--- a/src/components/settings/settings.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/* eslint-env browser */
-import { filter, trim } from 'lodash'
-
-import TabSwitcher from '../tab_switcher/tab_switcher.js'
-import StyleSwitcher from '../style_switcher/style_switcher.vue'
-import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue'
-import { extractCommit } from '../../services/version/version.service'
-import { instanceDefaultProperties, defaultState as configDefaultState } from '../../modules/config.js'
-import Checkbox from '../checkbox/checkbox.vue'
-
-const pleromaFeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma-fe/commit/'
-const pleromaBeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma/commit/'
-
-const multiChoiceProperties = [
- 'postContentType',
- 'subjectLineBehavior'
-]
-
-const settings = {
- data () {
- const instance = this.$store.state.instance
-
- return {
- loopSilentAvailable:
- // Firefox
- Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
- // Chrome-likes
- Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') ||
- // Future spec, still not supported in Nightly 63 as of 08/2018
- Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks'),
-
- backendVersion: instance.backendVersion,
- frontendVersion: instance.frontendVersion
- }
- },
- components: {
- TabSwitcher,
- StyleSwitcher,
- InterfaceLanguageSwitcher,
- Checkbox
- },
- computed: {
- user () {
- return this.$store.state.users.currentUser
- },
- currentSaveStateNotice () {
- return this.$store.state.interface.settings.currentSaveStateNotice
- },
- postFormats () {
- return this.$store.state.instance.postFormats || []
- },
- instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
- frontendVersionLink () {
- return pleromaFeCommitUrl + this.frontendVersion
- },
- backendVersionLink () {
- return pleromaBeCommitUrl + extractCommit(this.backendVersion)
- },
- // Getting localized values for instance-default properties
- ...instanceDefaultProperties
- .filter(key => multiChoiceProperties.includes(key))
- .map(key => [
- key + 'DefaultValue',
- function () {
- return this.$store.getters.instanceDefaultConfig[key]
- }
- ])
- .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),
- ...instanceDefaultProperties
- .filter(key => !multiChoiceProperties.includes(key))
- .map(key => [
- key + 'LocalizedValue',
- function () {
- return this.$t('settings.values.' + this.$store.getters.instanceDefaultConfig[key])
- }
- ])
- .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),
- // Generating computed values for vuex properties
- ...Object.keys(configDefaultState)
- .map(key => [key, {
- get () { return this.$store.getters.mergedConfig[key] },
- set (value) {
- this.$store.dispatch('setOption', { name: key, value })
- }
- }])
- .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),
- // Special cases (need to transform values or perform actions first)
- muteWordsString: {
- get () { return this.$store.getters.mergedConfig.muteWords.join('\n') },
- set (value) {
- this.$store.dispatch('setOption', {
- name: 'muteWords',
- value: filter(value.split('\n'), (word) => trim(word).length > 0)
- })
- }
- },
- useStreamingApi: {
- get () { return this.$store.getters.mergedConfig.useStreamingApi },
- set (value) {
- const promise = value
- ? this.$store.dispatch('enableMastoSockets')
- : this.$store.dispatch('disableMastoSockets')
-
- promise.then(() => {
- this.$store.dispatch('setOption', { name: 'useStreamingApi', value })
- }).catch((e) => {
- console.error('Failed starting MastoAPI Streaming socket', e)
- this.$store.dispatch('disableMastoSockets')
- this.$store.dispatch('setOption', { name: 'useStreamingApi', value: false })
- })
- }
- }
- },
- // Updating nested properties
- watch: {
- notificationVisibility: {
- handler (value) {
- this.$store.dispatch('setOption', {
- name: 'notificationVisibility',
- value: this.$store.getters.mergedConfig.notificationVisibility
- })
- },
- deep: true
- }
- }
-}
-
-export default settings
diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
deleted file mode 100644
index 9e14b449bd..0000000000
--- a/src/components/settings/settings.vue
+++ /dev/null
@@ -1,424 +0,0 @@
-
-
-
-
- {{ $t('settings.settings') }}
-
-
-
-
-
- {{ $t('settings.saving_err') }}
-
-
-
- {{ $t('settings.saving_ok') }}
-
-
-
-
-
-
-
-
-
-
{{ $t('settings.interface') }}
-
- -
-
-
- -
-
- {{ $t('settings.hide_isp') }}
-
-
-
-
-
-
{{ $t('nav.timeline') }}
-
- -
-
- {{ $t('settings.hide_muted_posts') }} {{ $t('settings.instance_default', { value: hideMutedPostsLocalizedValue }) }}
-
-
- -
-
- {{ $t('settings.collapse_subject') }} {{ $t('settings.instance_default', { value: collapseMessageWithSubjectLocalizedValue }) }}
-
-
- -
-
- {{ $t('settings.streaming') }}
-
-
- -
-
- {{ $t('settings.pause_on_unfocused') }}
-
-
-
-
- -
-
- {{ $t('settings.useStreamingApi') }}
-
-
- {{ $t('settings.useStreamingApiWarning') }}
-
-
-
- -
-
- {{ $t('settings.autoload') }}
-
-
- -
-
- {{ $t('settings.reply_link_preview') }}
-
-
- -
-
- {{ $t('settings.emoji_reactions_on_timeline') }}
-
-
-
-
-
-
-
{{ $t('settings.composing') }}
-
- -
-
- {{ $t('settings.scope_copy') }} {{ $t('settings.instance_default', { value: scopeCopyLocalizedValue }) }}
-
-
- -
-
- {{ $t('settings.subject_input_always_show') }} {{ $t('settings.instance_default', { value: alwaysShowSubjectInputLocalizedValue }) }}
-
-
- -
-
- {{ $t('settings.subject_line_behavior') }}
-
-
-
- -
-
- {{ $t('settings.post_status_content_type') }}
-
-
-
- -
-
- {{ $t('settings.minimal_scopes_mode') }} {{ $t('settings.instance_default', { value: minimalScopesModeLocalizedValue }) }}
-
-
- -
-
- {{ $t('settings.autohide_floating_post_button') }}
-
-
- -
-
- {{ $t('settings.pad_emoji') }}
-
-
-
-
-
-
-
{{ $t('settings.attachments') }}
-
-
-
-
-
{{ $t('settings.notifications') }}
-
- -
-
- {{ $t('settings.enable_web_push_notifications') }}
-
-
-
-
-
-
-
{{ $t('settings.fun') }}
-
- -
-
- {{ $t('settings.greentext') }} {{ $t('settings.instance_default', { value: greentextLocalizedValue }) }}
-
-
-
-
-
-
-
-
-
-
-
-
{{ $t('settings.notification_visibility') }}
-
- -
-
- {{ $t('settings.notification_visibility_likes') }}
-
-
- -
-
- {{ $t('settings.notification_visibility_repeats') }}
-
-
- -
-
- {{ $t('settings.notification_visibility_follows') }}
-
-
- -
-
- {{ $t('settings.notification_visibility_mentions') }}
-
-
- -
-
- {{ $t('settings.notification_visibility_moves') }}
-
-
- -
-
- {{ $t('settings.notification_visibility_emoji_reactions') }}
-
-
-
-
-
- {{ $t('settings.replies_in_timeline') }}
-
-
-
-
- {{ $t('settings.hide_post_stats') }} {{ $t('settings.instance_default', { value: hidePostStatsLocalizedValue }) }}
-
-
-
-
- {{ $t('settings.hide_user_stats') }} {{ $t('settings.instance_default', { value: hideUserStatsLocalizedValue }) }}
-
-
-
-
-
-
{{ $t('settings.filtering_explanation') }}
-
-
-
-
- {{ $t('settings.hide_filtered_statuses') }} {{ $t('settings.instance_default', { value: hideFilteredStatusesLocalizedValue }) }}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/components/settings_modal/settings_modal.js b/src/components/settings_modal/settings_modal.js
index 1f4c038fbe..d60babf695 100644
--- a/src/components/settings_modal/settings_modal.js
+++ b/src/components/settings_modal/settings_modal.js
@@ -1,21 +1,30 @@
-import Modal from '../modal/modal.vue'
-import TabSwitcher from '../tab_switcher/tab_switcher.js'
+import Modal from 'src/components/modal/modal.vue'
+import TabSwitcher from 'src/components/tab_switcher/tab_switcher.js'
-import Profile from './tabs/profile.vue'
-import Security from './tabs/security.vue'
-import Notifications from './tabs/notifications.vue'
-import DataImportExport from './tabs/data_import_export.vue'
-import MutesAndBlocks from './tabs/mutes_and_blocks.vue'
+import DataImportExportTab from './tabs/data_import_export_tab.vue'
+import MutesAndBlocksTab from './tabs/mutes_and_blocks_tab.vue'
+import NotificationsTab from './tabs/notifications_tab.vue'
+import FilteringTab from './tabs/filtering_tab.vue'
+import SecurityTab from './tabs/security_tab/security_tab.vue'
+import ProfileTab from './tabs/profile_tab.vue'
+import GeneralTab from './tabs/general_tab.vue'
+import VersionTab from './tabs/version_tab.vue'
+import ThemeTab from './tabs/theme_tab/theme_tab.vue'
const SettingsModal = {
components: {
Modal,
TabSwitcher,
- Profile,
- Security,
- Notifications,
- DataImportExport,
- MutesAndBlocks
+
+ DataImportExportTab,
+ MutesAndBlocksTab,
+ NotificationsTab,
+ FilteringTab,
+ SecurityTab,
+ ProfileTab,
+ GeneralTab,
+ VersionTab,
+ ThemeTab
},
data () {
return {
@@ -28,11 +37,20 @@ const SettingsModal = {
},
modalActivated () {
return this.$store.state.interface.settingsModalState !== 'hidden'
+ },
+ modalPeeked () {
+ return this.$store.state.interface.settingsModalState === 'minimized'
}
},
watch: {
},
methods: {
+ closeModal () {
+ this.$store.dispatch('closeSettingsModal')
+ },
+ peekModal () {
+ this.$store.dispatch('togglePeekSettingsModal')
+ }
}
}
diff --git a/src/components/settings_modal/settings_modal.scss b/src/components/settings_modal/settings_modal.scss
index 8cea52d21c..3efbe205b4 100644
--- a/src/components/settings_modal/settings_modal.scss
+++ b/src/components/settings_modal/settings_modal.scss
@@ -1,14 +1,29 @@
-@import '../../_variables.scss';
+@import 'src/_variables.scss';
.settings-modal {
+
.settings_tab-switcher {
height: 100%;
}
+ &.peek {
+ .settings-modal-panel {
+ transform: translateY(calc(100% - 50px));
+ }
+ }
+
.settings-modal-panel {
+ transition: transform;
+ transition-timing-function: ease-in-out;
+ transition-duration: 300ms;
width: 1000px;
max-width: 90vw;
height: 90vh;
+ @media all and (max-width: 800px) {
+ max-width: 100vw;
+ height: 100vh;
+ }
}
.panel-body {
+ height: 100%;
overflow-y: hidden;
}
.setting-item {
@@ -16,6 +31,12 @@
margin: 1em 1em 1.4em;
padding-bottom: 1.4em;
+ .btn {
+ min-height: 28px;
+ min-width: 10em;
+ padding: 0 2em;
+ }
+
> div {
margin-bottom: .5em;
&:last-child {
@@ -33,7 +54,6 @@
min-width: 10em;
}
-
textarea {
width: 100%;
max-width: 100%;
@@ -46,12 +66,6 @@
color: $fallback--cRed;
}
- .btn {
- min-height: 28px;
- min-width: 10em;
- padding: 0 2em;
- }
-
.number-input {
max-width: 6em;
}
diff --git a/src/components/settings_modal/settings_modal.vue b/src/components/settings_modal/settings_modal.vue
index 9e35d3f679..53481bddf7 100644
--- a/src/components/settings_modal/settings_modal.vue
+++ b/src/components/settings_modal/settings_modal.vue
@@ -3,10 +3,20 @@
v-if="isLoggedIn && !resettingForm"
:is-open="modalActivated"
class="settings-modal"
+ :class="{ peek: modalPeeked }"
+ :no-background="modalPeeked"
>
- {{ $t('settings.settings') }}
+
+ {{ $t('settings.settings') }}
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/src/components/settings_modal/tabs/data_import_export.js b/src/components/settings_modal/tabs/data_import_export_tab.js
similarity index 86%
rename from src/components/settings_modal/tabs/data_import_export.js
rename to src/components/settings_modal/tabs/data_import_export_tab.js
index f68d12e921..168f89e191 100644
--- a/src/components/settings_modal/tabs/data_import_export.js
+++ b/src/components/settings_modal/tabs/data_import_export_tab.js
@@ -1,8 +1,8 @@
-import Importer from '../../importer/importer.vue'
-import Exporter from '../../exporter/exporter.vue'
-import Checkbox from '../../checkbox/checkbox.vue'
+import Importer from 'src/components/importer/importer.vue'
+import Exporter from 'src/components/exporter/exporter.vue'
+import Checkbox from 'src/components/checkbox/checkbox.vue'
-const DataImportExport = {
+const DataImportExportTab = {
data () {
return {
activeTab: 'profile',
@@ -62,4 +62,4 @@ const DataImportExport = {
}
}
-export default DataImportExport
+export default DataImportExportTab
diff --git a/src/components/settings_modal/tabs/data_import_export.vue b/src/components/settings_modal/tabs/data_import_export_tab.vue
similarity index 96%
rename from src/components/settings_modal/tabs/data_import_export.vue
rename to src/components/settings_modal/tabs/data_import_export_tab.vue
index 464df6d398..3ddc8b03f3 100644
--- a/src/components/settings_modal/tabs/data_import_export.vue
+++ b/src/components/settings_modal/tabs/data_import_export_tab.vue
@@ -39,5 +39,5 @@
-
+
diff --git a/src/components/settings_modal/tabs/filtering_tab.js b/src/components/settings_modal/tabs/filtering_tab.js
new file mode 100644
index 0000000000..ec33066705
--- /dev/null
+++ b/src/components/settings_modal/tabs/filtering_tab.js
@@ -0,0 +1,26 @@
+import Checkbox from 'src/components/checkbox/checkbox.vue'
+
+import SharedComputedObject from './helpers/shared_computed_object.js'
+
+const FilteringTab = {
+ components: {
+ Checkbox
+ },
+ computed: {
+ ...SharedComputedObject()
+ },
+ // Updating nested properties
+ watch: {
+ notificationVisibility: {
+ handler (value) {
+ this.$store.dispatch('setOption', {
+ name: 'notificationVisibility',
+ value: this.$store.getters.mergedConfig.notificationVisibility
+ })
+ },
+ deep: true
+ }
+ }
+}
+
+export default FilteringTab
diff --git a/src/components/settings_modal/tabs/filtering_tab.vue b/src/components/settings_modal/tabs/filtering_tab.vue
new file mode 100644
index 0000000000..647ec7b461
--- /dev/null
+++ b/src/components/settings_modal/tabs/filtering_tab.vue
@@ -0,0 +1,86 @@
+
+
+
+
+
{{ $t('settings.notification_visibility') }}
+
+ -
+
+ {{ $t('settings.notification_visibility_likes') }}
+
+
+ -
+
+ {{ $t('settings.notification_visibility_repeats') }}
+
+
+ -
+
+ {{ $t('settings.notification_visibility_follows') }}
+
+
+ -
+
+ {{ $t('settings.notification_visibility_mentions') }}
+
+
+ -
+
+ {{ $t('settings.notification_visibility_moves') }}
+
+
+ -
+
+ {{ $t('settings.notification_visibility_emoji_reactions') }}
+
+
+
+
+
+ {{ $t('settings.replies_in_timeline') }}
+
+
+
+
+ {{ $t('settings.hide_post_stats') }} {{ $t('settings.instance_default', { value: hidePostStatsLocalizedValue }) }}
+
+
+
+
+ {{ $t('settings.hide_user_stats') }} {{ $t('settings.instance_default', { value: hideUserStatsLocalizedValue }) }}
+
+
+
+
+
+
{{ $t('settings.filtering_explanation') }}
+
+
+
+
+ {{ $t('settings.hide_filtered_statuses') }} {{ $t('settings.instance_default', { value: hideFilteredStatusesLocalizedValue }) }}
+
+
+
+
+
+
diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js
new file mode 100644
index 0000000000..82bf68624b
--- /dev/null
+++ b/src/components/settings_modal/tabs/general_tab.js
@@ -0,0 +1,32 @@
+import Checkbox from 'src/components/checkbox/checkbox.vue'
+import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue'
+
+import SharedComputedObject from './helpers/shared_computed_object.js'
+
+const GeneralTab = {
+ data () {
+ const instance = this.$store.state.instance
+ return {
+ loopSilentAvailable:
+ // Firefox
+ Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
+ // Chrome-likes
+ Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'webkitAudioDecodedByteCount') ||
+ // Future spec, still not supported in Nightly 63 as of 08/2018
+ Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks'),
+ }
+ },
+ components: {
+ Checkbox,
+ InterfaceLanguageSwitcher
+ },
+ computed: {
+ postFormats () {
+ return this.$store.state.instance.postFormats || []
+ },
+ instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
+ ...SharedComputedObject()
+ }
+}
+
+export default GeneralTab
diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
new file mode 100644
index 0000000000..0d2da07a7a
--- /dev/null
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -0,0 +1,272 @@
+
+
+
+
{{ $t('settings.interface') }}
+
+ -
+
+
+ -
+
+ {{ $t('settings.hide_isp') }}
+
+
+
+
+
+
{{ $t('nav.timeline') }}
+
+ -
+
+ {{ $t('settings.hide_muted_posts') }} {{ $t('settings.instance_default', { value: hideMutedPostsLocalizedValue }) }}
+
+
+ -
+
+ {{ $t('settings.collapse_subject') }} {{ $t('settings.instance_default', { value: collapseMessageWithSubjectLocalizedValue }) }}
+
+
+ -
+
+ {{ $t('settings.streaming') }}
+
+
+ -
+
+ {{ $t('settings.pause_on_unfocused') }}
+
+
+
+
+ -
+
+ {{ $t('settings.useStreamingApi') }}
+
+
+ {{ $t('settings.useStreamingApiWarning') }}
+
+
+
+ -
+
+ {{ $t('settings.autoload') }}
+
+
+ -
+
+ {{ $t('settings.reply_link_preview') }}
+
+
+ -
+
+ {{ $t('settings.emoji_reactions_on_timeline') }}
+
+
+
+
+
+
+
{{ $t('settings.composing') }}
+
+ -
+
+ {{ $t('settings.scope_copy') }} {{ $t('settings.instance_default', { value: scopeCopyLocalizedValue }) }}
+
+
+ -
+
+ {{ $t('settings.subject_input_always_show') }} {{ $t('settings.instance_default', { value: alwaysShowSubjectInputLocalizedValue }) }}
+
+
+ -
+
+ {{ $t('settings.subject_line_behavior') }}
+
+
+
+ -
+
+ {{ $t('settings.post_status_content_type') }}
+
+
+
+ -
+
+ {{ $t('settings.minimal_scopes_mode') }} {{ $t('settings.instance_default', { value: minimalScopesModeLocalizedValue }) }}
+
+
+ -
+
+ {{ $t('settings.autohide_floating_post_button') }}
+
+
+ -
+
+ {{ $t('settings.pad_emoji') }}
+
+
+
+
+
+
+
{{ $t('settings.attachments') }}
+
+
+
+
+
{{ $t('settings.notifications') }}
+
+ -
+
+ {{ $t('settings.enable_web_push_notifications') }}
+
+
+
+
+
+
+
{{ $t('settings.fun') }}
+
+ -
+
+ {{ $t('settings.greentext') }} {{ $t('settings.instance_default', { value: greentextLocalizedValue }) }}
+
+
+
+
+
+
+
+
diff --git a/src/components/settings_modal/tabs/helpers/shared_computed_object.js b/src/components/settings_modal/tabs/helpers/shared_computed_object.js
new file mode 100644
index 0000000000..61643e3ba6
--- /dev/null
+++ b/src/components/settings_modal/tabs/helpers/shared_computed_object.js
@@ -0,0 +1,69 @@
+import { filter, trim } from 'lodash'
+import { instanceDefaultProperties, defaultState as configDefaultState } from 'src/modules/config.js'
+
+const multiChoiceProperties = [
+ 'postContentType',
+ 'subjectLineBehavior'
+]
+
+const SharedComputedObject = () => ({
+ user () {
+ return this.$store.state.users.currentUser
+ },
+ // Getting localized values for instance-default properties
+ ...instanceDefaultProperties
+ .filter(key => multiChoiceProperties.includes(key))
+ .map(key => [
+ key + 'DefaultValue',
+ function () {
+ return this.$store.getters.instanceDefaultConfig[key]
+ }
+ ])
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),
+ ...instanceDefaultProperties
+ .filter(key => !multiChoiceProperties.includes(key))
+ .map(key => [
+ key + 'LocalizedValue',
+ function () {
+ return this.$t('settings.values.' + this.$store.getters.instanceDefaultConfig[key])
+ }
+ ])
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),
+ // Generating computed values for vuex properties
+ ...Object.keys(configDefaultState)
+ .map(key => [key, {
+ get () { return this.$store.getters.mergedConfig[key] },
+ set (value) {
+ this.$store.dispatch('setOption', { name: key, value })
+ }
+ }])
+ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}),
+ // Special cases (need to transform values or perform actions first)
+ muteWordsString: {
+ get () { return this.$store.getters.mergedConfig.muteWords.join('\n') },
+ set (value) {
+ this.$store.dispatch('setOption', {
+ name: 'muteWords',
+ value: filter(value.split('\n'), (word) => trim(word).length > 0)
+ })
+ }
+ },
+ useStreamingApi: {
+ get () { return this.$store.getters.mergedConfig.useStreamingApi },
+ set (value) {
+ const promise = value
+ ? this.$store.dispatch('enableMastoSockets')
+ : this.$store.dispatch('disableMastoSockets')
+
+ promise.then(() => {
+ this.$store.dispatch('setOption', { name: 'useStreamingApi', value })
+ }).catch((e) => {
+ console.error('Failed starting MastoAPI Streaming socket', e)
+ this.$store.dispatch('disableMastoSockets')
+ this.$store.dispatch('setOption', { name: 'useStreamingApi', value: false })
+ })
+ }
+ }
+})
+
+export default SharedComputedObject
diff --git a/src/components/settings_modal/tabs/mutes_and_blocks.js b/src/components/settings_modal/tabs/mutes_and_blocks_tab.js
similarity index 83%
rename from src/components/settings_modal/tabs/mutes_and_blocks.js
rename to src/components/settings_modal/tabs/mutes_and_blocks_tab.js
index 51895ddc9c..3f6b7205ed 100644
--- a/src/components/settings_modal/tabs/mutes_and_blocks.js
+++ b/src/components/settings_modal/tabs/mutes_and_blocks_tab.js
@@ -1,15 +1,15 @@
import get from 'lodash/get'
import map from 'lodash/map'
import reject from 'lodash/reject'
-import Autosuggest from '../../autosuggest/autosuggest.vue'
-import TabSwitcher from '../../tab_switcher/tab_switcher.js'
-import BlockCard from '../../block_card/block_card.vue'
-import MuteCard from '../../mute_card/mute_card.vue'
-import DomainMuteCard from '../../domain_mute_card/domain_mute_card.vue'
-import SelectableList from '../../selectable_list/selectable_list.vue'
-import ProgressButton from '../../progress_button/progress_button.vue'
-import withSubscription from '../../../hocs/with_subscription/with_subscription'
-import Checkbox from '../../checkbox/checkbox.vue'
+import Autosuggest from 'src/components/autosuggest/autosuggest.vue'
+import TabSwitcher from 'src/components/tab_switcher/tab_switcher.js'
+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'
+import SelectableList from 'src/components/selectable_list/selectable_list.vue'
+import ProgressButton from 'src/components/progress_button/progress_button.vue'
+import withSubscription from 'src/components/../hocs/with_subscription/with_subscription'
+import Checkbox from 'src/components/checkbox/checkbox.vue'
const BlockList = withSubscription({
fetch: (props, $store) => $store.dispatch('fetchBlocks'),
diff --git a/src/components/settings_modal/tabs/mutes_and_blocks.vue b/src/components/settings_modal/tabs/mutes_and_blocks_tab.vue
similarity index 97%
rename from src/components/settings_modal/tabs/mutes_and_blocks.vue
rename to src/components/settings_modal/tabs/mutes_and_blocks_tab.vue
index 3aff47a0e9..7fce7b7880 100644
--- a/src/components/settings_modal/tabs/mutes_and_blocks.vue
+++ b/src/components/settings_modal/tabs/mutes_and_blocks_tab.vue
@@ -15,7 +15,7 @@
-
+
diff --git a/src/components/settings_modal/tabs/notifications.js b/src/components/settings_modal/tabs/notifications_tab.js
similarity index 80%
rename from src/components/settings_modal/tabs/notifications.js
rename to src/components/settings_modal/tabs/notifications_tab.js
index 0a870b3f32..3e44c95df9 100644
--- a/src/components/settings_modal/tabs/notifications.js
+++ b/src/components/settings_modal/tabs/notifications_tab.js
@@ -1,6 +1,6 @@
-import Checkbox from '../../checkbox/checkbox.vue'
+import Checkbox from 'src/components/checkbox/checkbox.vue'
-const Notifications = {
+const NotificationsTab = {
data () {
return {
activeTab: 'profile',
@@ -24,4 +24,4 @@ const Notifications = {
}
}
-export default Notifications
+export default NotificationsTab
diff --git a/src/components/settings_modal/tabs/notifications.vue b/src/components/settings_modal/tabs/notifications_tab.vue
similarity index 96%
rename from src/components/settings_modal/tabs/notifications.vue
rename to src/components/settings_modal/tabs/notifications_tab.vue
index f9a7c17b1f..ab33a6a5ff 100644
--- a/src/components/settings_modal/tabs/notifications.vue
+++ b/src/components/settings_modal/tabs/notifications_tab.vue
@@ -38,5 +38,5 @@
-
+
diff --git a/src/components/settings_modal/tabs/profile.js b/src/components/settings_modal/tabs/profile_tab.js
similarity index 90%
rename from src/components/settings_modal/tabs/profile.js
rename to src/components/settings_modal/tabs/profile_tab.js
index 18c440243d..949b480b60 100644
--- a/src/components/settings_modal/tabs/profile.js
+++ b/src/components/settings_modal/tabs/profile_tab.js
@@ -1,12 +1,12 @@
import unescape from 'lodash/unescape'
-import ImageCropper from '../../image_cropper/image_cropper.vue'
-import ScopeSelector from '../../scope_selector/scope_selector.vue'
-import fileSizeFormatService from '../../../services/file_size_format/file_size_format.js'
-import ProgressButton from '../../progress_button/progress_button.vue'
-import EmojiInput from '../../emoji_input/emoji_input.vue'
-import suggestor from '../../emoji_input/suggestor.js'
-import Autosuggest from '../../autosuggest/autosuggest.vue'
-import Checkbox from '../../checkbox/checkbox.vue'
+import ImageCropper from 'src/components/image_cropper/image_cropper.vue'
+import ScopeSelector from 'src/components/scope_selector/scope_selector.vue'
+import fileSizeFormatService from 'src/components/../services/file_size_format/file_size_format.js'
+import ProgressButton from 'src/components/progress_button/progress_button.vue'
+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'
const ProfileTab = {
data () {
diff --git a/src/components/settings_modal/tabs/profile.scss b/src/components/settings_modal/tabs/profile_tab.scss
similarity index 100%
rename from src/components/settings_modal/tabs/profile.scss
rename to src/components/settings_modal/tabs/profile_tab.scss
diff --git a/src/components/settings_modal/tabs/profile.vue b/src/components/settings_modal/tabs/profile_tab.vue
similarity index 98%
rename from src/components/settings_modal/tabs/profile.vue
rename to src/components/settings_modal/tabs/profile_tab.vue
index 335fc12e31..9dd89b99d7 100644
--- a/src/components/settings_modal/tabs/profile.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -209,5 +209,5 @@
-
-
+
+
diff --git a/src/components/user_settings/confirm.js b/src/components/settings_modal/tabs/security_tab/confirm.js
similarity index 100%
rename from src/components/user_settings/confirm.js
rename to src/components/settings_modal/tabs/security_tab/confirm.js
diff --git a/src/components/user_settings/confirm.vue b/src/components/settings_modal/tabs/security_tab/confirm.vue
similarity index 100%
rename from src/components/user_settings/confirm.vue
rename to src/components/settings_modal/tabs/security_tab/confirm.vue
diff --git a/src/components/user_settings/mfa.js b/src/components/settings_modal/tabs/security_tab/mfa.js
similarity index 100%
rename from src/components/user_settings/mfa.js
rename to src/components/settings_modal/tabs/security_tab/mfa.js
diff --git a/src/components/user_settings/mfa.vue b/src/components/settings_modal/tabs/security_tab/mfa.vue
similarity index 97%
rename from src/components/user_settings/mfa.vue
rename to src/components/settings_modal/tabs/security_tab/mfa.vue
index 14ea10a1df..25c4d1dcba 100644
--- a/src/components/user_settings/mfa.vue
+++ b/src/components/settings_modal/tabs/security_tab/mfa.vue
@@ -137,11 +137,7 @@
diff --git a/src/components/user_settings/mfa_totp.js b/src/components/settings_modal/tabs/security_tab/mfa_totp.js
similarity index 100%
rename from src/components/user_settings/mfa_totp.js
rename to src/components/settings_modal/tabs/security_tab/mfa_totp.js
diff --git a/src/components/user_settings/mfa_totp.vue b/src/components/settings_modal/tabs/security_tab/mfa_totp.vue
similarity index 100%
rename from src/components/user_settings/mfa_totp.vue
rename to src/components/settings_modal/tabs/security_tab/mfa_totp.vue
diff --git a/src/components/settings_modal/tabs/security.js b/src/components/settings_modal/tabs/security_tab/security_tab.js
similarity index 92%
rename from src/components/settings_modal/tabs/security.js
rename to src/components/settings_modal/tabs/security_tab/security_tab.js
index cc791b7aed..811161a51b 100644
--- a/src/components/settings_modal/tabs/security.js
+++ b/src/components/settings_modal/tabs/security_tab/security_tab.js
@@ -1,8 +1,8 @@
-import ProgressButton from '../../progress_button/progress_button.vue'
-import Checkbox from '../../checkbox/checkbox.vue'
-import Mfa from '../../user_settings/mfa.vue'
+import ProgressButton from 'src/components/progress_button/progress_button.vue'
+import Checkbox from 'src/components/checkbox/checkbox.vue'
+import Mfa from './mfa.vue'
-const Security = {
+const SecurityTab = {
data () {
return {
newEmail: '',
@@ -103,4 +103,4 @@ const Security = {
}
}
-export default Security
+export default SecurityTab
diff --git a/src/components/settings_modal/tabs/security.vue b/src/components/settings_modal/tabs/security_tab/security_tab.vue
similarity index 98%
rename from src/components/settings_modal/tabs/security.vue
rename to src/components/settings_modal/tabs/security_tab/security_tab.vue
index 603c9a04a4..45bacec1ce 100644
--- a/src/components/settings_modal/tabs/security.vue
+++ b/src/components/settings_modal/tabs/security_tab/security_tab.vue
@@ -139,5 +139,5 @@
-
+
diff --git a/src/components/style_switcher/preview.vue b/src/components/settings_modal/tabs/theme_tab/preview.vue
similarity index 100%
rename from src/components/style_switcher/preview.vue
rename to src/components/settings_modal/tabs/theme_tab/preview.vue
diff --git a/src/components/style_switcher/style_switcher.js b/src/components/settings_modal/tabs/theme_tab/theme_tab.js
similarity index 96%
rename from src/components/style_switcher/style_switcher.js
rename to src/components/settings_modal/tabs/theme_tab/theme_tab.js
index a7f586f4b4..9d61b0c44c 100644
--- a/src/components/style_switcher/style_switcher.js
+++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.js
@@ -3,7 +3,7 @@ import {
rgb2hex,
hex2rgb,
getContrastRatioLayers
-} from '../../services/color_convert/color_convert.js'
+} from 'src/services/color_convert/color_convert.js'
import {
DEFAULT_SHADOWS,
generateColors,
@@ -14,26 +14,27 @@ import {
getThemes,
shadows2to3,
colors2to3
-} from '../../services/style_setter/style_setter.js'
+} from 'src/services/style_setter/style_setter.js'
import {
SLOT_INHERITANCE
-} from '../../services/theme_data/pleromafe.js'
+} from 'src/services/theme_data/pleromafe.js'
import {
CURRENT_VERSION,
OPACITIES,
getLayers,
getOpacitySlot
-} from '../../services/theme_data/theme_data.service.js'
-import ColorInput from '../color_input/color_input.vue'
-import RangeInput from '../range_input/range_input.vue'
-import OpacityInput from '../opacity_input/opacity_input.vue'
-import ShadowControl from '../shadow_control/shadow_control.vue'
-import FontControl from '../font_control/font_control.vue'
-import ContrastRatio from '../contrast_ratio/contrast_ratio.vue'
-import TabSwitcher from '../tab_switcher/tab_switcher.js'
+} from 'src/services/theme_data/theme_data.service.js'
+import ColorInput from 'src/components/color_input/color_input.vue'
+import RangeInput from 'src/components/range_input/range_input.vue'
+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 ExportImport from 'src/components/export_import/export_import.vue'
+import Checkbox from 'src/components/checkbox/checkbox.vue'
+
import Preview from './preview.vue'
-import ExportImport from '../export_import/export_import.vue'
-import Checkbox from '../checkbox/checkbox.vue'
// List of color values used in v1
const v1OnlyNames = [
diff --git a/src/components/style_switcher/style_switcher.scss b/src/components/settings_modal/tabs/theme_tab/theme_tab.scss
similarity index 97%
rename from src/components/style_switcher/style_switcher.scss
rename to src/components/settings_modal/tabs/theme_tab/theme_tab.scss
index d2a40d1341..75b3017dfe 100644
--- a/src/components/style_switcher/style_switcher.scss
+++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.scss
@@ -1,5 +1,5 @@
-@import '../../_variables.scss';
-.style-switcher {
+@import 'src/_variables.scss';
+.theme-tab {
.theme-warning {
display: flex;
align-items: baseline;
@@ -54,10 +54,6 @@
}
}
- .tab-switcher {
- margin: 0 -1em;
- }
-
.reset-container {
flex-wrap: wrap;
}
@@ -161,7 +157,7 @@
border-bottom: 1px dashed;
border-color: $fallback--border;
border-color: var(--border, $fallback--border);
- margin: 1em -1em 0;
+ margin: 1em 0;
padding: 1em;
background: var(--body-background-image);
background-size: cover;
@@ -328,6 +324,14 @@
padding: 20px;
}
+ .apply-container {
+ .btn {
+ min-height: 28px;
+ min-width: 10em;
+ padding: 0 2em;
+ }
+ }
+
.btn {
margin-left: .25em;
margin-right: .25em;
diff --git a/src/components/style_switcher/style_switcher.vue b/src/components/settings_modal/tabs/theme_tab/theme_tab.vue
similarity index 92%
rename from src/components/style_switcher/style_switcher.vue
rename to src/components/settings_modal/tabs/theme_tab/theme_tab.vue
index 62c8e634c3..6f6cf1d682 100644
--- a/src/components/style_switcher/style_switcher.vue
+++ b/src/components/settings_modal/tabs/theme_tab/theme_tab.vue
@@ -1,90 +1,90 @@
-
-
-
-
+
+
+
-
- {{ themeWarningHelp }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ {{ themeWarningHelp }}
-
-
-
- {{ $t('settings.presets') }}
-
-
+ {{ $t('settings.style.switcher.use_source') }}
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('settings.presets') }}
+
+
+
+
@@ -951,6 +951,6 @@
-
+
-
+
diff --git a/src/components/settings_modal/tabs/version_tab.js b/src/components/settings_modal/tabs/version_tab.js
new file mode 100644
index 0000000000..616bdadf51
--- /dev/null
+++ b/src/components/settings_modal/tabs/version_tab.js
@@ -0,0 +1,24 @@
+import { extractCommit } from 'src/services/version/version.service'
+
+const pleromaFeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma-fe/commit/'
+const pleromaBeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma/commit/'
+
+const VersionTab = {
+ data () {
+ const instance = this.$store.state.instance
+ return {
+ backendVersion: instance.backendVersion,
+ frontendVersion: instance.frontendVersion
+ }
+ },
+ computed: {
+ frontendVersionLink () {
+ return pleromaFeCommitUrl + this.frontendVersion
+ },
+ backendVersionLink () {
+ return pleromaBeCommitUrl + extractCommit(this.backendVersion)
+ }
+ }
+}
+
+export default VersionTab
diff --git a/src/components/settings_modal/tabs/version_tab.vue b/src/components/settings_modal/tabs/version_tab.vue
new file mode 100644
index 0000000000..acc4356960
--- /dev/null
+++ b/src/components/settings_modal/tabs/version_tab.vue
@@ -0,0 +1,31 @@
+
+
+
+
-
-
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 312f728329..d42be00fe7 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -68,7 +68,9 @@
"disable": "Disable",
"enable": "Enable",
"confirm": "Confirm",
- "verify": "Verify"
+ "verify": "Verify",
+ "close": "Close",
+ "peek": "Peek"
},
"image_cropper": {
"crop_picture": "Crop picture",