Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
Fix emoji picker grid observer for all languages
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusAquino authored Jan 24, 2021
1 parent 050c3a3 commit 473f565
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions ImageEmojis.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var ImageEmojis = (() => {
class Plugin {
getName() {return "ImageEmojis"}
getShortName() {return "ie"}
getDescription() {return "Unlock every single Discord emoji as images/gifs (Nitro Alternative). Just Right-Click it."}
getVersion() {return "0.1.0"}
getDescription() {return "Unlock every single Discord emoji as images/gifs. Just Right-Click it."}
getVersion() {return "0.1.1"}
getAuthor() {return "Mafios"}
load() {
if (window.ZLibrary)
Expand All @@ -16,7 +16,6 @@ var ImageEmojis = (() => {
);
}
start() {
this.onStack = false;
this.style = document.createElement('style');
this.style.innerHTML = `li[class^='emojiItem'], li[class*=' emojiItem'] { filter: none; -webkit-filter: none; } #ie-svg { -webkit-transition: all 0.1s ease-in-out;-moz-transition: all 0.1s ease-in-out;-ms-transition: all 0.1s ease-in-out;-o-transition: all 0.1s ease-in-out; }`;
document.head.appendChild(this.style);
Expand All @@ -26,16 +25,13 @@ var ImageEmojis = (() => {
this.style.remove();
}
observer(o) {
if (o.target.textContent && this.context(o.target.textContent, ['Utilizados com frequência', 'Frequently Used', 'Favorites', 'Favoritos', 'Pinned', 'People', 'Pessoas']))
if (o.target.id === "emoji-picker-grid")
o.target.addEventListener('contextmenu', e => {

// Get URL of Selected Emoji
e = e || window.event;
e = e.target || e.srcElement;
let url = e.children[0].src;
if (!url || this.onStack) return;
this.onStack = true;
setTimeout(() => this.onStack=false, 150);
if (!url) return;
let size = BdApi.loadData('ImageEmojis', 'fixedSize') | 0;
if (size) url+=`&size=${size}`;

Expand Down

0 comments on commit 473f565

Please sign in to comment.