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: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04 # Playwright 1.56 has no browsers for Ubuntu 26.04, which ubuntu-latest became
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- **PDFs open a little faster** (v54, PDF app). The PDF reader now gets ready while the start screen is up, instead of when you pick a file, and one reader is kept for every PDF you open, so Open again and adding a notebook page no longer start a new one each time. Checking which PDF it is (to find its ink) now happens while the PDF opens, not before.
- **Laser pointer sound** (v53, PDF app and HTML overlay). Turning on the laser pointer now plays a short, quiet, low laser sound, so it is clear what just happened. Turning it off is silent.
- **Laser pointer** (v52, PDF app and HTML overlay). Tap the pen or highlighter color you already have selected, and its ring turns black, red, black. What you draw now stays for two seconds after you lift the pen, then fades away by itself. It is never saved, printed or added to Undo. Tap the color again, or pick another color or tool, to go back to writing. Your palm still erases.
- **Blue toolbar and pink eraser** (v51, PDF app and HTML overlay). The toolbar, its menus, Settings, the Timer and the Chapters / Find panel are now dark navy with light sky-blue buttons and black text, instead of black and yellow, to match the boat icon. The Eraser button is eraser pink. A selected tool has a white ring. Pen, highlighter and cover colors are unchanged.
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="a4543e5866fb">
<meta name="ob-version" content="4831a1cabadf">
<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">v53</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">v54</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
19 changes: 19 additions & 0 deletions app/libs.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,25 @@ export function loadPdfjs() {
return pdfjsPromise;
}

/* One PDF reader for every PDF this tab opens. Starting one means loading and starting the 1.4 MB
pdf.worker file, so sharing it makes opening a PDF, Open again, and adding a notebook page faster.
Closing a PDF doesn't stop it (PDF.js only stops readers it made itself). */
let worker = null;
export function pdfWorker(lib) {
if (!worker || worker.destroyed) worker = new lib.PDFWorker({ name: 'overboard' });
return worker;
}
export function dropPdfWorker() { // after a PDF failed to open: the next one gets a fresh reader, in case this one broke
if (worker) { try { worker.destroy(); } catch (e) { /* already gone */ } }
worker = null;
}

/* get PDF.js and its reader ready while the start screen is up, so the first PDF opens sooner */
export function warmPdfjs() {
const go = () => loadPdfjs().then(pdfWorker, () => {});
if (window.requestIdleCallback) requestIdleCallback(go, { timeout: 3000 }); else setTimeout(go, 500);
}

