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 p…
This is an information page. It is not a Wikipedia policy or guideline; rather, its purpose is to explain certain aspects of Wikipedia's norms or practices. It may reflect varying levels of consensus. |
| You take full responsibility for any actions taken using any gadget. You must read and abide by all relevant Wikipedia policies when using this tool; failure to do so may result in being blocked from editing. |
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 Gadgets.
Many gadgets started out as user scripts. Once a user script is approved as a gadget, it is removed from Wikipedia:User scripts/List. The currently installed gadgets are listed at Special:Gadgets.
In order to be deployed on the English language Wikipedia, gadgets should generally pass the following conditions:
Gadgets that are marked as default and load for large groups of users have additional criteria they need to conform to.
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.
Gadgets can be installed after discussion at the technical section of the village pump by interface administrators in the following way:
* scriptname|scriptname.js[|scriptname.css|otherscript.js|...]
The gadget should now appear on Special:Gadgets.
Comments or warnings can be added to the gadget description templates in two ways:
<noinclude> comment </noinclude><!-- comment -->Comments added in this way will be automatically discarded during the page creation process.
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]]
*/
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.
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:
This list should not be considered exhaustive.
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.
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.
?withJS= and ?withCSS=.Especially once a user script has a lot of users...
?withJS= and ?withCSS=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 users. 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: (search for more)
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.