Jump to content

MediaWiki:Common.js

From λ LUMENWARD
Revision as of 13:22, 23 December 2025 by Kauku (talk | contribs)

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)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* =========================================================
   Lumenward: Top header links (Vector 2022, SAFE)
   Places GitHub + Discord next to the logo (left lane)
   ========================================================= */

mw.loader.using(['mediawiki.util'], function () {
  if (document.getElementById('lumenward-header-links')) return;

  var container =
    document.querySelector('.vector-header-start') ||
    document.querySelector('.mw-header');

  if (!container) return;

  var wrap = document.createElement('div');
  wrap.id = 'lumenward-header-links';
  wrap.style.display = 'inline-flex';
  wrap.style.gap = '14px';
  wrap.style.marginLeft = '16px';
  wrap.style.alignItems = 'center';

  var links = [
    { text: 'GitHub', url: 'https://github.com/YOUR_REPO' },
    { text: 'Discord', url: 'https://discord.gg/YOUR_INVITE' }
    { text: 'Telegram', url: 'https://t.me/YOUR_CHANNEL' }
  ];

  links.forEach(function (l) {
    var a = document.createElement('a');
    a.href = l.url;
    a.textContent = l.text;
    a.target = '_blank';
    a.rel = 'noopener';
    a.style.fontWeight = '600';
    a.style.textDecoration = 'none';
    a.style.color = '#000';
    wrap.appendChild(a);
  });

  container.appendChild(wrap);
});