Skip to content

Commit

Permalink
Prepend Ticket Number to page title
Browse files Browse the repository at this point in the history
  • Loading branch information
ejunga committed Oct 24, 2024
1 parent 0760f9f commit 7a74442
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 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-dev01
// @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,13 +115,14 @@

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);
const ticketID = urlParams.get('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");
}
}

Expand Down Expand Up @@ -1068,6 +1069,7 @@
parseTicket()
checkPath()
applyStudentFormatting()
left_append_ticket_number()

addEventListener("storage", (event) => {
//console.log("Storage event:",event)
Expand Down

0 comments on commit 7a74442

Please sign in to comment.