1/*! 2 * Skill Lab - súhlas s cookies (Google Consent Mode v2 + Meta Pixel) 3 * 4 * Ako to funguje: 5 * - Voľba návÅ¡tevnÃka sa ukladá do localStorage pod kľúÄom "sl_consent" 6 * ("all" = vÅ¡etko povolené, "necessary" = len nevyhnutné). 7 * - Inline skript v <head> každej stránky si voľbu preÄÃta eÅ¡te PRED 8 * naÄÃtanÃm Google Analytics a Meta Pixelu a nastavÃ: 9 * gtag('consent','default', ...) a window.SL_CONSENT 10 * - Tento súbor len zobrazà liÅ¡tu (ak voľba eÅ¡te nie je) a po kliknutà 11 * zavolá gtag('consent','update') + window.slConsentGranted(). 12 * - Odkaz "Nastavenia cookies" v pätiÄke volá window.slOpenConsent(). 13 */ 14(function () { 15 'use strict'; 16 17 var KEY = 'sl_consent'; 18 var POLICY_URL = '/vop/'; 19 20 // Voľba sa ukladá do localStorage (tento web) aj do cookie pre celú doménu 21 // .skills.sk, aby ju vedel preÄÃtaÅ¥ aj rezervaÄný systém www2.skills.sk. 22 function readCookie() { 23 var m = document.cookie.match(/(?:^|;\s*)sl_consent=(all|necessary)(?:;|$)/); 24 return m ? m[1] : null; 25 } 26 function read() { 27 var v = null; 28 try { v = localStorage.getItem(KEY); } catch (e) {} 29 return v || readCookie(); 30 } 31 function save(v) { 32 try { localStorage.setItem(KEY, v); } catch (e) {} 33 var domain = /(^|\.)skills\.sk$/i.test(location.hostname) ? '; Domain=.skills.sk' : ''; 34 document.cookie = KEY + '=' + v + '; Path=/; Max-Age=31536000; SameSite=Lax' + domain + 35 (location.protocol === 'https:' ? '; Secure' : ''); 36 } 37 38 function consentState(granted) { 39 var v = granted ? 'granted' : 'denied'; 40 return { ad_storage: v, ad_user_data: v, ad_personalization: v, analytics_storage: v }; 41 } 42 43 function applyChoice(all) { 44 save(all ? 'all' : 'necessary'); 45 if (typeof window.gtag === 'function') { 46 window.gtag('consent', 'update', consentState(all)); 47 } 48 if (all) { 49 window.SL_CONSENT = true; 50 if (typeof window.slConsentGranted === 'function') window.slConsentGranted(); 51 } 52 } 53 54 var box = null; 55 56 function close() { 57 if (box && box.parentNode) box.parentNode.removeChild(box); 58 box = null; 59 } 60 61 function render() { 62 if (box) return; 63 box = document.createElement('div'); 64 box.id = 'sl-consent'; 65 box.setAttribute('role', 'dialog'); 66 box.setAttribute('aria-label', 'Nastavenia cookies'); 67 box.innerHTML = 68 '<style>' + 69 '#sl-consent{position:fixed;left:1rem;right:1rem;bottom:1rem;z-index:10000;max-width:34rem;margin:0 auto;' + 70 'background:#fff;color:#111827;border:1px solid #e5e7eb;border-radius:1rem;box-shadow:0 12px 40px rgba(0,0,0,.14);' + 71 'padding:1.125rem 1.25rem;font-family:Barlow,system-ui,sans-serif;font-size:.875rem;line-height:1.5}' + 72 '#sl-consent h2{font-family:"Barlow Condensed",Barlow,sans-serif;font-weight:900;font-size:1.125rem;text-transform:uppercase;margin:0 0 .375rem}' + 73 '#sl-consent p{margin:0 0 .875rem;color:#4b5563}' + 74 '#sl-consent a{color:#b02a32;text-decoration:underline}' + 75 '#sl-consent .sl-c-btns{display:flex;gap:.5rem;flex-wrap:wrap}' + 76 '#sl-consent button{font:inherit;font-weight:700;padding:.625rem 1.125rem;border-radius:10px;cursor:pointer;border:1.5px solid #b02a32}' + 77 '#sl-consent .sl-c-all{background:#b02a32;color:#fff}' + 78 '#sl-consent .sl-c-nec{background:#fff;color:#b02a32}' + 79 '#sl-consent button:focus-visible{outline:3px solid #111827;outline-offset:2px}' + 80 '@media(max-width:480px){#sl-consent{left:.5rem;right:.5rem;bottom:.5rem}#sl-consent button{flex:1 1 auto}}' + 81 '</style>' + 82 '<h2>Cookies na tomto webe</h2>' + 83 '<p>Nevyhnutné cookies fungujú vždy. Ak súhlasÃte, použijeme aj cookies na meranie návÅ¡tevnosti ' + 84 '(Google Analytics) a úÄinnosti reklamy (Meta Pixel). Voľbu môžete kedykoľvek zmeniÅ¥ v pätiÄke. ' + 85 '<a href="' + POLICY_URL + '">Viac o spracúvanà údajov</a></p>' + 86 '<div class="sl-c-btns">' + 87 '<button type="button" class="sl-c-all">PrijaÅ¥ vÅ¡etko</button>' + 88 '<button type="button" class="sl-c-nec">Len nevyhnutné</button>' + 89 '</div>'; 90 document.body.appendChild(box); 91 box.querySelector('.sl-c-all').addEventListener('click', function () { applyChoice(true); close(); }); 92 box.querySelector('.sl-c-nec').addEventListener('click', function () { applyChoice(false); close(); }); 93 box.querySelector('.sl-c-all').focus({ preventScroll: true }); 94 } 95 96 window.slOpenConsent = render; 97 98 if (!read()) { 99 if (document.body) render(); else document.addEventListener('DOMContentLoaded', render); 100 } 101})();
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.