AnonSec Shell
Server IP : 46.105.57.169  /  Your IP : 216.73.216.144
Web Server : Apache
System : Linux webd003.cluster120.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
User : maitricfuz ( 93378)
PHP Version : 8.4.10
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/maitricfuz/www/saint-martin-lg/media/com_pagebuilderck/assets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/maitricfuz/www/saint-martin-lg/media/com_pagebuilderck/assets//accessibility.js
/**
 * @name		Page Builder CK
 * @package		com_pagebuilderck
 * @copyright	Copyright (C) 2015. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 * @author		Cedric Keiflin - https://www.template-creator.com - https://www.joomlack.fr
 */

// list of tasks
var AcDomList = [];
var AcContrastList = [];
var AcState = true;
var AcMinContrast = 4.5;


document.addEventListener("DOMContentLoaded", (event) => {
	setTimeout(function () {
		ckAccessibilityCheckerStart();
	}, 2000); // Delay of 2 seconds
});

function ckAccessibilityCheckerInit() {
	AcDomList = [];
	AcContrastList = [];
	AcState = true;
	AcMinContrast = 4.5;

	document.querySelector('#ckaccessibilitydomresult').innerHTML = '';
	document.querySelector('#ckaccessibilitycontrastresult').innerHTML = '';

	ckAccessibilityCheckerStart();
}

function ckAccessibilityCheckerStart() {
	document.querySelectorAll('[data-accessibilitychecker]').forEach(function (el) {
		el.removeAttribute('data-accessibilitychecker');
	});
	// search for images
	document.querySelectorAll('.imageck img').forEach(function (el) {
		ckAcCheckAlt(el, 'image');
	});
	document.querySelectorAll('.pbck_carousel .pbck_slide_img img').forEach(function (el) {
		ckAcCheckAlt(el, 'carousel');
	});
	document.querySelectorAll('.pbck_slider .pbck_slide img').forEach(function (el) {
		ckAcCheckAlt(el, 'slider');
	});
	document.querySelectorAll('.pbck_gallery_item_img img').forEach(function (el) {
		ckAcCheckAlt(el, 'gallery');
	});
	// search for other images
	document.querySelectorAll('.workspaceck img:not([data-accessibilitychecker="1"])').forEach(function (el) {
		if (el.src.match('plugins/pagebuilderck/contact2/assets/images/captcha.png')) return;
		if (el.src.match('plugins/pagebuilderck/audio/assets/images/audio_example.jpg')) return;
		ckAcCheckAlt(el, 'other');
	});
	// search for other images
	document.querySelectorAll('.workspaceck .cktype[data-type*="icon"] .iconck').forEach(function (el) {
		ckAcCheckIcon(el, 'icon');
	});
	// search for other images
	document.querySelectorAll('.workspaceck .buttonck').forEach(function (el) {
		ckAcCheckIcon(el, 'button');
		ckAcCheckHref(el, 'button');
	});

	// Run the contrast check
	// Make the check on all rows
	const rows = document.querySelectorAll('#workspaceck .rowck');
	const classesToCheck = ['.rowck', '.rowck > .inner', '.blockck > .inner']; // Classes à vérifier
	const stopSelector = '#workspaceck'; // Arrêter la remontée à cet élément

	rows.forEach(rootElement => {
		checkNestedContrast(rootElement, classesToCheck, stopSelector);
	});

	ckAcUpdateResult();
	ckAcUpdateButtonState();
}

function ckAcAddToList(el, type, problem) {
	AcDomList.push([el, type, problem]);
}

function ckAcCheckAlt(el, type) {
	if (!el.getAttribute('alt')) {
		ckAcAddToList(el, type, 'alt');
	}
	el.setAttribute('data-accessibilitychecker', '1');
}

function ckAcCheckIcon(el, type) {
	if (! ckAcManageIcon(el)) {
		ckAcAddToList(el, type, 'icon');
	}
	el.setAttribute('data-accessibilitychecker', '1');
}

function ckAcCheckHref(el, type) {
	if (!el.getAttribute('href')) {
		ckAcAddToList(el, type, 'link url (href)');
	}
	el.setAttribute('data-accessibilitychecker', '1');
}

