ui: 支持自定义导出文件名

This commit is contained in:
undefined committed 2021-05-27 23:16:18 +08:00
1 parent cdbbee8180
commit 0273bfe198
13 files changed
+50 -32

No files matched your search

@@ -104,7 +104,7 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
const extender = new ProblemPageExtender();
async function handleClickDownloadProblem() {
await downloadProblemSet([UiContext.problemNumId]);
await downloadProblemSet([UiContext.problemNumId], UiContext.pdoc.title);
}
async function scratchpadFadeIn() {
@@ -202,9 +202,12 @@ async function handleOperation(operation) {
}
}
async function handleDownload() {
async function handleDownload(ev) {
let name = 'Export';
// eslint-disable-next-line no-alert
if (ev.shiftKey) name = prompt('Filename:', name);
const pids = ensureAndGetSelectedPids();
await downloadProblemSet(pids);
await downloadProblemSet(pids, name);
}
const page = new NamedPage(['problem_main', 'problem_category'], () => {