Skip to content

Commit

Permalink
Merge pull request #1 from ejunga/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ejunga authored Oct 24, 2024
2 parents 0760f9f + 7240301 commit eafbc11
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tdx-enhanced.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name tdx-enhanced-student
// @namespace ecn
// @version 2024-09-03-01
// @version 2024-10-24-dev03
// @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 @@ -115,19 +115,20 @@

function left_append_ticket_number() {
try {
let form1 = document.querySelector("#Form1");
let ticketID = form1.attributes["action"].value.slice(-6);
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
let ticketID = urlParams.get('TicketID');
ticketID = (ticketID)? ticketID : '';
let title = document.querySelector("title");
title.innerText = ticketID + ' ' + title.innerText;
} catch (error) {
console.warn(error);
console.warn("Was unable to append the ticketID for this page to the title\nThis page may not point to a ticket, or the Form1 element may be missing");
console.warn("Was unable to append the ticketID for this page to the title\nThis page may not point to a ticket");
}
}

function applyStudentFormatting() {
highlightReportHeadings();
left_append_ticket_number();
}

let colorScheme
Expand Down Expand Up @@ -225,6 +226,7 @@
if (header) {
let ticketTitle = header.childNodes[0].textContent
document.title = ticketTitle
left_append_ticket_number()
} else {
return
}
Expand Down

0 comments on commit eafbc11

Please sign in to comment.