MediaWiki:Wikia.js

// ================================================================ // JavaScript here will be loaded only for users on the Oasis theme // ================================================================

// ============================== // Background randomiser // ==============================

function randomBack { var opts = [ 'http://images.wikia.com/testingmk/images/2/22/Arena01.jpg', 'http://images.wikia.com/testingmk/images/1/15/Arena02.jpg', 'http://images.wikia.com/testingmk/images/0/08/Arena04.jpg', 'http://images.wikia.com/testingmk/images/6/60/Arena06.jpg', 'http://images.wikia.com/testingmk/images/e/ec/Desert.jpeg', ];	if (wgPageName=='Main_Page') { $('body').css('background-image','url(' + opts[0] + ')'); $('body').css('background-size','120%'); //for the DS3 background to look better }	else $('body').css('background-image','url(' + opts[Math.floor((opts.length-1)*Math.random+1)] + ')'); //remove +1 to include first element of the array } randomBack;

// ============================== // BackToTopButton // ============================== //A script that adds a "Back To Top" option in the footer of the Oasis theme. //I don't like scrolling back to top on long pages neither do you :) //Created by Noemon from Dead Space Wiki function hideFade {	// hide #backtotop first	$( "#backtotop" ).hide ;	// fade in #backtotop	$( function  { $( window ).scroll( function {			if ( $( this ).scrollTop  > ButtonStart ) {				$( '#backtotop' ).fadeIn ;			} else {				$( '#backtotop' ).fadeOut ;			}		}); }); }

function goToTop { // scroll body to 0px on click $( 'body,html' ).animate ({		scrollTop: 0	}, ScrollSpeed ); return false; }

function addBackToTop { if( skin == 'oasis' ) { $('Back To Top ').appendTo('#WikiaBarWrapper .toolbar > .tools'); hideFade ; }	}

var ButtonStart = 800; var ScrollSpeed = 600;

if( !window.BackToTop ) { $( document ).ready( function { 		addBackToTop ; 	}); } var BackToTop = true; // prevent duplication

// ============================== // Snow! // ==============================

//importScriptPage('MediaWiki:Snow.js', 'community');