Diferencia entre revisiones de «Usuario:King of Herdaz/common.js»

m
sin resumen de edición
m (test)
m
 
(No se muestran 17 ediciones intermedias del mismo usuario)
var customizeToolbar = function() {
/* Your code goes here */
 
//add new section to editing toolbar
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
'sections': {
'useful-stuff': {
'type': 'booklet',
'label': 'Useful Stuff',
'pages': {
//Page of commonly used reference templates
'section-refs': {
'label': 'References',
'layout': 'characters',
'characters': [
'{' + '{book ref|}}',
'{' + '{wob ref|}}',
'{' + '{ref|text=}}',
'{' + '{epigraph ref|}}',
'{' + '{au ref|}}',
'{' + '{msh ref|}}',
'{' + '{tes ref|}}',
'{' + '{file ref|}}',
'{' + '{map ref|}}',
//These next two reference templates are very long so they are done differently
{
'action': {
'type': 'encapsulate',
options: {
pre: '{' + '{url ref|url=',
post: '|text=|date=|site=}}'
}
},
'label': '{' + '{url ref}}'
},
{
'action': {
'type': 'encapsulate',
options: {
pre: '{' + '{17s ref|topic/news/post',
post: '|id#|description|date=}}'
}
},
'label': '{' + '{17s ref}}'
},
]
},
//Page to quickly build character infoboxes
'section-Build-a-Box': {
'label': 'Build-a-Box',
'layout': 'characters',
'characters': [
'{' + '{character',
'\n' + '|image=',
'\n' + '|residence=',
'\n' + '|profession=',
'\n' + '|#profession=',
'\n' + '|species=',
'\n' + '|abilities=',
'\n' + '|ethnicity=',
'\n' + '|born=',
'\n' + '|died=',
'\n' + '|nationality=',
'\n' + '|residence=',
]
},
//Page of infobox endings
'section-end': {
'label': 'Endings',
'layout': 'characters',
'characters': [
'\n' + '|world=Scadrial',
'\n' + '|world=Roshar',
'\n' + '|world=Nalthis',
'\n' + '|world=Taldain',
'\n' + '|earth=Alcatraz',
'\n' + '|universe=[[Cosmere]]',
'\n' + '|books=[[Mistborn Era 1]]',
'\n' + '|books=[[Mistborn Era 2]]',
'\n' + '|books=[[The Stormlight Archive]]',
'\n' + '|books=[[Warbreaker]]',
//Alcatraz is very long so it has to be done differently
{
'action': {
'type': 'encapsulate',
'options': {
'pre': '\n' + '|books=[[Alcatraz Versus the Evil Librarians (series)|Alcatraz Versus the Evil Librarians]]'
}
},
'label': '|books=Alcatraz'
},
]
},
//Page of stuff to finish a page after making the infobox
'section-bottom': {
'label': 'Bottom of Page',
'layout': 'characters',
'characters': [
'\n' + '\'\'\'{' + '{SUBST:PAGENAME}}\'\'\'',
'\n\n' + '== Notes ==',
'\n' + '<' + 'references/>',
'\n' + '{' + '{stub}}',
'\n' + '{' + '{partial}}',
'\n' + '{' + '{complete}}',
'\n' + '{' + '{Alcatraz}}',
'\n' + '{' + '{Elantris}}',
'\n' + '{' + '{Mistborn|Era 1}}',
'\n' + '{' + '{Mistborn|Era 2}}',
'\n' + '{' + '{Reckoners}}',
'\n' + '{' + '{Skyward}}',
'\n' + '{' + '{Stormlight}}',
'\n' + '{' + '{Warbreaker}}',
'\n' + '{' + '{White Sand}}',
]
},
//page of other useful stuff
'section-tags': {
'label': 'Other Stuff',
'layout': 'characters',
'characters': [
'\n' + '{' + '{spoiler|sa4}}',
'\n' + '{' + '{update|sa4}}',
'\n' + '{' + '{demoted|sa4}}',
'{' + '{for|/Gallery|more images}}',
'\n' + '{' + '{columns|count=2|',
'<br/>',
'{' + '{expand}}',
'{' + '{cite}}',
'{' + '{clarify}}',
'{' + '{disputed}}',
'{' + '{delete}}',
'{' + '{move|}}',
'{' + '{merge|}}',
'{' + '{anchor|}}',
'{' + '{theory}}',
'{' + '{uncanonical}}',
'{' + '{copyright}}',
{
'action': {
'type': 'encapsulate',
'options': {
'pre': '{' + '{cat tag|',
'post': '}}'
}
},
'label': '{' + '{cat tag|}}'
},
{
'action': {
'type': 'encapsulate',
'options': {
'pre': '{' + '{tag+|',
'post': '}}'
}
},
'label': '{' + '{tag+|}}'
},
{
'action': {
'type': 'encapsulate',
'options': {
'pre': '{' + '{tag|',
'post': '}}'
}
},
'label': '{' + '{tag|}}'
},
{
'action': {
'type': 'encapsulate',
'options': {
'pre': '<pre>',
'post': '</pre>'
}
},
'label': '<pre>'
},
{
'action': {
'type': 'encapsulate',
'options': {
'pre': '<code>',
'post': '</code>'
}
},
'label': '<code>'
},
{
'action': {
'type': 'encapsulate',
'options': {
'pre': '<strike>',
'post': '</strike>'
}
},
'label': '<strike>'
},
{
'action': {
'type': 'encapsulate',
'options': {
'pre': '<DynamicPageList>' + '\n' + 'mode=ordered' + '\n' + 'category=' + '\n' + 'notcategory=' + '\n' + 'namespace=' + '\n' + 'ordermethod=sortkey' + '\n' + 'order=ascending' + '\n' + '</DynamicPageList>'
}
},
'label': '<dynamicpagelist>'
},
'{' + '{for|:Category:Residents of {' + '{SUBST:PAGENAME}}|a full list see}}',
'{' + '{Special:PrefixIndex/{' + '{FULLPAGENAME}}/|stripprefix=1}}',
]
}
}
}
}
});
 
 
 
