Help:Custom edit buttons
From the RuneScape Wiki, the wiki for all things RuneScape
With the upgrade to MediaWiki 1.9, users can now easily customize the edit toolbar. To do this, you can either edit the monobook.js or created your own monobook by doing placing [[User:Example/Monobook.js]] on your user page. However, only admins can edit the site-wide monobook, so you'll have to discuss changes with them to have buttons added to the entire wiki.
[edit] How to make a new button
The first thing to do is create a 23x22 image (you can use Wikia's blank button as a template) and upload it or use one of Wikia's already made buttons.
After that, you simply edit your user js or site-wide js. Shown below are examples on how to do this.
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/central/images/c/c8/Button_redirect.png",
"speedTip": "Redirect",
"tagOpen": "#REDIRECT [[",
"tagClose": "]]",
"sampleText": "Insert text"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/central/images/c/c9/Button_strike.png",
"speedTip": "Strike",
"tagOpen": "<s>",
"tagClose": "</s>",
"sampleText": "Strike-through text"};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/central/images/1/13/Button_enter.png",
"speedTip": "Line break",
"tagOpen": "<br />",
"tagClose": "",
"sampleText": ""};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://images.wikia.com/central/images/7/74/Button_comment.png",
"speedTip": "Comment visible only for editors",
"tagOpen": "<!-- ",
"tagClose": " -->",
"sampleText": "Insert comment here"}
}
- imageFile : This is the full URL to the image. This image should either be on this wiki or on Wikia.
- speedTip : The text that appears when you hover the mouse over the button.
- tagOpen : The opening tag
- tagClose : The closing tag (omitted if there is no sample text needed).
- sampleText : The text that will be automatically highlighted upon insertion (between the two other tags), this is intended to be replaced by user input.