diff --git a/package-lock.json b/package-lock.json index 7a3da26..09d14f6 100644 Binary files a/package-lock.json and b/package-lock.json differ diff --git a/package.json b/package.json index a3da9e9..1499a78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "doomsday", - "version": "1.3.6", + "version": "1.3.7", "description": "Test your mastery of Conway's Doomsday rule.", "author": "Felix W. Dekker", "browser": "dist/bundle.js", @@ -16,11 +16,9 @@ "deploy": "grunt deploy" }, "dependencies": { - "@fwdekker/template": "^0.0.18", - "js-cookie": "^2.2.1" + "@fwdekker/template": "^0.0.20" }, "devDependencies": { - "@types/js-cookie": "^2.2.6", "grunt": "^1.2.1", "grunt-cli": "^1.3.2", "grunt-contrib-clean": "^2.0.0", diff --git a/src/main/js/index.js b/src/main/js/index.js index 471f3d5..3564ba3 100644 --- a/src/main/js/index.js +++ b/src/main/js/index.js @@ -1,5 +1,4 @@ import {$, doAfterLoad, footer, header, nav} from "@fwdekker/template"; -import Cookies from "js-cookie"; /** @@ -152,7 +151,7 @@ class ValidatableInput { } /** - * A wrapper around a `
` element that persists the state in a cookie. + * A wrapper around a `
` element that persists the state in local storage. */ class ToggleableSection { /** @@ -204,8 +203,7 @@ class ToggleableSection { * @private */ _storeToggle() { - Cookies.set(`toggle-${this._name}`, "" + this.isOpened(), - {expires: 365 * 10, secure: true, sameSite: "lax", path: ""}); + localStorage.setItem(`/tools/doomsday//toggle-${this._name}`, "" + this.isOpened()); } /** @@ -214,7 +212,7 @@ class ToggleableSection { * @private */ _loadToggle() { - const target = Cookies.get(`toggle-${this._name}`); + const target = localStorage.getItem(`/tools/doomsday//toggle-${this._name}`); if (target === undefined) { this._storeToggle(); return;