MediaWiki:Common.js: Difference between revisions
adds subpages js |
No edit summary |
||
| Line 103: | Line 103: | ||
// import the SubPages 'gadget' for all users. non-optional | // import the SubPages 'gadget' for all users. non-optional | ||
/** See https://www.mediawiki.org/wiki/Extension:Gadgets/Scripts/SubPages.js **/ | |||
$( function () { | |||
var NSWithoutSubpages = [ -1, 6, 8, 12, 13, 14, 15, 104, 105 ]; | |||
if ( NSWithoutSubpages.indexOf( mw.config.get( 'wgNamespaceNumber' ) ) === -1 ) { | |||
var subpagesLink = mw.util.getUrl( 'Special:PrefixIndex/' + mw.config.get( 'wgPageName' ) + '/' ); | |||
mw.util.addPortletLink( 'p-tb', subpagesLink, 'Subpages', 't-subpages', 'Subpages of this page' ); | |||
} | |||
} ); | |||