Skip to content

Commit db1604a

Browse files
committed
Best changes to solve problems - save those changes.
1 parent 310f4d1 commit db1604a

11 files changed

Lines changed: 115 additions & 376 deletions

File tree

README.md

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

9898
## Release Notes
9999

100+
### 2.0.1
101+
102+
**New features**
103+
104+
- 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+
100107
### 2.0.0
101108

102109
- Fixed the start problem, e.g. the known problems [document](./KNOWN-PROBLEMS.md) is no longer valid.

package-lock.json

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

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "joplin-plugin-katex-input-helper",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"scripts": {
55
"dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && npm run build-assets && npm run build-docs && webpack --env joplin-plugin-config=createArchive",
66
"prepare": "npm run dist",
@@ -9,10 +9,11 @@
99
"build-docs": "typedoc --options typedoc.json && npm exec --package=@atao60/fse-cli fse copy ./img ./docs/img",
1010
"test": "vitest --root './tests' --run --reporter verbose",
1111
"jtest": "jest",
12-
"build-assets": "webpack --config webpack.assets.config.js --mode development",
12+
"build-assets": "webpack --config webpack.assets.config.js",
13+
"build-assets-prod": "webpack --config webpack.assets.config.js --env kihmode=production",
1314
"serve": "webpack serve --config webpack.assets.config.js",
1415
"stop-serve": "npx kill-port 9000",
15-
"deploy": "gh-pages -d dist"
16+
"deploy": "webpack --config webpack.assets.config.js --env ghpages && gh-pages -d dist/assets"
1617
},
1718
"license": "MIT",
1819
"keywords": [
@@ -31,6 +32,7 @@
3132
"babel": "^5.8.38",
3233
"babel-loader": "^10.0.0",
3334
"chalk": "^4.1.0",
35+
"codemirror": "^5.65.19",
3436
"copy-webpack-plugin": "^11.0.0",
3537
"css-loader": "^7.1.2",
3638
"css-minimizer-webpack-plugin": "^7.0.2",
@@ -42,6 +44,7 @@
4244
"html-webpack-plugin": "^5.6.3",
4345
"inversify": "^7.5.1",
4446
"jest": "^29.7.0",
47+
"jquery": "^3.7.1",
4548
"json-loader": "^0.5.7",
4649
"mini-css-extract-plugin": "^2.9.2",
4750
"path": "^0.12.7",

src/assets/js/bootLoader.js

Lines changed: 0 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,6 @@ export class BootLoader {
7171
});
7272
}
7373

