Skip to content

Commit

Permalink
Updated for release 2.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rmraya committed Aug 21, 2023
1 parent 20b05bc commit 710d0d6
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 102 deletions.
Binary file modified jars/openxliff.jar
Binary file not shown.
Binary file modified jars/tmxvalidator.jar
Binary file not shown.
Binary file modified jars/xmljava.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tmxeditor",
"productName": "TMXEditor",
"version": "2.12.0",
"version": "2.13.0",
"description": "TMX Editor",
"main": "js/app.js",
"scripts": {
Expand All @@ -19,9 +19,10 @@
"url": "https://github.com/rmraya/TMXEditor.git"
},
"devDependencies": {
"electron": "^22.0.2"
"electron": "^25.4.0",
"typescript": "^5.1.6"
},
"dependencies": {
"sdltm": "^1.0.2"
}
}
}
4 changes: 2 additions & 2 deletions src/com/maxprograms/tmxserver/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ private Constants() {
}

public static final String APPNAME = "TMXEditor";
public static final String VERSION = "2.12.0";
public static final String BUILD = "20230114_0957";
public static final String VERSION = "2.13.0";
public static final String BUILD = "20230801_0748";

public static final String REASON = "reason";
public static final String STATUS = "status";
Expand Down
Binary file modified tmxeditor.pdf
Binary file not shown.
147 changes: 77 additions & 70 deletions ts/app.ts

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions ts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class Main {
properties: Array<string[]>;
notes: string[];

currentId: string = null;
currentLang: string = null;
currentCell: HTMLTableCellElement = null;
currentContent: string = null;
currentId: string;
currentLang: string;
currentCell: HTMLTableCellElement;
currentContent: string;
selectedUnits: string[] = [];

static EDIT: string = '<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">' +
Expand Down Expand Up @@ -74,16 +74,16 @@ class Main {
this.deleteUnits();
});
this.electron.ipcRenderer.on('sort-on', () => {
document.getElementById('sortUnits').classList.add('active');
(document.getElementById('sortUnits') as HTMLAnchorElement).classList.add('active');
});
this.electron.ipcRenderer.on('sort-off', () => {
document.getElementById('sortUnits').classList.remove('active');
(document.getElementById('sortUnits') as HTMLAnchorElement).classList.remove('active');
});
this.electron.ipcRenderer.on('filters-on', () => {
document.getElementById('filterUnits').classList.add('active');
(document.getElementById('filterUnits') as HTMLAnchorElement).classList.add('active');
});
this.electron.ipcRenderer.on('filters-off', () => {
document.getElementById('filterUnits').classList.remove('active');
(document.getElementById('filterUnits') as HTMLAnchorElement).classList.remove('active');
});
this.electron.ipcRenderer.on('start-waiting', () => {
document.body.classList.add("wait");
Expand Down Expand Up @@ -361,7 +361,7 @@ class Main {
event.cancelBubble = true;
this.lastPage();
}
if (this.currentCell !== null && (event.key === 'PageDown' || event.key === 'PageUp') && !(event.ctrlKey || event.metaKey)) {
if (this.currentCell && (event.key === 'PageDown' || event.key === 'PageUp') && !(event.ctrlKey || event.metaKey)) {
// prevent scrolling while editing
event.preventDefault();
event.cancelBubble = true;
Expand Down Expand Up @@ -859,7 +859,7 @@ class Main {
if (!this.isLoaded) {
return;
}
if (this.currentId === null || this.currentId === '') {
if (!this.currentId || this.currentId === null || this.currentId === '') {
return;
}
this.electron.ipcRenderer.send('edit-attributes', { id: this.currentId, atts: this.attributes, type: this.attributesType });
Expand All @@ -869,7 +869,7 @@ class Main {
if (!this.isLoaded) {
return;
}
if (this.currentId === null || this.currentId === '') {
if (!this.currentId || this.currentId === null || this.currentId === '') {
return;
}
this.electron.ipcRenderer.send('edit-properties', { id: this.currentId, props: this.properties, type: this.attributesType });
Expand All @@ -879,7 +879,7 @@ class Main {
if (!this.isLoaded) {
return;
}
if (this.currentId === null || this.currentId === '') {
if (!this.currentId || this.currentId === null || this.currentId === '') {
return;
}
this.electron.ipcRenderer.send('edit-notes', { id: this.currentId, notes: this.notes, type: this.attributesType });
Expand Down Expand Up @@ -952,10 +952,10 @@ class Main {
this.maxPage = 0;
this.isLoaded = false;

this.currentId = null;
this.currentLang = null;
this.currentCell = null;
this.currentContent = null;
this.currentId = undefined;
this.currentLang = undefined;
this.currentCell = undefined;
this.currentContent = undefined;
this.selectedUnits = [];
}

Expand Down Expand Up @@ -983,7 +983,7 @@ class Main {
document.getElementById('propertiesSpan').innerHTML = 'TU';
document.getElementById('notesTable').innerHTML = '';
document.getElementById('notesSpan').innerHTML = 'TU';
this.currentId = null;
this.currentId = undefined;
this.setStatus('');
}

Expand Down Expand Up @@ -1040,15 +1040,15 @@ class Main {
}
lang = (event.target as Element).getAttribute('lang');
}
if (this.currentCell !== null && this.currentCell.isContentEditable && (this.currentId !== id || this.currentLang !== lang)) {
if (this.currentCell && this.currentCell.isContentEditable && (this.currentId !== id || this.currentLang !== lang)) {
this.saveEdit();
}

if (id) {
this.currentId = id;
if (this.currentCell) {
this.currentCell = null;
this.currentContent = null;
this.currentCell = undefined;
this.currentContent = undefined;
}
if (lang) {
this.currentLang = lang;
Expand Down Expand Up @@ -1130,7 +1130,7 @@ class Main {
}

firstPage(): void {
if (this.currentCell !== null && this.currentCell.isContentEditable) {
if (this.currentCell && this.currentCell.isContentEditable) {
this.saveEdit();
}
this.currentPage = 0;
Expand All @@ -1140,7 +1140,7 @@ class Main {

previousPage(): void {
if (this.currentPage > 0) {
if (this.currentCell !== null && this.currentCell.isContentEditable) {
if (this.currentCell && this.currentCell.isContentEditable) {
this.saveEdit();
}
this.currentPage--;
Expand All @@ -1151,7 +1151,7 @@ class Main {

nextPage(): void {
if (this.currentPage < this.maxPage - 1) {
if (this.currentCell !== null && this.currentCell.isContentEditable) {
if (this.currentCell && this.currentCell.isContentEditable) {
this.saveEdit();
}
this.currentPage++;
Expand All @@ -1161,7 +1161,7 @@ class Main {
}

lastPage(): void {
if (this.currentCell !== null && this.currentCell.isContentEditable) {
if (this.currentCell && this.currentCell.isContentEditable) {
this.saveEdit();
}
this.currentPage = this.maxPage - 1;
Expand All @@ -1184,7 +1184,7 @@ class Main {
(document.getElementById('units_page') as HTMLInputElement).value = '' + this.unitsPage;
this.maxPage = Math.ceil(this.unitsCount / this.unitsPage);
document.getElementById('pages').innerText = '' + this.maxPage;
if (this.currentCell !== null && this.currentCell.isContentEditable) {
if (this.currentCell && this.currentCell.isContentEditable) {
this.saveEdit();
}
this.firstPage();
Expand All @@ -1203,7 +1203,7 @@ class Main {
if (this.currentPage > this.maxPage - 1) {
this.currentPage = this.maxPage - 1;
}
if (this.currentCell !== null && this.currentCell.isContentEditable) {
if (this.currentCell && this.currentCell.isContentEditable) {
this.saveEdit();
}
(document.getElementById('page') as HTMLInputElement).value = '' + (this.currentPage + 1);
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
]
},
"forceConsistentCasingInFileNames": true,
"strict": false
"strict": false,
"esModuleInterop": true
},
"include": [
"ts/**/*"
Expand Down

0 comments on commit 710d0d6

Please sign in to comment.