From d592d3156e62c898b386763c74789f8420bc3206 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 8 Jul 2010 22:45:42 +0000 Subject: [PATCH] Fix translation in Fx4 --- chrome/content/zotero/xpcom/translate.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/translate.js b/chrome/content/zotero/xpcom/translate.js index 09d54fe8f..a030b2533 100644 --- a/chrome/content/zotero/xpcom/translate.js +++ b/chrome/content/zotero/xpcom/translate.js @@ -929,7 +929,16 @@ Zotero.Translate.prototype._generateSandbox = function() { // set up sandbox this._sandbox = new Components.utils.Sandbox(sandboxLocation); - this._sandbox.Zotero = new Object(); + Components.utils.evalInSandbox("var Zotero = {};"+ + "Zotero.Item = function (itemType) {"+ + "this.itemType = itemType;"+ + "this.creators = [];"+ + "this.notes = [];"+ + "this.tags = [];"+ + "this.seeAlso = [];"+ + "this.attachments = [];"+ + "};"+ + "Zotero.Item.prototype.complete = function() { Zotero._itemDone(this); };", this._sandbox) // add utilities this._sandbox.Zotero.Utilities = new Zotero.Utilities.Translate(this); @@ -941,8 +950,7 @@ Zotero.Translate.prototype._generateSandbox = function() { this._sandbox.Zotero.nextCollection = function() { return me._exportGetCollection() } } else { // copy routines to add new items - this._sandbox.Zotero.Item = Zotero.Translate.GenerateZoteroItemClass(); - this._sandbox.Zotero.Item.prototype.complete = function() {me._itemDone(this)}; + this._sandbox.Zotero._itemDone = function(a) {me._itemDone(a)}; if(this.type == "import") { // add routines to add new collections