Compare commits
No commits in common. "e4d78745af4f2fbe3bbe36816c1bdb16bb5bda77" and "e181276de907f7dccd1823a1458c36764a21e317" have entirely different histories.
e4d78745af
...
e181276de9
|
@ -26,12 +26,8 @@ div>label {
|
|||
<link href="https://unpkg.com/tabulator-tables/dist/css/tabulator.min.css" rel="stylesheet">
|
||||
<script src="https://unpkg.com/browser-cjs/require.min.js"></script>
|
||||
<script src="https://unpkg.com/tabulator-tables/dist/js/tabulator.min.js"></script>
|
||||
<!--
|
||||
for pdf saving
|
||||
<script src="https://unpkg.com/jspdf/dist/jspdf.umd.min.js"></script>
|
||||
<script src="https://unpkg.com/dompurify/dist/purify.min.js"></script>
|
||||
<script src="https://unpkg.com/html2canvas-pro/dist/html2canvas-pro.min.js"></script>
|
||||
-->
|
||||
<script src="https://unpkg.com/jspdf-autotable/dist/jspdf.plugin.autotable.min.js"></script>
|
||||
<script>
|
||||
// require in browser-cjs
|
||||
// eslint-disable-next-line no-undef
|
||||
|
@ -234,45 +230,7 @@ div>label {
|
|||
],
|
||||
selectableRows: true,
|
||||
data: tdata,
|
||||
autoColumns: "full",
|
||||
downloadEncoder: function(fileContents, mimeType){
|
||||
// add header and footer for a complete html file
|
||||
let header = "<!doctype html><html><head><style>";
|
||||
for (let i = 0; i < document.styleSheets.length; i++) {
|
||||
let css = document.styleSheets[i];
|
||||
if (css.ownerNode.id === "link_css") {
|
||||
for (let j = 0; j < css.cssRules.length; j++) {
|
||||
header += css.cssRules[j].cssText + "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
header += "</style></head><body>";
|
||||
let footer = "</body></html>";
|
||||
|
||||
// add footer for horizontal line
|
||||
let t = document.createElement("div");
|
||||
t.insertAdjacentHTML("beforeend", fileContents);
|
||||
t.firstChild.insertAdjacentHTML("beforeend", "<tfoot><tr><td colspan=\"100%\"></td></tr></tfoot>");
|
||||
fileContents = t.innerHTML;
|
||||
|
||||
fileContents = fileContents.replaceAll(">undefined<", "><");
|
||||
|
||||
// also save as pdf
|
||||
// currently scaling is wrong, no idea how to fix
|
||||
//const doc = new jspdf.jsPDF("p", "mm", "a4");
|
||||
//doc.html(header + fileContents + footer, {
|
||||
// callback: (doc) => {
|
||||
// doc.save();
|
||||
// },
|
||||
// filename: path.basename(document.getElementById("base_input").value, ".yml") + ".pdf",
|
||||
// autoPaging: "text",
|
||||
// html2canvas: {
|
||||
// scale: 0.5,
|
||||
// },
|
||||
//});
|
||||
return new Blob([header, fileContents, footer], {type:mimeType});
|
||||
},
|
||||
|
||||
autoColumns:"full",
|
||||
// add filter for all columns
|
||||
autoColumnsDefinitions: function(definitions){
|
||||
definitions.forEach((column) => {
|
||||
|
@ -332,17 +290,15 @@ div>label {
|
|||
});
|
||||
|
||||
document.getElementById("download").addEventListener("click", () => {
|
||||
let download_range = "active";
|
||||
let download_range = "all";
|
||||
if (table.getSelectedRows().length > 0) {
|
||||
download_range = "selected";
|
||||
}
|
||||
|
||||
table.downloadToTab(
|
||||
"html",
|
||||
path.basename(document.getElementById("base_input").value, ".yml") + ".html",
|
||||
{ },
|
||||
download_range,
|
||||
);
|
||||
table.download(
|
||||
"pdf",
|
||||
path.basename(document.getElementById("base_input").value, ".yml") + ".pdf",
|
||||
{ orientation:"portrait" },
|
||||
download_range);
|
||||
});
|
||||
|
||||
table.on("tableBuilt", () => {
|
||||
|
|
27
standard.css
27
standard.css
|
@ -16,7 +16,7 @@
|
|||
.cell-bandwidth-unrestricted {
|
||||
background-color: color-mix(in srgb, Gray 50%, transparent);
|
||||
}
|
||||
.row-bandwidth-undefined > .tabulator-cell, tr:has(.cell-bandwidth-undefined) > td {
|
||||
.row-bandwidth-undefined>.tabulator-cell {
|
||||
background-color: color-mix(in srgb, Red 50%, transparent);
|
||||
}
|
||||
.cell-frequency:not(.cell-frequency-is_range) {
|
||||
|
@ -25,28 +25,3 @@
|
|||
[class*='contest_preferred'] {
|
||||
background-color: color-mix(in srgb, Gold 30%, transparent);
|
||||
}
|
||||
|
||||
/* table settings for printing */
|
||||
:root {
|
||||
--border: 0.5px solid;
|
||||
}
|
||||
table {
|
||||
border-spacing: 0;
|
||||
}
|
||||
th, td {
|
||||
border-left: var(--border);
|
||||
}
|
||||
th:last-child, td:last-child {
|
||||
border-right: var(--border);
|
||||
}
|
||||
th {
|
||||
border-top: var(--border);
|
||||
border-bottom: var(--border);
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background-color: color-mix(in srgb, Gray 10%, transparent);;
|
||||
}
|
||||
tfoot > tr > td {
|
||||
padding-top: 0;
|
||||
border-bottom: var(--border);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue