Bureaucrats, editor, Interface administrators, Administrators (Semantic MediaWiki), Curators (Semantic MediaWiki), Editors (Semantic MediaWiki), Administrators
47,327
edits
No edit summary Tag: Manual revert |
No edit summary |
||
Line 1:
"use strict";
/**
* Toggles for skin cookies on mobile
Line 6 ⟶ 8:
*/
var currentDark = $.cookie('theme') === 'dark' ||
var self = {
darkPortletLink = mw.util.addPortletLink('p-personal', '#', (currentDark ? 'Light' : 'Dark') + ' mode', 'wgl-darkmode-toggle', 'Toggle ' + (currentDark ? 'light' : 'dark') + ' mode', null, $('a.menu__item--logout').closest('li'));
expires: 365,
(currentDark ? 'Light' : 'Dark') + ' mode',▼
path: '/'
expires: 365,
});
$.cookie(DARK_COOKIE, currentDark, {
▲ $(darkPortletLink).click(function (e) {
expires: 365,
▲ e.preventDefault();
path: '/'
▲ currentDark = !currentDark;
});
▲ $('#wgl-darkmode-toggle .toggle-list-item__label').text((currentDark ? 'Light' : 'Dark') + ' mode');
▲ $.cookie(DARK_COOKIE, currentDark, {expires: 365, path: '/'});
▲ $('meta[name="theme-color"]').attr('content', currentDark ? '#071022' : '#c0a886');
});
▲ if (currentDark) {
▲ mw.loader.using(['wgl.theme.dark']).then(function() {
}
▲ });
▲ } else {
tag: 'wg-darkmode-notification'
▲ $('body').addClass('wgl-theme-light').removeClass('wgl-theme-dark')
});
}
▲ });
$(self.init);
|