Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- **Fit works for PDFs with wider pages** (v63, PDF app). In a PDF whose pages are not all the same width, such as one with a landscape page, Fit now sizes the pages to the widest one as soon as it loads. Before, Fit only used the first page, so wider pages stuck out past the edge until the window was resized.

- **Tidier PDF app code, continued** (v62, PDF app). The split into smaller files continues. Nothing changes for teachers.

- **Tidier PDF app code** (v61, PDF app). app/main.js is split into smaller files. Nothing changes for teachers.
Expand Down
4 changes: 2 additions & 2 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>OverBoard PDF</title>
<meta name="description" content="OverBoard: write on any PDF on your smartboard. Runs in the browser; nothing is uploaded.">
<meta name="ob-version" content="5959bb0b7628">
<meta name="ob-version" content="5914fcb94a9e">
<meta name="theme-color" content="#145da0">
<link rel="manifest" href="manifest.json">
<link rel="icon" href="icons/favicon.ico" sizes="32x32">
Expand Down Expand Up @@ -47,7 +47,7 @@ <h2 data-t="open_again">Open again</h2>
<p class="note"><span data-th="start_note">Your PDF and your ink stay in this browser on this computer. Nothing is uploaded.
Have a Word file? In Word, choose File → Save as PDF, then drop the PDF here.
Have an HTML worksheet? Drop it here to get a <i>_board.html</i> copy you can write on.</span>
<br><a href="https://github.com/BPMData/OverBoard" data-t="about">About OverBoard</a> · <a href="report/?from=start" target="_blank" data-t="board_help">Board not working?</a> · <span id="ob-release" title="OverBoard version">v62</span></p>
<br><a href="https://github.com/BPMData/OverBoard" data-t="about">About OverBoard</a> · <a href="report/?from=start" target="_blank" data-t="board_help">Board not working?</a> · <span id="ob-release" title="OverBoard version">v63</span></p>
<p class="note ob-langpick"><label><span aria-hidden="true">🌐</span> <select id="ob-lang" aria-label="Language" data-ta="language" data-tt="language" title="Language"></select></label></p>
</div>
</main>
Expand Down
2 changes: 1 addition & 1 deletion app/report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ <h1 data-t="r_h1">Is OverBoard not working on your board?</h1>
<p data-th="r_intro2">If something doesn't work the way the page asks, that's fine. <b>That's exactly what I need to know.</b> Just keep going.</p>
<p class="mute small" data-th="r_privacy">Nothing is sent until you press <b>Send</b> at the very end, and you'll see everything first. No worksheets, PDFs or ink are ever included.</p>
<div class="row"><button class="go big" data-go="start" data-t="r_start">Start</button></div>
<p class="mute small" style="margin-top:28px">OverBoard <span id="ob-release" title="OverBoard version">v62</span></p>
<p class="mute small" style="margin-top:28px">OverBoard <span id="ob-release" title="OverBoard version">v63</span></p>
</div></div>
</section>

