mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-29 11:07:41 +00:00
chore(common/web): restores gesture-recognizer's recorder
This commit is contained in:
parent
be0d602a42
commit
263d8b254b
3 changed files with 18 additions and 13 deletions
|
|
@ -25,7 +25,7 @@ builder_parse "$@"
|
|||
builder_describe_outputs \
|
||||
configure /node_modules \
|
||||
build:fixture /common/web/gesture-recognizer/build/tools/host-fixture.mjs \
|
||||
build:recorder /common/web/gesture-recognizer/src/tools/recorder/build/recorder.js \
|
||||
build:recorder /common/web/gesture-recognizer/src/tools/recorder/build/recorder.mjs \
|
||||
build:test-module /common/web/gesture-recognizer/build/tools/lib/index.mjs
|
||||
|
||||
# TODO: build if out-of-date if test is specified
|
||||
|
|
@ -62,7 +62,7 @@ if builder_start_action build :recorder; then
|
|||
mkdir -p recorder/build
|
||||
fi
|
||||
cp recorder/src/pageStyle.css recorder/build/pageStyle.css
|
||||
cp recorder/src/recorder.js recorder/build/recorder.js
|
||||
cp recorder/src/recorder.mjs recorder/build/recorder.mjs
|
||||
|
||||
cp host-fixture/gestureHost.css recorder/build/gestureHost.css
|
||||
|
||||
|
|
|
|||
|
|
@ -11,9 +11,7 @@
|
|||
<link rel="stylesheet" href="pageStyle.css">
|
||||
<link rel="stylesheet" href="gestureHost.css">
|
||||
|
||||
<script src="../../../../build/obj/index.js"></script>
|
||||
<script src="../../../../build/tools/unit-test-resources.js"></script>
|
||||
<script src="recorder.js"></script>
|
||||
<script type="module" src="./recorder.mjs"></script>
|
||||
|
||||
<title>Gesture Recognizer - Demo Host Page</title>
|
||||
</head>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
// This script allows user-interactive use of the user-testing oriented unit-test-resource objects.
|
||||
|
||||
const controller = new Testing.HostFixtureLayoutController();
|
||||
import {
|
||||
FixtureLayoutConfiguration,
|
||||
HostFixtureLayoutController,
|
||||
InputSequenceSimulator,
|
||||
SequenceRecorder
|
||||
} from '../../../../build/tools/lib/index.mjs';
|
||||
|
||||
const controller = new HostFixtureLayoutController();
|
||||
let loadPromise = controller.connect();
|
||||
let recorder;
|
||||
|
||||
|
|
@ -13,7 +20,7 @@ function presentSavableJSON(text) {
|
|||
}
|
||||
|
||||
loadPromise.then((recognizer) => {
|
||||
recorder = new Testing.SequenceRecorder(controller);
|
||||
recorder = new SequenceRecorder(controller);
|
||||
updateConfig();
|
||||
|
||||
// DOM-oriented logging setup.
|
||||
|
|
@ -27,7 +34,7 @@ loadPromise.then((recognizer) => {
|
|||
recorder.clear();
|
||||
}
|
||||
|
||||
controller.on(Testing.HostFixtureLayoutController.CONFIG_CHANGED_EVENT, () => {
|
||||
controller.on(HostFixtureLayoutController.CONFIG_CHANGED_EVENT, () => {
|
||||
logElement.value = '';
|
||||
});
|
||||
|
||||
|
|
@ -63,15 +70,15 @@ window.addEventListener('load', function(ev) {
|
|||
let receiverGroup = document.config.receiver;
|
||||
let safeGroup = document.config.safeZone;
|
||||
|
||||
for(entry of layoutGroup) {
|
||||
for(let entry of layoutGroup) {
|
||||
entry.addEventListener('change', updateConfig);
|
||||
}
|
||||
|
||||
for(entry of boundsGroup) {
|
||||
for(let entry of boundsGroup) {
|
||||
entry.addEventListener('change', updateConfig);
|
||||
}
|
||||
|
||||
for(entry of receiverGroup) {
|
||||
for(let entry of receiverGroup) {
|
||||
if(entry.value == 'full') {
|
||||
entry.addEventListener('change', function() {
|
||||
let topRange = document.getElementById('topOnlyRadio');
|
||||
|
|
@ -89,7 +96,7 @@ window.addEventListener('load', function(ev) {
|
|||
|
||||
document.addEventListener('scroll', updateAlignment);
|
||||
|
||||
for(entry of safeGroup) {
|
||||
for(let entry of safeGroup) {
|
||||
entry.addEventListener('change', updateConfig);
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +122,7 @@ function updateConfig() {
|
|||
let receiver = document.config.receiver;
|
||||
let safe = document.config.safeZone;
|
||||
|
||||
let layoutSpec = new Testing.FixtureLayoutConfiguration(
|
||||
let layoutSpec = new FixtureLayoutConfiguration(
|
||||
layout.value,
|
||||
bounds.value,
|
||||
receiver.value,
|
||||
Loading…
Add table
Reference in a new issue