From 142d2b54e1ce960291e2c2e7288462654122358c Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Thu, 19 Mar 2026 16:14:54 -0400 Subject: [PATCH] The Return of the Quick Prints! --- src/assets/ITThermal.js | 40 +++++++++++++++++++++++++++++++++++++++- src/index.html | 23 +++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/src/assets/ITThermal.js b/src/assets/ITThermal.js index 30a9e1c..dbf9fdf 100644 --- a/src/assets/ITThermal.js +++ b/src/assets/ITThermal.js @@ -227,6 +227,21 @@ function ewasteClistHandler() { displayPdf(bUrl); } +function quickPrintContactHandler() { + /** @type Array */ + const lineArray = new Array(); + lineArray.push(new LineItem('', standard, false)); + const bUrl = generateFile(lineArray, true, true); + displayPdf(bUrl); +} + +function quickPrintPasswordReqHandler() { + /** @type Array */ + const lineArray = prepPasswordReqs(); + const bUrl = generateFile(lineArray, true, true); + displayPdf(bUrl); +} + /** * * @param {String} password @@ -361,6 +376,16 @@ function prepEwasteClist(hostname) { return lineArray; } +function prepPasswordReqs() { + const s = strings.tempPassword; + const lineArray = []; + + for (const reqLine of s.pwRequirements) { + lineArray.push(new LineItem(reqLine.text, reqLine.fontInfo, false)); + } + return lineArray; +}; + /** * * @param {Array} lineArray @@ -524,7 +549,20 @@ document.getElementById('ewasteClistBtn').addEventListener('click', () => { alert(`An error occurred while generating the PDF: ${error.message}`); } }); - +document.getElementById('quickPrintContactBtn').addEventListener('click', () => { + try { + quickPrintContactHandler(); + } catch (error) { + alert(`An error occurred while generating the PDF: ${error.message}`); + } +}); +document.getElementById('quickPrintPasswordReqBtn').addEventListener('click', () => { + try { + quickPrintPasswordReqHandler(); + } catch (error) { + alert(`An error occurred while generating the PDF: ${error.message}`); + } +}); // ############################################################# // Function Calls diff --git a/src/index.html b/src/index.html index 480b674..000abc1 100644 --- a/src/index.html +++ b/src/index.html @@ -82,6 +82,29 @@ + + +
+ +

Quick Prints

+ +
+ + + + +
+