You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
1.0 KiB
2 lines
1.0 KiB
window.addEventListener("contextmenu",RightClickMenu);const rightMenu=document.querySelector("#rcb_menu"),newTab=document.querySelector("#rcb_t6");function RightClickMenu(e){e.preventDefault(),rightMenu.style.display="block",e.target.closest("a")?newTab.style.display="block":newTab.style.display="none";let t=e.clientX,n=e.clientY,i=rightMenu.offsetWidth,o=rightMenu.offsetHeight,c=document.body.clientWidth,r=document.body.clientHeight;rightMenu.style.left=t+i<c?t+"px":c-i+"px",rightMenu.style.top=n+o<r?n+"px":r-o+"px"}document.body.addEventListener("click",(function(){rightMenu.style.display="none"})),rightMenu.addEventListener("click",(function(e){switch(e.target.id){case"rcb_t1":window.location.href="/";break;case"rcb_t2":window.location.href="#";break;case"rcb_t3":window.history.back(-1);break;case"rcb_t4":window.history.forward(1);break;case"rcb_t5":window.location.reload();break;case"rcb_t6":if(e.target.closest("a")){var t=e.target.closest("a"),n=encodeURIComponent(t.getAttribute("href"));window.open(n)}break;default:console.error(e.target.id)}}));
|