Add ifStuck/stop to frames and captured date to sequences (Refs #23)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
10
src/ops.js
10
src/ops.js
@@ -184,7 +184,7 @@ export function allSequences(doc) {
|
||||
// and the secret flags stay). Returns how many values were erased.
|
||||
export function clearSecrets(doc) {
|
||||
let n = 0;
|
||||
const frames = (q) => { for (const f of q.frames) if (f.secret && (f.image || String(f.text || '').trim())) { f.image = ''; f.text = ''; n++; } };
|
||||
const frames = (q) => { for (const f of q.frames) if (f.secret && (f.image || String(f.text || '').trim() || String(f.ifStuck || '').trim())) { f.image = ''; f.text = ''; if (f.ifStuck) f.ifStuck = ''; n++; } };
|
||||
for (const s of doc.sections) {
|
||||
for (const r of s.records || []) {
|
||||
if (isSequence(r)) frames(r);
|
||||
@@ -217,6 +217,14 @@ export function addFrame(seq, image = '', layout = 'under') {
|
||||
return f;
|
||||
}
|
||||
|
||||
// A step captured from the screen: a new frame, and the sequence remembers when,
|
||||
// so the reader can be told the site may have changed since.
|
||||
export function addCapture(seq, image) {
|
||||
const f = addFrame(seq, image);
|
||||
seq.captured = today();
|
||||
return f;
|
||||
}
|
||||
|
||||
// ---- what a section holds (for the delete confirmation) ----
|
||||
export function sectionContents(section) {
|
||||
const c = { records: 0, items: 0, sequences: 0, images: 0, text: false };
|
||||
|
||||
Reference in New Issue
Block a user