diff --git a/Plugins/ChatFilter/ChatFilter.plugin.js b/Plugins/ChatFilter/ChatFilter.plugin.js index 7ef58c3485..367ee481ef 100644 --- a/Plugins/ChatFilter/ChatFilter.plugin.js +++ b/Plugins/ChatFilter/ChatFilter.plugin.js @@ -2,7 +2,7 @@ class ChatFilter { initConstructor () { - this.configs = ["case","exact"]; + this.configs = ["empty","case","exact"]; this.css = ` ${BDFDB.dotCNS.messagegroup + BDFDB.dotCN.messageaccessory}.blocked:not(.revealed), @@ -32,7 +32,7 @@ class ChatFilter { getDescription () {return "Allows the user to censor words or block complete messages based on words in the chatwindow.";} - getVersion () {return "3.2.5";} + getVersion () {return "3.2.6";} getAuthor () {return "DevilBro";} @@ -48,7 +48,11 @@ class ChatFilter { settingshtml += `

${this.defaults.settings[key].description}

`; } settingshtml += `

${this.defaults.replaces[rtype].description}

`; - settingshtml += `

List of ${rtype} Words:

CASE
EXACT
`; + settingshtml += `

List of ${rtype} Words:

`; + for (let config of this.configs) { + settingshtml += `
${config.toUpperCase()}
`; + } + settingshtml += `
`; for (let word in words) { settingshtml += `
${BDFDB.encodeToHTML(word)} (${BDFDB.encodeToHTML(words[word].replace)})
` for (let config of this.configs) { @@ -62,7 +66,7 @@ class ChatFilter { } var infoHidden = BDFDB.loadData("hideInfo", this, "hideInfo"); settingshtml += `
Information
`; - settingshtml += `
Case: Will block/censor words while comparing lowercase/uppercase. apple => apple, not APPLE or AppLe
Not Case: Will block/censor words while ignoring lowercase/uppercase. apple => apple, APPLE and AppLe
Exact: Will block/censor words that are exactly the selected word. apple => apple, not applepie or pineapple
Not Exact: Will block/censor all words containing the selected word. apple => apple, applepie and pineapple
`; + settingshtml += `
Case: Will block/censor words while comparing lowercase/uppercase. apple => apple, not APPLE or AppLe
Not Case: Will block/censor words while ignoring lowercase/uppercase. apple => apple, APPLE and AppLe
Exact: Will block/censor words that are exactly the selected word. apple => apple, not applepie or pineapple
Not Exact: Will block/censor all words containing the selected word. apple => apple, applepie and pineapple
Empty: Ignores the default and set replace word and removes the word/message instead.
`; settingshtml += `
`; var settingspanel = $(settingshtml)[0]; @@ -198,9 +202,10 @@ class ChatFilter { replacevalue = replacevalue.trim(); words[wordvalue] = { replace: replacevalue, + empty: false, case: false, exact: true, - regex: false, + regex: false }; wordinput.value = null; replaceinput.value = null; @@ -319,7 +324,7 @@ class ChatFilter { var blockedWords = BDFDB.loadData("blocked", this, "words"); var blocked = false; for (let bWord in blockedWords) { - var blockedReplace = blockedWords[bWord].replace || replaces.blocked; + var blockedReplace = blockedWords[bWord].empty ? "" : (blockedWords[bWord].replace || replaces.blocked); var reg = this.createReg(bWord, blockedWords[bWord]); strings.forEach(string => { let emojiname = this.getEmojiName(string); @@ -351,7 +356,7 @@ class ChatFilter { else { var censoredWords = BDFDB.loadData("censored", this, "words"); for (let cWord in censoredWords) { - var censoredReplace = censoredWords[cWord].replace || replaces.censored; + var censoredReplace = censoredWords[cWord].empty ? "" : (censoredWords[cWord].replace || replaces.censored); var reg = this.createReg(cWord, censoredWords[cWord]); strings.forEach((string,i) => { let emojiname = this.getEmojiName(string);