diff --git a/chrome/content/zotero/xpcom/reader.js b/chrome/content/zotero/xpcom/reader.js index 48e639666e..f1317910a2 100644 --- a/chrome/content/zotero/xpcom/reader.js +++ b/chrome/content/zotero/xpcom/reader.js @@ -200,6 +200,7 @@ class ReaderInstance { ...Zotero.Intl.getPrefixedStrings('pdfReader.') }, showAnnotations: true, + textSelectionAnnotationMode: Zotero.Prefs.get('reader.textSelectionAnnotationMode'), useDarkModeForContent: Zotero.Prefs.get('reader.contentDarkMode'), fontFamily: Zotero.Prefs.get('reader.ebookFontFamily'), hyphenation: Zotero.Prefs.get('reader.ebookHyphenate'), @@ -518,6 +519,9 @@ class ReaderInstance { iframe.browsingContext.textZoom = 1; iframe.browsingContext.fullZoom = zoom; }, + onTextSelectionAnnotationModeChange: (mode) => { + Zotero.Prefs.set('reader.textSelectionAnnotationMode', mode); + } }, this._iframeWindow, { cloneFunctions: true })); this._resolveInitPromise(); @@ -527,6 +531,7 @@ class ReaderInstance { this._prefObserverIDs = [ Zotero.Prefs.registerObserver('fontSize', this._handleFontSizeChange), Zotero.Prefs.registerObserver('tabs.title.reader', this._handleTabTitlePrefChange), + Zotero.Prefs.registerObserver('reader.textSelectionAnnotationMode', this._handleTextSelectionAnnotationModeChange), Zotero.Prefs.registerObserver('reader.contentDarkMode', this._handleContentDarkModeChange), Zotero.Prefs.registerObserver('reader.ebookFontFamily', this._handleEbookPrefChange), Zotero.Prefs.registerObserver('reader.ebookHyphenate', this._handleEbookPrefChange), @@ -856,6 +861,10 @@ class ReaderInstance { await this.updateTitle(); }; + _handleTextSelectionAnnotationModeChange = () => { + this._internalReader.setTextSelectionAnnotationMode(Zotero.Prefs.get('reader.textSelectionAnnotationMode')); + }; + _handleContentDarkModeChange = () => { this._internalReader.useDarkModeForContent(Zotero.Prefs.get('reader.contentDarkMode')); }; diff --git a/defaults/preferences/zotero.js b/defaults/preferences/zotero.js index 50cb8e37f4..e40cd5637a 100644 --- a/defaults/preferences/zotero.js +++ b/defaults/preferences/zotero.js @@ -222,6 +222,7 @@ pref("extensions.zotero.scaffold.eslint.enabled", true); pref("extensions.zotero.tabs.title.reader", "titleCreatorYear"); // Reader +pref("extensions.zotero.reader.textSelectionAnnotationMode", "highlight"); pref("extensions.zotero.reader.contentDarkMode", true); pref("extensions.zotero.reader.ebookFontFamily", "Georgia, serif"); pref("extensions.zotero.reader.ebookHyphenate", true); diff --git a/reader b/reader index 4b37e0e23a..58b304032a 160000 --- a/reader +++ b/reader @@ -1 +1 @@ -Subproject commit 4b37e0e23ae5749421acf46dc3bb73525622ae45 +Subproject commit 58b304032aba2e2372cc7ee3f588225db0e70ad6