MediaWiki:Common.js: Difference between revisions

From jugglingpatterns
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
// use by using Template:AnimateSiteswap which provides the matching html
// use by using Template:AnimateSiteswap which provides the matching html
import("/js/animation.js");
import("/js/animation.js");
import("/js/darkreader/darkreader.js");
import("/js/mydarkreader.js");
mw.loader.load('//he.wikipedia.org/w/index.php?title=Mediawiki:Gadget-ime.js&action=raw&ctype=text/javascript');

DarkReader.enable({
brightness: 100,
contrast: 90,
sepia: 10
});

DarkReader.disable();

// Enable when the system color scheme is dark.
DarkReader.auto({
brightness: 100,
contrast: 90,
sepia: 10
});

// Stop watching for the system color scheme.
DarkReader.auto(false);

// Get the generated CSS of Dark Reader returned as a string.
const CSS = await DarkReader.exportGeneratedCSS();

// Check if Dark Reader is enabled.
const isEnabled = DarkReader.isEnabled();

Latest revision as of 08:41, 3 July 2025

// use by using Template:AnimateSiteswap which provides the matching html
import("/js/animation.js");
import("/js/mydarkreader.js");
mw.loader.load('//he.wikipedia.org/w/index.php?title=Mediawiki:Gadget-ime.js&action=raw&ctype=text/javascript');