Criticality Field Highlighter ์ ์์: zminkobinko
Colors criticality (td.customfield_11429) cells based on their criticality number.
์ฌ์ฉ์ 1๋ช
์ฌ์ฉ์ 1๋ช
ํ์ฅ ๋ฉํ ๋ฐ์ดํฐ
์ ๋ณด
Made for the volvo vira
source code:
(function () {
"use strict";
// Maps a criticality number to a background color.
const COLOR_MAP = {
300: "#e53935", // red
100: "#ff5722", // red-orange
75: "#ff9800", // orange
50: "#ffeb3b", // yellow
30: "#cddc39", // lime
10: "#4caf50" // green
};
const SELECTOR = "td.customfield_11429";
function colorCell(cell) {
// Extract the first standalone number from the cell, ignoring any
// surrounding markup/labels (e.g. "High (300)").
const match = cell.textContent.match(/\d+/);
if (!match) return;
}
function colorAll(root) {
const cells =
root.nodeType === Node.ELEMENT_NODE && root.matches?.(SELECTOR)
? [root]
: [];
root.querySelectorAll?.(SELECTOR).forEach((c) => cells.push(c));
cells.forEach(colorCell);
}
// Initial pass.
colorAll(document);
// Re-apply when the page updates dynamically (e.g. AJAX-loaded tables).
const observer = new MutationObserver((mutations) => {
for (const m of mutations) {
m.addedNodes.forEach((node) => {
if (node.nodeType === Node.ELEMENT_NODE) colorAll(node);
});
}
});
observer.observe(document.body || document.documentElement, {
childList: true,
subtree: true
});
})();
source code:
(function () {
"use strict";
// Maps a criticality number to a background color.
const COLOR_MAP = {
300: "#e53935", // red
100: "#ff5722", // red-orange
75: "#ff9800", // orange
50: "#ffeb3b", // yellow
30: "#cddc39", // lime
10: "#4caf50" // green
};
const SELECTOR = "td.customfield_11429";
function colorCell(cell) {
// Extract the first standalone number from the cell, ignoring any
// surrounding markup/labels (e.g. "High (300)").
const match = cell.textContent.match(/\d+/);
if (!match) return;
const color = COLOR_MAP[parseInt(match[0], 10)];
if (!color) return;
cell.style.backgroundColor = color;
}
function colorAll(root) {
const cells =
root.nodeType === Node.ELEMENT_NODE && root.matches?.(SELECTOR)
? [root]
: [];
root.querySelectorAll?.(SELECTOR).forEach((c) => cells.push(c));
cells.forEach(colorCell);
}
// Initial pass.
colorAll(document);
// Re-apply when the page updates dynamically (e.g. AJAX-loaded tables).
const observer = new MutationObserver((mutations) => {
for (const m of mutations) {
m.addedNodes.forEach((node) => {
if (node.nodeType === Node.ELEMENT_NODE) colorAll(node);
});
}
});
observer.observe(document.body || document.documentElement, {
childList: true,
subtree: true
});
})();
๋ฆฌ๋ทฐ์ด 0๋ช
์ด 0์ ์ผ๋ก ํ๊ฐํจ
๊ถํ ๋ฐ ๋ฐ์ดํฐ
ํ์ ๊ถํ:
- ๋ชจ๋ ์น์ฌ์ดํธ์์ ์ฌ์ฉ์์ ๋ฐ์ดํฐ์ ์ ๊ทผ
๋ฐ์ดํฐ ์์ง:
- ๊ฐ๋ฐ์๋ ์ด ํ์ฅ ๊ธฐ๋ฅ์ด ๋ฐ์ดํฐ ์์ง์ ์๊ตฌํ์ง ์๋๋ค๊ณ ๋ฐํ๊ณ ์์ต๋๋ค.
์ถ๊ฐ ์ ๋ณด
- ๋ถ๊ฐ ๊ธฐ๋ฅ ๋งํฌ
- ๋ฒ์
- 1.0.0
- ํฌ๊ธฐ
- 8.77 KB
- ๋ง์ง๋ง ์ ๋ฐ์ดํธ
- ํ ๋ฌ ์ (2026๋ 6์ 22์ผ)
- ๊ด๋ จ ์นดํ ๊ณ ๋ฆฌ
- ๋ผ์ด์ ์ค
- MIT ๋ผ์ด์ ์ค
- ๋ฒ์ ๋ชฉ๋ก
- ๋ชจ์์ง์ ์ถ๊ฐ