Skip to content

Commit 4e53598

Browse files
committed
Release 3.0.0
latest bug fixes
1 parent 0f74d25 commit 4e53598

27 files changed

Lines changed: 265 additions & 154 deletions

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,18 @@ The custom equations dialog with categories tree
9696

9797
<img src="img/Custom-Equations-with-Categories.png" width="600" />
9898

99-
The symbol bar with button for the Katex Input Helper (Calculator symbol)
99+
The symbol bar with button for the Katex Input Helper (Square Root symbol)
100100

101101
![Symbol Bar](./img/Symbol-Bar.png)
102102

103103
## Known Problems
104104

105105
- A minor problem is a missing update of the language of the data grid paging bar in the *Custom Equations* dialog. This only appears during language change during an actual activation of the dialog.
106106
- The persistence of custom equations can be damaged when a filter is active.
107+
- The *web* version of this app does work bad on *Firefox* and on mobile devices in that many dialogs are sized wrong.
108+
This does not appear on the *Chrome* browser on desktop.
109+
- The sub menu items of the mobile version do show icons with the default theme only.
110+
- The mobile version does regularly pop-up the screen keyboard. No mechanism is known to avoid this.
107111

108112
## Release Notes
109113

@@ -130,7 +134,7 @@ The symbol bar with button for the Katex Input Helper (Calculator symbol)
130134
- A dependency injection framework was introduced.
131135
- The handling of the information window was improved.
132136
- The web version of this app now supports a mobile parameter in the query string. But this is
133-
merely an experimental feature in an early stage.
137+
merely an experimental feature in an early stage. Use **?mobile=true**.
134138
- Extensive re-factorings of the source code to improve the code structure.
135139

136140
### 2.0.1

img/Symbol-Bar.png

735 Bytes
Loading

src/assets/dialog-desktop.hbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
<div id="innerLayout" data-options="fit:true" class="easyui-layout">
3535
<div id="divMathTextInput" data-options="region:'center',split:false,noheader:true">
3636
</div>
37-
<div id="mathVisualOutput" dir="ltr" data-options="region:'south',split:true,noheader:true" ></div>
37+
<div id="mathVisualOutput" dir="ltr" data-options="region:'south',split:true,noheader:true" >
38+
<div></div>
39+
</div>
3840
</div>
3941
</div>
4042

src/assets/dialog-mobile.hbs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@
88
{{> waitform }}
99

1010
<div>
11-
<div id="myContainer" class="easyui-navpanel" data-options="fit:true,bodyCls:'mainNavPanelBody'">
11+
<div id="myContainer" class="easyui-navpanel" data-options="fit:true">
1212
<header>
1313
<div id="introduction" class="m-toolbar">
1414
<div class="m-left">
1515
<a id="goWest" class="easyui-linkbutton" data-options="plain:true">&#x2770;</a>
1616
</div>
1717
<div class="m-title">Katex Input Helper</div>
1818
<div class="m-right">
19-
<!--
20-
-->
2119
<a href="javascript:void(0)" class="easyui-menubutton invisible" data-options="iconCls:'',menu:'#main-menu',menuAlign:'right',hasDownArrow:false">&#9776;</a>
2220
<a id="goMenu" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:''">&#9776;</a>
2321
<a id="goEast" href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true">&#x2771;</a>
@@ -28,14 +26,15 @@
2826
<input value="" class="keyboardInput" id="tKEYBOARD" />
2927

