mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-10 08:10:52 +00:00
4.0.0-rc3. Display a warning for complex or invalid filtering terms, using the safe-regex NPM module. Add a separate Regex (Word)
filtering mode. Fix channel hosting control. Fix hide extensions. Add a fix for bad local echo emote indices for chat. Position the color picker above rather than below for filter terms. Apply a dark theme to the color picker. Rewrite the filter terms editor to use the term editor component for adding a new term.
This commit is contained in:
parent
2a790ad7cd
commit
038270d232
23 changed files with 669 additions and 423 deletions
|
@ -1,38 +1,15 @@
|
|||
<template lang="html">
|
||||
<section class="ffz--widget ffz--basic-terms">
|
||||
<div class="tw-align-items-center tw-flex tw-flex-nowrap tw-flex-row tw-full-width tw-pd-b-1">
|
||||
<div class="tw-flex-grow-1">
|
||||
<input
|
||||
v-model="new_term"
|
||||
:placeholder="t('setting.terms.add-placeholder', 'Add a new term')"
|
||||
type="text"
|
||||
class="tw-input"
|
||||
autocapitalize="off"
|
||||
autocorrect="off"
|
||||
>
|
||||
</div>
|
||||
<div v-if="item.colored" class="tw-flex-shrink-0 tw-mg-l-05">
|
||||
<color-picker v-model="new_color" :nullable="true" :show-input="false" />
|
||||
</div>
|
||||
<div class="tw-flex-shrink-0 tw-mg-x-05">
|
||||
<select v-model="new_type" class="tw-select ffz-min-width-unset">
|
||||
<option value="text">{{ t('setting.terms.type.text', 'Text') }}</option>
|
||||
<option value="raw">{{ t('setting.terms.type.regex', 'Regex') }}</option>
|
||||
<option value="glob">{{ t('setting.terms.type.glob', 'Glob') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="tw-flex-shrink-0">
|
||||
<button class="tw-button" @click="add">
|
||||
<span class="tw-button__text">
|
||||
{{ t('setting.terms.add-term', 'Add') }}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="! val.length || val.length === 1 && hasInheritance" class="tw-c-text-alt-2 tw-font-size-4 tw-align-center tw-c-text-alt-2 tw-pd-05">
|
||||
<term-editor
|
||||
:term="default_term"
|
||||
:colored="item.colored"
|
||||
:adding="true"
|
||||
@save="new_term"
|
||||
/>
|
||||
<div v-if="! val.length || val.length === 1 && hasInheritance" class="tw-mg-t-05 tw-c-text-alt-2 tw-font-size-4 tw-align-center tw-c-text-alt-2 tw-pd-05">
|
||||
{{ t('setting.terms.no-terms', 'no terms are defined in this profile') }}
|
||||
</div>
|
||||
<ul v-else class="ffz--term-list">
|
||||
<ul v-else class="ffz--term-list tw-mg-t-05">
|
||||
<term-editor
|
||||
v-for="term in val"
|
||||
v-if="term.t !== 'inherit'"
|
||||
|
@ -59,9 +36,11 @@ export default {
|
|||
|
||||
data() {
|
||||
return {
|
||||
new_term: '',
|
||||
new_type: 'text',
|
||||
new_color: ''
|
||||
default_term: {
|
||||
v: '',
|
||||
t: 'text',
|
||||
c: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -84,17 +63,12 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
add() {
|
||||
const vals = Array.from(this.val);
|
||||
vals.push({
|
||||
v: {
|
||||
t: this.new_type,
|
||||
v: this.new_term,
|
||||
c: typeof this.new_color === 'string' ? this.new_color : null
|
||||
}
|
||||
});
|
||||
new_term(term) {
|
||||
if ( ! term.v )
|
||||
return;
|
||||
|
||||
this.new_term = '';
|
||||
const vals = Array.from(this.val);
|
||||
vals.push({v: term});
|
||||
this.set(deep_copy(vals));
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue