Open "about" paragraph by default

Fixes #36.
This commit is contained in:
Florine W. Dekker 2020-08-12 11:38:49 +02:00
parent 51c91900ff
commit 6c0dd74e63
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
3 changed files with 12 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "interlanguage-checker",
"version": "1.10.15",
"version": "1.10.16",
"description": "Check the consistency of MediaWiki interlanguage links in a simple overview.",
"author": "Felix W. Dekker",
"browser": "dist/bundle.js",

View File

@ -32,7 +32,7 @@
<section class="container">
<div class="row">
<div class="column">
<details>
<details open id="about">
<summary><b>About</b></summary>
<span>
<a href="https://community.fandom.com/wiki/Help:Interlanguage_link">Interlanguage links</a>

View File

@ -23,6 +23,16 @@ doAfterLoad(() => {
$("main").style.display = null;
});
doAfterLoad(() => {
const about = $("#about");
const key = "/tools/interlanguage-checker//toggle-about";
about.addEventListener("toggle", () => localStorage.setItem(key, "" + !!about.open));
const storedState = localStorage.getItem(key);
if (storedState === null) about.open = true;
else about.open = storedState === "true";
});
doAfterLoad(async () => {
const urlInput = new ValidatableInput($("#url"), (value) => {