MediaWiki:Gadget-Subpages.js: Difference between revisions
Jump to navigation
Jump to search
Want an adless experience? Log in or Create an account.
m (update deprecated wg variables to mw.config) |
m (load mediawiki.util) |
||
Line 4: | Line 4: | ||
if ( document.getElementById( 'p-tb' ) && NSWithoutSubpages.indexOf( mw.config.get('wgNamespaceNumber') ) == -1 ) { | if ( document.getElementById( 'p-tb' ) && NSWithoutSubpages.indexOf( mw.config.get('wgNamespaceNumber') ) == -1 ) { | ||
var subpagesLink = '/wiki/Special:PrefixIndex/' + mw.config.get('wgPageName') + '/'; | var subpagesLink = '/wiki/Special:PrefixIndex/' + mw.config.get('wgPageName') + '/'; | ||
mw.util.addPortletLink( 'p-tb', subpagesLink, 'Subpages', 't-subpages', 'Subpages of this page' ); | mw.loader.using( ['mediawik.util'], function() { | ||
mw.util.addPortletLink( 'p-tb', subpagesLink, 'Subpages', 't-subpages', 'Subpages of this page' ); | |||
}); | |||
} | } | ||
}); | }); |
Latest revision as of 01:14, June 22, 2020
/** subpages **/ $( function() { var NSWithoutSubpages = new Array( -1, 6, 8, 14); if ( document.getElementById( 'p-tb' ) && NSWithoutSubpages.indexOf( mw.config.get('wgNamespaceNumber') ) == -1 ) { var subpagesLink = '/wiki/Special:PrefixIndex/' + mw.config.get('wgPageName') + '/'; mw.loader.using( ['mediawik.util'], function() { mw.util.addPortletLink( 'p-tb', subpagesLink, 'Subpages', 't-subpages', 'Subpages of this page' ); }); } });