PageSourceSearch

https://cebras.cz/js/optin.js?6.355

js cebras.cz collected 2026-10-07 03:26:24 UTC 15,630 bytes, 279 lines download raw bytes

1!function (n, c) {
2
3    function getCookie(name) {
4        var match = document.cookie.match(RegExp('(?:^|;\\s*)' + name + '=([^;]*)'));
5        return match ? match[1] : null;
6    }
7
8    if (!getCookie('optinHidden') || getCookie('optinHidden') !== '1') {
9
10        let name = "optin";
11        let body = c.body;
12        let head = c.head;
13        let style = c.createElement("style");
14        let optinBoxOverlay = c.createElement("div");
15        let optinBoxWrapper = c.createElement("div");
16        let optinBoxText = c.createElement("div");
17        let optinBoxButtons = c.createElement("div");
18        let optinBox = c.createElement("div");
19        let optinCloseButton = c.createElement("a");
20        let optinCloseSettingButton = c.createElement("a");
21        let optinLangButton = c.createElement("a");
22        let textType = 1;
23        let textLang = 1;
24
25        let values = {
26            version: "0.1.0",
27            css: "" +
28                "#tracy-debug:not(body) { z-index: 9999999999; } " +
29                "div." + name + "Overlay { position: fixed; bottom: 0; left: 0; right: 0; top: 0; z-index: 999999998; background: rgba(255,255,255,85%); } " +
30                "div." + name + "Overlay.out { display: none; } " +
31                "div." + name + "Overlay.reload { background: rgba(200,200,200,85%); } " +
32                "div." + name + "Overlay.reload .optinBtn { background: rgba(200,200,200,85%); cursor: default; color: #666; } " +
33                "div." + name + "Overlay.reload .optinBtn:hover { color: #666; } " +
34                "div." + name + "Overlay div." + name + "Wrapper { align-items: center; color: #000; display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex: 1 0 auto; flex: 1 0 auto; -ms-flex-direction: column; flex-direction: column; height: 100%; justify-content: center; left: 0; overflow-y: auto; position: fixed; text-align: center; top: 0; width: 100%; z-index: 999999999; } " +
35                "div." + name + "Overlay .optinHeader .optinCloseSettingButton { display: none; } " +
36                "div." + name + " { text-align: left; max-width: 880px; min-width: 270px; min-height: 250px; background: #fff; box-shadow: 0 0 40px 3px rgb(0, 0, 0, 30%); border-radius: 5px; max-height: 90%; overflow: hidden; display: flex; flex-direction: column; line-height: 170%; font-size: 16px; } " +
37                "div." + name + "Header a." + name + "CloseBtn { float: right; margin: -15px 0 0 0; color: #777; text-decoration: none; cursor: pointer; } " +
38                "div." + name + "Header a." + name + "CloseBtn.hidden { display: none; } " +
39                "div." + name + "BoxText { padding: 40px 25px; overflow-y: auto; max-height: 100%; } " +
40                "div." + name + "BoxText label { display: block; margin: 0; padding: 0; overflow: auto; } " +
41                "div." + name + "BoxText label small { color: #555; } " +
42                "div." + name + "BoxText label small:not(:empty):before { content: '('; } " +
43                "div." + name + "BoxText label small:not(:empty):after { content: ')'; } " +
44                "div." + name + "BoxText input[type=\"checkbox\"] { width: 24px; height: 24px; float: left; margin: 0 5px 3px 0; position: inherit; left: auto; right: auto; top: auto; bottom: auto; visibility: visible; opacity: 1; } " +
45                "div." + name + "BoxButtons { padding: 15px 25px 0 25px; text-align: center; border-top: 1px solid #f2f2f2; } " +
46                "div." + name + "Header { padding: 0 15px 15px 15px; font-size: 30px; } " +
47                "div." + name + "Text { display: block; padding: 0 15px; } " +
48                "a." + name + "Href { display: block; padding: 0 15px 15px 15px; color: #444; font-size: 90%; } " +
49                "a." + name + "Btn { display: inline-block; background-color: #fff; border: 1px solid rgba(0,0,0,20%); color: #404040; font-size: 18px; font-weight: bold; text-decoration: none; padding: 15px 30px; margin: 0 15px 15px 15px; cursor: pointer; border-radius: 3px; } " +
50                "a." + name + "Btn:hover { background-color: #f0f0f0; } " +
51                "a." + name + "Accept {  } " +
52                "a." + name + "Reject { color: #606060; } " +
53
54                "div." + name + "OverlayBottom { top: unset; } " +
55                "div." + name + "OverlayBottom div." + name + "Wrapper { height: auto; bottom: 0; top: unset } " +
56                "div." + name + "OverlayBottom div." + name + "Wrapper div." + name + " { max-width: unset; width: 100%; border-radius: 0; flex-direction: row; border-top: 1px solid rgba(0,0,0,20%);; min-height: 200px; } " +
57                "div." + name + "OverlayBottom div." + name + "Wrapper div." + name + "BoxText { padding: 40px 25px 0 25px; width: 100%; } " +
58                "div." + name + "OverlayBottom div." + name + "Wrapper div." + name + "BoxButtons { border-top: 0 none; padding: 40px 25px 0 25px; } " +
59                "@media (max-width: 760px) { div." + name + "OverlayBottom div." + name + "Wrapper div." + name + " { flex-direction: column; } " +
60
61                "",
62            i18n: {
63                header: "Nastavení webu na míru",
64                accept: "Souhlasím",
65                setting: "Další volby",
66                hrefText: "více informací",
67                href: "",
68                reject: "Nesouhlasím",
69                link: "/gdpr/",
70            },
71        };
72        values.i18n.text = "Využíváme cookies a další technologie k tomu, aby zajistily spolehlivost a bezpečnost stránek, sledovaly jejich výkonnost a zprostředkovaly personalizovaný zážitek. Za tímto účelem shromažďujeme informace o uživatelích a jejich chování.\n" +
73            "Kliknutím na klávesu “" + values.i18n.accept + "” souhlasíte s tím, že tyto informace budeme sdílet se třetími stranami. Pokud toto odmítnete budeme používat jen základní cookies a bohužel nebudete dostávat žádný personalizovaný obsah.";
74
75
76        function optinGenerateContent() {
77            if (textType === 1) {
78                optinText.innerHTML = values.i18n.text.replaceAll("\n", "<br />");
79                textType = 2;
80                optinSetting.innerHTML = values.i18n.setting;
81                optinAccept.innerHTML = values.i18n.accept;
82                optinCloseSettingButton.classList.add('hidden');
83                optinCloseButton.classList.remove('hidden')
84            } else {
85                let dataFunctionalityText = "";
86                if(dataFunctionality.split(", ").length > 0 && dataFunctionality !== "") {
87                    dataFunctionalityText = dataFunctionality.split(", ").length;
88                }
89                let dataAnalyticalText = "";
90                if(dataAnalytical.split(", ").length > 0 && dataAnalytical !== "") {
91                    dataAnalyticalText = dataAnalytical.split(", ").length;
92                }
93                let dataAdsText = "";
94                if(dataAds.split(", ").length > 0 && dataAds !== "") {
95                    dataAdsText = dataAds.split(", ").length;
96                }
97
98                settingText = '<strong>Účely vyžadující souhlas uživatele:</strong><br />' +
99                    'Pro jednotlivé účely (typy zpracování) můžete upravit své nastavení a svou volbu potvrdit tlačítkem „Uložit nastavení“:<br />' +
100                    '<label><input type="checkbox" id="optIn-required" checked="checked" disabled /> Nezbytně nutné</label>' +
101                    '<label><input type="checkbox" id="optIn-functionality" name="" /> Funkční <small title="' + dataFunctionality.replaceAll(', ', "\n") + '">' + dataFunctionalityText + '</small></label>' +
102                    '<label><input type="checkbox" id="optIn-analytical" name="" /> Statistické <small title="' + dataAnalytical.replaceAll(', ', "\n") + '">' + dataAnalyticalText + '</small></label>' +
103                    '<label><input type="checkbox" id="optIn-ads" name="" /> Pro reklamní účely <small title="' + dataAds.replaceAll(', ', "\n") + '">' + dataAdsText + '</small></label>';
104                optinText.innerHTML = settingText;
105                textType = 1;
106                optinCloseButton.classList.add('hidden');
107                optinCloseSettingButton.classList.remove('hidden');
108                optinAccept.innerHTML = 'Povolit vše';
109
110                optinSetting.innerHTML = 'Uložit nastavení';
111
112                optinSetting.removeEventListener('click', optinSettingListener);
113
114                optinSetting.addEventListener("click", function () {
115                    let day = 1;
116                    let functionality = 0;
117                    let analytical = 0;
118                    let ads = 0;
119
120                    let functionalityElementX = document.getElementById('optIn-functionality');
121                    if(functionalityElementX.checked) {
122                        day = 365;
123                        functionality = 1;
124                    }
125
126                    let analyticalElementX = document.getElementById('optIn-analytical');
127                    if(analyticalElementX.checked) {
128                        day = 365;
129                        analytical = 1;
130                    }
131
132                    let adsElementX = document.getElementById('optIn-ads');
133                    if(adsElementX.checked) {
134                        day = 365;
135                        ads = 1;
136                    }
137
138                    document.cookie = `optinHidden=1; path=/; max-age=${60 * 60 * 24 * day};`;
139                    document.cookie = `optinAcceptFunctionality=${functionality}; path=/; max-age=${60 * 60 * 24 * day};`;
140                    document.cookie = `optinAcceptAnalytical=${analytical}; path=/; max-age=${60 * 60 * 24 * day};`;
141                    document.cookie = `optinAcceptAds=${ads}; path=/; max-age=${60 * 60 * 24 * day};`;
142                    optinBoxOverlay.classList.add('out');
143                    if(functionality == 1) {
144                        triggerOptedInScriptsFunctionality();
145                    }
146                    if(analytical == 1) {
147                        triggerOptedInScriptsAnalytical();
148                    }
149                    if(ads == 1) {
150                        triggerOptedInScriptsAds();
151                    }
152                    //optinGenerateContent();
153                }, false);
154
155            }
156        }
157
158        var dataAds, dataAnalytical, dataFunctionality = '';
159        var optinConfig = document.getElementById("optinConfig");
160        let dataPosition = 0;
161        let dataReload = 0;
162        if (optinConfig) {
163            let dataHeader = optinConfig.getAttribute('data-header');
164            let dataText = optinConfig.getAttribute('data-text');
165            let dataHref = optinConfig.getAttribute('data-file');
166            dataReload = optinConfig.getAttribute('data-reload');
167            dataPosition = optinConfig.getAttribute('data-position');
168            dataAds = optinConfig.getAttribute('data-ads');
169            dataAnalytical = optinConfig.getAttribute('data-analytical');
170            dataFunctionality = optinConfig.getAttribute('data-functionality');
171            if(optinConfig.getAttribute('data-accept')) {
172                values.i18n.accept = optinConfig.getAttribute('data-accept');
173            }
174            if(optinConfig.getAttribute('data-setting')) {
175                values.i18n.setting = optinConfig.getAttribute('data-setting');
176            }
177            if(optinConfig.getAttribute('data-reject')) {
178                values.i18n.reject = optinConfig.getAttribute('data-reject');
179            }
180            if (dataHeader) {
181                values.i18n.header = dataHeader;
182            }
183            if (dataHeader) {
184                values.i18n.text = dataText;
185            }
186            if(optinConfig.getAttribute('data-longtext')) {
187                values.i18n.text = optinConfig.getAttribute('data-longtext');
188            }
189            if (dataHref) {
190                values.i18n.href = dataHref;
191            }
192        }
193
194        style.type = "text/css" /* for very old browser */
195        style.innerHTML = values.css
196        head.appendChild(style);
197
198        let optinHeader = c.createElement("div");
199        optinHeader.setAttribute('class', name + 'Header');
200        optinHeader.innerHTML = values.i18n.header;
201        optinBoxText.appendChild(optinHeader);
202
203        optinCloseButton.setAttribute('class', name + 'CloseButton ' + name + 'CloseBtn');
204        optinCloseButton.innerHTML = '&times;';
205        optinCloseButton.addEventListener("click", function () {
206            optinBoxOverlay.classList.add('out');
207        }, false);
208        optinHeader.appendChild(optinCloseButton);
209
210
211        optinCloseSettingButton.setAttribute('class', name + 'CloseSettingButton ' + name + 'CloseBtn');
212        optinCloseSettingButton.innerHTML = '&times;';
213        optinCloseSettingButton.addEventListener("click", function () {
214            optinGenerateContent();
215        }, false);
216        optinHeader.appendChild(optinCloseSettingButton);
217
218        let optinText = c.createElement("div");
219        optinText.setAttribute('class', name + 'Text');
220        optinBoxText.appendChild(optinText);
221
222        let optinFile = c.createElement("a");
223        optinFile.setAttribute('class', name + 'Href');
224        optinFile.setAttribute('href', values.i18n.href);
225        optinFile.setAttribute('target', '_blank');
226        optinFile.innerHTML = values.i18n.hrefText;
227        optinBoxText.appendChild(optinFile);
228
229
230        let optinSetting = c.createElement("a");
231        optinSetting.setAttribute('class', name + 'Btn ' + name + 'Setting');
232        let optinSettingListener = function () { optinGenerateContent(); };
233        optinSetting.addEventListener("click", optinSettingListener, false);
234        optinSetting.innerHTML = values.i18n.setting;
235        optinBoxButtons.appendChild(optinSetting);
236
237        let optinAccept = c.createElement("a");
238        optinAccept.setAttribute('class', name + 'Btn ' + name + 'Accept');
239        optinAccept.addEventListener("click", function () {
240            document.cookie = `optinHidden=1; path=/; max-age=${60 * 60 * 24 * 365};`;
241            document.cookie = `optinAcceptFunctionality=1; path=/; max-age=${60 * 60 * 24 * 365};`;
242            document.cookie = `optinAcceptAnalytical=1; path=/; max-age=${60 * 60 * 24 * 365};`;
243            document.cookie = `optinAcceptAds=1; path=/; max-age=${60 * 60 * 24 * 365};`;
244            triggerOptedInScriptsFunctionality();
245            triggerOptedInScriptsAnalytical();
246            triggerOptedInScriptsAds();
247            if(dataReload === '1') {
248                optinBoxOverlay.classList.add('reload');
249                location.reload();
250            } else {
251                optinBoxOverlay.classList.add('out');
252            }
253        }, false);
254
255        optinAccept.innerHTML = values.i18n.accept;
256        optinBoxButtons.appendChild(optinAccept);
257
258
259        optinGenerateContent();
260        optinBox.setAttribute('class', name);
261
262        optinBoxOverlay.setAttribute('class', name + 'Overlay');
263        if(dataPosition === '1'){
264            optinBoxOverlay.classList.add(name + 'OverlayBottom');
265        }
266        optinBoxWrapper.setAttribute('class', name + 'Wrapper');
267        optinBoxText.setAttribute('class', name + 'BoxText');
268        optinBoxButtons.setAttribute('class', name + 'BoxButtons');
269
270        body.appendChild(optinBoxOverlay);
271
272        optinBox.appendChild(optinBoxText);
273        optinBox.appendChild(optinBoxButtons);
274
275        optinBoxOverlay.appendChild(optinBoxWrapper);
276
277        optinBoxWrapper.appendChild(optinBox);
278    }
279}(window, window.document);

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.