Jump to content

User:DannyS712/Userspace.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.
mw.loader.using('mediawiki.util',function(){
	var username = mw.config.get('wgUserName');
	$(mw.util.addPortletLink('p-tb', '#', 'Search own userspace', 'aca-usearch')).click(function(){
		var input = prompt("Enter the subpage you wish to open (User:" + username + "/??)");
		if (input) window.location.href = "https://en.wikipedia.org/wiki/User:" + username + "/" + input;
	});
});