FANDOM


WordFilter is a script that displays an inline alert to any user who attempts to post a blocked word into main chat. The user can then choose to continue to post the message, or choose to cancel.

Installation

Ensure that the custom chat JavaScript and CSS is set up, and then add the following to your wiki's MediaWiki:Chat.js:

alertMessage = 'MESSAGETOSHOWWHENBADWORDFOUND';
window.badWords = ['BADWORD', 'ANOTHERBADWORD']; // add bad words to pre-generated list
importScriptPage('WordFilter/code.js','dev');
Using configuration options with Fandom Open Source Library scripts
The instructions on this page describe how to use configuration options with a script. Here on the Fandom Open Source Library, many scripts provide optional configuration settings as a mean to alter or enhance the default behavior of the script. When installing configuration options in your JavaScript file, please note that they need to go above the import statement in order to work — unless the directions say otherwise. In case MediaWiki:ImportJS is used to load the scripts, it will be executed last.
Configuration options load too late, don't work
Proper placement of configuration options
// 1. AjaxRC import statement
importScriptPage('AjaxRC/code.js','dev');
 
// 2. AjaxRC configuration option
var ajaxRefresh = 30000;
// 1. AjaxRC configuration option
var ajaxRefresh = 30000;
 
// 2. AjaxRC import statement
importScriptPage('AjaxRC/code.js','dev');

Notes

  • The inline alert will be displayed once per chat room, including private messages. This can also be used to duplicate messages.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.