Help:Gadgets: Difference between revisions
From Inkipedia, the Splatoon wiki
(links) |
mNo edit summary |
||
Line 4: | Line 4: | ||
#* This entry creates a new gadget named "MyCoolGadget" and specifies that it should be loaded by default using ResourceLoader. | #* 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. | #* 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. | |||
# Create a new page for your gadget's JavaScript code at MediaWiki:Gadget-''MyCoolGadget''.js. | # Create a new page for your gadget's JavaScript code at MediaWiki:Gadget-''MyCoolGadget''.js. | ||
#* If you already have JS code | #* If you already have JS code, paste this into the new page. | ||
# Create a new page for your gadget's description shown in preferences at MediaWiki:Gadget-''MyCoolGadget''. (Note the missing .js). | # Create a new page for your gadget's description shown in preferences at MediaWiki:Gadget-''MyCoolGadget''. (Note the missing .js). | ||
# Save and Test. Remember to clear your browser cache or perform a hard refresh to see the changes. | # Save and Test. Remember to clear your browser cache or perform a hard refresh to see the changes. |
Revision as of 16:53, 15 June 2024
Creating new gadgets
- Go to MediaWiki:Gadgets-definition.
- 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.
- 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.
- Create a new page for your gadget's description shown in preferences at MediaWiki:Gadget-MyCoolGadget. (Note the missing .js).
- Save and Test. Remember to clear your browser cache or perform a hard refresh to see the changes.
- Each section in the definitions file corresponds to MediaWiki:gadget-section-NameOfTheSection, e.g. MediaWiki:gadget-section-appearance.