From ac75e84eb1e0fbf25b1423a92e9105225a967639 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 20 Jan 2026 11:07:44 +0100 Subject: Improvements. --- wasm/index.html | 57 +++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/wasm/index.html b/wasm/index.html index 218e4b0d2..e65b36523 100644 --- a/wasm/index.html +++ b/wasm/index.html @@ -770,14 +770,6 @@ -
- - -
-
- - -
@@ -788,6 +780,28 @@
+
+ + +
+
+ + +
+
+ + +
+
+ + +
-
- - -
+
+
+ + +
@@ -1471,6 +1483,7 @@ tabStop: '4', eol: '', dpi: '', + numberOffset: '', resourcePath: '', defaultImageExtension: '', stripComments: false, @@ -1526,6 +1539,7 @@ referenceDoc: null, metadataFile: null, epubCoverImage: null, + epubMetadataFile: null, epubFonts: [], headerFiles: [], beforeBodyFiles: [], @@ -1749,6 +1763,7 @@ this.abbreviationsFile = null; this.metadataFile = null; this.epubCoverImage = null; + this.epubMetadataFile = null; this.epubFonts = []; let optionsJson = null; @@ -2094,6 +2109,7 @@ handleReferenceDoc(e) { if (e.target.files[0]) { this.referenceDoc = e.target.files[0]; this.hasChanges = true; } }, handleMetadataFile(e) { if (e.target.files[0]) { this.metadataFile = e.target.files[0]; this.hasChanges = true; } }, handleEpubCover(e) { if (e.target.files[0]) { this.epubCoverImage = e.target.files[0]; this.hasChanges = true; } }, + handleEpubMetadata(e) { if (e.target.files[0]) { this.epubMetadataFile = e.target.files[0]; this.hasChanges = true; } }, handleCssFiles(e) { Array.from(e.target.files).forEach(file => { @@ -2296,6 +2312,9 @@ } if (this.opts.eol) opts.eol = this.opts.eol; if (this.opts.dpi) opts.dpi = parseInt(this.opts.dpi); + if (this.opts.numberOffset.trim()) { + opts['number-offset'] = this.opts.numberOffset.trim().split(',').map(n => parseInt(n.trim()) || 0); + } if (this.opts.resourcePath.trim()) opts['resource-path'] = this.opts.resourcePath.trim(); if (this.opts.stripComments) opts['strip-comments'] = true; if (this.opts.defaultImageExtension.trim()) opts['default-image-extension'] = this.opts.defaultImageExtension.trim(); @@ -2382,6 +2401,7 @@ // EPUB options if (['epub', 'epub2', 'epub3'].includes(baseOutFmt)) { if (this.epubCoverImage) opts['epub-cover-image'] = this.epubCoverImage.name; + if (this.epubMetadataFile) opts['epub-metadata'] = this.epubMetadataFile.name; if (this.epubFonts.length > 0) opts['epub-fonts'] = this.epubFonts.map(f => f.name); if (!this.opts.epubTitlePage) opts['epub-title-page'] = false; if (this.opts.epubSubdirectory.trim()) opts['epub-subdirectory'] = this.opts.epubSubdirectory.trim(); @@ -2477,6 +2497,7 @@ if (this.referenceDoc) files[this.referenceDoc.name] = this.referenceDoc; if (this.metadataFile) files[this.metadataFile.name] = this.metadataFile; if (this.epubCoverImage) files[this.epubCoverImage.name] = this.epubCoverImage; + if (this.epubMetadataFile) files[this.epubMetadataFile.name] = this.epubMetadataFile; this.epubFonts.forEach(font => { files[font.name] = font; }); this.headerFiles.forEach(file => { files[file.name] = file; }); this.beforeBodyFiles.forEach(file => { files[file.name] = file; }); -- cgit v1.2.3