Skip to content
Open
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
19 changes: 18 additions & 1 deletion css/print.css
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,29 @@
page-break-after: always;
}

/* Styles for web users who wish to print (or "print") the document */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* Styles for web users who wish to print (or "print") the document */
/* Styles for web users who wish to print (or print-to-pdf) the document */

I think this is what was meant by the scare quotes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol they weren't meant to be scare quotes, it was meant to communicate that using the "print" function may not be used for the purpose of putting ink (or toner) to paper

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me, that means print-to-PDF, and it'd be easier for me to understand by calling it that. If there's other "print" functions, we could list them as examples too. It'd give me something concrete to think about when reading this.

#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;
Expand Down
12 changes: 12 additions & 0 deletions js/sdoMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
});
31 changes: 30 additions & 1 deletion test/baselines/generated-reference/assets-inline.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down