-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabridge.min.js
1 lines (1 loc) · 1.88 KB
/
abridge.min.js
1
const items=document.querySelectorAll(".preStyle");items.forEach(e=>{e.rel="stylesheet"}),window.onload=function(){document.getElementById("searchinput").onclick=function(){var e=document.querySelector("meta[name='base']").getAttribute("content"),t=("/"==e.slice(-1)&&(e=e.slice(0,-1)),document.createElement("script"));t.src=e+"/search_bundle.min.js?h=76e65002d7da460de8f632427edc6d7d78332c34253012931b71179995418c35",t.setAttribute("integrity","sha384-sFalNeH0DxM4NNZpgi1nVlggG/Q0VN3CcRufOgPOXLtpmfWbJFYQ7cVkFkBnLTsw"),document.head.appendChild(t),document.getElementById("searchinput").onclick=""}},function(){for(var e=document.getElementsByClassName("m-protected"),t=0;t<e.length;t++){var n=e[t].getAttribute("href"),n=atob(n.substring(1));e[t].href="mailto:"+n}}(),function(){function t(e){const t=document.createElement("button");t.className="cc ",t.type="button",t.innerHTML="Copy",t.addEventListener("click",()=>async function(e,t){var n=t.querySelectorAll("table")["length"];let c="";0<n?t.querySelectorAll(":last-child > tr > td:last-child").forEach(e=>{c+=e.innerText}):c=t.querySelector(":last-child > code").innerText;try{"granted"==(result=await navigator.permissions.query({name:"clipboard-write"})).state||"prompt"==result.state?await navigator.clipboard.writeText(c):a(c,t)}catch(e){a(c,t)}finally{e.innerHTML="Copied",setTimeout(function(){e.innerHTML="Copy"},2e3)}}(t,e));var n=document.createElement("div");n.className="ccw",n.appendChild(t),e.parentNode.insertBefore(n,e),n.appendChild(e)}function a(e,t){var n=document.createElement("textArea"),e=(n.contentEditable="true",n.readOnly="false",n.className="copyable-text-area",n.value=e,t.insertBefore(n,t.firstChild),document.createRange()),c=(e.selectNodeContents(n),window.getSelection());c.removeAllRanges(),c.addRange(e),n.setSelectionRange(0,999999),document.execCommand("copy"),t.removeChild(n)}document.querySelectorAll("pre").forEach(e=>t(e))}();