MediaWiki:Common.js: Difference between revisions

From Wikizilla, the kaiju encyclopedia
Jump to navigationJump to search
(replacing Wikia images with Wikizilla)
No edit summary
 
(51 intermediate revisions by 4 users not shown)
Line 1: Line 1:
// Incluir Gadget-HotCat.js
// Para desactivar, agrega "window.noHotCat = true" en tu Monobook.js
if (mw.config.get('skin') != 'oasis' && mw.config.get('wgAction') == 'view' &&
(mw.config.get('wgNamespaceNumber') == 0 || mw.config.get('wgNamespaceNumber') == 6 || mw.config.get('wgNamespaceNumber') == 14) &&
window.location.toString().indexOf('diff=') == -1) {
(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
if (!document.getElementById('csAddCategorySwitch') && !window.noHotCat) {
if ($('#catlinks').length == 0) {
$('#'+(window.bodyContentId||'bodyContent')).children('div.printfooter').after('<div id="catlinks" class="catlinks"></div>');
}
if ($('#mw-normal-catlinks').length == 0) {
$('#catlinks').prepend('<div id="mw-normal-catlinks"><a title="Special:Categories" href="'+mw.config.get('wgArticlePath', '').replace('$1', 'Special:Categories')+'">Categories</a></div>');
}
$('#mw-normal-catlinks').children('a').eq(0).after('<span class="noprint">&nbsp;<span>(<a style="cursor: pointer;" title="Modify categories"><span>+<sup>+</sup></span></a>)</span></span>').next().find('a').click(function() {
$(this).unbind().closest('span.noprint').eq(0).remove();
importScript('MediaWiki:Common.js/Clases/Gadget-HotCat.js');
return false;
});
$('#catlinks').removeClass('catlinks-allhidden');
}
});
} else if (mw.config.get('wgCanonicalSpecialPageName', '') == 'Upload') {
(typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
importScript('MediaWiki:Common.js/Clases/Gadget-HotCat.js');
});
}
/**
* Collapsible tables
*
* @version 2.0.2 (2014-03-14)
* @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-collapsibleTables.js
* @author [[User:R. Koot]]
* @author [[User:Krinkle]]
* @deprecated Since MediaWiki 1.20: Use class="mw-collapsible" instead which
* is supported in MediaWiki core.
*/
/*global $, mw */
var autoCollapse = 2;
var collapseCaption = 'hide';
var expandCaption = 'show';
function collapseTable( tableIndex ) {
var Button = document.getElementById( 'collapseButton' + tableIndex );
var Table = document.getElementById( 'collapsibleTable' + tableIndex );
if ( !Table || !Button ) {
return false;
}
var Rows = Table.rows;
var i;
if ( Button.firstChild.data === collapseCaption ) {
for ( i = 1; i < Rows.length; i++ ) {
Rows[i].style.display = 'none';
}
Button.firstChild.data = expandCaption;
} else {
for ( i = 1; i < Rows.length; i++ ) {
Rows[i].style.display = Rows[0].style.display;
}
Button.firstChild.data = collapseCaption;
}
}
function createClickHandler( tableIndex ) {
return function ( e ) {
e.preventDefault();
collapseTable( tableIndex );
};
}
function createCollapseButtons() {
var tableIndex = 0;
var NavigationBoxes = {};
var Tables = document.getElementsByTagName( 'table' );
var i;
for ( i = 0; i < Tables.length; i++ ) {
if ( $( Tables[i] ).hasClass( 'collapsible' ) ) {
/* only add button and increment count if there is a header row to work with */
var HeaderRow = Tables[i].getElementsByTagName( 'tr' )[0];
if ( !HeaderRow ) {
continue;
}
var Header = HeaderRow.getElementsByTagName( 'th' )[0];
if ( !Header ) {
continue;
}
NavigationBoxes[tableIndex] = Tables[i];
Tables[i].setAttribute( 'id', 'collapsibleTable' + tableIndex );
var Button = document.createElement( 'span' );
var ButtonLink = document.createElement( 'a' );
var ButtonText = document.createTextNode( collapseCaption );
// TODO: Declare styles in [[MediaWiki:Gadget-collapsibleTables.css]]
// Button.className = 'collapseButton';
Button.style.styleFloat = 'right';
Button.style.cssFloat = 'right';
Button.style.fontWeight = 'normal';
Button.style.textAlign = 'right';
Button.style.width = '6em';
ButtonLink.style.color = Header.style.color;
ButtonLink.setAttribute( 'id', 'collapseButton' + tableIndex );
ButtonLink.setAttribute( 'href', '#' );
$( ButtonLink ).on( 'click', createClickHandler( tableIndex ) );
ButtonLink.appendChild( ButtonText );
Button.appendChild( document.createTextNode( '[' ) );
Button.appendChild( ButtonLink );
Button.appendChild( document.createTextNode( ']' ) );
Header.insertBefore( Button, Header.firstChild );
tableIndex++;
}
}
for ( i = 0; i < tableIndex; i++ ) {
if ( $( NavigationBoxes[i] ).hasClass( 'collapsed' ) ||
( tableIndex >= autoCollapse && $( NavigationBoxes[i] ).hasClass( 'autocollapse' ) )
) {
collapseTable( i );
}
}
}
mw.hook( 'wikipage.content' ).add( createCollapseButtons );
/******************************************************************************************************************************/
/******************************************************************************************************************************/


