Link trade fair names to source pages
This commit is contained in:
@@ -2272,33 +2272,50 @@ h1 {
|
||||
}
|
||||
|
||||
.bookmark-subpage__messe-link {
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: #0f4bb8;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 2px;
|
||||
padding: 0;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.bookmark-subpage__messe-link--static {
|
||||
color: #1f2937;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.bookmark-subpage__messe-links {
|
||||
display: inline-flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
row-gap: 2px;
|
||||
column-gap: 6px;
|
||||
}
|
||||
|
||||
.bookmark-subpage__messe-separator {
|
||||
color: #6b7280;
|
||||
margin: 0 2px;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.bookmark-subpage__messe-link:hover {
|
||||
color: #1d4ed8;
|
||||
}
|
||||
|
||||
.bookmark-subpage__messe-search {
|
||||
border: 1px solid #cbd5e1;
|
||||
background: #f8fafc;
|
||||
color: #1f2937;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
font-size: 12px;
|
||||
line-height: 1.2;
|
||||
border-radius: 999px;
|
||||
padding: 2px 8px;
|
||||
}
|
||||
|
||||
.bookmark-subpage__messe-search:hover {
|
||||
background: #e2e8f0;
|
||||
}
|
||||
|
||||
.bookmark-subpage__table th[data-column-key="thema"],
|
||||
.bookmark-subpage__table td[data-column="thema"],
|
||||
.bookmark-subpage__table th[data-column-key="notiz"],
|
||||
|
||||
@@ -1663,23 +1663,23 @@
|
||||
linksWrap.className = 'bookmark-subpage__messe-links';
|
||||
|
||||
bookmarkQueries.forEach((query, index) => {
|
||||
const button = document.createElement('button');
|
||||
button.type = 'button';
|
||||
button.className = 'bookmark-subpage__messe-link';
|
||||
button.textContent = query;
|
||||
button.title = getTradeFairHoverTitle(row);
|
||||
const handleOpenTradeFair = () => {
|
||||
const opened = openTradeFairSearch(row, query);
|
||||
if (opened > 0) {
|
||||
button.title = getTradeFairHoverTitle(row);
|
||||
render();
|
||||
}
|
||||
};
|
||||
button.addEventListener('click', handleOpenTradeFair);
|
||||
if (typeof window.bindMiddleMouseOpen === 'function') {
|
||||
window.bindMiddleMouseOpen(button, handleOpenTradeFair);
|
||||
const hasHomepage = typeof row.quelle_homepage === 'string' && row.quelle_homepage.trim();
|
||||
let linkLikeElement = null;
|
||||
if (hasHomepage) {
|
||||
const link = document.createElement('a');
|
||||
link.className = 'bookmark-subpage__messe-link';
|
||||
link.href = row.quelle_homepage;
|
||||
link.target = '_blank';
|
||||
link.rel = 'noopener';
|
||||
link.textContent = query;
|
||||
linkLikeElement = link;
|
||||
} else {
|
||||
const span = document.createElement('span');
|
||||
span.className = 'bookmark-subpage__messe-link bookmark-subpage__messe-link--static';
|
||||
span.textContent = query;
|
||||
linkLikeElement = span;
|
||||
}
|
||||
linksWrap.appendChild(button);
|
||||
linksWrap.appendChild(linkLikeElement);
|
||||
|
||||
if (index < bookmarkQueries.length - 1) {
|
||||
const separator = document.createElement('span');
|
||||
@@ -1689,6 +1689,24 @@
|
||||
}
|
||||
});
|
||||
|
||||
const searchButton = document.createElement('button');
|
||||
searchButton.type = 'button';
|
||||
searchButton.className = 'bookmark-subpage__messe-search';
|
||||
searchButton.textContent = 'Suche';
|
||||
searchButton.title = getTradeFairHoverTitle(row);
|
||||
const handleOpenTradeFair = () => {
|
||||
const opened = openTradeFairSearch(row);
|
||||
if (opened > 0) {
|
||||
searchButton.title = getTradeFairHoverTitle(row);
|
||||
render();
|
||||
}
|
||||
};
|
||||
searchButton.addEventListener('click', handleOpenTradeFair);
|
||||
if (typeof window.bindMiddleMouseOpen === 'function') {
|
||||
window.bindMiddleMouseOpen(searchButton, handleOpenTradeFair);
|
||||
}
|
||||
linksWrap.appendChild(searchButton);
|
||||
|
||||
td.appendChild(linksWrap);
|
||||
return td;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user