Merge branch 'feature/rich-text-optout' into 'develop'

add support for disabling rich text formatting

See merge request pleroma/pleroma-fe!347
This commit is contained in:
kaniini 2018-09-22 04:44:02 +00:00
commit 1cbabf31ee
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)
} }
}) })