MediaWiki:Gadget-toggleDarkMode.js: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 7: Line 7:
var self = {
var self = {
init: function() {
init: function() {
if (currentDark) {
$('body').addClass('wgl-darkmode')
$('body').removeClass('wgl-lightmode')
}
portletLink = mw.util.addPortletLink(
portletLink = mw.util.addPortletLink(
'p-personal',
'p-personal',
Line 20: Line 26:
e.preventDefault();
e.preventDefault();


if (currentDark) {
currentDark = !currentDark;
currentDark = false;
}


localStorage.setItem(DARKMODE_COOKIE, currentDark);
localStorage.setItem(DARKMODE_COOKIE, currentDark);

Navigation menu