Documents: remove script tags and comments
This commit is contained in:
@ -5,41 +5,6 @@
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style-deliverynote.css" />
|
||||
<main>
|
||||
<h1>@Model.Title</h1>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const hidden = document.getElementsByClassName("hidden")[0];
|
||||
const table = document.getElementsByClassName("delivery")[0];
|
||||
const stats = document.getElementById("delivery-stats");
|
||||
const mm = px2mm(0, hidden.offsetTop + hidden.offsetHeight);
|
||||
const heightTable = px2mm(table.offsetTop, hidden.offsetTop + hidden.offsetHeight);
|
||||
|
||||
if (mm >= heightA4 - heightFooter) {
|
||||
if (heightTable + 10 >= heightMain) {
|
||||
// force page break in table
|
||||
const tblOff = px2mm(0, table.offsetTop);
|
||||
let last = null;
|
||||
for (const tr of table.getElementsByTagName("tr")) {
|
||||
if (!tr.classList.contains("main")) continue;
|
||||
const mm2 = tblOff + px2mm(0, tr.offsetTop);
|
||||
if (mm2 >= heightA4 - heightFooter) {
|
||||
last.classList.add("page-break");
|
||||
break;
|
||||
}
|
||||
last = tr;
|
||||
}
|
||||
} else {
|
||||
// force page break
|
||||
const hr = document.createElement("hr");
|
||||
hr.classList.add("page-break");
|
||||
table.before(hr);
|
||||
|
||||
const p = document.createElement("p");
|
||||
p.innerText = "Siehe nächste Seite."
|
||||
hr.before(p);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<table class="delivery">
|
||||
<colgroup>
|
||||
<col style="width: 10.00mm;"/>
|
||||
|
@ -7,13 +7,6 @@
|
||||
<title>@Model.Title</title>
|
||||
<meta name="author" value="@Model.Author"/>
|
||||
<meta charset="UTF-8"/>
|
||||
<script>
|
||||
const heightA4 = 297, widhtA4 = 210, heightFooter = 35, heightHeader = 25;
|
||||
const heightMain = heightA4 - heightFooter - heightHeader;
|
||||
function px2mm(px1, px2) {
|
||||
return (px2 - px1 + 1) * 2.54 / 96 * window.devicePixelRatio * 10;
|
||||
}
|
||||
</script>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style.css"/>
|
||||
<link rel="stylesheet" href="file:///@Raw(Model.DataPath)\resources\style-page.css"/>
|
||||
</head>
|
||||
|
@ -39,11 +39,9 @@ table.delivery tr.tight.first td {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
/* FIXME update version of WeasyPrint
|
||||
table.delivery tr.tight:has(+ tr:not(.tight)) td {
|
||||
padding-bottom: 0.5mm !important;
|
||||
padding-bottom: 0.5mm !important;
|
||||
}
|
||||
*/
|
||||
|
||||
table.delivery tr.sum {
|
||||
border-top: 0.5pt solid black;
|
||||
|
Reference in New Issue
Block a user