any-file to PDF (Phase 1): converters/ dispatcher, images/text/md/csv/json/xml/svg/pdf-passthrough, 112 tests green
This commit is contained in:
@@ -118,12 +118,12 @@
|
||||
<body>
|
||||
<header class="masthead">
|
||||
<div class="wordmark"><span class="fleuron">❦</span>Bindery</div>
|
||||
<p class="tagline">A local typesetter. Drop an EPUB, take a properly set PDF. Nothing leaves your machine.</p>
|
||||
<p class="tagline">A local typesetter. Drop a document, take a properly set PDF. Nothing leaves your machine.</p>
|
||||
</header>
|
||||
<div class="rule"></div>
|
||||
|
||||
<main>
|
||||
<section id="drop" class="drop" role="button" tabindex="0" aria-label="Upload an EPUB file">
|
||||
<section id="drop" class="drop" role="button" tabindex="0" aria-label="Upload a document">
|
||||
<div class="shelf" aria-hidden="true">
|
||||
<span class="spine" style="--c:#6e3b34;--h:150px;--w:24px"></span>
|
||||
<span class="spine" style="--c:#33513f;--h:164px;--w:20px"></span>
|
||||
@@ -135,11 +135,11 @@
|
||||
<span class="spine" style="--c:#46525e;--h:156px;--w:26px"></span>
|
||||
</div>
|
||||
<div class="drop-copy">
|
||||
<h1>Drop a book to set it in type</h1>
|
||||
<p>or <span class="browse">browse your files</span> · up to <span id="maxmb">400</span> MB · <code>.epub</code></p>
|
||||
<h1>Drop a file to set it in type</h1>
|
||||
<p>or <span class="browse">browse your files</span> · up to <span id="maxmb">400</span> MB · <code>.epub .html .md .txt .csv .json .xml .svg .png .jpg .webp …</code></p>
|
||||
</div>
|
||||
<p id="droperr" class="drop-err" role="alert"></p>
|
||||
<input type="file" id="file" accept=".epub">
|
||||
<input type="file" id="file" accept=".epub,.html,.htm,.txt,.log,.md,.markdown,.csv,.tsv,.json,.xml,.svg,.png,.jpg,.jpeg,.webp">
|
||||
</section>
|
||||
|
||||
<section id="status" class="status" hidden>
|
||||
@@ -237,7 +237,8 @@
|
||||
}
|
||||
|
||||
function start(f) {
|
||||
if (!/\.epub$/i.test(f.name)) { flashError('That is not an .epub — pick a book with the .epub extension.'); return; }
|
||||
var OKEXT = /\.(epub|html?|txt|log|md|markdown|csv|tsv|json|xml|svg|png|jpe?g|webp)$/i;
|
||||
if (!OKEXT.test(f.name)) { flashError('Unsupported file type — accepted: .epub .html .md .txt .log .csv .tsv .json .xml .svg .png .jpg .webp'); return; }
|
||||
var form = new FormData();
|
||||
form.append('file', f);
|
||||
showStatus();
|
||||
|
||||
Reference in New Issue
Block a user