From 951059d75da46f3aad4db7280488696579ee5b5f Mon Sep 17 00:00:00 2001 From: Alpaq92 Date: Thu, 25 Jun 2026 23:36:39 +0200 Subject: [PATCH] feat: page-by-page compare for multi-page docs + move mode dropdown right MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PDF and DjVu extractors separate pages with \f; compare() splits each document into pages and renders a per-page diff. The existing toolbar page nav (< 1 / N >) drives it through the diff controller's new setPage, so multi-page PDFs and DjVu compare page-by-page. Single-page formats (docx/doc/rtf/odf/txt/...) are unchanged — they render as a continuous flow with no page breaks to split on. - Move the compare view-mode dropdown from the middle to the right, just left of the language selector. - Add a 2-page sample PDF pair (samples/manual-v{1,2}.pdf) for testing. Co-Authored-By: Claude Opus 4.8 --- index.html | 5 ++- reader.html | 5 ++- samples/manual-v1.pdf | 61 ++++++++++++++++++++++++++++++++++ samples/manual-v2.pdf | 61 ++++++++++++++++++++++++++++++++++ src/diff-view.js | 14 ++++++-- src/main.js | 21 +++++++++--- src/renderers/djvu-renderer.js | 8 +++-- src/renderers/pdf-renderer.js | 8 +++-- 8 files changed, 165 insertions(+), 18 deletions(-) create mode 100644 samples/manual-v1.pdf create mode 100644 samples/manual-v2.pdf diff --git a/index.html b/index.html index 3b7dc3a..9f09336 100644 --- a/index.html +++ b/index.html @@ -82,15 +82,14 @@ + +
-
- -
-
- -