MediaWiki:Common.js

/* Scripts which are imported via MediaWiki:ImportJS //Common.js/CustomTab.js Common.js/DynamicStats.js Common.js/gridfiltering.js Common.js/itemGridfiltering.js Common.js/levelselect.js Common.js/levelselect2.js Common.js/StatWheel.js //Common.js/tabviewenhancements.js dev:DiscordModule/code.js dev:OggPlayer.js dev:Tooltips.js

mw.loader.using( ['mediawiki.util', 'jquery.client'], function { /* Begin of mw.loader.using callback */

/* Username replace function (Template:USERNAME)          * * Inserts user name into */ $(function {       if(typeof(disableUsernameReplace) !== 'undefined' && disableUsernameReplace || mw.config.get('wgUserName') === null) return;    $("span.insertusername").text(mw.config.get('wgUserName'));    }); /* Config for MediaWiki:Common.js/gridfiltering.js */ gridContainer = '#champion-grid'; gridFilters = { 'search': 'search', 'role': ['- Role -', ['Controller','Controller'], ['Catcher','• Catcher'], ['Enchanter','• Enchanter'], ['Fighter','Fighter'], ['Diver','• Diver'], ['Juggernaut','• Juggernaut'], ['Mage','Mage'], ['Artillery','• Artillery'], ['Battlemage','• Battlemage'], ['Burst','• Burst'], ['Marksman','Marksman'], ['Slayer','Slayer'], ['Assassin','• Assassin'], ['Skirmisher','• Skirmisher'], ['Specialist','Specialist'], ['Tank','Tank'], ['Vanguard','• Vanguard'], ['Warden','• Warden'] ],       'type': ['- Attacktype -', ['Melee','Melee'], ['Ranged','Ranged'] ]   };    /* Config for MediaWiki:Common.js/itemGridfiltering.js */ itemGridContainer = '#item-grid'; itemGridFilters = { 'search': 'search', 'modes' : ['- Game Modes - ', ['Classic 5v5', '• Classic 5v5'], ['Classic 3v3', '• Classic 3v3'], ['ARAM', '• ARAM'], ['FGM', '• FGM Exclusive'] ]   };    /* Config for MediaWiki:Common.js/avatarGridfiltering.js */ avatarGridContainer = '#avatar-grid'; avatarGridFilters = { 'search': 'search', 'availability': ['- Availability -', ['Available','• Available'], ['Legacy','• Legacy'], ['Unavailable','• Unavailable'], ['Temporary','• Temporary'], ['Unlocked','• Account Creation'], ['Unreleased','• Unreleased'] ],       'source': ['- Source -', ['Store','• Client Store'], ['Riot','• Riot Distribution'], ['Missions','• Missions'], ['Bundle','• Bundles'], ['Account Creation','• Account Creation'], ['Merch Store','• Merch Store'] ],       'release': ['- Year -', ['2018release', '• 2018'], ['2017release', '• 2017'], ['2016release', '• 2016'], ['2015release', '• 2015'], ['2014release', '• 2014'], ['2013release', '• 2013'], ['2012release', '• 2012'], ['2011release', '• 2011'], ['2010release', '• 2010'], ['2009release', '• 2009'] ]   };    /* Config for MediaWiki:Common.js/esportsGridfiltering.js */ esportsGridContainer = '#esports-grid'; esportsGridFilters = { 'search': 'search', 'region': ['- Region -', ['INT','International Team'], ['NA','North America'], ['US','• North America'], ['EU','Europe'], ['DK','• Denmark'], ['DE','• Germany'], ['FR','• France'], ['LT','• Lithuania'], ['ES','• Spain'], ['SW','• Sweden'], ['UA','• Ukraine'], ['UK','• United Kingdom'], ['BR','Brazil'], ['CN','China'], ['KR','South Korea'], ['LAN','Latin American North'], ['CO','• Colombia'], ['CR','• Costa Rica'], ['MX','• Mexico'], ['PE','• Peru'], ['LAS','Latin America South'], ['AR','• Argentina'], ['CL','• Chile'], ['OCE','Oceania'], ['AU','• Australia'], ['JP','Japan'], ['RU','Russia'], ['SEA','South East Asia'], ['ID','• Indonesia'], ['HK','• Hong Kong'], ['MY','• Malaysia'], ['PH','• Philippines'], ['SG','• Singapore'], ['TH','• Thailand'], ['TW','• Taiwan'], ['VN','• Vietnam'], ['TR','Turkey'] ],       'tournament': ['- Tournament -', ['International','International'], ['MSI','• Mid-Season Invitational'], ['Worlds','• World Championship'], ['All-Star','• All-Stars'], ['Rift Rivals','• Rift Rivals'], ['Regional','Regional'], ['NALCS','• North America Championship Series'], ['EULCS','• Europe Championship Series'], ['CBLOL','• Campeonato Brasileiro'], ['CLS','• Copa Latinoamérica Sur'], ['CNC','• Circuito Nacional Chile'], ['LAN','• Latin America Cup'], ['LCK','• Champions Korea'], ['LCL','• Continental League (Russia)'], ['LJL','• Japan League'], ['LMS','• Master Series (SEA)'], ['LPL','• Pro League (China)'], ['LLN','• Liga Latinoamérica Norte'], ['OPL','• Oceanic Pro League'], ['TCL','• Turkey Champions League'], ['VCS','• Vietnam Championship Series'], ['Special','Special'], ['OGN','• OnGameNet Invitational (KR)'], ['SLTV','• SLTV Star Series (RU)'], ]   }; /* End of mw.loader.using callback */ });

