From dcb7e1ecf479a72c904dd882c05f1c446dbe2fe4 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 00:32:25 +0100 Subject: 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 +++++----- 4 files changed, 18 insertions(+), 5 deletions(-) (limited to 'src/components') 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}}

-- cgit v1.2.3-70-g09d2 From bdcbd110e42a5deb46116f3ba631118143f71a69 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 00:41:37 +0100 Subject: 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(-) (limited to 'src/components') 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, -- cgit v1.2.3-70-g09d2 From 5a59eb4efab1aa54000a229694a958e3e1274e8d Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 01:10:22 +0100 Subject: Don't hide the bio. --- src/components/user_card_content/user_card_content.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components') 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}}
-- cgit v1.2.3-70-g09d2 From 8dc85b057e058a39f968fa188e0d77a5a9dd5ca6 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 01:18:55 +0100 Subject: 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(-) (limited to 'src/components') 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 }}

-- cgit v1.2.3-70-g09d2 From 145929207ef9204066b03ab104284168a054b5f0 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 02:00:12 +0100 Subject: 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(-) (limited to 'src/components') 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 }}

-- cgit v1.2.3-70-g09d2 From 2bb663f0f6925082087ec08c4a28ab9e661bae96 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 16 Oct 2018 14:15:04 +0100 Subject: 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(-) (limited to 'src/components') 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, -- cgit v1.2.3-70-g09d2 From d6ad08050ad0cfcf5ed4a94b5b2e8c66ef27ca0a Mon Sep 17 00:00:00 2001 From: scarlett Date: Sun, 21 Oct 2018 18:04:23 +0100 Subject: Fall back to instance settings consistently --- src/components/status/status.js | 15 +++++++++++---- src/modules/config.js | 1 - 2 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src/components') diff --git a/src/components/status/status.js b/src/components/status/status.js index 45f5ccac..f1afcac7 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -31,10 +31,17 @@ const Status = { preview: null, showPreview: false, showingTall: false, - expandingSubject: !this.$store.state.config.collapseMessageWithSubject + expandingSubject: typeof this.$store.state.config.collapseMessageWithSubject === 'undefined' + ? !this.$store.state.instance.collapseMessageWithSubject + : !this.$store.state.config.collapseMessageWithSubject } }, computed: { + localCollapseSubjectDefault () { + return typeof this.$store.state.config.collapseMessageWithSubject === 'undefined' + ? this.$store.state.instance.collapseMessageWithSubject + : this.$store.state.config.collapseMessageWithSubject + }, muteWords () { return this.$store.state.config.muteWords }, @@ -147,13 +154,13 @@ const Status = { return this.status.attentions.length > 0 }, hideSubjectStatus () { - if (this.tallStatus && !this.$store.state.config.collapseMessageWithSubject) { + if (this.tallStatus && !this.localCollapseSubjectDefault) { return false } return !this.expandingSubject && this.status.summary }, hideTallStatus () { - if (this.status.summary && this.$store.state.config.collapseMessageWithSubject) { + if (this.status.summary && this.localCollapseSubjectDefault) { return false } if (this.showingTall) { @@ -168,7 +175,7 @@ const Status = { if (!this.status.nsfw) { return false } - if (this.status.summary && this.$store.state.config.collapseMessageWithSubject) { + if (this.status.summary && this.localCollapseSubjectDefault) { return false } return true diff --git a/src/modules/config.js b/src/modules/config.js index 375d0167..1c04845a 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -5,7 +5,6 @@ const browserLocale = (window.navigator.language || 'en').split('-')[0] const defaultState = { colors: {}, - collapseMessageWithSubject: false, hideAttachments: false, hideAttachmentsInConv: false, hideNsfw: true, -- cgit v1.2.3-70-g09d2 From 6f668df6976d7210a9768931b5f4b58994289479 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 7 Nov 2018 17:20:33 +0100 Subject: Count spoiler text in the character count. Fixes #135. --- src/components/post_status_form/post_status_form.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/components') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index a84e764c..af7d8810 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -53,7 +53,7 @@ const PostStatusForm = { posting: false, highlighted: 0, newStatus: { - spoilerText: this.subject, + spoilerText: this.subject || '', status: statusText, contentType: 'text/plain', nsfw: false, @@ -128,6 +128,9 @@ const PostStatusForm = { statusLength () { return this.newStatus.status.length }, + spoilerTextLength () { + return this.newStatus.spoilerText.length + }, statusLengthLimit () { return this.$store.state.instance.textlimit }, @@ -135,10 +138,10 @@ const PostStatusForm = { return this.statusLengthLimit > 0 }, charactersLeft () { - return this.statusLengthLimit - this.statusLength + return this.statusLengthLimit - (this.statusLength + this.spoilerTextLength) }, isOverLengthLimit () { - return this.hasStatusLengthLimit && (this.statusLength > this.statusLengthLimit) + return this.hasStatusLengthLimit && (this.charactersLeft < 0) }, scopeOptionsEnabled () { return this.$store.state.instance.scopeOptionsEnabled -- cgit v1.2.3-70-g09d2 From 2c2c4452b93efa53ff03e871e525b3a096855063 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 8 Nov 2018 19:34:59 +0100 Subject: Fix posting. --- src/components/post_status_form/post_status_form.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src/components') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index af7d8810..c0e34d72 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -226,6 +226,7 @@ const PostStatusForm = { if (!data.error) { this.newStatus = { status: '', + spoilerText: '', files: [], visibility: newStatus.visibility, contentType: newStatus.contentType -- cgit v1.2.3-70-g09d2