User:Schiffy/global.js

/*importScriptURI('https://raw.github.com/PrincessPlatinum/ChatOptions/master/Options-Menu.js');*/

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

/* Batch Delete */ importScriptPage('AjaxBatchDelete/code.js', 'dev');

/* User Rights Record */ importArticles({   type: 'script',    articles: [        'u:dev:UserRightsRecord/code.js'    ] });

/* Auto Refresh */ AjaxRCRefreshText = 'Auto-refresh'; AjaxRCRefreshHoverText = 'Automatically refresh the page'; ajaxPages = ["Special:RecentChanges","Special:WikiActivity"]; importScriptPage('AjaxRC/code.js', 'dev');

/* UTC clock */ importArticle({type:'script', article:'w:c:dev:DisplayClock/code.js'});

/* Quick Patrol */ importScriptPage('AjaxPatrol/code.js', 'dev' );

/* allow div id = css to show */ addOnloadHook(function {$('head').append('' + $('#css').html + ' ');});

/* WHAM */ importScriptPage('WHAM/code.js', 'dev');

/* Global nav "fix" - from User:Sactage */ (function fixGlobalNav {   var bgColor = mw.config.get('wgSassParams')['color-header'],        borderElements = document.querySelectorAll('.global-navigation .page-width, .global-navigation-item'),        globalNav = document.querySelector('.global-navigation'),        bgParse = bgColor.match(/#([0-9a-f]){2}([0-9a-f]){2}([0-9a-f]){2}/).splice(1),        gt127 = 0,        arrowColor,        arwStyle = document.createElement('style'),        logo = document.querySelector('.global-navigation-link.wikia-logo img');    // 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], 16) > 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 + '; }'; (gt127 < 2) && (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; });