aboutsummaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-04-01 12:01:34 -0700
committerAlex Yatskov <alex@foosoft.net>2017-04-01 12:01:34 -0700
commit4de9e5e9e06031e163bfeb27f83a8614f912d454 (patch)
tree806a43c7131aa56d9e2d6db5cf9dbbfd4d76aae8 /ext/bg
parentf556c95038e2ef9e4d97b4168ce417ba0d74282f (diff)
support for audio volume adjustment (fixes #39)
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/options.js2
-rw-r--r--ext/bg/js/util.js1
-rw-r--r--ext/bg/options.html13
3 files changed, 12 insertions, 4 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index 2089cc53..75f39d24 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -26,6 +26,7 @@ function formRead() {
const optionsNew = $.extend(true, {}, optionsOld);
optionsNew.general.audioPlayback = $('#audio-playback-buttons').prop('checked');
+ optionsNew.general.audioVolume = $('#audio-playback-volume').val();
optionsNew.general.groupResults = $('#group-terms-results').prop('checked');
optionsNew.general.softKatakana = $('#soft-katakana-search').prop('checked');
optionsNew.general.showAdvanced = $('#show-advanced-options').prop('checked');
@@ -111,6 +112,7 @@ $(document).ready(() => {
optionsLoad().then(options => {
$('#audio-playback-buttons').prop('checked', options.general.audioPlayback);
+ $('#audio-playback-volume').val(options.general.audioVolume);
$('#group-terms-results').prop('checked', options.general.groupResults);
$('#soft-katakana-search').prop('checked', options.general.softKatakana);
$('#show-advanced-options').prop('checked', options.general.showAdvanced);
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index b3e4feec..78258c97 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -85,6 +85,7 @@ function optionsSetDefaults(options) {
general: {
enable: true,
audioPlayback: true,
+ audioVolume: 100,
groupResults: true,
softKatakana: true,
maxResults: 32,
diff --git a/ext/bg/options.html b/ext/bg/options.html
index 3e457d2d..c483c656 100644
--- a/ext/bg/options.html
+++ b/ext/bg/options.html
@@ -26,10 +26,6 @@
<h3>General Options</h3>
<div class="checkbox">
- <label><input type="checkbox" id="audio-playback-buttons"> Audio playback buttons</label>
- </div>
-
- <div class="checkbox">
<label><input type="checkbox" id="group-terms-results"> Group term results</label>
</div>
@@ -41,6 +37,15 @@
<label><input type="checkbox" id="soft-katakana-search"> Soft Katakana search</label>
</div>
+ <div class="checkbox">
+ <label><input type="checkbox" id="audio-playback-buttons"> Audio playback buttons</label>
+ </div>
+
+ <div class="form-group options-advanced">
+ <label for="audio-playback-volume">Audio playback volume (percent)</label>
+ <input type="number" min="0" max="100" id="audio-playback-volume" class="form-control">
+ </div>
+
<div class="form-group options-advanced">
<label for="max-displayed-results">Maximum displayed results</label>
<input type="number" min="1" id="max-displayed-results" class="form-control">