Skip to content

Commit c7d8c2c

Browse files
committed
Pre v2.0.1 commit
- fix context menu crash - new easyui version - adapt to mobile version
1 parent 8eb79b5 commit c7d8c2c

86 files changed

Lines changed: 9631 additions & 7397 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,16 @@ The custom equations dialog with categories tree
102102
**New features**
103103

104104
- The language switcher is now equipped with country flags.
105-
- The functionality of this plug-in is now also available as [Web app](https://mick2nd.github.io/Katex-Input-Helper/index.html) hosted on Github.
106-
This can be used as Demo or to have a look at pre-published versions.
105+
- The functionality of this plug-in is now also available as [Web app](https://mick2nd.github.io/Katex-Input-Helper/index.html)
106+
hosted on Github. This can be used as Demo or to have a look at pre-published versions.
107+
It's also running on mobile devices.
107108
- Made the production version working hereby reducing the size of the plug-in.
109+
- The browser version (see above) is also adapted for mobile devices.
110+
111+
**Bug fixes**
112+
113+
- The context menus crashed on the trial to invoke and click them. A workaround helps here.
114+
But this is not fully satisfying as you might see.
108115

109116
### 2.0.0
110117

package-lock.json

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build-assets-prod": "webpack --config webpack.assets.config.js --env kihmode=production",
1414
"serve": "webpack serve --config webpack.assets.config.js",
1515
"stop-serve": "npx kill-port 9000",
16-
"deploy": "webpack --config webpack.assets.config.js --env ghpages && gh-pages -d dist/assets"
16+
"deploy": "webpack --config webpack.assets.config.js --env ghpages --env kihmode=production && gh-pages -d dist/assets"
1717
},
1818
"license": "MIT",
1919
"keywords": [
@@ -45,9 +45,11 @@
4545
"inversify": "^7.5.1",
4646
"jest": "^29.7.0",
4747
"jquery": "^3.7.1",
48+
"jquery-contextmenu": "^2.9.2",
4849
"json-loader": "^0.5.7",
4950
"katex": "^0.16.22",
5051
"mini-css-extract-plugin": "^2.9.2",
52+
"node-device-detector": "^2.2.2",
5153
"path": "^0.12.7",
5254
"raw-loader": "^4.0.2",
5355
"style-loader": "^4.0.0",

src/assets/dialog.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h3>Katex Input Helper</h3>
4141

4242
<div id="menu">
4343
<a class="easyui-menubutton" data-options="iconCls:'icon-file',menu:'#mFILE'"><span locate="FILE"></span></a>
44-
<a class="easyui-menubutton" data-options="iconCls:'icon-insert',menu:'#mINSERT'"><span locate="INSERT"></span></a>
44+
<a id="mbINSERT" class="easyui-menubutton" data-options="iconCls:'icon-insert',menu:'#mINSERT'"><span locate="INSERT"></span></a>
4545
<a class="easyui-menubutton" data-options="iconCls:'icon-plugin',menu:'#mTOOLS'"><span locate="TOOLS"></span> </a>
4646
<a class="easyui-menubutton" data-options="iconCls:'icon-watch',menu:'#mVIEW'"><span locate="VIEW"></span></a>
4747
<a class="easyui-menubutton" data-options="iconCls:'icon-option',menu:'#mOPTIONS'"><span locate="OPTIONS"></span></a>
@@ -58,7 +58,7 @@ <h3>Katex Input Helper</h3>
5858
</div>
5959
<input type="file" id="fOPEN_EQUATION" style="display: none" />
6060
</div>
61-
<div id="mINSERT" class="easyui-menu menus">
61+
<div id="mINSERT" class="menus">
6262
<div iconcls="icon-char" id="mCHARS">
6363
<span class='rtl-menu-item' locate="CHAR"></span>
6464
<div style="width: 200px;">
@@ -259,8 +259,9 @@ <h3>Katex Input Helper</h3>
259259
id="f_SUM_PROD_SYMBOLS"></div>
260260

261261
<!-- THIS MAY CAUSE FILE NOT FOUND : replacement see below
262-
<div title="<span information='MATRIX_SYMBOLS' class='rtl-title-withicon'><img class='symbol_btn icon-matrix_13_black' src='jquery-easyui/themes/default/images/blank.gif' width='15' height='20' /> &nbsp;&nbsp;
263-
<img class='symbol_btn icon-matrix_33_black' src='js/jquery-easyui/themes/default/images/blank.gif' width='15' height='20' /></span>"
262+
<div title="<span information='MATRIX_SYMBOLS' class='rtl-title-withicon'>
263+
<img class='symbol_btn icon-matrix_13_black' src='./icons/blank.gif' width='15' height='20' /> &nbsp;&nbsp;
264+
<img class='symbol_btn icon-matrix_33_black' src='./icons/blank.gif' width='15' height='20' /></span>"
264265
id="f_MATRIX_SYMBOLS">
265266
</div>
266267
-->

src/assets/formulas/f_BRACKET_SYMBOLS.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<td><a href="#" class=s lbegin="\left\Updownarrow" lend="\right\Updownarrow ">$\left\Updownarrow□\right\Updownarrow$</a></td>
4747
</tr>
4848
<tr style="font-size:100%">
49-
<td><a href="#" class="more"><img src="icons/mini_add.png" width=15 height=20 /></a></td>
49+
<td><a href="#" class="more"><img src="icons/mini_add.png" /></a></td>
5050
<td colspan=4></td>
5151
</tr>
5252
</table>

src/assets/js/bootLoader.js

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,22 @@ export class BootLoader {
9090
*/
9191
async setTimeoutAsync(delay) {
9292
return this.promisify(setTimeout, delay);
93-
}
93+
}
94+
95+
/**
96+
* @abstract Checks if running device is mobile device.
97+
*/
98+
get isMobile() {
99+
// Solution from Internet ... does not work
100+
// Check for Samsung device ... good enough to detect Samsung Internet Browser
101+
// var mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
102+
// var mobile = /Samsung/i.test(navigator.userAgent);
103+
// var isMobile = ('ontouchstart' in document.documentElement && /mobi/i.test(navigator.userAgent)) || mobile ;
104+
var mobile =
105+
navigator.userAgentData?.mobile ||
106+
/mobi|ios|arm/i.test(navigator.platform);
107+
return mobile ? true : false;
108+
}
94109

95110
/**
96111
* @abstract Initializes the app.
@@ -99,9 +114,9 @@ export class BootLoader {
99114
*
100115
* @async implements the Promise contract
101116
*/
102-
async initApp(useEasyLoader) {
117+
async initApp(mobile) {
103118
try {
104-
this.vme = new KatexInputHelper(useEasyLoader);
119+
this.vme = new KatexInputHelper(mobile);
105120
window.vme = this.vme; // prevents garbage collection?
106121
await this.vme.initialise();
107122
$('#myContainer').layout({fit: true});
@@ -119,7 +134,15 @@ export class BootLoader {
119134

120135
this.katex = await import('katex/dist/katex');
121136
await import('katex/dist/contrib/mhchem');
137+
var mobile = this.isMobile;
122138

139+
if (mobile) {
140+
var opts = { with: {
141+
type: 'css',
142+
} };
143+
await import('./jquery-easyui/jquery.easyui.mobile');
144+
await import('./jquery-easyui/themes/mobile.css', opts);
145+
}
123146
var counter = 20;
124147
while (!this.presenceCheck(counter) && --counter >= 0) {
125148
await this.setTimeoutAsync(100);
@@ -129,7 +152,7 @@ export class BootLoader {
129152
await this.readyAsync();
130153
console.debug('Promise check : document ready.');
131154

132-
await this.initApp(false);
155+
await this.initApp(mobile);
133156
console.debug('Promise check : app started.');
134157
this.check();
135158
}

src/assets/js/dialog.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ h3 {
7373
}
7474

7575
#westRegion {
76-
width: 210px;
76+
width: 230px;
7777

7878
.easyui-accordion > div {
79-
overflow: auto !important;
79+
overflow: hidden !important;
8080
}
8181
}
8282

@@ -132,10 +132,10 @@ h3 {
132132
}
133133

134134
#eastRegion {
135-
width: 210px;
135+
width: 250px;
136136

137137
.easyui-accordion > div {
138-
overflow: auto !important;
138+
overflow: hidden !important;
139139
}
140140
}
141141

0 commit comments

Comments
 (0)