From b169a5880fd346d5c23154eba50f29b2c01f0eb9 Mon Sep 17 00:00:00 2001
From: Emile Bangma <ewjbangma@hotmail.com>
Date: Mon, 05 Feb 2024 21:12:54 +0000
Subject: [PATCH] feat(i18n): Add Dutch to i18n (#813)
---
quartz/components/scripts/util.ts | 19 +++----------------
1 files changed, 3 insertions(+), 16 deletions(-)
diff --git a/quartz/components/scripts/util.ts b/quartz/components/scripts/util.ts
index e94929b..4ffff29 100644
--- a/quartz/components/scripts/util.ts
+++ b/quartz/components/scripts/util.ts
@@ -12,23 +12,10 @@
cb()
}
- outsideContainer?.removeEventListener("click", click)
outsideContainer?.addEventListener("click", click)
- document.removeEventListener("keydown", esc)
- document.addEventListener('keydown', esc)
-}
-
-export function stripIndex(s: string): string {
- return s.endsWith("index") ? s.slice(0, -"index".length) : s
-}
-
-export function relative(from: string, to: string) {
- from = encodeURI(stripIndex(from))
- to = encodeURI(stripIndex(to))
- const start = [location.protocol, '//', location.host, location.pathname].join('')
- const trimEnd = from.length === 0 ? start.length : -from.length
- const url = start.slice(0, trimEnd) + to
- return url
+ window.addCleanup(() => outsideContainer?.removeEventListener("click", click))
+ document.addEventListener("keydown", esc)
+ window.addCleanup(() => document.removeEventListener("keydown", esc))
}
export function removeAllChildren(node: HTMLElement) {
--
Gitblit v1.10.0