diff --git a/jey_theme/public/js/jey_theme.js b/jey_theme/public/js/jey_theme.js index 05997c5..c43a0cd 100644 --- a/jey_theme/public/js/jey_theme.js +++ b/jey_theme/public/js/jey_theme.js @@ -154,6 +154,7 @@ leaves: { paths: '' }, payroll: { paths: '' }, people: { paths: '' }, + employees: { paths: '' }, recruitment: { paths: '' }, performance: { paths: '' }, expenses: { paths: '' }, @@ -194,6 +195,7 @@ "share management": { paths: '' }, subscription: { paths: '' }, crm: { paths: '' }, + employees: { paths: '' }, support: { paths: '' }, _fallback: '' } @@ -278,24 +280,6 @@ iconContainer.appendChild(parts.chrome); } - var DESKTOP_LABEL_OVERRIDES = { - "Frappe HR": "HR", - "ERPNext Settings": "Settings" - }; - - function renameDesktopLabels() { - Object.keys(DESKTOP_LABEL_OVERRIDES).forEach(function (id) { - var newLabel = DESKTOP_LABEL_OVERRIDES[id]; - document.querySelectorAll('.desktop-icon[data-id="' + id + '"]').forEach(function (icon) { - var title = icon.querySelector(".icon-title"); - if (title && title.textContent.trim() !== newLabel) { - title.textContent = newLabel; - title.setAttribute("data-original-title", newLabel); - } - }); - }); - } - function processIcons() { document.querySelectorAll( ".desktop-icon > .icon-container:not(.jey-chrome-done)" @@ -308,7 +292,6 @@ ".desktop-icon > .icon-container.folder-icon:not(.jey-chrome-done)" ).forEach(wrapIcon); - renameDesktopLabels(); staggerAnimations(); } @@ -2007,118 +1990,6 @@ } })(); -/* ========================================================================== - Rebrand: ERPNext → Jey ERP, Frappe → Framework (visible text only) - ========================================================================== */ - -(function () { - "use strict"; - - var SKIP_TAGS = { SCRIPT: 1, STYLE: 1, NOSCRIPT: 1, IFRAME: 1, CANVAS: 1 }; - - /* Case-aware replacements: tries to preserve the surrounding case style */ - function rebrandText(str) { - // ERPNext variants - str = str.replace(/ERPNext/g, "Jey ERP"); - str = str.replace(/erpnext/gi, function (m) { - if (m === "ERPNEXT") return "JEY ERP"; - return "Jey ERP"; - }); - // Frappe variants (but not inside URLs or identifiers) - str = str.replace(/Frapp[eé]/g, "Jey ERP"); - str = str.replace(/frapp[eé]/gi, function (m) { - if (m.toUpperCase() === m) return "JEY ERP"; - return "Jey ERP"; - }); - return str; - } - - function needsRebrand(str) { - return /erpnext|frapp[eé]/i.test(str); - } - - /* Walk text nodes inside an element */ - function walkTextNodes(root) { - var walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, null, false); - var node; - while ((node = walker.nextNode())) { - if (SKIP_TAGS[node.parentNode.tagName]) continue; - var text = node.nodeValue; - if (needsRebrand(text)) { - node.nodeValue = rebrandText(text); - } - } - } - - /* Rebrand visible attributes: placeholder, title, alt */ - function walkAttributes(root) { - var els = root.querySelectorAll("[placeholder], [title], [alt]"); - for (var i = 0; i < els.length; i++) { - var el = els[i]; - ["placeholder", "title", "alt"].forEach(function (attr) { - var val = el.getAttribute(attr); - if (val && needsRebrand(val)) { - el.setAttribute(attr, rebrandText(val)); - } - }); - } - } - - /* Rebrand the page title */ - function rebrandTitle() { - if (needsRebrand(document.title)) { - document.title = rebrandText(document.title); - } - } - - function processNode(root) { - walkTextNodes(root); - walkAttributes(root); - rebrandTitle(); - } - - /* Initial pass */ - function init() { - processNode(document.body); - rebrandTitle(); - - /* Watch for dynamically added content */ - var observer = new MutationObserver(function (mutations) { - for (var i = 0; i < mutations.length; i++) { - var m = mutations[i]; - for (var j = 0; j < m.addedNodes.length; j++) { - var node = m.addedNodes[j]; - if (node.nodeType === 1 && !SKIP_TAGS[node.tagName]) { - processNode(node); - } else if (node.nodeType === 3 && node.parentNode && !SKIP_TAGS[node.parentNode.tagName] && needsRebrand(node.nodeValue)) { - node.nodeValue = rebrandText(node.nodeValue); - } - } - /* Handle direct text changes (e.g. frappe sets .textContent) */ - if (m.type === "characterData" && m.target.nodeType === 3) { - if (m.target.parentNode && !SKIP_TAGS[m.target.parentNode.tagName] && needsRebrand(m.target.nodeValue)) { - m.target.nodeValue = rebrandText(m.target.nodeValue); - } - } - } - rebrandTitle(); - }); - - observer.observe(document.body, { - childList: true, - subtree: true, - characterData: true - }); - } - - if (document.readyState === "loading") { - document.addEventListener("DOMContentLoaded", init); - } else { - init(); - } -})(); - - /* ========================================================================== Form Tabs — Re-trigger section cascade on tab switch ========================================================================== */