function ckAcUpdateResult() {
	const resultDomArea = document.querySelector('#ckaccessibilitydomresult');
	const resultContrastArea = document.querySelector('#ckaccessibilitycontrastresult');

	// DOM result
	if (AcDomList.length) {
		let html = '';
		let index = 0;
		html += '<p class="pbck-accessibility-result-text">' + AcDomList.length + ' ' + Joomla.JText._('CK_ACCESSIBILITY_ERRORS_FOUND') + '</p>';
		AcDomList.forEach(function (row) {
			html += ckAcAddItemToDomResult(index, row);
			index++;
		});
		resultDomArea.innerHTML = html
		AcState = false;
	} else {
		resultDomArea.innerHTML = '<p class="pbck-accessibility-result-text">No problem found</p>';
	}

	// Contrast result
	if (AcContrastList.length) {
		let html = '';
		let index = 0;
		html += '<p class="pbck-accessibility-result-text">' + AcContrastList.length + ' ' + Joomla.JText._('CK_ACCESSIBILITY_ERRORS_FOUND') + '</p>';
		AcContrastList.forEach(function (row) {
			html += ckAcAddItemToContrastResult(index, row);
			index++;
		});
		resultContrastArea.innerHTML = html
	} else {
		resultContrastArea.innerHTML = '<p class="pbck-accessibility-result-text">No problem found</p>';
	}
	// create tooltip for the items
	ckMakeTooltip($ck('.menuckpaneltarget[data-target="accessibility"]'));
}

function ckAcUpdateButtonState() {
	const button = document.querySelector('.menuckpanel[data-target="accessibility"]');
	button.classList.remove('pbck-accessibility-ok');
	button.classList.remove('pbck-accessibility-bad');
	if (AcState === false) {
		button.classList.add('pbck-accessibility-bad');
	} else {
		button.classList.add('pbck-accessibility-ok');
	}
}

function ckAcAddItemToDomResult(index, row) {
	let html = '';
	html += '<div class="pbck-accessibility-result-row" onclick="ckAcFocus(' + index + ')">';
//	html += '<span class="pbck-accessibility-result-label">' + Joomla.JText._('CK_ELEMENT', 'Element') + ' :</span>'
//	html += '<span class="pbck-accessibility-result-name ckbadge">' + row[0].tagName + '</span>'
//	html += '<br />'
	html += '<span class="pbck-accessibility-result-label">' + Joomla.JText._('CK_ADDON', 'Addon') + ' : </span>'
	html += '<span class="pbck-accessibility-result-name ckbadge ckbadge-inverse">' + row[1] + '</span>'
	html += '<br />'
	html += '<span class="pbck-accessibility-result-label">' + Joomla.JText._('CK_PROBLEM', 'Problem') + ' : </span>'
	html += '<span class="pbck-accessibility-result-name ckbadge ckbadge-warning">' + row[2] + '</span>'
	if (row[2] === 'icon' || row[2] === 'alt') {
		html += '<br />'
		html += '<span class="pbck-accessibility-result-label">' + Joomla.JText._('CK_ACCESSIBILITY_TEXT') + ' : </span>'
		html += '<span class="ckbutton-group">'
		html += '<input type="text" class="pbck-accessibility-result-field" />'
		html += '<span class="ckbutton cktip" title="' + Joomla.JText._('CK_APPLY') + '" onclick="ckAcManage' + row[2].toLowerCase() + 'FromResult(' + index + ', this.previousSibling.value)"><span class="ck-icon-check"></span></span>'
		html += '</span>'
	}
	html += '</div>';

	return html;
}

function ckAcFocus(index) {
	const target = AcDomList[index][0];
	target.scrollIntoView({behavior: "smooth", block: "center", inline: "nearest"});
	target.classList.add('focus-visible');
	setTimeout(function () {
		target.classList.remove('focus-visible');
	}, 3000); // Delay of 3 seconds
}

function ckAcContrastFocus(index) {
	const targetText = AcContrastList[index].textEl;
	const targetBg = AcContrastList[index].bgEl;
	targetText.scrollIntoView({behavior: "smooth", block: "center", inline: "nearest"});
	targetText.classList.add('focus-visible');
	setTimeout(function () {
		targetText.classList.remove('focus-visible');
	}, 3000); // Delay of 3 seconds
}

// Fonction pour convertir RGB en hexadécimal
//function rgbToHex(r, g, b) {
//	return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).toUpperCase()}`;
//}

