Help:Gadgets

Gadgets is an extension that allows users to pick JavaScript or CSS based "gadgets" that other wiki users provide.

They're designed using JavaScript and/or CSS snippets located on pages in the MediaWiki namespace. Each gadget is added by adding a new entry to MediaWiki:Gadgets-definition, providing a name and description for the gadget, and a list of the JS and CSS snippets that it uses (see the Usage section below).

Gadgets use the same principle as MediaWiki:Monaco.js, MediaWiki:Common.css, etc because they allow scripting or styling over the entire site. Since Gadgets function in this manner (the list that enables them as well as the actual JS and CSS pages), it requires being a wiki admin to manage these, just like the sitewide JS or CSS.

Use
First you need to add a script or style to a page in the MediaWiki namespace (e.g. MediaWiki:Foobar.js ). Then you add that page to MediaWiki:Gadgets-definition as shown here:

* foobargadget|foobar.js|foobar.css

The first field is the gadget's internal name, and may only contain alphanumberic (letters and numbers only) in order to function correctly. The second and subsequent fields define the pages that make up the code. In the above example, they would be MediaWiki:foobar.js and MediaWiki:foobar.css. Like other sitewide pages, Gadgets may only be written using JS and CSS pages.

These defined pages will allow the gadget to appear in the "Gadgets" section of everyone's preferences, so users can choose which gadgets fit their wiki needs. An overview of added gadgets can be found on Special:Gadgets, along with links to the respective pages that define them, which allows for better control over the wiki's gadgets.