minor changes

Added highlight for warranty repairs
Updated 'update' buttons to use local image
Begin work on fancy notifications
This commit is contained in:
2021-10-02 13:42:56 -04:00
parent 83ac9e687c
commit 98054b28f1
5 changed files with 249 additions and 140 deletions
+29
View File
@@ -0,0 +1,29 @@
"use strict";
/*
TODO: insert a reset button into search form
TODO: style menubar and keep it sticky on the window
TODO: style/move the location scan to float with the RO
TODO: implement facebook-style notifications
*/
// Warranty Highlight
const isWarranty = document.getElementById("chkWarrantee");
isWarranty.addEventListener("change", updateBackground);
updateBackground();
function updateBackground() {
isWarranty.nextElementSibling.style.backgroundColor = isWarranty.checked
? "red"
: "transparent";
}
// Notification system
// https://portal.trgrepair.com/task_manager.asp?rnd=0.9996227368620352
const notifCountStr = document.getElementById("lblTask").innerText;
const notifCount = parseInt(notifCountStr.split(" ")[2]); // Total task count
const notifCountNew = parseInt(notifCountStr.split(" ")[5].slice(1)); // New task count
// Insert notification button
const insertButton = document.getElementById("exitBtn");
insertButton.innerHTML = `<div id='newBtn'><a href='#' id='notification-button'><span class='material-icons-outlined notification-icon'>notifications</span></a><span id='notification-badge'>${notifCountNew}</span></div>`;