add support for disabling rich text formatting

This commit is contained in:
William Pitcock 2018-09-22 03:54:05 +00:00
parent cd48268c85
commit 1af5c8fd39
5 changed files with 11 additions and 3 deletions

View File

@ -7,6 +7,7 @@ const UserSettings = {
newname: this.$store.state.users.currentUser.name,
newbio: this.$store.state.users.currentUser.description,
newlocked: this.$store.state.users.currentUser.locked,
newnorichtext: this.$store.state.users.currentUser.no_rich_text,
newdefaultScope: this.$store.state.users.currentUser.default_scope,
followList: null,
followImportError: false,
@ -53,7 +54,8 @@ const UserSettings = {
const locked = this.newlocked
/* eslint-disable camelcase */
const default_scope = this.newdefaultScope
this.$store.state.api.backendInteractor.updateProfile({params: {name, description, locked, default_scope}}).then((user) => {
const no_rich_text = this.newnorichtext
this.$store.state.api.backendInteractor.updateProfile({params: {name, description, locked, default_scope, no_rich_text}}).then((user) => {
if (!user.error) {
this.$store.commit('addNewUsers', [user])
this.$store.commit('setCurrentUser', user)

View File

@ -25,6 +25,10 @@
<i v-on:click="changeVis('public')" class="icon-globe" :class="vis.public"></i>
</div>
</div>
<p>
<input type="checkbox" v-model="newnorichtext" id="account-no-rich-text">
<label for="account-no-rich-text">{{$t('settings.no_rich_text_description')}}</label>
</p>
<button :disabled='newname.length <= 0' class="btn btn-default" @click="updateProfile">{{$t('general.submit')}}</button>
</div>
<div class="setting-item">

View File

@ -130,6 +130,7 @@
"notification_visibility_likes": "Likes",
"notification_visibility_mentions": "Mentions",
"notification_visibility_repeats": "Repeats",
"no_rich_text_description": "Disable rich text support",
"nsfw_clickthrough": "Enable clickthrough NSFW attachment hiding",
"panelRadius": "Panels",
"pause_on_unfocused": "Pause streaming when tab is not focused",

View File

@ -89,6 +89,7 @@
"name": "Nom",
"name_bio": "Nom & Bio",
"new_password": "Nouveau mot de passe",
"no_rich_text_description": "Ne formatez pas le texte",
"nsfw_clickthrough": "Masquer les images marquées comme contenu adulte ou sensible",
"panelRadius": "Fenêtres",
"presets": "Thèmes prédéfinis",

View File

@ -136,8 +136,8 @@ const updateProfile = ({credentials, params}) => {
const form = new FormData()
each(params, (value, key) => {
/* Always include description and locked, because it might be empty or false */
if (key === 'description' || key === 'locked' || value) {
/* Always include description, no_rich_text and locked, because it might be empty or false */
if (key === 'description' || key === 'locked' || key === 'no_rich_text' || value) {
form.append(key, value)
}
})