From 01813f57cf640fe86cab4653d53245ef697c8405 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 24 Apr 2012 02:11:58 -0400 Subject: [PATCH] Allow translators to get the translatorID of their parent translator as Zotero.parentTranslator. Among other things, this permits import translators to exhibit different behavior depending on when they are called from web translators. --- chrome/content/zotero/xpcom/translation/translate.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 85ff370346..69bdc23183 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1378,6 +1378,9 @@ Zotero.Translate.Base.prototype = { this._sandboxManager.sandbox.Zotero.isBookmarklet = Zotero.isBookmarklet || false; this._sandboxManager.sandbox.Zotero.isConnector = Zotero.isConnector || false; this._sandboxManager.sandbox.Zotero.isServer = Zotero.isServer || false; + this._sandboxManager.sandbox.Zotero.parentTranslator = this._parentTranslator + && this._parentTranslator.translator && this._parentTranslator.translator[0] ? + this._parentTranslator.translator[0].translatorID : null; // create shortcuts this._sandboxManager.sandbox.Z = this._sandboxManager.sandbox.Zotero;