// Function to convert RGB to HSL
function rgbToHsl(r, g, b) {
	r /= 255, g /= 255, b /= 255;
	let max = Math.max(r, g, b), min = Math.min(r, g, b);
	let h, s, l = (max + min) / 2;

	if (max == min) {
		h = s = 0; // achromatic
	} else {
		let d = max - min;
		s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
		switch (max) {
			case r:
				h = (g - b) / d + (g < b ? 6 : 0);
				break;
			case g:
				h = (b - r) / d + 2;
				break;
			case b:
				h = (r - g) / d + 4;
				break;
		}
		h /= 6;
	}

	return [h, s, l];
}

// Function to convert HSL to RGB
function hslToRgb(h, s, l) {
	let r, g, b;

	if (s == 0) {
		r = g = b = l; // achromatic
	} else {
		function hue2rgb(p, q, t) {
			if (t < 0)
				t += 1;
			if (t > 1)
				t -= 1;
			if (t < 1 / 6)
				return p + (q - p) * 6 * t;
			if (t < 1 / 2)
				return q;
			if (t < 2 / 3)
				return p + (q - p) * (2 / 3 - t) * 6;
			return p;
		}

		let q = l < 0.5 ? l * (1 + s) : l + s - l * s;
		let p = 2 * l - q;
		r = hue2rgb(p, q, h + 1 / 3);
		g = hue2rgb(p, q, h);
		b = hue2rgb(p, q, h - 1 / 3);
	}

	return [Math.round(r * 255), Math.round(g * 255), Math.round(b * 255)];
}

// Fonction pour calculer la luminance relative d'une couleur
function getLuminance(r, g, b) {
	[r, g, b] = [r, g, b].map(c => {
		c /= 255.0;
		return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
	});
	return 0.2126 * r + 0.7152 * g + 0.0722 * b;
}

// Fonction pour calculer le ratio de contraste entre deux couleurs
function getContrastRatio(luminance1, luminance2) {
	const lighter = Math.max(luminance1, luminance2);
	const darker = Math.min(luminance1, luminance2);
	return (lighter + 0.05) / (darker + 0.05);
}

// Fonction pour obtenir la couleur d'un élément
function getElementColor(element, type) {
	const style = window.getComputedStyle(element);
	const color = style[type];
	const rgb = color.match(/\d+/g).map(Number);
	return rgb;
}

// Fonction pour vérifier si un élément a une couleur attribuée
function hasExplicitColor(element, type) {
	// for text color, the browser renders the visual color even if it's set in a parent element
	// then for text color, the computedStyle is always right
	// for the background color, the browser gives a default value rgba(0,0,0,0) for the background-color if no value is set
	// but the background property returns 'none', so we test this accordingly

	const computedStyle = window.getComputedStyle(element)[type];
	if (type === 'backgroundColor') {
		const hasBackground = window.getComputedStyle(element)['background'] !== 'none';
		if (!hasBackground)
			return false;
	}

	return true;
}

// Fonction pour vérifier si un élément a un style défini pour le texte ou l'arrière-plan
function hasStyle(element) {
	const style = window.getComputedStyle(element);
	const textColor = style.color;
	const bgColor = style.backgroundColor;
	return textColor !== 'rgba(0, 0, 0, 0)' || bgColor !== 'rgba(0, 0, 0, 0)';
}

