Added functionality and dark mode to doctests. And other changes in maps.
This commit is contained in:
+14
-6
@@ -497,6 +497,7 @@ CardPlugin.Speech = class SpeechPlugin extends CardPluginBase {
|
||||
|
||||
remove() {
|
||||
this.button = null
|
||||
this._stopThisSpeechIfPlaying()
|
||||
this.context.removeEventListener('DOMNodeRemoved', this._domWasChanged)
|
||||
super.remove()
|
||||
}
|
||||
@@ -514,12 +515,18 @@ CardPlugin.Speech = class SpeechPlugin extends CardPluginBase {
|
||||
context.addEventListener('DOMNodeRemoved', this._domWasChanged)
|
||||
}
|
||||
|
||||
/**
|
||||
* Don't remember why this was required - SO 20-11-2019
|
||||
*/
|
||||
_domWasChanged(event) {
|
||||
if (this.context == null) this._stop()
|
||||
else if (
|
||||
this.context['lastSpeechNode'] == window.speechSynthesis['speechPluginNode'] &&
|
||||
event.target == this.context
|
||||
) {
|
||||
if (event.target == this.context) this._stopThisSpeechIfPlaying()
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the module if it is set in the context.
|
||||
*/
|
||||
_stopThisSpeechIfPlaying() {
|
||||
if (this.context == null || this.context['lastSpeechNode'] == window.speechSynthesis['speechPluginNode']) {
|
||||
this._stop()
|
||||
}
|
||||
}
|
||||
@@ -543,7 +550,6 @@ CardPlugin.Speech = class SpeechPlugin extends CardPluginBase {
|
||||
* SO -17.07.19
|
||||
*/
|
||||
|
||||
let activeNode = window.speechSynthesis['speechPluginNode']
|
||||
this._updateText()
|
||||
}
|
||||
|
||||
@@ -585,6 +591,8 @@ CardPlugin.Speech = class SpeechPlugin extends CardPluginBase {
|
||||
this.context.classList.add('speech-plugin-is-reading')
|
||||
}
|
||||
|
||||
closed() {}
|
||||
|
||||
_cleanupText(node) {
|
||||
let text = node.textContent
|
||||
text = this._removeShy(text)
|
||||
|
||||
Reference in New Issue
Block a user