[ all ] [ a / b / c / f / h / jp / l / o / q / s / sw / lounge ] [ cgi ] [ up ] [ wiki ]
[Home] [Catalog] [Search] [RSS feed] [Inbox] [Write PM] [Admin]
[Return]
Posting mode: Reply
[]
(for deletion, 8 chars max)
  • Allowed file types are: GIF, JPG, JPEG, PNG, BMP, SWF, WEBM, MP4
  • Maximum file size allowed is 50000 KB.
  • Images greater than 200 * 200 pixels will be thumbnailed.

  • Switch Form Position | BBCode Reference
  • Read the rules before you post.
  • Protect your username, use a tripcode!
  • 日本のへゆり
    boku

  • 2025/05/04 - Heyuri Calendar has been launched. Find out about upcoming Heyuri events!
  • 2025/04/01 - NEW GAME: Slime Breeder! Commit slimecest with your ancestors to create teh ultimate slime!
  • 2024/09/12 - NEW GAME: Battle Royale R! Make characters and see if they can win the Heyuri Cup!
  • 2024/09/10 - Tegaki function has been added
  • [Show All]


File: question.gif
(577 KB, 512x504) [ImgOps]
577 KB
is there a chance of getting the emote/emoji/kaomoji buttons to insert at the cursor instead of at the end of the textbox?
pretty much nowhere else works like that and it's kind of awkward adding things to a post as it stands, very fiddly

you just split the textbox into two substrings, one with stuff before the cursor and one with stuff after
and set the textbox contents to be the text from the button concatenated into the middle of those two strins instead of just doing it at the end of the textbox contents
https://stackoverflow.com/a/11077016

Marked for deletion (Old)
>>
if someone teaches me what I need to change in https://static.heyuri.net/js/addemotes.js , sure
it's black magic to me...
>>
all the spots with COMMENT.value+= (whatever)
should be changed

not at home now, I might be able to make the exact changes in like 7 hours lol ┐(゚~゚)┌
>>
you need to store the caret position, splice the kamoji in at that point, add the length of the kaomoji to the stored position, then set the new position to the sum.

https://developer.mozilla.org/en-US/docs/Web/API/CaretPosition
>>
actually the selection range api is the safer way to do it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
>>
File: cirno-1694293785149819.gif
(890 KB, 295x305) [ImgOps]
890 KB
okay, I think I did it, here's the edited script
https://up.heyuri.net/src/3512.txt

didn't use the setSelectionRange API, I basically just applied that StackOverflow answer

not 100% sure I didn't break anything since testing was kind of awkward on a saved static page (a lot of stuff was broken just because of the save)
but I don't think I did
>>
❤💛💚💙the changes are live, thanks!
👍━━━(・∀・)━━━👍


Delete Post: []
Password:
First[0] Last