diff --git a/tdx-enhanced.js b/tdx-enhanced.js index d9b3c2d..3a5c419 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -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/* @@ -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 @@ -225,6 +226,7 @@ if (header) { let ticketTitle = header.childNodes[0].textContent document.title = ticketTitle + left_append_ticket_number() } else { return }