aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2019-03-07 16:03:06 +0000
committerShpuld Shpludson <shp@cock.li>2019-03-07 16:03:06 +0000
commitbf1fa52e5e8c95d5887e887132782f10197bbc49 (patch)
treedc56f0b8a6b7565a5a8843305364062111bea7fb /src
parentc44f0a9bde08c50598207494b121ae4bdf1f0fb1 (diff)
parent292cdfb24b2d42d38728e8ff9ab16e2ad9e66410 (diff)
Merge branch 'fix/post-content-type' into 'develop'
#327: Load post status content type from instance config Closes #327 See merge request pleroma/pleroma-fe!641
Diffstat (limited to 'src')
-rw-r--r--src/boot/after_store.js2
-rw-r--r--src/components/post_status_form/post_status_form.js3
-rw-r--r--src/components/post_status_form/post_status_form.vue6
-rw-r--r--src/components/settings/settings.js3
-rw-r--r--src/components/settings/settings.vue14
-rw-r--r--src/i18n/en.json5
-rw-r--r--src/i18n/eo.json1
-rw-r--r--src/i18n/es.json1
-rw-r--r--src/i18n/ja.json1
-rw-r--r--src/i18n/oc.json1
-rw-r--r--src/i18n/pt.json1
-rw-r--r--src/modules/instance.js1
12 files changed, 18 insertions, 21 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index 53ecc083..a8e2bf35 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -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
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index c28c51bf..23a2c7e2 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -171,6 +171,9 @@ const PostStatusForm = {
},
formattingOptionsEnabled () {
return this.$store.state.instance.formattingOptionsEnabled
+ },
+ postFormats () {
+ return this.$store.state.instance.postFormats || []
}
},
methods: {
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index 40d24b97..0ddde4ea 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -38,9 +38,9 @@
<span class="text-format" v-if="formattingOptionsEnabled">
<label for="post-content-type" class="select">
<select id="post-content-type" v-model="newStatus.contentType" class="form-control">
- <option value="text/plain">{{$t('post_status.content_type.plain_text')}}</option>
- <option value="text/html">HTML</option>
- <option value="text/markdown">Markdown</option>
+ <option v-for="postFormat in postFormats" :key="postFormat" :value="postFormat">
+ {{$t(`post_status.content_type["${postFormat}"]`)}}
+ </option>
</select>
<i class="icon-down-open"></i>
</label>
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js
index 6e2dff7b..979457a5 100644
--- a/src/components/settings/settings.js
+++ b/src/components/settings/settings.js
@@ -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: {
diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
index 5041b3a3..d2346747 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -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(`post_status.content_type["${postFormat}"]`)}}
+ {{postContentTypeDefault === postFormat ? $t('settings.instance_default_simple') : ''}}
</option>
</select>
<i class="icon-down-open"/>
diff --git a/src/i18n/en.json b/src/i18n/en.json
index c5a4a90d..01fe2fba 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -71,7 +71,9 @@
"account_not_locked_warning_link": "locked",
"attachments_sensitive": "Mark attachments as sensitive",
"content_type": {
- "plain_text": "Plain text"
+ "text/plain": "Plain text",
+ "text/html": "HTML",
+ "text/markdown": "Markdown"
},
"content_warning": "Subject (optional)",
"default": "Just landed in L.A.",
@@ -221,7 +223,6 @@
"subject_line_mastodon": "Like mastodon: copy as is",
"subject_line_noop": "Do not copy",
"post_status_content_type": "Post status content type",
- "status_content_type_plain": "Plain text",
"stop_gifs": "Play-on-hover GIFs",
"streaming": "Enable automatic streaming of new posts when scrolled to the top",
"text": "Text",
diff --git a/src/i18n/eo.json b/src/i18n/eo.json
index 2438b4d5..34851a44 100644
--- a/src/i18n/eo.json
+++ b/src/i18n/eo.json
@@ -221,7 +221,6 @@
"subject_line_mastodon": "Kiel Mastodon: kopii senŝanĝe",
"subject_line_noop": "Ne kopii",
"post_status_content_type": "Afiŝi specon de la enhavo de la stato",
- "status_content_type_plain": "Plata teksto",
"stop_gifs": "Movi GIF-bildojn dum musa ŝvebo",
"streaming": "Ŝalti memfaran fluigon de novaj afiŝoj ĉe la supro de la paĝo",
"text": "Teksto",
diff --git a/src/i18n/es.json b/src/i18n/es.json
index 167e8c42..fe96dd08 100644
--- a/src/i18n/es.json
+++ b/src/i18n/es.json
@@ -202,7 +202,6 @@
"subject_line_mastodon": "Tipo mastodon: copiar como es",
"subject_line_noop": "No copiar",
"post_status_content_type": "Formato de publicación",
- "status_content_type_plain": "Texto plano",
"stop_gifs": "Iniciar GIFs al pasar el ratón",
"streaming": "Habilite la transmisión automática de nuevas publicaciones cuando se desplaza hacia la parte superior",
"text": "Texto",
diff --git a/src/i18n/ja.json b/src/i18n/ja.json
index b51fa7fd..f39a5a7c 100644
--- a/src/i18n/ja.json
+++ b/src/i18n/ja.json
@@ -202,7 +202,6 @@
"subject_line_mastodon": "マストドンふう: そのままコピー",
"subject_line_noop": "コピーしない",
"post_status_content_type": "とうこうのコンテントタイプ",
- "status_content_type_plain": "プレーンテキスト",
"stop_gifs": "カーソルをかさねたとき、GIFをうごかす",
"streaming": "うえまでスクロールしたとき、じどうてきにストリーミングする",
"text": "もじ",
diff --git a/src/i18n/oc.json b/src/i18n/oc.json
index ef32f83b..fd5ccc97 100644
--- a/src/i18n/oc.json
+++ b/src/i18n/oc.json
@@ -221,7 +221,6 @@
"subject_line_mastodon": "Coma mastodon : copiar tal coma es",
"subject_line_noop": "Copiar pas",
"post_status_content_type": "Publicar lo tipe de contengut dels estatuts",
- "status_content_type_plain": "Tèxte brut",
"stop_gifs": "Lançar los GIFs al subrevòl",
"streaming": "Activar lo cargament automatic dels novèls estatus en anar amont",
"text": "Tèxt",
diff --git a/src/i18n/pt.json b/src/i18n/pt.json
index 39ff6c63..cbc2c9a3 100644
--- a/src/i18n/pt.json
+++ b/src/i18n/pt.json
@@ -221,7 +221,6 @@
"subject_line_mastodon": "Como o Mastodon: copiar como está",
"subject_line_noop": "Não copiar",
"post_status_content_type": "Postar tipo de conteúdo do status",
- "status_content_type_plain": "Texto puro",
"stop_gifs": "Reproduzir GIFs ao passar o cursor em cima",
"streaming": "Habilitar o fluxo automático de postagens quando ao topo da página",
"text": "Texto",
diff --git a/src/modules/instance.js b/src/modules/instance.js
index c31d02b9..24c52f9c 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -37,6 +37,7 @@ const defaultState = {
emoji: [],
customEmoji: [],
restrictedNicknames: [],
+ postFormats: [],
// Feature-set, apparently, not everything here is reported...
mediaProxyAvailable: false,