about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/local_settings/page/index.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-08-28 17:16:30 +0200
committerThibG <thib@sitedethib.com>2018-08-31 18:35:03 +0200
commitc6942a528332e99b605efa95ffa1c710324d368c (patch)
tree857b96004ccae2b5a7005afe681604db82661680 /app/javascript/flavours/glitch/features/local_settings/page/index.js
parent5c400a28422121df01fc5ae73bc201f3b9aa5288 (diff)
Add option to not automatically unfold content warnings matching a regexp
Fixes #678
Diffstat (limited to 'app/javascript/flavours/glitch/features/local_settings/page/index.js')
-rw-r--r--app/javascript/flavours/glitch/features/local_settings/page/index.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/features/local_settings/page/index.js b/app/javascript/flavours/glitch/features/local_settings/page/index.js
index 37396d970..0db49ba5d 100644
--- a/app/javascript/flavours/glitch/features/local_settings/page/index.js
+++ b/app/javascript/flavours/glitch/features/local_settings/page/index.js
@@ -17,6 +17,7 @@ const messages = defineMessages({
   side_arm_keep: { id: 'settings.side_arm_reply_mode.keep', defaultMessage: 'Keep secondary toot button to set privacy' },
   side_arm_copy: { id: 'settings.side_arm_reply_mode.copy', defaultMessage: 'Copy privacy setting of the toot being replied to' },
   side_arm_restrict: { id: 'settings.side_arm_reply_mode.restrict', defaultMessage: 'Restrict privacy setting to that of the toot being replied to' },
+  regexp: { id: 'settings.content_warnings.regexp', defaultMessage: 'Regular expression' },
 });
 
 @injectIntl
@@ -122,7 +123,7 @@ export default class LocalSettingsPage extends React.PureComponent {
         </section>
       </div>
     ),
-    ({ onChange, settings }) => (
+    ({ intl, onChange, settings }) => (
       <div className='glitch local-settings__page content_warnings'>
         <h1><FormattedMessage id='settings.content_warnings' defaultMessage='Content warnings' /></h1>
         <LocalSettingsPageItem
@@ -133,6 +134,16 @@ export default class LocalSettingsPage extends React.PureComponent {
         >
           <FormattedMessage id='settings.enable_content_warnings_auto_unfold' defaultMessage='Automatically unfold content-warnings' />
         </LocalSettingsPageItem>
+        <LocalSettingsPageItem
+          settings={settings}
+          item={['content_warnings', 'filter']}
+          id='mastodon-settings--content_warnings-auto_unfold'
+          onChange={onChange}
+          dependsOn={[['content_warnings', 'auto_unfold']]}
+          placeholder={intl.formatMessage(messages.regexp)}
+        >
+          <FormattedMessage id='settings.content_warnings_filter' defaultMessage='Content warnings to not automatically unfold:' />
+        </LocalSettingsPageItem>
       </div>
     ),
     ({ onChange, settings }) => (