From f893206dfd6794a9d190bcf9a423ab98512904dc Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Thu, 1 Sep 2022 11:49:30 +0300 Subject: [PATCH] Allow inserting images over context menu Fixes #2759 --- chrome/content/zotero/xpcom/editorInstance.js | 3 +++ chrome/locale/en-US/zotero/zotero.properties | 1 + note-editor | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/editorInstance.js b/chrome/content/zotero/xpcom/editorInstance.js index 3dbd4b5dea..8460226bd0 100644 --- a/chrome/content/zotero/xpcom/editorInstance.js +++ b/chrome/content/zotero/xpcom/editorInstance.js @@ -713,6 +713,9 @@ class EditorInstance { } menuitem.setAttribute('checked', item.checked); menuitem.addEventListener('command', () => { + if (item.name === 'insertImage') { + return this._iframeWindow.eval('openImageFilePicker()'); + } this._postMessage({ action: 'contextMenuAction', ctxAction: item.name, diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 54192b5122..f298c24cd6 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -1342,6 +1342,7 @@ noteEditor.applyAnnotationColors = Show Annotation Colors noteEditor.removeAnnotationColors = Hide Annotation Colors noteEditor.addCitations = Show Annotation Citations noteEditor.removeCitations = Hide Annotation Citations +noteEditor.image = Image noteEditor.math = Math noteEditor.table = Table noteEditor.insertRowBefore = Insert Row Above diff --git a/note-editor b/note-editor index 29372d3801..658dd43e19 160000 --- a/note-editor +++ b/note-editor @@ -1 +1 @@ -Subproject commit 29372d3801665c21ebc0a8d6661df88bebd0ea29 +Subproject commit 658dd43e19e77fe89cd0e0e9342b0ab2427345a7