From dcb7e1ecf479a72c904dd882c05f1c446dbe2fe4 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 00:32:25 +0100 Subject: [PATCH 1/7] Add option for disabling counts (followers, statuses) in user profiles. --- src/components/settings/settings.js | 4 ++++ src/components/settings/settings.vue | 4 ++++ src/components/user_card_content/user_card_content.js | 5 +++++ src/components/user_card_content/user_card_content.vue | 10 +++++----- src/i18n/messages.js | 1 + src/main.js | 1 + src/modules/config.js | 1 + 7 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index de12894b..088e19d3 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -10,6 +10,7 @@ const settings = { hideAttachmentsLocal: this.$store.state.config.hideAttachments, hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv, hideNsfwLocal: this.$store.state.config.hideNsfw, + hideUserStatsLocal: this.$store.state.config.hideUserStats, notificationVisibilityLocal: this.$store.state.config.notificationVisibility, replyVisibilityLocal: this.$store.state.config.replyVisibility, loopVideoLocal: this.$store.state.config.loopVideo, @@ -47,6 +48,9 @@ const settings = { hideAttachmentsInConvLocal (value) { this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value }) }, + hideUserStatsLocal (value) { + this.$store.dispatch('setOption', { name: 'hideUserStats', value }) + }, hideNsfwLocal (value) { this.$store.dispatch('setOption', { name: 'hideNsfw', value }) }, diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index c106b79c..2cf62200 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -122,6 +122,10 @@ +
+ + +

{{$t('settings.filtering_explanation')}}

