From f2c6dd658130be3dbef260dfa03d6bb7c67b7236 Mon Sep 17 00:00:00 2001 From: dev92341 Date: Tue, 5 Feb 2019 03:57:11 -0800 Subject: Add option to hide features panel --- src/modules/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/modules/config.js') diff --git a/src/modules/config.js b/src/modules/config.js index c9528f6f..526a7021 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -30,7 +30,8 @@ const defaultState = { interfaceLanguage: browserLocale, scopeCopy: undefined, // instance default subjectLineBehavior: undefined, // instance default - alwaysShowSubjectInput: undefined // instance default + alwaysShowSubjectInput: undefined, // instance default + showFeaturesPanel: true } const config = { -- cgit v1.2.3-70-g09d2 From 460976c6e5b23f47d5520a99b3113825fc5dbda4 Mon Sep 17 00:00:00 2001 From: Xiaofeng An Date: Wed, 6 Feb 2019 14:26:46 -0500 Subject: #301 - add an option for default formatting --- src/boot/after_store.js | 1 + .../post_status_form/post_status_form.js | 6 +++++- .../post_status_form/post_status_form.vue | 2 +- src/components/settings/settings.js | 8 ++++++++ src/components/settings/settings.vue | 22 ++++++++++++++++++++++ src/i18n/en.json | 2 ++ src/modules/config.js | 3 ++- src/modules/instance.js | 1 + static/config.json | 1 + 9 files changed, 43 insertions(+), 3 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 5693dcc6..3b08a3f6 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -84,6 +84,7 @@ const afterStoreSetup = ({ store, i18n }) => { copyInstanceOption('loginMethod') copyInstanceOption('scopeCopy') copyInstanceOption('subjectLineBehavior') + copyInstanceOption('postContentType') copyInstanceOption('alwaysShowSubjectInput') copyInstanceOption('noAttachmentLinks') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 5e8c2252..ab379c23 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -65,7 +65,6 @@ const PostStatusForm = { newStatus: { spoilerText: this.subject || '', status: statusText, - contentType: 'text/plain', nsfw: false, files: [], visibility: scope @@ -167,6 +166,11 @@ const PostStatusForm = { }, formattingOptionsEnabled () { return this.$store.state.instance.formattingOptionsEnabled + }, + defaultPostContentType () { + return typeof this.$store.state.config.postContentType === 'undefined' + ? this.$store.state.instance.postContentType + : this.$store.state.config.postContentType } }, methods: { diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index e09ad37f..6ed5d92e 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -35,7 +35,7 @@
+
  • +
    + {{$t('settings.post_status_content_type')}} + +
    +
  • diff --git a/src/i18n/en.json b/src/i18n/en.json index ac7cc2a7..87849e4c 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -192,6 +192,8 @@ "subject_line_email": "Like email: \"re: subject\"", "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/modules/config.js b/src/modules/config.js index 526a7021..2a70fbe2 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -31,7 +31,8 @@ const defaultState = { scopeCopy: undefined, // instance default subjectLineBehavior: undefined, // instance default alwaysShowSubjectInput: undefined, // instance default - showFeaturesPanel: true + showFeaturesPanel: true, + postContentType: undefined // instance default } const config = { diff --git a/src/modules/instance.js b/src/modules/instance.js index 4ad41873..475da92e 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -24,6 +24,7 @@ const defaultState = { disableChat: false, scopeCopy: true, subjectLineBehavior: 'email', + postContentType: 'text/plain', loginMethod: 'password', nsfwCensorImage: undefined, vapidPublicKey: undefined, diff --git a/static/config.json b/static/config.json index 24e26696..685846b9 100644 --- a/static/config.json +++ b/static/config.json @@ -13,6 +13,7 @@ "collapseMessageWithSubject": false, "scopeCopy": true, "subjectLineBehavior": "email", + "postContentType": "text/plain", "alwaysShowSubjectInput": true, "hidePostStats": false, "hideUserStats": false, -- cgit v1.2.3-70-g09d2 From 70c05a0c085adb95ef9946ac58a461f56252c2c2 Mon Sep 17 00:00:00 2001 From: jasper Date: Fri, 8 Feb 2019 12:17:14 -0800 Subject: Fix showFeaturesPanel option as instance --- src/App.js | 2 +- src/boot/after_store.js | 1 + src/components/about/about.js | 2 +- src/modules/config.js | 3 +-- src/modules/instance.js | 1 + static/config.json | 3 ++- 6 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/App.js b/src/App.js index 18bff2dd..200254f3 100644 --- a/src/App.js +++ b/src/App.js @@ -82,7 +82,7 @@ export default { unseenNotificationsCount () { return this.unseenNotifications.length }, - showFeaturesPanel () { return this.$store.state.config.showFeaturesPanel } + showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel } }, methods: { scrollToTop () { diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 5693dcc6..2e7754ab 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -86,6 +86,7 @@ const afterStoreSetup = ({ store, i18n }) => { copyInstanceOption('subjectLineBehavior') copyInstanceOption('alwaysShowSubjectInput') copyInstanceOption('noAttachmentLinks') + copyInstanceOption('showFeaturesPanel') if ((config.chatDisabled)) { store.dispatch('disableChat') diff --git a/src/components/about/about.js b/src/components/about/about.js index b1ce3c7d..ae1cb182 100644 --- a/src/components/about/about.js +++ b/src/components/about/about.js @@ -9,7 +9,7 @@ const About = { TermsOfServicePanel }, computed: { - showFeaturesPanel () { return this.$store.state.config.showFeaturesPanel } + showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel } } } diff --git a/src/modules/config.js b/src/modules/config.js index 526a7021..c9528f6f 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -30,8 +30,7 @@ const defaultState = { interfaceLanguage: browserLocale, scopeCopy: undefined, // instance default subjectLineBehavior: undefined, // instance default - alwaysShowSubjectInput: undefined, // instance default - showFeaturesPanel: true + alwaysShowSubjectInput: undefined // instance default } const config = { diff --git a/src/modules/instance.js b/src/modules/instance.js index 4ad41873..1bb5eb1b 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -28,6 +28,7 @@ const defaultState = { nsfwCensorImage: undefined, vapidPublicKey: undefined, noAttachmentLinks: false, + showFeaturesPanel: false, // Nasty stuff pleromaBackend: true, diff --git a/static/config.json b/static/config.json index 24e26696..204b5fc7 100644 --- a/static/config.json +++ b/static/config.json @@ -19,5 +19,6 @@ "loginMethod": "password", "webPushNotifications": false, "noAttachmentLinks": false, - "nsfwCensorImage": "" + "nsfwCensorImage": "", + "showFeaturesPanel": true } -- cgit v1.2.3-70-g09d2 From ced29a64827ee4f34c71776cb217188093e7ee58 Mon Sep 17 00:00:00 2001 From: jasper Date: Fri, 8 Feb 2019 13:18:50 -0800 Subject: fixing conflicts --- src/modules/config.js | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/modules/config.js') diff --git a/src/modules/config.js b/src/modules/config.js index eb2df541..71f71376 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -30,13 +30,8 @@ const defaultState = { interfaceLanguage: browserLocale, scopeCopy: undefined, // instance default subjectLineBehavior: undefined, // instance default -<<<<<<< HEAD - alwaysShowSubjectInput: undefined // instance default -======= alwaysShowSubjectInput: undefined, // instance default - showFeaturesPanel: true, postContentType: undefined // instance default ->>>>>>> da0a5535eb09f6637df921a8a5f951c295bedeac } const config = { -- cgit v1.2.3-70-g09d2