summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authorguidocella <guidocella91@gmail.com>2017-12-16 19:56:53 +0100
committerguidocella <guidocella91@gmail.com>2017-12-16 19:56:53 +0100
commit15b93060c76ee4d59eb8ef90f6e1f8dea4c34ac9 (patch)
tree7c0d664473c8472661b9c41c63eb7e5fd01d9706 /ext/bg
parenta17e84de83e3f8750d41acf942c4fe476230d83a (diff)
Add option to play audio automatically
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/options.js1
-rw-r--r--ext/bg/js/settings.js2
-rw-r--r--ext/bg/settings.html4
3 files changed, 7 insertions, 0 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 925c8432..373a1a6b 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -185,6 +185,7 @@ function optionsSetDefaults(options) {
enable: true,
audioSource: 'jpod101',
audioVolume: 100,
+ autoPlayAudio: false,
resultOutputMode: 'group',
debugInfo: false,
maxResults: 32,
diff --git a/ext/bg/js/settings.js b/ext/bg/js/settings.js
index dcc9c43d..7bc6a651 100644
--- a/ext/bg/js/settings.js
+++ b/ext/bg/js/settings.js
@@ -24,6 +24,7 @@ async function formRead() {
optionsNew.general.showGuide = $('#show-usage-guide').prop('checked');
optionsNew.general.compactTags = $('#compact-tags').prop('checked');
optionsNew.general.compactGlossaries = $('#compact-glossaries').prop('checked');
+ optionsNew.general.autoPlayAudio = $('#auto-play-audio').prop('checked');
optionsNew.general.resultOutputMode = $('#result-output-mode').val();
optionsNew.general.audioSource = $('#audio-playback-source').val();
optionsNew.general.audioVolume = parseFloat($('#audio-playback-volume').val());
@@ -153,6 +154,7 @@ async function onReady() {
$('#show-usage-guide').prop('checked', options.general.showGuide);
$('#compact-tags').prop('checked', options.general.compactTags);
$('#compact-glossaries').prop('checked', options.general.compactGlossaries);
+ $('#auto-play-audio').prop('checked', options.general.autoPlayAudio);
$('#result-output-mode').val(options.general.resultOutputMode);
$('#audio-playback-source').val(options.general.audioSource);
$('#audio-playback-volume').val(options.general.audioVolume);
diff --git a/ext/bg/settings.html b/ext/bg/settings.html
index 65043d44..c77f550c 100644
--- a/ext/bg/settings.html
+++ b/ext/bg/settings.html
@@ -44,6 +44,10 @@
</div>
<div class="checkbox">
+ <label><input type="checkbox" id="auto-play-audio"> Play audio automatically</label>
+ </div>
+
+ <div class="checkbox">
<label><input type="checkbox" id="show-advanced-options"> Show advanced options</label>
</div>