/h3/ - hikari3 Discussion

Posting mode: Reply
Visit J-List - Your Favorite Online Shop and Friend in Japan
Get the Newest Figures from J-List - Your Favorite Online Shop and Friend in Japan

[]
05/21/24 Happy birthday hikari3! (News post)
12/21/23 Recent news post: Check here. Also, new board added: /i/ - Oekaki.
11/25/23 Accepting banner submissions; check this thread for more details.
11/17/23 New blotter! Use this to keep an eye for small updates.
[Show All]


Anonymous 07/04/2023 (Tue) 07:37:17 No. 73
I don't know if this intended behavior, but when I click on an emote from the dropdown, nothing happens. So, to add them to a reply, I have to manually type them I'm using Chrome, I haven't tried in other browsers, but it happens on different devices
>>
there's nothing wrong on your end, when i first added the emotes, i was trying to do a script that would add them when you click on it, but i wasn't able to do it for some reason... i tried many scripts, online references, etc but none of it would work so i just settled on having people type it in for now the reason why they seem clickable is they're html buttons with no script, but that's just temporary since it added borders for me im on work making a UI update that changes the little things i don't really like about the current stuff though, and i'll be sure to make it so that the buttons actually work
>>
What about something like this? [code] const fieldMessage = document.getElementById('fieldMessage') // Assuming that the <p> element containing the emotes has an ID, to make selection easier // The way the code is structured currently, this would only work for one row at a time const emoteButtons = document.getElementById('emoteButtons') for (const emoteButton of temp1.children) { const emoteText = emoteButton.children[1].innerText emoteButton.addEventListener('click', () => { fieldMessage.textContent += emoteText }) } [/code] This emote was added using the above code
>>
>>78 oh wow LOL thank you so much! i'll get to work on putting this in
>>
also i should probably enable the code tags to work on this board lol...
>>
>>80 Do they work for multi-line code as well?
>>
>>82 Did the changes take place already? The code highlighting is not showing for me
>>
>>84 unfortunately it doesn't change past posts from when it wasn't enabled if you post with code tags again it should work
>>
>>85 This is a test const fieldMessage = document.getElementById('fieldMessage') // Assuming that the <p> element containing the emotes has an ID, to make selection easier // The way the code is structured currently, this would only work for one row at a time const emoteButtons = document.getElementById('emoteButtons') for (const emoteButton of temp1.children) { const emoteText = emoteButton.children[1].innerText emoteButton.addEventListener('click', () => { fieldMessage.textContent += emoteText }) }
>>
yay! it works
>>
>>78 Here's an updated quick and dirty solution const fieldMessage = document.getElementById("fieldMessage"); const emoteButtons = document.querySelectorAll( "#fieldMessage ~ details > p:not(:first-of-type)" ); for (const row of emoteButtons) { for (const emoteButton of row.children) { const emoteText = emoteButton.children[1].innerText; emoteButton.addEventListener("click", () => { fieldMessage.value += emoteText; }); } } Just copy/pasting on the console menu of developer tools should do the job, but it's quite unpractical, since you'd have to do it each time So, I tried to add it to the custom JS code in settings, but the browser refuses to execute it, because of security reasons
>>
>>91 i got it working on a test instance, i'm gonna try to get it to work on here, and i'll try to see if i can modify it to work on quick replies as well thank you so much, it was a pain for me to try to do (since i am a JS newb)
>>
the buttons work now!
>>
>>93 Can confirm
>>
>>94 Although I noticed a small problem, it doesn't alter the text of the Quick Reply


Quick Reply