aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/settings.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-10 21:28:27 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-10 21:36:09 -0400
commit6208d6c93b3921ac8726140869ae71d784569b48 (patch)
tree1f2dd46af5c567841c9b882343bcf3905d077ae9 /ext/bg/js/settings.js
parent1dc8bf77ca129555f0e56ef0f890105c14ab94ff (diff)
Add UI for editing audio playback sources
Diffstat (limited to 'ext/bg/js/settings.js')
-rw-r--r--ext/bg/js/settings.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js
index 89ba046d..f3b5ff16 100644
--- a/ext/bg/js/settings.js
+++ b/ext/bg/js/settings.js
@@ -158,7 +158,7 @@ function formSetupEventListeners() {
$('#dict-file-button').click(onDictionaryImportButtonClick);
$('#field-templates-reset').click(utilAsync(onAnkiFieldTemplatesReset));
- $('input, select, textarea').not('.anki-model').not('.profile-form *').change(utilAsync(onFormOptionsChanged));
+ $('input, select, textarea').not('.anki-model').not('.ignore-form-changes *').change(utilAsync(onFormOptionsChanged));
$('.anki-model').change(utilAsync(onAnkiModelChanged));
}
@@ -248,6 +248,7 @@ async function onReady() {
showExtensionInformation();
formSetupEventListeners();
+ await audioSettingsInitialize();
await profileOptionsSetup();
storageInfoInitialize();
@@ -259,6 +260,20 @@ $(document).ready(utilAsync(onReady));
/*
+ * Audio
+ */
+
+let audioSourceUI = null;
+
+async function audioSettingsInitialize() {
+ const optionsContext = getOptionsContext();
+ const options = await apiOptionsGet(optionsContext);
+ audioSourceUI = new AudioSourceUI.Container(options.audio.sources, $('.audio-source-list'), $('.audio-source-add'));
+ audioSourceUI.save = () => apiOptionsSave();
+}
+
+
+/*
* Remote options updates
*/