Skip to content

Commit

Permalink
Merge pull request #2 from ECN/beta
Browse files Browse the repository at this point in the history
Merge beta with main
  • Loading branch information
mart2070 authored Sep 3, 2024
2 parents 590b768 + 05aac12 commit 6a08f78
Showing 1 changed file with 16 additions and 4 deletions.
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

0 comments on commit 6a08f78

Please sign in to comment.