|
1094 | 1094 | }
|
1095 | 1095 | $("#submission_id").html(submission_id);
|
1096 | 1096 | $('#cboxLoadedContent .mod_turnitintooltwo_unanonymise_form').show();
|
1097 |
| - $('#id_reveal').unbind("click"); |
1098 |
| - $('#id_reveal').click(function () { |
| 1097 | + $('#id_reveal').prop('disabled', true); |
| 1098 | + |
| 1099 | + $('#id_anonymous_reveal_reason').on('input', function() { |
| 1100 | + var reason_text = $(this).val(); |
| 1101 | + $('#id_reveal').prop('disabled', reason_text === ''); // Enable/disable button based on textarea content |
| 1102 | + }); |
| 1103 | + |
| 1104 | + $('#id_reveal').on('click', function() { |
1099 | 1105 | $.ajax({
|
1100 | 1106 | "dataType": 'json',
|
1101 | 1107 | "type": "POST",
|
|
1158 | 1164 | // ZIP containing all files in original format.
|
1159 | 1165 | function initialiseZipDownloads(part_id) {
|
1160 | 1166 | // Unbind the event first to stop it being binded multiple times.
|
1161 |
| - $('#tabs-' + part_id + ' .orig_zip_open, #tabs-' + part_id + ' .pdf_zip_open, #tabs-' + part_id + ' .xls_inbox_open').unbind("click"); |
| 1167 | + $('#tabs-' + part_id + ' .orig_zip_open, #tabs-' + part_id + ' .pdf_zip_open, #tabs-' + part_id + ' .xls_inbox_open').off("click"); |
1162 | 1168 |
|
1163 | 1169 | // Open a spreadsheet or a zip file containing all the relevant data.
|
1164 |
| - $('#tabs-' + part_id + ' .orig_zip_open, #tabs-' + part_id + ' .pdf_zip_open, #tabs-' + part_id + ' .xls_inbox_open').click(function () { |
| 1170 | + $('#tabs-' + part_id + ' .orig_zip_open, #tabs-' + part_id + ' .pdf_zip_open, #tabs-' + part_id + ' .xls_inbox_open').on(function () { |
1165 | 1171 | var idStr = $(this).attr("id").split("_");
|
1166 | 1172 | downloadZipFile(idStr[0] + "_" + idStr[1], idStr[2]);
|
1167 | 1173 | });
|
|
1233 | 1239 |
|
1234 | 1240 | function initialiseHiddenZipDownloads(part_id) {
|
1235 | 1241 | // Unbind the event first to stop it being binded multiple times.
|
1236 |
| - $('#tabs-' + part_id + ' .mod_turnitintooltwo_origchecked_zip_open').unbind("click"); |
| 1242 | + $('#tabs-' + part_id + ' .mod_turnitintooltwo_origchecked_zip_open').off("click"); |
1237 | 1243 | // Seperate binder for hidden zip file link.
|
1238 |
| - $('#tabs-' + part_id + ' .mod_turnitintooltwo_origchecked_zip_open').click(function () { |
| 1244 | + $('#tabs-' + part_id + ' .mod_turnitintooltwo_origchecked_zip_open').on(function () { |
1239 | 1245 | var idStr = $(this).attr("id").split("_");
|
1240 | 1246 | downloadZipFile(idStr[0] + "_" + idStr[1], part_id);
|
1241 | 1247 | return false;
|
|
1249 | 1255 | }
|
1250 | 1256 |
|
1251 | 1257 | // Unbind the event first to stop it being binded multiple times.
|
1252 |
| - $(identifier).unbind("click"); |
| 1258 | + $(identifier).off("click"); |
1253 | 1259 |
|
1254 |
| - $(identifier).click(function () { |
| 1260 | + $(identifier).on(function () { |
1255 | 1261 | $(this).hide();
|
1256 | 1262 | $(this).siblings('.fa-spinner').css("display", "inline-block").addClass('fa-lg');
|
1257 | 1263 | var idStr = $(this).parent().attr("id").split("_");
|
|
1267 | 1273 | }
|
1268 | 1274 |
|
1269 | 1275 | // Unbind the event first to stop it being binded multiple times.
|
1270 |
| - $(identifier).unbind("click"); |
| 1276 | + $(identifier).off("click"); |
1271 | 1277 |
|
1272 |
| - $(identifier).click(function () { |
| 1278 | + $(identifier).on(function () { |
1273 | 1279 | var idStr = $(this).attr("id").split("_");
|
1274 | 1280 | // Don't open OR DV if score is pending.
|
1275 | 1281 | if (!$(this).children('.score_colour').hasClass('score_colour_')) {
|
|
1419 | 1425 | $('#tabs-' + part_id + ' .mod_turnitintooltwo_zip_downloads button').removeAttr("title");
|
1420 | 1426 | initialiseHiddenZipDownloads(part_id);
|
1421 | 1427 | } else {
|
1422 |
| - $('#tabs-' + part_id + ' .mod_turnitintooltwo_origchecked_zip_open').unbind('click'); |
| 1428 | + $('#tabs-' + part_id + ' .mod_turnitintooltwo_origchecked_zip_open').off('click'); |
1423 | 1429 | $('#tabs-' + part_id + ' .mod_turnitintooltwo_zip_downloads button').prop("disabled", true);
|
1424 | 1430 | $('#tabs-' + part_id + ' .mod_turnitintooltwo_zip_downloads button').prop("title", M.str.turnitintooltwo.download_button_warning);
|
1425 | 1431 | }
|
|
0 commit comments