MediaWiki:Wikia.js

(function {	var changeColors = function {		var PIs = $('.portable-infobox');		if (PIs.length) PIs.each(function { var $PI = $(this); var color = '', classNames = $PI.attr('class').split(' '); for (var i = 0; i < classNames.length; i++) { if (classNames[i].indexOf('pi-theme-_') !== -1) { color = classNames[i].replace('pi-theme-_', ''); break; }			}			if (color) { $PI.css('border', '3px #' + color + 'ridge'); $PI.find('h2').css('background-color', '#' + color); }		});	};	// Run it now	changeColors;	// Bind it to TabView loadContent function, so Portable Infoboxes	// inside TabView can also have fabulous custom backgrounds.	// - - - -	// WARNING! This may cause compatibility issues!	/*	TabViewClass.prototype.loadContent = function(tabLink) {		var tabUrl = tabLink.attr('href')		, dataTabId = tabLink.parent.attr('data-tab')		  , containerSelector = $('#' + this.cashedStuff.containersWrapperId).children('div[data-tab-body="' + dataTabId + '"]');		if (containerSelector.data('loaded') !== true) {			containerSelector.startThrobbing;			$.get(tabUrl, { action: 'render' }, function(html) { containerSelector.html(html).data('loaded', true).stopThrobbing; mw.hook('wikipage.content').fire(containerSelector); changeColors; });		}	};	*/ });

var background = [ '#06030c url(https://images.wikia.com/robyns-little-land/images/0/0b/WikiBackground.png) 50% -30px/cover no-repeat fixed', 'url("https://images.wikia.com/robyns-little-land/images/5/5c/WikiBackground2.jpg") 0 0 / cover no-repeat fixed rgb(6, 3, 12)' ]; var final = background[Math.floor(Math.random * background.length)]; $('body.skin-oasis').css({  'background' : final });