Skip to content

extend usage of selectors in annotations

Paul Pestov requested to merge feature/#372-annotation-ids into develop

This MR implements the results of our discussions on working with annotation ids/ target ids and selectors. Previously the annotations feature relied only on target.id string. The connection with the text was in the end made by 'getElementbyId` in the simple case. Since the idea behind the Annotation API is to keep the content separated from the annotation object, we would "misuse" that feature by hardcoing and id selector into TIDO.

So the solution could be to mostly rely on selectors. In the Annotation API there is a target.selector object which is already used in TIDO. So we now use the selector object as a central interaction point. To track down the active/inactive state of annotations we now use annotation.ids instead of target.ids.

This also prepares the code for having a text selection feature coming up next (#365 (closed)).

closes #372 (closed)

Edited by Paul Pestov

Merge request reports