Jump to content

User:TheFeds/script/contribstab.js

From Wikipedia, the free encyclopedia
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.
//contribstab.js
//Based on code by Gary_King (see http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=314868649#Viewing_Contribs_on_User_Subpages).

$(function() 
{
	if (!(wgCanonicalNamespace == 'Special'))
	{
		var username = wgTitle.split('/')[0];
		// "User:" tabs
  	if (wgCanonicalNamespace == 'User' || wgCanonicalNamespace == 'User_talk')
		{
			mw.util.addPortletLink('p-cactions', wgServer + '/wiki/Special:Contributions/' + username, 'User contributions', 'ca-contrib', 'View user contributions');
  	}
	}
});