User:Тишина/guides/JavaScript hacks

I'm developing a list of hacks that can be used by administrators to change their wikis. Javascript features can be added through the wiki interface by administrators without requesting changes to the PHP code on the server. Miraheze also gives any user the ability to customize their own view of the site with personal Javascript and CSS pages.


 * Implementing code on your wiki

Ending a page title in .js will consider the page a code page and trigger the code editor when editing the script.

Scripts can be added by using the  method to call the URL of the script page and adding   to the end of the URL so only the source code of the page is loaded.

Example of a script import:

Add a message to the top of the page
The easiest way to add a message to the top of the page is to use the MediaWiki:Sitenotice page that will include wiki code at the top of the page. This will probably be your best option for simple text.