aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/options.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-09 22:33:35 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-10-10 21:30:35 -0400
commit8ae1da427756a9a1e057b3518c4069ac7d5b4b3a (patch)
tree45356e700289c2b264e1a406c1984b10574be468 /ext/bg/js/options.js
parent22b218d17238cc003938ef46403596c2183a9c1b (diff)
Update audio options format
Diffstat (limited to 'ext/bg/js/options.js')
-rw-r--r--ext/bg/js/options.js23
1 files changed, 20 insertions, 3 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index a2ab8877..d0aa6fd3 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -74,6 +74,18 @@ const profileOptionsVersionUpdates = [
if (utilStringHashCode(options.anki.fieldTemplates) === -250091611) {
options.anki.fieldTemplates = profileOptionsGetDefaultFieldTemplates();
}
+ },
+ (options) => {
+ const oldAudioSource = options.general.audioSource;
+ const disabled = oldAudioSource === 'disabled';
+ options.audio.enabled = !disabled;
+ options.audio.volume = options.general.audioVolume;
+ options.audio.autoPlay = options.general.autoPlayAudio;
+ options.audio.sources = [disabled ? 'jpod101' : oldAudioSource];
+
+ delete options.general.audioSource;
+ delete options.general.audioVolume;
+ delete options.general.autoPlayAudio;
}
];
@@ -247,9 +259,6 @@ function profileOptionsCreateDefaults() {
return {
general: {
enable: true,
- audioSource: 'jpod101',
- audioVolume: 100,
- autoPlayAudio: false,
resultOutputMode: 'group',
debugInfo: false,
maxResults: 32,
@@ -270,6 +279,14 @@ function profileOptionsCreateDefaults() {
customPopupCss: ''
},
+ audio: {
+ enabled: true,
+ sources: ['jpod101', 'jpod101-alternate', 'jisho', 'custom'],
+ volume: 100,
+ autoPlay: false,
+ customSourceUrl: ''
+ },
+
scanning: {
middleMouse: true,
touchInputEnabled: true,