Difference between revisions of "User:Root/common.js"
(Created page with "/* $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'format', tools: { 'bluetext': { label: 'Blue text', type: 'button...") |
m |
||
Line 1: | Line 1: | ||
− | / | + | // OLD WAY - "classic toolbar": |
− | + | mw.toolbar.addButton({ | |
− | + | imageId: 'mw-customeditbutton-myspecialbutton', | |
− | + | imageFile: '//upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png', | |
− | + | speedTip: "Title label", | |
− | + | tagOpen: "Smile (", | |
− | + | tagClose: ")", | |
− | + | sampleText: "sample" | |
− | + | }); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | // NEW WAY - "WikiEditor": | |
− | + | 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: 'Title label', | |
− | + | insertBefore: 'Smile (', | |
− | + | insertAfter: ')', | |
− | + | sampleText: 'sample' | |
− | + | }); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | } ); |
Revision as of 02:29, 22 June 2017
// OLD WAY - "classic toolbar":
mw.toolbar.addButton({
imageId: 'mw-customeditbutton-myspecialbutton',
imageFile: '//upload.wikimedia.org/wikipedia/commons/thumb/a/a4/Gnome-face-smile.svg/22px-Gnome-face-smile.svg.png',
speedTip: "Title label",
tagOpen: "Smile (",
tagClose: ")",
sampleText: "sample"
});
// NEW WAY - "WikiEditor":
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: 'Title label',
insertBefore: 'Smile (',
insertAfter: ')',
sampleText: 'sample'
});