Skip to content

Commit

Permalink
Release 2025-07-31 (#25)
Browse files Browse the repository at this point in the history
* Add regex-report for regex matching highlights

* Add highlight toggle for block/text highlight

* Update to match reports in new dashboard

* Fix text highlighting for tdx update

* Add highlights.json

* Remove highlights.json

* Fix Responsibility highlights

* Remove debugging code

* Fixed gradient color on horizontal overflow

* Update tdx-enhanced.js

Change beta branch update/download URL and bump version

* Update tdx-enhanced.js

Bump version number

* bump version number

* bump version number

* Fix discolored time/expenses dashboard

* Fix "recently requested by" in ticket creation

* Fix new ticket page styles

* Various color corrections

* bumb version number

* Get ready for release
- [x] change download/update urls
- [x] set version number

* Fix 'CSS Support' highlighting
  • Loading branch information
ejunga authored Jul 31, 2025
1 parent 0200e8c commit 0886eaa
Showing 1 changed file with 110 additions and 17 deletions.
127 changes: 110 additions & 17 deletions tdx-enhanced.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name tdx-enhanced
// @namespace purdue-it
// @version 2025-07-21-01
// @version 2025-07-31-01
// @description enhanced tdx coloring & formatting. follows system color scheme.
// @author Purdue STEM IT - it@purdue.edu
// @match https://service.purdue.edu/TDWorkManagement*
Expand All @@ -12,8 +12,8 @@
// @match https://purdue.teamdynamixpreview.com/TDNext*
// @require https://momentjs.com/downloads/moment.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/tinycolor/1.6.0/tinycolor.min.js
// @downloadURL https://raw.github.itap.purdue.edu/ECN/tdx-userscript/main/tdx-enhanced.js
// @updateURL https://raw.github.itap.purdue.edu/ECN/tdx-userscript/main/tdx-enhanced.js
// @downloadURL https://raw.github.itap.purdue.edu/ECN/tdx-userscript/refs/heads/main/tdx-enhanced.js
// @updateURL https://raw.github.itap.purdue.edu/ECN/tdx-userscript/refs/heads/main/tdx-enhanced.js
// @grant GM_getResourceText
// @grant GM_addStyle
// @run-at document-end
Expand Down Expand Up @@ -826,9 +826,9 @@
//console.log("Parse item:",item)

//color queue names
if ('STEM Support' in item) {
let qCell = item["STEM Support"].cell
let qTxt = item["STEM Support"].txt.toLowerCase()
if ('CSS Support' in item) {
let qCell = item["CSS Support"].cell
let qTxt = item["CSS Support"].txt.toLowerCase()
if (qTxt in colorsByQueue) {
let q = colorsByQueue[qTxt]

Expand Down Expand Up @@ -912,8 +912,8 @@
}

//find internal users and highlight them
if ('ResponsibleFullName' in item) {
handleHighlight("person",item.ResponsibleFullName.txt,item.ResponsibleFullName.cell)
if ('Prim Resp' in item) {
handleHighlight("person",item['Prim Resp'].txt,item['Prim Resp'].cell)
} else if ('Responsibility' in item) {
handleHighlight("person",item.Responsibility.txt,item.Responsibility.cell)
}
Expand Down Expand Up @@ -1014,6 +1014,7 @@
}

function handleHighlight(type, txt, element) {
let behavior = settings('get','highlightBehavior')

var re
var style = null
Expand Down Expand Up @@ -1062,6 +1063,13 @@
}
}

if (type=="report" && customType=="report-regex") {
if ((new RegExp(customHighlight.value).exec(txt))) {
element.classList.add("reportTitle")
style = customHighlight.style
}
}

if (type=="person" && customType=="person") {
if (customHighlight.value==txt) {
element = createHighlightBubble(element)
Expand All @@ -1074,11 +1082,23 @@
//console.log("Apply custom highlight:",txt)

let link = element.querySelector("a")
if (re && link) {
let newTitle = re[1]
link.innerText = newTitle
//reset regex
re.lastIndex = 0
if (behavior==="block") {
if (re && link) {
let newTitle = re[1]
link.innerText = newTitle
//reset regex
re.lastIndex = 0
}
} else {
if (re && link) {
let text = link.innerText
link.innerText = ""
element = link.appendChild(document.createElement("span"))
element.innerText = text
element.style.lineHeight = "1.4"
//reset regex
re.lastIndex = 0
}
}

for (const [attr,val] of Object.entries(style)) {
Expand Down Expand Up @@ -1391,6 +1411,13 @@
<input type="radio" id="linkBehavior-tabs" name="linkBehavior" value="tabs">
<label for="linkBehavior-tabs">Tabs</label>
</div>
<div>
<h4>Highlight Behavior</h4>
<input type="radio" id="highlightBehavior-block" name="highlightBehavior" value="block">
<label for="highlightBehavior-block">Block</label><br>
<input type="radio" id="highlightBehavior-text" name="highlightBehavior" value="text">
<label for="highlightBehavior-block">Text</label><br>
</div>
</form>
</div>
Expand Down Expand Up @@ -1521,6 +1548,7 @@
data = {
colorMode: getColorMode(),
linkBehavior: "tabs",
highlightBehavior: "block",
customHighlights: [],
}
}
Expand Down Expand Up @@ -2645,6 +2673,33 @@ a:visited,
color: var(--col-400);
}
.tdworkmgmt.table-contents div.row > div > a {
color: var(--col-400);
}
.tdworkmgmt.table-striped > tbody > tr.tdx-grid__group-header > td, .tdworkmgmt.table-bordered > tbody > tr.tdx-grid__group-header > td {
background-color: var(--col-100);
}
.tdx-time-panel, .tdx-time-panel__heading {
color: var(--txt-1) !important;
background-color: var(--bg-1) !important;
border: 1px solid var(--border-0) !important;
}
.tdx-leftnav__badge {
color: var(--txt-1) !important;
background-color: var(--col-300) !important;
}
body .tdworkmgmt.table.table--vertical-lines > tbody > tr > td:not(:last-of-type) {
border-right: 1px solid var(--border-0);
}
.TDGroupingRow {
color: var(--txt-1);
}
a.disabledLink {
color: var(--txt-1) !important;
}
Expand Down Expand Up @@ -3167,6 +3222,10 @@ table.table {
color: var(--txt-2) !important;
}
.tdx-table-fade-right {
background: linear-gradient(to right,transparent,var(--bg-0)) !important;
}
thead, tbody, tfoot, tr, td, th {
border-color: var(--border-0);
}
Expand Down Expand Up @@ -3328,11 +3387,15 @@ button.k-pager-nav.k-button.k-button-flat.k-button-flat-base.k-icon-button.k-but
}
.k-window-titlebar {
background: var(--bg-0);
background-color: var(--bg-0) !important;
}
.k-window-content {
background-color: var(--bg-0) !important;
}
.k-window-title {
color: var(--col-500);
color: var(--col-500) !important;
}
.k-button .k-svg-i-window {
Expand Down Expand Up @@ -3392,6 +3455,11 @@ button.k-button.k-button-md.k-button-flat.k-button-flat-primary:hover {
background-color: var(--bg-5) !important;
}
.tdworkmgmt.table-header > div {
background-color: var(--bg-1);
color: var(--col-400);
}
/* Side Panels */
.tdx-right-side-panel {
Expand Down Expand Up @@ -3419,6 +3487,17 @@ button.k-button.k-button-md.k-button-flat.k-button-flat-primary:hover {
border-color: var(--col-500) !important;
}
.tdx-right-side-panel__home-button {
color: var(--col-400) !important;
border-color: var(--col-500) !important;
}
.tdx-right-side-panel__home-button:hover {
color: var(--col-200) !important;
border-color: var(--col-300) !important;
}
.tdx-leftnav-drag-handle {
background: linear-gradient(var(--col-400),var(--col-400)) no-repeat right/1px 10% !important;
}
Expand Down Expand Up @@ -3684,6 +3763,11 @@ body .tdworkmgmt.table>tbody>tr:not(.tdx-grid__group-header):not(.TDGridHeader):
color: var(--txt-1);
}
.list-group-item {
background-color: var(--bg-0);
border-color: var(--border-0);
}
/* Text Editor */
.cke_editable {
color: var(--txt-1);
Expand Down Expand Up @@ -3852,6 +3936,14 @@ div.profile-image.red-bg, div.profile-image.green-bg, div.profile-image.red-bg,
color: var(--col-400) !important;
}
.tdx-hover-darken {
color: var(--col-400);
}
.tdx-hover-darken:hover {
color: var(--col-300);
}
.form-group>a, .form-group>.checkbox>a, .disp-group>a, .form-group>.control-label>a, .checkbox>label>a {
color: var(--col-400) !important;
}
Expand All @@ -3876,7 +3968,8 @@ div.profile-image.red-bg, div.profile-image.green-bg, div.profile-image.red-bg,
.tdx-dropdown__menu-icon,
.tdx-dropdown--headline:after,
.tdx-dropdown:after,
.tdx-icon--search
.tdx-icon--search,
.k-icon
{
filter: brightness(0) invert(var(--filter-invert)) sepia(var(--filter-sepia)) saturate(var(--filter-saturate)) hue-rotate(var(--filter-hue-rotate)) brightness(var(--filter-brightness)) contrast(var(--filter-contrast));
}
Expand Down Expand Up @@ -3914,4 +4007,4 @@ div.select2-container-multi .select2-choices .select2-search-choice>.select2-sea
setCssFilters()
parseOtherElements()

})();
})();

0 comments on commit 0886eaa

Please sign in to comment.