Skip to content

Commit

Permalink
added tag 'release-beta-2024-01-17-16.51/+0100' for beta version in f…
Browse files Browse the repository at this point in the history
…older beta.
  • Loading branch information
klues committed Jan 17, 2024
1 parent af79230 commit 3835e8e
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 35 deletions.
2 changes: 1 addition & 1 deletion latest/app/build/asterics-grid.bundle.js

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions latest/app/lang/i18n.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@
"LEFT": "Go left",
"RIGHT": "Go right",
"GENERAL_INPUT": "Input",
"InputEventKey": "Keypress",
"InputEventKey": "Keypress, Mouseclick, Tap",
"KEY_TAP": "Touchscreen tap",
"KEY_MOUSE0": "Mouse click left",
"KEY_MOUSE1": "Mouse click middle",
"KEY_MOUSE2": "Mouse click right",
"InputEventAudio": "Microphone input",
"InputEventARE": "AsTeRICS ARE event",
"ELEMENT_TYPE_COLLECT": "Collect element",
Expand Down Expand Up @@ -252,7 +256,6 @@
"enableScanning": "Enable Scanning",
"verticalScanning": "Vertical scanning",
"binaryScanning": "Binary scanning",
"scanningselectionByMouseClickOrTap": "Scanning-selection by mouse click or tap",
"automaticTimedScanning": "Automatic (timed) scanning",
"scanningTimeMs": "Scanning Time (ms)",
"timeFactorFirstElement": "Time factor first element",
Expand Down Expand Up @@ -369,9 +372,9 @@
"offlineUser": "Offline user",
"onlineUser": "Online user",
"notDefined": "not defined",
"recordKey": "Record key",
"pressKey": "press key ...",
"currentKey": "Current key:",
"recordKey": "Record action",
"pressKey": "do action ...",
"currentKey": "Current action:",
"timeoutMs": "Timeout (ms)",
"repetitions": "Repetitions",
"disabledIfHoldDurationIsSet": "disabled if hold duration is set.",
Expand Down Expand Up @@ -973,5 +976,6 @@
"WORDFORM_MODE_NEXT_FORM": "Change this element to next word form",
"WORDFORM_MODE_RESET_FORMS": "Reset currently displayed word forms",
"toggleTagOnSelectingItMultipleTimes": "Toggle tags on selecting it multiple times",
"successfullyImportedWordForms": "Successfully imported {count} word forms."
"successfullyImportedWordForms": "Successfully imported {count} word forms.",
"infoPleaseDefineAHomeGridInManageGrids": "Info: please define a home grid in \"Manage grids -> Home grid\" in order to reliably showing correct paths."
}
2 changes: 1 addition & 1 deletion latest/serviceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ self.addEventListener('install', (event) => {
self.addEventListener('activate', event => {
clients.claim();
sendToClients({type: constants.SW_EVENT_ACTIVATED, activated: true});
console.log('Service Worker active! Version: https://github.com/asterics/AsTeRICS-Grid/releases/tag/release-beta-2024-01-15-16.34/+0100');
console.log('Service Worker active! Version: https://github.com/asterics/AsTeRICS-Grid/releases/tag/release-beta-2024-01-17-16.51/+0100');
});

self.addEventListener('message', (event) => {
Expand Down
32 changes: 29 additions & 3 deletions latest/src/js/input/inputEventHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ function Constructor() {
_listening = true;
subscribeAREEvents();
document.addEventListener('mousemove', mouseMoveListener);
document.addEventListener('keydown', keyboardListener);
document.addEventListener('mousedown', mouseDownListener);
document.addEventListener('mouseup', mouseUpListener);
document.addEventListener('keydown', keyDownListener);
document.addEventListener('keyup', keyUpListener);
document.addEventListener('fullscreenchange', fullscreenChangeListener);
_touchElement.addEventListener('touchmove', touchMoveListener, { passive: false });
Expand All @@ -81,7 +83,9 @@ function Constructor() {
_listening = false;
unsubscribeAREEvents();
document.removeEventListener('mousemove', mouseMoveListener);
document.removeEventListener('keydown', keyboardListener);
document.removeEventListener('mousedown', mouseDownListener);
document.removeEventListener('mouseup', mouseUpListener);
document.removeEventListener('keydown', keyDownListener);
document.removeEventListener('keyup', keyUpListener);
document.removeEventListener('fullscreenchange', fullscreenChangeListener);
_touchElement.removeEventListener('touchmove', touchMoveListener);
Expand Down Expand Up @@ -271,6 +275,20 @@ function Constructor() {
}
}

function mouseDownListener(event) {
keyDownListener({
keyCode: InputEventKey.KEY_MOUSE_PREFIX + event.button,
preventDefault: () => {}
})
}

function mouseUpListener(event) {
keyUpListener({
keyCode: InputEventKey.KEY_MOUSE_PREFIX + event.button,
preventDefault: () => {}
});
}

function touchMoveListener(event) {
callHandlers(touchMoveHandlers, [event], true);
if (!_touchMoveBeginPosY || !_touchMoveBeginPosX) {
Expand All @@ -296,16 +314,24 @@ function Constructor() {
}

function touchEndListener(event) {
keyUpListener({
keyCode: InputEventKey.KEY_TAP,
preventDefault: () => {}
})
callHandlers(touchEndHandlers, [event], true);
_touchMoveBeginPosX = null;
_touchMoveBeginPosY = null;
}

function touchStartListener(event) {
keyDownListener({
keyCode: InputEventKey.KEY_TAP,
preventDefault: () => {}
})
callHandlers(touchStartHandlers, [event], true);
}

function keyboardListener(event) {
function keyDownListener(event) {
let keyCode = event.which || event.keyCode;
if (anyKeyHandlers.length > 0 && !event.repeat) {
anyKeyHandlers.forEach((fn) => {
Expand Down
2 changes: 1 addition & 1 deletion latest/src/js/input/scanning.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Scanner.getInstanceFromConfig = function (inputConfig, itemSelector, scanActiveC
minBinarySplitThreshold: 3,
scanTimeoutMs: inputConfig.scanTimeoutMs,
scanTimeoutFirstElementFactor: inputConfig.scanTimeoutFirstElementFactor,
touchScanning: !inputConfig.mouseclickEnabled,
touchScanning: false,
inputEventSelect: inputConfig.scanInputs.filter((e) => e.label === InputConfig.SELECT)[0],
inputEventNext: inputConfig.scanInputs.filter((e) => e.label === InputConfig.NEXT)[0],
scanStartWithAction: inputConfig.scanStartWithAction
Expand Down
14 changes: 13 additions & 1 deletion latest/src/js/model/InputEventKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class InputEventKey extends Model({
modelName: String,
modelVersion: String,
label: [String],
keyCode: [Number],
keyCode: [Number, String],
keyName: [String],
repeat: [Number],
timeout: [Number],
Expand All @@ -28,6 +28,18 @@ class InputEventKey extends Model({
}
}

InputEventKey.KEY_MOUSE_PREFIX = "KEY_MOUSE";
InputEventKey.KEY_MOUSE_LEFT = "KEY_MOUSE0";
InputEventKey.KEY_MOUSE_MIDDLE = "KEY_MOUSE1";
InputEventKey.KEY_MOUSE_RIGHT = "KEY_MOUSE2";
InputEventKey.KEY_TAP = "KEY_TAP";
InputEventKey.SPECIAL_KEYS = [
InputEventKey.KEY_MOUSE_LEFT,
InputEventKey.KEY_MOUSE_MIDDLE,
InputEventKey.KEY_MOUSE_RIGHT,
InputEventKey.KEY_TAP
];

InputEventKey.defaults({
id: '', //will be replaced by constructor
modelName: InputEventKey.getModelName(),
Expand Down
3 changes: 2 additions & 1 deletion latest/src/vue-components/components/inputEventList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<span class="four columns">
<b>{{ $t('currentKey') }}</b>
<span v-show="!input.keyCode">{{ $t('noKey') }}</span>
<span v-show="input.keyCode">{{input.keyName + ' (' + input.keyCode + ')'}}</span>
<span v-show="input.keyCode && InputEventKey.SPECIAL_KEYS.includes(input.keyCode)">{{input.keyCode | translate}}</span>
<span v-show="input.keyCode && !InputEventKey.SPECIAL_KEYS.includes(input.keyCode)">{{input.keyName + ' (' + input.keyCode + ')'}}</span>
</span>
</div>
<div class="srow">
Expand Down
2 changes: 1 addition & 1 deletion latest/src/vue-components/modals/editElementImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<accordion class="offset-by-two ten columns" :acc-label="$t('settingsForImageSearch')" acc-label-type="span" acc-background-color="white">
<div class="srow">
<label class="three columns" for="searchLang">{{$t('searchLang')}}</label>
<select class="five columns" id="searchLang" v-model="searchLang" @input="searchInput(0)" @change="localStorageService.saveJSON(EDIT_ELEM_SEARCH_LANG_PREFIX + searchProvider.name, searchLang)">
<select class="five columns" id="searchLang" v-model="searchLang" @change="searchInput(0); localStorageService.saveJSON(EDIT_ELEM_SEARCH_LANG_PREFIX + searchProvider.name, searchLang)">
<option :value="null">{{ $t('automaticCurrentLanguage') }}</option>
<option v-for="value in searchProvider.searchLangs" :value="value">{{ $t('lang.' + value) }}</option>
</select>
Expand Down
9 changes: 0 additions & 9 deletions latest/src/vue-components/modals/input/scanningModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
<label for="chkBinaryScanning">{{ $t('binaryScanning') }}</label>
</div>
</div>
<div class="srow">
<div class="twelve columns">
<input type="checkbox" id="chkTouchScanning" v-model="touchScanning" @change="changeTouchScanning"/>
<label for="chkTouchScanning">{{ $t('scanningselectionByMouseClickOrTap') }}</label>
</div>
</div>
<div class="srow">
<div class="twelve columns">
<input type="checkbox" id="chkStartWithAction" v-model="inputConfig.scanStartWithAction"/>
Expand Down Expand Up @@ -183,9 +177,6 @@
this.$set(this.inputConfig, 'scanInputs', JSON.parse(JSON.stringify(InputConfig.DEFAULT_SCAN_INPUTS)));
this.inputChanged();
},
changeTouchScanning() {
this.inputConfig.mouseclickEnabled = !this.touchScanning;
},
initTest() {
setTimeout(() => {
this.stopTest();
Expand Down
30 changes: 19 additions & 11 deletions latest/src/vue-components/modals/searchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@
</div>

<div class="modal-body mt-5 row">
<input type="text" v-model="searchTerm" @input="search()" v-focus :placeholder="$t('searchElement') + '...'" class="col-8 col-sm-10 mb-5" @keydown.enter="goToFirstResult()" @keydown.ctrl.enter="goToFirstResult(true)"/>
<input type="text" v-model="searchTerm" @input="search()" v-focus :placeholder="$t('searchElement') + '...'" class="col-8 col-sm-10" @keydown.enter="goToFirstResult()" @keydown.ctrl.enter="goToFirstResult(true)"/>
<div class="col-sm-2 col-4">
<button class="col-12" :title="$t('search')"><i class="fas fa-search"/></button>
<button class="col-12 mb-0" :title="$t('search')"><i class="fas fa-search"/></button>
</div>
<ul v-if="results && results.length > 0" style="list-style-type: none">
</div>
<div>
<div class="warn mt-5" v-if="results && !homeGridId">
<i class="fas fa-info-circle"></i>
<span>{{ $t('infoPleaseDefineAHomeGridInManageGrids') }}</span>
</div>
<ul v-if="results && results.length > 0" style="list-style-type: none" class="mt-5">
<li v-for="(result, index) in results" class="d-flex align-items-center" style="flex-direction: row; min-height: 40px;">
<a href="javascript:;" @click="toResult(result)" class="d-flex align-items-center" :title="index === 0 ? `${$t('showElement')} ${$t('keyboardEnter')}` : $t('showElement')">
<img v-if="result.elem.image" :src="result.elem.image.data || result.elem.image.url" width="40" style="margin-right: 1em"/>
Expand All @@ -35,14 +41,16 @@
</a>
</li>
</ul>
<div v-if="results === null">
{{ $t('searching') }}
</div>
<div v-if="results && results.length === 0 && searchTerm">
{{ $t('noSearchResults') }}
</div>
<div v-if="overflow">
{{ $t('notShowingAllResultsTryALongerSearchTerm') }}
<div class="mt-5">
<div v-if="results === null">
{{ $t('searching') }}
</div>
<div v-if="results && results.length === 0 && searchTerm">
{{ $t('noSearchResults') }}
</div>
<div v-if="overflow">
{{ $t('notShowingAllResultsTryALongerSearchTerm') }}
</div>
</div>
</div>

Expand Down

0 comments on commit 3835e8e

Please sign in to comment.