| Location | Van Wert, OH |
Job Description
Inject the flag directly into the main browser window and the session.window.isSFInternalUser = true;sessionStorage.setItem('SF_Internal_User', 'true');
/
if (titleElement) {Locate the highest level wrapper SAP generated for the title and remove itlet titleWrapper = titleElement.closest('.joblayouttoken') || titleElement.closest('.inner');if (titleWrapper) titleWrapper.remove();}
Inject the new custom HTML structure at the very top of the job column.This includes the new H1 title and the empty green container/grid for the tokens.columnOne.insertAdjacentHTML('afterbegin', `
${titleText}
`);
Reference to the newly injected grid where we will move the tokenslet grid = columnOne.querySelector('.job-grid');
Variables to store extracted data for our business ruleslet jobLocationValue = "";let countryRegionValue = "";let regionValue = "";let jobLevelValue = "";let employeeGroupValue = "";
let labelText = labelEl.innerText;Use our helper function to normalize the label name regardless of the user's languagelet propId = generatePropertyId(labelText);
let valueEl = el.querySelector('.rtltextaligneligible');let valueText = valueEl ? valueEl.textContent.trim() : "";
Populate the business rule variables based on the identified property IDif (propId === "JobLocation") jobLocationValue = valueText;else if (propId === "CountryRegion") countryRegionValue = valueText;else if (propId === "Region") regionValue = valueText;else if (propId === "JobLevel") jobLevelValue = valueText.toUpperCase().trim();else if (propId === "EmployeeGroup") employeeGroupValue = valueText.toLowerCase();});
DATA FALLBACK: JOB DESCRIPTION PARSINGIf SAP failed to generate specific tokens, attempt to regex them directly out of the raw description text.let descDiv = document.querySelector('.job-description') || columnOne.querySelector('[itemprop="description"]');if (descDiv) {let descText = descDiv.innerText || "";if (!employeeGroupValue) {let eg = descText.match(/Employee Group:\s([^]+)/i);if (eg) employeeGroupValue = eg[1].toLowerCase().trim();}if (!countryRegionValue) {let cr = descText.match(/Country:\s([^]+)/i);if (cr) countryRegionValue = cr[1].toLowerCase().trim();}if (!regionValue) {let rg = descText.match(/Region:\s([^]+)/i);if (rg) regionValue = rg[1].toLowerCase().trim();}if (!jobLevelValue) {let jl = descText.match(/Job Level:\s([^]+)/i);Ensure we don't accidentally grab "Job Experience Level"if (jl && !jl[0].toLowerCase().includes("experience")) {jobLevelValue = jl[1].toUpperCase().trim();}}}
BUSINESS RULES EVALUATION (SALARY VISIBILITY)Rule A: Is it a salaried position?let isSalaryPaid = employeeGroupValue.includes('salary');
Rule B: Is the Job Level eligible? (Hide if PL09 or higher, or if ZZ)let isJobLevelSalaryEligible = true;let plMatch = jobLevelValue.match(/PL(\d+)/);if (jobLevelValue.includes("ZZ")) {isJobLevelSalaryEligible = false;} else if (plMatch && parseInt(plMatch[1], 10) >= 9) {isJobLevelSalaryEligible = false;}
Combine city/state and country to check geographic eligibilitylet fullLocationLower = (jobLocationValue + " " + countryRegionValue).toLowerCase();let isUSJob = fullLocationLower.includes("usa") || fullLocationLower.includes("united states") || /\bus\b/.test(fullLocationLower);
Define specifically allowed locations for salary transparency compliancelet allowedUSStates = ["massachusetts", "illinois", "colorado", "minnesota", "new york", "oregon", "ohio", "california", "washington", "nevada", "maryland", "new jersey"];let allowedUSAbbr = ["ma", "il", "co", "mn", "ny", "or", "oh", "ca", "wa", "nv", "md", "nj", "wdc", "dc"];let allowedGlobalCountries = ["canada"];
let isSalaryLocationValid = false;
Rule C: Is the location mandated to show salary?if (isUSJob) {isSalaryLocationValid = allowedUSStates.some(state =>fullLocationLower.includes(state)) ||allowedUSAbbr.some(abbr =>new RegExp(\\b${abbr}\\b).test(fullLocationLower));} else {isSalaryLocationValid = allowedGlobalCountries.some(country =>fullLocationLower.includes(country));}
Final Boolean: All three rules must pass to display the salary range tokenlet showSalaryRange = isSalaryLocationValid && isJobLevelSalaryEligible && isSalaryPaid;
let labelEl = el.querySelector('.joblayouttoken-label');if (!labelEl) return;
let labelText = labelEl.innerText;let customPropertyid = generatePropertyId(labelText);
Hide utility tokens that were only needed for backend business logic calculationsif (["EmployeeGroup", "CountryRegion", "Region", "JobLevel"].includes(customPropertyid)) {el.style.display = 'none';return;}
Hide the salary token if it failed the business rule checkif (customPropertyid === "SalaryRange" && !showSalaryRange) {el.style.display = 'none';return;}
TEXT OVERRIDES: Force specific terminology on the frontendif (customPropertyid === "SalaryRange" && labelText.toLowerCase().includes("recruitment salary range")) {labelEl.innerText = labelText.replace(/Recruitment Salary Range/ig, "Annual Salary Range");}Cleanup messy abbreviations from SAPif (labelText.includes("(Short)")) {labelEl.innerText = labelText.replace(/(Short)/g, "(s)");}
BRUTE FORCE STYLING: Override SAP's native CSS for the LabelslabelEl.style.setProperty('font-weight', 'bold', 'important');labelEl.style.setProperty('font-size', '14px', 'important');labelEl.style.setProperty('color', '#303030', 'important');labelEl.style.setProperty('font-family', 'Verdana, Geneva, sans-serif', 'important');
BRUTE FORCE STYLING: Override SAP's native CSS for the Valueslet valueEl = el.querySelector('.rtltextaligneligible');if (valueEl) {valueEl.style.setProperty('font-weight', 'normal', 'important');valueEl.style.setProperty('font-size', '15px', 'important');valueEl.style.setProperty('color', '#303030', 'important');valueEl.style.setProperty('font-family', 'Verdana, Geneva, sans-serif', 'important');}
ICON MAPPING: Assign specific Glyphicons or custom image URLs based on the token typelet icon = '';let iconUrl = '';
switch (customPropertyid) {case 'JobLocation': icon = 'glyphicon-map-marker'; break;case 'BusinessUnit': icon = 'glyphicon-briefcase'; break;case 'JobCategory': icon = 'glyphicon-dashboard'; break;case 'EmploymentType': icon = 'glyphicon-star-empty'; break;case 'ReqID': icon = 'glyphicon-calendar'; break;case 'WorkLocationType': icon = 'glyphicon-paste'; break;case 'JobExperienceLevel': iconUrl = 'https:rmkcdn.successfactors.com/ef55fddb/b4cf3492-3cb2-4e29-a914-3.png'; break;case 'SalaryRange': iconUrl = 'https:rmkcdn.successfactors.com/ef55fddb/3bd06ab1-e5dc-4e72-abcb-3.png'; break;case 'TAPartner': iconUrl = 'https:rmkcdn.successfactors.com/ef55fddb/66a66419-f8c9-4f0e-b94a-6.png'; break;}
Generate the HTML for the icon (either a span for a font-icon or an img tag)let iconHtml = '';if (icon) {iconHtml = ; } else if (iconUrl) { iconHtml =;}
SAFE DOM MANIPULATIONWrap the existing token and the new icon inside a flexible flexbox row container.We use DOM traversal (previousElementSibling) to avoid using dynamic ID queries which can fail if SAP injects weird characters.let containerToWrap = labelEl.parentElement;if(containerToWrap) {containerToWrap.insertAdjacentHTML('beforebegin', ${iconHtml});let wrapper = containerToWrap.previousElementSibling;if(wrapper) {wrapper.appendChild(containerToWrap);Clean up residual text nodes (like line breaks) to prevent unwanted spacing in the layoutlet nextNode = wrapper.nextSibling;if(nextNode && nextNode.nodeType === 3) nextNode.remove();}}
Finally, move the fully formatted token element into our custom green gridgrid.appendChild(el);} catch (err) {If a specific token is malformed by SAP, log the error but allow the loop to continue formatting the rest of the tokensconsole.error("Erro ao processar o token:", err);}});
/
/
Default brand is "standard" in case we don't find anythingvar detectedKey = "standard";
Step 2: Loop through all elements to find the label "Brand:"for (var i = 0; i
Clean up the text (e.g., "Lean Heat" ->"leanheat")var cleanValue = purify(rawValue);
If this clean name exists in our database above, save it as the detected brandif (brandContent[cleanValue]) {detectedKey = cleanValue;}
Stop searching since we found what we neededbreak;}}
Step 3: Find out what language the user is viewing the page in (e.g., "en-US" becomes "enUS")var lang = document.documentElement.lang.replace('-', '') || 'en_GB';
Step 4: Get the specific image and text for the detected Brand AND LanguageFallbacks: If language doesn't exist, use English. If brand doesn't exist, use standard English.var data = brandContent[detectedKey][lang] || brandContent[detectedKey]['en_GB'] || brandContent['standard']['en_GB'];
Step 5: Check if we haven't already drawn our custom block. If not, draw it!if (!document.querySelector('.custom-brand-display')) {This is the HTML code we will inject into the pageIt uses the classes we styled in the section abovevar contentToInject = `
${data.description}
`;
Find the "Apply Now" button container...var applyContainer = document.querySelector('.applylink.unify-button-container');...and paste our new HTML block right below itif (applyContainer) applyContainer.insertAdjacentHTML('afterend', contentToInject);}}
/
Also run it once immediately just in case the page is already fully loadedrenderBrandContent();})();
(function() {/ ==========================================================================SCRIPT 2: CLEANUP SCRIPT (Element Hider)Since Script 1 added a beautiful new image and description, we don't wantthe user to still see the raw, ugly text that says "Brand: LeanHeat" onthe page. This script finds that old text and makes it invisible.========================================================================== /
function hideBrandElement() {Find all text-bearing elements on the pagevar allLabels = document.querySelectorAll('.joblayouttoken-label, span, div, p, label');
Check each element one by oneallLabels.forEach(function(el) {If the element says exactly "Brand:"if (el.textContent && el.textContent.trim() === "Brand:") {Hide the word "Brand:"el.style.display = 'none';
Hide the value next to it (e.g., the word "LeanHeat")if (el.nextElementSibling) {el.nextElementSibling.style.display = 'none';}
If they are sitting inside a small container box by themselves, hide the box tooif (el.parentElement && el.parentElement.children.length