HomePhabricator

Highlight recited word

Authored by Sebastian_Berlin-WMSE on Mar 7 2017, 6:41 AM.

Description

Highlight recited word

Span elements are added around the text nodes in the page HTML that
represent the token being recited. Timeouts are used to move the
highlighting when the next token starts. While this is not very
accurate over longer time, it seems to work here as the durations of
tokens aren't very long and the timeout is updated each token.

Token elements were updated with information used to find the
corresponding text in the page HTML. This includes text nodes, through
text elements, and offset for where in the text nodes the token starts
and ends.

Abstracted the logic for wrapping utterances, that was implemented
previously, to be reusable for tokens too.

Broke out the logic for highlighting into a separate module, with
corresponding test module.

Changed the default colours for highlighting to solid, rather than
semitransparent; this didn't work when there were multiple,
overlapping highlightings.

Change-Id: I097b969ce00274b5f8d16d98c9d7ffd8c12f4fe1
Bug: T148623

Details

Committed
Sebastian_Berlin-WMSEJun 14 2017, 8:45 AM
Parents
rEWIS891162a0a0cc: Merge "Add feedback button"
Branches
Unknown
Tags
Unknown
ChangeId
I097b969ce00274b5f8d16d98c9d7ffd8c12f4fe1