Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow standards for javascript "data-" attribute names #79

Merged
merged 7 commits into from
Dec 27, 2023

Conversation

robby1066
Copy link
Contributor

@robby1066 robby1066 commented Dec 26, 2023

This change should not alter functionality anywhere. Simply a code cleanup to make the attributes on the SPAN tags wrapping each word use the HTML data-* attribute standards.

Changed attributes

Old Attribute New Attribute
tid data-text-id
lid data-lang-id
paraid data-paragraph-id
seid data-sentence-id
data_text data-text
data_status_class data-status-class
data_order data-order
data_wid data-wid

in places where jQuery is used, references to $(element).attr('data_some_attribute') were changed to $(element).data('some-attribute')

where vanilla Javascript was used, references to element.getAttribute('data_some_attribute') were changed to element.dataset.someAttribute

@jzohrab
Copy link
Collaborator

jzohrab commented Dec 27, 2023

Even though we’d said it was sort or make-work, it’s still a nice change. Thank you very much. I’m going to do another scan of the full code before merging it, but it looks like you’ve covered everything. Cheers!

@jzohrab
Copy link
Collaborator

jzohrab commented Dec 27, 2023

Pulled the branch and checked the code for the attributes, I think all is covered. Thank you very much!

@jzohrab jzohrab merged commit f120327 into LuteOrg:develop Dec 27, 2023
9 of 10 checks passed
@jzohrab
Copy link
Collaborator

jzohrab commented Dec 27, 2023

All of the acceptance tests passed, I gone through the code, everything seems good. Thanks @robby1066 (Battle of Hastings?).

@robby1066
Copy link
Contributor Author

Happy to help!

(Battle of Hastings?).

no, the 1066 is a reference to a graffiti crew I was in a million years ago in high school which feels really silly now but it stuck in my username so ¯_(ツ)_/¯. 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants