MediaWiki:Common.js: Difference between revisions
From Wikizilla, the kaiju encyclopedia
Jump to navigationJump to search
(janky solution) |
No edit summary |
||
(19 intermediate revisions by 4 users not shown) | |||
Line 46: | Line 46: | ||
icon: "/w/images/3/38/Editor_Button_-_Reference_Website.png", | icon: "/w/images/3/38/Editor_Button_-_Reference_Website.png", | ||
label: 'Cite web', | label: 'Cite web', | ||
insertBefore: '<ref name="">{{cite web|url= |title= | | insertBefore: '<ref name="">{{cite web|url=|title=|first=|last=', | ||
insertAfter: '|date=|work=|accessdate=|archiveurl=|archivedate=}}</ref>', | |||
sampleText: '' | sampleText: '...use |author= when first and last name are N/A' | ||
}); | }); | ||
Line 116: | Line 116: | ||
icon: "/w/images/e/eb/Editor_Button_-_Staff_and_Cast.png", | icon: "/w/images/e/eb/Editor_Button_-_Staff_and_Cast.png", | ||
label: 'Insert Staff and Cast information', | label: 'Insert Staff and Cast information', | ||
insertBefore: '==Staff==\r{{Staffs\r|Directed by=[[\r|Written by=\r|Produced by=\r| | 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' | |||
}); | }); | ||
Line 147: | Line 147: | ||
icon: "/w/images/6/68/Editor_Button_-_Infobox_Film.png", | icon: "/w/images/6/68/Editor_Button_-_Infobox_Film.png", | ||
label: 'Film infobox', | 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)}} | 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: '', | insertAfter: '', | ||
sampleText: '' | sampleText: '' | ||
Line 167: | Line 167: | ||
icon: "/w/images/7/70/Editor_Button_-_Infobox_Book.png", | icon: "/w/images/7/70/Editor_Button_-_Infobox_Book.png", | ||
label: 'Book infobox', | 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 | 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: '', | insertAfter: '\r}}', | ||
sampleText: '' | sampleText: '!!!OR!!!\r|asin =' | ||
}); | }); | ||
Line 187: | Line 187: | ||
icon: "/w/images/1/17/Editor_Button_-_Infobox_Song.png", | icon: "/w/images/1/17/Editor_Button_-_Infobox_Song.png", | ||
label: 'Song infobox', | label: 'Song infobox', | ||
insertBefore: '{{Infobox Song\r|type1 =\r|type2 =\r|name =\r|image ', | 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}}', | 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' | 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' | ||
Line 197: | Line 197: | ||
icon: "/w/images/2/22/Editor_Button_-_Infobox_TV.png", | icon: "/w/images/2/22/Editor_Button_-_Infobox_TV.png", | ||
label: 'TV show infobox', | label: 'TV show infobox', | ||
insertBefore: '{{Infobox Series\r|type1 =\r|type2 =\r|name =\r|image =\r|producer =\r| | 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: '' | sampleText: '\r|distributor =<!-- Only when "channel" does not apply -->' | ||
}); | }); | ||
Line 207: | Line 207: | ||
icon: "/w/images/f/f1/Editor_Button_-_Infobox_Episode.png", | icon: "/w/images/f/f1/Editor_Button_-_Infobox_Episode.png", | ||
label: 'Episode infobox', | label: 'Episode infobox', | ||
insertBefore: '{{Infobox Episode|ratings=yes\r|type1 =\r|type2 =\r|name ="" | 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: '', | insertAfter: '', | ||
sampleText: '' | sampleText: '' | ||
Line 249: | Line 249: | ||
/************************************************/ | /************************************************/ | ||
/** 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>'); | |||
}); |
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>'); });