The sentence currently being recited should be highlighted.
Proposed solution: Wrap the current sentence in a span with a particular CSS-class. Preferably, there should only be one span for this (see: T122158#2651737)
The sentence currently being recited should be highlighted.
Proposed solution: Wrap the current sentence in a span with a particular CSS-class. Preferably, there should only be one span for this (see: T122158#2651737)
Project | Branch | Lines +/- | Subject | |
---|---|---|---|---|
mediawiki/extensions/Wikispeech | master | +1 K -728 | Highlight recited sentence |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T152430 Run Wikispeech offline | |||
Resolved | HaraldBerthelsen | T143644 Multiple requests to TTS server should not cause delay | |||
Resolved | Jopparn | T151786 Publically accessible demo (player) [Stage 1+2] | |||
Resolved | Sebastian_Berlin-WMSE | T122158 Highlight recited text (was: Display the read word) | |||
Resolved | Sebastian_Berlin-WMSE | T148623 Highlight recited word | |||
Resolved | Sebastian_Berlin-WMSE | T158954 Use XPath to get text nodes related to utterances | |||
Resolved | Sebastian_Berlin-WMSE | T148622 Highlight recited sentence |
Worked on in Wikispeech (Sprint 2016-11-30):
To do in Wikispeech (Sprint 2016-12-14):
Adding <span> is tricky when they span multiple nodes. E.g. adding a <span> over "monkey penguin" in:
monkey <b> penguin giraffe </b>
doesn't work, since it would be broken HTML:
<span> monkey <b> penguin</span> giraffe </b>
While there are some methods for [[https://developer.mozilla.org/en-US/docs/Web/API/Range | Range]] that looked promising (like surroundContents() and insertNode()) experimenting with them has shown that they add/split elements, making it hard to remove the <span>.
I'm currently working on a solution that will instead find all the text nodes that should get highlighted and adding a <span> for each of them. Removing these later shouldn't be too hard and should leave the HTML intact. A (at the time of writing ugly) draft for getting all text nodes between to nodes can be seen here.
I have a reasonably working version of this locally. It still needs a bit more testing and, cleaning and merging.
Worked on in Wikispeech (Sprint 2016-12-14):
To do in Wikispeech (Sprint 2017-01-25):
The current under development solution uses index paths ([1, 0 ,4]) to find the correct nodes. Could Xpath be used instead? See https://developer.mozilla.org/en-US/docs/Introduction_to_using_XPath_in_JavaScript.
Worked on in Wikispeech (Sprint 2017-01-25):
To do in Wikispeech (Sprint 2017-02-08):
Changed story points to new system
Change 336816 had a related patch set uploaded (by Sebastian Berlin (WMSE)):
Highlight recited sentence
Worked on in Wikispeech (Sprint 2017-02-08):
To do in Wikispeech (Sprint 2017-02-22):
Change 336816 merged by jenkins-bot:
[mediawiki/extensions/Wikispeech] Highlight recited sentence
Mentioned in SAL (#wikimedia-labs) [2017-03-03T15:06:10Z] <Sebastian_> Deploy latest from Git master: e2fbe6a (T148622)