Advertisement
Guest User

Untitled

a guest
Apr 1st, 2022
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function() {
  2.   if (document.getElementById("qr")) inject();
  3.   document.addEventListener("QRDialogCreation", () => inject());
  4.  
  5.   document.addEventListener("click", e => {
  6.     if (e.target.classList.contains("xa-em-emote")) {
  7.       // Prevent event from adding unnecessary null in the field if
  8.       // you click on cancel when attempting to unlock a new emote
  9.       if (!(e.target.getAttribute("data-tip"))) return;
  10.       document.querySelector("#qr textarea[data-name=com]").value += e.target.getAttribute("data-tip");
  11.     }
  12.   })
  13.  
  14.   function inject() {
  15.     if (document.querySelector("script[src*=emotes2022]")) {
  16.       const button = document.createElement("div");
  17.       button.style = "display:inline-block;cursor:pointer;float:right";
  18.       button.setAttribute("data-xa-cmd", "open");
  19.       button.innerHTML = "🙂";
  20.       document.querySelector("#qr .persona").appendChild(button)
  21.     }
  22.   }
  23. })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement