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