User:Ultimate Dark Carnage/wikia.js

$(document).ready(function createTools{   var toolbarEnabled = true;    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 = encodeURIComponent(mwVariables.wgUserName) + '/tools-list';    $.ajax({ method: 'GET', dataType: 'text', url: mw.util.wikiScript('api'), data: { action: 'raw', title: mw.util.wikiUrlencode(url) }   }).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; }   }); });