MediaWiki:Gadget-Subpages.js: Difference between revisions

From Zelda Dungeon Wiki
Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
mNo edit summary
m (load mediawiki.util)
 
(2 intermediate revisions by the same user not shown)
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') + '/';
                 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' );
                });
        }
});