Remove screenshot preview on link tooltip.

This commit is contained in:
Paulo Gustavo Veiga 2022-06-21 19:45:13 -07:00
parent a27cca027d
commit d4fcb859f0

View File

@ -41,44 +41,20 @@ class LinkIconTooltip extends FloatingTip {
static _buildContent(linkIcon) { static _buildContent(linkIcon) {
const url = linkIcon.getModel().getUrl(); const url = linkIcon.getModel().getUrl();
const linkText = `${url}`; const linkText = `${url}`;
const linkPreview = `https://free.pagepeeker.com/v2/thumbs.php?size=m&url=${url}`;
const result = $('<div></div>').css({ const result = $('<div></div>').css({
padding: '5px', padding: '5px',
width: '100%', width: '100%',
}); });
const text = $('<div id="linkPopoverUrl"></div>').text(linkText)
.css({
'white-space': 'pre-wrap',
'word-wrap': 'break-word',
});
result.append(text);
const imgContainer = $('<div></div>')
.css({
width: '100%',
textAlign: 'right',
'padding-bottom': '5px',
'padding-top': '5px',
});
const img = $('<img id="linkPopoverPreview">')
.prop('src', linkPreview)
.prop('img', url)
.prop('alt', url);
img.css('padding', '5px');
const link = $('<a id="linkPopoverAnchor"></a>').attr({ const link = $('<a id="linkPopoverAnchor"></a>').attr({
href: url, href: url,
alt: 'Open in new window ...', alt: 'Open in new window ...',
target: '_blank', target: '_blank',
}); });
link.append(img); link.append(linkText);
imgContainer.append(link); result.append(link);
result.append(imgContainer);
return result; return result;
} }
} }