Help:Gadgets: Difference between revisions

From Inkipedia, the Splatoon wiki
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
Gadgets are made up of JavaScript and/or CSS Snippets located on pages in the MediaWiki namespace. Each gadget is defined by a line in [[MediaWiki:Gadgets-definition]], providing a name and description for the gadget, and a list of the JS and CSS snippets that it uses.
Gadgets are made up of JavaScript and/or CSS Snippets located on pages in the MediaWiki namespace. Each gadget is defined by a line in [[MediaWiki:Gadgets-definition]], providing a name and description for the gadget, and a list of the JS and CSS snippets that it uses.


Since gadgets reside in the MediaWiki namespace (the list defining the gadgets as well as the actual code snippets), only [[Inkipedia:Administrators|Administrators]] and [[Inkipedia:Interface administrators|Interface administrators]] can edit the code. This is as it should be as JavaScript code can be used to hijack accounts or spy on people.  
Since gadgets reside in the MediaWiki namespace (the list defining the gadgets as well as the actual code snippets), only [[Inkipedia:Administrators|Administrators]] and [[Inkipedia:Interface administrators|Interface administrators]] can edit the code. This is intended, as JavaScript code can be used to hijack accounts or spy on people.


== Creating new gadgets ==
== Creating new gadgets ==
Line 23: Line 23:
* [[mw:ResourceLoader|ResourceLoader manual]]
* [[mw:ResourceLoader|ResourceLoader manual]]
* [[Special:GadgetUsage|Gadget usage]]
* [[Special:GadgetUsage|Gadget usage]]
[[Category:Inkipedia]]

Latest revision as of 02:58, 16 June 2024

Inkipedia's gadgets

A list of gadgets employed is available at Special:Gadgets.

Gadgets are made up of JavaScript and/or CSS Snippets located on pages in the MediaWiki namespace. Each gadget is defined by a line in MediaWiki:Gadgets-definition, providing a name and description for the gadget, and a list of the JS and CSS snippets that it uses.

Since gadgets reside in the MediaWiki namespace (the list defining the gadgets as well as the actual code snippets), only Administrators and Interface administrators can edit the code. This is intended, as JavaScript code can be used to hijack accounts or spy on people.

Creating new gadgets

  1. Go to MediaWiki:Gadgets-definition.
  2. Add a new entry for your gadget. For example: * MyCoolGadget[ResourceLoader|default]|MyCoolGadget.js
    • This entry creates a new gadget named "MyCoolGadget" and specifies that it should be loaded by default using ResourceLoader.
    • Adding the default keyword in the definition entry enables by default for all users.
    • It's also a good idea to list the dependencies, such as jquery and mw.api where appropriate.
  3. Create a new page for your gadget's JavaScript code at MediaWiki:Gadget-MyCoolGadget.js.
    • If you already have JS code, paste this into the new page.
  4. Create a new page for your gadget's description shown in preferences at MediaWiki:Gadget-MyCoolGadget. (Note the missing .js).
  5. Save and Test. Remember to clear your browser cache or perform a hard refresh to see the changes.

See also