The Return of the Quick Prints!

This commit is contained in:
Skylar Grant 2026-03-19 16:14:54 -04:00
parent df96729396
commit 142d2b54e1
2 changed files with 62 additions and 1 deletions

View File

@ -227,6 +227,21 @@ function ewasteClistHandler() {
displayPdf(bUrl); displayPdf(bUrl);
} }
function quickPrintContactHandler() {
/** @type Array<LineItem> */
const lineArray = new Array();
lineArray.push(new LineItem('', standard, false));
const bUrl = generateFile(lineArray, true, true);
displayPdf(bUrl);
}
function quickPrintPasswordReqHandler() {
/** @type Array<LineItem> */
const lineArray = prepPasswordReqs();
const bUrl = generateFile(lineArray, true, true);
displayPdf(bUrl);
}
/** /**
* *
* @param {String} password * @param {String} password
@ -361,6 +376,16 @@ function prepEwasteClist(hostname) {
return lineArray; 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<LineItem>} lineArray * @param {Array<LineItem>} lineArray
@ -524,7 +549,20 @@ document.getElementById('ewasteClistBtn').addEventListener('click', () => {
alert(`An error occurred while generating the PDF: ${error.message}`); 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 // Function Calls

View File

@ -82,6 +82,29 @@
</button> </button>
</div> </div>
</div> </div>
<!-- Quick Prints -->
<div class="bg-white dark:bg-gray-800 p-5 rounded-lg shadow-lg">
<!-- Title -->
<h1 class="dark:text-gray-300 text-2xl font-bold text-center mb-4">Quick Prints</h1>
<!-- Buttons -->
<div class="flex flex-col space-y-4">
<!-- ITS Contact Info -->
<button type="submit"
id="quickPrintContactBtn"
style="background-color: #4b7839;"
class="dark:bg-indigo-600 dark:hover:bg-indigo-700 w-full text-white py-2 px-4 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50">
ITS Contact Info
</button>
<!-- Password Requirements -->
<button type="submit"
id="quickPrintPasswordReqBtn"
style="background-color: #4b7839;"
class="dark:bg-indigo-600 dark:hover:bg-indigo-700 w-full text-white py-2 px-4 rounded-md hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-opacity-50">
Password Requirements
</button>
</div>
</div>
</div> </div>
<!-- Right column --> <!-- Right column -->