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

MediaWiki interface page
Revision as of 06:12, 31 May 2025 by Admin AK (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.
/* Any JavaScript here will be loaded for all users on every page load. */
<!-- Cookie Consent Popup -->
<div id="cookie-banner" style="display:none; position: fixed; bottom: 0; left: 0; width: 100%; background-color: #111; color: #fff; padding: 15px; font-size: 14px; text-align: center; z-index: 9999; box-shadow: 0 -2px 5px rgba(0,0,0,0.5);">
  This site uses cookies and local storage for a smoother experience in Neo-Europa. By continuing, you accept this digital indulgence.
  <button id="accept-cookies" style="margin-left: 20px; background-color: #00ffff; color: #111; border: none; padding: 8px 12px; cursor: pointer;">Accept</button>
</div>

document.addEventListener("DOMContentLoaded", function() {
  if (!localStorage.getItem("cookiesAccepted")) {
    document.getElementById("cookie-banner").style.display = "block";
  }

  document.getElementById("accept-cookies").addEventListener("click", function() {
    localStorage.setItem("cookiesAccepted", "true");
    document.getElementById("cookie-banner").style.display = "none";
  });
});