let pdflibPromise = null;
export function loadPdfLib() { // only needed for exporting and "Save ink into PDF", so it loads on first use
if (!pdflibPromise) {
Expand Down
15 changes: 10 additions & 5 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import { obLangs, obLang, obT, obTranslate } from '../shared/strings.js';
import { showLaser, makeTimer, paletteColors, setPalette, fitTools, makePopMenu, historyKey, hlInk, makeHlMenu, holdRepeat, confirmTap, flashBtn, makePeriodPicker, makeSettings, loadPeriods, startPen, remapPeriods, makeSelect, makeTyping } from '../shared/ink-core.js';
import { loadPdfjs, PDFJS_CMAPS_URL, PDFJS_FONTS_URL } from './libs.js';
import { loadPdfjs, pdfWorker, dropPdfWorker, warmPdfjs, PDFJS_CMAPS_URL, PDFJS_FONTS_URL } from './libs.js';
import { Viewer } from './viewer.js';
import { Ink, PT_PER_UNIT } from './ink.js';
import { Finder } from './find.js';
Expand Down Expand Up @@ -310,16 +310,19 @@ async function openFile(file, handlePromise) {
drop.textContent = tr('opening', { f: file.name });
try {
if (doc) await closeDoc(false);
const libP = loadPdfjs(); // usually ready already (warmPdfjs); if not, it loads while the file is read
const buf = await file.arrayBuffer();
const base = findBase(new Uint8Array(buf)); // a PDF OverBoard saved ink into: the original bytes come first
let hash = await store.hashBytes(new Uint8Array(buf, 0, base));
const lib = await loadPdfjs();
const task = lib.getDocument({ data: new Uint8Array(buf), ...PDF_OPTS });
const hashP = store.hashBytes(new Uint8Array(buf, 0, base)); // copies the bytes now, so the PDF can open meanwhile
const lib = await libP;
const task = lib.getDocument({ data: new Uint8Array(buf), worker: pdfWorker(lib), ...PDF_OPTS }); // hands the bytes to the reader
task.onPassword = (give, reason) => {
const pw = prompt(reason === 2 ? 'Wrong password. Try again:' : 'This PDF has a password:');
if (pw === null) task.destroy(); else give(pw);
};
hashP.catch(() => {}); // (if the PDF fails first, that's the error to show)
const pdf = await task.promise;
let hash = await hashP;
// a blank notebook OverBoard made: its ink is kept under the notebook's ID, which stays the same as pages are added
// a picture OverBoard turned into a PDF: its ink is kept under the picture's ID (app/image.js)
let nb = null, im = null;
Expand Down Expand Up @@ -362,6 +365,7 @@ async function openFile(file, handlePromise) {
} catch (e) {
console.error(e);
doc = null; D = null;
if (!e || e.name !== 'PasswordException') dropPdfWorker();
document.body.classList.add('start'); bar.hidden = true; addPageEl.hidden = true;
showError(e && e.name === 'PasswordException' ? tr('err_password') :
e && /fetch|import|module/i.test(String(e.message)) ? tr('err_pdf_reader') :
Expand Down Expand Up @@ -858,7 +862,7 @@ async function changePages(change, at, by, show, msg) {
try {
const bytes = await change(new Uint8Array(await baseBlob().arrayBuffer()));
const lib = await loadPdfjs();
const pdf = await lib.getDocument({ data: bytes.slice(), ...PDF_OPTS }).promise;
const pdf = await lib.getDocument({ data: bytes.slice(), worker: pdfWorker(lib), ...PDF_OPTS }).promise;
if (doc !== d) { pdf.destroy(); return; } // closed in the meantime
const old = d.pdf;
d.file = new File([bytes], d.name, { type: 'application/pdf' });
Expand Down Expand Up @@ -999,6 +1003,7 @@ $('#ob-inkfile').addEventListener('change', (e) => { const f = e.target.files[0]

/* ---------- start ---------- */
translateAll(); refresh(); renderRecent();
warmPdfjs();
setupOffline(openFile);
(() => { // reopen the PDF after a reload; typing or clicking the address shows the start screen
const nav = performance.getEntriesByType && performance.getEntriesByType('navigation')[0];
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">v53</span></p>
<p class="mute small" style="margin-top:28px">OverBoard <span id="ob-release" title="OverBoard version">v54</span></p>
</div></div>
</section>

Expand Down
14 changes: 7 additions & 7 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 = 'ad523d024e67';
const VERSION = '911d716dff20';
const FILES = {
"../overlay/ink_overlay.html": "ccbeec7f9a193362",
"../overlay/ink_overlay.html": "658c92c6773cccf9",
"../shared/ink-core.js": "b65c19035e241559",
"../shared/strings.js": "b247836e7165abf0",
"../shared/toolbar.css": "a611595b897560c5",
Expand All @@ -17,14 +17,14 @@ const FILES = {
"icons/icon-512.png": "46ca8bd2d6a32612",
"icons/maskable-512.png": "c7d41ed2fa4ad874",
"image.js": "d396b7d4f5aced4e",
"index.html": "07e71eee1c4df161",
"index.html": "9460c8776a417eb4",
"ink.js": "3dc693cb202efe0c",
"libs.js": "c09f60186ab9029a",
"main.js": "ed783dc63ed7a6dd",
"libs.js": "bedbbbc2c8495fdf",
"main.js": "e842901e26803484",
"manifest.json": "416c107c34c8610b",
"notebook.js": "7346e40dda6ff149",
"offline.js": "6504935b2738711a",
"report/index.html": "480150bf36208394",
"report/index.html": "8885a58fbb345993",
"store.js": "155ec064f6ffe569",
"textlayer.js": "383ad22e91afb648",
"vendor/pdf-lib@1.17.1/LICENSE.md": "f2c9fc00fdb66eb9",
Expand Down Expand Up @@ -217,7 +217,7 @@ 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": "7b8de4a25ae70b82",
"version.json": "fe7d8c7110d62f35",
"viewer.js": "1cffd9d5c7158958"
};
// ===== 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": "a4543e5866fb",
"v": "4831a1cabadf",
"js": [
"embed.js",
"export.js",
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 (v53) =====
<!-- ===== INK OVERLAY START (v54) =====
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 (v53) =====
<!-- ===== INK OVERLAY START (v54) =====
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
Loading