MediaWiki:Common.js

/*   Replaces  with the name of the user browsing the page. Requires copying Template:Username. function substUsername { $('.insertusername').html(wgUserName); }

function substUsernameTOC { var toc = $('#toc'); var userpage = $('#pt-userpage');

if( !userpage || !toc ) return;

var username = $('#pt-userpage').children(':first-child').html; $('span.toctext:not(:has(*)), span.toctext i', toc).each(function	{		$(this).html($(this).html.replace(' ', username));	}); }

/ BEGIN JavaScript title rewrite -- jQuery version and new wikia skin fixes by Grunny function rewriteTitle { if( typeof( window.SKIP_TITLE_REWRITE ) != 'undefined' && window.SKIP_TITLE_REWRITE ) { return; }	if( $('#title-meta').length == 0 ) { return; }	var newTitle = $('#title-meta').html; if( skin == "oasis" ) { $('header.WikiaPageHeader > h1').html(' ' + newTitle + ' '); $('header.WikiaPageHeader > h1').attr('style','text-align:' + $('#title-align').html + ';'); } else { $('.firstHeading').html(' ' + newTitle + ' '); $('.firstHeading').attr('style','text-align:' + $('#title-align').html + ';'); } } // END JavaScript title rewrite addOnloadHook(rewriteTitle);