Remove Alabanza/Language, fix dropdown popup clipping
- Alabanza style removed: it only has Spanish recordings, so it always played nothing under the (now-removed) English default. - Language dropdown removed entirely; translation is hard-coded to English (sbe) in Model.js, overriding any legacy saved state too. - Dropdown popups were rendering past the popup window's bottom edge and getting clipped, since the window is sized only to the collapsed rows. Reserve room for the open popup, but only while a dropdown is actually expanded, so the panel doesn't carry permanent dead space. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LYvjTEDeh9T6NqBDdCALMq
This commit is contained in:
21
Model.js
21
Model.js
@@ -56,12 +56,15 @@ function enabledFirst(list) {
|
||||
return list.length ? list[0] : null
|
||||
}
|
||||
|
||||
// Language is hard-coded to English (sbe) — no Language dropdown, no
|
||||
// per-user Spanish selection.
|
||||
var FIXED_TRANSLATION = "sbe"
|
||||
|
||||
function defaultDesired(manifest) {
|
||||
var t = enabledFirst(manifest.translations)
|
||||
var v = enabledFirst(manifest.voices)
|
||||
var s = enabledFirst(manifest.styles)
|
||||
return {
|
||||
translation: t ? t.id : "",
|
||||
translation: FIXED_TRANSLATION,
|
||||
voice: v ? v.id : "",
|
||||
style: s ? s.id : "",
|
||||
book: manifest.books && manifest.books.length ? bookKey(manifest.books[0]) : "01-genesis",
|
||||
@@ -203,10 +206,12 @@ function optionsForBooks(manifest) {
|
||||
return out
|
||||
}
|
||||
|
||||
function optionsForStyles(manifest) { return toOptions(manifest.styles) }
|
||||
// Alabanza only has Spanish recordings (no sbe/*/alabanza in availability),
|
||||
// so it's excluded here to avoid a style that silently plays nothing.
|
||||
function optionsForStyles(manifest) {
|
||||
return toOptions(manifest.styles).filter(function(o) { return o.value !== "alabanza" })
|
||||
}
|
||||
function optionsForVoices(manifest) { return toOptions(manifest.voices) }
|
||||
function optionsForTranslations(manifest) { return toOptions(manifest.translations) }
|
||||
|
||||
function optionsForChapters(manifest, sel) {
|
||||
var chapters = chaptersFor(manifest, sel.translation, sel.voice, sel.age, sel.style, sel.book)
|
||||
var out = []
|
||||
@@ -218,9 +223,11 @@ function parseStateFile(raw) {
|
||||
try {
|
||||
var data = JSON.parse(String(raw || ""))
|
||||
if (!data || typeof data !== "object") return null
|
||||
if (!data.translation || !data.voice || !data.style || !data.book || !data.chapter) return null
|
||||
if (!data.voice || !data.style || !data.book || !data.chapter) return null
|
||||
return {
|
||||
translation: String(data.translation),
|
||||
// Forced regardless of what an older state.json saved (from before
|
||||
// Language was hard-coded to English).
|
||||
translation: FIXED_TRANSLATION,
|
||||
voice: String(data.voice),
|
||||
style: String(data.style),
|
||||
book: String(data.book),
|
||||
|
||||
Reference in New Issue
Block a user