From 366c257beb0e60058d7971fb1c5d56d50204aeca Mon Sep 17 00:00:00 2001 From: Ramon Mi Date: Fri, 6 Feb 2026 21:15:33 +0800 Subject: [PATCH] Note: add openInTab context menu and change editInWindow locale string --- chrome/content/zotero/elements/notesContext.js | 7 ++++++- chrome/content/zotero/xpcom/editorInstance.js | 8 +++++++- chrome/locale/en-US/zotero/note-editor.ftl | 1 + chrome/locale/en-US/zotero/zotero.ftl | 4 ++++ note-editor | 2 +- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/elements/notesContext.js b/chrome/content/zotero/elements/notesContext.js index a26340c577..e7cd472c91 100644 --- a/chrome/content/zotero/elements/notesContext.js +++ b/chrome/content/zotero/elements/notesContext.js @@ -77,7 +77,8 @@ - + + @@ -516,6 +517,10 @@ Zotero_Tabs.select('zotero-pane'); break; + case 'context-pane-list-edit-in-tab': + ZoteroPane.openNote(id, { openInWindow: false }); + break; + case 'context-pane-list-edit-in-window': ZoteroPane.openNote(id, { openInWindow: true }); break; diff --git a/chrome/content/zotero/xpcom/editorInstance.js b/chrome/content/zotero/xpcom/editorInstance.js index 4d10d37834..67c51f0f78 100644 --- a/chrome/content/zotero/xpcom/editorInstance.js +++ b/chrome/content/zotero/xpcom/editorInstance.js @@ -658,11 +658,17 @@ class EditorInstance { this._showInLibrary(this._item.id); return; } + case 'openTab': { + await this._ensureNoteCreated(); + let zp = Zotero.getActiveZoteroPane(); + zp.openNote(this._item.id, { openInWindow: false }); + return; + } case 'openWindow': { // TODO: Can we can avoid creating empty note just to open it in a new window? await this._ensureNoteCreated(); let zp = Zotero.getActiveZoteroPane(); - zp.openNoteWindow(this._item.id); + zp.openNote(this._item.id, { openInWindow: true }); return; } case 'update': { diff --git a/chrome/locale/en-US/zotero/note-editor.ftl b/chrome/locale/en-US/zotero/note-editor.ftl index da2db4c47d..b418ee0ba2 100644 --- a/chrome/locale/en-US/zotero/note-editor.ftl +++ b/chrome/locale/en-US/zotero/note-editor.ftl @@ -43,6 +43,7 @@ note-editor-show-on-page = Show on Page note-editor-add-citation = Add Citation note-editor-remove-citation = Hide Citation note-editor-find-and-replace = Find and Replace +note-editor-edit-in-tab = Edit in a New Tab note-editor-edit-in-window = Edit in a Separate Window note-editor-apply-annotation-colors = Show Annotation Colors note-editor-remove-annotation-colors = Hide Annotation Colors diff --git a/chrome/locale/en-US/zotero/zotero.ftl b/chrome/locale/en-US/zotero/zotero.ftl index 6a4807407a..6e1da2b951 100644 --- a/chrome/locale/en-US/zotero/zotero.ftl +++ b/chrome/locale/en-US/zotero/zotero.ftl @@ -639,6 +639,10 @@ context-notes-search = .placeholder = Search Notes context-notes-return-button = .aria-label = { general-go-back } +context-notes-edit-in-tab = + .label = Edit in a New Tab +context-notes-edit-in-window = + .label = Edit in a Separate Window new-collection = New Collection… menu-new-collection = diff --git a/note-editor b/note-editor index 107ab75c32..102d76fa93 160000 --- a/note-editor +++ b/note-editor @@ -1 +1 @@ -Subproject commit 107ab75c3247c6584bda2303ecbddf4b317fdd2d +Subproject commit 102d76fa93ea57a7b7b5fffa754b7445a9c9ae9c