dev

WelcomeMessage detects a user’s first-ever edit and posts a configurable greeting. It tries the Fandom Message Wall first and automatically falls back to User talk if Walls aren’t available. Admins set text and variables from their own wiki’s JS after importing the script.

Installation

Configuration

Set options on your wiki before import using window.welcomeMessage. All fields are optional; defaults are used when omitted.

Template variables available in title/body: $1 user username, $2 page edited, $3 admin nickname, $4 admin username.

Usage

Add your settings with window.welcomeMessage = { ... } before the import, or omit to use defaults. Import the script with importArticles({ type: 'script', articles: ['dev:MediaWiki:WelcomeMessage.js'] }).

Example


// Optional config — leave blank to use defaults
window.welcomeMessage = {
  enabled: true,
  adminUsername: 'ExampleAdmin',     // $4
  adminNickname: 'Example Admin',    // $3
  messageTitle: 'Welcome, $1!',
  messageText: 'Hey $1 — I\'m $3.\n\nThanks for your first edit on <a href="wikiurl.fandom.com/wiki/$2">$2</a>.\n\n— $3',
  debug: false,
  testAllEdits: false,
  preferTalk: false,
};

// Import from dev
importArticles({
  type: 'script',
  articles: [
    'dev:MediaWiki:WelcomeMessage.js'
  ]
});


Using configuration options with Fandom Developers Wiki scripts

The instructions on this page describe how to use configuration options with a script. Here on the Fandom Developers Wiki, 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
// 1. AjaxRC import statement
importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:AjaxRC.js'
    ]
});

// 2. AjaxRC configuration option
window.ajaxRefresh = 30000;
Proper placement of configuration options
// 1. AjaxRC configuration option
window.ajaxRefresh = 30000;

// 2. AjaxRC import statement
importArticles({
    type: 'script',
    articles: [
        'u:dev:MediaWiki:AjaxRC.js'
    ]
});

Planned updates

Text above can be found here (edit)