Fix support link in encrypted Mendeley database message

It started being flattened at some point.
This commit is contained in:
Dan Stillman 2021-04-20 05:04:09 -04:00
parent 3032cc6a02
commit bb75fcd784
4 changed files with 21 additions and 10 deletions

View file

@ -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 <a href="${url}" class="text-link">How do I import a Mendeley library `
+ `into Zotero?</a> 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 <a href="${url}" class="text-link">How do I import a `
+ `Mendeley library into Zotero?</a> 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');
}

View file

@ -1,6 +1,7 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/zotero.css" type="text/css"?>
<?xml-stylesheet href="chrome://zotero/skin/importWizard.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">

View file

@ -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;
};
}

View file

@ -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