Hide transcript editor markup behind view classes #74
Loading…
Reference in a new issue
No description provided.
Delete branch "transcript-editor-abstractions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Previously, the transcript editor script read the admin page's HTML directly: it selected
span[data-segment-id], walked up to the enclosingarticleto find a speakerturn, and kept its state in module-level variables. Any change to the template
meant hunting through the controller for the selectors it broke.
This change splits the script in two.
transcript-editor/view.jsowns every selectorand DOM read.
TranscriptSegmentwraps one contenteditable segment and convertsbetween the code-point offsets the server uses and the UTF-16 offsets DOM ranges
use.
SpeakerTurnholds one speaker's run of segments and decides where aparagraph break lands.
TranscriptEditorViewwraps the editor root, andSegmentMenuViewwraps the context menu.transcript-editor.jsbecomes aTranscriptEditorControllerthat turns DOM events into saves and carries savestate across the htmx swap that answers each one. It no longer names a tag,
class, or attribute.
The template marks each speaker turn with
data-speaker-turnso the view stopsdepending on the
articleelement.Hide transcript markup behind editor abstractionsto Hide transcript editor markup behind view classes