Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 24 additions & 30 deletions chat-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,39 +761,33 @@ document.addEventListener("DOMContentLoaded", () => {
openVoiceSettingsModalBtn.addEventListener("click", () => {
voiceSettingsModal.classList.remove("hidden");
window._chatInternals.populateAllVoiceDropdowns();
const voiceSpeedInput = document.getElementById("voice-speed");
const voicePitchInput = document.getElementById("voice-pitch");
const voiceSpeedValue = document.getElementById("voice-speed-value");
const voicePitchValue = document.getElementById("voice-pitch-value");
const autoSpeakModalCheckbox = document.getElementById("auto-speak-modal");
voiceSpeedInput.value = localStorage.getItem("voiceSpeed") || 0.9;
voicePitchInput.value = localStorage.getItem("voicePitch") || 1.0;
voiceSpeedValue.textContent = `${voiceSpeedInput.value}x`;
voicePitchValue.textContent = `${voicePitchInput.value}x`;
autoSpeakModalCheckbox.checked = window._chatInternals.autoSpeakEnabled;
});
const voiceSpeedInput = document.getElementById("voice-speed");
const voicePitchInput = document.getElementById("voice-pitch");
const voiceSpeedValue = document.getElementById("voice-speed-value");
const voicePitchValue = document.getElementById("voice-pitch-value");
voiceSpeedInput.value = localStorage.getItem("voiceSpeed") || 0.9;
voicePitchInput.value = localStorage.getItem("voicePitch") || 1.0;
voiceSpeedValue.textContent = `${voiceSpeedInput.value}x`;
voicePitchValue.textContent = `${voicePitchInput.value}x`;
});
document.getElementById("voice-settings-modal-close").addEventListener("click", () => voiceSettingsModal.classList.add("hidden"));
document.getElementById("voice-settings-cancel").addEventListener("click", () => voiceSettingsModal.classList.add("hidden"));
document.getElementById("voice-settings-save").addEventListener("click", () => {
const voiceSpeedInput = document.getElementById("voice-speed");
const voicePitchInput = document.getElementById("voice-pitch");
const autoSpeakModalCheckbox = document.getElementById("auto-speak-modal");
const voiceSelectModal = document.getElementById("voice-select-modal");
const selectedVoiceIndex = voiceSelectModal.value;
const voiceSpeed = voiceSpeedInput.value;
const voicePitch = voicePitchInput.value;
const autoSpeakEnabled = autoSpeakModalCheckbox.checked;
window._chatInternals.selectedVoice = window._chatInternals.voices[selectedVoiceIndex];
window._chatInternals.autoSpeakEnabled = autoSpeakEnabled;
localStorage.setItem("selectedVoiceIndex", selectedVoiceIndex);
localStorage.setItem("voiceSpeed", voiceSpeed);
localStorage.setItem("voicePitch", voicePitch);
localStorage.setItem("autoSpeakEnabled", autoSpeakEnabled.toString());
window._chatInternals.updateVoiceToggleUI();
updateAllVoiceDropdowns(selectedVoiceIndex);
voiceSettingsModal.classList.add("hidden");
showToast("Voice settings saved");
});
const voiceSpeedInput = document.getElementById("voice-speed");
const voicePitchInput = document.getElementById("voice-pitch");
const voiceSelectModal = document.getElementById("voice-select-modal");
const selectedVoiceIndex = voiceSelectModal.value;
const voiceSpeed = voiceSpeedInput.value;
const voicePitch = voicePitchInput.value;
window._chatInternals.selectedVoice = window._chatInternals.voices[selectedVoiceIndex];
localStorage.setItem("selectedVoiceIndex", selectedVoiceIndex);
localStorage.setItem("voiceSpeed", voiceSpeed);
localStorage.setItem("voicePitch", voicePitch);
window._chatInternals.updateVoiceToggleUI();
updateAllVoiceDropdowns(selectedVoiceIndex);
voiceSettingsModal.classList.add("hidden");
showToast("Voice settings saved");
});
document.getElementById("voice-speed").addEventListener("input", () => {
document.getElementById("voice-speed-value").textContent = `${document.getElementById("voice-speed").value}x`;
});
Expand Down
54 changes: 24 additions & 30 deletions chat-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -834,43 +834,37 @@ document.addEventListener("DOMContentLoaded", () => {
openVoiceSettingsModalBtn.addEventListener("click", () => {
voiceSettingsModal.classList.remove("hidden");
window._chatInternals.populateAllVoiceDropdowns();
const voiceSpeedInput = document.getElementById("voice-speed");
const voicePitchInput = document.getElementById("voice-pitch");
const voiceSpeedValue = document.getElementById("voice-speed-value");
const voicePitchValue = document.getElementById("voice-pitch-value");
const autoSpeakModalCheckbox = document.getElementById("auto-speak-modal");
voiceSpeedInput.value = localStorage.getItem("voiceSpeed") || 0.9;
voicePitchInput.value = localStorage.getItem("voicePitch") || 1.0;
voiceSpeedValue.textContent = `${voiceSpeedInput.value}x`;
voicePitchValue.textContent = `${voicePitchInput.value}x`;
autoSpeakModalCheckbox.checked = window._chatInternals.autoSpeakEnabled;
});
const voiceSpeedInput = document.getElementById("voice-speed");
const voicePitchInput = document.getElementById("voice-pitch");
const voiceSpeedValue = document.getElementById("voice-speed-value");
const voicePitchValue = document.getElementById("voice-pitch-value");
voiceSpeedInput.value = localStorage.getItem("voiceSpeed") || 0.9;
voicePitchInput.value = localStorage.getItem("voicePitch") || 1.0;
voiceSpeedValue.textContent = `${voiceSpeedInput.value}x`;
voicePitchValue.textContent = `${voicePitchInput.value}x`;
});
document.getElementById("voice-settings-modal-close").addEventListener("click", () => {
voiceSettingsModal.classList.add("hidden");
});
document.getElementById("voice-settings-cancel").addEventListener("click", () => {
voiceSettingsModal.classList.add("hidden");
});
document.getElementById("voice-settings-save").addEventListener("click", () => {
const voiceSpeedInput = document.getElementById("voice-speed");
const voicePitchInput = document.getElementById("voice-pitch");
const autoSpeakModalCheckbox = document.getElementById("auto-speak-modal");
const voiceSelectModal = document.getElementById("voice-select-modal");
const selectedVoiceIndex = voiceSelectModal.value;
const voiceSpeed = voiceSpeedInput.value;
const voicePitch = voicePitchInput.value;
const autoSpeakEnabled = autoSpeakModalCheckbox.checked;
window._chatInternals.selectedVoice = window._chatInternals.voices[selectedVoiceIndex];
window._chatInternals.autoSpeakEnabled = autoSpeakEnabled;
localStorage.setItem("selectedVoiceIndex", selectedVoiceIndex);
localStorage.setItem("voiceSpeed", voiceSpeed);
localStorage.setItem("voicePitch", voicePitch);
localStorage.setItem("autoSpeakEnabled", autoSpeakEnabled.toString());
window._chatInternals.updateVoiceToggleUI();
updateAllVoiceDropdowns(selectedIndex);
voiceSettingsModal.classList.add("hidden");
showToast("Voice settings saved");
});
const voiceSpeedInput = document.getElementById("voice-speed");
const voicePitchInput = document.getElementById("voice-pitch");
const voiceSelectModal = document.getElementById("voice-select-modal");
const selectedVoiceIndex = voiceSelectModal.value;
const voiceSpeed = voiceSpeedInput.value;
const voicePitch = voicePitchInput.value;
window._chatInternals.selectedVoice = window._chatInternals.voices[selectedVoiceIndex];
localStorage.setItem("selectedVoiceIndex", selectedVoiceIndex);
localStorage.setItem("voiceSpeed", voiceSpeed);
localStorage.setItem("voicePitch", voicePitch);
window._chatInternals.updateVoiceToggleUI();
updateAllVoiceDropdowns(selectedVoiceIndex);
voiceSettingsModal.classList.add("hidden");
showToast("Voice settings saved");
});
document.getElementById("voice-speed").addEventListener("input", () => {
document.getElementById("voice-speed-value").textContent = `${document.getElementById("voice-speed").value}x`;
});
Expand Down
28 changes: 12 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -349,22 +349,18 @@ <h3 class="modal-title">Voice Settings</h3>
<input type="range" id="voice-speed" class="form-range" min="0.5" max="2.0" step="0.1" value="1.0">
<span id="voice-speed-value">1.0x</span>
</div>
<div class="form-group mb-3">
<label for="voice-pitch" class="form-label">
<i class="fas fa-music"></i> Pitch:
</label>
<input type="range" id="voice-pitch" class="form-range" min="0.5" max="2.0" step="0.1" value="1.0">
<span id="voice-pitch-value">1.0x</span>
</div>
<div class="form-check mb-3">
<input type="checkbox" id="auto-speak-modal" class="form-check-input">
<label class="form-check-label" for="auto-speak-modal">Enable Auto-Speak</label>
</div>
</div>
<div class="modal-footer">
<button id="voice-settings-save" class="btn btn-primary">Save</button>
<button id="voice-settings-cancel" class="btn btn-secondary">Cancel</button>
</div>
<div class="form-group mb-3">
<label for="voice-pitch" class="form-label">
<i class="fas fa-music"></i> Pitch:
</label>
<input type="range" id="voice-pitch" class="form-range" min="0.5" max="2.0" step="0.1" value="1.0">
<span id="voice-pitch-value">1.0x</span>
</div>
</div>
<div class="modal-footer">
<button id="voice-settings-save" class="btn btn-primary">Save</button>
<button id="voice-settings-cancel" class="btn btn-secondary">Cancel</button>
</div>
</div>
</div>
<div id="voice-chat-modal" class="modal-backdrop hidden">
Expand Down