mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00

* Migrate check_copyright to Rust * Add a new lint to check accidental usages of /// in ts/svelte comments * Fix a bunch of incorrect jdoc comments * Move contributor check into minilints Will allow users to detect the issue locally with './ninja check' before pushing to CI. * Make Cargo.toml consistent with other crates
12 lines
445 B
TypeScript
12 lines
445 B
TypeScript
// Copyright: Ankitects Pty Ltd and contributors
|
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
/** Add night-mode class to documentElement if hash location is #night, and
|
|
return true if added. */
|
|
export function checkNightMode(): boolean {
|
|
const nightMode = window.location.hash == "#night";
|
|
if (nightMode) {
|
|
document.documentElement.className = "night-mode";
|
|
}
|
|
return nightMode;
|
|
}
|