User:StalwartUK/global.js

// Skin Switch Button for monobook to oasis and vice versa // and for monobook and oasis to wikiamobile

$( function {	if ( !document.getElementById( 'ca-skins' ) ) {		if ( skin === 'oasis' || skin === 'wikia' ) {			$( 'MB' ).appendTo( '#AccountNavigation' ); $( 'WM' ).appendTo( '#AccountNavigation' );		} else {			$( 'Oasis' ).appendTo( '#p-cactions > .pBody > ul' ); $( 'Mobile' ).appendTo( '#p-cactions > .pBody > ul' );		} 	} } );

/* Fix for slideshow galleries in Monobook function monobook_InitSlideshow { var sld = null; for (var it = 0; (sld = document.getElementById('slideshow-'+it.toString)) || document.getElementById('gallery-'+it.toString); it++) { if (!sld) continue; $.getScript(stylepath + '/common/jquery/jquery-slideshow-0.4.js?' + wgStyleVersion, function(i) {			return function {				var slideshow = $('#slideshow-'+i.toString);				var cb = function(index) {					var item = slideshow.find('li').eq(index);					if (item.attr('title')) {						item.css('backgroundImage', 'url(' + item.attr('title') + ')');						item.removeAttr('title');					}				};				//var item = slideshow.find('li').first;				var item = slideshow.find('li').eq(0);				if (item.attr('title')!='') {					item.css('backgroundImage', 'url(' + item.attr('title') + ')');				}				item.removeAttr('title');				slideshow.slideshow({ buttonsClass:'wikia-button', nextClass:'wikia-slideshow-next', prevClass:'wikia-slideshow-prev', slideWidth:'300px', slidesClass:'wikia-slideshow-images', slideCallback: cb				});			};		}(it)); } }

if (jQuery.prototype.jquery == '1.3.2') { wgAfterContentAndJS.push(monobook_InitSlideshow); } End Fix for slideshow galleries in Monobook */