Wikipedia:Gadget: Difference between revisions
Enterprisey (talk | contribs) |
No edit summary Tags: Reverted Mobile edit Mobile web edit |
||
Line 5: | Line 5: | ||
A '''Wikipedia gadget''' is a [[JavaScript]] program and/or a [[CSS]] [[Snippet (programming)|snippet]] that can be enabled simply by checking an option in your [[Special:Preferences#mw-prefsection-gadgets|preferences]]. The gadget's function is provided by the [[MediaWiki]] extension [[mw:Extension:Gadgets|Extension:Gadgets]]. |
A '''Wikipedia gadget''' is a [[JavaScript]] program and/or a [[CSS]] [[Snippet (programming)|snippet]] that can be enabled simply by checking an option in your [[Special:Preferences#mw-prefsection-gadgets|preferences]]. The gadget's function is provided by the [[MediaWiki]] extension [[mw:Extension:Gadgets|Extension:Gadgets]]. |
||
Many gadgets started out as [[Wikipedia:User scripts|user scripts]]. Once a user script is approved as a gadget, it is removed from [[Wikipedia: |
Many gadgets started out as [[Wikipedia:User scripts|user scripts]]. Once a user script is approved as a gadget, it is removed from [[Wikipedia:java scripts/List]]. |
||
== General criteria for gadgets == |
== General criteria for gadgets == |
Revision as of 15:40, 14 October 2021
This is an information page. It is not an encyclopedic article, nor one of Wikipedia's policies or guidelines; rather, its purpose is to explain certain aspects of Wikipedia's norms, customs, technicalities, or practices. It may reflect differing levels of consensus and vetting. |
Warning: You take full responsibility for any action you perform using any gadget. You must read and understand Wikipedia policies and use this tool within these policies, or risk being blocked from editing. |
Namespaces | |||
---|---|---|---|
Subject namespaces | Talk namespaces | ||
0 | (Main/Article) | Talk | 1 |
2 | User | User talk | 3 |
4 | Wikipedia | Wikipedia talk | 5 |
6 | File | File talk | 7 |
8 | MediaWiki | MediaWiki talk | 9 |
10 | Template | Template talk | 11 |
12 | Help | Help talk | 13 |
14 | Category | Category talk | 15 |
100 | Portal | Portal talk | 101 |
118 | Draft | Draft talk | 119 |
126 | MOS | MOS talk | 127 |
710 | TimedText | TimedText talk | 711 |
828 | Module | Module talk | 829 |
Former namespaces | |||
108 | Book | Book talk | 109 |
442 | Course | Course talk | 443 |
444 | Institution | Institution talk | 445 |
446 | Education Program | Education Program talk | 447 |
2300 | Gadget | Gadget talk | 2301 |
2302 | Gadget definition | Gadget definition talk | 2303 |
2600 | Topic | 2601 | |
Virtual namespaces | |||
-1 | Special | ||
-2 | Media | ||
Current list |
A Wikipedia gadget is a JavaScript program and/or a CSS snippet that can be enabled simply by checking an option in your preferences. The gadget's function is provided by the MediaWiki extension Extension:Gadgets.
Many gadgets started out as user scripts. Once a user script is approved as a gadget, it is removed from Wikipedia:java scripts/List.
General criteria for gadgets
In order to be deployed on the English language Wikipedia, gadgets should generally pass the following conditions:
- Gadgets must work if just included with no further configuration. They can be configurable via personal common.js, but must work unconfigured.
- Gadgets must be compatible with all major browsers, i.e., they must not terminate with errors.
- Gadgets should be functional in most major browsers (cross-browser compatibility). Exceptions must be clearly stated.
- Duplication of gadgets should only be made if it is reasonable.
- Collections of scripts should be split if they have disparate functions.
- Gadgets requiring permissions must be marked and must fail gracefully if the permissions aren't present.
- Gadgets only working in some skins must be marked as such if that data is available.
Proposals
New gadgets should be proposed at the technical Village Pump.
Historically, new gadgets were proposed at a subpage of this page, but that page was marked historical due to low participation. Also, existing WikiProject User scripts used to be evaluated for conversion to gadgets, but that process has also been marked historical.
Installation
Gadgets can be installed after discussion at the technical section of the village pump by interface administrators in the following way:
- Add the header below and the script code to MediaWiki:Gadget-scriptname.js
- Optionally, add the header below and CSS code to MediaWiki:Gadget-scriptname.css
- Add a script description to MediaWiki:Gadget-scriptname. Please link to the script home and/or help page and state browser requirements if needed.
- 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
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.
Header
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 [[WT:Gadget]] before editing. |
* |_____________________________________________________________________________|
*
* Imported from version XXXX as of DATE from [[SCRIPT_SOURCE]]
* SHORT_DESCRIPTION, see [[SCRIPT_HOME_PAGE]]
*/
Default gadgets
A gadget with default
keyword is enabled for all Wikipedia visitors and only registered users can disable it.
A gadget with [default|rights=minoredit]
description would be automatically enabled only for registered users.
Currently installed gadgets
Users can browse a list of all available gadgets in the gadgets section of their preferences page:
See Special:Gadgets for a list of all active gadgets and links to their script files.
See also
- MediaWiki talk:Gadgets-definition, discussing technical details of making and maintaining gadgets
- Special:GadgetUsage, provides statistics on gadget usage
- mw:Extension:Gadgets, the Mediawiki gadget extension page
- Template:Bug report, template message asking for detailed bug-related information
- mw:Gadget kitchen, tutorial on writing gadgets
- Wikipedia:Gadget/Repositories, a list of version control repositories for gadgets and user scripts