MediaWiki:Gadget-Subpages.js: Difference between revisions

Want an adless experience? Log in or Create an account.
m
update deprecated wg variables to mw.config
(addPortletLink -> mw.util.addPortletLink)
m (update deprecated wg variables to mw.config)
Line 2: Line 2:
$( function() {
$( function() {
         var NSWithoutSubpages = new Array( -1, 6, 8, 14);
         var NSWithoutSubpages = new Array( -1, 6, 8, 14);
         if ( document.getElementById( 'p-tb' ) && NSWithoutSubpages.indexOf( wgNamespaceNumber ) == -1 ) {
         if ( document.getElementById( 'p-tb' ) && NSWithoutSubpages.indexOf( mw.config.get('wgNamespaceNumber') ) == -1 ) {
                 var subpagesLink = '/wiki/Special:PrefixIndex/' + wgPageName + '/';
                 var subpagesLink = '/wiki/Special:PrefixIndex/' + mw.config.get('wgPageName') + '/';
                 mw.util.addPortletLink( 'p-tb', subpagesLink, 'Subpages', 't-subpages', 'Subpages of this page' );
                 mw.util.addPortletLink( 'p-tb', subpagesLink, 'Subpages', 't-subpages', 'Subpages of this page' );
         }
         }
});
});