diff --git a/src/assets/ITThermal.js b/src/assets/ITThermal.js index 81b9be3..c957baa 100644 --- a/src/assets/ITThermal.js +++ b/src/assets/ITThermal.js @@ -1,7 +1,7 @@ /* ITS Thermal Receipt Printer * Developed by Skylar Grant for MCCS ITS */ -const version = "1.2.9"; +const version = "1.2.10 dev"; // ############################################################# // Variables // ############################################################# @@ -199,6 +199,14 @@ function imagingClistLabsHandler() { displayPdf(bUrl); } +function ewasteClistHandler() { + // Grab the User or Host Name value + const imagingHostname = document.getElementById('imagingClistName').value; + const lineArray = prepEwasteClist(imagingHostname); + const bUrl = generateFile(lineArray, false, false); + displayPdf(bUrl); +} + /** * * @param {String} password @@ -312,6 +320,27 @@ function prepImagingClistLabs(hostname) { return lineArray; } +function prepEwasteClist(hostname) { + const s = strings.ewasteClist; + const now = new Date(); + const formattedDate = `Date: ${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')}-${now.getFullYear()}`; + /** @type Array */ + const lineArray = new Array() + lineArray.push(new LineItem(s.title.text, s.title.fontInfo, false)); + lineArray.push(new LineItem(s.sol.text, s.sol.fontInfo, false)); + lineArray.push(new LineItem(formattedDate, standard, false)); + + lineArray.push(new LineItem(`User/Hostname:`, standard, false)); + lineArray.push(new LineItem(hostname, standardBold, true)); + + for (let i = 0; i < s.steps.length; i++) { + const text = s.steps[i]; + const newText = `____ ${text}`; + lineArray.push(new LineItem(newText, standard, false)); + } + return lineArray; +} + /** * * @param {Array} lineArray @@ -468,6 +497,14 @@ document.getElementById('imagingClistLabsBtn').addEventListener('click', () => { alert(`An error occurred while generating the PDF: ${error.message}`); } }); +document.getElementById('ewasteClistBtn').addEventListener('click', () => { + try { + ewasteClistHandler(); + } 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 ab422f2..480b674 100644 --- a/src/index.html +++ b/src/index.html @@ -157,7 +157,7 @@
-

Imaging Checklists

+

Asset Management

@@ -182,6 +182,16 @@ Labs Imaging Checklist
+ + +
+ +