ThePacielloGroup / CCAe

The Colour Contrast Analyser (CCA) helps you determine the legibility of text and the contrast of visual elements, such as graphical controls and visual indicators.
http://www.paciellogroup.com/resources/contrastanalyser/
GNU General Public License v3.0
475 stars 106 forks source link

Reduce repeated translation codes. #291

Closed ungjinPark closed 1 year ago

ungjinPark commented 1 year ago

I think existing codes is too repeated. querySelector is too many used unnecesserily.

And, Too long CSS selector has used in querySelector. It is not worng code, but we can use more shorter selector than now.

modified next files

What's changed?

In html, I gave Id or class attributes at some container to make easier to access from DOM.

In js, I replaced repeated some DOM codes to 'NodeList.forEach' code patterns, and It's work correctly. and simplified some selectors.

Please review the above files.

ferllings commented 1 year ago

@ungjinPark This probably needs some sync as well

ungjinPark commented 1 year ago

@ferllings I just merged it. but need more enough test. I checked there was no problem with the naked eye. but not tested with screen readers

ferllings commented 1 year ago

Any updates? The preferences.html file still have merge issues.

ungjinPark commented 1 year ago

@ferllings I've certainly checked and merged codes but I don't know why merging issues are there. I'm on checking.