Expand Down
12 changes: 6 additions & 6 deletions app/sw.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ===== GENERATED by tools/build.py: every file the app needs, with the start of its SHA-256. Do not edit by hand. =====
const VERSION = '74fb2ffba32b';
const VERSION = 'a96032eb2878';
const FILES = {
"../overlay/ink_overlay.html": "cf491197d61d3324",
"../overlay/ink_overlay.html": "f5e2326731a7644a",
"../shared/ink-core.js": "b65c19035e241559",
"../shared/strings.js": "f2394bc536e6ec28",
"../shared/toolbar.css": "e1e1905491edf8e6",
Expand All @@ -19,7 +19,7 @@ const FILES = {
"icons/icon-512.png": "46ca8bd2d6a32612",
"icons/maskable-512.png": "c7d41ed2fa4ad874",
"image.js": "a867d49b8c47a4a0",
"index.html": "0a9c3158b886f378",
"index.html": "2d124b7152085b15",
"ink.js": "bec7069546fba2b6",
"libs.js": "3b92080779974cfa",
"main.js": "93f650a3e65a5b68",
Expand All @@ -30,7 +30,7 @@ const FILES = {
"offline.js": "e620a1ba2b6ea506",
"open.js": "406132fc612f21db",
"page-view.js": "30953dacd7f8594a",
"report/index.html": "78fcc108b971b965",
"report/index.html": "9232710e3f70a891",
"saving.js": "92749eb3940b545b",
"settings.js": "0502541890fcab28",
"start-screen.js": "3ef08c834bbe0eaf",
Expand Down Expand Up @@ -229,8 +229,8 @@ const FILES = {
"vendor/pdfjs-dist@4.10.38/standard_fonts/LiberationSans-BoldItalic.ttf": "a224075ac17495ad",
"vendor/pdfjs-dist@4.10.38/standard_fonts/LiberationSans-Italic.ttf": "832b4406dbef2362",
"vendor/pdfjs-dist@4.10.38/standard_fonts/LiberationSans-Regular.ttf": "f8ace1f892b2bd9d",
"version.json": "17ab852797ce4bb1",
"viewer.js": "f1e96f64aec11170"
"version.json": "31f18c7184e8a89e",
"viewer.js": "1c4e8693868f12d9"
};
// ===== END GENERATED =====

Expand Down
2 changes: 1 addition & 1 deletion app/version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"v": "5959bb0b7628",
"v": "5914fcb94a9e",
"js": [
"core.js",
"embed.js",
Expand Down
5 changes: 3 additions & 2 deletions app/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,15 @@ export class Viewer {
continue;
}
if (gen !== this.gen) return;
const P = this.pages[n - 1];
const P = this.pages[n - 1],
widest = this.maxW; // before this page counts, so a wider page re-fits below
P.sized = true;
P.turn = this.turnOf(n);
if (Math.abs(vp.width - P.w) > 0.01 || Math.abs(vp.height - P.h) > 0.01) {
P.w = vp.width;
P.h = vp.height;
this.sizePage(P);
if (this.fit && P.w > this.maxW) this.layout();
if (this.fit && P.w > widest) this.layout();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ <h2>Exit ticket</h2>
<div class="lines"><div></div><div></div><div></div><div></div></div>
<div class="foot">OverBoard · page 2 / 2 · Your ink saves in this browser only. Nothing is uploaded.</div>
</div>
<!-- ===== INK OVERLAY START (v62) =====
<!-- ===== INK OVERLAY START (v63) =====
Smartboard writing layer. Paste this whole block just before </body> in any .html file.
SMART BOARD: pen tip writes. Palm, fist or side of hand erases (the board reports it as an eraser).
Finger (and the round end of the SMART pen) scrolls the page; the "Finger" button switches it to drawing if you lose the pen.
Expand Down
2 changes: 1 addition & 1 deletion overlay/ink_overlay.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- ===== INK OVERLAY START (v62) =====
<!-- ===== INK OVERLAY START (v63) =====
Smartboard writing layer. Paste this whole block just before </body> in any .html file.
SMART BOARD: pen tip writes. Palm, fist or side of hand erases (the board reports it as an eraser).
Finger (and the round end of the SMART pen) scrolls the page; the "Finger" button switches it to drawing if you lose the pen.
Expand Down
15 changes: 15 additions & 0 deletions tests/book.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ test('only pages near the screen keep images and text layers while scrolling the
expect(mostText).toBeLessThanOrEqual(8); // and freed with the images
});

test('Fit sizes the book to its widest page once that page loads, so a landscape page does not stick out', async ({
page,
}) => {
await page.waitForFunction(() => __overboard.viewer.pages[10].sized); // page 11 is landscape
await expect
.poll(() =>
page.evaluate(() => {
const v = __overboard.viewer,
avail = document.documentElement.clientWidth - 2 * v.sideSpace;
return Math.round(v.pages[10].el.getBoundingClientRect().width - avail);
})
)
.toBeLessThanOrEqual(1);
});

test('mixed page sizes and rotation; export puts ink in the right place', async ({ page }, info) => {
await page.click('[data-color="#111111"]'); // black, so the check below can look for dark ink (the pen starts pink)
await page.waitForFunction(() => __overboard.viewer.pages[12].sized);
Expand Down
Loading