// Fonction pour vérifier le contraste des éléments imbriqués
function checkNestedContrast(rootElement, classesToCheck, stopSelector) {
	const innerElements = rootElement.querySelectorAll('.cktype > .inner');

	innerElements.forEach(element => {
		let textColor = null;
		let bgColor = null;
		let currentElement = element;

		// Vérifier d'abord l'élément lui-même
		if (hasExplicitColor(currentElement, 'color')) {
			textColor = getElementColor(currentElement, 'color');
		}
		if (hasExplicitColor(currentElement, 'backgroundColor')) {
			bgColor = getElementColor(currentElement, 'backgroundColor');
		}

		// Remonter pour trouver la couleur de texte et d'arrière-plan si nécessaire
		while (currentElement && !currentElement.matches(stopSelector)) {
			if (classesToCheck.some(cls => currentElement.matches(cls))) {

				if (!textColor && hasExplicitColor(currentElement, 'color')) {
					textColor = getElementColor(currentElement, 'color');
				}
				if (!bgColor && hasExplicitColor(currentElement, 'backgroundColor')) {
					bgColor = getElementColor(currentElement, 'backgroundColor');
				}

				if (textColor && bgColor) {
					break;
				}
			}
			currentElement = currentElement.parentElement;
		}

		// set default bgColor to white if nothing is set
		let additionalInfo = '';
		if (!bgColor) {
			bgColor = [255, 255, 255, ];
			additionalInfo = 'No background color found, default color #ffffff used.'
		}

		// Vérifier le contraste si les deux couleurs sont trouvées
		if (textColor && bgColor) {
			let textLuminance = getLuminance(...textColor);
			let bgLuminance = getLuminance(...bgColor);
			const contrastRatio = getContrastRatio(textLuminance, bgLuminance);

			// Vérification des normes WCAG
			const fontSize = parseFloat(window.getComputedStyle(element).fontSize);
			const isLargeText = fontSize >= 18.66 || (fontSize >= 14.67 && window.getComputedStyle(element).fontWeight >= 700);

//			let wcagCompliance = 'Ne respecte pas les critères d\'accessibilité';
			let contrastInfo = 'Ratio actuel : ' + contrastRatio;
			if (isLargeText) {
//				if (contrastRatio >= 3) {
//					wcagCompliance = 'Respecte le niveau AA pour le texte en gros caractères';
//					AcState = false;
//				}
				if (contrastRatio >= 4.5) {
//					wcagCompliance = 'Respecte le niveau AAA pour le texte en gros caractères';
				} else {
					AcMinContrast = 4.5;
					const solutions = ckAcGetContrastSolutions(bgColor, textColor);
					ckAcAddToContrastList(element, currentElement, contrastRatio, AcMinContrast, textColor, bgColor, solutions);
					AcState = false;
				}
				contrastInfo += ' - Ratio requis pour le niveau AAA = 3';
			} else {
//				if (contrastRatio >= 4.5) {
//					wcagCompliance = 'Respecte le niveau AA pour le texte normal';
//					AcState = false;
//				}
				if (contrastRatio >= 7) {
//					wcagCompliance = 'Respecte le niveau AAA pour le texte normal';
				} else {
					AcMinContrast = 7;
					const solutions = ckAcGetContrastSolutions(bgColor, textColor);
					ckAcAddToContrastList(element, currentElement, contrastRatio, AcMinContrast, textColor, bgColor, solutions);
					AcState = false;
				}
				contrastInfo += ' - Ratio requis pour le niveau AAA = 7';
			}
		}
	});
}

function ckAcGetContrastSolutions(bgColor, textColor) {
	const s1 = ckAcGetContrastSolution1(bgColor, textColor);
	const s2 = ckAcGetContrastSolution2(bgColor, textColor);
	const s3 = ckAcGetContrastSolution3(bgColor, textColor);

	return [s1, s2, s3];
}

