MediaWiki:Common.js: Difference between revisions

From Wikizilla, the kaiju encyclopedia
Jump to navigationJump to search
No edit summary
No edit summary
 
(109 intermediate revisions by 4 users not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for users using the MonoBook skin */
/******************************************************************************************************************************/
/*<nowiki>*/
/** additional monobook scripts **/


/**** function displayTimer.js
/******************************************************************************************************************************/
* by Patrick Westerhoff [poke]
*/
addOnloadHook(function ()
{
  if ( typeof( timerDisplay ) !== 'undefined' && timerDisplay === false )
    return;
 
  var date;
  var timerParent = document.getElementById( 'p-personal' ).getElementsByTagName( 'ul' )[0];
  var timerLink  = document.createElement( 'a' );
  var timerObj    = document.createElement( 'li' );
  timerLink.href              = '/wiki/' + wgPageName + '?action=purge';
  timerLink.title              = 'Purge the server cache and update the contents of this page.'
  timerObj.id                  = 'pt-timer';
  timerObj.style.textTransform = 'none';
  timerObj.style.fontWeight    = 'bold';
  timerObj.style.fontSize      = '100%';
  timerObj.appendChild( timerLink );
  timerParent.insertBefore( timerObj, timerParent.firstChild );
 
  function actualizeUTC ()
  {
    timerDate          = new Date();
    timerLink.innerHTML = ( timerDate.getUTCHours()  < 10 ? '0' : '' ) + timerDate.getUTCHours()  + ':'
                        + ( timerDate.getUTCMinutes() < 10 ? '0' : '' ) + timerDate.getUTCMinutes() + ':'
                        + ( timerDate.getUTCSeconds() < 10 ? '0' : '' ) + timerDate.getUTCSeconds() + ' (UTC)';
  }
 
  function actualizeCustom ()
  {
    timerDate          = new Date();
    timerDate.setMinutes( timerDate.getMinutes() + timerDate.getTimezoneOffset() + timerTimezone * 60 );
    timerLink.innerHTML = ( timerDate.getHours()  < 10 ? '0' : '' ) + timerDate.getHours()  + ':'
                        + ( timerDate.getMinutes() < 10 ? '0' : '' ) + timerDate.getMinutes() + ':'
                        + ( timerDate.getSeconds() < 10 ? '0' : '' ) + timerDate.getSeconds()
                        + ' (UTC' + ( timerTimezone < 0 ? '' : '+' ) + timerTimezone + ')';
  }
 
  // start
  if ( typeof( timerTimezone ) !== 'number' )
  {
    actualizeUTC();
    setInterval( actualizeUTC, 1000 );
  }
  else
  {
    actualizeCustom();
    setInterval( actualizeCustom, 1000 );
  }
});
/*</nowiki>*/


/******************************************************************************************************************************/


/* MediaWiki:Monobook.js v2.39 <pre> */
/*********************************************************************** W I K I  E D I T O R B U T T O N S *******************/


/* alternateBG: Agrega un class al body durante los primeros 30 min de cada hora */
/************************************************ WikiEditor Buttons/Customization ********************************************/
(function () {
var d = new Date();
if (d.getMinutes() < 30) {
try {
document.body.className += ' alternateBG';
} catch(e) {
(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function(){$(document.body).addClass('alternateBG');});
}
}
}());
function FondoFooter() {
$('#globalWrapper').append($('#footer'));
}
(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(FondoFooter);
/* fin alternateBG */


/* MONOBOOK SIDEBAR */
/******************************************************************************************************************************/
// Para editar los elementos del sidebar, cambiar [[MediaWiki:Monobook.js/Sidebar.js]]
window.wgSidebar = (window.wgSidebar||{});
importScript('MediaWiki:Monobook.js/Sidebar.js');


/*
/******************************************************************************************************************************
* MonobookSidebar v1.2: Permite definir submenús para elementos del Sidebar de MonoBook, agregando clases
* Extra buttons in toolbar
* especiales al pasar con el puntero por encima para permitir el efecto en todos los navegadores.
* @stats [[File:Krinkle_InsertWikiEditorButton.js]]
*
******************************************************************************************************************************/
* Copyright (C) 2010 - 2014 Jesús Martínez Novo ([[User:Ciencia Al Poder]])
mw.loader.using('ext.wikiEditor', function() {
*
$.ajax({
* This program is free software; you can redistribute it and/or modify
url: 'https://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript',
*   it under the terms of the GNU General Public License as published by
dataType: 'script',
*   the Free Software Foundation; either version 2 of the License, or
cache: true
*   (at your option) any later version
}).done(function () {
*/
var MonobookSidebar = {
// REFERENCE with ID
re_s: / /g,
krInsertWikiEditorButton({
re_p: /%/g,
id: "mw-customeditbutton-refidbutton",
loadedMenus: [],
icon: "/w/images/9/97/Editor_Button_-_Reference.png",
init: function() {
label: 'Reference with ID',
if (!window.wgSidebar) return;
insertBefore: '<ref name="">[http://',
for (var menu in wgSidebar) {
insertAfter: ']</ref>',
var item = document.getElementById(MonobookSidebar.getId(menu));
sampleText: ''
if (!item) continue;
});
var menuId = $(item).parents().get(2).id;
// BOOK CITATION
// Check it's a valid portlet item
krInsertWikiEditorButton({
if (!menuId || menuId === '') continue;
id: "mw-customeditbutton-citebookbutton",
// Generate menu hierarchy
icon: "/w/images/7/73/Editor_Button_-_Reference_Book.png",
MonobookSidebar.buildSubmenu(item, wgSidebar[menu]);
label: 'Cite book',
// Set events
insertBefore: '<ref name="">{{cite book|title= |edition=!!OR!!|volume= |last= |first= |date= |publisher= |page=!!OR!!|pages= ',
MonobookSidebar.setEvents(menuId);
insertAfter: '|isbn=}}</ref>',
}
sampleText: '...not all parameters required.--see Template:Cite_book for documentation...'
},
});
buildSubmenu: function(el, arr) {
var ul = document.createElement('ul');
// WEB CITATION
ul.className = 'sub-menu';
krInsertWikiEditorButton({
for (var i = 0; i < arr.length; i++) {
id: "mw-customeditbutton-citewebbutton",
var li = document.createElement('li');
icon: "/w/images/3/38/Editor_Button_-_Reference_Website.png",
if (typeof arr[i] == 'string') {
label: 'Cite web',
li.appendChild(MonobookSidebar.linkFromText(arr[i]));
insertBefore: '<ref name="">{{cite web|url=|title=|first=|last=',
} else {
insertAfter: '|date=|work=|accessdate=|archiveurl=|archivedate=}}</ref>',
for (var menukey in arr[i]) {
sampleText: '...use |author= when first and last name are N/A'
li.appendChild(MonobookSidebar.linkFromText(menukey));
});
MonobookSidebar.buildSubmenu(li, arr[i][menukey]);
}
// CORRECT FORMAT GALLERY
}
krInsertWikiEditorButton({
ul.appendChild(li);
id: "mw-customeditbutton-gallerybutton",
}
icon: "/w/images/f/f6/Editor_Button_-_Correct_Gallery.png",
el.appendChild(ul);
label: 'Gallery',
el.className = 'with-sub-menu';
insertBefore: '<gallery widths="120" position="center" captionalign="center" spacing="small">\r',
var em = document.createElement('em');
insertAfter: '\r</gallery>',
em.appendChild(document.createTextNode('\u203A'));
sampleText: 'Test Image.png'
el.firstChild.appendChild(em);
});
},
setEvents: function(menuId) {
// YOUTUBE EMBED
for (var i = 0; i < MonobookSidebar.loadedMenus; i++) {
krInsertWikiEditorButton({
if (MonobookSidebar.loadedMenus[i] == menuId) return;
id: "mw-customeditbutton-youtubebutton",
}
icon: "/w/images/d/de/Editor_Button_-_YouTube.png",
$('#'+menuId).children().eq(1).children().eq(0).bind('mouseover',MonobookSidebar.mouseover).bind('mouseout',MonobookSidebar.mouseout);
label: 'YouTube embed',
MonobookSidebar.loadedMenus.push(menuId);
insertBefore: '<youtube width="300" height="169">',
},
insertAfter: '</youtube>',
mouseover: function(e) {
sampleText: '...Put YT video ID here; remove _width="300" height="169"_ to make default size ~ 300x169 is specifically for infoboxes and video galleries...'
var target = e.target;
});
while (target.tagName.toLowerCase() != 'div') {
if (target.tagName.toLowerCase() == 'a') {
// DAILYMOTION EMBED
target = target.parentNode;
krInsertWikiEditorButton({
}
id: "mw-customeditbutton-dailymotionbutton",
if (target.tagName.toLowerCase() == 'li') {
icon: "/w/images/8/8c/Editor_Button_-_Dailymotion.png",
$(target).addClass('hover');
label: 'Dailymotion embed',
}
insertBefore: '<dailymotion dimensions="300x149">',
target = target.parentNode;
insertAfter: '</dailymotion>',
}
sampleText: '...Put Dailymotion video ID here; remove _dimensions="300x149"_ to make default size ~ 300x149 is specifically for infoboxes and video galleries...'
},
});
mouseout: function(e) {
var target = e.target;
// NICONICO EMBED
while (target.tagName.toLowerCase() != 'div') {
krInsertWikiEditorButton({
if (target.tagName.toLowerCase() == 'a') {
id: "mw-customeditbutton-niconicobutton",
target = target.parentNode;
icon: "/w/images/2/24/Editor_Button_-_NicoVideo.png",
}
label: 'NicoVideo embed',
if (target.tagName.toLowerCase() == 'li') {
insertBefore: '<nicovideo width="299" height="165">',
$(target).removeClass('hover');
insertAfter: '</nicovideo>',
}
sampleText: '...Put Nico Nico video ID here; remove _width="299" height="165"_ to make default size ~ 299x165 is specifically for infoboxes and video galleries...'
target = target.parentNode;
});
}
},
// TABBER
linkFromText: function(txt) {
krInsertWikiEditorButton({
var article = '', caption = '', sepPos = txt.indexOf('|');
id: "mw-customeditbutton-infoboxtabberbutton",
if (sepPos > 0) {
icon: "/w/images/0/08/Editor_Button_-_Tabber.png",
article = txt.substr(0, sepPos);
label: 'Tabber',
caption = txt.substr(sepPos+1);
insertBefore: '<tabs style="color:black; padding: 0px; margin: 0px;">\r<tab name="NAMEHERE">[[File:|330px| in ]]</tab>\r',
} else {
insertAfter: '\r<tab name="NAMEHERE2">[[File:|330px| in ]]</tab>\r</tabs>',
article = caption = txt;
sampleText: '<!---- add multiple tabs by copy pasting and changing the values ---- to replace the infobox image with a tabber, change |image = with |altimage = ---->'
}
});
var a = document.createElement('a');
if (article.length > 7 && article.substr(0,7) == 'http://') {
// DVD INFO
a.setAttribute('href',article);
krInsertWikiEditorButton({
} else {
id: "mw-customeditbutton-dvdbutton",
a.setAttribute('href', mw.util.getUrl(article));
icon: "/w/images/4/4f/Editor_Button_-_DVD_Info.png",
}
label: 'Insert DVD information',
a.appendChild(document.createTextNode(caption));
insertBefore: '\'\'\'COMPANY\'\'\' VHS[or]LaserDisc[or]Blu-ray[or]DVD (YEAR) [collection]<ref name="">[http:// Amazon.com: ]</ref>\r*\'\'\'Region:\'\'\' \r*\'\'\'Discs:\'\'\' \r*\'\'\'SRP:\'\'\' $\r*\'\'\'Audio:\'\'\' \r*\'\'\'Subtitles:\'\'\' \r*\'\'\'Special features:\'\'\' \r*\'\'\'Notes:\'\'\' ',
return a;
insertAfter: '',
},
sampleText: ''
getId: function(name) {
});
return 'n-' + encodeURIComponent(name.replace(MonobookSidebar.re_s, '-')).replace(MonobookSidebar.re_p, '.');
}
// STAFF and CAST Information
};
krInsertWikiEditorButton({
 
id: "mw-customeditbutton-staffcastbutton",
// Mueve cambios recientes a toolbox
icon: "/w/images/e/eb/Editor_Button_-_Staff_and_Cast.png",
function PosicionaElementosToolbox() {
label: 'Insert Staff and Cast information',
$('#p-tb').children().eq(1).children().eq(0)
insertBefore: '==Staff==\r{{Staffs\r',
// Opciones en páginas de usuario
insertAfter: '|Directed by=[[\r|Written by=\r|Based on a story by=\r|Executive producer=\r|Co-executive producer=\r|Produced by=\r|Assistant producer=\r|Music by=\r|Stock music by=\r|Cinematography by=\r|Edited by=\r|Production design by=\r|1st assistant director=\r|Director of special effects=\r|1st assistant director of special effects=\r|Visual effects supervisor=\r}}\r==Cast==\r{{Cast\r||\r||\r||\r||\r||\r||\r||\r||\r||\r||\r||\r}}',
.prepend($('#t-emailuser'))
sampleText: 'Vertical bars can replace equals signs for custom staff positions, but all subsequent equals signs must also be replaced to stay organized properly\r'
.prepend($('#t-blockip'))
});
.prepend($('#t-log'))
.prepend($('#t-contributions'))
// FILM Tab and Nav
// 'Enlace permanente' y 'Versión para imprimir'
krInsertWikiEditorButton({
.prepend($('#t-permalink'))
id: "mw-customeditbutton-filmtabnavbutton",
.prepend($('#t-print'))
icon: "/w/images/9/95/Editor_Button_-_Nav.png",
// Opciones principales
label: 'Tab and navigation (film)',
.prepend($('#t-specialpages'))
insertBefore: '{{Tab}}\r{{Nav\r|type1      =\r|type2      =\r|type        =[[:Category:|Category:]]\r|name        =\r|prev        =\r|prevname    =\r|next        =\r|nextname    =\r}}',
.prepend($('#t-recentchangeslinked'))
insertAfter: '',
.prepend($('#t-whatlinkshere'))
sampleText: ''
.prepend($('#t-multiupload'))
});
.prepend($('#t-upload'))
.prepend($('#n-randompage'))
.prepend($('#t-googlesearch'))
// INFOBOX KAIJU
.prepend($('#n-recentchanges'));
krInsertWikiEditorButton({
 
id: "mw-customeditbutton-infoboxkaijubutton",
if ($('#t-multiupload').length === 0 && $('#t-upload').length == 1) {
icon: "/w/images/b/b8/Editor_Button_-_Infobox_Kaiju.png",
$('<li id="t-multiupload"><a href="/wiki/Special:MultipleUpload">Upload multiple files</a></li>').insertAfter('#t-upload');
label: 'Kaiju infobox',
}
insertBefore: '{{Kaiju Infobox\r|type1            =???\r|type2            =???\r|copyrighticon    =\r|image            =\r|caption          =\r|name            =\r|nicknames        =\r|subtitle        =\r|species          =\r|height          =?? meters\r|length          =?? meters\r|wingspan        =?? meters\r|weight          =?? tons\r|stat1            =?? meters|1=\r|stat2            =?? meters|2=\r|stat3            =?? meters|3=\r|forms            =\r|allies          =\r|enemies          =\r|originplace      =\r|relationships    =\r|controlled      =\r|conceived        =\r|written          =\r|designed        =\r|modeled          =\r|portrayed        =\r|debut            =\r|last            =\r|suits            =\r|roar            =[[File:.ogg|180px|center|noicon]]{{More Roars}}\r}}',
 
insertAfter: '',
$('#t-contributions').before('<hr style="margin: 5px; margin-bottom: -1px; background-color: #E2A600;" />');
sampleText: ''
$('#t-print').before('<hr style="margin: 5px; margin-bottom: -1px; background-color: #E2A600;" />');
});
$('#t-upload').before('<hr style="margin: 5px; margin-bottom: -1px; background-color: #E2A600;" />');
$('#t-whatlinkshere').before('<hr style="margin: 5px; margin-bottom: -1px; background-color: #E2A600;" />');
// INFOBOX FILM
 
krInsertWikiEditorButton({
// wikicities
id: "mw-customeditbutton-infoboxfilmbutton",
$('#p-wikicities-nav').children('div').eq(0).children('hr').eq(0).next('ul').eq(0).children('li').eq(0).attr('id','n-activityfeed');
icon: "/w/images/6/68/Editor_Button_-_Infobox_Film.png",
$('#n-activityfeed').children('a').eq(0).text('Actividad reciente').attr('href','/wiki/Special:RecentChanges');
label: 'Film infobox',
$('#p-lang').before($('#p-wikicities-nav'));
insertBefore: '{{Infobox Film\r|type1        =\r|type2        =\r|image        =\r|caption      =The Japanese poster for \r|name        =\r|us-title    =\r|jp-title    =\r|director    =[[\r|producer    =[[\r|writer      =[[\r|composer    =[[\r|produced    =[[\r|distributor  =[[Toho]]{{sup|[[Japan|JP]]}}<br>[[]]{{sup|[[United States|US]]}}\r|rating      =\r|budget      =¥\r|gross        =¥\r|rentals      =¥\r|runtime      =?? minutes{{sup|[[Japan|JP]]}}<br>{{Small|(? hour, ?? minutes)}}<br />?? minutes{{sup|[[United States|US]]}}<br>{{Small|(? hour, ?? minutes)}}\r}}',
 
insertAfter: '',
}
sampleText: ''
(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(PosicionaElementosToolbox);
});
 
// UserWikiInfo
// INFOBOX VIDEO GAME
if ((mw.config.get('wgNamespaceNumber', 0) == -1 && mw.config.get('wgCanonicalSpecialPageName', '') == 'Contributions') || (mw.config.get('wgCanonicalNamespace', '') == 'User' || mw.config.get('wgCanonicalNamespace', '') == 'User_talk')) {
krInsertWikiEditorButton({
(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
id: "mw-customeditbutton-infoboxvideogamebutton",
if (!window.disableUserWikiInfo) {
icon: "/w/images/f/fb/Editor_Button_-_Infobox_Game.png",
mw.loader.using(['mediawiki.api'], function() {
label: 'Video game infobox',
importScript('MediaWiki:Common.js/Clases/UserWikiInfo.js');
insertBefore: '{{Infobox Game\r|type1        =\r|type2        =\r|header      =\r|image        =\r|caption      =\r|name        =\r|us-title    =\r|jp-title    =\r|publisher    =\r|developer    =\r|platforms    =\r|languages    =\r|genre        =\r}}',
});
insertAfter: '',
}
sampleText: ''
});
});
}
 
// INFOBOX BOOK
/* WMU en Monobook */
krInsertWikiEditorButton({
if (mw.config.get('wgAction', '') == 'edit' || mw.config.get('wgAction', '') == 'submit') {
id: "mw-customeditbutton-infoboxbookbutton",
/*GLOBAL WMU VARS*/
icon: "/w/images/7/70/Editor_Button_-_Infobox_Book.png",
window.wmu_back = "back";
label: 'Book infobox',
window.wmu_imagebutton = "Add images";
insertBefore: '{{Infobox Book\r|type1        =\r|type2        =\r|image        =\r|name        =\r|author      =\r|story        =\r|editor      =\r|writer      =\r|art          =\r|illustrator  =\r|pencils      =\r|inks        =\r|colors      =\r|cover        =\r|design      =\r|production  =\r|edits        =\r|letters      =\r|cc          =\r|publisher    =\r|publishdate  =\r|pages        =\r|size        =\r|genre        =\r|isbn        =[[Special:BookSources/|ISBN-10: ]]<br>[[Special:BookSources/|ISBN-13: ]]\r',
window.wmu_close = "close";
insertAfter: '\r}}',
window.wmu_no_preview = "Images can't be added from the page in preview mode";
sampleText: '!!!OR!!!\r|asin        ='
window.wmu_warn1 = "You should specify the text you want to look for";
});
window.wmu_warn2 = "Select the file you want to upload";
window.wmu_warn3 = "You must specify the name of the file first!";
// INFOBOX SOUNDTRACK
window.wmu_bad_extension = "This type of file is not allowed. Allowed extensions may be found in [[Special:Version]].";
krInsertWikiEditorButton({
window.wmu_show_message = "show message";
id: "mw-customeditbutton-infoboxsoundtrackbutton",
window.wmu_hide_message = "hide message";
icon: "/w/images/4/44/Editor_Button_-_Infobox_Soundtrack.png",
window.wmu_show_license_message = "show license";
label: 'Soundtrack infobox',
window.wmu_hide_license_message = "hide license";
insertBefore: '{{Infobox Soundtrack\r|type1              =\r|type2              =\r|name              =\r|image              =\r|composer          =\r|year              =\r|tracks            =\r|sample            =[[File:.ogg|180px|noicon]]\r}}',
window.wmu_max_thumb = "The maximum size of the thumbnail has been surpassed. It will now return to its original size.";
insertAfter: '',
importScript('MediaWiki:Common.js/Extra/WikiaWMU.js');
sampleText: ''
importStylesheetURI(mw.config.get('wgExtensionsPath')+'/wikia/WikiaMiniUpload/css/WMU.css?'+mw.config.get('wgStyleVersion'));
});
}
/* fin WMU en Monobook */
// INFOBOX SONG
 
krInsertWikiEditorButton({
// Añade un aviso al salir de una página cuando se está editando
id: "mw-customeditbutton-infoboxsongbutton",
var LeaveEditingWarning = (function() {
icon: "/w/images/1/17/Editor_Button_-_Infobox_Song.png",
var _MESSAGE = 'Hay cambios sin guardar que se perderán si abandonas esta página.',
label: 'Song infobox',
_enabled = false,
insertBefore: '{{Infobox Song\r|type1        =\r|type2        =\r|name        =\r|image        =',
_originalText = null,
insertAfter: '|composer    =\r|arranged    =\r|lyrics      =\r|performer    =\r|film        =\r|kaiju        =\r|sample      =[[File:.ogg|180px|noicon]]\r}}',
_forceWarn = false,
sampleText: '!!!OR!!!\r|video        =<youtube width="300" height="169">...Put YT video ID here; remove _width="300" height="169"_ to make default size ~ 300x169 is specifically for infoboxes and video galleries...</youtube>\r'
_triggerWarn = false,
});
_submit = false,
_timer = null,
// INFOBOX TV SHOW
_init = function() {
krInsertWikiEditorButton({
if (mw.config.get('wgAction') != 'submit') {
id: "mw-customeditbutton-infoboxtvshowbutton",
_originalText = $('#wpTextbox1').val();
icon: "/w/images/2/22/Editor_Button_-_Infobox_TV.png",
}
label: 'TV show infobox',
},
insertBefore: '{{Infobox Series\r|type1          =\r|type2          =\r|name          =\r|image          =\r|aired          =\r|director      =\r|producer      =\r|writer        =\r|composer      =\r|funded        =\r|produced      =',
_enable = function() {
insertAfter: '\r|channel        =\r|rating        =\r|genre          =\r|episodes      =\r}}',
if (_enabled) return;
sampleText: '\r|distributor    =<!-- Only when "channel" does not apply -->'
_enabled = true;
});
if (mw.config.get('wgAction') == 'submit') {
_forceWarn = true;
// INFOBOX EPISODE
} else {
krInsertWikiEditorButton({
$('#wpTextbox1').bind('change', _onInputChange);
id: "mw-customeditbutton-infoboxepisodebutton",
// El "change" solo se activa al salir del textbox. Comprobamos periódicamente
icon: "/w/images/f/f1/Editor_Button_-_Infobox_Episode.png",
window.setInterval(_onInputChange, 5000);
label: 'Episode infobox',
}
insertBefore: '{{Nav\r|type2          =\r|type1          =\r|type            ={{link|black|}} {{link|black|:Category: episodes|episodes}}\r|prev            =\r|prevname        =""\r|name            =""\r|next            =\r|nextname        =""\r}}\r{{Infobox Episode|ratings=yes\r|type1          =\r|type2          =\r|name            =""<!--\r|dt              =""-->\r|image          =\r|caption        =The title card of ""\r|series          =\r|episodeno      =\r|director        =\r|writer          =\r|specialfx      =\r|viewers        =\r|aired          =\r}}',
$('#editform').bind('submit', _onFormSubmit);
insertAfter: '',
$(window).bind('beforeunload.LeaveEditingWarning', _onBeforeUnload);
sampleText: ''
},
});
_disable = function() {
if (!_enabled) return;
// INFOBOX VEHICLE
_enabled = false;
krInsertWikiEditorButton({
_forceWarn = false;
id: "mw-customeditbutton-infoboxvehiclebutton",
_triggerWarn = false;
icon: "/w/images/d/d4/Editor_Button_-_Infobox_Weapon.png",
$('#editform').unbind('submit', _onFormSubmit);
label: 'Vehicle infobox',
$('#wpTextbox1').unbind('change', _onInputChange);
insertBefore: '{{Infobox Vehicle\r|type1          =\r|type2          =\r|name            =\r|image          =\r|nicknames      =\r|subtitle        =\r|height          =\r|length          =\r|wingspan        =\r|stat1          =|1=Width\r|stat2          =|2=Weight\r|info-misc      =\r|pilot          =\r|attach          =\r|launched        =\r|firstappearance =\r',
if (_timer) {
insertAfter: '\r}}',
window.clearInterval(_timer);
sampleText: '<!--- use |debut = and |last = if more than 1 appearance --->'
_timer = null;
});
}
$(window).unbind('beforeunload.LeaveEditingWarning');
},
_onFormSubmit = function(e) {
_submit = true;
},
_onInputChange = function(e) {
if (_originalText !== null && _originalText !== $('#wpTextbox1').val()) {
_triggerWarn = true;
} else {
_triggerWarn = false;
}
},
_onBeforeUnload = function() {
if (_timer) {
window.clearInterval(_timer);
_timer = null;
}
if (!_submit && (_forceWarn || _triggerWarn)) {
if (window.event) {
window.event.returnValue = _MESSAGE;
}
return _MESSAGE;
}
};
if (mw.config.get('wgAction') == 'edit' || mw.config.get('wgAction') == 'submit') {
// INFOBOX PERSON
(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(_init);
krInsertWikiEditorButton({
id: "mw-customeditbutton-infoboxpersonbutton",
icon: "/w/images/9/93/Editor_Button_-_Infobox_Real_Person.png",
label: 'Real person infobox',
insertBefore: '{{Infobox Person\r|type1          =\r|type2          =\r|name          =\r|image          =\r|caption        =\r|occupation    =\r|birthday      =\r|birthplace    =\r|death          =\r|deathplace    =\r|first          =\r|notable        =\r|imdb          =\r|wikipedia      =\r}}',
insertAfter: '',
sampleText: ''
});
if (!window.LeaveEditingWarning || window.LeaveEditingWarning.enabled !== false) {
// INFOBOX CHARACTER
(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(_enable);
krInsertWikiEditorButton({
}
id: "mw-customeditbutton-infoboxcharacterbutton",
}
icon: "/w/images/f/f6/Editor_Button_-_Infobox_Character.png",
label: 'Character infobox',
insertBefore: '{{Infobox Character\r|type1            =\r|type2            =\r|image            =\r|caption          =\r|name              =\r|species          =\r|aliases          =\r|nationality      =\r|relationships    =\r|occupation        =\r|affiliation      =\r|firstappearance  =\r',
insertAfter: '\r|played            =\r}}',
sampleText: '<!--- use |debut = and |last = if the character has more than 1 appearance --->'
});
return {
});
enable: _enable,
} );
disable: _disable
/**************************************************/
};
})();


/*************** END WikiEditor ******************/


// Wikia ha cambiado el texto del título de las imágenes. Restaurando...
/************************************************/
if (mw.config.get('wgNamespaceNumber') == 6) {
(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
$('#firstHeading').text(mw.config.get('wgPageName').replace(/_/g, ' '));
});
}
// Añade un 'span' que sirve para añadir una imagen de fondo a la barra de categorías
function ImagenCatlinks() {
$('#mw-normal-catlinks').before('<span id="catlinks-background-image">&nbsp;</span>');
}
(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(ImagenCatlinks);


(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
/** A fix for tables **/
if (!mw.config.get('wgNoWarnOnLogout', false)) {
$('#pt-logout').children().eq(0).bind('click', function() {
return confirm('Si continúas dejarás de estar identificado. Podrás volver a iniciar sesión en cualquier momento. ¿Deseas continuar?');
});
}
});


 
$(function() {
// PARCHE PARA WIKIA: Arreglar las sugerencias de búsqueda
  // Exclusion approach. Uncomment the line below to apply horizontal scrolling to all tables except those with the class `skip-responsive`
(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
  $('body:not(.ns--1) .mw-body-content table:not(.skip-responsive').wrap('<div class="responsive-table"></div>');
if (!mw.config.get('wgMWSuggestTemplate') && mw.loader.getVersion('mediawiki.legacy.mwsuggest')) {
mw.config.set('wgMWSuggestTemplate', mw.util.wikiScript('api') + '?action=opensearch&search={searchTerms}&namespace={namespaces}&suggest');
mw.config.set('wgSearchNamespaces', [0, 6, 10, 14, 110]);
importScriptURI(mw.config.get('stylepath') + '/common/mwsuggest.js');
window.setTimeout(function() {
if (window.os_MWSuggestInit) {
window.os_MWSuggestInit();
}
}, 1000);
}
});
});
/**
* MonobookSidebar: Sets sidebar submenus for elements of MonoBook, adding special
* classes to pass the pointer over to allow the effect on all browsers.
*
* Date: 15 October 2010
* Copyright © 2010 Jesús Martínez Novo ([[User:Ciencia Al Poder]])
*
* This program is free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version
*/
MonobookSidebar = {
re_s: / /g,
re_p: /%/g,
loadedMenus: [],
init: function() {
if ( !window.wgSidebar ) {
return;
}
for ( var menu in wgSidebar ) {
var item = document.getElementById( MonobookSidebar.getId( menu ) );
if ( !item ) {
continue;
}
var menuId = jQuery( item ).parents().get( 2 ).id;
// Check it's a valid portlet item
if ( !menuId || menuId == '' ) {
continue;
}
// Generate menu hierarchy
MonobookSidebar.buildSubmenu( item, wgSidebar[menu] );
// Set events
MonobookSidebar.setEvents( menuId );
}
},
buildSubmenu: function( el, arr ) {
var ul = document.createElement( 'ul' );
ul.className = 'sub-menu';
for ( var i = 0; i < arr.length; i++ ) {
var li = document.createElement( 'li' );
if ( typeof arr[i] == 'string' ) {
var a = MonobookSidebar.linkFromText( arr[i] );
li.appendChild( a );
} else {
for ( var menukey in arr[i] ) {
a = MonobookSidebar.linkFromText( menukey );
li.appendChild( a );
MonobookSidebar.buildSubmenu( li, arr[i][menukey] );
}
}
ul.appendChild( li );
}
el.appendChild( ul );
el.className = 'with-sub-menu';
var em = document.createElement( 'em' );
em.appendChild( document.createTextNode( '\u203A' ) );
el.firstChild.appendChild( em );
},
setEvents: function( menuId ) {
for ( var i = 0; i < MonobookSidebar.loadedMenus; i++ ) {
if ( MonobookSidebar.loadedMenus[i] == menuId ) {
return;
}
}
jQuery( '#' + menuId ).children().eq( 1 ).children().eq( 0 )
.bind( 'mouseover', MonobookSidebar.mouseover )
.bind( 'mouseout', MonobookSidebar.mouseout );
MonobookSidebar.loadedMenus.push( menuId );
},
mouseover: function( e ) {
var target = e.target;
while ( target.tagName.toLowerCase() != 'div' ) {
if ( target.tagName.toLowerCase() == 'a' ) {
target = target.parentNode;
}
if ( target.tagName.toLowerCase() == 'li' ) {
jQuery( target ).addClass( 'hover' );
}
target = target.parentNode;
}
},
mouseout: function( e ) {
var target = e.target;
while ( target.tagName.toLowerCase() != 'div' ) {
if ( target.tagName.toLowerCase() == 'a' ) {
target = target.parentNode;
}
if ( target.tagName.toLowerCase() == 'li' ) {
jQuery( target ).removeClass( 'hover' );
}
target = target.parentNode;
}
},
linkFromText: function( txt ) {
var article = '', caption = '', sepPos = txt.indexOf( '|' );
if ( sepPos > 0 ) {
article = txt.substr( 0, sepPos );
caption = txt.substr( sepPos + 1 );
} else {
article = caption = txt;
}
article = article.replace( MonobookSidebar.re_s, '_' ); // removed encodeURIComponent(), it was messing things up --Jack Phoenix
var a = document.createElement( 'a' );
if ( article.length > 7 && article.substr( 0, 7 ) == 'http://' ) {
a.setAttribute( 'href', article );
} else {
article = article.replace( MonobookSidebar.re_s, '_' ); // removed encodeURIComponent(), it was messing things up --Jack Phoenix
// Replace encoded colons with normal colons -- added this. --Jack Phoenix
article = article.replace( '%3A', ':' ); // added code ends here
a.setAttribute( 'href', wgArticlePath.replace( '$1', article ) );
}
a.appendChild( document.createTextNode( caption ) );
return a;
},
getId: function( name ) {
return 'n-' + encodeURIComponent( name.replace( MonobookSidebar.re_s, '-' ) ).replace( MonobookSidebar.re_p, '.' );
}
};
/* Calling this code to initialize */
jQuery( MonobookSidebar.init );

Latest revision as of 02:30, 8 April 2024

/******************************************************************************************************************************/

/******************************************************************************************************************************/

/******************************************************************************************************************************/

/*********************************************************************** W I K I  E D I T O R B U T T O N S *******************/

/************************************************ WikiEditor Buttons/Customization ********************************************/

/******************************************************************************************************************************/

/******************************************************************************************************************************
 * Extra buttons in toolbar
 * @stats [[File:Krinkle_InsertWikiEditorButton.js]]
 ******************************************************************************************************************************/
mw.loader.using('ext.wikiEditor', function() {
	$.ajax({
		url: 'https://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript',
		dataType: 'script',
		cache: true
	}).done(function () {
	
		// REFERENCE with ID
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-refidbutton",
			icon: "/w/images/9/97/Editor_Button_-_Reference.png",
			label: 'Reference with ID',
			insertBefore: '<ref name="">[http://',
			insertAfter: ']</ref>',
			sampleText: ''
		});
		// BOOK CITATION
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-citebookbutton",
			icon: "/w/images/7/73/Editor_Button_-_Reference_Book.png",
			label: 'Cite book',
			insertBefore: '<ref name="">{{cite book|title= |edition=!!OR!!|volume= |last= |first= |date= |publisher= |page=!!OR!!|pages= ',
			insertAfter: '|isbn=}}</ref>',
			sampleText: '...not all parameters required.--see Template:Cite_book for documentation...'
		});
		
		// WEB CITATION
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-citewebbutton",
			icon: "/w/images/3/38/Editor_Button_-_Reference_Website.png",
			label: 'Cite web',
			insertBefore: '<ref name="">{{cite web|url=|title=|first=|last=',
			insertAfter: '|date=|work=|accessdate=|archiveurl=|archivedate=}}</ref>',
			sampleText: '...use |author= when first and last name are N/A'
		});
	
		// CORRECT FORMAT GALLERY
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-gallerybutton",
			icon: "/w/images/f/f6/Editor_Button_-_Correct_Gallery.png",
			label: 'Gallery',
			insertBefore: '<gallery widths="120" position="center" captionalign="center" spacing="small">\r',
			insertAfter: '\r</gallery>',
			sampleText: 'Test Image.png'
		});
	
		// YOUTUBE EMBED
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-youtubebutton",
			icon: "/w/images/d/de/Editor_Button_-_YouTube.png",
			label: 'YouTube embed',
			insertBefore: '<youtube width="300" height="169">',
			insertAfter: '</youtube>',
			sampleText: '...Put YT video ID here; remove _width="300" height="169"_ to make default size ~ 300x169 is specifically for infoboxes and video galleries...'
		});
		
		// DAILYMOTION EMBED
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-dailymotionbutton",
			icon: "/w/images/8/8c/Editor_Button_-_Dailymotion.png",
			label: 'Dailymotion embed',
			insertBefore: '<dailymotion dimensions="300x149">',
			insertAfter: '</dailymotion>',
			sampleText: '...Put Dailymotion video ID here; remove _dimensions="300x149"_ to make default size ~ 300x149 is specifically for infoboxes and video galleries...'
		});
		
		// NICONICO EMBED
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-niconicobutton",
			icon: "/w/images/2/24/Editor_Button_-_NicoVideo.png",
			label: 'NicoVideo embed',
			insertBefore: '<nicovideo width="299" height="165">',
			insertAfter: '</nicovideo>',
			sampleText: '...Put Nico Nico video ID here; remove _width="299" height="165"_ to make default size ~ 299x165 is specifically for infoboxes and video galleries...'
		});
	
		// TABBER
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxtabberbutton",
			icon: "/w/images/0/08/Editor_Button_-_Tabber.png",
			label: 'Tabber',
			insertBefore: '<tabs style="color:black; padding: 0px; margin: 0px;">\r<tab name="NAMEHERE">[[File:|330px| in ]]</tab>\r',
			insertAfter: '\r<tab name="NAMEHERE2">[[File:|330px| in ]]</tab>\r</tabs>',
			sampleText: '<!---- add multiple tabs by copy pasting and changing the values ---- to replace the infobox image with a tabber, change |image = with |altimage = ---->'
		});
	
		// DVD INFO
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-dvdbutton",
			icon: "/w/images/4/4f/Editor_Button_-_DVD_Info.png",
			label: 'Insert DVD information',
			insertBefore: '\'\'\'COMPANY\'\'\' VHS[or]LaserDisc[or]Blu-ray[or]DVD (YEAR) [collection]<ref name="">[http:// Amazon.com: ]</ref>\r*\'\'\'Region:\'\'\' \r*\'\'\'Discs:\'\'\' \r*\'\'\'SRP:\'\'\' $\r*\'\'\'Audio:\'\'\' \r*\'\'\'Subtitles:\'\'\' \r*\'\'\'Special features:\'\'\' \r*\'\'\'Notes:\'\'\' ',
			insertAfter: '',
			sampleText: ''
		});
	
		// STAFF and CAST Information
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-staffcastbutton",
			icon: "/w/images/e/eb/Editor_Button_-_Staff_and_Cast.png",
			label: 'Insert Staff and Cast information',
			insertBefore: '==Staff==\r{{Staffs\r',
			insertAfter: '|Directed by=[[\r|Written by=\r|Based on a story by=\r|Executive producer=\r|Co-executive producer=\r|Produced by=\r|Assistant producer=\r|Music by=\r|Stock music by=\r|Cinematography by=\r|Edited by=\r|Production design by=\r|1st assistant director=\r|Director of special effects=\r|1st assistant director of special effects=\r|Visual effects supervisor=\r}}\r==Cast==\r{{Cast\r||\r||\r||\r||\r||\r||\r||\r||\r||\r||\r||\r}}',
			sampleText: 'Vertical bars can replace equals signs for custom staff positions, but all subsequent equals signs must also be replaced to stay organized properly\r'
		});
	
		// FILM Tab and Nav
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-filmtabnavbutton",
			icon: "/w/images/9/95/Editor_Button_-_Nav.png",
			label: 'Tab and navigation (film)',
			insertBefore: '{{Tab}}\r{{Nav\r|type1       =\r|type2       =\r|type        =[[:Category:|Category:]]\r|name        =\r|prev        =\r|prevname    =\r|next        =\r|nextname    =\r}}',
			insertAfter: '',
			sampleText: ''
		});
	
	
		// INFOBOX KAIJU
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxkaijubutton",
			icon: "/w/images/b/b8/Editor_Button_-_Infobox_Kaiju.png",
			label: 'Kaiju infobox',
			insertBefore: '{{Kaiju Infobox\r|type1            =???\r|type2            =???\r|copyrighticon    =\r|image            =\r|caption          =\r|name             =\r|nicknames        =\r|subtitle         =\r|species          =\r|height           =?? meters\r|length           =?? meters\r|wingspan         =?? meters\r|weight           =?? tons\r|stat1            =?? meters|1=\r|stat2            =?? meters|2=\r|stat3            =?? meters|3=\r|forms            =\r|allies           =\r|enemies          =\r|originplace      =\r|relationships    =\r|controlled       =\r|conceived        =\r|written          =\r|designed         =\r|modeled          =\r|portrayed        =\r|debut            =\r|last             =\r|suits            =\r|roar             =[[File:.ogg|180px|center|noicon]]{{More Roars}}\r}}',
			insertAfter: '',
			sampleText: ''
		});
	
		// INFOBOX FILM
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxfilmbutton",
			icon: "/w/images/6/68/Editor_Button_-_Infobox_Film.png",
			label: 'Film infobox',
			insertBefore: '{{Infobox Film\r|type1        =\r|type2        =\r|image        =\r|caption      =The Japanese poster for \r|name         =\r|us-title     =\r|jp-title     =\r|director     =[[\r|producer     =[[\r|writer       =[[\r|composer     =[[\r|produced     =[[\r|distributor  =[[Toho]]{{sup|[[Japan|JP]]}}<br>[[]]{{sup|[[United States|US]]}}\r|rating       =\r|budget       =¥\r|gross        =¥\r|rentals      =¥\r|runtime      =?? minutes{{sup|[[Japan|JP]]}}<br>{{Small|(? hour, ?? minutes)}}<br />?? minutes{{sup|[[United States|US]]}}<br>{{Small|(? hour, ?? minutes)}}\r}}',
			insertAfter: '',
			sampleText: ''
		});
		
		// INFOBOX VIDEO GAME
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxvideogamebutton",
			icon: "/w/images/f/fb/Editor_Button_-_Infobox_Game.png",
			label: 'Video game infobox',
			insertBefore: '{{Infobox Game\r|type1        =\r|type2        =\r|header       =\r|image        =\r|caption      =\r|name         =\r|us-title     =\r|jp-title     =\r|publisher    =\r|developer    =\r|platforms    =\r|languages    =\r|genre        =\r}}',
			insertAfter: '',
			sampleText: ''
		});
		
		// INFOBOX BOOK
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxbookbutton",
			icon: "/w/images/7/70/Editor_Button_-_Infobox_Book.png",
			label: 'Book infobox',
			insertBefore: '{{Infobox Book\r|type1        =\r|type2        =\r|image        =\r|name         =\r|author       =\r|story        =\r|editor       =\r|writer       =\r|art          =\r|illustrator  =\r|pencils      =\r|inks         =\r|colors       =\r|cover        =\r|design       =\r|production   =\r|edits        =\r|letters      =\r|cc           =\r|publisher    =\r|publishdate  =\r|pages        =\r|size         =\r|genre        =\r|isbn         =[[Special:BookSources/|ISBN-10: ]]<br>[[Special:BookSources/|ISBN-13: ]]\r',
			insertAfter: '\r}}',
			sampleText: '!!!OR!!!\r|asin         ='
		});
		
		// INFOBOX SOUNDTRACK
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxsoundtrackbutton",
			icon: "/w/images/4/44/Editor_Button_-_Infobox_Soundtrack.png",
			label: 'Soundtrack infobox',
			insertBefore: '{{Infobox Soundtrack\r|type1              =\r|type2              =\r|name               =\r|image              =\r|composer           =\r|year               =\r|tracks             =\r|sample             =[[File:.ogg|180px|noicon]]\r}}',
			insertAfter: '',
			sampleText: ''
		});
		
		// INFOBOX SONG
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxsongbutton",
			icon: "/w/images/1/17/Editor_Button_-_Infobox_Song.png",
			label: 'Song infobox',
			insertBefore: '{{Infobox Song\r|type1        =\r|type2        =\r|name         =\r|image        =',
			insertAfter: '|composer     =\r|arranged     =\r|lyrics       =\r|performer    =\r|film         =\r|kaiju        =\r|sample       =[[File:.ogg|180px|noicon]]\r}}',
			sampleText: '!!!OR!!!\r|video        =<youtube width="300" height="169">...Put YT video ID here; remove _width="300" height="169"_ to make default size ~ 300x169 is specifically for infoboxes and video galleries...</youtube>\r'
		});
		
		// INFOBOX TV SHOW
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxtvshowbutton",
			icon: "/w/images/2/22/Editor_Button_-_Infobox_TV.png",
			label: 'TV show infobox',
			insertBefore: '{{Infobox Series\r|type1          =\r|type2          =\r|name           =\r|image          =\r|aired          =\r|director       =\r|producer       =\r|writer         =\r|composer       =\r|funded         =\r|produced       =',
			insertAfter: '\r|channel        =\r|rating         =\r|genre          =\r|episodes       =\r}}',
			sampleText: '\r|distributor    =<!-- Only when "channel" does not apply -->'
		});
		
		// INFOBOX EPISODE
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxepisodebutton",
			icon: "/w/images/f/f1/Editor_Button_-_Infobox_Episode.png",
			label: 'Episode infobox',
			insertBefore: '{{Nav\r|type2           =\r|type1           =\r|type            ={{link|black|}} {{link|black|:Category: episodes|episodes}}\r|prev            =\r|prevname        =""\r|name            =""\r|next            =\r|nextname        =""\r}}\r{{Infobox Episode|ratings=yes\r|type1           =\r|type2           =\r|name            =""<!--\r|dt              =""-->\r|image           =\r|caption         =The title card of ""\r|series          =\r|episodeno       =\r|director        =\r|writer          =\r|specialfx       =\r|viewers         =\r|aired           =\r}}',
			insertAfter: '',
			sampleText: ''
		});
		
		// INFOBOX VEHICLE
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxvehiclebutton",
			icon: "/w/images/d/d4/Editor_Button_-_Infobox_Weapon.png",
			label: 'Vehicle infobox',
			insertBefore: '{{Infobox Vehicle\r|type1           =\r|type2           =\r|name            =\r|image           =\r|nicknames       =\r|subtitle        =\r|height          =\r|length          =\r|wingspan        =\r|stat1           =|1=Width\r|stat2           =|2=Weight\r|info-misc       =\r|pilot           =\r|attach          =\r|launched        =\r|firstappearance =\r',
			insertAfter: '\r}}',
			sampleText: '<!--- use |debut = and |last = if more than 1 appearance --->'
		});
	
		// INFOBOX PERSON
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxpersonbutton",
			icon: "/w/images/9/93/Editor_Button_-_Infobox_Real_Person.png",
			label: 'Real person infobox',
			insertBefore: '{{Infobox Person\r|type1          =\r|type2          =\r|name           =\r|image          =\r|caption        =\r|occupation     =\r|birthday       =\r|birthplace     =\r|death          =\r|deathplace     =\r|first          =\r|notable        =\r|imdb           =\r|wikipedia      =\r}}',
			insertAfter: '',
			sampleText: ''
		});
		
		// INFOBOX CHARACTER
		krInsertWikiEditorButton({
			id: "mw-customeditbutton-infoboxcharacterbutton",
			icon: "/w/images/f/f6/Editor_Button_-_Infobox_Character.png",
			label: 'Character infobox',
			insertBefore: '{{Infobox Character\r|type1             =\r|type2             =\r|image             =\r|caption           =\r|name              =\r|species           =\r|aliases           =\r|nationality       =\r|relationships     =\r|occupation        =\r|affiliation       =\r|firstappearance   =\r',
			insertAfter: '\r|played            =\r}}',
			sampleText: '<!--- use |debut = and |last = if the character has more than 1 appearance --->'
		});
	
	});
} );
/**************************************************/

/*************** END WikiEditor ******************/

/************************************************/

/** A fix for tables **/

$(function() {
  // Exclusion approach. Uncomment the line below to apply horizontal scrolling to all tables except those with the class `skip-responsive`
   $('body:not(.ns--1) .mw-body-content table:not(.skip-responsive').wrap('<div class="responsive-table"></div>');	
});