From 4578b534b9ff881b25235e6feea9fdd163aed6c1 Mon Sep 17 00:00:00 2001 From: Alex Jordan Date: Sun, 26 Jul 2026 14:22:26 -0700 Subject: [PATCH] make a few anchors with role=button activate upon use of spacebar Co-Authored-By: Claude Sonnet 5 --- htdocs/js/CourseAdmin/manage_lti_course_map.js | 11 +++++++++++ htdocs/js/JobManager/jobmanager.js | 10 ++++++++++ .../CourseAdmin/manage_lti_course_map_form.html.ep | 6 +++++- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 htdocs/js/CourseAdmin/manage_lti_course_map.js diff --git a/htdocs/js/CourseAdmin/manage_lti_course_map.js b/htdocs/js/CourseAdmin/manage_lti_course_map.js new file mode 100644 index 0000000000..665ce98a8f --- /dev/null +++ b/htdocs/js/CourseAdmin/manage_lti_course_map.js @@ -0,0 +1,11 @@ +(() => { + // Make the LTI configuration info buttons activate upon use of the spacebar. + for (const btn of document.querySelectorAll('.lti-config-btn')) { + btn.addEventListener('keydown', (e) => { + if (e.key === ' ') { + e.preventDefault(); + btn.click(); + } + }); + } +})(); diff --git a/htdocs/js/JobManager/jobmanager.js b/htdocs/js/JobManager/jobmanager.js index fe57f3949a..6662842f2f 100644 --- a/htdocs/js/JobManager/jobmanager.js +++ b/htdocs/js/JobManager/jobmanager.js @@ -10,4 +10,14 @@ filter_select.addEventListener('change', toggle_filter_elements); toggle_filter_elements(); } + + // Make the job result buttons activate when using the spacebar. + for (const btn of document.querySelectorAll('.result-btn')) { + btn.addEventListener('keydown', (e) => { + if (e.key === ' ') { + e.preventDefault(); + btn.click(); + } + }); + } })(); diff --git a/templates/ContentGenerator/CourseAdmin/manage_lti_course_map_form.html.ep b/templates/ContentGenerator/CourseAdmin/manage_lti_course_map_form.html.ep index 1265bcfa13..25141ce5ec 100644 --- a/templates/ContentGenerator/CourseAdmin/manage_lti_course_map_form.html.ep +++ b/templates/ContentGenerator/CourseAdmin/manage_lti_course_map_form.html.ep @@ -1,3 +1,7 @@ +% content_for js => begin + <%= javascript getAssetURL($ce, 'js/CourseAdmin/manage_lti_course_map.js'), defer => undef =%> +% end +%

<%= maketext('Manage LTI Course Map') %> <%= $c->helpMacro('AdminManageLTICourseMap') %>

<%= form_for current_route, method => 'POST', begin =%> <%= $c->hidden_authen_fields =%> @@ -30,7 +34,7 @@ % if ($ltiConfigs->{$_}{LTIVersion} && $ltiConfigs->{$_}{LTIVersion} =~ /^v1p[13]$/) { - <%= maketext('LTI Configuration') %>