GlotDict icon indicating copy to clipboard operation
GlotDict copied to clipboard

Replace JQuery with vanilla Javascript paying respect to ESlint rules and global variable conventions

Open DillonKyleDev opened this issue 3 years ago • 5 comments

Fixes #339 @webaxones

Replaced JQuery in glotdict-settings.js with vanilla Javascript.

I just started learning JQuery so pointers/corrections are appreciated! And of course if I missed any JQuery that's worth pointing out too!

DillonKyleDev avatar Sep 22 '21 01:09 DillonKyleDev

About getElementById: even though getElementById is a bit faster, I prefer to use querySelector everywhere as it is more readable to have the same way of accessing elements. Unless someone explains to me that it is better: I am not a JavaScript specialist, nor a specialist at all.

I am for querySelector too.

I'm very happy to have a new developer participating in this project. And I bet Daniele is even more so!

Of course but before to do a pull request you should test your code itself. There is already a guide in the wiki https://github.com/Mte90/GlotDict/wiki/Test-extension-locally (that we can update if something is not clear).

Mte90 avatar Sep 22 '21 12:09 Mte90

@webaxones and @Mte90 Thanks for all the helpful feedback! I was just looking on MDN and didn't realize how versatile querySelector() is. I'll switch them out.

prependTo doesn't exist in DOM API, it's some jQuery. prepend exist in DOM API. So this shouldn't work.

Copy that ^

So we create elements then define their innerText then append them.

Will do ^

We haven't explained how to test a web extension. Did you manage to do it locally?

No you haven't, but that's on me! I should have read the docs more carefully before submitting any PRs. I'll take a look at the testing resources and give it a go!

DillonKyleDev avatar Sep 22 '21 18:09 DillonKyleDev

I should have read the docs more carefully before submitting any PRs.

@DillonKyleDev, Every time I make a mistake I learn something. Every time I don't make a mistake I stagnate :D When you are not sure, you can also comment with code, one of us will reply, etc. and then you will make your PR. Github is also a place to talk, ask questions, give answers, share ideas, and I do not deprive myself of it :)

webaxones avatar Sep 23 '21 18:09 webaxones

Any updates for this PR?

Mte90 avatar Oct 07 '21 11:10 Mte90

any updates @DillonKyleDev?

Mte90 avatar Jan 10 '22 11:01 Mte90

Fixed in #395

vlad-timotei avatar Oct 30 '22 15:10 vlad-timotei