Skip to content

Commit a6dbfff

Browse files
committed
Release candidate v2.1.0
- README prepared - Better handling of Information window
1 parent d68ae19 commit a6dbfff

3 files changed

Lines changed: 62 additions & 3 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,16 @@ The custom equations dialog with categories tree
9797

9898
## Release Notes
9999

100+
### 2.1.0
101+
102+
**New features**
103+
104+
- The plug-in was migrated to typescript as programming language.
105+
- A dependency injection framework was introduced.
106+
- The handling of the information window was improved.
107+
- The web version of this app now supports a mobile parameter in the query string.
108+
- Extensive re-factorings of the source code to improve the code structure.
109+
100110
### 2.0.1
101111

102112
**New features**

src/assets/js/dialog.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const CodeMirror = (await import('codemirror')).default;
44
await import('codemirror/mode/stex/stex'); // manual recommendation
55

66
import { VKI_init } from './keyboard/keyboard';
7-
import { DynamicPanel, KIHMoreDialog, KIHWindow, UnicodeWindow, MatrixWindow } from "./panels";
7+
import { DynamicPanel, KIHMoreDialog, KIHWindow, UnicodeWindow, MatrixWindow, InformationWindow } from "./panels";
88
import { FileHandler } from "./fileHandling";
99

1010
import { inject } from 'inversify';
@@ -666,8 +666,7 @@ export class KatexInputHelper implements IKatexInputHelper {
666666
* @param numTab - number (index) of the tab (0..3)
667667
*/
668668
async openInformationTab(numTab: number) {
669-
await this.openWindow('wINFORMATIONS');
670-
$('#tINFORMATIONS').tabs('select', numTab);
669+
this.panels.showWindowGeneric(InformationWindow, 'wINFORMATIONS', numTab);
671670
}
672671

673672
/**

src/assets/js/panels.ts

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,53 @@ export class KIHWindow extends KIHPanel {
239239
}
240240
}
241241

242+
/**
243+
* The Information window. Additionally to an ordinary window this also handles
244+
* tabs (tab is here a tab index).
245+
*/
246+
export class InformationWindow extends KIHWindow {
247+
tab: number = 0;
248+
tabChanged = false;
249+
250+
/**
251+
* Ctor.
252+
*/
253+
constructor(panelId: string, parent: any, ...params: any) {
254+
super(panelId, parent, params);
255+
}
256+
257+
/**
258+
* Initialises the Matrix window.
259+
*/
260+
override async initialise(...params) : Promise<void> {
261+
await super.initialise();
262+
let [ tab ] = params;
263+
this.tab = tab;
264+
}
265+
266+
/**
267+
* The update method handles tab changes. This merely sets a flag indicating
268+
* the change.
269+
*/
270+
override update(...params) {
271+
let [ tab ] = params;
272+
this.tabChanged = tab != this.tab;
273+
this.tab = tab;
274+
}
275+
276+
/**
277+
* The toggle method switches the isOpen state, but only if no tab switch took
278+
* place. In this case the tab is switched.
279+
*/
280+
override async toggle() {
281+
if (!this.tabChanged || !this.isOpen) {
282+
await super.toggle();
283+
}
284+
$('#tINFORMATIONS').tabs('select', this.tab);
285+
this.tabChanged = false;
286+
}
287+
}
288+
242289
/**
243290
* The Matrix window is a special Window with extra functionality.
244291
*/
@@ -408,6 +455,9 @@ export class MatrixWindow extends KIHWindow {
408455
}
409456
}
410457

458+
/**
459+
* Represents the Unicode window.
460+
*/
411461
export class UnicodeWindow extends KIHWindow {
412462

413463
uniCodesListLoaded = false;

0 commit comments

Comments
 (0)