function ckAcAddItemToContrastResult(index, row) {
	//ckaccessibilitycontrastresult
	let html = '';
	html += '<div class="pbck-accessibility-result-row" onclick="ckAcContrastFocus(' + index + ')">';
	html += '<span class="pbck-accessibility-result-label">' + Joomla.JText._('CK_CONTRAST_RATIO', 'Contrast ratio') + ' : </span>'
	html += '<span class="pbck-accessibility-result-name ckbadge ckbadge-inverse">' + row.contrastRatio.toFixed(2) + '</span> / '
	html += '<span class="pbck-accessibility-result-name ckbadge ckbadge-success">' + row.complianceValue + '</span>'
	html += '<br />'
	html += '<span class="pbck-accessibility-result-label"><b>' + Joomla.JText._('CK_INITIAL_COLORS') + ' :</b></span>'
	html += '<br />'
	html += '<span class="pbck-accessibility-result-color" style="background-color:rgb(' + row.bgColor + '); color:rgb(' + row.textColor + ');">Lorem Ipsum</span>'
	html += '<br />'
	html += '<span class="pbck-accessibility-result-label"><b>' + Joomla.JText._('CK_SOLUTION') + ' 1 :</b> ' + Joomla.JText._('CK_SOLUTION_BOTH_COLORS') + '</span>'
	html += '<br />'
	html += '<span class="pbck-accessibility-result-color" style="background-color:rgb(' + row.solutions[0].bg + '); color:rgb(' + row.solutions[0].text + ');">Lorem Ipsum</span>'
	html += ' <span class="pbck-accessibility-result-color-copy cktip" style="background-color:rgb(' + row.solutions[0].bg + ');" title="' + Joomla.JText._('CK_COPY') + '" onclick="ckAcCopyColorInClipboard(\'' + rgbArrayToHex(row.solutions[0].bg) + '\')"></span>'
	html += ' <span class="pbck-accessibility-result-color-copy cktip" style="background-color:rgb(' + row.solutions[0].text + ');" title="' + Joomla.JText._('CK_COPY') + '" onclick="ckAcCopyColorInClipboard(\'' + rgbArrayToHex(row.solutions[0].text) + '\')"></span>'
//	html += '<span class="ckbutton" onclick="ckAcApplyContrastSolution(' + index + ', ' + row.solutions[0].bg + ', ' + row.solutions[0].text + ')">' + Joomla.JText._('CK_APPLY') + '</span>'
	html += '<br />'
	html += '<span class="pbck-accessibility-result-label"><b>' + Joomla.JText._('CK_SOLUTION') + ' 2 :</b> ' + Joomla.JText._('CK_SOLUTION_KEEP_BACKGROUND') + '</span>'
	html += '<br />'
	html += '<span class="pbck-accessibility-result-color" style="background-color:rgb(' + row.solutions[1].bg + '); color:rgb(' + row.solutions[1].text + ');">Lorem Ipsum</span>'
	html += ' <span class="pbck-accessibility-result-color-copy cktip" style="background-color:rgb(' + row.solutions[1].text + ');" title="' + Joomla.JText._('CK_COPY') + '" onclick="ckAcCopyColorInClipboard(\'' + rgbArrayToHex(row.solutions[1].text) + '\')"></span>'
	html += '<br />'
	html += '<span class="pbck-accessibility-result-label"><b>' + Joomla.JText._('CK_SOLUTION') + ' 3 :</b> ' + Joomla.JText._('CK_SOLUTION_KEEP_TEXT') + '</span>'
	html += '<br />'
	html += '<span class="pbck-accessibility-result-color" style="background-color:rgb(' + row.solutions[2].bg + '); color:rgb(' + row.solutions[2].text + ');">Lorem Ipsum</span>'
	html += ' <span class="pbck-accessibility-result-color-copy cktip" style="background-color:rgb(' + row.solutions[2].bg + ');" title="' + Joomla.JText._('CK_COPY') + '" onclick="ckAcCopyColorInClipboard(\'' + rgbArrayToHex(row.solutions[2].bg) + '\')"></span>'

	html += '</div>';

	return  html;
}

function ckAcAddToContrastList(textEl, bgEl, contrastRatio, complianceValue, textColor, bgColor, solutions) {
	AcContrastList.push(
		{
		textEl: textEl
		, bgEl: bgEl
		, contrastRatio: contrastRatio
		, complianceValue: complianceValue
		, textColor: textColor
		, bgColor: bgColor
		, solutions: solutions
		}
	);
}

function ckAcApplyContrastSolution(index, newBgColor, newTextColor) {
	ckAcContrastFocus(index);
	const bgEl = AcContrastList[index].bgEl;
	const textEl = AcContrastList[index].textEl;
	let oldBgProps = bgEl.parentNode.querySelector('.tab_blocstyles.ckprops');
	let oldTextProps = textEl.parentNode.querySelector('.tab_blocstyles.ckprops');
	let bgPrefix = 'bloc';
	let textPrefix = 'bloc';

	// try to find the row background
	if (! oldBgProps) {
		oldBgProps = bgEl.querySelector('.tab_rowbgstyles.ckprops');
		bgPrefix = 'rowbg';
	}

	if (! oldTextProps || ! oldBgProps) {
		alert('Color property not found');
		return;
	}

	const oldBgColor = oldBgProps.getAttribute(bgPrefix + 'backgroundcolorstart').replace('(','\\(').replace(')','\\)');
	const oldTextColor = oldTextProps.getAttribute('bloccolor').replace('(','\\(').replace(')','\\)');

	if (! oldBgColor || ! oldTextColor) {
		alert('Color value not found');
		return;
	}

	ckAcReplaceColors(bgEl.parentNode, 'tab_' + bgPrefix + 'styles',oldBgColor, newBgColor);
	ckAcReplaceColors(textEl.parentNode, 'tab_blocstyles', oldTextColor, newTextColor);
}

