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
|
|
@ -8,7 +8,7 @@ Chrome extension for downloading EPAS applicant files into a ZIP archive, includ
|
|||
- turn on Developer mode (Entwicklermodus) if not done already
|
||||
- there are then 2 options:
|
||||
- on Linux, [download](https://imsc.uni-graz.at/git/gjankowiak/epas-ripper/raw/branch/chrome/epas-ripper-0.1.0.crx) the `.crx` extension file and drag-and-drop it to the `about:extensions` tab.
|
||||
- on Windows, [download](https://imsc.uni-graz.at/git/gjankowiak/epas-ripper/archive/chrome.zip) the `.zip` archive of this repository, extract it and load the `epas-ripper` directory using the "Load unpacked" ("Entpackte Erweiterung laden") button of the `about:extensions` tab.
|
||||
- on Windows (macOS too?), [download](https://imsc.uni-graz.at/git/gjankowiak/epas-ripper/archive/chrome.zip) the `.zip` archive of this repository, extract it _somewhere it does not risk begin moved or deleted_ and load the `epas-ripper` directory (located inside) using the "Load unpacked" ("Entpackte Erweiterung laden") button of the `about:extensions` tab.
|
||||
- Chrome will display security warnings which you need to check and accept.
|
||||
|
||||
## Usage
|
||||
|
|
@ -19,4 +19,4 @@ The archive will contain:
|
|||
|
||||
- one directory per applicant with the corresponding files
|
||||
- applicants.csv, which contains a table with the details of each applicant
|
||||
- `index.html` (+ auxiliary files), a static HTML file which can be use to browse the applicants' files. After opening it in a browser, you need to load the ZIP file you just downloaded. For this to work properly, you should _extract_ the `applications[...].zip` file first. Opening `index.html` from the archive directly (like the explorer on Windows) is not going to work.
|
||||
- `viewer.html` (+ auxiliary files), a static HTML file which can be use to browse the applicants' files. After opening it in a browser, you need to load the ZIP file you just downloaded. For this to work properly, you should _extract_ the `applications[...].zip` file first.
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -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())
|
||||
|
|
|
|||
11577
lib/jszip.js
11577
lib/jszip.js
File diff suppressed because it is too large
Load diff
|
|
@ -12,7 +12,7 @@
|
|||
"https://personal.uni-graz.at/*"
|
||||
],
|
||||
"js": [
|
||||
"lib/jszip.js",
|
||||
"lib/jszip.min.js",
|
||||
"content.js"
|
||||
],
|
||||
"css": [
|
||||
|
|
@ -24,7 +24,6 @@
|
|||
{
|
||||
"resources": [
|
||||
"archive-viewer/index.html",
|
||||
"lib/jszip.js",
|
||||
"lib/jszip.min.js"
|
||||
],
|
||||
"matches": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue