MediaWiki:Common.js

From Artifacts of Capitalism
Revision as of 20:38, 14 July 2025 by Abrano (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.
$(document).ready(function () {
  console.log("✅ Common.js is loading and attempting to insert link...");

  // Create new link
  var $customLink = $('<li><a href="/index.php/Special:RecentChanges">Recent Changes</a></li>');

  // Wait a bit for the Chameleon menu to render
  setTimeout(function () {
    var menu = $('.cmln-personal-tools .dropdown-menu');
    if (menu.length) {
      menu.append($customLink);
      console.log("✅ Custom link added to personal tools menu.");
    } else {
      console.warn("⚠️ Personal tools dropdown not found.");
    }
  }, 500); // Slight delay to ensure menu has rendered
});