fix & feat: resolve user reports #1 through #8 (TTS voice & speed, modals, scrollbar, CEFR hint, SRS grammar exclusion, global word lookup)
This commit is contained in:
1 parent
8cffae46fa
commit
7871191c90
12 files changed
+443
-103
No files matched your search
@@ -167,8 +167,7 @@ export function initDictionary() {
|
||||
audioPlayBtn.addEventListener('click', () => {
|
||||
const term = currentLookupData?.term || currentLookupData?.english_term;
|
||||
if (!term) return;
|
||||
const url = currentLookupData.audio_url || `/api/tts?text=${encodeURIComponent(term)}&lang=en`;
|
||||
playAudio(url);
|
||||
playTextSpeech(term, 'en');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -402,7 +401,10 @@ export function initDictionary() {
|
||||
${c.context_sentence ? `
|
||||
<div class="card-context">
|
||||
“${escapeHtml(c.context_sentence)}”
|
||||
<button class="icon-btn audio-play-btn play-context-audio-btn" data-id="${c.id}" title="Озвучить пример">🔊</button>
|
||||
<span class="audio-ctrl-group">
|
||||
<button class="icon-btn audio-play-btn play-context-audio-btn" data-id="${c.id}" title="Озвучить пример (1.0x)">🔊</button>
|
||||
<button class="icon-btn audio-slow-btn play-context-slow-btn" data-id="${c.id}" title="Озвучить медленно (0.7x)">🐢 0.7x</button>
|
||||
</span>
|
||||
</div>` : ''}
|
||||
<div class="card-bottom">
|
||||
<div class="card-tags">
|
||||
@@ -416,13 +418,17 @@ export function initDictionary() {
|
||||
// Audio buttons
|
||||
cardEl.querySelector('.play-term-audio-btn')?.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
if (c.audio_url) playAudio(c.audio_url);
|
||||
else playTextSpeech(c.term, 'en');
|
||||
playTextSpeech(c.term, 'en', 1.0);
|
||||
});
|
||||
|
||||
cardEl.querySelector('.play-context-audio-btn')?.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
playTextSpeech(c.context_sentence, 'en');
|
||||
playTextSpeech(c.context_sentence, 'en', 1.0);
|
||||
});
|
||||
|
||||
cardEl.querySelector('.play-context-slow-btn')?.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
playTextSpeech(c.context_sentence, 'en', 0.75);
|
||||
});
|
||||
|
||||
// Edit button
|
||||
|
||||
Reference in new issue
Block a user