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.

This commit is contained in:
Simon Kornblith 2012-04-24 02:11:58 -04:00
parent 8faf011b2d
commit 01813f57cf

View file

@ -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;