diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 3982e1d..05d93f1 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -1,7 +1,7 @@ // ==UserScript== // @name tdx-enhanced // @namespace ecn -// @version 2024-08-28-01 +// @version 2024-09-03-01 // @description enhanced tdx coloring & formatting. follows system color scheme. // @author Purdue STEM IT - it@purdue.edu // @match https://service.purdue.edu/TDNext/* @@ -140,7 +140,7 @@ let calendars = document.querySelectorAll("#txtStartDate, #txtEndDate") //tasks for now, will add more as found if (calendars) { let originalFormat = "M/D/YYYY h:mm A"; - let newFormat = "YYYY-MM-DDThh:mm"; + let newFormat = "YYYY-MM-DDTHH:mm"; [...calendars].forEach(calendar=>{ let date = moment(calendar.value,originalFormat) let iso = date.format(newFormat) @@ -197,7 +197,7 @@ //handle button links - updates/tasks for now //update buttons - [...document.querySelectorAll("#btnUpdateTicket, #divUpdateFromActions>a")].forEach(button=>{ + [...document.querySelectorAll("#btnUpdateTicket, #divUpdateFromActions")].forEach(button=>{ handleLink("Update",button) }); @@ -844,7 +844,19 @@ let statusTime = statusLink.querySelector("#statusTime") let statusText = statusLink.querySelector("#statusText") - if (statusData && statusData.msg != "All Systems Operational") { + let operationalText = "All Systems Operational" + + if (statusData) { + if (statusData.msg.length==0) { + statusData.msg = operationalText + } + } else { + statusData = { + msg: operationalText + } + } + + if (!statusData.msg == operationalText) { statusIcon.classList = ("fa-solid fa-triangle-exclamation") } else { statusIcon.classList = ("fa-solid fa-check")