mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
provide context menu in text editor also with disabled spellcheck
This commit is contained in:
parent
3cf3fc13b9
commit
3386dace3b
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"version": "0.39.3",
|
"version": "0.39.5",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -6,7 +6,7 @@ const TPL = `
|
|||||||
<div>
|
<div>
|
||||||
<h4>Spell check</h4>
|
<h4>Spell check</h4>
|
||||||
|
|
||||||
<p>These options apply only for desktop builds, browsers will use their own native spell check.</p>
|
<p>These options apply only for desktop builds, browsers will use their own native spell check. App restart is required after change.</p>
|
||||||
|
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input type="checkbox" class="custom-control-input" id="spell-check-enabled">
|
<input type="checkbox" class="custom-control-input" id="spell-check-enabled">
|
||||||
|
@ -3,15 +3,16 @@ import optionsService from "./options.js";
|
|||||||
export async function initSpellCheck() {
|
export async function initSpellCheck() {
|
||||||
const options = await optionsService.waitForOptions();
|
const options = await optionsService.waitForOptions();
|
||||||
|
|
||||||
if (!options.is('spellCheckEnabled')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const {SpellCheckHandler, ContextMenuListener, ContextMenuBuilder} = require('electron-spellchecker');
|
const {SpellCheckHandler, ContextMenuListener, ContextMenuBuilder} = require('electron-spellchecker');
|
||||||
const {remote, shell} = require('electron');
|
const {remote, shell} = require('electron');
|
||||||
|
|
||||||
const spellCheckHandler = new SpellCheckHandler();
|
const spellCheckHandler = new SpellCheckHandler();
|
||||||
spellCheckHandler.attachToInput();
|
|
||||||
|
// not fully disabling the spellcheck since we want to preserve the context menu
|
||||||
|
// this will just get rid of the "red squiggles"
|
||||||
|
if (options.is('spellCheckEnabled')) {
|
||||||
|
spellCheckHandler.attachToInput();
|
||||||
|
}
|
||||||
|
|
||||||
spellCheckHandler.switchLanguage(options.get('spellCheckLanguageCode'));
|
spellCheckHandler.switchLanguage(options.get('spellCheckLanguageCode'));
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<table class="table">
|
<table class="table table-borderless">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Homepage:</th>
|
<th>Homepage:</th>
|
||||||
<td><a href="https://github.com/zadam/trilium" class="external">https://github.com/zadam/trilium</a></td>
|
<td><a href="https://github.com/zadam/trilium" class="external">https://github.com/zadam/trilium</a></td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user