User:Ninjamask/global.js

importArticles({   type: 'script',    articles: [        'u:dev:MultiUpload/code.js',        'u:dev:ChatOptions/code.js',        'u:dev:PurgeButton/code.js',        'u:dev:DisplayTimer/code.js',        'u:dev:RedirectManagement/code.js',        'u:dev:LastEdited/code.js',    ] });

// LANGUAGE BUTTONS 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['pl'] = ''; flags['pt-br'] = ''; flags['ru'] = ''; $('.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 "Polski":				languages['pl'] = href;				break;			case "Português do Brasil":				languages['pt-br'] = href;				break;			case "Русский":				languages['ru'] = 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('' + flags[key] + '');			}		}	}); $('.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); } jQuery( function($) {	var track = Wikia.Tracker.buildTrackingFunction({ category: 'interlanguage-nav', action: Wikia.Tracker.ACTIONS.CLICK, trackingMethod: 'ga' });	var $WikiaInterlanguageDefaultLink = $('nav.WikiaArticleInterlang');	$WikiaInterlanguageDefaultLink.on( 'mousedown', 'a', function(e) { track({			browserEvent: e,			label: 'interlanguage-default-link'		}); } );	var $WikiaInterlanguageCustomLink = $('.WikiaPageHeader');	$WikiaInterlanguageCustomLink.on( 'mousedown', '.chooselanguage a', function(e) { track({			browserEvent: e,			label: 'interlanguage-custom-link'		}); } ); } );