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, newname: this.$store.state.users.currentUser.name,
newbio: this.$store.state.users.currentUser.description, newbio: this.$store.state.users.currentUser.description,
newlocked: this.$store.state.users.currentUser.locked, newlocked: this.$store.state.users.currentUser.locked,
newnorichtext: this.$store.state.users.currentUser.no_rich_text,
newdefaultScope: this.$store.state.users.currentUser.default_scope, newdefaultScope: this.$store.state.users.currentUser.default_scope,
followList: null, followList: null,
followImportError: false, followImportError: false,
@ -53,7 +54,8 @@ const UserSettings = {
const locked = this.newlocked const locked = this.newlocked
/* eslint-disable camelcase */ /* eslint-disable camelcase */
const default_scope = this.newdefaultScope 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) { if (!user.error) {
this.$store.commit('addNewUsers', [user]) this.$store.commit('addNewUsers', [user])
this.$store.commit('setCurrentUser', 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> <i v-on:click="changeVis('public')" class="icon-globe" :class="vis.public"></i>
</div> </div>
</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> <button :disabled='newname.length <= 0' class="btn btn-default" @click="updateProfile">{{$t('general.submit')}}</button>
</div> </div>
<div class="setting-item"> <div class="setting-item">

View file

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

View file

@ -89,6 +89,7 @@
"name": "Nom", "name": "Nom",
"name_bio": "Nom & Bio", "name_bio": "Nom & Bio",
"new_password": "Nouveau mot de passe", "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", "nsfw_clickthrough": "Masquer les images marquées comme contenu adulte ou sensible",
"panelRadius": "Fenêtres", "panelRadius": "Fenêtres",
"presets": "Thèmes prédéfinis", "presets": "Thèmes prédéfinis",

View file

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