1 |
efrain |
1 |
{{!
|
|
|
2 |
This file is part of Moodle - http://moodle.org/
|
|
|
3 |
|
|
|
4 |
Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
it under the terms of the GNU General Public License as published by
|
|
|
6 |
the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
(at your option) any later version.
|
|
|
8 |
|
|
|
9 |
Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
GNU General Public License for more details.
|
|
|
13 |
|
|
|
14 |
You should have received a copy of the GNU General Public License
|
|
|
15 |
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
}}
|
|
|
17 |
{{!
|
|
|
18 |
@template mod_lti/tool_proxy_registration_form
|
|
|
19 |
|
|
|
20 |
This template provides the registration form to submit an external
|
|
|
21 |
LTI registration.
|
|
|
22 |
|
|
|
23 |
Classes required for JS:
|
|
|
24 |
* none
|
|
|
25 |
|
|
|
26 |
Data attributes required for JS:
|
|
|
27 |
* none
|
|
|
28 |
|
|
|
29 |
Context variables required for this template:
|
|
|
30 |
*
|
|
|
31 |
|
|
|
32 |
}}
|
|
|
33 |
<div id="tool-proxy-registration-form-container">
|
|
|
34 |
<div class="registration-loading-container loading-screen">
|
|
|
35 |
{{> mod_lti/loader }}
|
|
|
36 |
<p class="loading-text">{{#str}} loadinghelp, moodle {{/str}}</p>
|
|
|
37 |
<p id="registration-loading-failed" class="hidden">{{#str}} register_warning, mod_lti {{/str}}</p>
|
|
|
38 |
</div>
|
|
|
39 |
<iframe id="registration-page-iframe" name="registration-page-iframe" class="hidden">
|
|
|
40 |
</iframe>
|
|
|
41 |
<form action="{{{reg_url}}}" name="ltiLaunchForm" id="ltiLaunchForm" method="post" encType="application/x-www-form-urlencoded" target="registration-page-iframe">
|
|
|
42 |
<input type="hidden" name="lti_message_type" value="{{lti_message_type}}" />
|
|
|
43 |
<input type="hidden" name="lti_version" value="{{lti_version}}" />
|
|
|
44 |
<input type="hidden" name="reg_key" value="{{reg_key}}" />
|
|
|
45 |
<input type="hidden" name="reg_password" value="{{reg_password}}" />
|
|
|
46 |
<input type="hidden" name="tc_profile_url" value="{{{tc_profile_url}}}" />
|
|
|
47 |
<input type="hidden" name="launch_presentation_return_url" value="{{{launch_presentation_return_url}}}" />
|
|
|
48 |
</form>
|
|
|
49 |
</div>
|
|
|
50 |
{{#js}}
|
|
|
51 |
require(['jquery'], function($) {
|
|
|
52 |
var loadingContainer = $('#tool-proxy-registration-form-container .registration-loading-container');
|
|
|
53 |
var iframe = $('#registration-page-iframe');
|
|
|
54 |
var timeout = setTimeout(function () {
|
|
|
55 |
var failedContainer = $('#registration-loading-failed');
|
|
|
56 |
failedContainer.removeClass('hidden');
|
|
|
57 |
}, 20000);
|
|
|
58 |
|
|
|
59 |
iframe.on('load', function() {
|
|
|
60 |
loadingContainer.addClass('hidden');
|
|
|
61 |
iframe.removeClass('hidden');
|
|
|
62 |
});
|
|
|
63 |
});
|
|
|
64 |
{{/js}}
|