MediaWiki:Common.js: Difference between revisions

From Kintara
Jump to navigation Jump to search
No edit summary
Tag: Reverted
No edit summary
Tag: Manual revert
Line 1: Line 1:
mw.loader.using('mediawiki.util').then(function () {
mw.loader.using('mediawiki.util').then(function () {
   // Open Discord sidebar/button links in a new tab everywhere.
   if (mw.config.get('wgPageName') !== 'Main_Page') {
   document.querySelectorAll('a[href*="discord.gg/kintara"]').forEach(function (link) {
    return;
  }
 
   document.querySelectorAll(
    '.kin-promo.discord .pbody a, .kin-promo.xbox .pbody a'
  ).forEach(function (link) {
     link.setAttribute('target', '_blank');
     link.setAttribute('target', '_blank');
     link.setAttribute('rel', 'nofollow noopener noreferrer');
     link.setAttribute('rel', 'nofollow noopener noreferrer');
   });
   });
  // Main Page social cards: open the card links in a new tab.
  if (mw.config.get('wgPageName') === 'Main_Page') {
    document.querySelectorAll(
      '.kin-promo.discord .pbody a, .kin-promo.xbox .pbody a'
    ).forEach(function (link) {
      link.setAttribute('target', '_blank');
      link.setAttribute('rel', 'nofollow noopener noreferrer');
    });
  }
});
});

Revision as of 13:46, 20 June 2026

mw.loader.using('mediawiki.util').then(function () {
  if (mw.config.get('wgPageName') !== 'Main_Page') {
    return;
  }

  document.querySelectorAll(
    '.kin-promo.discord .pbody a, .kin-promo.xbox .pbody a'
  ).forEach(function (link) {
    link.setAttribute('target', '_blank');
    link.setAttribute('rel', 'nofollow noopener noreferrer');
  });
});