Skip to content

Commit 34aa849

Browse files
committed
Move JavaScript of LTI 1.3 login self posting form to a JS file.
1 parent 0ab4513 commit 34aa849

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

htdocs/js/LTILogin/ltilogin.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
document.addEventListener('DOMContentLoaded', function() {
2+
var form = document.getElementById("ltiRepost");
3+
if (form) {
4+
form.submit();
5+
}
6+
});
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
<%= javascript $c->url({ type => 'webwork', name => 'htdocs', file => 'js/LTILogin/ltilogin.js' }),
2+
defer => undef =%>
13
<%= form_for $form_target, method => 'POST', enctype => 'application/x-www-form-urlencoded',
24
name => 'ltiRepost', id => 'ltiRepost', begin =%>
35
% for (keys %$form_params) {
46
<%= hidden_field $_ => $form_params->{$_} =%>
57
% }
68
<% end =%>
7-
<%= javascript begin =%>
8-
document.ltiRepost.submit();
9-
<% end =%>

0 commit comments

Comments
 (0)