Skip to content
Open
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
59 changes: 55 additions & 4 deletions tdx-enhanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,6 @@
}
}
}

function parseOtherElements() {
let path = document.location.pathname;

Expand All @@ -713,14 +712,13 @@
document.querySelectorAll("div.moreToggle *:not(a), div.lessToggle *:not(a), div.wrap-text *:not(a)").forEach(textBlock=>{
textBlock.style.color = "var(--txt-1)"
})
document.querySelectorAll("#ToggleAIAgentAssist").forEach(AIAgentButton=>{
document.querySelectorAll("#ToggleAIAgentAssist, .tdx-view-ticket-summary").forEach(AIAgentButton=>{
let selected = settings('get','aiBehavior');
console.log("AI Behavior selected:",selected.value)
if (selected == "aiDisable") {
AIAgentButton.style.display = "none"
}
})

let desktopLayout = settings('get','layout')
let desktop = document.querySelector("#divContent")
if (desktop && desktopLayout) {
Expand Down Expand Up @@ -915,6 +913,35 @@
}
}

let age = ['Age']
for (const dType of age) {
if (dType in item) {
let Age = item[dType]
const ageThreshold = 30

let days = Age.txt.slice(0,-1)

if (days > 30){
days = days - 30
let alpha = days / ageThreshold
alpha = alpha > 1 ? 1 : alpha
let cell = Age.cell
console.log(alpha)
handleHighlight("age",alpha,cell)
cell.classList.add(alpha > 0.5 ? "light" : "dark")
}
}
}

// let Status = ['Status']
// for (const dType of Status) {
// if (dType in item) {
// let CurrentStatus = item[dType]
// let cell = CurrentStatus.cell
// handleHighlight("status",CurrentStatus.txt,cell)
// }
// }

//find user replies & last modified by internal
if ('Requestor' in item && 'Modified By' in item && 'Prim Resp' in item) {
let fromUser = item["Requestor"]
Expand Down Expand Up @@ -1141,6 +1168,14 @@
if (type=="dateModified") {
element.style.backgroundColor = `rgba(255,0,0,${txt}`;
}
// if (type=="status"){
// if (txt=="In Process") {
// element.style.backgroundColor = "red"
// }
// }
if (type=="age") {
element.style.backgroundColor = `rgba(255,0,0,${txt}`;
}
}
}

Expand Down Expand Up @@ -1227,6 +1262,22 @@
if (t.classList.contains("tdx-right-side-panel")) {
parseOtherElements()
}
if (t.classList.contains("sr-alert-region")){ // magic class
document.querySelectorAll("#divFieldSuggestionsResponsible, #divFieldSuggestionsPriority, #divFieldSuggestionsForm").forEach(AIAgentButton=>{
let selected = settings('get','aiBehavior');
if (selected == "aiDisable") {
AIAgentButton.style.display = "none"
}
})
}
if (t.classList.contains("cke_button_label")){
document.querySelectorAll(".cke_button__revisetext").forEach(AIAgentButton=>{
let selected = settings('get','aiBehavior');
if (selected == "aiDisable") {
AIAgentButton.style.display = "none"
}
})
}

let module = t.querySelector("div > .tdx-dashboard__widget-container")
if (module) {
Expand Down