From 627eee569248c669be3145101036775f0c0bf518 Mon Sep 17 00:00:00 2001 From: ejunga Date: Thu, 13 Nov 2025 09:52:29 -0500 Subject: [PATCH 01/10] correct beta download/update url --- tdx-enhanced.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 86ebd62..e51b4f8 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -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/refs/heads/main/tdx-enhanced.js -// @updateURL https://raw.github.itap.purdue.edu/ECN/tdx-userscript/refs/heads/main/tdx-enhanced.js +// @downloadURL https://raw.github.itap.purdue.edu/ECN/tdx-userscript/refs/heads/beta/tdx-enhanced.js +// @updateURL https://raw.github.itap.purdue.edu/ECN/tdx-userscript/refs/heads/beta/tdx-enhanced.js // @grant GM_getResourceText // @grant GM_addStyle // @run-at document-end From 50be3baf897180a6ad48b053c1a7ae98abce401a Mon Sep 17 00:00:00 2001 From: ejunga Date: Tue, 18 Nov 2025 07:53:17 -0500 Subject: [PATCH 02/10] correct colors in ticket comment this issue was previously fixed in the task view; however, it seems that the ticket and task views utilize differing css classes for identically functioning elements --- tdx-enhanced.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tdx-enhanced.js b/tdx-enhanced.js index e51b4f8..8c20fb9 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -2379,11 +2379,12 @@ div.WhiteOut { } .ms-drop { - background-color: var(--bg-0); + background-color: var(--bg-0) !important; border-color: var(--border-0); } button.ms-choice { + background-color: var(--bg-0) !important; border-color: var(--border-0) !important; } From 21d776a1e4a7cbc0040a52516648a7147e584115 Mon Sep 17 00:00:00 2001 From: ejunga Date: Wed, 19 Nov 2025 09:22:53 -0500 Subject: [PATCH 03/10] Force contrastive color for description text --- tdx-enhanced.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 014219e..9b2e327 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -3989,6 +3989,10 @@ div.profile-image.red-bg, div.profile-image.green-bg, div.profile-image.red-bg, color: var(--col-400) !important; } +.ticket-desc *:not(a), .ticket-desc *:not(a) { + color: var(--txt-1) !important; +} + .tdx-view-ticket-summary #divSummaryHeading a { color: var(--col-400); } From 0d2dfd94e6f0ac3357e3d54e719f71276098521d Mon Sep 17 00:00:00 2001 From: ejunga Date: Tue, 25 Nov 2025 09:24:29 -0500 Subject: [PATCH 04/10] Fix for short descriptions --- tdx-enhanced.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 9b2e327..837a37e 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -3989,7 +3989,7 @@ div.profile-image.red-bg, div.profile-image.green-bg, div.profile-image.red-bg, color: var(--col-400) !important; } -.ticket-desc *:not(a), .ticket-desc *:not(a) { +.wrap-text *:not(a), .moreToggle *:not(a), .lessToggle *:not(a) { color: var(--txt-1) !important; } From c6b2e5d500b3777e20d7b94aac0416e658e72e87 Mon Sep 17 00:00:00 2001 From: ejunga Date: Tue, 25 Nov 2025 09:32:29 -0500 Subject: [PATCH 05/10] bump version number --- tdx-enhanced.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 837a37e..7c08171 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -1,7 +1,7 @@ // ==UserScript== // @name tdx-enhanced // @namespace purdue-it -// @version 2025-11-18-00 +// @version 2025-11-25-00 // @description enhanced tdx coloring & formatting. follows system color scheme. // @author Purdue STEM IT - it@purdue.edu // @match https://service.purdue.edu/TDWorkManagement* From f6a54dc8a14a6407badc434ec0791bd35fd3e005 Mon Sep 17 00:00:00 2001 From: ejunga Date: Wed, 3 Dec 2025 10:52:42 -0500 Subject: [PATCH 06/10] Fix descriptions and editors --- tdx-enhanced.js | 55 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 14 deletions(-) diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 7c08171..5166443 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -19,6 +19,8 @@ // @run-at document-end // ==/UserScript== + + (function() { 'use strict'; @@ -707,6 +709,11 @@ } }) + //force contrastive colors in descriptions with inline styles + document.querySelectorAll("div.moreToggle *:not(a), div.lessToggle *:not(a), div.wrap-text *:not(a)").forEach(textBlock=>{ + textBlock.style.color = "var(--txt-1)" + }) + let desktopLayout = settings('get','layout') let desktop = document.querySelector("#divContent") if (desktop && desktopLayout) { @@ -1171,7 +1178,6 @@ let observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { let t = mutation.target - //console.error("Mutation:",t) if (t.querySelector("div > table")) { //let table = t.firstElementChild.querySelector("table") //console.log("Matched table",t) @@ -1185,6 +1191,11 @@ parseTicket(t.querySelectorAll(".feed-reply")) } + //force contrastive colors in comments/replies with inline styles + document.querySelectorAll("div.feed-item-text *:not(a)").forEach(textBlock=>{ + textBlock.style.color = "var(--txt-1)" + }) + //parse dashboard widgets if (t.id=="tdx-workmgmt-container-collection") { parseOtherElements() @@ -1194,29 +1205,29 @@ if (t.classList.contains("tdx-right-side-panel")) { parseOtherElements() } - + let module = t.querySelector("div > .tdx-dashboard__widget-container") if (module) { updateHeading(t) } //search whole document, frames may reset when reopened - let frames = document.querySelectorAll("iframe:not(.customEmbed)") - if (frames) { - [...frames].forEach(frame=>{ - injectOtherStyles(frame) - }); - } + // let frames = document.querySelectorAll("iframe:not(.customEmbed)") + // if (frames) { + // [...frames].forEach(frame=>{ + // injectOtherStyles(frame) + // }); + // } }); }); if (true) { console.log("Observing...") observer.observe(document.body, { - characterDataOldValue: true, + characterDataOldValue: false, subtree: true, childList: true, - characterData: true + characterData: false }); } @@ -1330,6 +1341,19 @@ } + try { + CKEDITOR.on('instanceReady', function(event) { + var style = event.editor.document.$.createElement('style'); + style.innerHTML = customStyles + editor.document.$.getElementsByTagName('head')[0].appendChild(style); + editor.document.$.querySelectorAll("*:not(a)").forEach((element) => { + element.style.color = "var(--txt-1)" + }) + }) + } catch (error) { + + } + async function injectToolbar() { let iconBar = document.querySelector("#globalSearchBar") @@ -1784,6 +1808,8 @@ --light-txt-hue: 0deg; --light-shadow-1: rgba(50, 50, 50, 0.1); --light-shadow-2: rgba(50, 50, 50, 0.06); + + --body-text-color: var(--txt-0); } @media (prefers-color-scheme: light) { @@ -3794,6 +3820,11 @@ body .tdworkmgmt.table>tbody>tr:not(.tdx-grid__group-header):not(.TDGridHeader): background-color: var(--bg-4); } +html .cke_editable { + background-color: var(--bg-4) important!; + color: var(--txt-1) important!; +} + .cke_wysiwyg_div, .cke_wysiwyg_frame { background: var(--bg-0) !important; } @@ -3989,10 +4020,6 @@ div.profile-image.red-bg, div.profile-image.green-bg, div.profile-image.red-bg, color: var(--col-400) !important; } -.wrap-text *:not(a), .moreToggle *:not(a), .lessToggle *:not(a) { - color: var(--txt-1) !important; -} - .tdx-view-ticket-summary #divSummaryHeading a { color: var(--col-400); } From 7840543c8386687deac70cf07cb9c6ccafc9c99b Mon Sep 17 00:00:00 2001 From: ejunga Date: Wed, 3 Dec 2025 11:39:59 -0500 Subject: [PATCH 07/10] Fix comment editor colors --- tdx-enhanced.js | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 5166443..7b92cc2 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -1174,6 +1174,21 @@ } } + function ckeinjectCustomCss(event) { + // var editor = event.editor + try { + if (!(event.document.$.getElementById("tdxuserscript-style"))) { + var style = event.document.$.createElement('style'); + style.id = "tdxuserscript-style" + style.innerHTML = customStyles + event.document.$.getElementsByTagName('head')[0].appendChild(style); + event.document.$.querySelectorAll("div, span").forEach((element) => { + element.style.color = "var(--txt-1)" + }) + } + } catch(error) {} + } + //setup observer to watch report/table changes/refreshes let observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { @@ -1211,6 +1226,10 @@ updateHeading(t) } + for (const instance in CKEDITOR.instances) { + ckeinjectCustomCss(CKEDITOR.instances[instance]); + } + //search whole document, frames may reset when reopened // let frames = document.querySelectorAll("iframe:not(.customEmbed)") // if (frames) { @@ -1299,7 +1318,7 @@ style.setProperty("--filter-invert",filters.invert) style.setProperty("--filter-saturate",filters.saturate) style.setProperty("--filter-sepia",filters.sepia) -} + } /* function toggleColorMode() { @@ -1343,17 +1362,11 @@ try { CKEDITOR.on('instanceReady', function(event) { - var style = event.editor.document.$.createElement('style'); - style.innerHTML = customStyles - editor.document.$.getElementsByTagName('head')[0].appendChild(style); - editor.document.$.querySelectorAll("*:not(a)").forEach((element) => { - element.style.color = "var(--txt-1)" - }) + ckeinjectCustomCss(event) }) } catch (error) { } - async function injectToolbar() { let iconBar = document.querySelector("#globalSearchBar") From 256b508ea1280a33f70903539c4efe5adb698322 Mon Sep 17 00:00:00 2001 From: ejunga Date: Wed, 3 Dec 2025 11:51:37 -0500 Subject: [PATCH 08/10] bump version number --- tdx-enhanced.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 7b92cc2..d83e96f 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -1,7 +1,7 @@ // ==UserScript== // @name tdx-enhanced // @namespace purdue-it -// @version 2025-11-25-00 +// @version 2025-12-03-00 // @description enhanced tdx coloring & formatting. follows system color scheme. // @author Purdue STEM IT - it@purdue.edu // @match https://service.purdue.edu/TDWorkManagement* From 86db883205312f04048a839e1922e16173c6eaeb Mon Sep 17 00:00:00 2001 From: ejunga Date: Thu, 4 Dec 2025 08:11:15 -0500 Subject: [PATCH 09/10] Don't assume ckeditor exists on page --- tdx-enhanced.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tdx-enhanced.js b/tdx-enhanced.js index d83e96f..35f0de8 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -1226,9 +1226,11 @@ updateHeading(t) } - for (const instance in CKEDITOR.instances) { - ckeinjectCustomCss(CKEDITOR.instances[instance]); - } + try { + for (const instance in CKEDITOR.instances) { + ckeinjectCustomCss(CKEDITOR.instances[instance]); + } + } catch (error) {} //search whole document, frames may reset when reopened // let frames = document.querySelectorAll("iframe:not(.customEmbed)") @@ -1364,9 +1366,8 @@ CKEDITOR.on('instanceReady', function(event) { ckeinjectCustomCss(event) }) - } catch (error) { - - } + } catch (error) {} + async function injectToolbar() { let iconBar = document.querySelector("#globalSearchBar") From 2f96b8636755e9706949817ea3c17cf906c2f5da Mon Sep 17 00:00:00 2001 From: ejunga Date: Thu, 4 Dec 2025 08:12:28 -0500 Subject: [PATCH 10/10] Prepare for release --- tdx-enhanced.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tdx-enhanced.js b/tdx-enhanced.js index 35f0de8..f4cdcc4 100644 --- a/tdx-enhanced.js +++ b/tdx-enhanced.js @@ -1,7 +1,7 @@ // ==UserScript== // @name tdx-enhanced // @namespace purdue-it -// @version 2025-12-03-00 +// @version 2025-12-04-00 // @description enhanced tdx coloring & formatting. follows system color scheme. // @author Purdue STEM IT - it@purdue.edu // @match https://service.purdue.edu/TDWorkManagement* @@ -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/refs/heads/beta/tdx-enhanced.js -// @updateURL https://raw.github.itap.purdue.edu/ECN/tdx-userscript/refs/heads/beta/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 @@ -1367,7 +1367,7 @@ ckeinjectCustomCss(event) }) } catch (error) {} - + async function injectToolbar() { let iconBar = document.querySelector("#globalSearchBar")