User:Bookofjude/userlogs.js

/* */ /* Adds "User logs" to the toolbox. */ /* Coded by User:Bookofjude, requested by User:Kylu. */ $(function {	if (document.getElementById('t-contributions')) {		z=document.getElementById("content").childNodes;		for (var n=0;n<z.length;n++) { 			if (z[n].className=="firstHeading") var username = z[n].textContent.replace(new RegExp('User:([^/]*)', 'g'), '$1');		};		var toolbox = document.getElementById('p-tb').getElementsByTagName('ul')[0];		var link = document.createElement('a');		link.href = '/w/index.php?title=Special:Log&user='+username;		link.appendChild(document.createTextNode('User logs'));		var li = document.createElement('li');		li.appendChild(link);		toolbox.appendChild(li);	} }); /* */