PageSourceSearch

https://lionx.ai/themes/default/assets/js/gdpr.js

js lionx.ai collected 2026-10-05 12:14:07 UTC 1,262 bytes, 46 lines download raw bytes

1( () => {
2	'use strict';
3
4	document.addEventListener('DOMContentLoaded', function() {
5		const gdpr = getCookie( 'magicai_gdpr' );
6		const gdpr_selector = document.querySelector('#gdpr');
7
8		if ( gdpr ) {
9			gdpr_selector.classList.add('hidden');
10		}
11
12		document.querySelector('#gdpr button').addEventListener('click', function(){
13			gdpr_selector.classList.add('hidden');
14			setCookie('magicai_gdpr', 'accepted', 365);
15		});
16
17	});
18
19
20} )();
21
22function setCookie( cookieName, cookieValue, expirationDays ) {
23	'use strict';
24	const date = new Date();
25	date.setTime( date.getTime() + ( expirationDays * 24 * 60 * 60 * 1000 ) ); // Convert days to milliseconds
26	const expires = 'expires=' + date.toUTCString();
27	document.cookie = cookieName + '=' + cookieValue + ';' + expires + ';path=/';
28}
29
30function getCookie( cookieName ) {
31	'use strict';
32	const name = cookieName + '=';
33	const decodedCookie = decodeURIComponent( document.cookie );
34	const cookieArray = decodedCookie.split( ';' );
35
36	for ( let i = 0; i < cookieArray.length; i++ ) {
37		let cookie = cookieArray[ i ];
38		while ( cookie.charAt( 0 ) === ' ' ) {
39			cookie = cookie.substring( 1 );
40		}
41		if ( cookie.indexOf( name ) === 0 ) {
42			return cookie.substring( name.length, cookie.length );
43		}
44	}
45	return '';
46}

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.