User:Awaikage/global.js

/* Monchomans chat hacks */ importScriptPage('User:Foodbandlt/FixedChatHacks.js', 'c'); importScriptPage('User:Joeytje50/ChatPMs.js', 'c');

importArticles({   type: "script",    articles: [        "w:c:onepiece:User:Sewil/MarkForDeletionRemix.js" //MarkForDeletionRemix    ] });

importArticles({	type: 'script',	articles: [		// ...		'w:c:dev:WHAM/code.js'		// ...	] }); /** (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; });
 * "Fix" the new and "improved" global navigation Wikia has forced upon us
 * See https://gist.github.com/sactage/21b17a54ce6359d2bdee for the most recent version of this script
 * @author sactage 
 * (c) 2014 sactage