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();"> +