aboutsummaryrefslogtreecommitdiff
path: root/static/js/abridge_nosearch.min.js
diff options
context:
space:
mode:
authorJieiku2023-09-11 13:16:05 -0700
committerJieiku2023-09-11 13:16:05 -0700
commitc44af9da6d9db0f420eabce146058ae0ac48b353 (patch)
tree018f27c86de834580cc225a67cbaeaf0522ef449 /static/js/abridge_nosearch.min.js
parent4d89eb007a635c7c3ff69e496bac71746e93e80e (diff)
downloadabridge-2.3.0.tar.gz
abridge-2.3.0.tar.bz2
abridge-2.3.0.zip
PWA Fixes, Options, Optimizations2.3.0
Diffstat (limited to 'static/js/abridge_nosearch.min.js')
-rw-r--r--static/js/abridge_nosearch.min.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/static/js/abridge_nosearch.min.js b/static/js/abridge_nosearch.min.js
index dd67a9b..e90acf7 100644
--- a/static/js/abridge_nosearch.min.js
+++ b/static/js/abridge_nosearch.min.js
@@ -1 +1 @@
-const items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),!function(){for(var e=document.getElementsByClassName("m-protected"),t=0;t<e.length;t++){var o=e[t].getAttribute("href"),o=atob(o.substring(1));e[t].href="mailto:"+o}}(),(e,t)=>{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{const t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),"serviceWorker"in navigator&&(navigator.serviceWorker.register("/sw.min.js?v=3.10.0",{scope:"/"}).then(()=>{},e=>{}),navigator.serviceWorker.ready.then(()=>{})); \ No newline at end of file
+const items=document.querySelectorAll(".preStyle"),changeIcon=(items.forEach(e=>{e.rel="stylesheet"}),document.getElementById("mode")&&document.getElementById("mode").addEventListener("click",()=>{document.documentElement.classList.toggle("switch"),localStorage.setItem("theme",document.documentElement.classList.contains("switch")?"switch":"default")}),!function(){for(var e=document.getElementsByClassName("m-protected"),t=0;t<e.length;t++){var o=e[t].getAttribute("href"),o=atob(o.substring(1));e[t].href="mailto:"+o}}(),(e,t)=>{e.classList.add(t),setTimeout(()=>e.classList.remove(t),2500)}),copyCodeAndChangeIcon=async(t,e)=>{e=(e.querySelector("table")?getTableCode:getNonTableCode)(e);try{await navigator.clipboard.writeText(e),changeIcon(t,"yes")}catch(e){changeIcon(t,"err")}},getNonTableCode=e=>[...e.querySelectorAll("code")].map(e=>e.textContent).join(""),getTableCode=e=>[...e.querySelectorAll("tr")].map(e=>e.querySelector("td:last-child")?.innerText??"").join("");document.querySelectorAll("pre").forEach(e=>{const t=document.createElement("div");t.className="cc svgs svgh copy",t.innerHTML=" ",e.prepend(t),t.addEventListener("click",()=>copyCodeAndChangeIcon(t,e))}),"serviceWorker"in navigator&&(navigator.serviceWorker.register("/sw.min.js?v=3.11.0",{scope:"/"}).then(()=>{},e=>{}),navigator.serviceWorker.ready.then(()=>{})); \ No newline at end of file