Fix support link in encrypted Mendeley database message
It started being flattened at some point.
This commit is contained in:
parent
3032cc6a02
commit
bb75fcd784
4 changed files with 21 additions and 10 deletions
|
@ -252,13 +252,12 @@ var Zotero_Import_Wizard = {
|
||||||
catch (e) {
|
catch (e) {
|
||||||
if (e.message == 'Encrypted Mendeley database') {
|
if (e.message == 'Encrypted Mendeley database') {
|
||||||
let url = 'https://www.zotero.org/support/kb/mendeley_import';
|
let url = 'https://www.zotero.org/support/kb/mendeley_import';
|
||||||
this._onDone(
|
let HTML_NS = 'http://www.w3.org/1999/xhtml'
|
||||||
Zotero.getString('general.error'),
|
let elem = document.createElementNS(HTML_NS, 'div');
|
||||||
// TODO: Localize
|
elem.innerHTML = `The selected Mendeley database cannot be read, likely because it `
|
||||||
`The selected Mendeley database cannot be read, likely because it is encrypted. `
|
+ `is encrypted. See <a href="${url}" class="text-link">How do I import a `
|
||||||
+ `See <a href="${url}" class="text-link">How do I import a Mendeley library `
|
+ `Mendeley library into Zotero?</a> for more information.`
|
||||||
+ `into Zotero?</a> for more information.`
|
this._onDone(Zotero.getString('general.error'), elem);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this._onDone(
|
this._onDone(
|
||||||
|
@ -338,9 +337,9 @@ var Zotero_Import_Wizard = {
|
||||||
var xulElem = document.getElementById('result-description');
|
var xulElem = document.getElementById('result-description');
|
||||||
var htmlElem = document.getElementById('result-description-html');
|
var htmlElem = document.getElementById('result-description-html');
|
||||||
|
|
||||||
if (description.includes('href')) {
|
if (description instanceof HTMLElement) {
|
||||||
htmlElem.innerHTML = description;
|
htmlElem.appendChild(description);
|
||||||
Zotero.Utilities.Internal.updateHTMLInXUL(htmlElem);
|
Zotero.Utilities.Internal.updateHTMLInXUL(htmlElem, { callback: () => window.close() });
|
||||||
xulElem.hidden = true;
|
xulElem.hidden = true;
|
||||||
htmlElem.setAttribute('display', 'block');
|
htmlElem.setAttribute('display', 'block');
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
|
<?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"?>
|
<?xml-stylesheet href="chrome://zotero/skin/importWizard.css" type="text/css"?>
|
||||||
|
|
||||||
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
<!DOCTYPE window SYSTEM "chrome://zotero/locale/zotero.dtd">
|
||||||
|
|
|
@ -836,6 +836,7 @@ Zotero.Utilities.Internal = {
|
||||||
* force links to open in new windows, pass with
|
* force links to open in new windows, pass with
|
||||||
* .shiftKey = true. If not provided, the actual event will
|
* .shiftKey = true. If not provided, the actual event will
|
||||||
* be used instead.
|
* be used instead.
|
||||||
|
* .callback - Function to call after launching URL
|
||||||
*/
|
*/
|
||||||
updateHTMLInXUL: function (elem, options) {
|
updateHTMLInXUL: function (elem, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
|
@ -846,6 +847,9 @@ Zotero.Utilities.Internal = {
|
||||||
a.setAttribute('tooltiptext', href);
|
a.setAttribute('tooltiptext', href);
|
||||||
a.onclick = function (event) {
|
a.onclick = function (event) {
|
||||||
Zotero.launchURL(href);
|
Zotero.launchURL(href);
|
||||||
|
if (options.callback) {
|
||||||
|
options.callback();
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,14 @@ label.zotero-text-link {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-link {
|
||||||
|
-moz-user-focus: normal;
|
||||||
color: -moz-nativehyperlinktext;
|
color: -moz-nativehyperlinktext;
|
||||||
|
text-decoration: underline;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.zotero-clicky
|
.zotero-clicky
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue