Remove "Store Annotations in File" option (#2498)

This is a confusing, bad option, which was already disabled in groups,
and this removes it from personal libraries as well. People seem to be
using it mainly because they think annotations are locked into Zotero if
they don't, which is causing them to ask for this to be done
automatically on every edit, which we don't do because it would result
in constant file syncing and file conflicts [1].

We provide multiple export options for exporting PDFs with annotations,
and people can use those when sharing a file with people who don't use
Zotero. Otherwise, if storing annotations in the file is a priority,
they can use an external reader that's not designed to be tightly
integrated into Zotero.

(As a rare hack, it's of course also possible to export the PDF with
annotations, replace the original file, and import the annotations.)

[1] https://www.zotero.org/support/kb/annotations_in_database
This commit is contained in:
Dan Stillman 2022-03-30 13:58:59 -04:00 committed by GitHub
parent 56321a7a6d
commit e0097df068
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 37 deletions

View file

@ -166,13 +166,10 @@ const ZoteroStandalone = new function() {
&& !(item.deleted || item.parentItem && item.parentItem.deleted)) { && !(item.deleted || item.parentItem && item.parentItem.deleted)) {
let annotations = item.getAnnotations(); let annotations = item.getAnnotations();
let canTransferFromPDF = annotations.find(x => x.annotationIsExternal); let canTransferFromPDF = annotations.find(x => x.annotationIsExternal);
let canTransferToPDF = annotations.find(x => !x.annotationIsExternal);
this.updateMenuItemEnabled('menu_transferFromPDF', canTransferFromPDF); this.updateMenuItemEnabled('menu_transferFromPDF', canTransferFromPDF);
this.updateMenuItemEnabled('menu_transferToPDF', canTransferToPDF);
} }
else { else {
this.updateMenuItemEnabled('menu_transferFromPDF', false); this.updateMenuItemEnabled('menu_transferFromPDF', false);
this.updateMenuItemEnabled('menu_transferToPDF', false);
} }
} }

View file

@ -160,12 +160,6 @@
label="&zotero.pdfReader.transferFromPDF;" label="&zotero.pdfReader.transferFromPDF;"
oncommand="ZoteroStandalone.onReaderCmd('transferFromPDF')" oncommand="ZoteroStandalone.onReaderCmd('transferFromPDF')"
/> />
<menuitem
id="menu_transferToPDF"
class="menu-type-reader"
label="&zotero.pdfReader.transferToPDF;"
oncommand="ZoteroStandalone.onReaderCmd('transferToPDF')"
/>
<menuseparator class="menu-type-reader"/> <menuseparator class="menu-type-reader"/>
<menuitem id="menu_export_file" class="menu-type-reader" <menuitem id="menu_export_file" class="menu-type-reader"
label="&zotero.general.saveAs;" label="&zotero.general.saveAs;"

View file

@ -231,23 +231,14 @@ class ReaderInstance {
return true; return true;
} }
promptToTransferAnnotations(fromPDF) { promptToTransferAnnotations() {
let ps = Services.prompt; let ps = Services.prompt;
let buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING let buttonFlags = ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING
+ ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL; + ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL;
let index = ps.confirmEx( let index = ps.confirmEx(
null, null,
Zotero.getString( Zotero.getString('pdfReader.promptTransferFromPDF.title'),
fromPDF Zotero.getString('pdfReader.promptTransferFromPDF.text', Zotero.appName),
? 'pdfReader.promptTransferFromPDF.title'
: 'pdfReader.promptTransferToPDF.title'
),
Zotero.getString(
fromPDF
? 'pdfReader.promptTransferFromPDF.text'
: 'pdfReader.promptTransferToPDF.text',
Zotero.appName
),
buttonFlags, buttonFlags,
Zotero.getString('general.continue'), Zotero.getString('general.continue'),
null, null, null, {} null, null, null, {}
@ -270,21 +261,6 @@ class ReaderInstance {
} }
} }
} }
else if (cmd === 'transferToPDF') {
if (this.promptToTransferAnnotations(false)) {
try {
await Zotero.PDFWorker.export(this._itemID, null, true, '', true);
}
catch (e) {
if (e.name === 'PasswordException') {
Zotero.alert(null, Zotero.getString('general.error'),
Zotero.getString('pdfReader.promptPasswordProtected'));
}
throw e;
}
await Zotero.PDFWorker.import(this._itemID, true);
}
}
else if (cmd === 'export') { else if (cmd === 'export') {
let zp = Zotero.getActiveZoteroPane(); let zp = Zotero.getActiveZoteroPane();
zp.exportPDF(this._itemID); zp.exportPDF(this._itemID);

View file

@ -325,4 +325,3 @@
<!ENTITY zotero.pdfReader.zoomAuto "Automatically Resize"> <!ENTITY zotero.pdfReader.zoomAuto "Automatically Resize">
<!ENTITY zotero.pdfReader.zoomPageWidth "Zoom to Page Width"> <!ENTITY zotero.pdfReader.zoomPageWidth "Zoom to Page Width">
<!ENTITY zotero.pdfReader.transferFromPDF "Import Annotations…"> <!ENTITY zotero.pdfReader.transferFromPDF "Import Annotations…">
<!ENTITY zotero.pdfReader.transferToPDF "Store Annotations in File…">