From cfeaaf141d576ca2034542080d63858730995a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aki=20=F0=9F=8C=B9?= Date: Fri, 12 Sep 2025 15:41:38 +0200 Subject: [PATCH 1/2] Hide menu on print --- css/print.css | 19 ++++++++++++++++++- js/sdoMap.js | 12 ++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/css/print.css b/css/print.css index 29e1561d..9c99e2f7 100644 --- a/css/print.css +++ b/css/print.css @@ -186,12 +186,29 @@ page-break-after: always; } +/* Styles for web users who wish to print (or "print") the document */ +#shortcuts-help, #menu-toggle, #menu-spacer, #menu-search, #menu-pins { display: none } +#menu-toc { display: block; overflow: visible } +#menu { + background: none; + border: none; + display: block; + height: initial; + max-width: 100%; + overflow: initial; + position: static; + transition: none; + width: initial; +} +.menu-pane-header { background: none; font-size: initial; } + html, body { background-color: initial; } body { - font-family: 'Arial Plus', Arial, Helvetica, sans-serif, "DejaVu Math TeX Gyre", Symbola, monospace; + display: block; + font-family: "Arial Plus", Arial, Helvetica, sans-serif, "DejaVu Math TeX Gyre", Symbola, monospace; font-size: 10pt; color: #000; line-height: 1.15; diff --git a/js/sdoMap.js b/js/sdoMap.js index 2e8d051e..22eb6579 100644 --- a/js/sdoMap.js +++ b/js/sdoMap.js @@ -80,3 +80,15 @@ document.addEventListener('DOMContentLoaded', () => { }), ); }); + +window.addEventListener('beforeprint', () => { + if (!document.body.classList.contains('oldtoc')) { + document.getElementById('metadata-block').before(document.getElementById('menu')); + } +}); + +window.addEventListener('afterprint', () => { + if (!document.body.classList.contains('oldtoc')) { + document.getElementById('spec-container').before(document.getElementById('menu')); + } +}); From a4aee0b6ae54dda9f4ab21c5342083c332a1e03d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aki=20=F0=9F=8C=B9?= Date: Fri, 12 Sep 2025 18:48:35 +0200 Subject: [PATCH 2/2] Update inline assets baseline --- .../generated-reference/assets-inline.html | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/test/baselines/generated-reference/assets-inline.html b/test/baselines/generated-reference/assets-inline.html index fba5ef80..b6e2ff2f 100644 --- a/test/baselines/generated-reference/assets-inline.html +++ b/test/baselines/generated-reference/assets-inline.html @@ -82,6 +82,18 @@ ); }); +window.addEventListener('beforeprint', () => { + if (!document.body.classList.contains('oldtoc')) { + document.getElementById('metadata-block').before(document.getElementById('menu')); + } +}); + +window.addEventListener('afterprint', () => { + if (!document.body.classList.contains('oldtoc')) { + document.getElementById('spec-container').before(document.getElementById('menu')); + } +}); + 'use strict'; function Search(menu) { this.menu = menu; @@ -3452,12 +3464,29 @@ page-break-after: always; } +/* Styles for web users who wish to print (or "print") the document */ +#shortcuts-help, #menu-toggle, #menu-spacer, #menu-search, #menu-pins { display: none } +#menu-toc { display: block; overflow: visible } +#menu { + background: none; + border: none; + display: block; + height: initial; + max-width: 100%; + overflow: initial; + position: static; + transition: none; + width: initial; +} +.menu-pane-header { background: none; font-size: initial; } + html, body { background-color: initial; } body { - font-family: 'Arial Plus', Arial, Helvetica, sans-serif, "DejaVu Math TeX Gyre", Symbola, monospace; + display: block; + font-family: "Arial Plus", Arial, Helvetica, sans-serif, "DejaVu Math TeX Gyre", Symbola, monospace; font-size: 10pt; color: #000; line-height: 1.15;