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

m
→‎Premade Buttons: put in alphabetical order
m
m (→‎Premade Buttons: put in alphabetical order)
 
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).
 
==== Image template ====
Pastes the {{t|image}} template onto the page, encapsulating your cursor or whatever you have highlighted.
 
For example, if you have <code><nowiki>Shallan.jpg</nowiki></code> highlighted when you press the button it will result in this: <code><nowiki>{{image|Shallan.jpg|side=|width=|caption}}</nowiki></code>
 
{| class="mw-collapsible mw-collapsed" width=100%
|-
|-
<pre>
// Adding image template button to the "main" section
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"image": {
label: 'Image template',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/d/d8/Vector_toolbar_insert_image_button.png',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{image|',
post: '|side=|width=|caption}}'
}
}
}
}
});
</pre>
|}
 
==== Art Infobox ====
|}
 
==== CategoryBreak Tag ====
PastesInserts <code><nowiki>[[Category:<br /nowiki></code> and <code><nowiki>]]</nowiki></code> aroundinto the page which is the preferred syntax on the Coppermind for yourcreating highlightedline textbreaks.
 
{| class="mw-collapsible mw-collapsed" width=100%
|
<pre>
// Adding category<br/> button to the "main" section
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"categorybreak": {
label: 'CategoryBreak tag',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/21/2d13/Button_clipboard_categoryButton_enter.png',
action: {
type: 'encapsulate',
options: {
pre: "[[Category:'<' "+ 'br />',
post: "]]"
}
}
|}
 
==== Wikipedia LinkCategory ====
Pastes <code><nowiki>[[WikipediaCategory:</nowiki></code> and <code><nowiki>|]]</nowiki></code> around your highlighted text. This generates a link to that Wikipedia page and hides the prefix. For example, if you highlight <code>Brandon Sanderson</code> and click this button it will generate this: <code><nowiki>[[Wikipedia:Brandon Sanderson|]]</nowiki></code> which produces [[Wikipedia:Brandon Sanderson|Brandon Sanderson]] on the page.
 
{| class="mw-collapsible mw-collapsed" width=100%
|
<pre>
// Adding Wikipedia linkcategory button to the "main" section
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"wikipediacategory": {
label: 'WikipediaCategory',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/c2/cb2d/Button_wikipediaButton_clipboard_category.png',
action: {
type: 'encapsulate',
options: {
pre: "[[WikipediaCategory: ",
post: "|]]"
}
}
|}
 
==== Break Tag<nowiki><code></nowiki> ====
InsertsEncases your highlighted text between <code><nowiki><br /code></nowiki></code> intoand the page which is the preferred syntax on the Coppermind for creating line breaks<code><nowiki></code></nowiki></code>.
 
{| class="mw-collapsible mw-collapsed" width=100%
|
<pre>
// Adding a <br/code> button to the "main" section
$('#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"breakcode": {
label: 'Break tagCode',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/12/1323/Button_enterButton_code.png',
action: {
type: 'encapsulate',
options: {
pre: '<' + 'br /code>',
post: '</' + }'code>'
}
}
}
}
|}
 
==== Simple LinkColumns ====
SimplyEncases encasesyour thetext, highlightedwhich textshould withina bulleted (<code><nowiki>[[*</nowiki></code>) andor numbered (<code><nowiki>]]#</nowiki></code>) tolist, generateinside aof normalthe {{t|columns}} template to columnize the linklist.
 
{| class="mw-collapsible mw-collapsed" width=100%
|
<pre>
// Adding linkcolumns button to the "main" section
$('#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"linkcolumns": {
label: 'LinkColumns',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/92/9725/Button_int_linkVector_toolbar_bulleted_list_button.png',
action: {
type: 'encapsulate',
options: {
pre: "[["'{' + '{columns|' + '\n',
post: "]]"'\n' + '}}'
}
}
|}
 
==== ColumnsImage template ====
Pastes the {{t|image}} template onto the page, encapsulating your cursor or whatever you have highlighted.
Encases your text, which should a bulleted (<code><nowiki>*</nowiki></code>) or numbered (<code><nowiki>#</nowiki></code>) list, inside of the {{t|columns}} template to columnize the list.
 
For example, if you have <code><nowiki>Shallan.jpg</nowiki></code> highlighted when you press the button it will result in this: <code><nowiki>{{image|Shallan.jpg|side=|width=|caption}}</nowiki></code>
 
{| class="mw-collapsible mw-collapsed" width=100%
|
<pre>
// Adding columnsimage template button to the "main" section
$('#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"columnsimage": {
label: 'ColumnsImage template',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/2d/25d8/Vector_toolbar_bulleted_list_buttonVector_toolbar_insert_image_button.png',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{columnsimage|' + '\n',
post: '\n' + post: '|side=|width=|caption}}'
}
}
}
}
}
|}
 
==== <nowiki><code></nowiki>Simple Link ====
EncasesSimply yourencases the highlighted text betweenwithin <code><nowiki><code>[[</nowiki></code> and <code><nowiki></code>]]</nowiki></code> to generate a normal link.
 
{| class="mw-collapsible mw-collapsed" width=100%
|
<pre>
// Adding a <code>link button to the "main" section
$('#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"codelink": {
label: 'CodeLink',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/29/2397/Button_codeButton_int_link.png',
action: {
type: 'encapsulate',
options: {
pre: '<' + 'code>'"[[",
post: '</' + 'code>'"]]"
}
}
}
}
});
</pre>
|}
 
==== Wikipedia Link ====
Pastes <code><nowiki>[[Wikipedia:</nowiki></code> and <code><nowiki>|]]</nowiki></code> around your highlighted text. This generates a link to that Wikipedia page and hides the prefix. For example, if you highlight <code>Brandon Sanderson</code> and click this button it will generate this: <code><nowiki>[[Wikipedia:Brandon Sanderson|]]</nowiki></code> which produces [[Wikipedia:Brandon Sanderson|Brandon Sanderson]] on the page.
 
{| class="mw-collapsible mw-collapsed" width=100%
|-
|-
<pre>
// Adding imageWikipedia templatelink button to the "main" section
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"imagewikipedia": {
label: 'Image templateWikipedia',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/dc/d8cb/Vector_toolbar_insert_image_buttonButton_wikipedia.png',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{image|'"[[Wikipedia:",
post: '"|side=|width=|caption}}']]"
}
}
}
}
Autopatrolled, Editors
8,718

edits