From c6d4c20982261b55b16dda59c3e657eb1feb0041 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 11 Mar 2021 16:11:44 +0200 Subject: Made Select component to make using styled selects easier --- src/components/settings_modal/tabs/general_tab.vue | 72 ++++++++-------------- 1 file changed, 27 insertions(+), 45 deletions(-) (limited to 'src/components/settings_modal/tabs/general_tab.vue') diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 9228c78e..a0413cfa 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -87,59 +87,41 @@
  • {{ $t('settings.subject_line_behavior') }} - + + + +
  • {{ $t('settings.post_status_content_type') }} - + {{ $t(`post_status.content_type["${postFormat}"]`) }} + {{ postContentTypeDefaultValue === postFormat ? $t('settings.instance_default_simple') : '' }} + +
  • -- cgit v1.2.3-70-g09d2 From 1f0ac68fcd3f382eedf69d1f5fdcffdc16c3885e Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Thu, 11 Mar 2021 16:55:14 +0200 Subject: implement ChoiceSetting for settings modal similar to BooleanSetting --- .../settings_modal/helpers/choice_setting.js | 34 ++++++++++++++++ .../settings_modal/helpers/choice_setting.vue | 29 ++++++++++++++ .../settings_modal/tabs/filtering_tab.js | 11 ++++-- .../settings_modal/tabs/filtering_tab.vue | 17 +++----- src/components/settings_modal/tabs/general_tab.js | 18 +++++++-- src/components/settings_modal/tabs/general_tab.vue | 46 ++++++---------------- 6 files changed, 103 insertions(+), 52 deletions(-) create mode 100644 src/components/settings_modal/helpers/choice_setting.js create mode 100644 src/components/settings_modal/helpers/choice_setting.vue (limited to 'src/components/settings_modal/tabs/general_tab.vue') diff --git a/src/components/settings_modal/helpers/choice_setting.js b/src/components/settings_modal/helpers/choice_setting.js new file mode 100644 index 00000000..042e8106 --- /dev/null +++ b/src/components/settings_modal/helpers/choice_setting.js @@ -0,0 +1,34 @@ +import { get, set } from 'lodash' +import Select from 'src/components/select/select.vue' +import ModifiedIndicator from './modified_indicator.vue' +export default { + components: { + Select, + ModifiedIndicator + }, + props: [ + 'path', + 'disabled', + 'options' + ], + computed: { + pathDefault () { + const [firstSegment, ...rest] = this.path.split('.') + return [firstSegment + 'DefaultValue', ...rest].join('.') + }, + state () { + return get(this.$parent, this.path) + }, + defaultState () { + return get(this.$parent, this.pathDefault) + }, + isChanged () { + return get(this.$parent, this.path) !== get(this.$parent, this.pathDefault) + } + }, + methods: { + update (e) { + set(this.$parent, this.path, e) + } + } +} diff --git a/src/components/settings_modal/helpers/choice_setting.vue b/src/components/settings_modal/helpers/choice_setting.vue new file mode 100644 index 00000000..1a8275b4 --- /dev/null +++ b/src/components/settings_modal/helpers/choice_setting.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/src/components/settings_modal/tabs/filtering_tab.js b/src/components/settings_modal/tabs/filtering_tab.js index 89199d85..4eaf4217 100644 --- a/src/components/settings_modal/tabs/filtering_tab.js +++ b/src/components/settings_modal/tabs/filtering_tab.js @@ -1,18 +1,23 @@ import { filter, trim } from 'lodash' import BooleanSetting from '../helpers/boolean_setting.vue' -import Select from '../../select/select.vue' +import ChoiceSetting from '../helpers/choice_setting.vue' import SharedComputedObject from '../helpers/shared_computed_object.js' const FilteringTab = { data () { return { - muteWordsStringLocal: this.$store.getters.mergedConfig.muteWords.join('\n') + muteWordsStringLocal: this.$store.getters.mergedConfig.muteWords.join('\n'), + replyVisibilityOptions: ['all', 'following', 'self'].map(mode => ({ + key: mode, + value: mode, + label: this.$t(`settings.reply_visibility_${mode}`) + })) } }, components: { BooleanSetting, - Select + ChoiceSetting }, computed: { ...SharedComputedObject(), diff --git a/src/components/settings_modal/tabs/filtering_tab.vue b/src/components/settings_modal/tabs/filtering_tab.vue index 4023fbe2..fb5fc375 100644 --- a/src/components/settings_modal/tabs/filtering_tab.vue +++ b/src/components/settings_modal/tabs/filtering_tab.vue @@ -36,20 +36,13 @@
  • -
    - {{ $t('settings.replies_in_timeline') }} - -
    + {{ $t('settings.replies_in_timeline') }} +
    {{ $t('settings.hide_post_stats') }} diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js index 03648d0b..07fccf57 100644 --- a/src/components/settings_modal/tabs/general_tab.js +++ b/src/components/settings_modal/tabs/general_tab.js @@ -1,5 +1,5 @@ import BooleanSetting from '../helpers/boolean_setting.vue' -import Select from '../../select/select.vue' +import ChoiceSetting from '../helpers/choice_setting.vue' import InterfaceLanguageSwitcher from 'src/components/interface_language_switcher/interface_language_switcher.vue' import SharedComputedObject from '../helpers/shared_computed_object.js' @@ -15,6 +15,11 @@ library.add( const GeneralTab = { data () { return { + subjectLineOptions: ['email', 'noop', 'masto'].map(mode => ({ + key: mode, + value: mode, + label: this.$t(`settings.subject_line_${mode === 'masto' ? 'mastodon' : mode}`) + })), loopSilentAvailable: // Firefox Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') || @@ -26,13 +31,20 @@ const GeneralTab = { }, components: { BooleanSetting, - InterfaceLanguageSwitcher, - Select + ChoiceSetting, + InterfaceLanguageSwitcher }, computed: { postFormats () { return this.$store.state.instance.postFormats || [] }, + postContentOptions () { + return this.postFormats.map(format => ({ + key: format, + value: format, + label: this.$t(`post_status.content_type["${format}"]`) + })) + }, instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel }, instanceWallpaperUsed () { return this.$store.state.instance.background && diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index a0413cfa..7fb82c06 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -85,44 +85,22 @@
  • -
    + {{ $t('settings.subject_line_behavior') }} - -
    +
  • -
    + {{ $t('settings.post_status_content_type') }} - -
    +
  • -- cgit v1.2.3-70-g09d2 From 7341b8a5516621985a76456e1eefc58cd23ff2e2 Mon Sep 17 00:00:00 2001 From: eris Date: Wed, 26 May 2021 22:22:55 +0000 Subject: Implement right sidebar option as user option --- CHANGELOG.md | 1 + src/App.js | 2 +- src/components/settings_modal/tabs/general_tab.vue | 5 +++++ src/i18n/en.json | 1 + src/modules/config.js | 1 + 5 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/components/settings_modal/tabs/general_tab.vue') diff --git a/CHANGELOG.md b/CHANGELOG.md index cef6d401..905d9f65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Added a quick settings to timeline header for easier access - Added option to mark posts as sensitive by default - Added quick filters for notifications +- Implemented user option to change sidebar position to the right side ## [2.3.0] - 2021-03-01 diff --git a/src/App.js b/src/App.js index 1ca029b6..231c6ae1 100644 --- a/src/App.js +++ b/src/App.js @@ -77,7 +77,7 @@ export default { privateMode () { return this.$store.state.instance.private }, sidebarAlign () { return { - 'order': this.$store.state.instance.sidebarRight ? 99 : 0 + 'order': this.$store.getters.mergedConfig.sidebarRight ? 99 : 0 } }, ...mapGetters(['mergedConfig']) diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 9228c78e..7bae4a32 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -11,6 +11,11 @@ {{ $t('settings.hide_isp') }}
  • +
  • + + {{ $t('settings.right_sidebar') }} + +
  • {{ $t('settings.hide_wallpaper') }} diff --git a/src/i18n/en.json b/src/i18n/en.json index d6138482..1b38e29a 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -345,6 +345,7 @@ "hide_all_muted_posts": "Hide muted posts", "max_thumbnails": "Maximum amount of thumbnails per post", "hide_isp": "Hide instance-specific panel", + "right_sidebar": "Show sidebar on the right side", "hide_wallpaper": "Hide instance wallpaper", "preload_images": "Preload images", "use_one_click_nsfw": "Open NSFW attachments with just one click", diff --git a/src/modules/config.js b/src/modules/config.js index 629588a8..0f596750 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -54,6 +54,7 @@ export const defaultState = { interfaceLanguage: browserLocale, hideScopeNotice: false, useStreamingApi: false, + sidebarRight: undefined, // instance default scopeCopy: undefined, // instance default subjectLineBehavior: undefined, // instance default alwaysShowSubjectInput: undefined, // instance default -- cgit v1.2.3-70-g09d2 From b87a9d6675cf7cd8d37d45e62013fab27cbc46e6 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 8 Jun 2021 16:14:01 +0300 Subject: Rearranged settings, moved more stuff to filtering where apllicable. Changed how filering works. --- src/components/notification/notification.scss | 6 + src/components/notification/notification.vue | 1 + src/components/notifications/notifications.scss | 5 - .../settings_modal/tabs/filtering_tab.vue | 195 ++++++++++++++------- src/components/settings_modal/tabs/general_tab.vue | 154 ++++++---------- src/components/status/status.js | 44 +++-- src/components/timeline/timeline_quick_settings.js | 3 +- src/i18n/en.json | 14 +- src/modules/config.js | 2 + src/modules/instance.js | 3 + 10 files changed, 242 insertions(+), 185 deletions(-) (limited to 'src/components/settings_modal/tabs/general_tab.vue') diff --git a/src/components/notification/notification.scss b/src/components/notification/notification.scss index f5905560..e075747b 100644 --- a/src/components/notification/notification.scss +++ b/src/components/notification/notification.scss @@ -2,6 +2,12 @@ // TODO Copypaste from Status, should unify it somehow .Notification { + border-bottom: 1px solid; + border-color: $fallback--border; + border-color: var(--border, $fallback--border); + word-wrap: break-word; + word-break: break-word; + &.-muted { padding: 0.25em 0.6em; height: 1.2em; diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 0081dee4..fb324cec 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -1,6 +1,7 @@