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
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

- **Save ink into file says so when a file can't take ink** (v37, HTML overlay). Picking a file without OverBoard in it now shows **Not saved!** on the button and explains in plain words (drop it on the app first to make a board copy), and the browser no longer asks to edit a file that won't be written to.
- **Save ink into file works into a different board copy in Chrome** (v36, HTML overlay). Saving from `pet_board_inked.html` into `pet_board_clean.html` now asks Chrome's "allow editing?" question straight after you pick the file, before OverBoard's own "different file name" question (which used up the tap Chrome needs). If the browser still won't ask, the button stays in view and says **Tap again to allow**.
- **Ink saved into a file always shows when that file opens** (v36). The file now notes when the ink was written into it, so a browser that had used that copy before (even just to try it and clear it) no longer shows its own older, empty copy instead.
- **Tested: old board copies upgrade cleanly** (v35). Dropping an older `_board.html` on the PDF app keeps its name (no `_board_board`), puts in the newest toolbar, and the ink saved inside it still opens. A test now checks this end to end, starting from a v13 board copy.
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="38fc581fca25">
<meta name="ob-version" content="7bce951ceba7">
<meta name="theme-color" content="#1f1f1f">
<link rel="manifest" href="manifest.json">
<link rel="icon" href="icons/icon-192.png">
Expand Down Expand Up @@ -45,7 +45,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="../" data-t="back_demo">Back to the HTML worksheet demo</a> · <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">v36</span></p>
<br><a href="../" data-t="back_demo">Back to the HTML worksheet demo</a> · <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">v37</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 @@ -97,7 +97,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">v36</span></p>
<p class="mute small" style="margin-top:28px">OverBoard <span id="ob-release" title="OverBoard version">v37</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,9 +1,9 @@
// ===== GENERATED by tools/build.py: every file the app needs, with the start of its SHA-256. Do not edit by hand. =====
const VERSION = '471e7c21ebea';
const VERSION = '132eb34e5d4f';
const FILES = {
"../overlay/ink_overlay.html": "42bade453c738a0a",
"../overlay/ink_overlay.html": "b6c60b7242623972",
"../shared/ink-core.js": "84be8f49eeb4d2d3",
"../shared/strings.js": "d85fbc3cf3f1c436",
"../shared/strings.js": "60ed5521f07e5d9f",
"../shared/toolbar.css": "55e88770a7c0f1c2",
"app.css": "eb0f282d02685caf",
"embed.js": "ea50a9ff4e960dd4",
Expand All @@ -14,14 +14,14 @@ const FILES = {
"icons/icon-192.png": "d245e15b36475003",
"icons/icon-512.png": "17c1021fe2a0ade1",
"icons/maskable-512.png": "0c58f1bdccc9eda9",
"index.html": "c03b8fc0802c288d",
"index.html": "79fae83f812a179f",
"ink.js": "253f8d907ccfbc1b",
"libs.js": "c09f60186ab9029a",
"main.js": "48ecaa409acb49b9",
"manifest.json": "f7ee4a6c6f83cd40",
"notebook.js": "47bcfd4f80712344",
"offline.js": "6504935b2738711a",
"report/index.html": "9c8cd50b68eafb8c",
"report/index.html": "5be61cdfda281b62",
"store.js": "66af54cd32e6cbd2",
"textlayer.js": "1911308ed3e2a8b5",
"vendor/[email protected]/LICENSE.md": "f2c9fc00fdb66eb9",
Expand Down Expand Up @@ -214,7 +214,7 @@ const FILES = {
"vendor/[email protected]/standard_fonts/LiberationSans-BoldItalic.ttf": "a224075ac17495ad",
"vendor/[email protected]/standard_fonts/LiberationSans-Italic.ttf": "832b4406dbef2362",
"vendor/[email protected]/standard_fonts/LiberationSans-Regular.ttf": "f8ace1f892b2bd9d",
"version.json": "0c4d0798795a815b",
"version.json": "8579eaae05ca65ca",
"viewer.js": "648b4479c5b68b93"
};
// ===== 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": "38fc581fca25",
"v": "7bce951ceba7",
"js": [
"embed.js",
"export.js",
Expand Down
11 changes: 6 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,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 (v36) =====
<!-- ===== INK OVERLAY START (v37) =====
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 Expand Up @@ -1622,7 +1622,7 @@ <h2>Exit ticket</h2>
"saved_flash": ["Saved!", "¡Guardado!", "已保存!", "Na-save!", "Đã lưu!", "Enregistré !", "Salvo!", "تم الحفظ!"],
"not_saved": ["Not saved!", "¡No se guardó!", "未保存!", "Hindi na-save!", "Chưa lưu!", "Non enregistré !", "Não salvo!", "لم يُحفظ!"],
"confirm_other_file": ["This page is \"{a}\" but you picked \"{b}\". Save ink into the picked file?", "Esta página es \"{a}\" pero elegiste \"{b}\". ¿Guardar la tinta en el archivo elegido?", "此页面是“{a}”,但你选择了“{b}”。要把笔迹保存到所选文件吗?", "Ang pahinang ito ay \"{a}\" pero \"{b}\" ang pinili mo. I-save ang tinta sa napiling file?", "Trang này là \"{a}\" nhưng bạn đã chọn \"{b}\". Lưu nét mực vào tệp đã chọn?", "Cette page est « {a} » mais vous avez choisi « {b} ». Enregistrer l'encre dans le fichier choisi ?", "Esta página é \"{a}\", mas você escolheu \"{b}\". Salvar a tinta no arquivo escolhido?", "هذه الصفحة هي \"{a}\" لكنك اخترت \"{b}\". هل تحفظ الحبر في الملف المختار؟"],
"st_no_ink_block": ["That file has no ink block. Paste the overlay snippet into it first.", "Ese archivo no tiene bloque de tinta. Primero pega en él el código de OverBoard.", "该文件没有笔迹区块。请先把 OverBoard 代码粘贴进去。", "Walang ink block ang file na iyan. I-paste muna roon ang OverBoard snippet.", "Tệp đó không có khối nét mực. Hãy dán đoạn mã OverBoard vào trước.", "Ce fichier n'a pas de bloc d'encre. Collez-y d'abord le code d'OverBoard.", "Esse arquivo não tem bloco de tinta. Cole o código do OverBoard nele primeiro.", "هذا الملف لا يحتوي على كتلة الحبر. الصق شيفرة OverBoard فيه أولًا."],
"st_no_ink_block": ["That file doesn't have OverBoard in it, so it can't keep ink. Drop it on the OverBoard app first to make a board copy.", "Ese archivo no tiene OverBoard, así que no puede guardar tinta. Primero suéltalo en la app de OverBoard para hacer una copia para la pizarra.", "该文件里没有 OverBoard,无法保存笔迹。请先把它拖到 OverBoard 应用里,生成一份白板副本。", "Walang OverBoard ang file na iyan, kaya hindi ito makakapag-save ng tinta. I-drop muna ito sa OverBoard app para gumawa ng kopya para sa board.", "Tệp đó không có OverBoard nên không lưu được nét mực. Hãy thả nó vào ứng dụng OverBoard trước để tạo bản dùng trên bảng.", "Ce fichier ne contient pas OverBoard, il ne peut donc pas garder l'encre. Déposez-le d'abord sur l'app OverBoard pour en faire une copie pour le tableau.", "Esse arquivo não tem o OverBoard, então não guarda tinta. Primeiro solte-o no app OverBoard para fazer uma cópia para a lousa.", "هذا الملف لا يحتوي على OverBoard، لذا لا يمكنه حفظ الحبر. اسحبه أولًا إلى تطبيق OverBoard لإنشاء نسخة للسبورة."],
"st_tap_allow": ["{p} · tap Save ink into file to allow writing", "{p} · toca Guardar tinta en el archivo para permitir escribir", "{p} · 点按“把笔迹保存到文件”以允许写入", "{p} · i-tap ang I-save ang tinta sa file para payagang magsulat", "{p} · chạm Lưu nét mực vào tệp để cho phép ghi", "{p} · touchez Enregistrer l'encre dans le fichier pour autoriser l'écriture", "{p} · toque em Salvar tinta no arquivo para permitir gravar", "{p} · اضغط «حفظ الحبر في الملف» للسماح بالكتابة"],
"st_linked_no_block": ["Linked file has no ink block", "El archivo vinculado no tiene bloque de tinta", "关联文件没有笔迹区块", "Walang ink block ang naka-link na file", "Tệp liên kết không có khối nét mực", "Le fichier lié n'a pas de bloc d'encre", "O arquivo vinculado não tem bloco de tinta", "الملف المرتبط لا يحتوي على كتلة الحبر"],
"st_saved_to": ["{p} · saved to {f} {t}", "{p} · guardado en {f} {t}", "{p} · 已保存到 {f} {t}", "{p} · na-save sa {f} {t}", "{p} · đã lưu vào {f} {t}", "{p} · enregistré dans {f} {t}", "{p} · salvo em {f} {t}", "{p} · حُفظ في {f} {t}"],
Expand Down Expand Up @@ -2282,12 +2282,13 @@ <h2>Exit ticket</h2>
async function linkFile(){
var hs = await window.showOpenFilePicker({ types: [{ description: 'This worksheet (.html)', accept: { 'text/html': ['.html', '.htm'] } }] });
var h = hs[0], base = decodeURIComponent(location.pathname.split('/').pop());
// a file without OverBoard in it has nowhere to keep ink: say so before the browser asks to edit it
var txt = await (await h.getFile()).text();
if (injectInk(txt, '{}') === null) { setStatus(tr('st_no_ink_block')); return 'none'; }
// ask to write right away, while the tap that opened the file window still counts: in Chrome, our question
// below uses it up, and then the browser refuses without asking
try { if ((await h.queryPermission({ mode: 'readwrite' })) !== 'granted') await h.requestPermission({ mode: 'readwrite' }); } catch(e){}
if (base && h.name !== base && !confirm(tr('confirm_other_file', { a: base, b: h.name }))) return false;
var txt = await (await h.getFile()).text();
if (injectInk(txt, '{}') === null) { setStatus(tr('st_no_ink_block')); return false; }
fileHandle = h; idb('readwrite', function(st){ return st.put(h, KEY); });
return true;
}
Expand All @@ -2312,7 +2313,7 @@ <h2>Exit ticket</h2>
async function saveFile(forcePick){ // true = ink written into the file, false = not (status line says why), null = picker cancelled
if (!FSA) { setStatus(tr('st_needs_chrome')); return false; }
try {
if (forcePick || !fileHandle) { if (!(await linkFile())) return null; }
if (forcePick || !fileHandle) { var linked = await linkFile(); if (linked === 'none') return false; if (!linked) return null; } // false: Not saved! on the button
writeLocal(true);
for (var i = 0; fileBusy && i < 30; i++) await new Promise(function(r){ setTimeout(r, 100); }); // let an autosave finish first
return await writeFile(true);
Expand Down
11 changes: 6 additions & 5 deletions overlay/ink_overlay.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- ===== INK OVERLAY START (v36) =====
<!-- ===== INK OVERLAY START (v37) =====
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 Expand Up @@ -1566,7 +1566,7 @@
"saved_flash": ["Saved!", "¡Guardado!", "已保存!", "Na-save!", "Đã lưu!", "Enregistré !", "Salvo!", "تم الحفظ!"],
"not_saved": ["Not saved!", "¡No se guardó!", "未保存!", "Hindi na-save!", "Chưa lưu!", "Non enregistré !", "Não salvo!", "لم يُحفظ!"],
"confirm_other_file": ["This page is \"{a}\" but you picked \"{b}\". Save ink into the picked file?", "Esta página es \"{a}\" pero elegiste \"{b}\". ¿Guardar la tinta en el archivo elegido?", "此页面是“{a}”,但你选择了“{b}”。要把笔迹保存到所选文件吗?", "Ang pahinang ito ay \"{a}\" pero \"{b}\" ang pinili mo. I-save ang tinta sa napiling file?", "Trang này là \"{a}\" nhưng bạn đã chọn \"{b}\". Lưu nét mực vào tệp đã chọn?", "Cette page est « {a} » mais vous avez choisi « {b} ». Enregistrer l'encre dans le fichier choisi ?", "Esta página é \"{a}\", mas você escolheu \"{b}\". Salvar a tinta no arquivo escolhido?", "هذه الصفحة هي \"{a}\" لكنك اخترت \"{b}\". هل تحفظ الحبر في الملف المختار؟"],
"st_no_ink_block": ["That file has no ink block. Paste the overlay snippet into it first.", "Ese archivo no tiene bloque de tinta. Primero pega en él el código de OverBoard.", "该文件没有笔迹区块。请先把 OverBoard 代码粘贴进去。", "Walang ink block ang file na iyan. I-paste muna roon ang OverBoard snippet.", "Tệp đó không có khối nét mực. Hãy dán đoạn mã OverBoard vào trước.", "Ce fichier n'a pas de bloc d'encre. Collez-y d'abord le code d'OverBoard.", "Esse arquivo não tem bloco de tinta. Cole o código do OverBoard nele primeiro.", "هذا الملف لا يحتوي على كتلة الحبر. الصق شيفرة OverBoard فيه أولًا."],
"st_no_ink_block": ["That file doesn't have OverBoard in it, so it can't keep ink. Drop it on the OverBoard app first to make a board copy.", "Ese archivo no tiene OverBoard, así que no puede guardar tinta. Primero suéltalo en la app de OverBoard para hacer una copia para la pizarra.", "该文件里没有 OverBoard,无法保存笔迹。请先把它拖到 OverBoard 应用里,生成一份白板副本。", "Walang OverBoard ang file na iyan, kaya hindi ito makakapag-save ng tinta. I-drop muna ito sa OverBoard app para gumawa ng kopya para sa board.", "Tệp đó không có OverBoard nên không lưu được nét mực. Hãy thả nó vào ứng dụng OverBoard trước để tạo bản dùng trên bảng.", "Ce fichier ne contient pas OverBoard, il ne peut donc pas garder l'encre. Déposez-le d'abord sur l'app OverBoard pour en faire une copie pour le tableau.", "Esse arquivo não tem o OverBoard, então não guarda tinta. Primeiro solte-o no app OverBoard para fazer uma cópia para a lousa.", "هذا الملف لا يحتوي على OverBoard، لذا لا يمكنه حفظ الحبر. اسحبه أولًا إلى تطبيق OverBoard لإنشاء نسخة للسبورة."],
"st_tap_allow": ["{p} · tap Save ink into file to allow writing", "{p} · toca Guardar tinta en el archivo para permitir escribir", "{p} · 点按“把笔迹保存到文件”以允许写入", "{p} · i-tap ang I-save ang tinta sa file para payagang magsulat", "{p} · chạm Lưu nét mực vào tệp để cho phép ghi", "{p} · touchez Enregistrer l'encre dans le fichier pour autoriser l'écriture", "{p} · toque em Salvar tinta no arquivo para permitir gravar", "{p} · اضغط «حفظ الحبر في الملف» للسماح بالكتابة"],
"st_linked_no_block": ["Linked file has no ink block", "El archivo vinculado no tiene bloque de tinta", "关联文件没有笔迹区块", "Walang ink block ang naka-link na file", "Tệp liên kết không có khối nét mực", "Le fichier lié n'a pas de bloc d'encre", "O arquivo vinculado não tem bloco de tinta", "الملف المرتبط لا يحتوي على كتلة الحبر"],
"st_saved_to": ["{p} · saved to {f} {t}", "{p} · guardado en {f} {t}", "{p} · 已保存到 {f} {t}", "{p} · na-save sa {f} {t}", "{p} · đã lưu vào {f} {t}", "{p} · enregistré dans {f} {t}", "{p} · salvo em {f} {t}", "{p} · حُفظ في {f} {t}"],
Expand Down Expand Up @@ -2226,12 +2226,13 @@
async function linkFile(){
var hs = await window.showOpenFilePicker({ types: [{ description: 'This worksheet (.html)', accept: { 'text/html': ['.html', '.htm'] } }] });
var h = hs[0], base = decodeURIComponent(location.pathname.split('/').pop());
// a file without OverBoard in it has nowhere to keep ink: say so before the browser asks to edit it
var txt = await (await h.getFile()).text();
if (injectInk(txt, '{}') === null) { setStatus(tr('st_no_ink_block')); return 'none'; }
// ask to write right away, while the tap that opened the file window still counts: in Chrome, our question
// below uses it up, and then the browser refuses without asking
try { if ((await h.queryPermission({ mode: 'readwrite' })) !== 'granted') await h.requestPermission({ mode: 'readwrite' }); } catch(e){}
if (base && h.name !== base && !confirm(tr('confirm_other_file', { a: base, b: h.name }))) return false;
var txt = await (await h.getFile()).text();
if (injectInk(txt, '{}') === null) { setStatus(tr('st_no_ink_block')); return false; }
fileHandle = h; idb('readwrite', function(st){ return st.put(h, KEY); });
return true;
}
Expand All @@ -2256,7 +2257,7 @@
async function saveFile(forcePick){ // true = ink written into the file, false = not (status line says why), null = picker cancelled
if (!FSA) { setStatus(tr('st_needs_chrome')); return false; }
try {
if (forcePick || !fileHandle) { if (!(await linkFile())) return null; }
if (forcePick || !fileHandle) { var linked = await linkFile(); if (linked === 'none') return false; if (!linked) return null; } // false: Not saved! on the button
writeLocal(true);
for (var i = 0; fileBusy && i < 30; i++) await new Promise(function(r){ setTimeout(r, 100); }); // let an autosave finish first
return await writeFile(true);
Expand Down
Loading
Loading