shift = don't close
This commit is contained in:
parent
f9dcdf8044
commit
e5afe772e3
1 changed files with 15 additions and 3 deletions
18
extra.js
18
extra.js
|
@ -96,6 +96,15 @@ if(window.PvInternals.services_client) {
|
|||
style.innerHTML = `pv-chat>div button:nth-child(3){position:absolute;right:40px;z-index:26;cursor:url(88b4a467a18e813218f8.cur),auto;font-size:1em;border:none;height:46px;aspect-ratio:1;padding:0;border-radius:0;box-shadow:none;margin:0;flex:0;color:var(--color-text)}pv-chat>div button:nth-child(3)>img:hover{transform-origin:50% 50%;transform:scale(1.4);transition:.1s}pv-chat>div input[type=text]{padding:0 90px 0 14px}.emoji-container{display:grid;grid-template-columns:auto auto auto auto auto auto}.emoji-container>*{text-align:center;margin:2px}`
|
||||
document.head.appendChild(style);
|
||||
|
||||
let shiftHeldDown = false; // ShiftLeft/Right or False
|
||||
|
||||
document.addEventListener("keydown", (e) => {
|
||||
if(!shiftHeldDown) shiftHeldDown = e.code;
|
||||
})
|
||||
|
||||
document.addEventListener("keyup", (e) => {
|
||||
if(e.code == shiftHeldDown) shiftHeldDown = false;
|
||||
})
|
||||
|
||||
const pv = window.PvInternals;
|
||||
const emojiRequest = await fetch("emojis.json");
|
||||
|
@ -117,6 +126,7 @@ if(window.PvInternals.services_client) {
|
|||
|
||||
//#region Modal
|
||||
class PvmeEmojiPicker extends pv.components_pv_popup_pv_popup {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
|
@ -148,7 +158,7 @@ if(window.PvInternals.services_client) {
|
|||
|
||||
// #region Modal info
|
||||
const info = document.createElement("p")
|
||||
info.innerText = "Write 'discord' for discord emoijs, anything else for normal ones."
|
||||
info.innerText = "Write 'discord' for discord emoijs, anything else for normal ones.\nHold shift before opening emoji picker to spam emojis."
|
||||
content.appendChild(info);
|
||||
//#endregion
|
||||
|
||||
|
@ -173,7 +183,8 @@ if(window.PvInternals.services_client) {
|
|||
div.addEventListener("click", () => {
|
||||
const chat = document.querySelector("pv-chat");
|
||||
chat.input.value += z[1] + " ";
|
||||
pv.PopupManager.closeModals();
|
||||
console.log(shiftHeldDown)
|
||||
if(!shiftHeldDown) pv.PopupManager.closeModals();
|
||||
setTimeout(() => {
|
||||
document.querySelector("pv-chat").input.scrollLeft = document.querySelector("pv-chat").input.scrollWidth;
|
||||
}, 50)
|
||||
|
@ -186,7 +197,8 @@ if(window.PvInternals.services_client) {
|
|||
img.addEventListener("click", () => {
|
||||
const chat = document.querySelector("pv-chat");
|
||||
chat.input.value += z + " ";
|
||||
pv.PopupManager.closeModals();
|
||||
console.log(shiftHeldDown)
|
||||
if(!shiftHeldDown) pv.PopupManager.closeModals();
|
||||
setTimeout(() => {
|
||||
document.querySelector("pv-chat").input.scrollLeft = document.querySelector("pv-chat").input.scrollWidth;
|
||||
}, 50)
|
||||
|
|
Loading…
Reference in a new issue