MediaWiki:Gadget-Subpages.js

/** * Add a "Subpages" link to the toolbox menu. * Dependencies: mediawiki.util, mediawiki.Title, mediawiki.Uri * * @author Jim Tittsler  from old JSconfig.subPagesLink */ ( function ( mw, $ ) {

$( document ).ready( function {                if ( $('#t-whatlinkshere').length && wgNamespaceNumber != -2 // Media: && wgNamespaceNumber != -1 // Special: && wgNamespaceNumber != 6  // File: && wgNamespaceNumber != 14 // Category: ) {

var url = '/Special:Prefixindex/' + wgPageName + '/';

mw.util.addPortletLink(                               'p-tb',                                url,                                'Subpages',                                'Show subpages of current page',                                null,                                '#tb-subpages'                        ); }

}); }( mediaWiki, jQuery ) );