diff options
author | 2019-07-31 17:08:29 +0200 | |
---|---|---|
committer | 2019-07-31 17:08:29 +0200 | |
commit | bd49d59008d64db13e3f37277ec873a3a464ef9e (patch) | |
tree | 7d4f4a943477e543abbcacd2ceb2ac0002054910 /src/webview/contextMenu.js | |
parent | Merge branch 'develop' into feature/todos (diff) | |
download | ferdium-app-bd49d59008d64db13e3f37277ec873a3a464ef9e.tar.gz ferdium-app-bd49d59008d64db13e3f37277ec873a3a464ef9e.tar.zst ferdium-app-bd49d59008d64db13e3f37277ec873a3a464ef9e.zip |
MVP for service <-> todos integration
Diffstat (limited to 'src/webview/contextMenu.js')
-rw-r--r-- | src/webview/contextMenu.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/webview/contextMenu.js b/src/webview/contextMenu.js index a4a6ab899..663b1ebca 100644 --- a/src/webview/contextMenu.js +++ b/src/webview/contextMenu.js | |||
@@ -39,6 +39,23 @@ const buildMenuTpl = (props, suggestions, isSpellcheckEnabled, defaultSpellcheck | |||
39 | { | 39 | { |
40 | type: 'separator', | 40 | type: 'separator', |
41 | }, { | 41 | }, { |
42 | id: 'createTodo', | ||
43 | label: `Create todo: "${textSelection.length > 15 ? `${textSelection.slice(0, 15)}...` : textSelection}"`, | ||
44 | visible: hasText, | ||
45 | click() { | ||
46 | debug('Create todo from selected text', textSelection); | ||
47 | ipcRenderer.sendToHost('feature:todos', { | ||
48 | action: 'create:todo', | ||
49 | data: { | ||
50 | title: textSelection, | ||
51 | url: window.location.href, | ||
52 | }, | ||
53 | }); | ||
54 | }, | ||
55 | }, | ||
56 | { | ||
57 | type: 'separator', | ||
58 | }, { | ||
42 | id: 'lookup', | 59 | id: 'lookup', |
43 | label: `Look Up "${textSelection.length > 15 ? `${textSelection.slice(0, 15)}...` : textSelection}"`, | 60 | label: `Look Up "${textSelection.length > 15 ? `${textSelection.slice(0, 15)}...` : textSelection}"`, |
44 | visible: isMac && props.mediaType === 'none' && hasText, | 61 | visible: isMac && props.mediaType === 'none' && hasText, |