//END OF EXPERIMENTATION SECTION
 
 
//removing original buttons I don't want
'group': 'insert',
'tool': 'file'
});
 
//remove original link button
$( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
'section': 'main',
'group': 'insert',
'tool': 'link'
});
 
});
 
// Adding imageArtist templateheader button for galleries to the "main" section
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"imageArtist-header": {
label: 'ImageArtist templateheader',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/d3/d83a/Vector_toolbar_insert_image_buttonButton_av-img.png',
action: {
type: 'encapsulate',
options: {
pre: '| <small><center>by {' + '{imagea|',
post: '|side=|width=|caption}}</center></small>'
}
}
});
 
// Adding artistimage pagetemplate button to the "main" section
$('#wpTextbox1').wikiEditor('addToToolbar', {
section: 'main',
group: 'insert',
tools: {
"artist-pageimage": {
label: 'ArtistImage Pagetemplate',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/7d/76d8/Button_atelier_graphiqueVector_toolbar_insert_image_button.PNGpng',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{image|',
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}}'
post: '|side=|width=|caption}}'
}
}
pre: '<' + 'code>',
post: '</' + 'code>'
}
}
}
}
});
 
// 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/5/5a/Vector_toolbar_insert_picture_gallery_button.png',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{art' + '\n' + '|#artist=' + '\n' + '|series=' + '\n' + '|#source=',
post: '\n' + '|type=' + '\n' + '}}'
}
}
//Add new references dropdown to the "advanced" section
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
groups: {
list: {
tools: {
references: {
label: 'refs',
type: 'select',
list: {
options: {
pre: '{' + '{merge|',
post: '}}'
}
}
},
'anchor': {
label: '{' + '{anchor|}}',
action: {
type: 'encapsulate',
options: {
pre: '{' + '{anchor|',
post: '}}'
}
8718

ediciones