diff --git a/src/components/user_card_content/user_card_content.js b/src/components/user_card_content/user_card_content.js index 76a5577e..eefa65f3 100644 --- a/src/components/user_card_content/user_card_content.js +++ b/src/components/user_card_content/user_card_content.js @@ -3,6 +3,11 @@ import { hex2rgb } from '../../services/color_convert/color_convert.js' export default { props: [ 'user', 'switcher', 'selected', 'hideBio' ], + data () { + return { + hideUserStatsLocal: this.$store.state.config.hideUserStats + } + }, computed: { headingStyle () { const color = this.$store.state.config.colors.bg diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 59358040..65fd26eb 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -17,7 +17,7 @@
{{user.name}}
@{{user.screen_name}} - {{dailyAvg}} {{ $t('user_card.per_day') }} + {{dailyAvg}} {{ $t('user_card.per_day') }}
@@ -90,19 +90,19 @@ -
+
{{ $t('user_card.statuses') }}
- {{user.statuses_count}}
+ {{user.statuses_count}}
{{ $t('user_card.followees') }}
- {{user.friends_count}} + {{user.friends_count}}
{{ $t('user_card.followers') }}
- {{user.followers_count}} + {{user.followers_count}}

diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 42e7e9d4..42b1dd40 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -328,6 +328,7 @@ const en = { loop_video_silent_only: 'Loop only videos without sound (i.e. Mastodon\'s "gifs")', reply_link_preview: 'Enable reply-link preview on mouse hover', replies_in_timeline: 'Replies in timeline', + hide_user_stats: 'Hide user statistics (e.g. status and follower counts)', reply_visibility_all: 'Show all replies', reply_visibility_following: 'Only show replies directed at me or users I\'m following', reply_visibility_self: 'Only show replies directed at me', diff --git a/src/main.js b/src/main.js index debd8703..d05ecba8 100644 --- a/src/main.js +++ b/src/main.js @@ -48,6 +48,7 @@ const persistedStateOptions = { 'config.collapseMessageWithSubject', 'config.hideAttachments', 'config.hideAttachmentsInConv', + 'config.hideUserStats', 'config.hideNsfw', 'config.replyVisibility', 'config.notificationVisibility', diff --git a/src/modules/config.js b/src/modules/config.js index 60a34bc1..24665e95 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -9,6 +9,7 @@ const defaultState = { collapseMessageWithSubject: false, hideAttachments: false, hideAttachmentsInConv: false, + hideUserStats: false, hideNsfw: true, loopVideo: true, loopVideoSilentOnly: true, From bdcbd110e42a5deb46116f3ba631118143f71a69 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 00:41:37 +0100 Subject: [PATCH 2/7] Add option for hiding post statistics (e.g. repeats, favs) --- src/components/favorite_button/favorite_button.js | 1 + src/components/favorite_button/favorite_button.vue | 4 ++-- src/components/retweet_button/retweet_button.js | 1 + src/components/retweet_button/retweet_button.vue | 4 ++-- src/components/settings/settings.js | 4 ++++ src/components/settings/settings.vue | 4 ++++ src/i18n/messages.js | 1 + src/main.js | 1 + src/modules/config.js | 1 + 9 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js index 1266be90..80893719 100644 --- a/src/components/favorite_button/favorite_button.js +++ b/src/components/favorite_button/favorite_button.js @@ -2,6 +2,7 @@ const FavoriteButton = { props: ['status', 'loggedIn'], data () { return { + hidePostStatsLocal: this.$store.state.config.hidePostStats, animated: false } }, diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue index 1e1a6970..71cb875e 100644 --- a/src/components/favorite_button/favorite_button.vue +++ b/src/components/favorite_button/favorite_button.vue @@ -1,11 +1,11 @@ diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js index cafa9cbc..ef2f271a 100644 --- a/src/components/retweet_button/retweet_button.js +++ b/src/components/retweet_button/retweet_button.js @@ -2,6 +2,7 @@ const RetweetButton = { props: ['status', 'loggedIn', 'visibility'], data () { return { + hidePostStatsLocal: this.$store.state.config.hidePostStats, animated: false } }, diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue index ee5722bd..5b1e64b8 100644 --- a/src/components/retweet_button/retweet_button.vue +++ b/src/components/retweet_button/retweet_button.vue @@ -2,7 +2,7 @@
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 088e19d3..1dd53ab2 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -10,6 +10,7 @@ const settings = { hideAttachmentsLocal: this.$store.state.config.hideAttachments, hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv, hideNsfwLocal: this.$store.state.config.hideNsfw, + hidePostStatsLocal: this.$store.state.config.hidePostStats, hideUserStatsLocal: this.$store.state.config.hideUserStats, notificationVisibilityLocal: this.$store.state.config.notificationVisibility, replyVisibilityLocal: this.$store.state.config.replyVisibility, @@ -48,6 +49,9 @@ const settings = { hideAttachmentsInConvLocal (value) { this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value }) }, + hidePostStatsLocal (value) { + this.$store.dispatch('setOption', { name: 'hidePostStats', value }) + }, hideUserStatsLocal (value) { this.$store.dispatch('setOption', { name: 'hideUserStats', value }) }, diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 2cf62200..18e8e244 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -122,6 +122,10 @@
+
+ + +
diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 42b1dd40..56cc7b49 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -328,6 +328,7 @@ const en = { loop_video_silent_only: 'Loop only videos without sound (i.e. Mastodon\'s "gifs")', reply_link_preview: 'Enable reply-link preview on mouse hover', replies_in_timeline: 'Replies in timeline', + hide_post_stats: 'Hide post statistics (e.g. repeat and favorite counts)', hide_user_stats: 'Hide user statistics (e.g. status and follower counts)', reply_visibility_all: 'Show all replies', reply_visibility_following: 'Only show replies directed at me or users I\'m following', diff --git a/src/main.js b/src/main.js index d05ecba8..132029dc 100644 --- a/src/main.js +++ b/src/main.js @@ -48,6 +48,7 @@ const persistedStateOptions = { 'config.collapseMessageWithSubject', 'config.hideAttachments', 'config.hideAttachmentsInConv', + 'config.hidePostStats', 'config.hideUserStats', 'config.hideNsfw', 'config.replyVisibility', diff --git a/src/modules/config.js b/src/modules/config.js index 24665e95..dae58eb1 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -9,6 +9,7 @@ const defaultState = { collapseMessageWithSubject: false, hideAttachments: false, hideAttachmentsInConv: false, + hidePostStats: false, hideUserStats: false, hideNsfw: true, loopVideo: true, From 699ee0891ddb8d788cff77366ee8ac73eb4b02f9 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 00:48:14 +0100 Subject: [PATCH 3/7] Changeable defaults for hideUserStats and hidePostStats --- src/main.js | 4 ++++ static/config.json | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 132029dc..c69ca6c3 100644 --- a/src/main.js +++ b/src/main.js @@ -123,6 +123,8 @@ window.fetch('/api/statusnet/config.json') var scopeOptionsEnabled = (config.scopeOptionsEnabled) var formattingOptionsEnabled = (config.formattingOptionsEnabled) var collapseMessageWithSubject = (config.collapseMessageWithSubject) + var hidePostStats = (config.hidePostStats) + var hideUserStats = (config.hideUserStats) store.dispatch('setOption', { name: 'theme', value: theme }) store.dispatch('setOption', { name: 'background', value: background }) @@ -136,6 +138,8 @@ window.fetch('/api/statusnet/config.json') store.dispatch('setOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled }) store.dispatch('setOption', { name: 'formattingOptionsEnabled', value: formattingOptionsEnabled }) store.dispatch('setOption', { name: 'collapseMessageWithSubject', value: collapseMessageWithSubject }) + store.dispatch('setOption', { name: 'hidePostStats', value: hidePostStats }) + store.dispatch('setOption', { name: 'hideUserStats', value: hideUserStats }) if (chatDisabled) { store.dispatch('disableChat') } diff --git a/static/config.json b/static/config.json index 144fe951..a6eace0f 100644 --- a/static/config.json +++ b/static/config.json @@ -10,5 +10,7 @@ "showInstanceSpecificPanel": false, "scopeOptionsEnabled": false, "formattingOptionsEnabled": false, - "collapseMessageWithSubject": false + "collapseMessageWithSubject": false, + "hidePostStats": false, + "hideUserStats": false } From 5a59eb4efab1aa54000a229694a958e3e1274e8d Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 01:10:22 +0100 Subject: [PATCH 4/7] Don't hide the bio. --- src/components/user_card_content/user_card_content.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 65fd26eb..84669d7f 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -90,8 +90,8 @@
-
-
+
+
{{ $t('user_card.statuses') }}
{{user.statuses_count}}
From 8dc85b057e058a39f968fa188e0d77a5a9dd5ca6 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 01:18:55 +0100 Subject: [PATCH 5/7] Don't only include whitespace conditionally, to fix the fade. --- src/components/user_card_content/user_card_content.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 84669d7f..9ce3ca19 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -94,7 +94,7 @@
{{ $t('user_card.statuses') }}
- {{user.statuses_count}}
+ {{user.statuses_count}}
{{ $t('user_card.followees') }}
@@ -105,6 +105,7 @@ {{user.followers_count}}
+

{{ user.description }}

From 145929207ef9204066b03ab104284168a054b5f0 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 02:00:12 +0100 Subject: [PATCH 6/7] Revert "Don't only include whitespace conditionally, to fix the fade." This reverts commit 8dc85b057e058a39f968fa188e0d77a5a9dd5ca6. --- src/components/user_card_content/user_card_content.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 9ce3ca19..84669d7f 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -94,7 +94,7 @@
{{ $t('user_card.statuses') }}
- {{user.statuses_count}} + {{user.statuses_count}}
{{ $t('user_card.followees') }}
@@ -105,7 +105,6 @@ {{user.followers_count}}
-

{{ user.description }}

From 2bb663f0f6925082087ec08c4a28ab9e661bae96 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 16 Oct 2018 14:15:04 +0100 Subject: [PATCH 7/7] satisfy lint --- src/components/favorite_button/favorite_button.js | 2 +- src/components/retweet_button/retweet_button.js | 2 +- src/components/settings/settings.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js index 1621341e..a2b4cb65 100644 --- a/src/components/favorite_button/favorite_button.js +++ b/src/components/favorite_button/favorite_button.js @@ -2,7 +2,7 @@ const FavoriteButton = { props: ['status', 'loggedIn'], data () { return { - hidePostStatsLocal: typeof this.$store.state.config.hidePostStats == 'undefined' + hidePostStatsLocal: typeof this.$store.state.config.hidePostStats === 'undefined' ? this.$store.state.instance.hidePostStats : this.$store.state.config.hidePostStats, animated: false diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js index 1527afc8..eb4e4b41 100644 --- a/src/components/retweet_button/retweet_button.js +++ b/src/components/retweet_button/retweet_button.js @@ -2,7 +2,7 @@ const RetweetButton = { props: ['status', 'loggedIn', 'visibility'], data () { return { - hidePostStatsLocal: typeof this.$store.state.config.hidePostStats == 'undefined' + hidePostStatsLocal: typeof this.$store.state.config.hidePostStats === 'undefined' ? this.$store.state.instance.hidePostStats : this.$store.state.config.hidePostStats, animated: false diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index fe8a2d9e..67110841 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -16,11 +16,11 @@ const settings = { hidePostStatsLocal: typeof user.hidePostStats === 'undefined' ? instance.hidePostStats : user.hidePostStats, - hidePostStatsDefault : this.$t('settings.values.' + instance.hidePostStats), + hidePostStatsDefault: this.$t('settings.values.' + instance.hidePostStats), hideUserStatsLocal: typeof user.hideUserStats === 'undefined' ? instance.hideUserStats : user.hideUserStats, - hideUserStatsDefault : this.$t('settings.values.' + instance.hideUserStats), + hideUserStatsDefault: this.$t('settings.values.' + instance.hideUserStats), notificationVisibilityLocal: user.notificationVisibility, replyVisibilityLocal: user.replyVisibility, loopVideoLocal: user.loopVideo,