diff --git a/chrome/content/zotero/exportOptions.js b/chrome/content/zotero/exportOptions.js
index e78f51366a..2410252812 100644
--- a/chrome/content/zotero/exportOptions.js
+++ b/chrome/content/zotero/exportOptions.js
@@ -31,6 +31,13 @@
const OPTION_PREFIX = "export-option-";
+const IGNORE_EXPORT_ONLY_TRANSLATORS = [
+ 'b6e39b57-8942-4d11-8259-342c46ce395f', // BibLaTeX: Imported by BibTeX
+ '14763d25-8ba0-45df-8f52-b8d1108e7ac9', // Bibliontology RDF: Imported by RDF
+ '14763d24-8ba0-45df-8f52-b8d1108e7ac9', // Zotero RDF: Imported by RDF
+ '6e372642-ed9d-4934-b5d1-c11ac758ebb7', // Unqualified Dublin Core RDF: Imported by RDF
+];
+
// Class to provide options for export
var Zotero_File_Interface_Export = new function() {
@@ -49,7 +56,7 @@ var Zotero_File_Interface_Export = new function() {
var addedOptions = new Object();
- var { translators, exportingNotes } = window.arguments[0];
+ var { translators, exportingNotes, exportingLibrary } = window.arguments[0];
// get format popup
var formatPopup = document.getElementById("format-popup");
@@ -138,6 +145,9 @@ var Zotero_File_Interface_Export = new function() {
exportingNotes ? "export.noteTranslatorSettings" : "export.translatorSettings"
));
+ var warningBackup = document.getElementById('warning-backup');
+ warningBackup.hidden = !exportingLibrary;
+
document.addEventListener('dialogaccept', () => this.accept());
document.addEventListener('dialogcancel', () => this.cancel());
}
@@ -148,7 +158,8 @@ var Zotero_File_Interface_Export = new function() {
this.updateOptions = function (optionString) {
// get selected translator
var index = document.getElementById("format-menu").selectedIndex;
- var translatorOptions = window.arguments[0].translators[index].displayOptions;
+ var translator = window.arguments[0].translators[index];
+ var translatorOptions = translator.displayOptions;
if(optionString) {
try {
@@ -215,6 +226,12 @@ var Zotero_File_Interface_Export = new function() {
document.getElementById("charset-box").hidden = true;
}
+ let warningCannotImport = document.getElementById('warning-cannot-import');
+ warningCannotImport.hidden = translator.translatorType & Zotero.Translator.TRANSLATOR_TYPES.import
+ || IGNORE_EXPORT_ONLY_TRANSLATORS.includes(translator.translatorID);
+ document.l10n.setArgs(warningCannotImport, { format: translator.label });
+ document.l10n.translateRoots().then(() => window.sizeToContent());
+
window.sizeToContent();
}
diff --git a/chrome/content/zotero/exportOptions.xhtml b/chrome/content/zotero/exportOptions.xhtml
index 9087cd509e..38ca02d669 100644
--- a/chrome/content/zotero/exportOptions.xhtml
+++ b/chrome/content/zotero/exportOptions.xhtml
@@ -7,7 +7,6 @@
%zoteroDTD;
]>
-
+
+
+
+
@@ -38,6 +39,7 @@
+
@@ -47,6 +49,9 @@
+
diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js
index 7c0c9cdc5f..2edeeb20aa 100644
--- a/chrome/content/zotero/fileInterface.js
+++ b/chrome/content/zotero/fileInterface.js
@@ -103,7 +103,11 @@ Zotero_File_Exporter.prototype.save = async function () {
}
// present options dialog
- var io = { translators, exportingNotes };
+ var io = {
+ translators,
+ exportingNotes,
+ exportingLibrary: !!(this.libraryID && !this.collection && !this.items),
+ };
window.openDialog("chrome://zotero/content/exportOptions.xhtml",
"_blank", "chrome,modal,centerscreen,resizable=no", io);
if(!io.selectedTranslator) {
diff --git a/chrome/locale/en-US/zotero/zotero.ftl b/chrome/locale/en-US/zotero/zotero.ftl
index 42cd1e48d8..cd5af8822d 100644
--- a/chrome/locale/en-US/zotero/zotero.ftl
+++ b/chrome/locale/en-US/zotero/zotero.ftl
@@ -299,6 +299,9 @@ import-online-new =
import-mendeley-username = Username
import-mendeley-password = Password
+export-warning-cannot-import = { -app-name } cannot import data in { $format }. Only exports are supported using this format.
+export-warning-backup = You may lose data if you attempt to back up your entire library this way. Learn more.
+
general-error = Error
file-interface-import-error = An error occurred while trying to import the selected file. Please ensure that the file is valid and try again.
file-interface-import-complete = Import Complete
diff --git a/scss/components/_exportOptions.scss b/scss/components/_exportOptions.scss
index 8b1da82f78..99f9b9fc8e 100644
--- a/scss/components/_exportOptions.scss
+++ b/scss/components/_exportOptions.scss
@@ -13,4 +13,23 @@
checkbox[native][disabled="true"] {
color: unset;
}
+
+ #warning-cannot-import, #warning-backup {
+ max-width: 300px;
+ white-space: wrap;
+ }
+
+ #warning-cannot-import {
+ color: var(--fill-secondary);
+ padding-inline-start: 8px;
+ padding-bottom: 2px;
+ }
+
+ #warning-backup {
+ color: var(--accent-red);
+
+ .zotero-text-link {
+ margin: 0;
+ }
+ }
}