From 6bcbed38d0952a332a900a615bfe8c7a553e8fc4 Mon Sep 17 00:00:00 2001 From: wakarimasen Date: Sat, 4 Mar 2017 21:25:59 +0100 Subject: [PATCH 1/2] Add option to only hide attachments on timeline --- src/components/settings/settings.js | 4 ++++ src/components/settings/settings.vue | 21 +++++++++++++++++---- src/components/status/status.js | 5 ++++- src/main.js | 1 + src/modules/config.js | 1 + 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index c1b88f82..3d373283 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -4,6 +4,7 @@ const settings = { data () { return { hideAttachmentsLocal: this.$store.state.config.hideAttachments, + hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv, hideNsfwLocal: this.$store.state.config.hideNsfw } }, @@ -14,6 +15,9 @@ const settings = { hideAttachmentsLocal (value) { this.$store.dispatch('setOption', { name: 'hideAttachments', value }) }, + hideAttachmentsInConvLocal (value) { + this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', 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 89b89a39..cebf62f7 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -10,10 +10,20 @@

Attachments

- - - - +
@@ -26,4 +36,7 @@ .setting-item { margin: 1em 1em 1.4em; } + .setting-list { + list-style-type: none; + } diff --git a/src/components/status/status.js b/src/components/status/status.js index 22292ffa..cca5f7fc 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -17,7 +17,10 @@ const Status = { userExpanded: false }), computed: { - hideAttachments () { return this.$store.state.config.hideAttachments }, + hideAttachments () { + return (this.$store.state.config.hideAttachments && this.expandable) || + (this.$store.state.config.hideAttachmentsInConv && !this.expandable) + }, retweet () { return !!this.statusoid.retweeted_status }, retweeter () { return this.statusoid.user.name }, status () { diff --git a/src/main.js b/src/main.js index fa0a872f..b5c148ff 100644 --- a/src/main.js +++ b/src/main.js @@ -31,6 +31,7 @@ Vue.use(VueTimeago, { const persistedStateOptions = { paths: [ 'config.hideAttachments', + 'config.hideAttachmentsInConv', 'config.hideNsfw', 'statuses.notifications', 'users.users' diff --git a/src/modules/config.js b/src/modules/config.js index 896a6978..05b4ab3b 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -5,6 +5,7 @@ const defaultState = { name: 'Pleroma FE', colors: {}, hideAttachments: false, + hideAttachmentsInConv: false, hideNsfw: true } From c921662036fe39f5146d5a36b4b018af3cfc2635 Mon Sep 17 00:00:00 2001 From: wakarimasen Date: Sun, 5 Mar 2017 14:34:14 +0100 Subject: [PATCH 2/2] Add inConversation prop to status --- src/components/conversation/conversation.vue | 2 +- src/components/settings/settings.vue | 2 +- src/components/status/status.js | 7 ++++--- src/components/status/status.vue | 4 ++-- .../status_or_conversation/status_or_conversation.vue | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/components/conversation/conversation.vue b/src/components/conversation/conversation.vue index 9675e69f..8e24fcbe 100644 --- a/src/components/conversation/conversation.vue +++ b/src/components/conversation/conversation.vue @@ -8,7 +8,7 @@
- +
diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index cebf62f7..478d761a 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -13,7 +13,7 @@