mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-16 18:06:55 +00:00
Added UI for clearing temp highlights
This commit is contained in:
parent
fac918b897
commit
441ccee64d
2 changed files with 52 additions and 0 deletions
|
@ -363,6 +363,16 @@ export default class Chat extends Module {
|
|||
}
|
||||
});
|
||||
|
||||
this.settings.add('chat.filtering.highlight-basic-users-temp', {
|
||||
default: [],
|
||||
type: 'array_merge',
|
||||
always_inherit: true,
|
||||
ui: {
|
||||
path: 'Chat > Filtering >> Temporary User Highlights',
|
||||
component: 'temp-highlights',
|
||||
}
|
||||
});
|
||||
|
||||
this.settings.add('chat.filtering.highlight-basic-users--color-regex', {
|
||||
requires: ['chat.filtering.highlight-basic-users'],
|
||||
equals: 'requirements',
|
||||
|
|
42
src/modules/main_menu/components/temp-highlights.vue
Normal file
42
src/modules/main_menu/components/temp-highlights.vue
Normal file
|
@ -0,0 +1,42 @@
|
|||
<template lang="html">
|
||||
<section class="ffz--widget">
|
||||
<button
|
||||
class="tw-button tw-mg-x-1"
|
||||
@click="clear"
|
||||
>
|
||||
<span class="tw-button__icon tw-button__icon--left">
|
||||
<figure class="ffz-i-trash" />
|
||||
</span>
|
||||
<span class="tw-button__text">
|
||||
{{ t('setting.highlights-temp.clear', 'Clear highlights') }}
|
||||
</span>
|
||||
</button>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import SettingMixin from '../setting-mixin';
|
||||
|
||||
export default {
|
||||
mixins: [SettingMixin],
|
||||
props: ['item', 'context'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
error_desc: null,
|
||||
error: false,
|
||||
message: null
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
clear(){
|
||||
const settings = this.context.getFFZ().resolve('settings')
|
||||
settings.provider.delete('chat.filtering.highlight-temp')
|
||||
this.context.getFFZ().resolve('chat').emit('chat:update-lines')
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue