logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe
commit: 1cbabf31ee7c6481ab18fd36fab76247b360e3be
parent: cd48268c858f4a7f24767e41e81cb6524393c5e6
Author: kaniini <nenolod@gmail.com>
Date:   Sat, 22 Sep 2018 04:44:02 +0000

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

add support for disabling rich text formatting

See merge request pleroma/pleroma-fe!347

Diffstat:

Msrc/components/user_settings/user_settings.js4+++-
Msrc/components/user_settings/user_settings.vue4++++
Msrc/i18n/en.json1+
Msrc/i18n/fr.json1+
Msrc/services/api/api.service.js4++--
5 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js @@ -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) diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue @@ -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"> diff --git a/src/i18n/en.json b/src/i18n/en.json @@ -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", diff --git a/src/i18n/fr.json b/src/i18n/fr.json @@ -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", diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js @@ -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) } })