aboutsummaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-27 11:46:37 -0400
committerGitHub <noreply@github.com>2020-09-27 11:46:37 -0400
commitcdd649ea3d3c933b571db1b00bc40162b4da8c01 (patch)
treed64e8462660f953b003871c6e7976141577fe23c /ext/bg
parent73dd578821d1373d4504778318e2e2f26b79a80e (diff)
Add scan on touch move and prevent touch scroll options (#871)
* Add scanOnTouchMove/preventTouchScrolling scanning input options * Add settings controls * Support scanOnTouchMove in TextScanner * Support preventTouchScrolling in TextScanner
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/data/options-schema.json20
-rw-r--r--ext/bg/js/options.js4
-rw-r--r--ext/bg/js/settings/scan-inputs-controller.js4
-rw-r--r--ext/bg/settings.html2
4 files changed, 25 insertions, 5 deletions
diff --git a/ext/bg/data/options-schema.json b/ext/bg/data/options-schema.json
index 80f8d782..0b0a9259 100644
--- a/ext/bg/data/options-schema.json
+++ b/ext/bg/data/options-schema.json
@@ -352,11 +352,13 @@
},
"options": {
"showAdvanced": false,
+ "scanOnTouchMove": true,
"scanOnPenHover": true,
"scanOnPenPress": true,
"scanOnPenRelease": false,
"searchTerms": true,
- "searchKanji": true
+ "searchKanji": true,
+ "preventTouchScrolling": false
}
},
{
@@ -369,11 +371,13 @@
},
"options": {
"showAdvanced": false,
+ "scanOnTouchMove": true,
"scanOnPenHover": true,
"scanOnPenPress": true,
"scanOnPenRelease": false,
"searchTerms": true,
- "searchKanji": true
+ "searchKanji": true,
+ "preventTouchScrolling": true
}
}
],
@@ -419,17 +423,23 @@
"type": "object",
"required": [
"showAdvanced",
+ "scanOnTouchMove",
"scanOnPenHover",
"scanOnPenPress",
"scanOnPenRelease",
"searchTerms",
- "searchKanji"
+ "searchKanji",
+ "preventTouchScrolling"
],
"properties": {
"showAdvanced": {
"type": "boolean",
"default": false
},
+ "scanOnTouchMove": {
+ "type": "boolean",
+ "default": true
+ },
"scanOnPenHover": {
"type": "boolean",
"default": true
@@ -449,6 +459,10 @@
"searchKanji": {
"type": "boolean",
"default": true
+ },
+ "preventTouchScrolling": {
+ "type": "boolean",
+ "default": true
}
}
}
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js
index cf24645a..f83dad6d 100644
--- a/ext/bg/js/options.js
+++ b/ext/bg/js/options.js
@@ -522,11 +522,13 @@ class OptionsUtil {
}
const createInputDefaultOptions = () => ({
showAdvanced: false,
+ scanOnTouchMove: true,
scanOnPenHover: true,
scanOnPenPress: true,
scanOnPenRelease: false,
searchTerms: true,
- searchKanji: true
+ searchKanji: true,
+ preventTouchScrolling: true
});
for (const {options: profileOptions} of options.profiles) {
profileOptions.general.usePopupWindow = false;
diff --git a/ext/bg/js/settings/scan-inputs-controller.js b/ext/bg/js/settings/scan-inputs-controller.js
index b6498d7c..0606d142 100644
--- a/ext/bg/js/settings/scan-inputs-controller.js
+++ b/ext/bg/js/settings/scan-inputs-controller.js
@@ -99,11 +99,13 @@ class ScanInputsController {
types: {mouse: true, touch: false, pen: false},
options: {
showAdvanced: false,
+ scanOnTouchMove: true,
scanOnPenHover: true,
scanOnPenPress: true,
scanOnPenRelease: false,
searchTerms: true,
- searchKanji: true
+ searchKanji: true,
+ preventTouchScrolling: true
}
}]
}]);
diff --git a/ext/bg/settings.html b/ext/bg/settings.html
index 8dea0245..86535af4 100644
--- a/ext/bg/settings.html
+++ b/ext/bg/settings.html
@@ -484,9 +484,11 @@
<div class="scan-input-type-list-container form-control"><div>
<div><label class="scan-input-toggle"><input type="checkbox" class="scan-input-settings-checkbox" data-property="options.searchTerms"><span>Search for terms</span></label></div>
<div><label class="scan-input-toggle"><input type="checkbox" class="scan-input-settings-checkbox" data-property="options.searchKanji"><span>Search for kanji</span></label></div>
+ <div><label class="scan-input-toggle"><input type="checkbox" class="scan-input-settings-checkbox" data-property="options.scanOnTouchMove"><span>Scan on touch move</span></label></div>
<div><label class="scan-input-toggle"><input type="checkbox" class="scan-input-settings-checkbox" data-property="options.scanOnPenHover"><span>Scan on pen hover</span></label></div>
<div><label class="scan-input-toggle"><input type="checkbox" class="scan-input-settings-checkbox" data-property="options.scanOnPenPress"><span>Scan on pen press</span></label></div>
<div><label class="scan-input-toggle"><input type="checkbox" class="scan-input-settings-checkbox" data-property="options.scanOnPenRelease"><span>Scan on pen release</span></label></div>
+ <div><label class="scan-input-toggle"><input type="checkbox" class="scan-input-settings-checkbox" data-property="options.preventTouchScrolling"><span>Prevent touch/pen scrolling</span></label></div>
</div></div>
</div></div>
</div>