use minimized version of jszip and inline it into the viewer.
This commit is contained in:
parent
8cb5e314af
commit
b203e9bef3
5 changed files with 22 additions and 11586 deletions
|
|
@ -231,8 +231,7 @@ async function getArchiveViewerHtmlSource() {
|
|||
|
||||
async function getArchiveViewerJsZipSource() {
|
||||
const candidates = [
|
||||
"lib/jszip.min.js",
|
||||
"lib/jszip.js"
|
||||
"lib/jszip.min.js"
|
||||
]
|
||||
|
||||
for (const candidate of candidates) {
|
||||
|
|
@ -411,12 +410,13 @@ function rip(event) {
|
|||
btn.disabled = true;
|
||||
getApplicants()
|
||||
.then(async ({ aid, applicants, token }) => {
|
||||
progressDialog.setStatus("Downloading applicant files (will take several minutes)...")
|
||||
progressDialog.setStatus("Downloading applicant details (will take several minutes)...")
|
||||
applicants.forEach((applicant) => {
|
||||
progressDialog.initializeApplicant(applicant)
|
||||
})
|
||||
|
||||
const applicantDetailsResults = await Promise.allSettled(applicants.map(async (applicant) => {
|
||||
progressDialog.setStatus("Downloading applicant files (will take some time)...")
|
||||
try {
|
||||
const applicantDetails = await getApplicant(applicant, token, ({ downloaded, total, bytes }) => {
|
||||
progressDialog.updateApplicant(applicant, downloaded, total, bytes)
|
||||
|
|
@ -455,7 +455,7 @@ function rip(event) {
|
|||
zip.file("applicants.csv", createApplicantsCsv(successfulApplicants))
|
||||
|
||||
console.log("Creating index.html")
|
||||
zip.file("index.html", await getArchiveViewerHtmlSource())
|
||||
zip.file("viewer.html", await getArchiveViewerHtmlSource())
|
||||
|
||||
console.log("Adding viewer Javascript to archive")
|
||||
zip.file("jszip.min.js", await getArchiveViewerJsZipSource())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue