User:Kamikaze839/global.js

importScriptPage('User:Monchoman45/ChatHacks.js', 'c');

importArticles({   type: 'script',    articles: [        'u:dev:RelatedDiscussionsModule/code.js'    ] });

window.AdvancedOasisUI = { accountNavFollowedPages: false, accountNavWatchlist: false, categoryRedlink: true, RCHeader: true, lightbox: false, randomPageLimitedTo: '', activity2RC: false, userLang: true, }; importScriptPage('AdvancedOasisUI/code.js', 'dev');

importArticles({   type: "script",    articles: [        "u:dev:MarkForDeletion/code.js"    ] });

/** * "Fix" the new and "improved" global navigation Wikia has forced upon us * * Changes so far: *  Sets background colour of global nav to that of the local nav *  Removes some some of the borders used as visual separation in the global nav, since they look like crap *  Changes the colour of the chevrons on the global nav (for dropdowns) to white/black depending on new bg colour * * @TODO Maybe make the nav not take up full width of the page * @TODO Maybe add options - e.g. allow choosing if nav scrolls with you or not * @TODO Change colour of user menu dropdown * @TODO Improve notifications bubble look * @TODO Send a literal letter to Wikia's product team, telling them this is utter crap * * @author sactage  * (c) 2014 sactage * */ (function fixGlobalNav {   var localNav = document.querySelector('.WikiHeader .navbackground'),        navStyle = window.getComputedStyle(localNav),        bgColor = navStyle.getPropertyValue('background-color'),        textColor = navStyle.getPropertyValue('color'),        borderElements = document.querySelectorAll('.global-navigation .page-width, .global-navigation-item'),        globalNav = document.querySelector('.global-navigation'),        bgParse = bgColor.match(/(\d+), (\d+), (\d+)/).splice(1),        gt127 = 0,        arrowColor,        arwStyle = document.createElement('style');    // change chevron colour based on the background colour we're going to use for the nav    for (var i = 0; i < 3; i++)        parseInt(bgParse[i]) > 127 && gt127++;    if (gt127 < 2)        arrowColor = 'white';    else        arrowColor = 'black';    // it's impossible to use the Selectors API with psuedo-elements (wtf mozilla) - this is the next best thing arwStyle.innerHTML = '.hubs-entry-point:after, #searchFormChevron, .AccountNavigation > li > a:after { border: 5px solid transparent; border-top-color: ' + arrowColor + '; }'; arwStyle.innerHTML += '\n.search-label-bold { color: ' + arrowColor + ' !important; }'; document.head.appendChild(arwStyle); // kill borders because they look kinda horrible for (var i = 0; i < borderElements.length; i++) { borderElements[i].style.border = 'none'; }   // change nav bg    globalNav.style.backgroundColor = bgColor; globalNav.style.color = textColor; });