Merge branch 'master' into contest-problemlist

This commit is contained in:
undefined committed 2022-10-18 16:56:18 +08:00
commit 58c0cade0e
28 files changed
+304 -187

No files matched your search

@@ -20,10 +20,11 @@ const page = new NamedPage('manage_user_priv', () => {
async function changeUserPriv(uid, priv) {
try {
const res = await request.post('', uid !== 'default' ? {
uid,
const res = await request.post('', {
uid: uid !== 'default' ? uid : 0,
priv,
} : { priv });
system: uid === 'default',
});
if (res.url && res.url !== window.location.href) window.location.href = res.url;
else {
Notification.success(i18n('Priv has been updated to {0}.', priv));
@@ -54,8 +55,8 @@ const page = new NamedPage('manage_user_priv', () => {
handleOpenUserPrivDialog(user.udoc);
}
$('[name="select_user"]').on('click', () => handleClickSelectUser());
$('[name="set_priv"]').on('click', (ev) => handleOpenUserPrivDialog(ev));
$(document).on('click', '[name="select_user"]', () => handleClickSelectUser());
$(document).on('click', '[name="set_priv"]', (ev) => handleOpenUserPrivDialog(ev));
});
export default page;
@@ -163,18 +163,26 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
$('.loader-container').hide();
}
let progress = false;
async function enterScratchpadMode() {
if (progress) return;
progress = true;
await extender.extend();
await loadReact();
renderReact();
await scratchpadFadeIn();
progress = false;
}
async function leaveScratchpadMode() {
if (progress) return;
progress = true;
await scratchpadFadeOut();
$('.problem-content-container').append($('.problem-content'));
await extender.collapse();
unmountReact();
progress = false;
}
async function loadObjective() {