diff --git a/chrome/content/zotero/import/importWizard.js b/chrome/content/zotero/import/importWizard.js index 5db6b0dbc4..66cab732db 100644 --- a/chrome/content/zotero/import/importWizard.js +++ b/chrome/content/zotero/import/importWizard.js @@ -252,13 +252,12 @@ var Zotero_Import_Wizard = { catch (e) { if (e.message == 'Encrypted Mendeley database') { let url = 'https://www.zotero.org/support/kb/mendeley_import'; - this._onDone( - Zotero.getString('general.error'), - // TODO: Localize - `The selected Mendeley database cannot be read, likely because it is encrypted. ` - + `See How do I import a Mendeley library ` - + `into Zotero? for more information.` - ); + let HTML_NS = 'http://www.w3.org/1999/xhtml' + let elem = document.createElementNS(HTML_NS, 'div'); + elem.innerHTML = `The selected Mendeley database cannot be read, likely because it ` + + `is encrypted. See How do I import a ` + + `Mendeley library into Zotero? for more information.` + this._onDone(Zotero.getString('general.error'), elem); } else { this._onDone( @@ -338,9 +337,9 @@ var Zotero_Import_Wizard = { var xulElem = document.getElementById('result-description'); var htmlElem = document.getElementById('result-description-html'); - if (description.includes('href')) { - htmlElem.innerHTML = description; - Zotero.Utilities.Internal.updateHTMLInXUL(htmlElem); + if (description instanceof HTMLElement) { + htmlElem.appendChild(description); + Zotero.Utilities.Internal.updateHTMLInXUL(htmlElem, { callback: () => window.close() }); xulElem.hidden = true; htmlElem.setAttribute('display', 'block'); } diff --git a/chrome/content/zotero/import/importWizard.xul b/chrome/content/zotero/import/importWizard.xul index e59b2c0693..d204df3633 100644 --- a/chrome/content/zotero/import/importWizard.xul +++ b/chrome/content/zotero/import/importWizard.xul @@ -1,6 +1,7 @@ + diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index d100911bce..11c406e951 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -836,6 +836,7 @@ Zotero.Utilities.Internal = { * force links to open in new windows, pass with * .shiftKey = true. If not provided, the actual event will * be used instead. + * .callback - Function to call after launching URL */ updateHTMLInXUL: function (elem, options) { options = options || {}; @@ -846,6 +847,9 @@ Zotero.Utilities.Internal = { a.setAttribute('tooltiptext', href); a.onclick = function (event) { Zotero.launchURL(href); + if (options.callback) { + options.callback(); + } return false; }; } diff --git a/chrome/skin/default/zotero/zotero.css b/chrome/skin/default/zotero/zotero.css index 8b591d8ac9..7ba615b9b6 100644 --- a/chrome/skin/default/zotero/zotero.css +++ b/chrome/skin/default/zotero/zotero.css @@ -135,7 +135,14 @@ label.zotero-text-link { text-decoration: underline; border: 1px solid transparent; cursor: pointer; +} + +.text-link { + -moz-user-focus: normal; color: -moz-nativehyperlinktext; + text-decoration: underline; + border: 1px solid transparent; + cursor: pointer; } .zotero-clicky