User:MACH-59330/global.js

// global imports importArticles({   type: 'script',    articles: [        // 'u:de.trollocool:VanguardTools.js',        // 'u:dev:PortableCSSPad/code.js',        //  using these in Tampermonkey for quick toggling        'u:dev:DiscussionsFeed.js',        'u:dev:SkinSwitchButton/code.js',        'u:dev:Colors/code.js' //Monobook dark wiki class    ] });

// global header recolor document.addEventListener("DOMContentLoaded", function(gnaviclr) {   if ( document.querySelector('.wds-global-navigation') !== null ) {        mw.util.addCSS('' + '.skin-oasis .wds-global-navigation-wrapper .wds-global-navigation {' + 'background-color: ' + wgSassParams['color-buttons'] + ';' + '}');   }    if ( document.querySelector('.pph-wiki-header') !== null ) {        mw.util.addCSS('' + '.skin-oasis .pph-wiki-header {' + 'box-shadow: inset 15px 15px 20px 0 ' + wgSassParams['color-buttons'] + ';' + '}');   } }, false);

// global footer recolor document.addEventListener("DOMContentLoaded", function(gfootclr) {   if ( document.querySelector('.wds-global-footer') !== null ) {        mw.util.addCSS('' + '.skin-oasis .wds-global-footer {' + 'background-color: ' + wgSassParams['color-buttons'] + ';' + '}');   } }, false);

// source editor recolor document.addEventListener("DOMContentLoaded", function(sourceclr) {   if ( document.querySelector('.skin-oasis.editor') !== null ) {        mw.util.addCSS('' + '.wds-global-navigation, .EditPageHeader, .EditPage .module > h3 {' + 'background-color: ' + wgSassParams['color-buttons'] + ' !important;' + '}' +       '.WikiaPage {' + 'border-color: ' + wgSassParams['color-buttons'] + ' !important;' + '}');   } });

// global chat-specific JS, by KockaAdmiralac document.addEventListener("DOMContentLoaded", function(gcw) {   if (mw.config.get('wgCityId') !== '177') {        document.querySelector('a[href="/wiki/Special:Chat"], .chat-join button').addEventListener('click', function(gcwa) { gcwa.preventDefault; var cw = window.open('/wiki/Special:Chat?useskin=oasis'); cw.onload = function { cw.importScriptPage('Special:MyPage/chat.js', 'c'); }       }, false);    } }, false);

// chat link for premium page header document.addEventListener("DOMContentLoaded", function(pphchat) {   if ( document.querySelector('.pph-wiki-header') !== null ) {        var pphexpdpdn = document.querySelector('.pph-local-nav-explore .pph-local-nav-l2'),            pphchatli = document.createElement('li'),            pphchata = document.createElement('a'),            pphtxtchat = document.createTextNode('Chat');        pphchatli.setAttribute('class','pph-local-nav-item-l2');        pphchata.setAttribute('href','/wiki/Special:Chat');        pphexpdpdn.appendChild(pphchatli);        pphexpdpdn.lastChild.appendChild(pphchata);        pphexpdpdn.lastChild.lastChild.appendChild(pphtxtchat);    } });