-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
41 lines (32 loc) · 1.23 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<br><br>
Text area:<br>
<textarea rows="15" cols="50"></textarea>
<br><br><br>
Div with contenteditable
<div contenteditable="true" style="width:350px;height:200px;border:1px solid black;"/>
<script type="text/javascript" charset="utf-8">
try {
const electronSpellchecker = require('electron-spellchecker');
const SpellCheckHandler = electronSpellchecker.SpellCheckHandler;
const ContextMenuListener = electronSpellchecker.ContextMenuListener;
const ContextMenuBuilder = electronSpellchecker.ContextMenuBuilder;
window.spellCheckHandler = new SpellCheckHandler();
window.spellCheckHandler.attachToInput();
window.spellCheckHandler.switchLanguage('en-GB');
//window.spellCheckHandler._automaticallyIdentifyLanguages = false;
let contextMenuBuilder = new ContextMenuBuilder(window.spellCheckHandler);
let contextMenuListener = new ContextMenuListener(async (info) => {
await contextMenuBuilder.showPopupMenu(info);
});
} catch (err) {
console.log('error in spell checker: ' + err.message);
}
</script>
</body>
</html>