forked from rDrama/rDrama
parent
e2629bc523
commit
df0c82ea9e
|
@ -14,8 +14,13 @@ popClickBadgeTemplateDOM.loading = "lazy";
|
||||||
popClickBadgeTemplateDOM.alt = "badge";
|
popClickBadgeTemplateDOM.alt = "badge";
|
||||||
|
|
||||||
document.addEventListener('shown.bs.popover', (e) => {
|
document.addEventListener('shown.bs.popover', (e) => {
|
||||||
let popover = document.getElementsByClassName("popover")
|
const popfix = document.getElementById("popover-fix")
|
||||||
popover = popover[popover.length-1]
|
if (popfix) document.body.removeChild(popfix);
|
||||||
|
|
||||||
|
const popover_old = document.getElementsByClassName("popover")[0];
|
||||||
|
const popover = document.createElement("DIV");
|
||||||
|
popover.innerHTML = popover_old.outerHTML;
|
||||||
|
popover.id = "popover-fix";
|
||||||
|
|
||||||
const author = JSON.parse(e.target.dataset.popInfo);
|
const author = JSON.parse(e.target.dataset.popInfo);
|
||||||
|
|
||||||
|
@ -52,8 +57,22 @@ document.addEventListener('shown.bs.popover', (e) => {
|
||||||
if (author["original_usernames"]) {
|
if (author["original_usernames"]) {
|
||||||
popover.getElementsByClassName('pop-original-usernames')[0].innerHTML = author["original_usernames"]
|
popover.getElementsByClassName('pop-original-usernames')[0].innerHTML = author["original_usernames"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.body.appendChild(popover);
|
||||||
|
document.body.removeChild(popover_old);
|
||||||
})
|
})
|
||||||
|
|
||||||
|
document.addEventListener("click", function(){
|
||||||
|
const cellText = document.getSelection();
|
||||||
|
if (cellText.type === 'Range') e.preventDefault();
|
||||||
|
|
||||||
|
active = document.activeElement.getAttributeNode("class");
|
||||||
|
if (!(active && active.nodeValue == "user-name text-decoration-none")){
|
||||||
|
const popfix = document.getElementById("popover-fix")
|
||||||
|
if (popfix) document.body.removeChild(popfix);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
function post(url) {
|
function post(url) {
|
||||||
const xhr = createXhrWithFormKey(url);
|
const xhr = createXhrWithFormKey(url);
|
||||||
xhr[0].send(xhr[1]);
|
xhr[0].send(xhr[1]);
|
||||||
|
|
Loading…
Reference in New Issue