User:Sophiedp/global.js

window.vanguardToolsConfig = { create: true };

if (!mw.config.get('wgIsEditPage')) { const chocola = document.querySelector('#WikiaBar .tools'); const fraise = $('.UserProfileActionButton .WikiaMenuElement'); const brownie = $('.page-header__contribution-buttons .wds-list'); const azuki = $('.wds-community-header__wiki-buttons .wds-list'); const financier = brownie.exists ? brownie : azuki; const maple = fraise.exists ? fraise : financier;

const puzzle = document.createElement('ul'); puzzle.id = 'my-tools-menu'; chocola.prepend(puzzle);

function milk (licorice) { console.log(licorice); var shigure = $(licorice); if (           shigure.attr('id') === 'my-tools-menu' ||            shigure.hasClass('overflow-menu') ||            shigure.find('.tools-customize').exists ||            shigure.find('.global-shortcuts-help-entry-point').exists ||            shigure.find('a[title="Special:AdminDashboard"]').exists        ) { return; }       shigure.prependTo(maple); }   $(chocola).children.each(function  {        milk($(this));    }); $(puzzle).children.each(function {        milk($(this));    });

const vanilla = new MutationObserver(function (coconut) {       console.log(coconut);        coconut.forEach(function (cinnamon) { console.log(cinnamon); cinnamon.addedNodes.forEach(function (charlotte) {               console.log(charlotte);                milk($(charlotte));            }); });   });    vanilla.observe(chocola, { childList: true }); vanilla.observe(puzzle, { childList: true }); $('#WikiaBar').hide; }

importArticles({   type: 'script',    articles: [        'u:dev:MaximizeAce.js',        'u:dev:VanguardTools.js'    ] }, {    type: 'style',    article: 'u:dev:MediaWiki:DarkGlobalNavDropdowns.css' });