74-
/**
75-
* @abstract A using function encapsulated by a Promise.
76-
*
77-
* @async implements the Promise contract
78-
* @param script - the url of the script to be loaded
79-
* @returns - the Promise indicating the state of the transaction
80-
*/
81-
async usingAsync(script) {
82-
return this.promisify(/*using*/easyloader.load.bind(easyloader), script);
83-
}
84-
8574
/**
8675
* @abstract The promise is fulfilled if the document becomes ready.
8776
*
@@ -101,77 +90,6 @@ export class BootLoader {
10190
return this.promisify(setTimeout, delay);
10291
}
10392

104-
/**
105-
* @abstract Initializes the scripts (css and js) using the easyloader.
106-
*
107-
* All but this boot loader and the easy loader is loaded here.
108-
*
109-
* @async implements the Promise contract
110-
*/
111-
async initScripts() {
112-
this.baseLocation = this.getBaseLocation();
113-
easyloader.base = this.baseLocation; // set the easyui base directory
114-
easyloader.css = false;
115-
console.dir(easyloader.modules);
116-
117-
var modules = [
118-
'parser', 'layout','window', 'dialog', 'panel', 'datagrid', 'tree',
119-
'menubutton', 'menu', 'accordion', 'linkbutton', 'tooltip', 'tabs',
120-
'messager', 'combobox' ];
121-
122-
var scripts = [
123-
//"./jquery.easyui.min.js",
124-
"./datagrid-cellediting.js",
125-
"./datagrid-filter.js",
126-
"../jquery-colorpicker/js/colorpicker.js",
127-
"../codemirror/lib/codemirror.js",
128-
"../katex/katex.min.js",
129-
"../katex/mhchem.min.js",
130-
131-
"../patterns/observable.js",
132-
"../localization.js",
133-
"../themes.js",
134-
"../parserExtension.js",
135-
"../parameters.js",
136-
"../fileHandling.js",
137-
"../helpers.js",
138-
"../math.js",
139-
"../categoriesTree.js",
140-
"../panels.js",
141-
"../dialog.js"
142-
];
143-
144-
var csss = [
145-
"./themes/default/easyui.css",
146-
"./themes/icon.css",
147-
"../jquery-easyui-MathEditorExtend/themes/aguas/easyui.css",
148-
"../jquery-easyui-MathEditorExtend/themes/icon.css",
149-
"../jquery-colorpicker/css/colorpicker.css",
150-
"../codemirror/lib/codemirror.css",
151-
"../keyboard/Keyboard.css",
152-
"../katex/katex.min.css",
153-
"../dialog.css"
154-
];
155-
156-
await this.usingAsync('./jquery.min.js');
157-
158-
for (var module of modules) {
159-
await this.usingAsync(module);
160-
}
161-
162-
for (var css of csss) {
163-
await this.usingAsync(css);
164-
// works but has no effect
165-
$('link')
166-
.last()
167-
.removeAttr('media');
168-
}
169-
170-
for (var script of scripts) {
171-
await this.usingAsync(script);
172-
}
173-
}
174-
17593
/**
17694
* @abstract Initializes the app.
17795
*
@@ -209,55 +127,6 @@ export class BootLoader {
209127
console.debug('Promise check : app started.');
210128
this.check();
211129
}
212-
213-
/**
214-
* @abstract Initialization scenario 2 : with easy loader.
215-
*
216-
* @async implements the Promise contract
217-
*/
218-
async init2() {
219-
var counter = 0;
220-
while ((typeof easyloader !== 'object' || !document.currentScript) && ++counter <= 50) {
221-
await this.setTimeoutAsync(100);
222-
}
223-
if (counter > 50) {
224-
throw Error("easyloader not loaded");
225-
}
226-
console.info(`easyloader loaded : ${typeof easyloader} `);
227-
228-
await this.initScripts();
229-
console.debug('Promise check : scripts loaded.');
230-
231-
await this.readyAsync();
232-
console.debug('Promise check : document ready.');
233-
234-
// trial to shift misplaced menus
235-
// $('#mFile, #mInsert, #mTools, #mView, #mOptions, #mInformations').append($('#menu'));
236-
237-
await this.initApp(true);
238-
console.debug('Promise check : app started.');
239-
this.check();
240-
}
241-
242-
/**
243-
* @abstract Sets the base location.
244-
*
245-
* This will be needed for relative paths of some content like css or js files.
246-
* Is here used only for *easyloader*.
247-
*
248-
* @returns the location of this script, ending with a slash
249-
*/
250-
getBaseLocation() {
251-
var location = document.currentScript.src
252-
.split('/')
253-
.slice(0, -1) // up to js folder
254-
.join('/')
255-
.replace(/ /g, '%20')
256-
.replace('file:///', 'file://')
257-
.replace('file://', 'file:///') + '/jquery-easyui/';
258-
259-
return location;
260-
}
261130

262131
/**
263132
* @abstract Checks the presence of the required scripts.
@@ -372,9 +241,7 @@ if (!window.bootLoaderLoaded) {
372241
});
373242
}
374243

375-
/*
376244
// This helps to import symbols in test suite
377245
try {
378246
module.exports = BootLoader;
379247
} catch(e) { }
380-
*/

src/assets/js/dialog.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
@import 'katex/dist/katex.css';
12
@import './jquery-easyui/themes/icon.css';
23
@import './jquery-easyui/themes/default/easyui.css';
34
@import './jquery-easyui-MathEditorExtend/themes/icon.css';
45
@import './jquery-easyui-MathEditorExtend/themes/aguas/easyui.css';
5-
@import './katex/katex.min.css';
66
@import './keyboard/keyboard.css';
77
@import './codemirror/lib/codemirror.css';
88
@import './codemirror/theme/darcula.css';
99
@import './codemirror/theme/twilight.css';
10+
@import './codemirror/theme/zenburn.css';
1011

1112
body {
1213
height: 100%;

0 commit comments

Comments
 (0)