User:Chlod/Scripts/GlobalUserToolbox

{{Short description|Userscript that adds a user toolbox to all user pages}}

{{Infobox user script

| author = Chlod

| updated = {{start date and age|2020|02|08}}

| status = Stable

| source = User:Chlod/Scripts/GlobalUserToolbox.js

| skins = Vector

| browsers = Firefox (but likely works on all browsers)

}}

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

Installation

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

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.

class="wikitable"
Key

!Type

!Default

!Description

include_userpages

| boolean (true/false)

| {{yes|true}}

| Include all pages (excluding subpages) under the "User" namespace.

include_talkpages

| boolean (true/false)

| {{yes|true}}

| Include all pages (excluding subpages) under the "User talk" namespace.

include_subpages

| boolean (true/false)

| {{yes|true}}

| Include all pages (including subpages) under the "User" namespace.

include_talksubpages

| boolean (true/false)

| {{yes|true}}

| Include all pages (including subpages) under the "User talk" namespace.

insert_at_top

| boolean (true/false)

| {{yes|true}}

| Insert the user toolbox at the top of the page? (Inserted at bottom, if false.)

ignore_existing

| boolean (true/false)

| {{yes|true}}

| Disable adding a toolbox if there is already a toolbox for that user on the page.

start_collapsed

| boolean (true/false)

| {{yes|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

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

Discussion

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