From 57350fae1eabbc0fdd471645076f731845b7d835 Mon Sep 17 00:00:00 2001 From: aurimasv Date: Tue, 14 Jan 2014 02:17:58 -0600 Subject: [PATCH] [Retrieve Metadata] Use a single queue to query Google Scholar. Window closing tweaks. * Close window on blur after completion on Mac (revert previous change) * Don't close window when canceling * Add Esc handler to cancel/close window * Allow columns to be resized * Fixes #445 * Fixes #444 --- chrome/content/zotero/captcha.js | 21 + chrome/content/zotero/captcha.xul | 12 +- chrome/content/zotero/pdfProgress.xul | 2 + chrome/content/zotero/recognizePDF.js | 648 ++++++++++++------- chrome/locale/en-US/zotero/zotero.dtd | 5 +- chrome/locale/en-US/zotero/zotero.properties | 10 +- chrome/skin/default/zotero/zotero.css | 16 +- 7 files changed, 465 insertions(+), 249 deletions(-) diff --git a/chrome/content/zotero/captcha.js b/chrome/content/zotero/captcha.js index 72432cd64a..c5c771b885 100644 --- a/chrome/content/zotero/captcha.js +++ b/chrome/content/zotero/captcha.js @@ -28,6 +28,27 @@ var Zotero_Captcha = new function() { this.onLoad = function() { this._io = window.arguments[0]; + var description = document.getElementById('zotero-captcha-description'), + errorMsg = document.getElementById('zotero-captcha-error'); + + if(this._io.dataIn.title) { + document.title = this._io.dataIn.title; + } + + if(this._io.dataIn.description) { + description.textContent = this._io.dataIn.description; + description.hidden = false; + } else { + description.hidden = true; + } + + if(this._io.dataIn.error) { + errorMsg.textContent = this._io.dataIn.error; + errorMsg.hidden = false; + } else { + errorMsg.hidden = true; + } + document.getElementById('zotero-captcha-image').src = this._io.dataIn.imgUrl; document.getElementById('zotero-captcha-input').focus(); } diff --git a/chrome/content/zotero/captcha.xul b/chrome/content/zotero/captcha.xul index 3893b7b7fb..6ede55b756 100644 --- a/chrome/content/zotero/captcha.xul +++ b/chrome/content/zotero/captcha.xul @@ -1,16 +1,22 @@ - + + + + + id="zotero-captcha" + onkeypress="if(event.keyCode === KeyEvent.DOM_VK_ESCAPE) Zotero_Captcha.cancel();"> +