Jump to content
Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
Add accessible book shortcut to 10th Edition Changelog in Citizen navigation
 
Use the shared Citizen header for Rules and Changelog icons; remove temporary script fallback
Tag: Replaced
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
/* BEGIN NERO CHANGELOG NAVIGATION 2026-10-16 */
/* NERO: direct Changelog link in Citizen's navigation rail. */
(function () {
  'use strict';
  function addChangelogLink() {
    if (!document.body || !document.body.classList.contains('skin-citizen') || document.getElementById('nero-changelog-nav')) {
      return;
    }
    var rail = document.querySelector('.citizen-header__start');
    if (!rail) {
      return;
    }
    var link = document.createElement('a');
    link.id = 'nero-changelog-nav';
    link.className = 'citizen-header__item citizen-cdx-button--size-large cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--icon-only cdx-button--weight-quiet';
    link.href = '/index.php/10th_Edition_Changelog';
    link.title = '10th Edition Changelog';
    link.setAttribute('aria-label', '10th Edition Changelog');
    var icon = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
    icon.setAttribute('viewBox', '0 0 24 24');
    icon.setAttribute('width', '20');
    icon.setAttribute('height', '20');
    icon.setAttribute('fill', 'none');
    icon.setAttribute('stroke', 'currentColor');
    icon.setAttribute('stroke-width', '1.7');
    icon.setAttribute('stroke-linecap', 'round');
    icon.setAttribute('stroke-linejoin', 'round');
    icon.setAttribute('aria-hidden', 'true');
    icon.setAttribute('focusable', 'false');
    var outline = document.createElementNS('http://www.w3.org/2000/svg', 'path');
    outline.setAttribute('d', 'M6 3h13v18H6a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm-2 16a2 2 0 0 1 2-2h13M14 3v8l-3-2-3 2V3');
    icon.appendChild(outline);
    link.appendChild(icon);
    rail.appendChild(link);
  }
  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', addChangelogLink, { once: true });
  } else {
    addChangelogLink();
  }
}());
/* END NERO CHANGELOG NAVIGATION */

Latest revision as of 22:56, 16 October 2026

/* Any JavaScript here will be loaded for all users on every page load. */