Discuss Scratch

bidulule
Scratcher
1000+ posts

I need help with my extension!

Hi everyone ! To start with, i'm not here to advertise any userscript or browser extension…
I just need help for a little part of a script (so i will not share the rest of the project).
Let me explain,
as you way know, it's possible to post emojis in project and profile comment sections ^^ List of the emojis you can post in comments. As you can see, it require to know the exact code and to write it when be want to post an emoji. i found this annoying so i started to make a userscript to make it easier to post emojis.
I'm not very good at javascript so i started my project by using the scratchmoji extension. It's an extension witch add others emojis to scratch (but they aren't visible by everyone).
So i worked on it and i successfully made an extension that give me the code to paste when i click on an emoji.
But pasting the code after clicking on the emoji is still annoying so that would be great if it would automatically paste the code in the comment when i click on the emoji….. The problem is that i've tryed many times but i don't know how to do that.
So i need your help to explain me how to paste automatically the code in the comment that i'm typing.

Here is the code used to copy the code in the clipboard :

function copyT(e){console.log(e);var t=document.createElement(“textarea”);if(e==“_lol_”){t.textContent=“_:'P_”} else{t.textContent=e};var n=document.body;n.appendChild(t),t.select(),document.execCommand(“copy”),n.removeChild(t)};


Ask me if you need some precisions (and sorry for my bad english skills, i'm just learning it at school)

________________________Bidulule ~ French ~ 900+ followers_________________________
★My Projects★___________________★My Profile★___________________★My Fan Club★
bidulule
Scratcher
1000+ posts

I need help with my extension!

bump

________________________Bidulule ~ French ~ 900+ followers_________________________
★My Projects★___________________★My Profile★___________________★My Fan Club★
bidulule
Scratcher
1000+ posts

I need help with my extension!

bump

________________________Bidulule ~ French ~ 900+ followers_________________________
★My Projects★___________________★My Profile★___________________★My Fan Club★

Powered by DjangoBB

Standard | Mobile