User:DodoMan/subpages.js

From Test Wiki
Revision as of 14:52, 17 March 2024 by DodoMan~usurped (talk | contribs) (Created page with "$(document).ready(function () { var NSWithoutSubpages = [-1, 6, 8, 14, 104, 105, 113]; if (document.getElementById('p-tb') && NSWithoutSubpages.indexOf(mw.config.get('wgNamespaceNumber')) == -1) { var lienSouspages = '/wiki/Special:Index/'; if (mw.config.get('wgCanonicalNamespace') === 'Index') { lienSouspages += 'Page:' + mw.config.get('wgTitle'); } else { lienSouspages += mw.config.get('wgPageName'); } mw.loader.using('mediaw...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
$(document).ready(function () {
  var NSWithoutSubpages = [-1, 6, 8, 14, 104, 105, 113];
  if (document.getElementById('p-tb') && NSWithoutSubpages.indexOf(mw.config.get('wgNamespaceNumber')) == -1)
    {
    var lienSouspages = '/wiki/Special:Index/';
    if (mw.config.get('wgCanonicalNamespace') === 'Index') {
        lienSouspages += 'Page:' + mw.config.get('wgTitle');
    } else {
        lienSouspages += mw.config.get('wgPageName');
    }
    mw.loader.using('mediawiki.util', function() {
      mw.util.addPortletLink('p-tb', lienSouspages + '/', 'Sous-pages', 't-subpages', 'Sous-pages de cette page');	
    });
    }
});