aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/features_panel/features_panel.js12
-rw-r--r--src/components/instance_specific_panel/instance_specific_panel.js2
-rw-r--r--src/components/login_form/login_form.js2
-rw-r--r--src/components/post_status_form/post_status_form.js12
-rw-r--r--src/components/registration/registration.js6
-rw-r--r--src/components/settings/settings.js39
-rw-r--r--src/components/settings/settings.vue20
-rw-r--r--src/components/user_settings/user_settings.js4
-rw-r--r--src/components/who_to_follow_panel/who_to_follow_panel.js4
-rw-r--r--src/components/who_to_follow_panel/who_to_follow_panel.vue2
10 files changed, 62 insertions, 41 deletions
diff --git a/src/components/features_panel/features_panel.js b/src/components/features_panel/features_panel.js
index 80f5c966..e0b7a118 100644
--- a/src/components/features_panel/features_panel.js
+++ b/src/components/features_panel/features_panel.js
@@ -1,13 +1,13 @@
const FeaturesPanel = {
computed: {
chat: function () {
- return this.$store.state.config.chatAvailable && (!this.$store.state.chatDisabled)
+ return this.$store.state.instance.chatAvailable && (!this.$store.state.chatDisabled)
},
- gopher: function () { return this.$store.state.config.gopherAvailable },
- whoToFollow: function () { return this.$store.state.config.suggestionsEnabled },
- mediaProxy: function () { return this.$store.state.config.mediaProxyAvailable },
- scopeOptions: function () { return this.$store.state.config.scopeOptionsEnabled },
- textlimit: function () { return this.$store.state.config.textlimit }
+ gopher: function () { return this.$store.state.instance.gopherAvailable },
+ whoToFollow: function () { return this.$store.state.instance.suggestionsEnabled },
+ mediaProxy: function () { return this.$store.state.instance.mediaProxyAvailable },
+ scopeOptions: function () { return this.$store.state.instance.scopeOptionsEnabled },
+ textlimit: function () { return this.$store.state.instance.textlimit }
}
}
diff --git a/src/components/instance_specific_panel/instance_specific_panel.js b/src/components/instance_specific_panel/instance_specific_panel.js
index abd408c8..09e3d055 100644
--- a/src/components/instance_specific_panel/instance_specific_panel.js
+++ b/src/components/instance_specific_panel/instance_specific_panel.js
@@ -1,7 +1,7 @@
const InstanceSpecificPanel = {
computed: {
instanceSpecificPanelContent () {
- return this.$store.state.config.instanceSpecificPanelContent
+ return this.$store.state.instance.instanceSpecificPanelContent
}
}
}
diff --git a/src/components/login_form/login_form.js b/src/components/login_form/login_form.js
index a117b76f..4405fb92 100644
--- a/src/components/login_form/login_form.js
+++ b/src/components/login_form/login_form.js
@@ -5,7 +5,7 @@ const LoginForm = {
}),
computed: {
loggingIn () { return this.$store.state.users.loggingIn },
- registrationOpen () { return this.$store.state.config.registrationOpen }
+ registrationOpen () { return this.$store.state.instance.registrationOpen }
},
methods: {
submit () {
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index 7babe236..a84e764c 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -102,7 +102,7 @@ const PostStatusForm = {
name: '',
utf: utf || '',
// eslint-disable-next-line camelcase
- img: utf ? '' : this.$store.state.config.server + image_url,
+ img: utf ? '' : this.$store.state.instance.server + image_url,
highlighted: index === this.highlighted
}))
} else {
@@ -120,16 +120,16 @@ const PostStatusForm = {
return this.$store.state.users.users
},
emoji () {
- return this.$store.state.config.emoji || []
+ return this.$store.state.instance.emoji || []
},
customEmoji () {
- return this.$store.state.config.customEmoji || []
+ return this.$store.state.instance.customEmoji || []
},
statusLength () {
return this.newStatus.status.length
},
statusLengthLimit () {
- return this.$store.state.config.textlimit
+ return this.$store.state.instance.textlimit
},
hasStatusLengthLimit () {
return this.statusLengthLimit > 0
@@ -141,10 +141,10 @@ const PostStatusForm = {
return this.hasStatusLengthLimit && (this.statusLength > this.statusLengthLimit)
},
scopeOptionsEnabled () {
- return this.$store.state.config.scopeOptionsEnabled
+ return this.$store.state.instance.scopeOptionsEnabled
},
formattingOptionsEnabled () {
- return this.$store.state.config.formattingOptionsEnabled
+ return this.$store.state.instance.formattingOptionsEnabled
}
},
methods: {
diff --git a/src/components/registration/registration.js b/src/components/registration/registration.js
index 73840608..8f59878d 100644
--- a/src/components/registration/registration.js
+++ b/src/components/registration/registration.js
@@ -5,16 +5,16 @@ const registration = {
registering: false
}),
created () {
- if ((!this.$store.state.config.registrationOpen && !this.token) || !!this.$store.state.users.currentUser) {
+ if ((!this.$store.state.instance.registrationOpen && !this.token) || !!this.$store.state.users.currentUser) {
this.$router.push('/main/all')
}
// Seems like this doesn't work at first page open for some reason
- if (this.$store.state.config.registrationOpen && this.token) {
+ if (this.$store.state.instance.registrationOpen && this.token) {
this.$router.push('/registration')
}
},
computed: {
- termsofservice () { return this.$store.state.config.tos },
+ termsofservice () { return this.$store.state.instance.tos },
token () { return this.$route.params.token }
},
methods: {
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js
index 8ef84b2a..a24bc265 100644
--- a/src/components/settings/settings.js
+++ b/src/components/settings/settings.js
@@ -6,25 +6,27 @@ import { filter, trim } from 'lodash'
const settings = {
data () {
- const config = this.$store.state.config
+ const user = this.$store.state.config
+ const instance = this.$store.state.instance
return {
- hideAttachmentsLocal: config.hideAttachments,
- hideAttachmentsInConvLocal: config.hideAttachmentsInConv,
- hideNsfwLocal: config.hideNsfw,
- notificationVisibilityLocal: config.notificationVisibility,
- replyVisibilityLocal: config.replyVisibility,
- loopVideoLocal: config.loopVideo,
- loopVideoSilentOnlyLocal: config.loopVideoSilentOnly,
- muteWordsString: config.muteWords.join('\n'),
- autoLoadLocal: config.autoLoad,
- streamingLocal: config.streaming,
- pauseOnUnfocusedLocal: config.pauseOnUnfocused,
- hoverPreviewLocal: config.hoverPreview,
- collapseMessageWithSubjectLocal: typeof config.collapseMessageWithSubject === 'undefined'
- ? config.defaultCollapseMessageWithSubject
- : config.collapseMessageWithSubject,
- stopGifs: config.stopGifs,
+ hideAttachmentsLocal: user.hideAttachments,
+ hideAttachmentsInConvLocal: user.hideAttachmentsInConv,
+ hideNsfwLocal: user.hideNsfw,
+ notificationVisibilityLocal: user.notificationVisibility,
+ replyVisibilityLocal: user.replyVisibility,
+ loopVideoLocal: user.loopVideo,
+ loopVideoSilentOnlyLocal: user.loopVideoSilentOnly,
+ muteWordsString: user.muteWords.join('\n'),
+ autoLoadLocal: user.autoLoad,
+ streamingLocal: user.streaming,
+ pauseOnUnfocusedLocal: user.pauseOnUnfocused,
+ hoverPreviewLocal: user.hoverPreview,
+ collapseMessageWithSubjectLocal: typeof user.collapseMessageWithSubject === 'undefined'
+ ? instance.collapseMessageWithSubject
+ : user.collapseMessageWithSubject,
+ collapseMessageWithSubjectDefault: this.$t('settings.values.' + instance.collapseMessageWithSubject),
+ stopGifs: user.stopGifs,
loopSilentAvailable:
// Firefox
Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
@@ -42,6 +44,9 @@ const settings = {
computed: {
user () {
return this.$store.state.users.currentUser
+ },
+ currentSaveStateNotice () {
+ return this.$store.state.interface.settings.currentSaveStateNotice
}
},
watch: {
diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
index c106b79c..42c660a3 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -1,7 +1,21 @@
<template>
<div class="settings panel panel-default">
<div class="panel-heading">
- {{$t('settings.settings')}}
+ <div class="title">
+ {{$t('settings.settings')}}
+ </div>
+
+ <transition name="fade">
+ <template v-if="currentSaveStateNotice">
+ <div @click.prevent class="alert error" v-if="currentSaveStateNotice.error">
+ {{ $t('settings.saving_err') }}
+ </div>
+
+ <div @click.prevent class="alert transparent" v-if="!currentSaveStateNotice.error">
+ {{ $t('settings.saving_ok') }}
+ </div>
+ </template>
+ </transition>
</div>
<div class="panel-body">
<tab-switcher>
@@ -15,7 +29,9 @@
<ul class="setting-list">
<li>
<input type="checkbox" id="collapseMessageWithSubject" v-model="collapseMessageWithSubjectLocal">
- <label for="collapseMessageWithSubject">{{$t('settings.collapse_subject')}}</label>
+ <label for="collapseMessageWithSubject">
+ {{$t('settings.collapse_subject')}} {{$t('settings.instance_default', { value: collapseMessageWithSubjectDefault })}}
+ </label>
</li>
<li>
<input type="checkbox" id="streaming" v-model="streamingLocal">
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index 0b13a668..70463f2a 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -32,10 +32,10 @@ const UserSettings = {
return this.$store.state.users.currentUser
},
pleromaBackend () {
- return this.$store.state.config.pleromaBackend
+ return this.$store.state.instance.pleromaBackend
},
scopeOptionsEnabled () {
- return this.$store.state.config.scopeOptionsEnabled
+ return this.$store.state.instance.scopeOptionsEnabled
},
vis () {
return {
diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js
index bc62f455..49b8f5b6 100644
--- a/src/components/who_to_follow_panel/who_to_follow_panel.js
+++ b/src/components/who_to_follow_panel/who_to_follow_panel.js
@@ -83,14 +83,14 @@ const WhoToFollowPanel = {
moreUrl: function () {
var host = window.location.hostname
var user = this.user
- var suggestionsWeb = this.$store.state.config.suggestionsWeb
+ var suggestionsWeb = this.$store.state.instance.suggestionsWeb
var url
url = suggestionsWeb.replace(/{{host}}/g, encodeURIComponent(host))
url = url.replace(/{{user}}/g, encodeURIComponent(user))
return url
},
suggestionsEnabled () {
- return this.$store.state.config.suggestionsEnabled
+ return this.$store.state.instance.suggestionsEnabled
}
},
watch: {
diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.vue b/src/components/who_to_follow_panel/who_to_follow_panel.vue
index 8b3abe70..d031318d 100644
--- a/src/components/who_to_follow_panel/who_to_follow_panel.vue
+++ b/src/components/who_to_follow_panel/who_to_follow_panel.vue
@@ -11,7 +11,7 @@
<img v-bind:src="img1"/> <router-link :to="{ name: 'user-profile', params: { id: id1 } }">{{ name1 }}</router-link><br>
<img v-bind:src="img2"/> <router-link :to="{ name: 'user-profile', params: { id: id2 } }">{{ name2 }}</router-link><br>
<img v-bind:src="img3"/> <router-link :to="{ name: 'user-profile', params: { id: id3 } }">{{ name3 }}</router-link><br>
- <img v-bind:src="$store.state.config.logo"> <a v-bind:href="moreUrl" target="_blank">{{$t('who_to_follow.more')}}</a>
+ <img v-bind:src="$store.state.instance.logo"> <a v-bind:href="moreUrl" target="_blank">{{$t('who_to_follow.more')}}</a>
</p>
</div>
</div>