function disableTooltips(el) { let titles = el.querySelectorAll("[title]"); titles.forEach((t) => { const title = t.getAttribute("title"); t.removeAttribute("title"); }); }; disableTooltips(document); setTimeout(function () { disableTooltips(document) }, 700); let controlAriaLabels = document.querySelectorAll(".cell.text > .control [aria-label], .cell.textarea > .control [aria-label]"); controlAriaLabels.forEach((el) => { el.removeAttribute("aria-label"); }); let ariaRequiredLabels = document.querySelectorAll(".cell .table-info label"); ariaRequiredLabels.forEach((el)=>el.removeAttribute("aria-required")); let remainingAriaLabels = document.querySelectorAll("[aria-label]"); remainingAriaLabels.forEach((el) => { el.ariaLabel = el.ariaLabel.replaceAll(/<\/?[a-z][a-z0-9]*[^<>]*>|/g, ""); //remove HTML markup from augenerated aria labels. }); let controlAriaDescriptions = document.querySelectorAll(".cell.text > .control [aria-roledescription], .cell.textarea > .control [aria-roledescription], .cell.picklist-cell > .control [aria-roledescription]"); controlAriaDescriptions.forEach((el) => { el.removeAttribute("aria-roledescription"); }); let ariaDesc = document.querySelectorAll("[aria-roledescription]"); ariaDesc.forEach((el) => { el.ariaRoleDescription.replace(/.*<\/ghost-text>/,''); el.ariaRoleDescription = el.ariaRoleDescription.replaceAll(/<\/?[a-z][a-z0-9]*[^<>]*>|/g, ""); }); let ariaDisabled = document.querySelectorAll("[aria-disabled='true'], [disabled='disabled']"); ariaDisabled.forEach((el) => { try { el.removeAttribute('aria-disabled'); el.removeAttribute('disabled'); el.setAttribute('readonly'); } catch { }; }); const readonlyInputs = document.querySelectorAll('input[readonly], textarea[readonly]'); readonlyInputs.forEach(input => { input.addEventListener('focus', (e) => { e.target.setSelectionRange(0, 0); }); }); let urlFields = document.querySelectorAll("[ondblclick='launchUrl(this.value);']"); urlFields.forEach((el) => { el.ondblclick = null; el.style.textDecoration = 'none'; el.removeAttribute('ondblclick'); }) $(document).ready(function () { document.querySelectorAll(".datetimepicker [role='button']").forEach((el) => { el.addEventListener("keydown", (event) => { if (event.code === "Space" || event.key === " ") { event.preventDefault(); event.target.click(); } }); }); if (document.body.dataset.dateformat.toLowerCase() == 'yyyy-mm-dd') { const today = new Date(); const formattedDate = new Intl.DateTimeFormat('en-CA').format(today); let DATE_INSTRUCTIONS = { 'en': 'Expected Date Format:', 'fr': 'Format de date attendu:', } let DATE_FORMAT = { 'en': 'yyyy-mm-dd', 'fr': "aaaa-mm-jj", } document.querySelectorAll('.cell.datetime').forEach((cell)=>{ let label = cell.querySelector('label'); let input = cell.querySelector('.datetimepicker input'); let formatValidator = cell.querySelector('[id^="DateFormatValidator"]'); label.insertAdjacentHTML('beforeend',`${DATE_INSTRUCTIONS[LANG]}`); const FORMAT = DATE_FORMAT[LANG]; input.placeholder = FORMAT; let errorMessage = formatValidator?.errormessage; let newErrorMessage = errorMessage.replace("{1}", formattedDate); formatValidator.errormessage = newErrorMessage; //input.setAttribute('aria-required', ''); }); } document.querySelectorAll('.btn-for-delete').forEach(btn=>btn.style.setProperty("padding", "17px", "important")); const subgridContainers = document.querySelectorAll(".subgrid"); subgridContainers.forEach(container => { const table = container.querySelector("table"); const label = container.closest("td")?.querySelector("label"); const description = container.closest("td")?.querySelector(".description"); if (table) { let labelledByIds = []; if (label) { if (!label.id) { label.id = "label-" + Math.random().toString(36).substr(2, 9); } labelledByIds.push(label.id); } if (description) { if (!description.id) { description.id = "desc-" + Math.random().toString(36).substr(2, 9); } labelledByIds.push(description.id); } if (labelledByIds.length > 0) { table.setAttribute("aria-labelledby", labelledByIds.join(" ")); } } }); });