From 75b354a67ec8774b6c9b2c4fe33b748e51f9ac5c Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Wed, 6 Jul 2011 13:29:06 +0000 Subject: [PATCH] Closes #1854, XML mode import issues --- .../zotero/xpcom/translation/translate.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js index 30acee977..f0ab05368 100644 --- a/chrome/content/zotero/xpcom/translation/translate.js +++ b/chrome/content/zotero/xpcom/translation/translate.js @@ -1091,7 +1091,9 @@ Zotero.Translate.Base.prototype = { return; } - if(!this._loadTranslator(this._potentialTranslators[0])) return; + if(!this._loadTranslator(this._potentialTranslators[0])) { + this.complete(false); + } this._prepareDetection(); this.incrementAsyncProcesses(); @@ -1171,12 +1173,13 @@ Zotero.Translate.Base.prototype = { if(this instanceof Zotero.Translate.Export || this instanceof Zotero.Translate.Import) { src += "Zotero.Collection = function () {};"+ "Zotero.Collection.prototype.complete = function() { Zotero._collectionDone(this); };"; - } else if (this instanceof Zotero.Translate.Import) { - // https://bugzilla.mozilla.org/show_bug.cgi?id=609143 - can't pass E4X to sandbox in Fx4 - src += "Zotero.getXML = function() {"+ - "var xml = Zotero._getXML();"+ - "if(typeof xml == 'string') return new XML(xml);"+ - "};"; + if (this instanceof Zotero.Translate.Import) { + // https://bugzilla.mozilla.org/show_bug.cgi?id=609143 - can't pass E4X to sandbox in Fx4 + src += "Zotero.getXML = function() {"+ + "var xml = Zotero._getXML();"+ + "if(typeof xml == 'string') return new XML(xml);"+ + "};"; + } } if(Zotero.isFx) {