From 04120099fb53bb0acaf9043fdf4c8a719cce4a45 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 (cherry picked from commit f893206dfd6794a9d190bcf9a423ab98512904dc) --- chrome/content/zotero/xpcom/editorInstance.js | 3 +++ chrome/locale/en-US/zotero/zotero.properties | 1 + 2 files changed, 4 insertions(+) diff --git a/chrome/content/zotero/xpcom/editorInstance.js b/chrome/content/zotero/xpcom/editorInstance.js index 154aa33822..fe8da5c6c2 100644 --- a/chrome/content/zotero/xpcom/editorInstance.js +++ b/chrome/content/zotero/xpcom/editorInstance.js @@ -766,6 +766,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 c12a28cd18..fe8cb43dc8 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -1338,6 +1338,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.copyImage = Copy Image