FANDOM


FindNEdit allows users to define a string to find and then alter that string slightly by adding something before or after the found string. It will perform the change for all instances found on the page.

Advantages

  • add user titles automatically
    • set addBefores to something like 'USERTITLE: '
  • add badges automatically
    • set addBefores to an img tag with src being the location of the badge
  • easily identify certain things
    • easily highlight words by setting addBefores to something like '<span style="color:#FF0000; font-weight:bold; font-size:large;">' and addAfters to '</span>'
  • can be used as word filter
    • set searchWords to the filtered words and then addBefores to '<!--' and addAfters to '--->'
    • also see below
  • easily identify where user's name is used (see below script)
searchWords = [wgUserName];
addBefore = ['<span style="color:#FF0000; font-weight:bold; font-size:large;">*</span>'];
importScriptPage('FindNEdit/code.js','dev');

Disadvantages

  • vandalism
    • unless altered on system page, will only affect user who adds script


importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:FindNEdit.js',
    ]
});
dev:FindNEdit.js


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');

See Also