GlotDict
GlotDict copied to clipboard
Replace JQuery with vanilla Javascript paying respect to ESlint rules and global variable conventions
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!
About
getElementById
: even thoughgetElementById
is a bit faster, I prefer to usequerySelector
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).
@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!
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 :)
Any updates for this PR?
any updates @DillonKyleDev?
Fixed in #395