MediaWiki:Timeless.js

From Ephinea PSO Wiki
Revision as of 05:36, 17 November 2021 by Matt (talk | contribs) (Created page with "→‎All JavaScript here will be loaded for users of the Timeless skin: function toggleDarkMode() { const darkMode = localStorage.getItem("darkMode"); if (darkMode !== "tru...")
(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)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* All JavaScript here will be loaded for users of the Timeless skin */

function toggleDarkMode() {
	const darkMode = localStorage.getItem("darkMode");
	if (darkMode !== "true") {
	    localStorage.setItem("darkMode", true);
		document.body.classList.add("darkMode");
	} else {
	    localStorage.setItem("darkMode", false);
		document.body.classList.remove("darkMode");
	}
}