// Find the color that is nearest the initial value that comply to the rule
function adjustColorTowards(color, targetContrastColor) {
	const [r, g, b] = color;
	let [h, s, l] = rgbToHsl(r, g, b);

	const directions = [-1, 1]; // Try darkening and lightening
	let best = color;
	let bestContrast = 0;

	for (let dir of directions) {
		let tempL = l;
		let steps = 0;
		while (steps++ < 50) {
			tempL += dir * 0.02;
			if (tempL < 0 || tempL > 1)
				break;

			const [newR, newG, newB] = hslToRgb(h, s, tempL);
			const lum1 = getLuminance(newR, newG, newB);
			const lum2 = getLuminance(...targetContrastColor);
			const contrast = getContrastRatio(lum1, lum2);

			if (contrast > bestContrast) {
				bestContrast = contrast;
				best = [newR, newG, newB];
				if (contrast >= AcMinContrast)
					return best;
			}
		}
	}

	return best;
}

// === Solutions ===
function ckAcGetContrastSolution1(bg, text) {
	const mid = [
		Math.round((bg[0] + text[0]) / 2),
		Math.round((bg[1] + text[1]) / 2),
		Math.round((bg[2] + text[2]) / 2),
	];
	const newBg = adjustColorTowards(bg, mid);
	const newText = adjustColorTowards(text, newBg);
	return {bg: newBg, text: newText};
}

function ckAcGetContrastSolution2(bg, text) {
	const newText = adjustColorTowards(text, bg);
	return {bg: bg, text: newText};
}

function ckAcGetContrastSolution3(bg, text) {
	const newBg = adjustColorTowards(bg, text);
	return {bg: newBg, text: text};
}


function ckAcReplaceColors(el, tab, oldColor, newColor) {
	if (! oldColor || ! newColor) return;
	var regEx = new RegExp(oldColor, "ig");
	$ck('.ckstyle', el).each(function() {
		var $st = $ck(this);
		$st.html($st.html().replace(regEx, newColor));
	});
	$ck('.' + tab, el).each(function() {
		this.outerHTML = this.outerHTML.replace(regEx, newColor);
	});
	ckSaveAction();
}

function ckAcCopyColorInClipboard(color) {
	CLIPBOARDCOLORCK = color;
	ckWriteClipboardText(color);
}

function ckAcManageIcon(el, text) {
	const iconTagname = el.tagName;
	if (iconTagname !== 'svg' && iconTagname !== 'i') {
		el = el.querySelector('svg') || el.querySelector('i.pbckicon');
	}
	if (! el) return true;

//	iconTagname = el[0].tagName;
	let iconParent = el.parentNode;
	let hasLink = false;
	let parentType;
	while (! iconParent.classList.contains('cktype')) {
		if (iconParent.tagName.toLowerCase() === 'a') {
			parentType = 'anchor';
			hasLink = true;
			break;
		}
		iconParent = iconParent.parentNode;
	}

	let ret = true;
	if (! hasLink) {
		const isIcontext = iconParent.classList.contains('cktype') && iconParent.getAttribute('data-type') === 'icontext';
		if (isIcontext && ! el.getAttribute('aria-label')) {
			el.setAttribute('aria-hidden', 'true');
		} else if (text) {
			el.setAttribute('role', 'img');
			el.setAttribute('aria-label', text);
		} else if (! el.getAttribute('aria-label')) {
			ret = false;
		}
	} else {
		const isButton = iconParent.classList.contains('buttonck');
		if (isButton) {
				const hasText = iconParent.querySelector('.buttontextck').innerText ? true : false;

				if (text && ! hasText) {
					el.removeAttribute('aria-hidden');
					el.setAttribute('role', 'img');
					el.setAttribute('aria-label', text);
				} else if (text && hasText) {
					el.setAttribute('aria-hidden', 'true');
					el.removeAttribute('role', 'img');
					el.removeAttribute('aria-label');
				} else if (! hasText && ! el.getAttribute('aria-label')) {
					ret = false;
				} else if (hasText && ! el.getAttribute('aria-hidden')) {
					el.setAttribute('aria-hidden', 'true');
				}
		} else {
			if (text) {
				el.removeAttribute('aria-label');
				if (parentType === 'anchor') {
					iconParent.setAttribute('aria-label', text);
					el.setAttribute('aria-hidden', 'true');
				}
			} else if (! iconParent.getAttribute('aria-label')) {
				ret = false;
			}
		}
	}

	return ret;
}

function ckAcManageiconFromResult(index, text) {
	const el = AcDomList[index][0];
	ckAcManageIcon(el, text);
}

function ckAcManagealtFromResult(index, text) {
	const el = AcDomList[index][0];
	el.setAttribute('alt', text);
}

Anon7 - 2022
AnonSec Team