From 1575bf4292e3f85ceb6425fb1d3c478222f4cdf6 Mon Sep 17 00:00:00 2001 From: Steve White Date: Fri, 6 Jun 2025 00:05:05 -0500 Subject: [PATCH] Made speakers drop-down selectable. --- frontend/js/app.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/frontend/js/app.js b/frontend/js/app.js index 7a5b856..be3a786 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -147,8 +147,19 @@ function initializeDialogEditor() { // Speaker column const speakerTd = document.createElement('td'); if (item.type === 'speech') { - const speaker = availableSpeakersCache.find(s => s.id === item.speaker_id); - speakerTd.textContent = speaker ? speaker.name : 'Unknown Speaker'; + const speakerSelect = document.createElement('select'); + speakerSelect.className = 'dialog-speaker-select'; + availableSpeakersCache.forEach(speaker => { + const option = document.createElement('option'); + option.value = speaker.id; + option.textContent = speaker.name; + if (speaker.id === item.speaker_id) option.selected = true; + speakerSelect.appendChild(option); + }); + speakerSelect.onchange = (e) => { + dialogItems[index].speaker_id = e.target.value; + }; + speakerTd.appendChild(speakerSelect); } else { speakerTd.textContent = '—'; }