We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2536ab commit 919d941Copy full SHA for 919d941
1 file changed
static/gen_utils.js
@@ -0,0 +1,21 @@
1
+function fetchApplyLayout(layoutUrl, containerId) {
2
+ window.addEventListener("DOMContentLoaded", async () => {
3
+ var layout = await fetch(layoutUrl);
4
+ var parser = new DOMParser();
5
+ var doc = parser.parseFromString(await layout.text(), 'text/html');
6
+ var container = doc.getElementById(containerId);
7
+ container.innerHTML = document.body.innerHTML;
8
+ document.replaceChild(
9
+ document.adoptNode(doc.documentElement),
10
+ document.documentElement
11
+ );
12
+ })
13
+}
14
+
15
+function tryRedirectToLower() {
16
+ var currentURL = window.location.href;
17
+ var lowerCaseURL = currentURL.toLowerCase();
18
+ if (currentURL != lowerCaseURL) {
19
+ location.replace(lowerCaseURL);
20
+ }
21
0 commit comments