From a57f8bdd68ae52b4e5725fe0358dc8c7567c81ac Mon Sep 17 00:00:00 2001
From: jasper <jasper92341@hotmail.com>
Date: Wed, 6 Feb 2019 10:18:13 -0800
Subject: Add option to hide filtered statuses

---
 src/components/settings/settings.vue | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

(limited to 'src/components/settings/settings.vue')

diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
index 9953780f..2fa2c89c 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -205,7 +205,6 @@
                 </label>
               </li>
             </ul>
-            </label>
           </div>
           <div>
             {{$t('settings.replies_in_timeline')}}
@@ -232,11 +231,18 @@
           </div>
         </div>
         <div class="setting-item">
-          <p>{{$t('settings.filtering_explanation')}}</p>
-          <textarea id="muteWords" v-model="muteWordsString"></textarea>
+          <div>
+            <p>{{$t('settings.filtering_explanation')}}</p>
+            <textarea id="muteWords" v-model="muteWordsString"></textarea>
+          </div>
+          <div>
+            <input type="checkbox" id="hideFilteredStatuses" v-model="hideFilteredStatusesLocal">
+            <label for="hideFilteredStatuses">
+              {{$t('settings.hide_filtered_statuses')}} {{$t('settings.instance_default', { value: hideFilteredStatusesDefault })}}
+            </label>
+          </div>
         </div>
       </div>
-
     </tab-switcher>
 </keep-alive>
   </div>
-- 
cgit v1.2.3-70-g09d2


From 460976c6e5b23f47d5520a99b3113825fc5dbda4 Mon Sep 17 00:00:00 2001
From: Xiaofeng An <futureweb2020@yandex.com>
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/components/settings/settings.vue')

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 @@
       <div class="visibility-tray">
         <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">
+            <select id="post-content-type" v-model="defaultPostContentType" 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>
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js
index 8d138485..9f2a1de4 100644
--- a/src/components/settings/settings.js
+++ b/src/components/settings/settings.js
@@ -46,6 +46,11 @@ const settings = {
         : user.subjectLineBehavior,
       subjectLineBehaviorDefault: instance.subjectLineBehavior,
 
+      postContentTypeLocal: typeof user.postContentType === 'undefined'
+        ? instance.postContentType
+        : user.postContentType,
+      postContentTypeDefault: instance.postContentType,
+
       alwaysShowSubjectInputLocal: typeof user.alwaysShowSubjectInput === 'undefined'
         ? instance.alwaysShowSubjectInput
         : user.alwaysShowSubjectInput,
@@ -157,6 +162,9 @@ const settings = {
     subjectLineBehaviorLocal (value) {
       this.$store.dispatch('setOption', { name: 'subjectLineBehavior', value })
     },
+    postContentTypeLocal (value) {
+      this.$store.dispatch('setOption', { name: 'postContentType', value })
+    },
     stopGifs (value) {
       this.$store.dispatch('setOption', { name: 'stopGifs', value })
     },
diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
index 9953780f..ba539489 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -100,6 +100,28 @@
                 </label>
               </div>
             </li>
+            <li>
+              <div>
+                {{$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>
+                  </select>
+                  <i class="icon-down-open"/>
+                </label>
+              </div>
+            </li>
           </ul>
         </div>
 
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

