Help:Gadgets/options

Gadgets allow users to pick JavaScript (JS) or CSS-based "gadgets" that other community users provide. This page details how to configure a gadget.

Gadgets are usually configured in MediaWiki:Gadgets-definition using the following syntax, where each field is separated by : The first field sets up the internal name of the gadget. The other fields are  pages that will be loaded for the user. In the above example, mygadget:
 * mygadget|mygadget.js|mygadget.css
 * has definition text at [ MediaWiki:Gadget-mygadget]
 * will load [ MediaWiki:Gadget-mygadget.js] and [ MediaWiki:Gadget-mygadget.css].

It's possible to configure options in the first field of your gadgets. For example:
 * mygadget[ResourceLoader]|mygadget.js|mygadget.css
 * mygadget[ ResourceLoader | rights=foo, bar ] | mygadget.js | mygadget.css

Option format
[option1 | option2 | ... optionN] Whitespace can be omitted. The brackets are wrapped around either: option = value1, value2, value3
 * single option name (in this case it is a flag option), OR
 * contain a comma-separated list of values:

Available options
To enable a gadget by default use " ":
 * mygadget[ResourceLoader|default|dependencies=mediawiki.util]|mygadget.js|mygadget.css

To make the gadget available only to users with appropriate permissions, set the  option. For example:
 * mygadget[rights=foo,bar]|mygadget.js|mygadget.css

There's four gadget options available: