User:Sophiedp/global.js

/* Alert if global.js loads in chat */ if ( wgCanonicalSpecialPageName == 'Chat' ) { alert('Global.js is loaded in chat!'); }

/* Show removed replies */ $(".message-removed.hide").removeClass("hide");

/* Remove some items from the global nav */ $('#AccountNavigation > li > ul.subnav > li:has(a[data-id="help"])').remove; $('#AccountNavigation > li > ul.subnav > li:has(a[data-id="mytalk"])').remove; $('#AccountNavigation > li > ul.subnav > li:has(a[data-id="preferences"])').remove; $('#AccountNavigation > li > ul.subnav > li:has(a[data-id="logout"])').remove;

/* FastDelete settings */ var fdButtons = []; fdButtons.push({   'summary': 'Housekeeping',    'label': 'HK' });

/* Make the edit sub-menu expand on hover */ $(document.head).append('#WikiHeader nav.wikia-menu-button .drop:hover ~ ul,#WikiHeader nav.wikia-menu-button ul.WikiaMenuElement:hover,#WikiaMainContent nav.wikia-menu-button .drop:hover ~ ul,#WikiaMainContent nav.wikia-menu-button ul.WikiaMenuElement:hover{min-width:100%;display:block;} ');

/* Pseudo-Vector */ (function ($, mw) {   'use strict';    // double-run protection + only run in monobook    if (window.pseudoVectorLoaded || mw.config.get('skin') !== 'monobook') {        return;    }    window.pseudoVectorLoaded = true;    // Load the style    importStylesheetPage('Pseudo-Vector/code.css', 'dev');    // JS-based tweaks    $(function  { // add 'Search' box text placeholder $('#searchInput').attr('placeholder', $('#mw-searchButton').val);

// add 'Read' tab if (mw.config.get('wgArticleId')) { var $readTab = $('').append(               $('', { 'href': mw.util.getUrl(mw.config.get('wgRelevantPageName')), 'text': 'Read' })           );            // is another action tab selected already? if (!$('#p-cactions li.selected').not(':nth-child(1), :nth-child(2)').length) { $readTab.addClass('selected'); }

$('#ca-edit, #ca-viewsource').before($readTab); }   }); }(jQuery, mediaWiki));

/* ColoredColors */ //@author-Curiouscrab //Fixed by Dorumin (function {	var isHexCode = function(h) {		var a = parseInt(h, 16);		return (a.toString(16) === h);	};	var tags = document.getElementsByClassName('re0');	if (wgAction == 'view' && wgPageName.split('.')[wgPageName.split('.').length - 1] == 'css') {		for (i = 0; i < tags.length; i++) {			var html = tags[i].innerHTML;			if (html.charAt(0) == '#' && html.length == 7 && isHexCode(html.slice(1).toLowerCase)) {				var brokened = html.split(';');				for (j = 0; j < html.split('#').length - 1; j++) {					if (brokened[j][0] == '#') {						brokened[j] = '' + brokened[j].substring(0, 7) + ' ';					}				}				tags[i].innerHTML = brokened.join(';');			}		}	} });

//—————————————————————————————— ! ! ! ———————————————————————————————// /* Place imports below this line. Place everything else above this line. */

/* Imports */ $(window).load(function {   importArticles({ type: "script", articles: [ 'u:embercastle:MediaWiki:Sine.js', 'u:embercastle:MediaWiki:QuickCreateUserPage.js', 'u:dev:MediaWiki:NoImageLightbox/code.js', 'u:dev:MediaWiki:Rollback/code.js', 'u:dev:MediaWiki:Wikimarks/code.js', 'u:dev:MediaWiki:WallGreetingButton/code.js', 'u:dev:MediaWiki:PurgeButton/code.js', 'u:dev:MediaWiki:NullEditButton/code.js', 'u:dev:MediaWiki:FastDelete/code.js' ]   }); });