User:Ultimate Dark Carnage/wikia.js

$(document).ready(function createTools{   var toolbarEnabled = true,        $menu_html = $('      ');    const mwVariables = mw.config.get([ 'wgUserName', 'wgUserLanguage', 'wgUserGroups', 'wgCanonicalSpecialPageName', 'wgAction', 'skin' ]),       i18n = {            'en': 'My Tools',            'es': 'Herramientas',            'fr': 'Outils',            'ar': 'أدوات',            'ru': 'инструменты'        },        lang = mwVariables.wgUserLanguage,        _txt = i18n[lang],        userGroups = /(chatmoderator|sysop|rollback|bureaucrat|helper|vstf|staff)/g.test(mwVariables.wgUserGroups.join(' ')),        url = mw.util.wikiUrlencode(mwVariables.wgUserName) + '/tools-list';    $.ajax({ method: 'GET', dataType: 'text', url: mw.util.wikiScript('index'), data: { title: url, action: 'raw' }   }).done(function addLinks(data){ var line_split = data.split(/\n/g), i = 0, links = []; for (i < line_split.length; i++){ var s = line_split[i].split(/\|/), t = s[0], u = s[1], _url = '/wiki/' + encodeURIComponent(u), $menu_link = $('').addClass('menu-item item'); $menu_link.find('> a').addClass('menu-link').attr('href', _url).text(t); links[links.length] = $menu_link; }       $menu_html.find('nav > ul').html(links); });   $('.WikiaSiteWrapper').append($menu_html); });