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
|
- turn on Developer mode (Entwicklermodus) if not done already
|
||||||
- there are then 2 options:
|
- 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 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.
|
- Chrome will display security warnings which you need to check and accept.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
@ -19,4 +19,4 @@ The archive will contain:
|
||||||
|
|
||||||
- one directory per applicant with the corresponding files
|
- one directory per applicant with the corresponding files
|
||||||
- applicants.csv, which contains a table with the details of each applicant
|
- 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() {
|
async function getArchiveViewerJsZipSource() {
|
||||||
const candidates = [
|
const candidates = [
|
||||||
"lib/jszip.min.js",
|
"lib/jszip.min.js"
|
||||||
"lib/jszip.js"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
for (const candidate of candidates) {
|
for (const candidate of candidates) {
|
||||||
|
|
@ -411,12 +410,13 @@ function rip(event) {
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
getApplicants()
|
getApplicants()
|
||||||
.then(async ({ aid, applicants, token }) => {
|
.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) => {
|
applicants.forEach((applicant) => {
|
||||||
progressDialog.initializeApplicant(applicant)
|
progressDialog.initializeApplicant(applicant)
|
||||||
})
|
})
|
||||||
|
|
||||||
const applicantDetailsResults = await Promise.allSettled(applicants.map(async (applicant) => {
|
const applicantDetailsResults = await Promise.allSettled(applicants.map(async (applicant) => {
|
||||||
|
progressDialog.setStatus("Downloading applicant files (will take some time)...")
|
||||||
try {
|
try {
|
||||||
const applicantDetails = await getApplicant(applicant, token, ({ downloaded, total, bytes }) => {
|
const applicantDetails = await getApplicant(applicant, token, ({ downloaded, total, bytes }) => {
|
||||||
progressDialog.updateApplicant(applicant, downloaded, total, bytes)
|
progressDialog.updateApplicant(applicant, downloaded, total, bytes)
|
||||||
|
|
@ -455,7 +455,7 @@ function rip(event) {
|
||||||
zip.file("applicants.csv", createApplicantsCsv(successfulApplicants))
|
zip.file("applicants.csv", createApplicantsCsv(successfulApplicants))
|
||||||
|
|
||||||
console.log("Creating index.html")
|
console.log("Creating index.html")
|
||||||
zip.file("index.html", await getArchiveViewerHtmlSource())
|
zip.file("viewer.html", await getArchiveViewerHtmlSource())
|
||||||
|
|
||||||
console.log("Adding viewer Javascript to archive")
|
console.log("Adding viewer Javascript to archive")
|
||||||
zip.file("jszip.min.js", await getArchiveViewerJsZipSource())
|
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/*"
|
"https://personal.uni-graz.at/*"
|
||||||
],
|
],
|
||||||
"js": [
|
"js": [
|
||||||
"lib/jszip.js",
|
"lib/jszip.min.js",
|
||||||
"content.js"
|
"content.js"
|
||||||
],
|
],
|
||||||
"css": [
|
"css": [
|
||||||
|
|
@ -24,7 +24,6 @@
|
||||||
{
|
{
|
||||||
"resources": [
|
"resources": [
|
||||||
"archive-viewer/index.html",
|
"archive-viewer/index.html",
|
||||||
"lib/jszip.js",
|
|
||||||
"lib/jszip.min.js"
|
"lib/jszip.min.js"
|
||||||
],
|
],
|
||||||
"matches": [
|
"matches": [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue