Autopatrolled, Editors
8,718
edits
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).
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 ====
|}
====
{| class="mw-collapsible mw-collapsed" width=100%
|
<pre>
// Adding
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"
label: '
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/
action: {
type: 'encapsulate',
options: {
pre:
}
}
|}
====
Pastes <code><nowiki>[[
{| class="mw-collapsible mw-collapsed" width=100%
|
<pre>
//
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"
label: '
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/
action: {
type: 'encapsulate',
options: {
pre: "[[
post: "
}
}
|}
====
{| class="mw-collapsible mw-collapsed" width=100%
|
<pre>
// Adding a <
$('#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'main',
group: 'insert',
tools: {
post: '</' +
}▼
}
}
|}
====
{| class="mw-collapsible mw-collapsed" width=100%
|
<pre>
// Adding
$('#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"
label: '
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/
action: {
type: 'encapsulate',
options: {
pre:
post:
}
}
|}
====
▲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
$('#wpTextbox1'
section: 'main',
group: 'insert',
tools: {
"
▲ }
▲ }
}
}
|}
====
{| class="mw-collapsible mw-collapsed" width=100%
|
<pre>
// Adding
$('#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"
label: '
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/
action: {
type: 'encapsulate',
options: {
pre:
post:
}
}
▲ }
▲ }
▲ });
▲</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>
▲ $('#wpTextbox1').wikiEditor('addToToolbar', {
▲ section: 'main',
▲ group: 'insert',
▲ tools: {
▲ type: 'button',
▲ icon: '//upload.wikimedia.org/wikipedia/commons/
▲ action: {
▲ type: 'encapsulate',
▲ options: {
▲ }
}
}
}
|