Skip to content

Merge beta with main #2

Merged
merged 4 commits into from
Sep 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions tdx-enhanced.js
Original file line number Diff line number Diff line change
@@ -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/*
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
});

Expand Down Expand Up @@ -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")
Expand Down