diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-03-11 17:48:30 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-03-11 17:48:30 -0800 |
commit | 83e2fd47485f7036c387563277db06aec14aa462 (patch) | |
tree | d0335ae917308dcb22bef19ad6b909cfd3f4b366 /ext/bg | |
parent | 2c86e875765b1ed4f1753ab51af5583cc9606760 (diff) |
add options for setting popup width, height, offset
Diffstat (limited to 'ext/bg')
-rw-r--r-- | ext/bg/js/options.js | 6 | ||||
-rw-r--r-- | ext/bg/js/util.js | 5 | ||||
-rw-r--r-- | ext/bg/options.html | 15 |
3 files changed, 24 insertions, 2 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index 3b10b74f..a094f73f 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -30,6 +30,9 @@ function formRead() { optionsNew.general.softKatakana = $('#soft-katakana-search').prop('checked'); optionsNew.general.showAdvanced = $('#show-advanced-options').prop('checked'); optionsNew.general.maxResults = parseInt($('#max-displayed-results').val(), 10); + optionsNew.general.popupWidth = parseInt($('#popup-width').val(), 10); + optionsNew.general.popupHeight = parseInt($('#popup-height').val(), 10); + optionsNew.general.popupOffset = parseInt($('#popup-offset').val(), 10); optionsNew.scanning.requireShift = $('#hold-shift-to-scan').prop('checked'); optionsNew.scanning.middleMouse = $('#middle-mouse-button-scan').prop('checked'); @@ -112,6 +115,9 @@ $(document).ready(() => { $('#soft-katakana-search').prop('checked', options.general.softKatakana); $('#show-advanced-options').prop('checked', options.general.showAdvanced); $('#max-displayed-results').val(options.general.maxResults); + $('#popup-width').val(options.general.popupWidth); + $('#popup-height').val(options.general.popupHeight); + $('#popup-offset').val(options.general.popupOffset); $('#hold-shift-to-scan').prop('checked', options.scanning.requireShift); $('#middle-mouse-button-scan').prop('checked', options.scanning.middleMouse); diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js index 7f031040..f9b221b3 100644 --- a/ext/bg/js/util.js +++ b/ext/bg/js/util.js @@ -79,7 +79,10 @@ function optionsSetDefaults(options) { groupResults: true, softKatakana: true, maxResults: 32, - showAdvanced: false + showAdvanced: false, + popupWidth: 400, + popupHeight: 250, + popupOffset: 10 }, scanning: { diff --git a/ext/bg/options.html b/ext/bg/options.html index b2d4c3c6..2c7256c2 100644 --- a/ext/bg/options.html +++ b/ext/bg/options.html @@ -45,13 +45,26 @@ <label for="max-displayed-results">Maximum displayed results</label> <input type="number" min="1" id="max-displayed-results" class="form-control"> </div> + + <div class="form-group options-advanced"> + <label>Popup size (in pixels)</label> + <div class="row"> + <div class="col-xs-6"><input type="number" min="1" id="popup-width" class="form-control"></div> + <div class="col-xs-6"><input type="number" min="1" id="popup-height" class="form-control"></div> + </div> + </div> + + <div class="form-group options-advanced"> + <label for="popup-offset">Popup offset (in pixels)</label> + <input type="number" min="0" id="popup-offset" class="form-control"> + </div> </div> <div> <h3>Scanning Options</h3> <div class="checkbox"> - <label><input type="checkbox" id="middle-mouse-button-scan"> Middle mouse button scanning</label> + <label><input type="checkbox" id="middle-mouse-button-scan"> Middle mouse button scans</label> </div> <div class="checkbox"> |