Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Electron Spellchecker support #246

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ addons:
- icnsutils
- graphicsmagick
- xz-utils
- libxkbfile-dev
install:
- nvm install 6
- npm install
Expand Down
11 changes: 11 additions & 0 deletions browser.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
'use strict';
const electron = require('electron');
const {SpellCheckHandler, ContextMenuListener, ContextMenuBuilder} = require('electron-spellchecker');
const config = require('./config');

const {ipcRenderer: ipc} = electron;

// Spellchecking for user input
window.spellCheckHandler = new SpellCheckHandler();
window.spellCheckHandler.attachToInput();
window.spellCheckHandler.switchLanguage(navigator.language);
const contextMenuBuilder = new ContextMenuBuilder(window.spellCheckHandler);
// eslint-disable-next-line no-unused-vars
new ContextMenuListener(info => {
contextMenuBuilder.showPopupMenu(info);
});

const listSelector = 'div[role="navigation"] > div > ul';
const conversationSelector = '._4u-c._1wfr > ._5f0v.uiScrollableArea';
const selectedConversationSelector = '._5l-3._1ht1._1ht2';
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ app.disableHardwareAcceleration();

require('electron-debug')({enabled: true});
require('electron-dl')();
require('electron-context-menu')();

let mainWindow;
let isQuitting = false;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"dist": "build"
},
"dependencies": {
"electron-context-menu": "^0.8.0",
"electron-debug": "^1.0.0",
"electron-dl": "^1.0.0",
"electron-is-dev": "^0.1.2",
"electron-localshortcut": "^2.0.0",
"electron-log": "^2.0.2",
"electron-spellchecker": "^1.1.0",
"electron-store": "^1.1.0",
"electron-updater": "^1.3.2",
"facebook-locales": "^1.0.464",
Expand Down