PageSourceSearch

https://www.cad22.com/plugins/lae-cookies/assets/js/popup-f.15.0.js

js cad22.com collected 2026-10-02 04:40:46 UTC 9,526 bytes, 280 lines download raw bytes

1(function() {
2
3	var isAdmin = laeCookiesOptions.is_user_logged_in == '1';
4	var lHost = window.location.host;
5	var isLoc = lHost && lHost.endsWith('.loc');
6	var showBanner = false;
7	var tac_ck_name = laeCookiesOptions.cookieName ? laeCookiesOptions.cookieName : 'lae-rgpd';
8	tarteaucitron.job = tarteaucitron.job || [];
9
10	if (
11		   laeCookiesOptions.TAC_TIKTOK
12		|| laeCookiesOptions.TAC_SNAPCHAT
13		|| laeCookiesOptions.TAC_GGA
14		|| laeCookiesOptions.TAC_LINKEDIN
15		|| laeCookiesOptions.TAC_ADS
16		|| laeCookiesOptions.TAC_FB
17		|| laeCookiesOptions.TAC_BING
18		|| laeCookiesOptions.TAC_CLARITY
19		|| laeCookiesOptions.TAC_CRITEO
20		|| laeCookiesOptions.TAC_MATOMO
21	) {
22		showBanner = true;
23	}
24	
25	tarteaucitron.addInternalScript('/plugins/lae-cookies/assets/js/custom-services.js', '', function () {
26		tarteaucitron.job = tarteaucitron.job || [];
27		if ( ! isAdmin && ! isLoc ) {
28			if ( laeCookiesOptions.TAC_TIKTOK ) {
29				tarteaucitron.job.push('TAC_TIKTOK');
30			}
31			if ( laeCookiesOptions.TAC_SNAPCHAT ) {
32				tarteaucitron.job.push('TAC_SNAPCHAT');
33			}
34			if ( laeCookiesOptions.TAC_GGA ) {
35				tarteaucitron.job.push('TAC_GGA');
36			}
37			if ( laeCookiesOptions.TAC_LINKEDIN ) {
38				tarteaucitron.job.push('TAC_LINKEDIN');
39			}
40			if ( laeCookiesOptions.TAC_ADS ) {
41				tarteaucitron.job.push('TAC_ADS');
42			}
43			if ( laeCookiesOptions.TAC_FB ) {
44				tarteaucitron.job.push('TAC_FB');
45			}
46			if ( laeCookiesOptions.TAC_BING ) {
47				tarteaucitron.job.push('TAC_BING');
48			}
49			if ( laeCookiesOptions.TAC_CLARITY ) {
50				tarteaucitron.job.push('TAC_CLARITY');
51			}
52			if ( laeCookiesOptions.TAC_CRITEO ) {
53				tarteaucitron.job.push('TAC_CRITEO');
54			}
55			if ( laeCookiesOptions.TAC_MATOMO ) {
56				tarteaucitron.job.push('TAC_MATOMO');
57			}
58		}
59	});
60
61	if (!isAdmin && !isLoc) {
62		/* Services liés aux stats seulement pour internautes */
63
64		if (!laeCookiesOptions.gtmDur && laeCookiesOptions.googletagmanagerId && laeCookiesOptions.googletagmanagerId != 'GTM-XXXXXXX') {
65			tarteaucitron.user.googletagmanagerId = '' + laeCookiesOptions.googletagmanagerId;
66			tarteaucitron.job.push('googletagmanager');
67			showBanner = true;
68		} else if (laeCookiesOptions.analyticsUa) {
69			if (laeCookiesOptions.analyticsUa.substring(0,3)==='UA-') {
70				tarteaucitron.user.analyticsUa = laeCookiesOptions.analyticsUa;
71				// tarteaucitron.user.analyticsMore = function () { /* add here your optionnal ga.push() */ };
72				tarteaucitron.job.push('analytics');
73				showBanner = true;
74			} else {
75				tarteaucitron.user.gtagUa = laeCookiesOptions.analyticsUa;
76				// tarteaucitron.user.gtagMore = function () { /* add here your optionnal gtag() */ };
77				tarteaucitron.job.push('gtag');
78				showBanner = true;
79			}
80		}
81		if (laeCookiesOptions.facebookpixelId) {
82			tarteaucitron.user.facebookpixelId = '' + laeCookiesOptions.facebookpixelId;
83			// tarteaucitron.user.facebookpixelMore = function () { /* add here your optionnal facebook pixel function */ };
84			tarteaucitron.job.push('facebookpixel');
85			showBanner = true;
86		}
87		if (laeCookiesOptions.tiktokpixelId) {
88			tarteaucitron.user.tiktokId = '' + laeCookiesOptions.tiktokpixelId;
89			tarteaucitron.job.push('tiktok');
90			showBanner = true;
91		}
92		if (laeCookiesOptions.pinterestpixelId) {
93			tarteaucitron.user.pinterestpixelId = '' + laeCookiesOptions.pinterestpixelId;
94			tarteaucitron.job.push('pinterestpixel');
95			showBanner = true;
96		}
97		if (laeCookiesOptions.linkedininsighttag) {
98			tarteaucitron.user.linkedininsighttag = '' + laeCookiesOptions.linkedininsighttag;
99			tarteaucitron.job.push('linkedininsighttag');
100			showBanner = true;
101		}
102		if (laeCookiesOptions.adsensecapub) {
103			tarteaucitron.user.adsensecapub = '' + laeCookiesOptions.adsensecapub;
104			tarteaucitron.job.push('adsenseauto');
105			showBanner = true;
106		}
107	}
108
109	if (laeCookiesOptions.youtube) {
110		tarteaucitron.job.push('youtube');
111		tarteaucitron.job.push('youtubeapi');
112		showBanner = true;
113	}
114
115	if (laeCookiesOptions.vimeo) {
116		tarteaucitron.job.push('vimeo');
117		tarteaucitron.job.push('vimeoapi');
118		showBanner = true;
119	}
120	
121	function getCookie(cname) {
122		let name = cname + "=";
123		let decodedCookie = decodeURIComponent(document.cookie);
124		let ca = decodedCookie.split(';');
125		for(let i = 0; i <ca.length; i++) {
126			let c = ca[i];
127			while (c.charAt(0) == ' ') {
128				c = c.substring(1);
129			}
130			if (c.indexOf(name) == 0) {
131				return c.substring(name.length, c.length);
132			}
133		}
134		return "";
135	}
136
137	var LaeRgpdPop = function () {
138		this.dom = null;
139		var popMasque = localStorage.getItem(tac_ck_name + '-pop');
140		if (!(popMasque && popMasque === 'true')) {
141			this.show();
142			return;
143		} 
144		// else verification si tarte au citron en attente
145		// si cookie supprimé à la main ou si internaute utilise bouton personnaliser sans répondre
146		var now = Date.now();
147		var checkCookie = localStorage.getItem(tac_ck_name + '-cookie-check');
148		if (!checkCookie || parseInt(checkCookie) < (now - 24 * 60 * 60 * 1000)) {
149			// verification cookie une seule fois par jour, pas à chaque page
150			var cookieRgpd = getCookie(tac_ck_name);
151			if (!cookieRgpd || cookieRgpd.includes('wait')) {
152				this.show();
153			}
154		}
155	};	
156	LaeRgpdPop.prototype.show = function () {
157		var that = this;
158		this.dom = document.createElement('div');
159		if (laeCookiesOptions.alertBigPrivacy && laeCookiesOptions.alertBigPrivacy != '') {
160			tarteaucitron.lang.alertBigPrivacy  = laeCookiesOptions.alertBigPrivacy;
161		}
162		this.dom.innerHTML = '<div class="txt">' + tarteaucitron.lang.alertBigPrivacy + '<p><a target="_blank" href="' + laeCookiesOptions.privacyUrl + '">' + tarteaucitron.lang.privacyUrl + '</a></p></div>';
163		
164		this.btns = document.createElement('div');
165		this.btns.setAttribute('class', 'btns');
166
167		this.denyBtn = document.createElement('button');
168		this.denyBtn.setAttribute('class', 'btn deny');
169		this.denyBtn.innerHTML = tarteaucitron.lang.denyAll;
170		this.denyBtn.onclick = function() {
171			tarteaucitron.userInterface.respondAll(false);
172			that.hide();
173			that.sendStatDeny();
174		};
175
176		this.personalizeBtn = document.createElement('button');
177		this.personalizeBtn.setAttribute('class', 'btn personalize');
178		this.personalizeBtn.innerHTML = tarteaucitron.lang.personalize;
179		this.personalizeBtn.onclick = function() {
180			tarteaucitron.userInterface.openPanel();
181			that.hide(false);
182			that.sendStatPersonalize();
183		};
184		if (laeCookiesOptions.allowAll && laeCookiesOptions.allowAll != '') {
185			tarteaucitron.lang.allowAll  = laeCookiesOptions.allowAll;
186		}
187		this.allowBtn = document.createElement('button');
188		this.allowBtn.setAttribute('class', 'btn allow');
189		this.allowBtn.innerHTML = tarteaucitron.lang.allowAll;
190		this.allowBtn.onclick = function() {
191			tarteaucitron.userInterface.respondAll(true);
192			that.hide();
193			that.sendStatAllow();
194		};
195
196		this.btns.appendChild(that.allowBtn);
197		this.btns.appendChild(that.personalizeBtn);
198		this.btns.appendChild(that.denyBtn);
199
200		this.dom.appendChild(that.btns);
201
202		this.btnsD = document.createElement('div');
203		this.btnsD.setAttribute('class', 'btns btns--desk');
204
205		this.denyBtnD = that.denyBtn.cloneNode(true);
206		this.denyBtnD.onclick = function() {
207			tarteaucitron.userInterface.respondAll(false);
208			that.hide();
209			that.sendStatDeny();
210		};
211
212		this.personalizeBtnD = that.personalizeBtn.cloneNode(true);
213		this.personalizeBtnD.onclick = function() {
214			tarteaucitron.userInterface.openPanel();
215			that.hide(false);
216			that.sendStatPersonalize();
217		};
218
219		this.allowBtnD = that.allowBtn.cloneNode(true);
220		this.allowBtnD.onclick = function() {
221			tarteaucitron.userInterface.respondAll(true);
222			that.hide();
223			that.sendStatAllow();
224		};
225		
226		this.btnsD.appendChild(this.denyBtnD);
227		this.btnsD.appendChild(this.personalizeBtnD);
228		this.btnsD.appendChild(this.allowBtnD);
229
230		this.dom.appendChild(that.btnsD);
231
232		this.dom.id = 'lae-rgpd-pop';
233		document.getElementById('tarteaucitronRoot').appendChild(that.dom);
234		const skipLinksList = document.querySelector('ul.skip-links');
235    if (skipLinksList) {
236        const listItem = document.createElement('li');
237        const anchor = document.createElement('a');
238        anchor.href = '#lae-rgpd-pop';
239				anchor.classList.add('skip-link');
240				anchor.classList.add('screen-reader-text');
241        anchor.textContent = 'Aller au bandeau consentement cookies'; // Texte du lien
242        listItem.appendChild(anchor);
243        skipLinksList.prepend(listItem);
244    }
245	};
246	LaeRgpdPop.prototype.sendStatDeny = function () {
247		var xhr = new XMLHttpRequest();
248		xhr.withCredentials = true;
249		xhr.open("GET", "https://webservices.laetis.fr/public/rgpd/data-stat-popup/deny--" + window.location.hostname);
250		xhr.send();
251	};
252	LaeRgpdPop.prototype.sendStatPersonalize = function () {
253		var xhr = new XMLHttpRequest();
254		xhr.withCredentials = true;
255		xhr.open("GET", "https://webservices.laetis.fr/public/rgpd/data-stat-popup/personalize--" + window.location.hostname);
256		xhr.send();
257	};
258	LaeRgpdPop.prototype.sendStatAllow = function () {
259		var xhr = new XMLHttpRequest();
260		xhr.withCredentials = true;
261		xhr.open("GET", "https://webservices.laetis.fr/public/rgpd/data-stat-popup/allow--" + window.location.hostname);
262		xhr.send();
263	};
264	LaeRgpdPop.prototype.hide = function (setCookieCheck=true) {
265		localStorage.setItem(tac_ck_name + '-pop', 'true');
266		if (setCookieCheck) {
267			var now = Date.now();
268			localStorage.setItem(tac_ck_name + '-cookie-check', now);
269		}
270		this.dom.remove();
271	};
272
273	
274	if (!isAdmin && !isLoc && showBanner) {
275		window.addEventListener("tac.root_available", function () {
276			new LaeRgpdPop();
277		}, false);
278	}
279
280})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.