index.html: allow uploading multiple EPUB files at once
- ID
97f7931- date
2026-08-10 06:42:35+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
16efa14- message
index.html: allow uploading multiple EPUB files at once- changed files
2 files, 17 additions, 8 deletions
Changed files
CHANGELOG.md (118 → 184)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5f7b6b4..16210fc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG
+## v1.1.0 - 2026-08-10
+
+Allow processing multiple files at once.
+
## v1.0.1 - 2026-08-10
Fix a bug with ampersands in fic titles.
index.html (13606 → 13707)
diff --git a/index.html b/index.html
index 6e8b8c4..f19db9b 100644
--- a/index.html
+++ b/index.html
@@ -145,7 +145,7 @@
<main>
<h1>
Add cover images to EPUBs from AO3
- <span class="version">v1.0.1</span>
+ <span class="version">v1.1.0</span>
</h1>
<noscript>
@@ -170,7 +170,8 @@
name="filename"
accept="application/epub+zip"
required
- onchange="createNewCoverImage()">
+ multiple
+ onchange="createNewCoverImages()">
</p>
<p id="instructions"> </p>
@@ -188,14 +189,9 @@
`<li><strong>Something went wrong:</strong> ${message}</li>`;
}
- function createNewCoverImage() {
- const fileInput = document.querySelector('#epubFileInput');
-
- // Get the epub file from the file input.
- const file = fileInput.files[0];
+ function createSingleCoverImage(file) {
console.debug(`Got file ${file.name}`);
- // Find the `content
JSZip.loadAsync(file)
.then(async function(zip) {
// Get the key information about this fic.
@@ -273,6 +269,15 @@
});
}
+ function createNewCoverImages() {
+ const fileInput = document.querySelector('#epubFileInput');
+
+ // Get the epub files from the file input.
+ for (var file of fileInput.files) {
+ createSingleCoverImage(file);
+ }
+ }
+
// When the window loads, add three randomly generated stories
// to give a sense of what the covers will look like.
window.addEventListener("DOMContentLoaded", function(event) {