diff --git a/files/assets/emojis.json b/files/assets/emojis.json index 03f68efce..8d1e8de3e 100644 --- a/files/assets/emojis.json +++ b/files/assets/emojis.json @@ -777,6 +777,9 @@ {"name":"sharkysad","class":"Users"}, {"name":"sharkythink","class":"Users"}, + {"name":"ivoted", "tags":["democracy", "spider"],"class":"Misc"}, + {"name":"hapyday", "tags":["happyday", "wholesome", "smile"],"class":"Misc"}, + {"name":"froth", "tags":["froth", "seethe", "angry", "ugh", "frothing", "sneed"],"class":"Misc"}, {"name":"chadyescapy", "tags":["capy", "aevann"],"class":"Misc"}, {"name":"chadnocapy", "tags":["capy", "aevann"],"class":"Misc"}, {"name":"capygitcommit", "tags":["capy", "aevann"],"class":"Misc"}, diff --git a/files/assets/images/emojis/froth.webp b/files/assets/images/emojis/froth.webp new file mode 100644 index 000000000..e52c7d1ee Binary files /dev/null and b/files/assets/images/emojis/froth.webp differ diff --git a/files/assets/images/emojis/hapyday.webp b/files/assets/images/emojis/hapyday.webp new file mode 100644 index 000000000..f694cd66b Binary files /dev/null and b/files/assets/images/emojis/hapyday.webp differ diff --git a/files/assets/images/emojis/ivoted.webp b/files/assets/images/emojis/ivoted.webp new file mode 100644 index 000000000..5e966f3aa Binary files /dev/null and b/files/assets/images/emojis/ivoted.webp differ diff --git a/files/assets/js/emoji_modal.js b/files/assets/js/emoji_modal.js index 3e6ce5149..9b1555663 100644 --- a/files/assets/js/emoji_modal.js +++ b/files/assets/js/emoji_modal.js @@ -406,6 +406,8 @@ function emojiAddToInput(event) speed_carot_modal.style.display = "none"; document.body.appendChild(speed_carot_modal); + let e + let current_word = ""; let emojo_index = 0; @@ -458,8 +460,6 @@ function emojiAddToInput(event) function update_speed_emoji_modal(event) { - if (event.target.tagName.toLowerCase() !== 'textarea') return; - const box_coords = update_ghost_div_textarea(event.target); let text = event.target.value; @@ -504,11 +504,8 @@ function emojiAddToInput(event) } } - // Update emoji position - document.addEventListener('input', update_speed_emoji_modal, false); - - // Update emoji position - document.addEventListener('keydown', (e) => { + function speed_carot_navigate(e) + { let select_items = speed_carot_modal.querySelectorAll(".speed-modal-option"); if (!select_items || !curr_word_is_emoji()) return false; // Up or down arrow or enter @@ -516,7 +513,7 @@ function emojiAddToInput(event) { if (emojo_index > select_items.length) emojo_index = select_items; - + select_items[emojo_index].classList.remove("selected"); switch (e.keyCode) { @@ -539,7 +536,17 @@ function emojiAddToInput(event) select_items[emojo_index].classList.add("selected"); e.preventDefault(); } - }, false); + } + + // Let's get it running now + let forms = document.querySelectorAll("textarea, .allow-emojis"); + forms.forEach(i => { + let pseudo_div = document.createElement("div"); + pseudo_div.className = "ghostdiv"; + i.after(pseudo_div); + i.addEventListener('input', update_speed_emoji_modal, false); + i.addEventListener('keydown', speed_carot_navigate, false); + }); })(); diff --git a/files/templates/comments.html b/files/templates/comments.html index b7bd1cf2e..1708874b8 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -552,7 +552,6 @@ -
diff --git a/files/templates/submission.html b/files/templates/submission.html index 152eda2bd..0dc32c6be 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -983,7 +983,6 @@ -
diff --git a/files/templates/submit.html b/files/templates/submit.html index b03fc07f3..19c83553d 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -100,7 +100,7 @@ - + diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index 5071017d0..f07d0c27d 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -39,4 +39,4 @@ set CACHE_VER = { {%- macro asset_siteimg(name) -%} /i/{{SITE_NAME}}/{{name}}?v=3001 -{%- endmacro -%} \ No newline at end of file +{%- endmacro -%}