aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/options.js
diff options
context:
space:
mode:
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,