PageSourceSearch

https://www.classonlive.com/js_common/own/accept-cookies.js?v1

js classonlive.com collected 2026-10-03 21:18:49 UTC 2,491 bytes, 89 lines download raw bytes

1//@ sourceURL=accept-cookies.js
2window.dataLayer = window.dataLayer || [];
3if (typeof gtag == 'function') {
4            gtag('consent', 'default', {
5                'ad_storage': 'denied',
6                'analytics_storage': 'denied',
7                'ad_user_data': 'denied',
8                'ad_personalization': 'denied'
9            });}
10var comprobar = getCookie("avisocookies");
11console.log(comprobar);
12if (comprobar != null) {
13	if (comprobar == "1") {
14		sendConsent();
15        activateOwnTracking();
16	}
17} else {
18
19	$("#cookies-message").removeClass("d-none");
20}
21
22function setCookie(name, value, expires, path, domain, secure) {
23	document.cookie = name + "=" + escape(value) + ((expires == null) ? "" : "; expires=" + expires
24		.toGMTString()) + ((path == null) ? "" : "; path=" + path) + ((domain == null) ? "" :
25			"; domain=" +
26			domain) + ((secure == null) ? "" : "; secure")
27}
28
29function getCookie(name) {
30	var cname = name + "=";
31	var dc = document.cookie;
32	if (dc.length > 0) {
33		begin = dc.indexOf(cname);
34		if (begin != -1) {
35			begin += cname.length;
36			end = dc.indexOf(";", begin);
37			if (end == -1) end = dc.length;
38			return unescape(dc.substring(begin, end))
39		}
40	}
41	return null
42}
43
44function delCookie(name, path, domain) {
45	if (getCookie(name)) {
46		document.cookie = name + "=" + ((path == null) ? "" : "; path=" + path) + ((domain == null) ? "" :
47			"; domain=" + domain) + "; expires=Thu, 01-Jan-70 00:00:01 GMT"
48	}
49}
50
51function acceptCookies() {
52	var expiration = new Date();
53	expiration.setTime(expiration.getTime() + (60000 * 60 * 24 * 365));
54	setCookie('avisocookies', '1', expiration, '/');
55	$("#cookies-message").addClass("d-none");
56	sendConsent();
57    activateOwnTracking();
58}
59
60function rejectCookies() {
61	var expiration = new Date();
62	expiration.setTime(expiration.getTime() + (60000 * 60 * 24 * 365));
63	setCookie('avisocookies', '0', expiration, '/');
64	$("#cookies-message").addClass("d-none");
65	deniedConsent();
66}
67
68function sendConsent() {
69	if (typeof gtag == 'function') {
70		gtag('consent', 'update', {
71			'ad_storage': 'granted',
72			'analytics_storage': 'granted',
73			'ad_user_data': 'granted',
74			'ad_personalization': 'granted'
75		});
76	}
77}
78
79function deniedConsent() {
80	if (typeof gtag == 'function') {
81		gtag('consent', 'update', {
82			'ad_storage': 'denied',
83			'analytics_storage': 'denied',
84			'ad_user_data': 'denied',
85			'ad_personalization': 'denied'
86
87		});
88	}
89}

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.