FANDOM


SignatureCheck checks that users have signed (~~~~) their talk page replies when they hit Publish. If there is no signature wikicode on the page then it will throw up a confirmation box warning them about it and asking if they are sure they want to proceed anyway. [Minor edits do not trigger the signing warning]

It also detects the creation of Forum pages without the {{Forumheader}} template being present on it, since some users inexplicably choose to delete the header before submitting their post.

Installation

After that, add the following code to MediaWiki:Common.js or MediaWiki:Wikia.js. The code will not work without it.

window.i = window.i || 0; //Required for SignatureCheck to work properly

Configuration

The script can be optionally configured if you don't like the defaults.

Property Description Type Default
preamble The text that will appear as the first line of the prompt if the user triggers one of the warnings. You should generally put a '\n' (a line-break) at the end unless you want the entire prompt to appear as one line. Text There are a few potential problems with your edit:\n\n
noForumheader The text that will appear in the prompt when the {{Forumheader}} template is missing from a page in the Forum namespace. Text !! There is no forum header on this forum page. You should not create forum pages without the header since they will not actually show up in the forum list.\n
noSignature The text that will appear in the prompt if there is no signature insertion wikitext (~~~) on the page [Only if the page is a talk page or the Forum]. Text ?? It looks like you forgot to sign your reply. Use ~~~~ to sign.\n
epilogue The text that will always appear as the last line of the prompt. Text \nAre you sure you want to post this anyway?\n[Violating policy may incur a warning from the administrators]
forumheader The name of the {{Forumheader}} template on your wiki. Generally you won't need to set this since all wikis use the same one unless you moved it. You can set this to an empty string to disable the feature if you'd prefer. Text Forumheader
checkSignature Whether to check for the wikitext signature or not. If this is false then only the Forumheader check will be performed. Boolean true
extraNamespaces An array of objects that contains a namespace and patterns parameter. Array< Object< Number< namespace >, Array< patterns > > > null
window.SignatureCheckJS = {
	// Parts of the confirm prompt
	preamble: 'This will appear as the first line of the prompt box\n\n',
	epilogue: '\nThis will appear at the end of the prompt box.',
	noForumheader: 'This will appear in the middle of the preamble and epilogue if the forumheader template is missing on a forum page\n',
	noSignature: 'This will appear in the middle of the preamble and epilogue if the user hasn\'t used ~~~ to sign their post on a forum or talk page\n',
 
	// Other stuff
	forumheader: 'Forumheader', // The name of the Forumheader template, can be set to an empty string or false to disable
	checkSignature: true, // Enable the signature check function
        extraNamespaces: [    // Enable signature checking on other namespaces and subpages can be omitted
                {
                        namespace: 2,          // namespace to check REQUIRED
                        patterns: [ '/talk' ]  // subpages to match in this namespace REQUIRED
                }
        ]
};

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
importScriptPage('AjaxRC/code.js','dev');
 
// 2. AjaxRC configuration option
var ajaxRefresh = 30000;
Proper placement of configuration options
// 1. AjaxRC configuration option
var ajaxRefresh = 30000;
 
// 2. AjaxRC import statement
importScriptPage('AjaxRC/code.js','dev');

Usage notes

  • The prompt will come up when editing Forum index pages which you obviously don't want to sign. Just ignore it and press Ok.
  • If you tick the "minor edit" box then the script will not prompt you to sign. This is because minor edits should not be replies, just fixing style problems, bad links, or correcting a reply you just made but published early by accident.
  • Users who don't want to encounter the prompt functionality can add the following code to their common.js page on the wiki using this script or their global.js:
if (window.WikiaEditor && window.GlobalTriggers) {
    window.GlobalTriggers.bind('WikiaEditorReady', function callback() {
        window.GlobalTriggers.unbind('WikiaEditorReady', callback);
        window.setTimeout(function() {
            $('#wpSave').closest('form').off('submit.CheckSignature');
        }, 0);
    });
}