-
Notifications
You must be signed in to change notification settings - Fork 7
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
fixes powerschool showing icons next to every assignment #276
Conversation
Signed-off-by: Suhas Hariharan <hariharan774531@sas.edu.sg>
@ARtheboss this should fix the issue, can you test as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few things that could be changed.
src/js/helpers.js
Outdated
@@ -203,7 +203,8 @@ function assignments (node) { | |||
[...node.querySelector('table[align=center').querySelectorAll('tr')].slice(1, -1).forEach((e, i) => { | |||
const curr = e.querySelectorAll('td'); | |||
const assignment = new Assignment(curr[2]?.innerText || "", curr[curr.length - 1]?.innerText || "", i); | |||
if (e.querySelector('img[src="/images/icon_missing.gif"]')) { | |||
const missingIcon = e.querySelector('img[src="/images/icon_missing.gif"]'); | |||
if (missingIcon && missingIcon.style.display !== 'none') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can simply this to the following, actually:
if (missingIcon && missingIcon.style.display !== 'none') { | |
if (missingIcon?.style.display !== 'none') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this actually works here as for some classes this will be null due to inconsistent CSS(some classes don't contain the missingicon gif and some do), and as such it should be counted as not missing if it doesn't exist.
Signed-off-by: Suhas Hariharan <hariharan774531@sas.edu.sg>
Signed-off-by: Suhas Hariharan <hariharan774531@sas.edu.sg>
accounts for recent PowerSchool change where some courses have the missing icon in the HTML hidden.
fixes #275
Signed-off-by: Suhas Hariharan hariharan774531@sas.edu.sg