feat(render-mode): Rich (LibreOffice) vs Standard (pandoc) toggle for office formats (.docx/.odt/.rtf); Rich default; 5 office tests; 152/152 green"
Test / Tests (Python 3.12) (push) Canceled after 0s
Test / Tests (Python 3.12) (push) Canceled after 0s
This commit is contained in:
@@ -346,6 +346,10 @@
|
||||
<h1>Drop a file to set it in type</h1>
|
||||
<p class="drop-note">or <span class="browse">browse your files</span> · up to <span id="maxmb">400</span> MB · <code>.epub .docx .odt .md .html .txt .csv .svg .png .pdf</code></p>
|
||||
<p id="droperr" class="drop-err" role="alert"></p>
|
||||
<div class="render-modes" role="radiogroup" aria-label="Rendering mode">
|
||||
<label class="mode-label"><input type="radio" name="render_mode" value="rich" checked> <span class="mode-name">Rich</span> — best fidelity (LibreOffice)</label>
|
||||
<label class="mode-label"><input type="radio" name="render_mode" value="standard"> <span class="mode-name">Standard</span> — fastest (pandoc)</label>
|
||||
</div>
|
||||
<input type="file" id="file" accept=".epub,.html,.htm,.txt,.log,.md,.markdown,.csv,.tsv,.json,.xml,.svg,.png,.jpg,.jpeg,.webp,.tiff,.bmp,.pdf,.docx,.odt,.rtf,.tex,.latex,.org,.adoc,.rst">
|
||||
</section>
|
||||
|
||||
@@ -456,6 +460,11 @@
|
||||
if (!OKEXT.test(f.name)) { flashError('Unsupported file type — accepted: .epub .html .htm .txt .log .md .markdown .csv .tsv .json .xml .svg .png .jpg .jpeg .webp .tiff .bmp .pdf .docx .odt .rtf .tex .latex .org .adoc .rst'); return; }
|
||||
var form = new FormData();
|
||||
form.append('file', f);
|
||||
var modeEl = document.querySelector('input[name="render_mode"]:checked');
|
||||
if (modeEl) form.append('render_mode', modeEl.value);
|
||||
// AC: render_mode defaults to "rich" on the server when omitted; the UI
|
||||
// always sends it (Rich preselected) so the choice reaches the worker.
|
||||
// OKEXT (all 27 extensions) left unchanged — the toggle only gates office routing.
|
||||
showStatus();
|
||||
bookname.textContent = f.name;
|
||||
stateEl.textContent = 'Sending to the press';
|
||||
|
||||
Reference in New Issue
Block a user