1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-01 23:29:38 +02:00

Merge pull request #121 from google/show-speaker-notes-on-print

Show expanded speaker notes on print page
This commit is contained in:
Fabian Bornhofen 2023-01-11 18:25:04 +01:00 committed by GitHub
commit 4ca2469274
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,6 +115,18 @@
summary.append(popOut);
}
// Create headers on the print page.
function setupPrintPage() {
for (const notes of document.querySelectorAll("details")) {
notes.open = true;
let summary = document.createElement("summary");
notes.insertBefore(summary, notes.firstChild);
let h4 = document.createElement("h4");
h4.append("Speaker Notes");
summary.append(h4);
}
}
// Create controls for a speaker note window.
function setupSpeakerNotes() {
// Show the notes inline again when the window is closed.
@ -215,6 +227,11 @@
markDefunct();
break;
default:
if (window.location.pathname == "/print.html") {
setupPrintPage();
return;
}
// We are on a regular page. We force the state to "inline-open" if this
// looks like a direct link to the speaker notes.
if (window.location.hash == "#speaker-notes") {