MediaWiki:Gadget-skinTogglesNew.js: Difference between revisions

Jump to navigation Jump to search
remove wg.darkmode load that doesn't exist.
(Created page with "→‎* * Toggles for skin cookies * * @author Gaz Lloyd * @author JaydenKieran *: ;(function($, mw, rs){ var READER_COOKIE = 'readermode', DARK_COOKIE = 'darkmode', DARK_COOKIE_CONDITIONAL = 'darkmode_conditional', STICKY_HEADER_COOKIE = 'stickyheader', FLOORNUMBER_LS = 'floornumber_display', currentReader = $.cookie(READER_COOKIE) === 'true', currentDark = $.cookie(DARK_COOKIE) === 'true', currentDarkConditional = $.cookie(DARK_COOKIE_CONDITIONAL)...")
 
(remove wg.darkmode load that doesn't exist.)
 
(4 intermediate revisions by the same user not shown)
Line 98: Line 98:


if (currentReader) {
if (currentReader) {
                $('body').addClass('wgl-readermode');
mw.util.addPortletLink(
mw.util.addPortletLink(
'p-namespaces',
'p-namespaces',
Line 116: Line 117:
}
}


if (currentDark) {
$('body').addClass('wgl-darkmode');
}
if (currentDarkConditional) {
if (currentDarkConditional) {
var reloadRequired = (conditionalCheck != currentDark)
var reloadRequired = (conditionalCheck != currentDark)
Line 314: Line 318:


if (darkc === true) {
if (darkc === true) {
mw.loader.using(['wg.darkmode']).then(function() {
 
  $('body').addClass('wgl-darkmode')
  $('body').addClass('wgl-darkmode')
  $('body').removeClass('wgl-lightmode')
  $('body').removeClass('wgl-lightmode')
});
} else {
} else {
$('body').addClass('wgl-lightmode')
$('body').addClass('wgl-lightmode')

Navigation menu