3028
<div id="innerLayout" data-options="fit:true" class="easyui-layout">
31-
<!--
32-
<div id="divMathTextInput" class="center" data-options="region:'center',split:false,noheader:true"></div>
33-
<div id="mathVisualOutput" class="inner-south-mobile" dir="ltr" data-options="region:'south',split:true,noheader:true" ></div>
34-
-->
3529
<!--
3630
TEST: exchange the order of INPUT and OUTPUT area, attach title to INPUT area.
31+
This leads to better experience on mobile device.
3732
-->
38-
<div id="mathVisualOutput" class="inner-south-mobile" dir="ltr" data-options="region:'center',split:false,noheader:true" ></div>
33+
<div id="mathVisualOutput" class="inner-south-mobile" dir="ltr" data-options="region:'center',split:false,noheader:true" >
34+
<div>
35+
36+
</div>
37+
</div>
3938
<div id="divMathTextInput" class="center" data-options="title:'<span locate=EDITION></span>&nbsp;',region:'south',split:true,noheader:false"></div>
4039
</div>
4140
</div>

src/assets/information/tVERSION.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@
99
</p>
1010
<table class="inline-table">
1111

12+
<tr>
13+
<td valign=top>
14+
<b>3.0.0&nbsp;&nbsp;</b>
15+
</td>
16+
<td>
17+
&raquo; Introduced a mobile version of the plug-in (experimental).
18+
<br/> &raquo; Divided HTML code to avoid duplication, introduced Handlebars tool for support.
19+
<br/> &raquo; Migrated this release to Code Mirror 6.
20+
<br/>
21+
<br/> Resizing of windows is more or less deactivated, Window size adapted to content.
22+
<br/>
23+
</td>
24+
</tr>
25+
1226
<tr>
1327
<td valign=top>
1428
<b>2.1.1&nbsp;&nbsp;</b>

