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:
parent
8faf011b2d
commit
01813f57cf
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue