commit 01813f57cf640fe86cab4653d53245ef697c8405
parent 8faf011b2de74fd6caa0e80975332706e768cadf
Author: Simon Kornblith <simon@simonster.com>
Date: Tue, 24 Apr 2012 02:11:58 -0400
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.
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git 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;