Skip to content
Snippets Groups Projects
Commit f91e4a58 authored by Edijs Bov's avatar Edijs Bov
Browse files

Load post status content type from instance config

parent 3e4d465e
No related branches found
No related tags found
4 merge requests!673Update master with bugfixes (and other changes),!660[i18n] Update: occitan language,!648WIP: Merge develop into mastoapi-exploration,!641#327: Load post status content type from instance config
......@@ -169,6 +169,8 @@ const afterStoreSetup = ({ store, i18n }) => {
store.dispatch('setInstanceOption', { name: 'chatAvailable', value: features.includes('chat') })
store.dispatch('setInstanceOption', { name: 'gopherAvailable', value: features.includes('gopher') })
store.dispatch('setInstanceOption', { name: 'postFormats', value: metadata.postFormats })
store.dispatch('setInstanceOption', { name: 'restrictedNicknames', value: metadata.restrictedNicknames })
const suggestions = metadata.suggestions
......
......@@ -93,6 +93,9 @@ const settings = {
currentSaveStateNotice () {
return this.$store.state.interface.settings.currentSaveStateNotice
},
postFormats () {
return this.$store.state.instance.postFormats || []
},
instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel }
},
watch: {
......
......@@ -105,17 +105,9 @@
{{$t('settings.post_status_content_type')}}
<label for="postContentType" class="select">
<select id="postContentType" v-model="postContentTypeLocal">
<option value="text/plain">
{{$t('settings.status_content_type_plain')}}
{{postContentTypeDefault == 'text/plain' ? $t('settings.instance_default_simple') : ''}}
</option>
<option value="text/html">
HTML
{{postContentTypeDefault == 'text/html' ? $t('settings.instance_default_simple') : ''}}
</option>
<option value="text/markdown">
Markdown
{{postContentTypeDefault == 'text/markdown' ? $t('settings.instance_default_simple') : ''}}
<option v-for="postFormat in postFormats" :key="postFormat" :value="postFormat">
{{$t(`settings.post_formats["${postFormat}"]`)}}
{{postContentTypeDefault === postFormat ? $t('settings.instance_default_simple') : ''}}
</option>
</select>
<i class="icon-down-open"/>
......
......@@ -220,6 +220,11 @@
"subject_line_email": "Like email: \"re: subject\"",
"subject_line_mastodon": "Like mastodon: copy as is",
"subject_line_noop": "Do not copy",
"post_formats": {
"text/plain": "Plain text",
"text/html": "HTML",
"text/markdown": "Markdown"
},
"post_status_content_type": "Post status content type",
"status_content_type_plain": "Plain text",
"stop_gifs": "Play-on-hover GIFs",
......
......@@ -37,6 +37,7 @@ const defaultState = {
emoji: [],
customEmoji: [],
restrictedNicknames: [],
postFormats: [],
// Feature-set, apparently, not everything here is reported...
mediaProxyAvailable: false,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment