From b0cf050797702d6a7cc921c71b27cecb5ce234c6 Mon Sep 17 00:00:00 2001 From: Vivian Lim Date: Thu, 28 Jun 2018 21:39:25 -0700 Subject: [PATCH] Add configuration option to enable click-through content warnings --- src/components/status/status.js | 7 +++++-- src/components/status/status.vue | 10 ++++++---- src/main.js | 4 +++- static/config.json | 3 ++- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/status/status.js b/src/components/status/status.js index 9f88d38ca9..4e2427010b 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -29,7 +29,7 @@ const Status = { preview: null, showPreview: false, showingTall: false, - showingContentWarningContent: false + showingContentWarningContent: false }), computed: { muteWords () { @@ -93,7 +93,10 @@ const Status = { return 'small' } return 'normal' - } + }, + clickThroughContentWarningsEnabled () { + return this.$store.state.config.clickThroughContentWarningsEnabled + }, }, components: { Attachment, diff --git a/src/components/status/status.vue b/src/components/status/status.vue index 77a7904e7c..2e33999a57 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -76,17 +76,19 @@
- - + + + +
-
+
Click to view this post. (has attachments)
Show less -
+
diff --git a/src/main.js b/src/main.js index bacd7f6d65..01ee7f75d4 100644 --- a/src/main.js +++ b/src/main.js @@ -89,7 +89,7 @@ window.fetch('/api/statusnet/config.json') window.fetch('/static/config.json') .then((res) => res.json()) .then((data) => { - const {theme, background, logo, showWhoToFollowPanel, whoToFollowProvider, whoToFollowLink, showInstanceSpecificPanel, scopeOptionsEnabled} = data + const {theme, background, logo, showWhoToFollowPanel, whoToFollowProvider, whoToFollowLink, showInstanceSpecificPanel, scopeOptionsEnabled, clickThroughContentWarningsEnabled} = data store.dispatch('setOption', { name: 'theme', value: theme }) store.dispatch('setOption', { name: 'background', value: background }) store.dispatch('setOption', { name: 'logo', value: logo }) @@ -98,6 +98,8 @@ window.fetch('/static/config.json') store.dispatch('setOption', { name: 'whoToFollowLink', value: whoToFollowLink }) store.dispatch('setOption', { name: 'showInstanceSpecificPanel', value: showInstanceSpecificPanel }) store.dispatch('setOption', { name: 'scopeOptionsEnabled', value: scopeOptionsEnabled }) + store.dispatch('setOption', { name: 'clickThroughContentWarningsEnabled', value: clickThroughContentWarningsEnabled }) + if (data['chatDisabled']) { store.dispatch('disableChat') } diff --git a/static/config.json b/static/config.json index 4dacfebedf..4fdddf2936 100644 --- a/static/config.json +++ b/static/config.json @@ -11,5 +11,6 @@ "whoToFollowLink": "https://vinayaka.distsn.org/?{{host}}+{{user}}", "whoToFollowLinkDummy2": "https://followlink.osa-p.net/recommend.html", "showInstanceSpecificPanel": false, - "scopeOptionsEnabled": false + "scopeOptionsEnabled": true, + "clickThroughContentWarningsEnabled": true }