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

m
no edit summary
m
 
(4 intermediate revisions by the same user not shown)
Changes you make to your [[Special:MyPage/common.js|common.js]] page only take effect after you save the page, so to check that the changes you have made worked you should save your [[Special:MyPage/common.js|common.js]] page and try to edit some other wiki page. If you see the default toolbar when you edit a page that means that your edits "broke" your toolbar. Consult the [[#General Guidelines|#general guidelines]] for help debugging your code.
 
If the changes you made are not working, or if you would like assistance creating your own toolbar you can DM <code>King of Herdaz#2300kingofherdaz</code> on Discord for help.
 
== Basic ==
group: 'insert',
tools: {
"code": {
label: 'Art infobox',
type: 'button',
group: 'insert',
tools: {
"artist-attribution"artistAttribution: {
label: 'Artist Attribution',
type: 'button',
group: 'insert',
tools: {
"artist-page"artistPage: {
label: 'Artist Page',
type: 'button',
group: 'insert',
tools: {
"break": {
label: 'Break tag',
type: 'button',
group: 'insert',
tools: {
"category": {
label: 'Category',
type: 'button',
group: 'insert',
tools: {
"code": {
label: 'Code',
type: 'button',
group: 'insert',
tools: {
"columns": {
label: 'Columns',
type: 'button',
group: 'insert',
tools: {
"hidden": {
label: 'Hidden text',
type: 'button',
group: 'insert',
tools: {
"image": {
label: 'Image template',
type: 'button',
group: 'insert',
tools: {
"link": {
label: 'Link',
type: 'button',
group: 'insert',
tools: {
"wikipedia": {
label: 'Wikipedia',
type: 'button',
|
<pre>
//Add new references dropdown to the "advanced" section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
groups: {
list: {
tools: {
references: {
label: 'referencesrefs',
type: 'select',
list: {
'book-ref': {
label: '{' + '{book ref}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{book ref|',
post: '}}'
}
}
},
'wob-ref': {
label: '{' + '{wob ref}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{wob ref|',
post: '}}'
}
}
},
'ref-plaintext': {
label: '{' + '{ref}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{ref|text=',
post: '}}'
}
}
},
'epigraph-ref': {
label: '{' + '{epigraph ref}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{epigraph ref|',
post: '}}'
}
}
},
'au-ref': {
label: '{' + '{au ref}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{au ref|',
post: '}}'
}
}
},
'msh-ref': {
label: '{' + '{msh ref}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{msh ref|',
post: '}}'
}
}
},
'tes-ref': {
label: '{' + '{tes ref}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{tes ref|',
post: '}}'
}
}
},
'file-ref': {
label: '{' + '{file ref}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{file ref|',
post: '}}'
}
}
},
'map-refmapref': {
label: '{' + '{map ref}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{map ref|',
post: '}}'
}
}
},
'url-ref': {
label: '{' + '{url ref}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{url ref|url=',
post: '|text=|date=|site=}}'
}
}
},
'17s-ref': {
label: '{' + '{17s ref}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{17s ref|topic/news/post',
post: '|id#|description|date=}}'
}
}
}
}
}
}
}
}
} );
</pre>
|}
|
<pre>
//Add new build-a-box dropdown to the "advanced" section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
groups: {
list: {
tools: {
simplecharacterinfobox: {
label: 'build-a-box',
type: 'select',
list: {
'start': {
label: '{' + '{character',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{character'
}
}
},
'residence': {
label: '|residence=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|residence='
}
}
},
'imageparam': {
label: '|image=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|image='
}
}
},
'profession': {
label: '|profession=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|profession='
}
}
},
'#profession': {
label: '|#profession=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|#profession='
}
}
},
'skills': {
label: '|skills=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|skills='
}
}
},
'species': {
label: '|species=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|species='
}
}
},
'abilities': {
label: '|abilities=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|abilities='
}
}
},
'ethnicity': {
label: '|ethnicity=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|ethnicity='
}
}
},
'born': {
label: '|born=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|born='
}
}
},
'died': {
label: '|died=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|died='
}
}
},
'nationality': {
label: '|nationality=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|nationality='
}
}
},
'bonded': {
label: '|bonded=',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|bonded='
}
}
}
}
}
}
}
}
} );
</pre>
|}
|
<pre>
//Add new infobox endings dropdown to the "advanced" section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
groups: {
list: {
tools: {
endings: {
label: 'ends',
type: 'select',
list: {
'sa': {
label: 'Stormlight',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|world=Roshar' + '\n' + '|universe=[[Cosmere]]' + '\n' + '|books=[[The Stormlight Archive]]' + '\n' + '}}'
}
}
},
'mbe1': {
label: 'MB Era 1',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|world=Scadrial' + '\n' + '|universe=[[Cosmere]]' + '\n' + '|books=[[Mistborn Era 1]]' + '\n' + '}}'
}
}
},
'mbe2': {
label: 'MB Era 2',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|world=Scadrial' + '\n' + '|universe=[[Cosmere]]' + '\n' + '|books=[[Mistborn Era 2]]' + '\n' + '}}'
}
}
},
'wb': {
label: 'Warbreaker',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|world=Nalthis' + '\n' + '|universe=[[Cosmere]]' + '\n' + '|books=[[Warbreaker]]' + '\n' + '}}'
}
}
},
'ela': {
label: 'Elantris',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|world=Sel' + '\n' + '|universe=[[Cosmere]]' + '\n' + '|books=[[Elantris (book)|Elantris]]' + '\n' + '}}'
}
}
},
'alc': {
label: 'Alcatraz',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|earth=Alcatraz' + '\n' + '|books=[[Alcatraz Versus the Evil Librarians (series)|Alcatraz Versus the Evil Librarians]]' + '\n' + '}}'
}
}
},
'ws': {
label: 'White Sand',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|world=Taldain' + '\n' + '|universe=[[Cosmere]]' + '\n' + '|books=[[White Sand]]' + '\n' + '}}'
}
}
},
'skywardfirst-born': {
label: 'SkywardFirstborn',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '|worldnation=High Empire' + '\n' + '|books=[[Firstborn]]' + '\n' + '}}',
}
post: '\n' + '|universe=[[Cytoverse]]' + '\n' + '|books=[[Skyward (series)]]' + '\n' + '}}'
}
},
} 'skyward': {
label: }'Skyward',
action: }{
type: 'encapsulate',
}
} options: {
pre: '\n' + '|world=',
}
post: '\n' + '|universe=[[Cytoverse]]' + '\n' + '|books=[[Skyward (series)]]' + '\n' + '}}'
} );
}
}
}
}
}
}
}
}
} );
</pre>
|}
|
<pre>
//Add new page ends dropdown to the "advanced" section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
groups: {
list: {
tools: {
bottoms: {
label: 'bottoms',
type: 'select',
list: {
'pagename': {
label: '{' + '{SUBST:PAGENAME}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '\'\'\'{' + '{SUBST:PAGENAME}}\'\'\''
}
}
},
'notessubpagename': {
label: '=={' Notes+ =='{SUBST:SUBPAGENAME}}',
action: {
type: 'encapsulate',
options: {
pre: '\n\n' + '==\'\'\'{' Notes+ =='{SUBST:SUBPAGENAME}}\'\'\''
}
}
},
'refsectionnotes': {
label: '<'== +Notes 'references/>==',
action: {
type: 'encapsulate',
options: {
pre: '\n\n' + '<'== + 'referencesNotes />=='
}
}
},
'stubrefsection': {
label: '{<' + '{stub}}references/>',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{<' + '{stub}}references />'
}
}
},
'partialstub': {
label: '{' + '{partialstub}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{partialstub}}'
}
}
},
'completepartial': {
label: '{' + '{completepartial}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{completepartial}}'
}
}
},
'alcatrazcomplete': {
label: '{' + '{Alcatrazcomplete}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{Alcatrazcomplete}}'
}
}
},
'elantrisalcatraz': {
label: '{' + '{ElantrisAlcatraz}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{ElantrisAlcatraz}}'
}
}
},
'mbera1elantris': {
label: '{' + '{Mistborn|Era 1Elantris}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{Mistborn|Era 1Elantris}}'
}
}
},
'mbera2mbera1': {
label: '{' + '{Mistborn|Era 21}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{Mistborn|Era 21}}'
}
}
},
'reckonersmbera2': {
label: '{' + '{ReckonersMistborn|Era 2}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{ReckonersMistborn|Era 2}}'
}
}
},
'skyreckoners': {
label: '{' + '{SkywardReckoners}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{SkywardReckoners}}'
}
}
},
'stormlightsky': {
label: '{' + '{StormlightSkyward}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{StormlightSkyward}}'
}
}
},
'warbreakerstorm': {
label: '{' + '{WarbreakerStormlight}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{WarbreakerStormlight}}'
}
}
},
'whitesandwarbreaker': {
label: '{' + '{White SandWarbreaker}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{White SandWarbreaker}}'
}
}
},
} 'firstborn': {
label: '{' + '{Firstborn}}',
action: }{
type: 'encapsulate',
}
options: {
}
pre: '\n' + '{' + '{Firstborn}}'
} );
}
} },
'whitesand': {
label: '{' + '{White Sand}}',
action: {
type: 'encapsulate',
options: {
pre: '\n' + '{' + '{White Sand}}'
}
}
}
}
}
}
}
}
} );
</pre>
|}
//These next two reference templates are very long so they are done differently
{
'action': {
'type': 'encapsulate',
options: {
pre: '{' + '{url ref|url=',
}
},
'label': '{' + '{url ref}}'
},
{
'action': {
'type': 'encapsulate',
options: {
pre: '{' + '{17s ref|topic/news/post',
group: 'BBBB',
tools: {
"CCCC": {
label: 'DDDD',
type: 'button',
type: 'select',
list: {
'WWWW': {
label: 'XXXX',
action: {
<pre>
},
'WWWW': {
label: 'XXXX',
action: {
<pre>
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'AAAA': {
'type': 'toolbar',
'label': 'BBBB'
}
}
<pre>
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'section':: 'CCCC',
'groups': {
'DDDD': {
'label': 'EEEE'
}
}
//Optional description
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'AAAA': {
'type': 'booklet',
'label': 'BBBB',
'pages': {
</pre>
 
<pre>
//Optional description
'section-CCCC': {
'label': 'DDDD',
'layout': 'characters',
'characters': [
</pre>
 
<pre>
{
'action': {
'type': 'encapsulate',
'options': {
'pre': 'XXXX',
'post': 'YYYY'
}
},
'label': 'ZZZZ'
},
</pre>
//Remove the default <ref> button
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
'section':: 'main',
'group':: 'insert',
'tool':: 'reference'
});</pre>
|}
//remove the bulleted list button
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
'section':: 'advanced',
'group':: 'format',
'tool':: 'ulist'
});</pre>
|}
//remove the numbered list button
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
'section':: 'advanced',
'group':: 'format',
'tool':: 'olist'
});</pre>
|}
//remove the default <br> button (to replace it with a <br/> button which is preferred on the Coppermind)
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
'section':: 'advanced',
'group':: 'format',
'tool':: 'newline'
});</pre>
|}
//remove table button
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
'section':: 'advanced',
'group':: 'insert',
'tool':: 'table'
});</pre>
|}
//remove File button
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
'section':: 'main',
'group':: 'insert',
'tool':: 'file'
});</pre>
|}
//remove original link button
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
'section':: 'main',
'group':: 'insert',
'tool':: 'link'
});</pre>
|}
<pre>
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
'section':: 'XXXX',
'group':: 'YYYY',
'tool':: 'ZZZZ'
});</pre>
|}
Autopatrolled, Editors
8,718

edits