Created
October 24, 2024 09:51
-
-
Save justsml/f29ebc040e564fb1b33f13c8ed2634be to your computer and use it in GitHub Desktop.
Revisions
-
justsml created this gist
Oct 24, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ // This script makes it very fast to drag and drop files into the Slack Emoji Admin page var isModalOpen = () => Boolean(document.querySelector('.ReactModal__Content--after-open')) function openModal() { var addBtn = document.querySelector('[data-qa="customize_emoji_add_button"]') // modal closed, open it again if (addBtn) addBtn.click() } var $timer = setInterval(() => { if (isModalOpen()) { var visibleForm = document.querySelector('.p-add_custom_emoji_dialog__form') if (visibleForm) { // clearInterval($timer) var fileName = document.querySelector('.p-add_custom_emoji_dialog__filename')?.innerHTML; if (fileName) { // auto save! var saveModalButton = document.querySelector('[data-qa="customize_emoji_add_dialog_go"]') saveModalButton.click() // auto open, fast setTimeout(openModal, 120) } } } else { openModal() } }, 100); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ // 1. Run in console on slack emoji admin page, // 2. scroll your entire list // 3. when done run `stopCapture()` for your Emoji names + URLs var emojis = {}; var $timer = setInterval(captureEmojis, 50); function captureEmojis() { document.querySelectorAll(".p-customize_emoji_list__image").forEach((el) => { emojis[el.alt] = el.src; }); } function stopCapture() { clearInterval($timer); console.dir(emojis); }