feat(frontend): add basic print functionality

Co-authored-by: Philip Molares <philip.molares@udo.edu>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
Erik Michelson 2024-11-01 20:21:16 +01:00 committed by Philip Molares
parent 8a1b29fddc
commit d7a3d0ff54
4 changed files with 21 additions and 0 deletions

View file

@ -17,6 +17,7 @@
@import "./github-markdown";
@import "./markdown-tweaks";
@import "./reveal";
@import "./print";
.text-black, body[data-bs-theme=dark] .text-black {
color: $black;

View file

@ -0,0 +1,10 @@
/*!
* SPDX-FileCopyrightText: 2024 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
@media print {
.heading-anchor {
display: none;
}
}

View file

@ -9,7 +9,11 @@
*/
export const printIframe = (): void => {
const iframe = document.getElementById('editor-renderer-iframe') as HTMLIFrameElement
<<<<<<< HEAD
if (!iframe) {
=======
if (!iframe || !iframe.contentWindow) {
>>>>>>> 279f6cd89 (feat(frontend): add basic print functionality)
return
}
iframe.contentWindow.print()

View file

@ -15,3 +15,9 @@
right: 0;
}
}
@media print {
.markdown-toc-sidebar-button {
display: none;
}
}