MediaWiki:Wikia.js

/* AjaxRC */ window.ajaxPages = ["Blog:Recent_posts","Special:Chat","Special:WikiActivity","Special:RecentChanges","Special:Watchlist","Special:Log","Special:Contributions"]; window.ajaxIndicator = 'http://vignette2.wikia.nocookie.net/dev/images/8/82/Facebook_throbber.gif'; window.ajaxRefresh = 30000; window.AjaxRCRefreshText = 'Auto-refresh'; window.AjaxRCRefreshHoverText = 'Automatically refresh the page'; //—————————————————————————————— ! ! ! ———————————————————————————————// /* Import scripts. NOTE: Place scripts configurations above this line */ importArticles({   type: 'script',    articles: [        'u:dev:TimedSlider/code.js', //Automatically tabs through a set slides based on a user-defined timer.         'u:dev:AjaxRC/code.js',      //Automatically refreshes pages.    ] }); /** Language dropdown **/ function appendLanguageDropdown { var borderColor = $('.WikiaPageHeader .comments').css('border-top-color'); var server = wgServer.replace("http://",""); var html = '   '; flags = {}; flags['en'] = ''; flags['de'] = ''; flags['es'] = ''; flags['fr'] = ''; flags['it'] = ''; flags['ja'] = ''; flags['nl'] = ''; flags['pl'] = ''; flags['pt'] = ''; flags['pt-br'] = ''; flags['ru'] = ''; flags['zh'] = ''; $('.WikiaPageHeader .comments').after(html); languages = {}; $('.WikiaArticleInterlang ul li a').each(function {		var languageFull = $(this).text;		var href = $(this).attr('href');		var pageNameArray = href.split('/')		var pageName = pageNameArray[pageNameArray.length - 1];		switch (languageFull) {			case "English":				languages['en'] = href;				break;			case "Deutsch":				languages['de'] = href;				break;			case "Español":				languages['es'] = href;				break;			case "Français":				languages['fr'] = href;				break;			case "Italiano":				languages['it'] = href;				break;			case "日本語":				languages['ja'] = href;				break;			case "Nederlands":				languages['nl'] = href;				break;			case "Polski":				languages['pl'] = href;				break;			case "Português":				languages['pt'] = href;				break;			case "Português do Brasil":				languages['pt-br'] = href;				break;			case "Русский":				languages['ru'] = href;				break;			case "中文":				languages['zh'] = href; break; }	});	var language = wgContentLanguage;	$.each(flags, function (key, value) { if (key === language) { $('.WikiaPageHeader .chooselanguage').prepend(flags[key]); } 		else { if (languages[key]) { $('.WikiaPageHeader .chooselanguage ul').append('<a style="display: inline; padding: 0; height: 0; line-height: 0;" class="'+ key +'-link" href="' + languages[key] + '"><li style="border-top: 1px solid '+ borderColor +'; padding-top: 3px; padding-bottom: 3px;" class="' + key + '">' + flags[key] + '</li></a>'); }		}	});	$('.WikiaPageHeader .chooselanguage').on('click', function { if ($(this).hasClass('active') === false) { $(this).addClass('active'); } 		else { $(this).removeClass('active'); }	});	$('.WikiaPageHeader .chooselanguage').on('mouseleave', function { var that = this; var timeOut = setTimeout(function { $(that).removeClass('active'); }, 500); $('.chooselanguage').on('mouseenter', function {			clearTimeout(timeOut);		}); }); } if( $('.WikiaArticleInterlang').length > 0 ) {	addOnloadHook(appendLanguageDropdown); } /*** Click tracking ***/ jQuery( function($) { var track = Wikia.Tracker.buildTrackingFunction({		category: 'interlanguage-nav',		action: Wikia.Tracker.ACTIONS.CLICK,		trackingMethod: 'ga'	}); /** Wikia Interlanguage Default Link **/ var $WikiaInterlanguageDefaultLink = $('nav.WikiaArticleInterlang'); $WikiaInterlanguageDefaultLink.on( 'mousedown', 'a', function(e) {		track({ browserEvent: e,			label: 'interlanguage-deafult-link' });	} );	/** WikiaInterlanguageCustomLink **/ var $WikiaInterlanguageCustomLink = $('.WikiaPageHeader'); $WikiaInterlanguageCustomLink.on( 'mousedown', '.chooselanguage a', function(e) {		track({ browserEvent: e,			label: 'interlanguage-custom-link' });	} ); } );