aboutsummaryrefslogtreecommitdiffstats
path: root/src/webview/spellchecker.js
blob: ec8807874b3755a7b971d53d13ca1ba425fb50bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { SpellCheckHandler, ContextMenuListener, ContextMenuBuilder } from 'electron-spellchecker';

window.spellCheckHandler = new SpellCheckHandler();
setTimeout(() => {
  window.spellCheckHandler.attachToInput();
}, 1000);

// TODO: should we set the language to user settings?
// window.spellCheckHandler.switchLanguage('en-US');

const contextMenuBuilder = new ContextMenuBuilder(window.spellCheckHandler);
const contextMenuListener = new ContextMenuListener((info) => { // eslint-disable-line
  contextMenuBuilder.showPopupMenu(info);
});