Code style update.
This commit is contained in:
parent
76a5987a23
commit
94462d172c
5
themes/patek/assets/js/dark-mode.js
Normal file
5
themes/patek/assets/js/dark-mode.js
Normal file
@ -0,0 +1,5 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
if (window.location.search.indexOf("darkmode=true") > -1) {
|
||||
document.getElementById("content").classList.add("dark-mode");
|
||||
}
|
||||
});
|
@ -1,5 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
if (window.location.search.indexOf("darkmode=true") > -1) {
|
||||
document.getElementById("content").classList.add("dark-mode");
|
||||
}
|
||||
});
|
10
themes/patek/assets/js/header-link.js
Normal file
10
themes/patek/assets/js/header-link.js
Normal file
@ -0,0 +1,10 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const headings = document.querySelectorAll(".content h1, .content h2, .content h3, .content h4, .content h5, .content h6");
|
||||
headings.forEach(e => {
|
||||
const a = document.createElement("a");
|
||||
a.href = "#" + e.id;
|
||||
a.innerText = "#";
|
||||
a.classList.add("header-link");
|
||||
e.prepend(a);
|
||||
});
|
||||
});
|
@ -1,10 +0,0 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const headings = document.querySelectorAll(".content h1, .content h2, .content h3, .content h4, .content h5, .content h6");
|
||||
headings.forEach(e => {
|
||||
const a = document.createElement("a");
|
||||
a.href = "#" + e.id;
|
||||
a.innerText = "#";
|
||||
a.classList.add("header-link");
|
||||
e.prepend(a);
|
||||
});
|
||||
});
|
@ -1 +1 @@
|
||||
Subproject commit 895805bda1cfc4adc016826c79c400a6d8be6f34
|
||||
Subproject commit 0a5cf1419b3555f16a069eaa562ebb122b2f6f5d
|
@ -11,9 +11,9 @@
|
||||
<meta name="theme-color" content="#0b2a37">
|
||||
{{- end }}
|
||||
{{ block "js" . -}}
|
||||
{{ partial "js.html" "js/headerLink.js" }}
|
||||
{{ partial "js.html" "js/patek-logo-custom-element/patekLogo.js" }}
|
||||
{{ partial "js.html" "js/darkMode.js" }}
|
||||
{{ partial "js.html" "js/header-link.js" }}
|
||||
{{ partial "js.html" "js/patek-logo-custom-element/patek-logo.js" }}
|
||||
{{ partial "js.html" "js/dark-mode.js" }}
|
||||
{{ end }}
|
||||
<body>
|
||||
{{ block "body" . }}
|
||||
|
Loading…
Reference in New Issue
Block a user