summaryrefslogtreecommitdiffstats
path: root/static/assets/js
diff options
context:
space:
mode:
Diffstat (limited to 'static/assets/js')
-rw-r--r--static/assets/js/fuji.min.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/static/assets/js/fuji.min.js b/static/assets/js/fuji.min.js
index b3940da..c21a20f 100644
--- a/static/assets/js/fuji.min.js
+++ b/static/assets/js/fuji.min.js
@@ -1 +1 @@
-"use strict";function getNowTheme(){var t=document.body.getAttribute("data-theme");return"auto"===t?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark"===t?"dark":"light"}function updateUtterancesTheme(t){var e=getNowTheme();t&&("dark"===e?t.contentWindow.postMessage({type:"set-theme",theme:"photon-dark"},"https://utteranc.es"):t.contentWindow.postMessage({type:"set-theme",theme:"github-light"},"https://utteranc.es"))}document.querySelector("span.post-comment-notloaded")&&document.querySelector("span.post-comment-notloaded").addEventListener("click",loadComment),document.querySelector(".btn .btn-scroll-top").addEventListener("click",function(){document.documentElement.scrollTop=0}),document.querySelector(".btn .btn-toggle-mode").addEventListener("click",function(){var t=getNowTheme(),e=document.body.getAttribute("data-theme"),o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";"auto"===e?(document.body.setAttribute("data-theme","light"===t?"dark":"light"),localStorage.setItem("fuji_data-theme","light"===t?"dark":"light")):"light"===e?(document.body.setAttribute("data-theme","dark"),localStorage.setItem("fuji_data-theme","dark"==o?"auto":"dark")):(document.body.setAttribute("data-theme","light"),localStorage.setItem("fuji_data-theme","light"==o?"auto":"light"));var a=document.querySelector(".post-comment");a&&document.querySelector("span.post-comment-notloaded").getAttribute("style")&&("utterances"===a.getAttribute("data-comment")&&updateUtterancesTheme(document.querySelector(".post-comment iframe")),"disqus"===a.getAttribute("data-comment")&&DISQUS.reset({reload:!0}))}); \ No newline at end of file
+"use strict";function getNowTheme(){var e=document.body.getAttribute("data-theme");return"auto"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":"dark"===e?"dark":"light"}function updateUtterancesTheme(e){var t=getNowTheme();e&&("dark"===t?e.contentWindow.postMessage({type:"set-theme",theme:"photon-dark"},"https://utteranc.es"):e.contentWindow.postMessage({type:"set-theme",theme:"github-light"},"https://utteranc.es"))}function searchAll(e,t){var o=new Fuse(t,{keys:["title","tags"]}).search(e);console.log(o),0<o.length&&(document.getElementById("search-result").innerHTML=template("search-result-template",o))}document.querySelector("span.post-comment-notloaded")&&document.querySelector("span.post-comment-notloaded").addEventListener("click",loadComment),document.querySelector(".btn .btn-scroll-top").addEventListener("click",function(){document.documentElement.scrollTop=0}),document.querySelector(".btn .btn-toggle-mode").addEventListener("click",function(){var e=getNowTheme(),t=document.body.getAttribute("data-theme"),o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";"auto"===t?(document.body.setAttribute("data-theme","light"===e?"dark":"light"),localStorage.setItem("fuji_data-theme","light"===e?"dark":"light")):"light"===t?(document.body.setAttribute("data-theme","dark"),localStorage.setItem("fuji_data-theme","dark"==o?"auto":"dark")):(document.body.setAttribute("data-theme","light"),localStorage.setItem("fuji_data-theme","light"==o?"auto":"light"));var r=document.querySelector(".post-comment");r&&document.querySelector("span.post-comment-notloaded").getAttribute("style")&&("utterances"===r.getAttribute("data-comment")&&updateUtterancesTheme(document.querySelector(".post-comment iframe")),"disqus"===r.getAttribute("data-comment")&&DISQUS.reset({reload:!0}))});var key,xhr,urlParams=new URLSearchParams(window.location.search);urlParams.has("search")&&(key=urlParams.get("search"),document.querySelector(".search-input input").setAttribute("value",key),(xhr=new XMLHttpRequest).open("GET","/index.json",!0),xhr.responseType="json",xhr.onerror=function(e){console.error("".concat(xhr.status," ").concat(xhr.statusText))},xhr.onload=function(){4===xhr.readyState&&(200===xhr.status?(console.log(xhr.response),searchAll(key,xhr.response)):console.error("".concat(xhr.status," ").concat(xhr.statusText)))},xhr.send(null)); \ No newline at end of file