User:Jandor/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' );		} 	} } );

/* == Username replace function == * Inserts user name into * Originally in uncyclopedia * disable with:  var disableUsernameReplace = true; */ function UsernameReplace { if(window.disableUsernameReplace || wgUserName === null) return; var un = getElementsByClassName(document, 'span', 'insertusername'); for (var i=0;i<un.length;i++) { var d = 0; for(var j=0;j<un[i].childNodes.length;j++) { if(un[i].childNodes[j].nodeType == 3 && d < 1) { //find first text node and replace; un[i].childNodes[j].nodeValue = wgUserName; d++; }   }  } } addOnloadHook(UsernameReplace);