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

Move javascript for credit checkboxes to the js file #1372

Merged
merged 2 commits into from
Nov 16, 2024

Conversation

70ray
Copy link
Collaborator

@70ray 70ray commented Nov 14, 2024

echo "<input type='checkbox' name='cp_credit' value='yes' $cp_credit_checked> CP\n";
echo "<input type='checkbox' name='ip_credit' value='yes' $ip_credit_checked> IP\n";
echo "<input type='checkbox' name='tp_credit' value='yes' $tp_credit_checked> TP\n";
echo "<input type='checkbox' name='cp_credit' class='credit_box' value='yes' $cp_credit_checked> CP\n";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor suggestion, but instead of adding a class to every checkbox, maybe just tag the table cell and then query all inputs under that cell?

tableCell.querySelectorAll('input[type=checkbox]')

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I'll look into it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is @chrismiceli's suggestion still being considered?

Copy link
Collaborator Author

@70ray 70ray Nov 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reminding me. @chrismiceli's suggestion would make it more compact but looking at structure of userprefs.php, the function _show_credits_wanted_adhoc() is far removed from the table structure so I think it makes it clearer how it is intended to work to leave it like it is. (Leaving aside the unusual way the show_ functions are called, see comment on line 874).

@cpeel cpeel merged commit 7ea41bd into DistributedProofreaders:master Nov 16, 2024
12 checks passed
@70ray 70ray deleted the userpref_js branch November 19, 2024 13:33
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.

4 participants