Add word-based muting to settings / statuses.

This commit is contained in:
Roger Braun 2017-04-09 15:53:23 +02:00
parent f3ca011fbe
commit a53555254a
6 changed files with 37 additions and 5 deletions

View file

@ -5,7 +5,8 @@ const settings = {
return {
hideAttachmentsLocal: this.$store.state.config.hideAttachments,
hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv,
hideNsfwLocal: this.$store.state.config.hideNsfw
hideNsfwLocal: this.$store.state.config.hideNsfw,
muteWordsString: this.$store.state.config.muteWords.join('\n')
}
},
components: {
@ -20,6 +21,9 @@ const settings = {
},
hideNsfwLocal (value) {
this.$store.dispatch('setOption', { name: 'hideNsfw', value })
},
muteWordsString (value) {
this.$store.dispatch('setOption', { name: 'muteWords', value: value.split('\n') })
}
}
}

View file

@ -8,6 +8,11 @@
<h2>Theme</h2>
<style-switcher></style-switcher>
</div>
<div class="setting-item">
<h2>Filtering</h2>
<p>All notices containing these words will be muted, one per line</p>
<textarea id="muteWords" v-model="muteWordsString"></textarea>
</div>
<div class="setting-item">
<h2>Attachments</h2>
<ul class="setting-list">
@ -32,9 +37,13 @@
<script src="./settings.js">
</script>
<style>
<style lang="scss">
.setting-item {
margin: 1em 1em 1.4em;
textarea {
width: 100%;
height: 100px;
}
}
.setting-list {
list-style-type: none;