User:RainingPain17/global.js

//Custom edit buttons mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/c/c8/Button_redirect.png", "speedTip": "Redirect", "tagOpen": "#REDIRECT ",		"tagClose": "", "sampleText": "Insert text" };	mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/c/c9/Button_strike.png", "speedTip": "Strike", "tagOpen": " ", "tagClose": " ", "sampleText": "Strike-through text" };	mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/1/13/Button_enter.png", "speedTip": "Line break", "tagOpen": " ", "tagClose": "", "sampleText": "" };	mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/7/74/Button_comment.png", "speedTip": "Comment visible only for editors", "tagOpen": "", "sampleText": "Insert comment here" };

//End Custom edit buttons

//************ //Auto Refresh //************ var ajaxPages = ["Special:RecentChanges", "Special:Log", "Special:Contributions", "Special:WikiActivity"]; var AjaxRCRefreshText = 'Auto-refresh'; importScriptPage('AjaxRC/code.js', 'dev'); //**************** //End Auto Refresh //****************

/** * "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 * * 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; });

importScriptPage( 'AjaxUndo/code.js', 'dev' );

importArticle({   type: 'script',    article: 'u:dev:NullEditButton/code.js' });