From b76453d43e7a2b734cb6f119b9cc045bb53637ca Mon Sep 17 00:00:00 2001 From: Joshua L Remender Date: Mon, 17 Nov 2025 14:22:43 -0500 Subject: [PATCH] Removed legacy ECN features from parsing.js --- content/modules/parsing.js | 207 ------------------------------------- 1 file changed, 207 deletions(-) diff --git a/content/modules/parsing.js b/content/modules/parsing.js index 8fa41ad..2440afd 100644 --- a/content/modules/parsing.js +++ b/content/modules/parsing.js @@ -247,121 +247,6 @@ function parseTicket(mutation = null) { // Find ticket or task header element let header = document.getElementById("thTicket_spnTitle") || document.querySelector("#upTaskHeader>div>h1") - // Find calendar inputs when editing tickets/tasks - // Currently handles start and end dates for tasks - let calendarInputs = document.querySelectorAll("#txtStartDate, #txtEndDate") - if (calendarInputs && calendarInputs.length > 0) { - [...calendarInputs].forEach(calendarInput => { - let calendarDateTime = parseDateTimeFlexible(calendarInput.value, { - formats: LEGACY_CALENDAR_PARSE_FORMATS - }) - - let newCalendarInput = document.createElement("input") - newCalendarInput.id = `${calendarInput.id}-new` - newCalendarInput.classList = calendarInput.classList - newCalendarInput.type = "datetime-local" - - let calendarButtonContainer = document.createElement("div") - calendarButtonContainer.classList = ["calBox"] - - let calendarText = document.createElement("span") - if (calendarDateTime && calendarDateTime.isValid) { - calendarText.textContent = calendarDateTime.toFormat("cccc") - } - - function updateDate() { - if (!calendarDateTime || !calendarDateTime.isValid) { - return - } - - const legacyFormatValue = calendarDateTime.toFormat(LEGACY_CALENDAR_OUTPUT_FORMAT) - calendarInput.value = legacyFormatValue - - const isoFormatValue = calendarDateTime.toFormat(DATETIME_LOCAL_FORMAT) - newCalendarInput.value = isoFormatValue - - if (calendarText) { - calendarText.textContent = formatCalendarLabel(calendarDateTime) - } - } - - newCalendarInput.addEventListener("input", event => { - const parsedValue = parseDateTimeFlexible(event.target.value, { - formats: [DATETIME_LOCAL_FORMAT], - allowLoose: false - }) - - if (parsedValue && parsedValue.isValid) { - calendarDateTime = parsedValue - updateDate() - } - }) - - function modifyDate(buttonConfig) { - if (!calendarDateTime || !calendarDateTime.isValid) { - return - } - - let updatedDate = calendarDateTime - - if (Object.prototype.hasOwnProperty.call(buttonConfig, "add")) { - updatedDate = updatedDate.plus(buttonConfig.add) - } else if (Object.prototype.hasOwnProperty.call(buttonConfig, "set")) { - updatedDate = applyMomentLikeSet(updatedDate, buttonConfig.set) - } - - const dayOfWeek = updatedDate.weekday - const hour = updatedDate.hour - const minute = updatedDate.minute - - if (dayOfWeek >= 5 && (hour > 17 || (hour === 17 && minute > 0))) { - updatedDate = applyMomentLikeSet(updatedDate, { - h: 8, - d: updatedDate.day + 7, - m: 0 - }) - } else if (dayOfWeek > 5) { - updatedDate = applyMomentLikeSet(updatedDate, { - d: updatedDate.day + 7 - }) - } - - calendarDateTime = updatedDate - updateDate() - } - - // Define quick date modifier buttons - let dateModifierButtons = [ - { name: "+1 day", add: { days: 1 } }, - { name: "+1 week", add: { weeks: 1 } }, - { name: "+1 month", add: { months: 1 } }, - { name: "12PM", set: { h: 12, m: 0 } }, - { name: "5PM", set: { h: 17, m: 0 } } - ] - - // Create and attach date modifier buttons - for (const buttonConfig of dateModifierButtons) { - let buttonElement = document.createElement("button") - buttonElement.classList = "btn btn-calendar" - buttonElement.innerText = buttonConfig.name - buttonElement.addEventListener("click", (event) => { - event.preventDefault() - modifyDate(buttonConfig) - }) - calendarButtonContainer.appendChild(buttonElement) - } - - updateDate() - - // Hide old calendar input (still needed for format conversion) - // Append new elements to the parent - calendarInput.style.display = "none" - calendarInput.parentElement.append(newCalendarInput) - calendarInput.parentElement.append(calendarText) - calendarInput.parentElement.append(calendarButtonContainer) - }); - } - // Update browser tab title with ticket title if (header) { let ticketTitle = header.childNodes[0].textContent @@ -376,16 +261,6 @@ function parseTicket(mutation = null) { handleLink("Update", button) }); - // Add task button - [...document.querySelectorAll("#liAddTicketTask>a")].forEach(button => { - handleLink("TicketTaskNew", button) - }); - - // Add task template button - [...document.querySelectorAll("#divAddTaskTemplate>a")].forEach(button => { - handleLink("TicketAddTaskTemplate", button) - }); - // Adjust feed colors for dark mode compatibility // Find feed items either from mutation or document var feedItems @@ -450,50 +325,6 @@ function parseOtherElements() { }) } }) - - // Apply custom desktop layout configuration - let desktopLayout = settings('get', 'layout') - let desktopContainer = document.querySelector("#divContent") - if (desktopContainer && desktopLayout) { - let column1 = desktopContainer.querySelector("#Column1") - let column2 = desktopContainer.querySelector("#Column2") - let column3 = desktopContainer.querySelector("#Column3") - - // Apply 100% / 66-33% layout (column 2 takes 66%, column 3 takes 33%) - if (desktopLayout === "1_100-66-33" && column2 && column3) { - // Define width classes for Bootstrap grid - let column2WidthClass = "col-md-8" // 66% width - let column3WidthClass = "col-md-4" // 33% width - - // Resize column 2: remove existing col-md class and add new one - for (const className of column2.classList) { - if (className.startsWith("col-md")) { - column2.classList.remove(className) - column2.classList.add(column2WidthClass) - break - } - } - - // Resize column 3: remove existing col-md class and add new one - for (const className of column3.classList) { - if (className.startsWith("col-md")) { - column3.classList.remove(className) - column3.classList.add(column3WidthClass) - break - } - } - } - } - - // Apply sticky column positioning if enabled - let stickyColumns = settings('get', 'stickyColumns') - if (stickyColumns) { - [...document.querySelectorAll(".tdx-dashboard__column")].forEach(column => { - column.style.position = "sticky" - column.style.alignSelf = "flex-start" - column.style.top = "4px" - }); - } } /** @@ -553,15 +384,6 @@ function parseTable(element) { * @param {Object} item - Item object containing row data with header names as keys */ function parseItem(item) { - // Color queue names in "CSS Support" column - if ('CSS Support' in item && item["CSS Support"]) { - let queueCell = item["CSS Support"].cell - let queueText = (item["CSS Support"].txt || "").toLowerCase().trim() - if (queueText && queueCell && queueText in colorsByQueue) { - let queueColorConfig = colorsByQueue[queueText] - createHighlightBubble(queueCell, queueColorConfig.bg, queueColorConfig.txt) - } - } // Convert dates to relative time format (e.g., "3 hours ago", "in 2 days") let relativeDateColumns = ['Modified', 'Created'] @@ -592,22 +414,6 @@ function parseItem(item) { } } - let detailedDateColumns = ['Date Due', 'Due', 'Created', 'Start'] - for (const dateColumnName of detailedDateColumns) { - if (dateColumnName in item) { - let dateText = item[dateColumnName].txt - let dateCell = item[dateColumnName].cell - - let parsedDate = parseDateTimeFlexible(dateText) - if (parsedDate && parsedDate.isValid) { - let calendarFormatText = formatCalendarLabel(parsedDate) - if (calendarFormatText) { - dateCell.textContent = calendarFormatText - } - } - } - } - let modifiedDateColumns = ['Modified'] for (const dateColumnName of modifiedDateColumns) { if (dateColumnName in item) { @@ -664,19 +470,6 @@ function parseItem(item) { } } - // Highlight internal users (primary responsibility or responsibility column) - 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) - } - - // Apply inline highlighting for task titles - if ('Title' in item) { - let titleData = item.Title - handleHighlight("title", titleData.txt, titleData.cell) - } - // Configure links to open in new tabs (if configured) let linkColumnTypes = ['Title', 'TicketID', 'TicketTitle'] for (const linkColumnType of linkColumnTypes) {