Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/javascripts/extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
const focusedElement = document.activeElement;
const isMainContent = focusedElement && focusedElement.id === 'main-content';
const isSkipLink = focusedElement && focusedElement.classList.contains('skip-link');

if (!isMainContent && !isSkipLink) {
// Reset focus to document body to ensure skiplink is first tab stop
document.body.setAttribute('tabindex', '-1');
Expand Down Expand Up @@ -123,34 +123,34 @@
// Function to setup custom tooltips
function setupCustomTooltip(element) {
let originalTitle = element.getAttribute('title');

// Store original title in data attribute for CSS to use
element.setAttribute('data-tooltip', originalTitle);

// Remove title immediately to prevent native tooltip
element.removeAttribute('title');
}

// Function to fix search result semantic structure
// Function to fix search result semantic structure
// Converts h1 tags in search results to h2 for proper semantic hierarchy
function fixSearchResultSemantics() {
// Find all search result h1 tags within the search output area
const searchResults = document.querySelectorAll('.md-search-result h1, .md-search-result__title');

searchResults.forEach(function(h1Element) {
// Only convert h1 tags, not other elements with md-search-result__title class
if (h1Element.tagName.toLowerCase() === 'h1') {
// Create a new h2 element
const h2Element = document.createElement('h2');

// Copy all attributes from h1 to h2
Array.from(h1Element.attributes).forEach(function(attr) {
h2Element.setAttribute(attr.name, attr.value);
});

// Copy all content from h1 to h2
h2Element.innerHTML = h1Element.innerHTML;

// Replace h1 with h2 in the DOM
h1Element.parentNode.replaceChild(h2Element, h1Element);
}
Expand All @@ -166,7 +166,7 @@
const parent = mark.parentNode;
const textNode = document.createTextNode(mark.textContent);
parent.replaceChild(textNode, mark);

// Normalize the parent to merge adjacent text nodes
parent.normalize();
});
Expand Down
20 changes: 10 additions & 10 deletions docs/javascripts/hamburger-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ function controlHamburgerMenu() {
// Even more aggressive selector search
const selectors = [
'.md-header__button[for="__drawer"]',
'.md-header__button.md-icon--menu',
'.md-header__button.md-icon--menu',
'.md-nav__button',
'button[for="__drawer"]',
'[data-md-component="navigation"]',
'.md-header__button[type="button"]',
'.md-header button'
];

const hamburgers = document.querySelectorAll(selectors.join(', '));

hamburgers.forEach(hamburger => {
if (window.innerWidth > 800) {
// Nuclear option - remove all possible CSS
Expand All @@ -30,25 +30,25 @@ function controlHamburgerMenu() {
console.log('Hamburger restored:', hamburger.className);
}
});

console.log('Screen width check:', window.innerWidth, 'Found hamburgers:', hamburgers.length);
}

// Initial check
findAndHideHamburger();

// Listen for resize events
window.addEventListener('resize', findAndHideHamburger);

// Force check every 100ms to override any dynamic changes from Material Insiders
const forceInterval = setInterval(findAndHideHamburger, 100);

// Also watch for DOM mutations
if (typeof MutationObserver !== 'undefined') {
const observer = new MutationObserver(findAndHideHamburger);
observer.observe(document.body, { childList: true, subtree: true });
}

// Clear interval after 10 seconds to avoid performance impact
setTimeout(() => clearInterval(forceInterval), 10000);
}
Expand All @@ -64,4 +64,4 @@ if (document.readyState === 'loading') {
window.addEventListener('pageshow', controlHamburgerMenu);

// Run again after a delay to catch any late-loading elements
setTimeout(controlHamburgerMenu, 1000);
setTimeout(controlHamburgerMenu, 1000);
16 changes: 8 additions & 8 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -121,27 +121,27 @@ td {
table, thead, tbody, th, td, tr {
display: block !important;
}

thead tr {
position: absolute !important;
top: -9999px !important;
left: -9999px !important;
}

tr {
border: 1px solid #B9C7D5 !important;
margin-bottom: 10px !important;
padding: 10px !important;
border-radius: 4px;
}

td {
border: none !important;
position: relative !important;
padding-left: 50% !important;
min-width: auto !important;
}

td:before {
content: attr(data-label) ": " !important;
position: absolute !important;
Expand Down Expand Up @@ -762,7 +762,7 @@ font-size: 0.875rem !important;
.responsive-grid-2 {
grid-template-columns: 1fr !important;
}

.responsive-grid-3 {
grid-template-columns: 1fr !important;
}
Expand All @@ -776,20 +776,20 @@ font-size: 0.875rem !important;

/* WCAG AA: Make images scalable for 320px viewport */
@media (max-width: 320px) {
img,
img,
.block-image,
.md-header__button.md-logo img {
max-width: 100% !important;
height: auto !important;
width: auto !important;
}

/* Ensure grid cards stack properly on very small screens */
.grid.cards {
grid-template-columns: 1fr !important;
gap: 8px !important;
}

/* Reduce padding for very small screens */
.float-child,
.float-child-white {
Expand Down
3 changes: 1 addition & 2 deletions docs/stylesheets/navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ abbr[data-tooltip]:hover {
position: static !important;
z-index: auto !important;
}

.md-main {
margin-top: 0 !important;
}
Expand Down Expand Up @@ -720,4 +720,3 @@ abbr[data-tooltip]:hover {
display: none !important;
}
}

11 changes: 8 additions & 3 deletions src/overrides/hooks/lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,14 +450,17 @@ def generate_filters(
has_search = filter_options.get("search", True)
has_column_filters = len(column_filters_html) > 0
has_ai_act_labels = filter_options.get("ai-act-labels", False)
has_export = should_show_export(current_file) and content_type in ["vereisten", "maatregelen"]
has_export = should_show_export(current_file) and content_type in [
"vereisten",
"maatregelen",
]
has_any_filters = has_search or has_column_filters or has_ai_act_labels

# Only add wrapper div if there are actually filters to show
if has_any_filters:
wrapper_class = "filter-wrapper"
filters.append(
f'<div class="{wrapper_class}" style="background-color: #e6f3fb; padding: 16px; border-radius: 8px; margin-bottom: 16px;">'
f'<div class="{wrapper_class}" style="background-color: #e6f3fb; padding: 16px; border-radius: 8px; margin-bottom: 16px;">'
)

filters.append('<form autocomplete="off" onsubmit="return false;">')
Expand Down Expand Up @@ -487,7 +490,9 @@ def generate_filters(

# AI-act labels info as separate div below the filter container
if has_ai_act_labels:
filters.append("<div id='ai-act-labels-info' style='margin-top: 12px;'>")
filters.append(
"<div id='ai-act-labels-info' style='margin-top: 12px;'>"
)
filters.append(
"<div id='ai-act-info-no-labels'><strong><a href='#' onclick=\"showModal(event, 'ai-act-labels');\">Kies je AI-verordeningprofiel</a> of <a href='#' onclick=\"showModal(event, 'beslishulp AI-verordening');\">gebruik de beslishulp AI-verordening</a> om vereisten te filteren.</strong></div>"
)
Expand Down
2 changes: 1 addition & 1 deletion src/overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
{% block content %}{{ super() }}{% endblock %}
</div>
</main>
{% endblock %}
{% endblock %}
19 changes: 11 additions & 8 deletions src/overrides/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@
</div>
<!-- Column 1: Internal Links -->
<div class="md-footer__column">
<a href="{{ base_url }}/over-het-algoritmekader/CONTRIBUTING/#ik-heb-een-vraag">Contact</a>
<a href="https://algoritmes.overheid.nl/nl/footer/contact">Contact</a>
<a href="{{ base_url }}/over-het-algoritmekader/over-het-algoritmekader">Over het Algoritmekader</a>
<a href="{{ base_url }}/over-het-algoritmekader/veelgestelde-vragen">Veelgestelde vragen</a>
<a href="{{ base_url }}/over-het-algoritmekader/sitemap">Sitemap</a>
<a href="https://algoritmes.overheid.nl/nl/footer/over">Over het Algoritmeregister</a>
<a href="https://algoritmes.overheid.nl/nl/footer/archief">Archief</a>
<a href="https://algoritmes.overheid.nl/nl/footer/registreer-je-algoritme">Registreer je algoritmes</a>
<a href="https://algoritmes.overheid.nl/nl/footer/vragen">Veelgestelde vragen</a>
<a href="https://algoritmes.overheid.nl/nl/footer/sitemap">Sitemap</a>
</div>
<!-- Column 2: Policy Pages -->
<div class="md-footer__column">
<a href="{{ base_url }}/over-het-algoritmekader/privacy">Privacy</a>
<a href="{{ base_url }}/over-het-algoritmekader/cookies">Cookies</a>
<a href="{{ base_url }}/over-het-algoritmekader/copyright">Copyright</a>
<a href="{{ base_url }}/over-het-algoritmekader/toegankelijkheid">Toegankelijkheid</a>
<a href="{{ base_url }}/over-het-algoritmekader/kwetsbaarheid-melden">Kwetsbaarheid melden</a>
<a href="https://algoritmes.overheid.nl/nl/footer/privacyverklaring">Privacy</a>
<a href="https://algoritmes.overheid.nl/nl/footer/cookies">Cookies</a>
<a href="https://algoritmes.overheid.nl/nl/footer/copyright">Copyright</a>
<a href="https://algoritmes.overheid.nl/nl/footer/toegankelijkheid">Toegankelijkheid</a>
<a href="https://algoritmes.overheid.nl/nl/footer/kwetsbaarheid-melden">Kwetsbaarheid melden</a>
<a class="is-external-link-icon" href="https://github.com/MinBZK/Algoritmekader/releases" target="_blank"><span class="visually-hidden">Link naar externe pagina</span>Releasenotes op Github</a>
</div>
<!-- Column 3: External Government Links -->
Expand Down