Heyuri / kokonotsuba

Heyuri's BBS software
Other
19 stars 14 forks source link

Add tegaki.js #111

Closed kaguy4 closed 3 days ago

kaguy4 commented 1 month ago

Borrow futaba's tegaki feature

Go to any futaba thread, see there is a "手書きjs" under "コメント" Check it out. Port it to kokonotsuba. Futaba gives them the filename "unixtimestamp.png", (as all their filenames are unix stamps), but they can probably just all be "tegaki.jpg" too (as attaching unix timestamps to posts is rather a PHP thing. Can probably be done with JS with slightly earlier timestamp too, doesn't matter much)

It would be good if it somehow allows using http://hadacan.web.fc2.com/tegaki/index.html too (or maybe can also be ported?)

The original script is Japanese, but translating it would probably be the easy part of it. You can leave add it in Japanese too, and it would get translated later on. Not sure how high level this would be, but the best is having a language switch option, that would let users decide between EN/JP. And only if browser's language is Japanese should it display JP by default.

anonwaha commented 1 month ago

There is also https://appsweets.net/momo/

hachikuji-san commented 1 week ago

The script was adapted to be usuable on koko by COW, it just needs translation from japanese to english

anonwaha commented 1 week ago

I translated teh userscript version to English: https://pastebin.com/XBxFk3xZ (I dunno what needs changing to turn it back into a regular script, if anything)

Note that this script makes use of a CSS file and lots of SVG files that are hotlinked from the appsweets.net site. These files will need importing and paths need adjusting if we wanna host the whole thing locally and not risk losing them whenever their site aspl0des ^^;

anonwaha commented 1 week ago

I compiled all teh files (I think) and uploaded them here: https://up.heyuri.net/src/3833.7z

kaguy4 commented 1 week ago

I will add to heyuri the appsweets version for now, but the script should define the static folder (default can be ./static, but I'd change to the absolute static.heyuri.net for example) at top of the file and images/css should be appropriately prefixed with that

since there are many svg files, they can go to a new folder liek static/image/tegaki/ I'm not sure what's can.php doing?

anonwaha commented 1 week ago

"can.php" is just the original untranslated JS script - their site serves it via a PHP script, so when I saved it it was ".php". I included it cuz why not ^^;

kaguy4 commented 1 week ago

After choosing "Finish drawing", if you select it again and press "Cancel", it's removed from the post form but remains in file selector thing. Clicking "Cancel" should also trigger whatever does [x] (I think it does $id('upfile').value=''; )

See how the filename remains, meaning it would get posted despite the preview not being there image

an0nc0w commented 1 week ago

I've modified the script now it links css and images from the directory where the script is located. You can change it to another location by modifyingMOMO_URL:

const MOMO_URL = 'https://example.com/momo';

Clicking Cancel now clears the file selector.

Also fixed a bug in the merge layers tool where the upper layers didn't align with the background layer.

https://up.heyuri.net/src/3850.7z

kaguy4 commented 3 days ago

added, thanks minna! ヽ(´ー`)ノ