Skip to content

Dev #1

Merged
merged 5 commits into from
Oct 24, 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
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