MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on desktop */

/* Alternating wiki logo */ $(function {	var logos = ['b/bc/Wiki.png', 'd/d7/Wiki_2.png', '9/97/Wiki_3.png', '6/6a/Wiki_4.png', '7/79/Wiki_5.png'];	$('#p-logo a').css('background-image', 'url(https://kh.wiki.gallery/images/' + logos[Math.floor(Math.random * logos.length)] + ')'); });

/* Hide page previews when portals are used */ $(function {	if (document.getElementsByClassName('nav')[0] && document.getElementsByClassName('dropdown')[0])		$('head').append('.mwe-popups { display: none !important; } '); });

/* Add subpages toolbox link on user pages */ $(function {	var title = mw.config.get('wgTitle');	if (mw.config.get('wgCanonicalNamespace') === 'User' && !title.includes('/') && mw.config.get('skin') !== 'timeless') {		var subpagesLink = '/Special:PrefixIndex/User:' + title + '/';		mediaWiki.util.addPortletLink('p-tb', subpagesLink, 'User subpages', 't-subpages', 'Subpages of this page');	} });

/* Shrinking talk bubble sprites */ $(function {	if (document.readyState != "complete") {		setTimeout(arguments.callee, 100);		return;	}	$("table.talkbubble").each(function { $(this).find("td").first.width(90).css("text-align", "center").find("img").each(function {			if ($(this).width > 90) $(this).css("height", "auto").width(90);		}); }); });

/* Code for Template:Suite3 - Author: Soxra */ $(function {	$(".morphMaster").each(function { var $master = $(this); var $tabs = $master.find(".morphTabBox"); var $container = $master.find(".morphTabContainer");

$tabs.find(".morphLink").click(function {			var id = $(this).attr("id");			id = id.substr(0, id.length - 4);			$container.find(".morphContent").hide;			$container.find("#" + id + "Content").show;		}); }); });