From fedd6f8241d9f0ef15d80a095d99e3b103f574f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Tue, 28 May 2019 13:51:08 +0300 Subject: [PATCH] Add an 'exportDocument' integration command endpoint --- chrome/content/zotero/xpcom/integration.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/chrome/content/zotero/xpcom/integration.js b/chrome/content/zotero/xpcom/integration.js index ce63ecf7ee..2b0f5c5e70 100644 --- a/chrome/content/zotero/xpcom/integration.js +++ b/chrome/content/zotero/xpcom/integration.js @@ -807,6 +807,15 @@ Zotero.Integration.Interface.prototype.setDocPrefs = Zotero.Promise.coroutine(fu return this._session.fields.updateDocument(FORCE_CITATIONS_RESET_TEXT, true, true); }); +/** + * Exports the citations in the document to a format importable in other word processors + * @return {Promise} + */ +Zotero.Integration.Interface.prototype.exportDocument = async function () { + await this._session.init(true, false); + await this._session.exportDocument(); +} + /** * An exceedingly simple nsISimpleEnumerator implementation */