User:TheFeds/script/subpagestab.js

Source: 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.
//subpagestab.js
//Based on code by Gadget850 (see http://en.wikipedia.org/wiki/Wikipedia:VPT#New_Subpages) and Gary_King (see http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&oldid=314868649#Viewing_Contribs_on_User_Subpages).
 
$(function() 
{
	mw.util.addPortletLink("p-tb", mw.config.get('wgServer')+mw.config.get('wgArticlePath').replace("$1", "Special:PrefixIndex/"+wgPageName+"/"), "Subpages", "t-subpages", "Subpages"); //Toolbox link
	mw.util.addPortletLink("p-cactions", mw.config.get('wgServer') + mw.config.get('wgArticlePath').replace("$1", "Special:PrefixIndex/" + wgPageName + "/"), "Subpages", "ca-subpages", "View subpages"); //Tab link
});