User:OstPavel/common.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
/**
* Extra buttons in toolbar
* @stats [[File:Krinkle_InsertWikiEditorButton.js]]
*/
jQuery.getScript('//meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript', function () {
// Happy face
krInsertWikiEditorButton({
id: "mw-customeditbutton-myspecialbutton",
icon: "//upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png",
label: 'Insert happy face',
insertBefore: '[[File:Gnome-face-smile.svg|21px|',
insertAfter: ']]',
sampleText: 'Happy face'
});
//Custom button test
krInsertWikiEditorButton({
id: 'mw-customeditbutton-craftingtabletemplatebutton',
icon: '//upload.wikimedia.org/wikipedia/commons/7/76/Button_ela_geminada_min.png',
label: 'Insert Crafting Table Template',
insertBefore: '{{Grid/Crafting Table \n|A1= |B1= C1= \n|A2= |B2= C2= \n|A3= |B3= C3= \nOutput=',
insertAfter: '\n }}',
});
});