Difference between revisions of "User:King of Herdaz/Toolbar customization"

m
m
 
=== Premade Buttons ===
Buttons are the simplest type of element in the toolbar. Buttons appear in the toolbar as icons thatand will performexecute one [[#Actions|action]] when itthey isare clicked. Examples of buttons in the default toolbar configuration include the Bold button and the Italics button.
 
The buttons presented here will be added to the left side of the <code>main</code> section of your toolbar (which is the top row that is always showing).
 
==== Artist Page ====
This button inserts the {{t|artist}} infobox (with all possible parameters) into the page followed by the rest of the things that should go on an artist page with the proper formatting and spacing.
 
{| class="mw-collapsible mw-collapsed" width=100%
|-
|-
<pre>
// Adding artist page button to the "main" section
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"artist-page": {
label: 'Artist Page',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/7/76/Button_atelier_graphique.PNG',
action: {
type: 'encapsulate',
options: {
pre: '{'+'{artist' + '\n' + '|image=' + '\n' + '|alias=' + '\n' + '|fb=' + '\n' + '|reddit=' + '\n' + '|behance=' + '\n' + '|da=' + '\n' + '|ig=' + '\n' + '|as=' + '\n' + '|tumblr=' + '\n' + '|twitter=' + '\n' + '|site=' + '\n' + '|license=all|some|none|official' + '\n' + '|contact=' + '\n' + '|type=fan|interior|cover|multimedia' + '\n' + '|no-notify=y' + '\n' + '}}' + '\n\n' + '<br style="clear:right;"/>' + '\n' + '== Gallery ==' + '\n' + '<gallery caption="Gallery" mode="packed" heights=200px>' + '\n\n' + '</gallery>' + '\n' + '{{meta/done}}'
}
}
}
}
});
</pre>
|}
 
==== Image template ====
}
}
}
}
});
</pre>
|}
 
==== Artist Page ====
This button inserts the {{t|artist}} infobox (with all possible parameters) into the page followed by the rest of the things that should go on an artist page with the proper formatting and spacing.
 
{| class="mw-collapsible mw-collapsed" width=100%
|-
|-
<pre>
// Adding artist page button to the "main" section
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"artist-page": {
label: 'Artist Page',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/7/76/Button_atelier_graphique.PNG',
action: {
type: 'encapsulate',
options: {
pre: '{'+'{artist' + '\n' + '|image=' + '\n' + '|alias=' + '\n' + '|fb=' + '\n' + '|reddit=' + '\n' + '|behance=' + '\n' + '|da=' + '\n' + '|ig=' + '\n' + '|as=' + '\n' + '|tumblr=' + '\n' + '|twitter=' + '\n' + '|site=' + '\n' + '|license=all|some|none|official' + '\n' + '|contact=' + '\n' + '|type=fan|interior|cover|multimedia' + '\n' + '|no-notify=y' + '\n' + '}}' + '\n\n' + '<br style="clear:right;"/>' + '\n' + '== Gallery ==' + '\n' + '<gallery caption="Gallery" mode="packed" heights=200px>' + '\n\n' + '</gallery>' + '\n' + '{{meta/done}}'
}
}
}
}
Autopatrolled, Editors
8,718

edits