|
1 | 1 | (function () {
|
2 |
| - var check_completeness, form_alert, handle_submit, handle_generate_textbook, init, reset_alert_area, valid_token; |
| 2 | + var check_completeness, form_alert, handle_submit, init, reset_alert_area, valid_token; |
3 | 3 |
|
4 | 4 | $(document).ready(function () {
|
5 | 5 |
|
|
22 | 22 | return handle_submit();
|
23 | 23 | });
|
24 | 24 |
|
25 |
| - $('#btn-gen-textbook').click(function () { |
26 |
| - $(this).prop('disabled', true); |
27 |
| - return handle_generate_textbook(); |
28 |
| - }); |
29 |
| - |
30 | 25 | $('#display').click(function () {
|
31 | 26 | return handle_select_student();
|
32 | 27 | //return handle_display();
|
|
185 | 180 | });
|
186 | 181 | };
|
187 | 182 |
|
188 |
| - handle_generate_textbook = function () { |
189 |
| - var organization_id, course_id, term_id, label, inst_book_id, fd, messages, url; |
190 |
| - messages = check_completeness(true); |
191 |
| - if (messages.length !== 0) { |
192 |
| - form_alert(messages); |
193 |
| - $('#btn-submit-co').prop('disabled', false); |
194 |
| - return; |
195 |
| - } |
196 |
| - organization_id = $('#organization-select').val(); |
197 |
| - course_id = $('#course-select').val(); |
198 |
| - term_id = $('#term-select').val(); |
199 |
| - label = $('#label').val(); |
200 |
| - inst_book_id = $('#inst-book-select').val(); |
201 |
| - fd = new FormData; |
202 |
| - fd.append('organization_id', organization_id); |
203 |
| - fd.append('course_id', course_id); |
204 |
| - fd.append('term_id', term_id); |
205 |
| - fd.append('label', label); |
206 |
| - fd.append('inst_book_id', inst_book_id); |
207 |
| - url = '/textbooks' |
208 |
| - return $.ajax({ |
209 |
| - url: url, |
210 |
| - type: 'post', |
211 |
| - data: fd, |
212 |
| - processData: false, |
213 |
| - contentType: false, |
214 |
| - success: function (data) { |
215 |
| - return window.location.href = data['url']; |
216 |
| - } |
217 |
| - }); |
218 |
| - }; |
219 |
| - |
220 |
| - |
221 | 183 | handle_submit = function () {
|
222 | 184 | var lms_instance_id, lms_course_num, lms_course_code, organization_id, course_id, term_id, label, late_policy_id, inst_book_id, fd, messages, url;
|
223 | 185 | messages = check_completeness(false);
|
|
0 commit comments