MediaWiki:Common.js

From Artifacts of Capitalism
Revision as of 18:54, 23 August 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.
// Replace the Chameleon search-box placeholder and button text
$(function() {
  // input field
  var inp = document.querySelector('#searchInput, input[name="search"]');
  if ( inp ) {
    inp.placeholder = 'Find an artifact…';    // your new placeholder
  }
  // submit button (magnifying-glass)
  var btn = document.querySelector('#searchButton, button[type="submit"].mw-searchButton');
  if ( btn ) {
    btn.textContent = 'Go';                   // your new label, if you like
  }
});

// Tag login + create-account pages so CSS can target reliably
mw.loader.using([]).then(function () {
  var sp = mw.config.get('wgCanonicalSpecialPageName');
  if (sp === 'Userlogin' || sp === 'CreateAccount') {
    document.documentElement.classList.add('aoc-auth');
    document.body.classList.add('aoc-auth');
  }
});