www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit d780350d24864bf5e81aa07966c30f4a52b64e7c
parent e682ab729c022a42c23850dc5347c4f405e699a0
Author: Simon Kornblith <simon@simonster.com>
Date:   Sun,  1 Jul 2012 15:44:06 -0400

Merge branch '3.0'

Diffstat:
Mchrome/content/zotero/xpcom/translation/translate.js | 6++++--
Mchrome/content/zotero/xpcom/translation/translate_firefox.js | 8+++++++-
Mchrome/content/zotero/xpcom/utilities_translate.js | 2+-
3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/chrome/content/zotero/xpcom/translation/translate.js b/chrome/content/zotero/xpcom/translation/translate.js @@ -1337,7 +1337,8 @@ Zotero.Translate.Base.prototype = { // 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(typeof xml == 'string') { return new XML(xml);}"+ + "return xml;"+ "};"; } } @@ -2229,11 +2230,12 @@ Zotero.Translate.IO.String.prototype = { "_getXML":function() { if(this._mode == "xml/dom") { try { - return Zotero.Translate.IO.parseDOMXML(this.string); + var xml = Zotero.Translate.IO.parseDOMXML(this.string); } catch(e) { this._xmlInvalid = true; throw e; } + return (Zotero.isFx5 ? Zotero.Translate.SandboxManager.Fx5DOMWrapper(xml) : xml); } else { return this.string.replace(/<\?xml[^>]+\?>/, ""); } diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js @@ -732,7 +732,13 @@ Zotero.Translate.IO.Read.prototype = { "_getXML":function() { if(this._mode == "xml/dom") { - return Zotero.Translate.IO.parseDOMXML(this._rawStream, this._charset, this.file.fileSize); + try { + var xml = Zotero.Translate.IO.parseDOMXML(this._rawStream, this._charset, this.file.fileSize); + } catch(e) { + this._xmlInvalid = true; + throw e; + } + return (Zotero.isFx5 ? Zotero.Translate.SandboxManager.Fx5DOMWrapper(xml) : xml); } else { return this._readToString().replace(/<\?xml[^>]+\?>/, ""); } diff --git a/chrome/content/zotero/xpcom/utilities_translate.js b/chrome/content/zotero/xpcom/utilities_translate.js @@ -158,7 +158,7 @@ Zotero.Utilities.Translate.prototype.getItemArray = function(doc, inHere, urlRe, var links = inHere[j].getElementsByTagName("a"); for(var i=0; i<links.length; i++) { if(!urlRe || urlRegexp.test(links[i].href)) { - var text = links[i].textContent; + var text = "textContent" in links[i] ? links[i].textContent : links[i].innerText; if(text) { text = this.trimInternal(text); if(!rejectRe || !rejectRegexp.test(text)) {