whisper.cat/weboasis/faq/net/faq.min.js
2023-10-05 23:28:32 +11:00

1 line
1.8 KiB
JavaScript

history.scrollRestoration="manual";let questions=document.getElementsByClassName("panel-default"),answers=document.getElementsByClassName("toggleAnswer");for(i=0;i<questions.length;i++)questions[i].addEventListener("click",function(a){a.preventDefault();var b=this.nextElementSibling;"block"===b.style.display?b.style.display="none":(b.style.display="block",this.scrollIntoView({block:"nearest",behavior:"smooth"}))});let re=/#(.*)/;if(re.exec(window.location.href)){var x=re.exec(window.location.href)[1];let a=document.getElementById(x);a.parentElement.previousElementSibling.scrollIntoView({block:"start"}),a.parentElement.style.display="block"}function listExpansion(){let a="true"==document.getElementById("expand").getAttribute("expanding"),b=document.querySelectorAll(".toggleAnswer");a||(b=document.querySelectorAll(".toggleAnswer"));for(let c=0;c<b.length;c++)b[c].style.display=a?"block":"none";let c=!a;document.getElementById("expand").innerHTML=c?"Expand":"Collapse",document.getElementById("expand").innerHTML=c?"Expand":"Collapse",document.getElementById("expand").setAttribute("expanding",c)}window.listExpansion=listExpansion,document.getElementById("expand").setAttribute("expanding",!0);function copyLink(a){var b=a.nextElementSibling;b.innerHTML="Copied!";var c=a.parentElement.parentElement.id,d=document.createElement("textarea");document.body.appendChild(d),d.value="https://weboas.is/faq/net/#"+c,d.select(),document.execCommand("copy"),document.body.removeChild(d)}let allShareButton=document.getElementsByClassName("sharebtn");for(i=0;i<allShareButton.length;i++)allShareButton[i].addEventListener("mouseover",function(){var a=this.nextElementSibling;a.style.display="block"}),allShareButton[i].addEventListener("mouseout",function(){var a=this.nextElementSibling;a.style.display="none",a.innerHTML="Copy"});