Jump to content

User:Chlod/Scripts/GlobalUserToolbox

From Wikipedia, the free encyclopedia
GlobalUserToolbox
Author(s)Chlod
StatusStable
UpdatedFebruary 8, 2020; 4 years ago (2020-02-08)
BrowsersFirefox (but likely works on all browsers)
SkinsVector
SourceUser:Chlod/Scripts/GlobalUserToolbox.js

Global User Toolbox (GUT) is a script that adds the {{User toolbox}} template to all pages in the "User" and "User talk" namespaces.

Installation

[edit]

To install the script, add this to your common.js file.

mw.loader.load( '/w/index.php?title=User:Chlod/Scripts/GlobalUserToolbox.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Chlod/Scripts/GlobalUserToolbox.js]]

Features

[edit]

The following options can be configured. You can change them by setting a variable named "gutOptions" to an object with the configuration keys you want.

Key Type Default Description
include_userpages boolean (true/false) true Include all pages (excluding subpages) under the "User" namespace.
include_talkpages boolean (true/false) true Include all pages (excluding subpages) under the "User talk" namespace.
include_subpages boolean (true/false) true Include all pages (including subpages) under the "User" namespace.
include_talksubpages boolean (true/false) true Include all pages (including subpages) under the "User talk" namespace.
insert_at_top boolean (true/false) true Insert the user toolbox at the top of the page? (Inserted at bottom, if false.)
ignore_existing boolean (true/false) true Disable adding a toolbox if there is already a toolbox for that user on the page.
start_collapsed boolean (true/false) true Create the toolbox collapsed (if collapsible.)

These settings can be applied like so:

// The variable name must ALWAYS be gutOptions.
var gutOptions = {
    "insert_at_top": false,
    "ignore_existing": false
};
mw.loader.load( '/w/index.php?title=User:Chlod/Scripts/GlobalUserToolbox.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:Chlod/Scripts/GlobalUserToolbox.js]]

Source

[edit]

The source can be found at User:Chlod/Scripts/GlobalUserToolbox.js. Like all Wikipedia pages, the license is CC BY-SA 3.0.

Discussion

[edit]

You may visit my talk page if you have any concerns.