Jump to content

User:FatalError/monobook.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by FatalError (talk | contribs) at 03:19, 30 July 2008. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
importScript('User:AzaToth/morebits.js');
importScript('User:AzaToth/twinklefluff.js');
importScript('User:AzaToth/twinklewarn.js');
importScript('User:AzaToth/twinklediff.js');
importScript('User:AzaToth/twinklespeedy.js');

TwinkleConfig =
{
	watchWarnings : false
};

addOnloadHook
(
	function()
	{
		if((wgCanonicalNamespace == 'User' || wgCanonicalNamespace == 'User_talk') && wgTitle.indexOf('/') == -1)
		{
			var li = document.createElement('li');
			li.setAttribute('id', 'ca-contrib');
			var a = document.createElement('a');
			a.setAttribute('title', 'View the user\'s contributions');
			a.setAttribute('href', wgServer + '/wiki/Special:Contributions/' + wgTitle.split('/')[0]);
			var txt = document.createTextNode('Contribs');
			a.appendChild(txt);
			li.appendChild(a);
			
			var edit = document.getElementById('ca-edit') || document.getElementById('ca-viewsource');
			// Set the padding and stuff so it doesn't look weird
			var padding = edit.style.padding;
			li.style.padding = padding;
			alert(padding);
			edit.parentNode.insertBefore(li, edit);
		}
	}
);