Add the export warning to the plugin interface export command
This commit is contained in:
parent
07c8269433
commit
96a0b77192
2 changed files with 30 additions and 20 deletions
|
@ -243,27 +243,10 @@ var Zotero_File_Interface_Bibliography = new function() {
|
||||||
window.sizeToContent();
|
window.sizeToContent();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.exportDocument = function() {
|
this.exportDocument = function () {
|
||||||
const documentationURL = "https://www.zotero.org/support/kb/word_processor_document_export";
|
if (Zotero.Integration.confirmExportDocument()) {
|
||||||
|
|
||||||
var ps = Services.prompt;
|
|
||||||
var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
|
||||||
+ (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL)
|
|
||||||
+ (ps.BUTTON_POS_2) * (ps.BUTTON_TITLE_IS_STRING);
|
|
||||||
var result = ps.confirmEx(null,
|
|
||||||
Zotero.getString('integration.exportDocument'),
|
|
||||||
Zotero.getString('integration.exportDocument.description1')
|
|
||||||
+ "\n\n"
|
|
||||||
+ Zotero.getString('integration.exportDocument.description2'),
|
|
||||||
buttonFlags,
|
|
||||||
Zotero.getString('general.export'),
|
|
||||||
null,
|
|
||||||
Zotero.getString('general.moreInformation'), null, {});
|
|
||||||
if (result == 0) {
|
|
||||||
_io.exportDocument = true;
|
_io.exportDocument = true;
|
||||||
document.documentElement.acceptDialog();
|
document.documentElement.acceptDialog();
|
||||||
} else if (result == 2) {
|
|
||||||
Zotero.launchURL(documentationURL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -540,6 +540,31 @@ Zotero.Integration = new function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Zotero.Integration.confirmExportDocument = function() {
|
||||||
|
const documentationURL = "https://www.zotero.org/support/kb/word_processor_document_export";
|
||||||
|
|
||||||
|
var ps = Services.prompt;
|
||||||
|
var buttonFlags = (ps.BUTTON_POS_0) * (ps.BUTTON_TITLE_IS_STRING)
|
||||||
|
+ (ps.BUTTON_POS_1) * (ps.BUTTON_TITLE_CANCEL)
|
||||||
|
+ (ps.BUTTON_POS_2) * (ps.BUTTON_TITLE_IS_STRING);
|
||||||
|
var result = ps.confirmEx(null,
|
||||||
|
Zotero.getString('integration.exportDocument'),
|
||||||
|
Zotero.getString('integration.exportDocument.description1')
|
||||||
|
+ "\n\n"
|
||||||
|
+ Zotero.getString('integration.exportDocument.description2'),
|
||||||
|
buttonFlags,
|
||||||
|
Zotero.getString('general.export'),
|
||||||
|
null,
|
||||||
|
Zotero.getString('general.moreInformation'), null, {});
|
||||||
|
if (result == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (result == 2) {
|
||||||
|
Zotero.launchURL(documentationURL);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An exception thrown when a document contains an item that no longer exists in the current document.
|
* An exception thrown when a document contains an item that no longer exists in the current document.
|
||||||
*/
|
*/
|
||||||
|
@ -813,7 +838,9 @@ Zotero.Integration.Interface.prototype.setDocPrefs = Zotero.Promise.coroutine(fu
|
||||||
*/
|
*/
|
||||||
Zotero.Integration.Interface.prototype.exportDocument = async function () {
|
Zotero.Integration.Interface.prototype.exportDocument = async function () {
|
||||||
await this._session.init(true, false);
|
await this._session.init(true, false);
|
||||||
|
if (Zotero.Integration.confirmExportDocument()) {
|
||||||
await this._session.exportDocument();
|
await this._session.exportDocument();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue