Skip to content

Commit

Permalink
Merge pull request #11 from kaplanPRO/development
Browse files Browse the repository at this point in the history
version 0.5.3
  • Loading branch information
csengor authored Jun 11, 2021
2 parents 83c393e + 9a418d6 commit a230f41
Show file tree
Hide file tree
Showing 4 changed files with 280 additions and 263 deletions.
14 changes: 7 additions & 7 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kaplan-desktop",
"productName": "Kaplan Desktop",
"version": "0.5.2",
"version": "0.5.3",
"description": "An open-source CAT tool.",
"homepage": "https://kaplan.pro",
"main": "src/main.js",
Expand Down Expand Up @@ -59,11 +59,11 @@
"mysql": "^2.18.1"
},
"devDependencies": {
"@electron-forge/cli": "6.0.0-beta.54",
"@electron-forge/maker-deb": "6.0.0-beta.54",
"@electron-forge/maker-rpm": "6.0.0-beta.54",
"@electron-forge/maker-squirrel": "6.0.0-beta.54",
"@electron-forge/maker-zip": "6.0.0-beta.54",
"electron": "^12.0.7"
"@electron-forge/cli": "^6.0.0-beta.57",
"@electron-forge/maker-deb": "^6.0.0-beta.57",
"@electron-forge/maker-rpm": "^6.0.0-beta.57",
"@electron-forge/maker-squirrel": "^6.0.0-beta.57",
"@electron-forge/maker-zip": "^6.0.0-beta.57",
"electron": "^13.1.1"
}
}
27 changes: 15 additions & 12 deletions app/src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,19 +483,14 @@ function targetKeydownHandler(e, target_cell) {
if (e.ctrlKey) {
target_cell.parentNode.classList.remove("draft");
submitSegment(target_cell, "translated");
jumpToNextSegment = false;
jumpToNextConfirmedSegment = !e.shiftKey;
targetList = [...document.getElementsByClassName("target")].slice(1);
for (i = 0; i < targetList.length; i++) {
currentId = targetList.findIndex(function(element){return element==target_cell})
for (i = currentId; i < targetList.length; i++) {
target = targetList[i];
if (!jumpToNextSegment) {
if (target === target_cell) {
jumpToNextSegment = true;
}
} else {
if (!target.parentNode.classList.contains("translated")) {
target.focus();
break;
}
if (!target.parentNode.classList.contains("translated") && jumpToNextConfirmedSegment) {
target.focus();
break;
}
}
}
Expand All @@ -505,7 +500,15 @@ function targetKeydownHandler(e, target_cell) {
target_cell.innerHTML = target_cell.parentNode.getElementsByClassName("source")[0].innerHTML;
}
}
else if ( e.shiftKey || e.key == "Tab") {}
else if (e.key == "Tab") {
e.preventDefault();
targetList = [...document.getElementsByClassName("target")].slice(1);
currentId = targetList.findIndex(function(element){return element==target_cell})
if (currentId < targetList.length) {
targetList[currentId+1].focus();
}
}
else if ( e.shiftKey) {}
else {
target_cell.parentNode.classList.remove("translated");
target_cell.parentNode.classList.add("draft");
Expand Down
Loading

0 comments on commit a230f41

Please sign in to comment.