/* Custom Tooltips for use with the Tooltips/code.js */ var tooltips_list = [ {  classname: 'ability-icon', parse: '{'+'{Tooltip/Ability|champion=<#champion#>|ability=<#ability#>}}'}, {  classname: 'buff-icon', parse: '{'+'{Tooltip/Buff|<#param#>}}'}, {  classname: 'champion-icon', parse: '{'+'{Tooltip/Champion|champion=<#champion#>|skin=<#skin#>|variant=<#variant#>}}'}, {  classname: 'glossary', parse: '{'+'{Tooltip/Glossary|<#param#>}}'}, {  classname: 'item-icon', parse: '{'+'{Tooltip/Item|<#param#>}}'}, {  classname: 'mastery-icon', parse: '{'+'{Tooltip/Mastery|<#param#>}}'}, {  classname: 'pp-tooltip', parse: '{'+'{Tooltip/Pp|<#size#>|<#values#>|label1=<#label1#>|label2=<#label2#>|displayformula=<#displayformula#>|useformula=<#useformula#>}}', },   {   classname: 'passive-progression', parse: '{'+'{Tooltip/Progression|<#size#>|<#values#>|<#levels#>|type=<#type#>|formula=<#formula#>}}'}, {  classname: 'rune-icon', parse: '{'+'{Tooltip/Rune|<#param#>}}'}, {  classname: 'skin-icon', parse: '{'+'{Tooltip/Skin|champion=<#champion#>|skin=<#skin#>|variant=<#variant#>}}'}, {  classname: 'skinloading-icon', parse: '{'+'{Tooltip/Skin/Loading|champion=<#champion#>|skin=<#skin#>|variant=<#variant#>}}'}, {  classname: 'chroma-icon', parse: '{'+'{Tooltip/Chroma|champion=<#champion#>|skin=<#skin#>}}'}, {  classname: 'avatar-icon', parse: '{'+'{Tooltip/Icon|<#param#>}}'}, {  classname: 'esports-icon', parse: '{'+'{Tooltip/Icon|<#param#>}}'}, {  classname: 'ward-icon', parse: '{'+'{Tooltip/Ward|<#param#>}}'}, {  classname: 'spell-icon', parse: '{'+'{Tooltip/Spell|<#param#>}}'}, {  classname: 'tooltip-sandbox', parse: '{'+'{Tooltip/Sandbox|<#v1#>|<#v2#>|<#v3#>|<#v4#>|<#v5#>|<#v6#>}}'} ]; var tooltips_config = { offsetX: 20, offsetY: 20, waitForImages: true, noCSS: true };

/* Flip Text */ (function {   function addHook {        $(".flipText1").show;        $(".flipText2").hide;        $(".flipText1, .flipText2").off;        $(".flipText1, .flipText2").click(function(e) { $(e.target).closest('span#container.container').children.toggle; });   }    $(addHook);    mw.hook('wikipage.content').add(addHook); });

/* Toggleable skill tabs */ mw.hook('wikipage.content').add(function(elem) {   $(elem).find('.skill-tabs:not(.made-skill-tabs)').each(function { var tabs = $(this).addClass('made-skill-tabs'); var dts = $(this).find('> dt'); if(dts.length === 2) tabs.addClass('toggle-tabs'); dts.each(function(i) {           var dt = $(this);            if(i > 0) {                dt.addClass('hidden-tab').find('+ dd').addClass('hidden-tab');                dt.prepend($(' « ').mousedown(function(e) {                    e.preventDefault;                }).click(function {                    dts.addClass('hidden-tab').find('+ dd').addClass('hidden-tab');                    $(dts[i-1]).removeClass('hidden-tab').find('+ dd').removeClass('hidden-tab');                }));            }            if(i < dts.length-1) {                dt.append($(' » ').mousedown(function(e) {                    e.preventDefault;                }).click(function {                    dts.addClass('hidden-tab').find('+ dd').addClass('hidden-tab');                    $(dts[i+1]).removeClass('hidden-tab').find('+ dd').removeClass('hidden-tab');                }));            }        }); }); });

/* DO NOT ADD CODE BELOW THIS LINE */