Soyjak Wiki:Gadgets

From Soyjak Wiki, the free ensoyclopedia
Jump to navigationJump to search
(You) take all of the responsibilities using any gadget at all. This means (obviously) following the Wiki rules when using this tool. Failure to do so will result in despicable things happening to you.
This topic relates to this very wikiHere be edit wars, censorship and template spam.

Gadgets are MediaWiki extensions or snippets that enhance the software's functionality for users. They can be enabled in Special:Preferences#mw-prefsection-gadgets. Gadgets are usually made in JavaScript or CSS.

Many gadgets started out as user scripts. Once a user script is approved as a gadget, it has its status as an User script removed. The currently installed gadgets are listed at Special:Gadgets.

General criteria for making gadgets

[edit | edit source]

In order to be deployed on any wiki, gadgets should generally pass the following conditions:

  1. Gadgets must work if just included with no further configuration. They can be configurable via personal common.js, but must work unconfigured.
  2. Gadgets must be compatible with all major browsers, i.e., they must not terminate with errors. Ignoring Internet Explorer, that's a dnb.
  3. Gadgets should be functional in most major browsers (cross-browser compatibility). Exceptions like the aforementioned Internet Explorer must be clearly stated.
  4. Duplication of gadgets should only be made if it is reasonable. Or just don't try to copy a gadget, you VVILL get 'nished.
  5. Collections of scripts should be split if they have disparate functions.
  6. Gadgets requiring permissions must be marked and must fail gracefully if the permissions aren't present.
  7. Gadgets only working in some skins must be marked as such if that data is even available.

Gadgets that are marked as default and load for large groups of users have additional criteria they need to conform to.

Existing Gadgets

[edit | edit source]

Existing Gadgets you can use (atleast if you have certain perms) in the 'ki includes:

UI Enhancements

[edit | edit source]
  • Navigation popups: Navigation popups are previews of pages that are shown by hovering over links. Unlike the default page previews, these have extra features such as being able to edit a page from its preview.
  • UserHighlighter: highlights the names of staff, and strikes out the names of blocked users.
  • Gallery Controls
  • Collapsible Tables: Autocollapse navigation boxes.
  • HideTOC: Automatically hides table of contents when its over 10 headers long.
  • PermablockedLog: Show block reason for blocked users.
  • My Sandbox: Add a "Sandbox" link to the personal toolbar area.

Editing Utilities

[edit | edit source]
  • Convenient Discussions: Improves the talk page discussions experience with with easier replying, mentions, topic tools, and a searchable Soymoji picker.
  • WikED: wikEd enhances the functionality of the source editor with features such as syntax highlighting and markup buttons.
  • HotCat: HotCat allows users to easily add categories to pages by simply clicking a (+) button in the category list. Users can also remove and modify categories using this gadget.
  • Purge option : The purge option gadget adds a button to the top of a page to purge its cache.

Moderation Tools

[edit | edit source]
  • Vanish User: Allows bureaucrats to quickly process approved account vanishing requests by performing the required vanishing actions in one operation.
  • Twinkle: Assists users with rollback permissions in common tasks. It enables features such as requesting page protection, viewing recent changes, and marking pages for deletion.

Installation

[edit | edit source]

Gadgets can be installed after discussion[Where?] in the following way:

  1. Add the header below and the script code to MediaWiki:Gadget-scriptname.js
  2. Optionally, add the header below and CSS code to MediaWiki:Gadget-scriptname.css
  3. Add a script description to MediaWiki:Gadget-scriptname. Please link to the script home and/or help page and state browser requirements if really needed.
  4. Add to MediaWiki:Gadgets-definition under the appropriate heading
    * scriptname|scriptname.js[|scriptname.css|otherscript.js|...]

The gadget should now appear on Special:Gadgets.

Comments

[edit | edit source]

Comments or warnings can be added to the gadget description templates in two ways:

  • noinclude tag (visible on description page with links): <noinclude> comment </noinclude>
  • HTML comments (visible in source text only): <!-- comment -->

Comments added in this way will be automatically discarded during the page creation process.

[edit | edit source]

The following header is to be added to the gadget files:

/*  _____________________________________________________________________________
 * |                                                                             |
 * |                    === WARNING: GLOBAL GADGET FILE ===                      |
 * |                  Changes to this page affect many users.                    |
 * | Please discuss changes on the talk page or on [[Soyjak Wiki talk:Gadgets]] before editing. |
 * |_____________________________________________________________________________|
 * 
 * Imported from version XXXX as of DATE from [[SCRIPT_SOURCE]]
 * SHORT_DESCRIPTION, see [[SCRIPT_HOME_PAGE]]
 */

Default gadgets

[edit | edit source]

A gadget with default keyword is enabled for all Soyjak Wiki visitors and only registered users can disable it. A gadget with [default|rights=minoredit] description would be automatically enabled only for registered users.

Criteria

[edit | edit source]

Gadgets that are enabled by default for all users have to comply with stricter rules. These are essentially the same rules that apply to all default shipped code. This is because users have no active choice in them being enabled and the gadgets can impact the performance, security and stability of the entire website. These gadgets should:

  • Have been reviewed by an experienced JavaScript developer (generally an interface admin).
  • Be well maintained or something
  • Conform with the Third-party resources policy.
  • Be written to run efficiently, i.e. with as little code as required. If full functionality of the gadget requires a lot of JavaScript code, then this code should be loaded conditionally and lazily, or only on demand (click to load).
  • Cause no accessibility problems.
  • Not be required for content to be readable, except for styles-only gadgets.
  • Not interfere with printing pages.
  • Comply with the current security and privacy standards.

This list should not be considered exhaustive.

Template gadgets

[edit | edit source]
>Though maybe you were looking for mw:Template gadgets?

Template gadgets are a special category of default gadgets. These gadgets only run on pages in explicit trigger categories, generally controlled by adding a template to a page. Trigger categories should be move-protected as they are integrated with the definition.

?withJS= and ?withCSS=

[edit | edit source]

Adding ?withJS= and/or ?withCSS= to the URL, and then placing the name of a MediaWiki namespace .js or .css page after the equals sign, will execute that .js and css. code for the user on that page only. This is useful for making wizards, or for temporarily loading a gadget without changing your preferences. This functionality is similar to a default gadget and works for everyone, including logged out chuds. However it is not implemented via mw:Extension:Gadgets, but rather via English Wikipedia's MediaWiki:Common.js. The upstream code is located at mw:Snippets/Load JS and CSS by URL. Here is a partial list of scripts loaded in this manner: (they are all for Wikipedia. Kek.) (search for more)