src/assets/js/codeMirrorProxy.ts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,29 @@ export class CodeMirrorProxy implements ICodeMirror {
102102

103103
/**
104104
* Sets the focus to the editor view.
105+
* TODO: Problem: we cannot avoid automatic screen keyboard pop-ups on Android
106+
* -> deactivate mechanism, because it does not work
107+
*
108+
* @param [disableKeyboard = false] - true switches the screen keyboard off
105109
*/
106-
focus() : void {
110+
focus(disableKeyboard: boolean = false) : void {
107111

108112
this.view.focus();
113+
114+
/*
115+
if (disableKeyboard) {
116+
this.makeEditable(false); // hope: this should switch the keyboard OFF
117+
this.makeEditable(true);
118+
}
119+
*/
109120
}
110121

111122
/**
112123
* Not implemented.
113124
*/
114-
refresh() : void { }
125+
refresh() : void {
126+
127+
}
115128

116129
/**
117130
* Returns the number of the last line (zero based)
@@ -225,13 +238,17 @@ export class CodeMirrorProxy implements ICodeMirror {
225238
event.preventDefault(); // Verhindert Zoom
226239

227240
this.editable = !this.editable; // toggle the editable state
228-
this.view.dispatch({
229-
effects: this.editableCompartment.reconfigure(EditorView.editable.of(this.editable))
230-
});
241+
this.makeEditable(this.editable);
231242
}
232243
}
233244
}
234245

246+
makeEditable(editable: boolean) {
247+
this.view.dispatch({
248+
effects: this.editableCompartment.reconfigure(EditorView.editable.of(editable))
249+
});
250+
}
251+
235252

236253
isMobile: boolean = false;
237254
version?: string = "6.x" ;

src/assets/js/dialog.ts

Lines changed: 20 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ export class KatexInputHelper implements IKatexInputHelper {
169169
sidemenuData: any = { };
170170
customEquationsToggler = null;
171171
unicodeToggler = null;
172+
cursorAtInsertionPoint = false;
172173

173174
/**
174175
* Constructor
@@ -285,7 +286,8 @@ export class KatexInputHelper implements IKatexInputHelper {
285286
}
286287

287288
/**
288-
* A Prefetch cycle to load the required HTML document.
289+
* A Prefetch cycle to load the required HTML document. The intent is to
290+
* load the mobile or desktop version depending on configuration.
289291
*
290292
* @returns true, if a document could be loaded
291293
*/
@@ -334,6 +336,14 @@ export class KatexInputHelper implements IKatexInputHelper {
334336
this.codeMirrorEditor = this.math.codeMirror; // lazy injection
335337
console.debug(`Document check : ${document.URL}.`);
336338

339+
// TEST to set app window size
340+
// This works but not on Android !!!
341+
// TODO: make it work on Android and only Android
342+
/*
343+
const containerElement = window.frames.top.top.document.getElementsByClassName('user-webview-dialog')[0];
344+
$(containerElement).css("--content-height", "80vh");
345+
*/
346+
337347
return true;
338348
}
339349

@@ -384,7 +394,9 @@ export class KatexInputHelper implements IKatexInputHelper {
384394
this.themes.subscribe(this.onStyleChanged.bind(this));
385395
await this.themes.initialiseThemeChoice(this.style, this.rtlStyle); // RTL STYLE defined after locale language
386396

387-
$('#myContainer').layout({fit: true});
397+
if (!this.platformInfo.isMobile) {
398+
$('#myContainer').layout({fit: true});
399+
}
388400
$('#innerLayout').layout({fit: true});
389401
vme.endWait();
390402
}
@@ -438,6 +450,7 @@ export class KatexInputHelper implements IKatexInputHelper {
438450

439451
// Intent: to restore original web page structure (required by Joplin plugin).
440452
// Here: the viewport
453+
// TODO: required?
441454
const content = $("body meta[name='viewport']").attr('content');
442455
if (content) {
443456
const html = `<meta name="viewport" content="${content}" ></meta>`;
@@ -497,61 +510,13 @@ export class KatexInputHelper implements IKatexInputHelper {
497510
$('#myContainer').panel({
498511
fit: true,
499512
onOpen: function() {
500-
inst.codeMirrorEditor.focus();
501-
}
502-
});
503-
504-
// I'm struggling with getting the correct initial display, but nothing works.
505-
/* This TRIAL also does not work: switch forth and back during program start.
506-
let switchForth = true;
507-
let switchBack = true;
508-
$('#myContainer').panel({
509-
fit: true,
510-
onOpen: function() {
511-
if (switchForth) {
512-
switchForth = false;
513-
$.mobile.go('#eastRegion');
514-
}
515-
}
516-
});
517-
$('#eastRegion').panel({
518-
fit: true,
519-
onOpen: function() {
520-
if (switchBack && !switchForth) {
521-
switchBack = false;
522-
$.mobile.go('#myContainer');
523-
}
513+
inst.codeMirrorEditor.focus(!inst.cursorAtInsertionPoint);
514+
inst.cursorAtInsertionPoint = false;
524515
}
525516
});
526-
*/
527-
528-
// RESERVED.
529-
let height = getHeightFooter();
530-
function heightChanged() {
531-
const oldHeight = height;
532-
const newHeight = getHeightFooter();
533-
height = newHeight;
534-
return newHeight != oldHeight;
535-
}
536-
let cycle = 0;
537-
const timerFunc = () => {
538-
cycle ++;
539-
if (heightChanged() || cycle >= 10) {
540-
console.info(`Changed Footer Height : ${getHeightFooter()} after ${cycle} cycles yields ${getHeightCenterVh()}`);
541-
542-
// Both solutions have no effect. Initial display does not display footer.
543-
// NavPanel to large
544-
//$('#myContainer').attr('style', { height: `${getHeightCenterVh()} !important` });
545-
//$('#myContainer').navpanel('resize');
546-
547-
} else {
548-
setTimeout(timerFunc, 100);
549-
}
550-
}
551517

552518
defineProportions('#innerLayout', 'south', 50);
553-
timerFunc();
554-
519+
555520
this.sidemenuData = this.getSidemenuData();
556521
console.log(`Sidemenu data : %O`, this.sidemenuData);
557522
this.populateSidemenu(this.sidemenuData);
@@ -1125,7 +1090,8 @@ export class KatexInputHelper implements IKatexInputHelper {
11251090
pos.ch = pos.ch - a.length;
11261091
this.codeMirrorEditor.setCursor(pos);
11271092
if (this.menuupdateType) this.updateOutput();
1128-
this.setFocus();
1093+
this.setFocus();
1094+
this.cursorAtInsertionPoint = true; // used in mobile only
11291095
}
11301096

11311097
/**
@@ -1405,10 +1371,6 @@ export class KatexInputHelper implements IKatexInputHelper {
14051371
.join('/')
14061372
.replace(/ /g, '%20') + '/';
14071373
}
1408-
// TEST CODE to check path OR mobile detection
1409-
// $('h3').text(bundlePath);
1410-
// let heading = $('h3').text();
1411-
// $('h3').text(`${heading} on ${this.mobile ? 'mobile' : 'desktop'} device`);
14121374

14131375
console.info(`Base location is : ${bundlePath}`);
14141376

src/assets/js/helpers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ class RegionToggler {
195195
$(this.layout).layout('panel', this.firstRegion).panel('resize', { width: width });
196196
$(this.layout).layout('resize');
197197

198-
$(this.id).html(text);
198+
text = `&nbsp;${text}&nbsp;`;
199+
$(`${this.id} span`).html(text);
199200
this.parent.localizer.notify(); // updates the tooltip text
200201
}
201202

@@ -284,7 +285,7 @@ class ContainerToggler {
284285

285286
$(this.uiId)
286287
.css('display', this.active ? 'inline-block' : 'none');
287-
$(this.btnId).html(this.active ? this.secondIcon : this.firstIcon);
288+
$(`${this.btnId} span`).html(this.active ? this.secondIcon : this.firstIcon);
288289
this.parent.localizer.notify(); // updates the tooltip text
289290
}
290291

src/assets/js/interfaces.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export interface IMath {
6060
insert(b: any) : void;
6161
insertMath(text: string, element: any, multiple?: boolean, displayMode?: boolean) : void;
6262
codeMirror: any;
63-
setFocus() : void;
63+
setFocus(disableKeyboard?: boolean) : void;
6464
updateAnchor(a: any) : void;
6565
updateTableAnchor(a: any) : void;
6666
updateHeaders(selector: string) : void;
@@ -74,7 +74,7 @@ export interface ICodeMirror {
7474
getSelection() : string;
7575
setValue(val: string|ArrayBuffer) : void;
7676
getValue() : string;
77-
focus() : void;
77+
focus(disableKeyboard?: boolean) : void;
7878
refresh() : void;
7979
lastLine() : number;
8080
setCursor(cursor: any) : void;

src/assets/js/localization/ar/lang.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@
122122
"TTREMOVECATEGORY": "استخدم أمر القائمة هذا لإزالة العقدة الطرفية (الفئة) وجميع المعادلات التابعة لها.",
123123
"TTREMOVEFOLDER": "استخدم أمر القائمة هذا لإزالة عقدة المجلد (الفئة الفائقة) وجميع المعادلات والمجلدات الفرعية التابعة لها.",
124124
"TTCUTPASTE": "استخدم أمر القائمة هذا لقص ولصق المعادلات من فئة إلى أخرى. للقيام بذلك، تحقق من المعادلات المطلوبة في شبكة البيانات واستدعاء هذا الأمر.",
125+
"TTREGION_FIRST": "انقر للتبديل إلى عرض الفئات",
126+
"TTREGION_SECOND": "انقر للتبديل إلى عرض المعادلات",
127+
"TTREGION_BOTH": "انقر للتبديل إلى عرض كل من: الفئات والمعادلات",
128+
"TTCONTAINER_ACTIVATE": "انقر لعرض نافذة قائمة يونيكود",
129+
"TTCONTAINER_DEACTIVATE": "انقر لإخفاء نافذة قائمة يونيكود",
125130

126131
"RESET": "إعادة ضبط",
127132
"RESET_WINDOW_POSITIONS": "مواضع النافذة",

0 commit comments

Comments
 (0)