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

m
→‎Premade Buttons: added art infobox button
m (→‎Premade Buttons: added art infobox button)
}
}
}
}
});
</pre>
|}
 
==== Art Infobox ====
This button pastes the {{t|art}} infobox into the page leaving your cursor after <code>|#artist=</code>. This can make file uploads an easier process since you no longer have to copy and paste the infobox every time you upload a file.
 
{| class="mw-collapsible mw-collapsed" width=100%
|-
|
|-
|
<pre>
// Adding an art infobox button to the "main" section
$('#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"code": {
label: 'Art infobox',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/7/76/Button_atelier_graphique.PNG',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{art' + '\n' + '|#artist=' + '\n' + '|series=' + '\n' + '|#source=',
post: '\n' + '|type=' + '\n' + '}}'
}
}
}
}
Autopatrolled, Editors
8,721

edits