From ec5d8b9833034604299496a8ae87741c2efa5b7b Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 22 Feb 2017 21:14:55 +0100 Subject: Set colors into config so they can be used for more dynamic styles. --- src/modules/config.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/modules/config.js b/src/modules/config.js index a1276519..30155f45 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -2,7 +2,8 @@ import { set } from 'vue' import StyleSetter from '../services/style_setter/style_setter.js' const defaultState = { - name: 'Pleroma FE' + name: 'Pleroma FE', + colors: {} } const config = { @@ -24,7 +25,7 @@ const config = { break case 'theme': const fullPath = `/static/css/${value}` - StyleSetter.setStyle(fullPath) + StyleSetter.setStyle(fullPath, commit) } } } -- cgit v1.2.3-70-g09d2 From 7c0f3ea666a866a3bb1f2e8da161ae69901e519b Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 23 Feb 2017 00:04:47 +0100 Subject: Add setting to hide all attachments. --- src/components/settings/settings.js | 10 ++++++++++ src/components/settings/settings.vue | 5 +++++ src/components/status/status.js | 1 + src/components/status/status.vue | 2 +- src/main.js | 2 +- src/modules/config.js | 3 ++- 6 files changed, 20 insertions(+), 3 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index f979e7ab..61236af2 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -1,8 +1,18 @@ import StyleSwitcher from '../style_switcher/style_switcher.vue' const settings = { + data () { + return { + hideAttachmentsLocal: this.$store.state.config.hideAttachments + } + }, components: { StyleSwitcher + }, + watch: { + hideAttachmentsLocal (value) { + this.$store.dispatch('setOption', { name: 'hideAttachments', value }) + } } } diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 57aafac8..f2f83953 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -8,6 +8,11 @@

Theme

+
+

Attachments

+ + +
diff --git a/src/components/status/status.js b/src/components/status/status.js index 46add8aa..22292ffa 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -17,6 +17,7 @@ const Status = { userExpanded: false }), computed: { + hideAttachments () { return this.$store.state.config.hideAttachments }, retweet () { return !!this.statusoid.retweeted_status }, retweeter () { return this.statusoid.user.name }, status () { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index b0f468e5..1e970ec6 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -57,7 +57,7 @@
- +
diff --git a/src/main.js b/src/main.js index 22879b34..51d281fa 100644 --- a/src/main.js +++ b/src/main.js @@ -29,7 +29,7 @@ Vue.use(VueTimeago, { }) const persistedStateOptions = { - paths: ['users.users', 'statuses.notifications'] + paths: ['users.users', 'statuses.notifications', 'config.hideAttachments'] } const store = new Vuex.Store({ diff --git a/src/modules/config.js b/src/modules/config.js index 30155f45..25de98ea 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -3,7 +3,8 @@ import StyleSetter from '../services/style_setter/style_setter.js' const defaultState = { name: 'Pleroma FE', - colors: {} + colors: {}, + hideAttachments: false } const config = { -- cgit v1.2.3-70-g09d2 From a7db72d7a7667fc5f06953b37d32d6847e6dfc58 Mon Sep 17 00:00:00 2001 From: "Hector A. Escobedo" Date: Wed, 22 Feb 2017 18:38:05 -0500 Subject: Add setting to toggle NSFW hiding. --- src/components/attachment/attachment.js | 3 ++- src/components/attachment/attachment.vue | 4 ++-- src/components/settings/settings.js | 4 ++++ src/components/settings/settings.vue | 2 ++ src/main.js | 5 ++++- src/modules/config.js | 3 ++- 6 files changed, 16 insertions(+), 5 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js index 57d21b28..8e959903 100644 --- a/src/components/attachment/attachment.js +++ b/src/components/attachment/attachment.js @@ -9,7 +9,8 @@ const Attachment = { ], data: () => ({ nsfwImage, - showHidden: false + hideNsfwLocal: this.$store.state.config.hideNsfw, + showHidden: !this.hideNsfwLocal }), computed: { type () { diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index e0eba6a9..577f8444 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -1,9 +1,9 @@