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/main.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main.js') 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', -- 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/main.js') 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 699ee0891ddb8d788cff77366ee8ac73eb4b02f9 Mon Sep 17 00:00:00 2001 From: scarlett Date: Tue, 4 Sep 2018 00:48:14 +0100 Subject: Changeable defaults for hideUserStats and hidePostStats --- src/main.js | 4 ++++ static/config.json | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main.js') 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 } -- cgit v1.2.3-70-g09d2 From 01aba3f9c6fa89106cf5b6322b7919f26e92b21d Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Fri, 26 Oct 2018 10:13:53 +0900 Subject: adapt to destructive change of api --- src/main.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/main.js') diff --git a/src/main.js b/src/main.js index 1b1780df..53cee313 100644 --- a/src/main.js +++ b/src/main.js @@ -217,9 +217,20 @@ window.fetch('/nodeinfo/2.0.json') .then((res) => res.json()) .then((data) => { const metadata = data.metadata - store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: data.metadata.mediaProxy }) - store.dispatch('setInstanceOption', { name: 'chatAvailable', value: data.metadata.chat }) - store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: data.metadata.gopher }) + + const features = metadata.features + store.dispatch('setInstanceOption', { + name: 'mediaProxyAvailable', + value: features.findIndex((element, index, array) => (element === 'media_proxy')) >= 0 + }) + store.dispatch('setInstanceOption', { + name: 'chatAvailable', + value: features.findIndex((element, index, array) => (element === 'chat')) >= 0 + }) + store.dispatch('setInstanceOption', { + name: 'gopherAvailable', + value: features.findIndex((element, index, array) => (element === 'gopher')) >= 0 + }) const suggestions = metadata.suggestions store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled }) -- cgit v1.2.3-70-g09d2 From 630c6e3e4417be8d79bf3ade011f07d78bf99b44 Mon Sep 17 00:00:00 2001 From: hakabahitoyo Date: Fri, 26 Oct 2018 15:08:51 +0900 Subject: simplify code --- src/main.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/main.js') diff --git a/src/main.js b/src/main.js index 53cee313..b71ae4cb 100644 --- a/src/main.js +++ b/src/main.js @@ -219,18 +219,9 @@ window.fetch('/nodeinfo/2.0.json') const metadata = data.metadata const features = metadata.features - store.dispatch('setInstanceOption', { - name: 'mediaProxyAvailable', - value: features.findIndex((element, index, array) => (element === 'media_proxy')) >= 0 - }) - store.dispatch('setInstanceOption', { - name: 'chatAvailable', - value: features.findIndex((element, index, array) => (element === 'chat')) >= 0 - }) - store.dispatch('setInstanceOption', { - name: 'gopherAvailable', - value: features.findIndex((element, index, array) => (element === 'gopher')) >= 0 - }) + store.dispatch('setInstanceOption', { name: 'mediaProxyAvailable', value: features.includes('media_proxy') }) + store.dispatch('setInstanceOption', { name: 'chatAvailable', value: features.includes('chat') }) + store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') }) const suggestions = metadata.suggestions store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled }) -- cgit v1.2.3-70-g09d2