User:Jkmartindale/subpages.js
Appearance
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/*
* Adds a "Subpages" link to the page actions that does what you think. This is my first user script so please let me know if you have an improvement.
* Horrid mashup of https://commons.wikimedia.org/wiki/MediaWiki:Gadget-purgetab.js and https://id.wikipedia.org/wiki/MediaWiki:Gadget-Subpages.js
*/
$(function ()
{
if ($('#ca-subpages').length || !mw.config.get('wgIsArticle'))
return;
var subpages = mw.util.addPortletLink
(
'p-cactions',
mw.config.get('wgArticlePath').replace('$1', 'Special:Prefixindex/' + mw.config.get('wgPageName') + '/'),
mw.config.get('skin') == 'vector' ? 'Subpages' : '...',
'ca-subpages',
'View subpages',
's'
);
});