Fix PDF recognition

This commit is contained in:
Simon Kornblith 2013-03-03 17:04:27 -05:00
parent b0a71467ea
commit b2a7050dea

View file

@ -184,15 +184,16 @@ var Zotero_RecognizePDF = new function() {
return Zotero.HTTP.promise("GET", url, {"responseType":"document"})
})
.then(function(xmlhttp) {
var doc = xmlhttp.response,
deferred = Q.defer(),
translate = new Zotero.Translate.Web();
if(Zotero.Utilities.xpath(doc, "//form[@action='Captcha']").length) {
// Hit CAPTCHA
limited = true;
throw new Zotero.Exception.Alert("recognizePDF.limit");
}
var doc = xmlhttp.response,
deferred = Q.defer(),
translate = new Zotero.Translate.Web();
translate.setTranslator("57a00950-f0d1-4b41-b6ba-44ff0fc30289");
translate.setDocument(Zotero.HTTP.wrapDocument(doc, url));
translate.setHandler("translators", function(translate, detected) {