ui: add rejudge warning on problem_files page

This commit is contained in:
undefined committed 2021-10-11 17:44:46 +08:00
1 parent 3c5ba8c82f
commit 0986277b4d
2 files changed
+11 -1

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.24.3",
"version": "4.24.4",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",
@@ -235,6 +235,16 @@ const page = new NamedPage('problem_files', () => {
await pjax.request({ push: false });
}
$(document).on('click', '[name="problem-sidebar__rejudge"]', (ev) => {
ev.preventDefault();
new ConfirmDialog({
$body: tpl.typoMsg(i18n('Confirm rejudge this problem?')),
}).open().then((action) => {
if (action !== 'yes') return;
$(ev.currentTarget).closest('form').trigger('submit');
});
});
if ($('[name="upload_testdata"]').length) {
$(document).on('click', '.problem-files-testdata .col--name', (ev) => handleEdit('testdata', ev));
$(document).on('click', '.problem-files-additional_file .col--name', (ev) => handleEdit('additional_file', ev));