Line 145: Line 15:
  * @stats [[File:Krinkle_InsertWikiEditorButton.js]]
  * @stats [[File:Krinkle_InsertWikiEditorButton.js]]
  ******************************************************************************************************************************/
  ******************************************************************************************************************************/
$.ajax({
mw.loader.using('ext.wikiEditor', function() {
url: 'https://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript',
$.ajax({
dataType: 'script',
url: 'https://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript',
cache: true
dataType: 'script',
}).done(function () {
cache: true
 
}).done(function () {
// REFERENCE with ID
krInsertWikiEditorButton({
// REFERENCE with ID
id: "mw-customeditbutton-refidbutton",
krInsertWikiEditorButton({
icon: "//wikizilla.org/wiki/images/9/97/Editor_Button_-_Reference.png",
id: "mw-customeditbutton-refidbutton",
label: 'Reference with ID',
icon: "/w/images/9/97/Editor_Button_-_Reference.png",
insertBefore: '<ref name="">[http://',
label: 'Reference with ID',
insertAfter: ']</ref>',
insertBefore: '<ref name="">[http://',
sampleText: ''
insertAfter: ']</ref>',
});
sampleText: ''
// BOOK CITATION       ----------------- website citation for when it's added: //wikizilla.org/wiki/images/3/38/Editor_Button_-_Reference_Website.png
});
krInsertWikiEditorButton({
// BOOK CITATION
id: "mw-customeditbutton-citebookbutton",
krInsertWikiEditorButton({
icon: "//wikizilla.org/wiki/images/7/73/Editor_Button_-_Reference_Book.png",
id: "mw-customeditbutton-citebookbutton",
label: 'Cite book',
icon: "/w/images/7/73/Editor_Button_-_Reference_Book.png",
insertBefore: '<ref name="">{{cite book|title= |author= |date= |publisher= |page=!!OR!!|pages= ',
label: 'Cite book',
insertAfter: '|isbn=}}</ref>',
insertBefore: '<ref name="">{{cite book|title= |edition=!!OR!!|volume= |last= |first= |date= |publisher= |page=!!OR!!|pages= ',
sampleText: '...not all parameters required.--see Template:Cite_book for documentation...'
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 --->'
});
});
});
} );
/**************************************************/


// CORRECT FORMAT GALLERY
/*************** END WikiEditor ******************/
krInsertWikiEditorButton({
id: "mw-customeditbutton-gallerybutton",
icon: "//wikizilla.org/wiki/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: "//wikizilla.org/wiki/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...'
});
 
// TABBER
krInsertWikiEditorButton({
id: "mw-customeditbutton-infoboxtabberbutton",
icon: "//wikizilla.org/wiki/images/0/08/Editor_Button_-_Tabber.png",
label: 'Tabber',
insertBefore: '<tabs style="color:black; padding: 0px; margin: 0px;">\r<tab name="NAMEHERE">[[File:|300px| in ]]</tab>\r',
insertAfter: '\r<tab name="NAMEHERE2">[[File:|300px| 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: "//wikizilla.org/wiki/images/4/4f/Editor_Button_-_DVD_Info.png",
label: 'Insert DVD information',
insertBefore: '<b>COMPANY</b> (YEAR)<ref name="">[http:// Amazon.com: ]</ref>\\r*Region: \r*Audio: \r*Special Features: \r*Notes:  ',
insertAfter: '',
sampleText: ''
});
 
// STAFF and CAST Information
krInsertWikiEditorButton({
id: "mw-customeditbutton-staffcastbutton",
icon: "//wikizilla.org/wiki/images/e/eb/Editor_Button_-_Staff_and_Cast.png",
label: 'Insert Staff and Cast information',
insertBefore: '==Staff==\r{{Staffs\r|Directed by=[[\r|Written by=\r|Produced by=\r|Executive Producing by=\r|Music by=\r|Cinematography by=\r|Edited by=\r|Production Design by=\r|Assistant Directing by=\r|Special Effects by=\r}}\r==Cast==\r{{Cast\r||\r||\r||\r||\r||\r||\r||\r||\r||\r||\r||\r}}',
insertAfter: '',
sampleText: ''
});
 
// FILM Tab and Nav
krInsertWikiEditorButton({
id: "mw-customeditbutton-filmtabnavbutton",
icon: "//wikizilla.org/wiki/images/9/95/Editor_Button_-_Nav.png",
label: 'Tab and navigation (film)',
insertBefore: '{{Tab}}\r{{Nav Design\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: "//wikizilla.org/wiki/images/b/b8/Editor_Button_-_Infobox_Kaiju.png",
label: 'Kaiju infobox',
insertBefore: '{{Kaiju Infobox\r|type1            =???\r|type2            =???\r|header          ={{Toho Kaiju}} \r|copyrighticon    =\r|image            =\r|caption          =\r|name            =\r|nicknames        =\r|subtitle        =\r|species          =\r|height          =?? meters\r|length          =?? meters\r|weight          =?? tons\r|forms            =\r|allies          =\r|enemies          =\r|relationships    =\r|controlled      =\r|created          =\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: "//wikizilla.org/wiki/images/6/68/Editor_Button_-_Infobox_Film.png",
label: 'Film infobox',
insertBefore: '{{Infopelicula\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|distributor =[[Toho]]{{sup|[[Japan|JP]]}}<br>[[]]{{sup|[[United States|US]]}}\r|rating      =\r|budget      =¥\r|gross      =¥\r|runtime    =?? minutes{{sup|[[Japan|JP]]}}<br>{{Small|(? hour, ?? minutes)}}<br />?? minutes{{sup|[[United States|US]]}}<br>{{Small|(? hour, ?? minutes)}}\r|designs    =[[\r}}',
insertAfter: '',
sampleText: ''
});
 
// INFOBOX CHARACTER
krInsertWikiEditorButton({
id: "mw-customeditbutton-infoboxcharacterbutton",
icon: "//wikizilla.org/wiki/images/f/f6/Editor_Button_-_Infobox_Character.png",
label: 'Character infobox',
insertBefore: '{{Infobox Character\r|type1          =\r|type2          =\r|header          ={{Character}}\r|image          =\r|caption        =\r|species        =\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 --->'
});
 
// INFOBOX TV SHOW
krInsertWikiEditorButton({
id: "mw-customeditbutton-infoboxtvshowbutton",
icon: "//wikizilla.org/wiki/images/2/22/Editor_Button_-_Infobox_TV.png",
label: 'TV show infobox',
insertBefore: '{{Infobox Series\r|header        ={{Series}}\r|type1        =\r|type2        =\r|name          =\r|image        =\r|creator      =\r|producer      =\r|distributor  =\r|genre        =\r|aired        =\r|channel      =\r|episodes      =\r}}',
insertAfter: '',
sampleText: ''
});


// INFOBOX BOOK
/** A fix for tables **/
krInsertWikiEditorButton({
id: "mw-customeditbutton-infoboxbookbutton",
icon: "//wikizilla.org/wiki/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|publisher    =\r|publishdate  =\r|genre        =\r|isbn        =[[Special:BookSources/|ISBN-10: ]]<br>[[Special:BookSources/|ISBN-13: ]]\r}}',
insertAfter: '',
sampleText: ''
});
 
// INFOBOX PERSON
krInsertWikiEditorButton({
id: "mw-customeditbutton-infoboxpersonbutton",
icon: "//wikizilla.org/wiki/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|first            =\r|notable          =\r|imdb            =\r|wikipedia        =\r}}',
insertAfter: '',
sampleText: ''
});
 
// INFOBOX VIDEO GAME
krInsertWikiEditorButton({
id: "mw-customeditbutton-infoboxvideogamebutton",
icon: "//wikizilla.org/wiki/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: ''
});


$(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>');
});
});
/**************************************************/
/*************** END WikiEditor ******************/
/************************************************/

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>');	
});