Usuario:King of Herdaz/common.js
< Usuario:King of Herdaz
Revisión del 15:20 8 mar 2021 de King of Herdaz (discusión | contribs.)
Nota: tras guardar, quizás necesites actualizar la caché de tu navegador para ver los cambios.
- Firefox/Safari: Mantén presionada la tecla Mayús mientras pulsas el botón Actualizar, o presiona Ctrl+F5 o Ctrl+R (⌘+R en Mac)
- Google Chrome: presiona Ctrl+Shift+R (⌘+Mayús+R en Mac)
- Internet Explorer: mantén presionada Ctrl mientras pulsas Actualizar, o presiona Ctrl+F5
- Opera: dirígete a Menú → Configuración (Opera → Preferencias en Mac) y luego a Privacidad y seguridad → Borrar datos de navegación → Imágenes y archivos en caché.
//change syntax highlighter timeout time ('//www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-DotsSyntaxHighlighter.js&action=raw&ctype=text/javascript'); syntaxHighlighterConfig = { timeout: 45, } //customize toolbar var customizeToolbar = function() { /* Your code goes here */ //removing original buttons I don't want //Remove default references button $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'reference' }); //remove bulleted list button $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'advanced', 'group': 'format', 'tool': 'ulist' }); //remove numbered list button $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'advanced', 'group': 'format', 'tool': 'olist' }); //remove <br> button so I can replace it with my own <br/> button $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'advanced', 'group': 'format', 'tool': 'newline' }); //remove table button $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'advanced', 'group': 'insert', 'tool': 'table' }); //remove File button $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'file' }); //remove original link button $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', { 'section': 'main', 'group': 'insert', 'tool': 'link' }); //Adding various buttons // Adding category button to the "main" section $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'insert', tools: { "category": { label: 'Category', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/2/2d/Button_clipboard_category.png', action: { type: 'encapsulate', options: { pre: "[[Category: ", post: "]]" } } } } }); // Adding image template button to the "main" section $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'insert', tools: { "category": { 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}}' } } } } }); // Adding Wikipedia link button to the "main" section $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'insert', tools: { "category": { label: 'Wikipedia', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/c/cb/Button_wikipedia.png', action: { type: 'encapsulate', options: { pre: "[[Wikipedia: ", post: "|]]" } } } } }); // Adding signature button to the "main" section $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'format', tools: { "category": { label: 'Signature', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/6/6d/Button_sig.png', action: { type: 'encapsulate', options: { pre: '~~' + '~~' } } } } }); // Adding <br/> button to the "main" section $('#wpTextbox1').wikiEditor('addToToolbar', { section: 'main', group: 'insert', tools: { "category": { label: 'Break tag', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/1/13/Button_enter.png', action: { type: 'encapsulate', options: { pre: '<' + 'br /', } } } } }); // Adding link button to the "main" section $('#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'main', group: 'format', tools: { "comment": { label: 'Link', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/9/97/Button_int_link.png', action: { type: 'encapsulate', options: { pre: "[[", post: "]]" } } } } }); // Adding hidden text button to the "main" section $('#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'main', group: 'format', tools: { "comment": { label: 'Hidden text', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/1/1b/Button_hide_wiki_tag.png', action: { type: 'encapsulate', options: { pre: "<!-- ", post: " -->" } } } } }); // Adding columns button to the "main" section $('#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'main', group: 'format', tools: { "comment": { label: 'Columns', type: 'button', icon: '//upload.wikimedia.org/wikipedia/commons/2/25/Vector_toolbar_bulleted_list_button.png', action: { type: 'encapsulate', options: { pre: '{' + '{columns|' + '\n', post: '\n' + '}}' } } } } }); //Adding a bunch of dropdowns to the "advanced" section for easy access //Add new references dropdown to the "advanced" section $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'advanced', groups: { list: { tools: { references: { label: 'refs', type: 'select', list: { 'book-button': { label: '{' + '{book ref}}', action: { type: 'encapsulate', options: { pre: '{' + '{book ref|', post: '}}' } } }, 'wob-button': { label: '{' + '{wob ref}}', action: { type: 'encapsulate', options: { pre: '{' + '{wob ref|', post: '}}' } } }, 'ref-button': { label: '{' + '{ref}}', action: { type: 'encapsulate', options: { pre: '{' + '{ref|text=', post: '}}' } } }, 'epigraph-button': { label: '{' + '{epigraph ref}}', action: { type: 'encapsulate', options: { pre: '{' + '{epigraph ref|', post: '}}' } } }, 'au-button': { label: '{' + '{au ref}}', action: { type: 'encapsulate', options: { pre: '{' + '{au ref|', post: '}}' } } }, 'msh-button': { label: '{' + '{msh ref}}', action: { type: 'encapsulate', options: { pre: '{' + '{msh ref|', post: '}}' } } }, 'file-button': { label: '{' + '{file ref}}', action: { type: 'encapsulate', options: { pre: '{' + '{file ref|', post: '}}' } } }, 'url-button': { label: '{' + '{url ref}}', action: { type: 'encapsulate', options: { pre: '{' + '{url ref|url=', post: '|text=|date=|site=}}' } } }, '17s-button': { label: '{' + '{17s ref}}', action: { type: 'encapsulate', options: { pre: '{' + '{17s ref|topic/news/post', post: '|id#|description|date=}}' } } } } } } } } } ); //Adding an infobox dropdown to the "advanced" section $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'advanced', groups: { list: { tools: { infoboxes: { label: 'infoboxes', type: 'select', list: { 'character-button': { label: '{' + '{character}}', action: { type: 'encapsulate', options: { pre: '{' + '{character' + '\n' + '|image=' + '\n' + '|unnamed=y' + '\n' + '|merge-family=y' + '\n' + '|parents=' + '\n' + '|spouse=' + '\n' + '|siblings=' + '\n' + '|children=' + '\n' + '|ancestors=' + '\n' + '|relatives=' + '\n' + '|descendants=' + '\n' + '|born=' + '\n' + '|died=' + '\n' + '|abilities=' + '\n' + '|bonded=' + '\n' + '|titles=' + '\n' + '|aliases=' + '\n' + '|skills=' + '\n' + '|achievements=' + '\n' + '|#profession=' + '\n' + '|profession=' + '\n' + '|occupation=' + '\n' + '|religion=' + '\n' + '|groups=' + '\n' + '|species=' + '\n' + '|era=' + '\n' + '|birthplace=' + '\n' + '|residence=' + '\n' + '|ethnicity=' + '\n' + '|nation=' + '\n' + '|nationality=', } } }, 'architecture-button': { label: '{' + '{architecture}}', action: { type: 'encapsulate', options: { pre: '{' + '{architecture' + '\n' + '|image=' + '\n' + '|owner= / owners=' + '\n' + '|usage=' + '\n' + '|era=' + '\n' + '|city=' + '\n' + '|state=' + '\n' + '|dominance=' + '\n' + '|princedom=' + '\n' + '|region=' + '\n' + '|nation=', } } }, 'business-button': { label: '{' + '{business}}', action: { type: 'encapsulate', options: { pre: '{' + '{business' + '\n' + '|image=' + '\n' + '|owner= / owners=' + '\n' + '|founder= / founders=' + '\n' + '|leader= / leaders=' + '\n' + '|members=' + '\n' + '|services=' + '\n' + '|era=' + '\n' + '|city=' + '\n' + '|nation=', } } }, 'culture-button': { label: '{' + '{culture}}', action: { type: 'encapsulate', options: { pre: '{' + '{culture' + '\n' + '|image=' + '\n' + '|related=' + '\n' + '|type=' + '\n' + '|era=' + '\n' + '|origin=', } } }, 'event-button': { label: '{' + '{event}}', action: { type: 'encapsulate', options: { pre: '{' + '{event' + '\n' + '|image=' + '\n' + '|partof=' + '\n' + '|date=' + '\n' + '|era=' + '\n' + '|participants=' + '\n' + '|effects=' + '\n' + '|city= / state= / region= / nation=' + '\n' + '|princedom= / dominance=' + '\n' + '|location=', } } }, 'food-button': { label: '{' + '{food}}', action: { type: 'encapsulate', options: { pre: '{' + '{food' + '\n' + '|image=' + '\n' + '|ingredients=' + '\n' + '|type=' + '\n' + '|taste=' + '\n' + '|origin=', } } }, 'geography-button': { label: '{' + '{geography}}', action: { type: 'encapsulate', options: { pre: '{' + '{geography' + '\n' + '|map= / |image=' + '\n' + '|type=' + '\n' + '|era=' + '\n' + '|region=', } } }, 'group-button': { label: '{' + '{group}}', action: { type: 'encapsulate', options: { pre: '{' + '{group' + '\n' + '|image=' + '\n' + '|founder= / founders=' + '\n' + '|leader= / leaders=' + '\n' + '|hq=' + '\n' + '|type=' + '\n' + '|era=', } } }, 'item-button': { label: '{' + '{item}}', action: { type: 'encapsulate', options: { pre: '{' + '{item' + '\n' + '|image=' + '\n' + '|owner= / owners=' + '\n' + '|creator= / creators=' + '\n' + '|type=' + '\n' + '|function=', } } }, 'lifeform-button': { label: '{' + '{lifeform}}', action: { type: 'encapsulate', options: { pre: '{' + '{lifeform' + '\n' + '|image=' + '\n' + '|type=' + '\n' + '|abilities=' + '\n' + '|use=' + '\n' + '|native=' + '\n' + '|sapient=y', } } }, 'settlement-button': { label: '{' + '{settlement}}', action: { type: 'encapsulate', options: { pre: '{' + '{settlement' + '\n' + '|map/image=' + '\n' + '|ruler=' + '\n' + '|occupied=' + '\n' + '|era=' + '\n' + '|state=' + '\n' + '|dominance=' + '\n' + '|princedom=' + '\n' + '|region=' + '\n' + '|nation=', } } }, 'location-button': { label: '{' + '{location}}', action: { type: 'encapsulate', options: { pre: '{' + '{location' + '\n' + '|map/image=' + '\n' + '|capital=' + '\n' + '|ruler=' + '\n' + '|occupied=' + '\n' + '|era=' + '\n' + '|city=' + '\n' + '|state=' + '\n' + '|dominance=' + '\n' + '|princedom=' + '\n' + '|region=' + '\n' + '|nation=', } } }, 'literature-button': { label: '{' + '{literature}}', action: { type: 'encapsulate', options: { pre: '{' + '{literature' + '\n' + '|image=' + '\n' + '|type=' + '\n' + '|author=' + '\n' + '|language=' + '\n' + '|era=', } } }, 'vehicle-button': { label: '{' + '{vehicle}}', action: { type: 'encapsulate', options: { pre: '{' + '{vehicle' + '\n' + '|image=' + '\n' + '|owner/owners=' + '\n' + '|creator/creators=' + '\n' + '|type=' + '\n' + '|captain=', } } } } } } } } } ); //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-button': { label: '{' + '{character', action: { type: 'encapsulate', options: { pre: '{' + '{character', } } }, 'residence-button': { label: '|residence=', action: { type: 'encapsulate', options: { pre: '\n' + '|residence=', } } }, 'profession-button': { label: '|profession=', action: { type: 'encapsulate', options: { pre: '\n' + '|profession=', } } }, '#profession-button': { label: '|#profession=', action: { type: 'encapsulate', options: { pre: '\n' + '|#profession=', } } }, 'species-button': { label: '|species=', action: { type: 'encapsulate', options: { pre: '\n' + '|species=', } } }, 'abilities-button': { label: '|abilities=', action: { type: 'encapsulate', options: { pre: '\n' + '|abilities=', } } }, 'ethnicity-button': { label: '|ethnicity=', action: { type: 'encapsulate', options: { pre: '\n' + '|ethnicity=', } } }, 'born-button': { label: '|born=', action: { type: 'encapsulate', options: { pre: '\n' + '|born=', } } }, 'died-button': { label: '|died=', action: { type: 'encapsulate', options: { pre: '\n' + '|died=', } } }, 'nationality-button': { label: '|nationality=', action: { type: 'encapsulate', options: { pre: '\n' + '|nationality=', } } }, 'imageparam-button': { label: '|image=', action: { type: 'encapsulate', options: { pre: '\n' + '|image=', } } }, 'bonded-button': { label: '|bonded=', action: { type: 'encapsulate', options: { pre: '\n' + '|bonded=', } } } } } } } } } ); //Add new infobox endings dropdown to the "advanced" section $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'advanced', groups: { list: { tools: { endings: { label: 'ends', type: 'select', list: { 'sa-button': { label: 'Stormlight', action: { type: 'encapsulate', options: { pre: '\n' + '|world=Roshar' + '\n' + '|universe=[[Cosmere]]' + '\n' + '|books=[[The Stormlight Archive]]' + '\n' + '}}', } } }, 'mbe1-button': { label: 'MB Era 1', action: { type: 'encapsulate', options: { pre: '\n' + '|world=Scadrial' + '\n' + '|universe=[[Cosmere]]' + '\n' + '|books=[[Mistborn Era 1]]' + '\n' + '}}', } } }, 'mbe2-button': { label: 'MB Era 2', action: { type: 'encapsulate', options: { pre: '\n' + '|world=Scadrial' + '\n' + '|universe=[[Cosmere]]' + '\n' + '|books=[[Mistborn Era 2]]' + '\n' + '}}', } } }, 'wb-button': { label: 'Warbreaker', action: { type: 'encapsulate', options: { pre: '\n' + '|world=Nalthis' + '\n' + '|universe=[[Cosmere]]' + '\n' + '|books=[[Warbreaker]]' + '\n' + '}}', } } }, 'alc-button': { 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-button': { label: 'White Sand', action: { type: 'encapsulate', options: { pre: '\n' + '|world=Taldain' + '\n' + '|universe=[[Cosmere]]' + '\n' + '|books=[[White Sand]]' + '\n' + '}}', } } }, 'skyward-button': { label: 'Skyward', action: { type: 'encapsulate', options: { pre: '\n' + '|world=' + '\n' + '|universe=[[Cytoverse]]' + '\n' + '|books=[[Skyward (series)]]' + '\n' + '}}', } } } } } } } } } ); //Add new page ends dropdown to the "advanced" section $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'advanced', groups: { list: { tools: { bottoms: { label: 'bottoms', type: 'select', list: { 'pagename-button': { label: '{' + '{SUBST:PAGENAME}}', action: { type: 'encapsulate', options: { pre: '\n' + '\'\'\'{' + '{SUBST:PAGENAME}}\'\'\'', } } }, 'notes-button': { label: '== Notes ==', action: { type: 'encapsulate', options: { pre: '\n\n' + '== Notes ==', } } }, 'refsection-button': { label: '<' + 'references/>', action: { type: 'encapsulate', options: { pre: '\n' + '<' + 'references />', } } }, 'stub-button': { label: '{' + '{stub}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{stub}}', } } }, 'partial-button': { label: '{' + '{partial}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{partial}}', } } }, 'complete-button': { label: '{' + '{complete}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{complete}}', } } }, 'alcatraz-button': { label: '{' + '{Alcatraz}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{Alcatraz}}', } } }, 'elantris-button': { label: '{' + '{Elantris}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{Elantris}}', } } }, 'mbera1-button': { label: '{' + '{Mistborn|Era 1}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{Mistborn|Era 1}}', } } }, 'mbera2-button': { label: '{' + '{Mistborn|Era 2}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{Mistborn|Era 2}}', } } }, 'reckoners-button': { label: '{' + '{Reckoners}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{Reckoners}}', } } }, 'sky-button': { label: '{' + '{Skyward}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{Skyward}}', } } }, 'storm-button': { label: '{' + '{Stormlight}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{Stormlight}}', } } }, 'warbreaker-button': { label: '{' + '{Warbreaker}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{Warbreaker}}', } } }, 'whitesand-button': { label: '{' + '{White Sand}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{White Sand}}', } } } } } } } } } ); //Add new art dropdown to the "advanced" section $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'advanced', groups: { list: { tools: { art: { label: 'art', type: 'select', list: { 'artistbox-button': { label: '{' + '{artist}}', action: { type: 'encapsulate', options: { 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', } } }, 'gallerysubpage-button': { label: 'gallery subpage', action: { type: 'encapsulate', options: { pre: '== Official artwork ==' + '\n' + '<' + 'gallery mode="packed" heights=200px caption="Official artwork">' + '\n' + '\n' + '</gallery>' + '\n' + '\n' + '== Portraits ==' + '\n' + '<' + 'gallery mode="packed" heights=200px caption="Portraits">' + '\n' + '\n' + '</gallery>' + '\n' + '\n' + '== Scenes ==' + '\n' + '<' + 'gallery mode="packed" heights=200px caption="Scenes">' + '\n' + '\n' + '</gallery>' + '\n' + '\n' + '[' + '[Category:Gallery Subpages]]', } } }, 'artbox-button': { label: '{' + '{art}}', action: { type: 'encapsulate', options: { pre: '{' + '{art' + '\n' + '|#artist=' + '\n' + '|series=' + '\n' + '|#source=', post: '\n' + '|type=' + '\n' + '}}' } } }, 'artistheading-button': { label: 'artist header', action: { type: 'encapsulate', options: { pre: '<small><center>by {' + '{a|', post: '}}</center></small>' } } }, 'bookcovercat-button': { label: '{' + '{cat tag|Books|book cover}}', action: { type: 'encapsulate', options: { pre: '{' + '{cat tag|Books|book cover}}', } } }, 'charactercat-button': { label: '{' + '{cat tag|Character images}}', action: { type: 'encapsulate', options: { pre: '{' + '{cat tag|Character images}}', } } }, 'artcat-button': { label: '{' + '{cat tag|Art}}', action: { type: 'encapsulate', options: { pre: '{' + '{cat tag|Art}}', } } }, 'interiorartcat-button': { label: '{' + '{cat tag|Interior art}}', action: { type: 'encapsulate', options: { pre: '{' + '{cat tag|Interior art}}', } } }, 'interiorartcat-button': { label: '{' + '{cat tag|Interior art}}', action: { type: 'encapsulate', options: { pre: '{' + '{cat tag|Interior art}}', } } }, 'officialart-button': { label: '|official=y', action: { type: 'encapsulate', options: { pre: '|official=y' + '\n', } } }, 'tracer-button': { label: '|tracer=', action: { type: 'encapsulate', options: { pre: '\n' + '|tracer=', } } }, 'modified-button': { label: '|modified=', action: { type: 'encapsulate', options: { pre: '\n' + '|modified=', } } }, 'bookparam-button': { label: '|book=', action: { type: 'encapsulate', options: { pre: '\n' + '|book=', } } }, 'email-button': { label: 'Email', action: { type: 'encapsulate', options: { pre: '[mailto:', post: ' Email]' } } }, 'clearright-button': { label: 'clear:right', action: { type: 'encapsulate', options: { pre: '<br style="clear:right;"/>', } } }, 'galleryheader-button': { label: 'gallery header', action: { type: 'encapsulate', options: { pre: '<' + 'gallery caption="Gallery" mode="packed" heights=200px>' + '\n', } } }, 'endgallery-button': { label: '</gallery>', action: { type: 'encapsulate', options: { pre: '</gallery>', } } } } } } } } } ); //Add new dropdown of commonly used tags to the "advanced" section $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'advanced', groups: { list: { tools: { tags: { label: 'tags', type: 'select', list: { 'cattag-button': { label: '{' + '{cat tag|}}', action: { type: 'encapsulate', options: { pre: '{' + '{cat tag|', post: '}}' } } }, 'tagplus-button': { label: '{' + '{tag+|}}', action: { type: 'encapsulate', options: { pre: '{' + '{tag+|', post: '}}' } } }, 'tag-button': { label: '{' + '{tag|}}', action: { type: 'encapsulate', options: { pre: '{' + '{tag|', post: '}}' } } }, 'move-button': { label: '{' + '{move|}}', action: { type: 'encapsulate', options: { pre: '{' + '{move|', post: '}}' } } }, 'merge-button': { label: '{' + '{merge|}}', action: { type: 'encapsulate', options: { pre: '{' + '{merge|', post: '}}' } } }, 'delete-button': { label: '{' + '{delete}}', action: { type: 'encapsulate', options: { pre: '{' + '{delete}}', } } }, 'cite-button': { label: '{' + '{cite}}', action: { type: 'encapsulate', options: { pre: '{' + '{cite}}', } } }, 'theory-button': { label: '{' + '{theory}}', action: { type: 'encapsulate', options: { pre: '{' + '{theory}}', } } }, 'disputed-button': { label: '{' + '{disputed}}', action: { type: 'encapsulate', options: { pre: '{' + '{disputed}}', } } }, 'expand-button': { label: '{' + '{expand}}', action: { type: 'encapsulate', options: { pre: '{' + '{expand}}', } } }, 'clarify-button': { label: '{' + '{clarify}}', action: { type: 'encapsulate', options: { pre: '{' + '{clarify}}', } } }, 'uncanonical-button': { label: '{' + '{uncanonical}}', action: { type: 'encapsulate', options: { pre: '{' + '{uncanonical}}', } } }, 'copyright-button': { label: '{' + '{copyright}}', action: { type: 'encapsulate', options: { pre: '{' + '{copyright}}', } } } } } } } } } ); //Add new dropdown for other stuff to the "advanced" section $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'advanced', groups: { list: { tools: { references: { label: 'other', type: 'select', list: { 'for-button': { label: '{' + '{for|', action: { type: 'encapsulate', options: { pre: '{{for|', } } }, 'spoiler-button': { label: '{' + '{spoiler|sa4}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{spoiler|sa4}}', } } }, 'update-button': { label: '{' + '{update|sa4}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{update|sa4}}', } } }, 'demoted-button': { label: '{' + '{demoted|sa4}}', action: { type: 'encapsulate', options: { pre: '\n' + '{' + '{demoted|sa4}}', } } }, 'forgallery-button': { label: '{' + '{for|/' + 'Gallery', action: { type: 'encapsulate', options: { pre: '{' + '{for|/Gallery|more images}}', } } }, 'roshardate-button': { label: '{' + '{rosharan date}}', action: { type: 'encapsulate', options: { pre: '{' + '{rosharan date|', post: '}}' } } }, 'pre-button': { label: '<pre>', action: { type: 'encapsulate', options: { pre: '<pre>', post: '</pre>' } } }, 'code-button': { label: '<code>', action: { type: 'encapsulate', options: { pre: '<code>', post: '</code>' } } }, 'dpl-button': { label: '<dynamicpagelist>', action: { type: 'encapsulate', options: { pre: '<DynamicPageList>' + '\n' + 'mode=ordered' + '\n' + 'category=' + '\n' + 'notcategory=' + '\n' + 'namespace=' + '\n' + 'ordermethod=sortkey' + '\n' + 'order=ascending' + '\n' + '</DynamicPageList>', } } }, 'forresidents-button': { label: '{' + '{for|Residents', action: { type: 'encapsulate', options: { pre: '{' + '{for|:Category:Residents of {' + '{SUBST:PAGENAME}}|a full list see}}', } } }, 'prefixindex-button': { label: 'PrefixIndex', action: { type: 'encapsulate', options: { pre: '{' + '{Special:PrefixIndex/{' + '{FULLPAGENAME}}/|stripprefix=1}}', } } } } } } } } } ); //Add new broadsheet citations dropdown to the "advanced" section $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', { section: 'advanced', groups: { list: { tools: { broadsheets: { label: 'broadsheets', type: 'select', list: { 'elendel-button': { label: 'Elendel', action: { type: 'encapsulate', options: { pre: '{' + '{file ref|Elendel_Daily_broadsheet.png|\'\'The Elendel Daily\'\' Broadsheet}}', } } }, 'house-button': { label: 'House', action: { type: 'encapsulate', options: { pre: '{' + '{file ref|House_Record_broadsheet.jpg|\'\'The House Record\'\' Broadsheet}}', } } }, 'ascendency-button': { label: 'Ascendency', action: { type: 'encapsulate', options: { pre: '{' + '{file ref|New_Ascendancy_broadsheet.jpg|\'\'The New Ascendency\'\' Broadsheet}}', } } } } } } } } } ); }; /* * Check if view is in edit mode and that the required modules are available. Then, customize the toolbar... * Don't touch below this line! */ if (['edit', 'submit'].indexOf(mw.config.get('wgAction')) !== -1) { mw.loader.using('user.options').then(function() { // This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]]) if (mw.user.options.get('usebetatoolbar') == 1) { $.when( mw.loader.using('ext.wikiEditor'), $.ready ).then(customizeToolbar); } }); }