middle mouse button scanning

This commit is contained in:
Alex Yatskov 2017-03-05 16:03:14 -08:00
parent a4dfadaa15
commit efc5be4dac
5 changed files with 9 additions and 2 deletions

View File

@ -32,6 +32,7 @@ function formRead() {
optionsNew.general.maxResults = parseInt($('#max-displayed-results').val(), 10); optionsNew.general.maxResults = parseInt($('#max-displayed-results').val(), 10);
optionsNew.scanning.requireShift = $('#hold-shift-to-scan').prop('checked'); optionsNew.scanning.requireShift = $('#hold-shift-to-scan').prop('checked');
optionsNew.scanning.middleMouse = $('#middle-mouse-button-scan').prop('checked');
optionsNew.scanning.selectText = $('#select-matched-text').prop('checked'); optionsNew.scanning.selectText = $('#select-matched-text').prop('checked');
optionsNew.scanning.imposter = $('#search-form-text-fields').prop('checked'); optionsNew.scanning.imposter = $('#search-form-text-fields').prop('checked');
optionsNew.scanning.delay = parseInt($('#scan-delay').val(), 10); optionsNew.scanning.delay = parseInt($('#scan-delay').val(), 10);
@ -113,6 +114,7 @@ $(document).ready(() => {
$('#max-displayed-results').val(options.general.maxResults); $('#max-displayed-results').val(options.general.maxResults);
$('#hold-shift-to-scan').prop('checked', options.scanning.requireShift); $('#hold-shift-to-scan').prop('checked', options.scanning.requireShift);
$('#middle-mouse-button-scan').prop('checked', options.scanning.middleMouse);
$('#select-matched-text').prop('checked', options.scanning.selectText); $('#select-matched-text').prop('checked', options.scanning.selectText);
$('#search-form-text-fields').prop('checked', options.scanning.imposter); $('#search-form-text-fields').prop('checked', options.scanning.imposter);
$('#scan-delay').val(options.scanning.delay); $('#scan-delay').val(options.scanning.delay);

View File

@ -84,6 +84,7 @@ function optionsSetDefaults(options) {
scanning: { scanning: {
requireShift: true, requireShift: true,
middleMouse: true,
selectText: true, selectText: true,
imposter: true, imposter: true,
delay: 15, delay: 15,

View File

@ -54,6 +54,10 @@
<label><input type="checkbox" id="hold-shift-to-scan"> Hold <kbd>Shift</kbd> to scan</label> <label><input type="checkbox" id="hold-shift-to-scan"> Hold <kbd>Shift</kbd> to scan</label>
</div> </div>
<div class="checkbox">
<label><input type="checkbox" id="middle-mouse-button-scan"> Middle mouse button scanning</label>
</div>
<div class="checkbox"> <div class="checkbox">
<label><input type="checkbox" id="select-matched-text"> Select matched text</label> <label><input type="checkbox" id="select-matched-text"> Select matched text</label>
</div> </div>

View File

@ -69,7 +69,7 @@ window.driver = new class {
return; return;
} }
if (this.options.scanning.requireShift && !e.shiftKey && !this.mouseDownMiddle) { if (this.options.scanning.requireShift && !e.shiftKey && !(this.mouseDownMiddle && this.options.scanning.middleMouse)) {
return; return;
} }

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "Yomichan", "name": "Yomichan",
"version": "1.0.18", "version": "1.1.0",
"description": "Japanese dictionary with Anki integration", "description": "Japanese dictionary with Anki integration",
"icons": {"16": "mixed/img/icon16.png", "48": "mixed/img/icon48.png", "128": "mixed/img/icon128.png"}, "icons": {"16": "mixed/img/icon16.png", "48": "mixed/img/icon48.png", "128": "mixed/img/icon128.png"},