-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
404.html
641 lines (513 loc) Β· 35.4 KB
/
404.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
<!DOCTYPE html><html lang="en-us"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"><title>Error 404 - DF Blogs</title><meta name="description" content="This Page Doesn't Exist"><meta name="generator" content="Publii Open-Source CMS for Static Site"><script>window.publiiEmbedConsentCheck = function (cookieGroup) {
var configName = 'publii-gdpr-allowed-cookies-v1';
var lastConfigSave = localStorage.getItem('publii-gdpr-cookies-config-save-date');
var configIsFresh = false;
if (lastConfigSave !== null) {
lastConfigSave = parseInt(lastConfigSave, 10);
if (lastConfigSave === 0) {
configIsFresh = true;
} else if (30 > 0 && +new Date() - lastConfigSave < 30 * 24 * 60 * 60 * 1000) {
configIsFresh = true;
}
}
if (!configIsFresh) {
return;
}
var config = localStorage.getItem(configName);
if (config && config.indexOf(cookieGroup) > -1) {
var iframesToUnlock = document.querySelectorAll('.pec-wrapper[data-consent-group-id="' + cookieGroup + '"]');
for (var i = 0; i < iframesToUnlock.length; i++) {
var iframeWrapper = iframesToUnlock[i];
if (iframeWrapper.getAttribute('data-consent-given') === 'true') {
continue;
}
iframeWrapper.setAttribute('data-consent-given', 'true');
iframeWrapper.querySelector('.pec-overlay').classList.remove('is-active');
iframeWrapper.querySelector('.pec-overlay').setAttribute('aria-hidden', 'true');
var iframe = iframeWrapper.querySelector('iframe');
iframe.setAttribute('src', iframe.getAttribute('data-consent-src'));
}
}
}</script><script async defer="defer" type="gdpr-blocker/analytics" src="https://analytics.ims-network.net/script.js" data-website-id="eb95aa07-0a06-4aa6-931d-22ef79ee78cb" data-auto-track="true" data-do-not-track="true" data-cache="false" data-host-url="https://analytics.ims-network.net"></script><meta name="theme-color" content="#000000" media="(prefers-color-scheme: dark)"><meta name="theme-color" content="#000000" media="(prefers-color-scheme: light)"><meta name="msapplication-navbutton-color" content="#000000"><meta name="apple-mobile-web-app-status-bar-style" content="#000000"><link rel="canonical" href="https://blog.thefourcraft.com/"><link rel="alternate" type="application/atom+xml" href="https://blog.thefourcraft.com/feed.xml"><link rel="alternate" type="application/json" href="https://blog.thefourcraft.com/feed.json"><meta property="og:title" content="DF Blogs"><meta property="og:image" content="https://blog.thefourcraft.com/media/website/Blogs-Open-Graph-Fallback.png"><meta property="og:image:width" content="1920"><meta property="og:image:height" content="1080"><meta property="og:site_name" content="DF Blogs"><meta property="og:description" content="This Page Doesn't Exist"><meta property="og:url" content="https://blog.thefourcraft.com/"><meta property="og:type" content="website"><meta property="fb:app_id" content="1574887919592240"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:site" content="@thefourcraft"><meta name="twitter:title" content="DF Blogs"><meta name="twitter:description" content="This Page Doesn't Exist"><meta name="twitter:image" content="https://blog.thefourcraft.com/media/website/Blogs-Open-Graph-Fallback.png"><link rel="shortcut icon" href="https://blog.thefourcraft.com/media/website/logo.png" type="image/png"><link rel="preload" href="https://blog.thefourcraft.com/assets/dynamic/fonts/publicsans/publicsans.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="https://blog.thefourcraft.com/assets/dynamic/fonts/publicsans/publicsans-italic.woff2" as="font" type="font/woff2" crossorigin><link rel="preload" href="https://blog.thefourcraft.com/assets/dynamic/fonts/oswald/oswald.woff2" as="font" type="font/woff2" crossorigin><link rel="stylesheet" href="https://blog.thefourcraft.com/assets/css/fontawesome-all.min.css?v=85514f933f9e0b82460af63f1a403fa5"><link rel="stylesheet" href="https://blog.thefourcraft.com/assets/css/style.css?v=339e09a20d1897120c805bf11914bdae"><script type="application/ld+json">{"@context":"http://schema.org","@type":"Organization","name":"DF Blogs","url":"https://blog.thefourcraft.com/index.html","sameAs":["https://www.facebook.com/david2004furman","https://twitter.com/thefourcraft","https://www.instagram.com/david_furman/","https://www.linkedin.com/in/david-furman/"]}</script><noscript><style>img[loading] {
opacity: 1;
}</style></noscript></head><body class="is-preload error-template"><div id="wrapper"><div id="main"><div class="inner"><header id="header"><a class="logo" href="https://blog.thefourcraft.com/index.html"><strong>DF Blogs</strong></a><ul class="icons"><li><a href="https://twitter.com/thefourcraft" class="icon brands fa-x-twitter"><span class="label">Twitter</span></a></li><li><a href="https://www.facebook.com/david2004furman" class="icon brands fa-facebook-f"><span class="label">Facebook</span></a></li><li><a href="https://www.instagram.com/david_furman/" class="icon brands fa-instagram"><span class="label">Instagram</span></a></li><li><a href="https://www.linkedin.com/in/david-furman/" class="icon brands fa-linkedin"><span class="label">LinkedIn</span></a></li></ul></header><article class="post"><header class="main post__header"><h1>404 Error</h1><p class="post__date">Page not found</p></header><div class="post__inner center"><p>The page you were looking for appears to have been moved, deleted or does not exist. You could go back to where you were or head straight to our home page.</p><a href="https://blog.thefourcraft.com/index.html" class="button">Go home</a></div></article></div></div><div id="sidebar"><div class="inner"><div id="search" class="alt"></div><nav id="menu"><header class="major"><h2>Menu</h2></header><ul><li><a href="https://blog.thefourcraft.com/index.html" target="_self">Home</a></li><li class="has-submenu"><span aria-haspopup="true" class="opener">Series Spotlight βοΈ</span><ul class="submenu level-2" aria-hidden="true"><li><a href="https://blog.thefourcraft.com/tags/twelve-factor-app/index.html" target="_self">Twelve Factor App</a></li><li><a href="https://blog.thefourcraft.com/tags/leaky-buckets/index.html" target="_self">Leaky Buckets</a></li></ul></li><li><a href="https://www.linkedin.com/build-relation/newsletter-follow?entityUrn=7062371340606930944" target="_blank">Subscribe on LinkedIn</a></li><li><a href="https://blog.thefourcraft.com/tags/index.html" target="_self">Topics</a></li><li><a href="https://www.thefourcraft.com" target="_self">Main Website</a></li><li><a href="https://www.thefourcraft.com/privacy-policy.html" target="_self">Privacy Policy</a></li></ul></nav><section><header class="major"><h2>Get in touch</h2></header><h1>Welcome To DF - Blogs</h1><p>My life is a blend of diverse roles, keeping me busy around the clock.<br>By day, I'm <a href="https://www.idf.il/en/">@Israel Defense Forces (IDF)</a>, and as evening falls, I step into my role as CISO at <a href="https://aidock.net" target="_blank" rel="noopener">AiDock</a>, ensuring top-notch cybersecurity. I am the CTO at <a href="https://ims-network.org">IMS - Network</a> at night, driving technological innovations in digital gaming. In rare free moments, I dive into open-source projects and nurture my brand, "<a href="https://david-furman.com">DF</a>." I'm also the Chairman of the <a href="https://ΧΧΧΧΧΧ Χ.ΧΧ©Χ¨ΧΧ">Israeli Gaming Association</a>, advocating for gaming culture, and volunteer as CTO at <a href="https://discord.gg/tgi">TeGriAi</a>, Israel's largest gaming community with 250K members.</p><p><a class="libutton" href="https://www.linkedin.com/build-relation/newsletter-follow?entityUrn=7062371340606930944" target="_blank" rel="noopener">Subscribe on LinkedIn</a></p></section><footer id="footer"><p class="copyright">Β© DF. All rights reserved under applicable copyright laws.<br><br>This site operates under an open-source license, specifically CC BY-NC 4.0, which governs its usage and distribution.<br><br>Please note that all tips, blogs, and other content on this website reflect my opinions and are not intended as professional advice. Additionally, some content on this site is generated with artificial intelligence.</p></footer></div></div></div><script src="https://blog.thefourcraft.com/assets/js/jquery.min.js?v=7c14a783dfeb3d238ccd3edd840d82ee"></script><script src="https://blog.thefourcraft.com/assets/js/browser.min.js?v=c07298dd19048a8a69ad97e754dfe8d0"></script><script src="https://blog.thefourcraft.com/assets/js/breakpoints.min.js?v=81a479eb099e3b187613943b085923b8"></script><script src="https://blog.thefourcraft.com/assets/js/util.min.js?v=cbdaf7c20ac2883c77ae23acfbabd47e"></script><script src="https://blog.thefourcraft.com/assets/js/main.min.js?v=08add7f6d435054ad38ec38d7cf8be40"></script><script>var images=document.querySelectorAll("img[loading]");for(var i=0;i<images.length;i++){if(images[i].complete){images[i].classList.add("is-loaded")}else{images[i].addEventListener("load",function(){this.classList.add("is-loaded")},false)}};</script><div class="pcb" data-behaviour="badge" data-behaviour-link="#cookie-settings" data-revision="1" data-config-ttl="30" data-debug-mode="false"><div role="dialog" aria-modal="true" aria-hidden="true" aria-labelledby="pcb-title" aria-describedby="pcb-txt" class="pcb__banner"><div class="pcb__inner"><div id="pcb-title" role="heading" aria-level="2" class="pcb__title">My Blogging Website Is Using Cookies</div><div id="pcb-txt" class="pcb__txt">Select which cookies to opt-in to via the checkboxes below; our website uses cookies to examine site traffic and user activity while on our site, for marketing, and to provide social media functionality. <a href="https://www.thefourcraft.com/privacy-policy.html">More details...</a></div><div class="pcb__buttons"><button type="button" class="pcb__btn pcb__btn--link pcb__btn--configure" aria-haspopup="dialog">Manage preferences</button> <button type="button" class="pcb__btn pcb__btn--reject">Reject</button> <button type="button" class="pcb__btn pcb__btn--solid pcb__btn--accept">Accept all</button></div></div></div><div class="pcb__popup" role="dialog" aria-modal="true" aria-hidden="true" aria-labelledby="pcb-popup-title"><div class="pcb__popup__wrapper"><div class="pcb__inner pcb__popup__inner"><div class="pcb__popup__heading"><div id="pcb-popup-title" role="heading" aria-level="2" class="pcb__title">Cookie settings</div><button class="pcb__popup__close" aria-label="Close"></button></div><div class="pcb__popup__content"><div class="pcb__txt pcb__popup__txt">I use cookies to enhance your browsing experience and security and analyze traffic. By clicking "Accept All", you consent to our use of cookies. <a href="https://www.thefourcraft.com/privacy-policy.html">More details...</a></div><ul class="pcb__groups"><li class="pcb__group"><details><summary class="pcb__group__title">Comments</summary><p class="pcb__group__txt">If You Want To Enable The 3rd Party Comments Integration</p></details><div class="pcb__popup__switch"><input type="checkbox" data-group-name="comments" id="comments-cookies"> <label for="comments-cookies">Comments</label></div></li><li class="pcb__group"><details><summary class="pcb__group__title">Functions</summary><p class="pcb__group__txt">If You Want Site 3rd Party Search</p></details><div class="pcb__popup__switch"><input type="checkbox" data-group-name="functions" id="functions-cookies"> <label for="functions-cookies">Functions</label></div></li><li class="pcb__group"><details><summary class="pcb__group__title">Analytics</summary><p class="pcb__group__txt">Enabling IMS - Analytics is subjected to IMS -Network's privacy policy https://legal.ims-network.net/privacy-policy.html</p></details><div class="pcb__popup__switch"><input type="checkbox" data-group-name="analytics" id="analytics-cookies"> <label for="analytics-cookies">Analytics</label></div></li><li class="pcb__group"><details><summary class="pcb__group__title">YouTube</summary><p class="pcb__group__txt">YouTubes & Google's Data Collection, because this website might have videos that are streamed with YouTube</p></details><div class="pcb__popup__switch"><input type="checkbox" data-group-name="youtube" id="youtube-cookies"> <label for="youtube-cookies">YouTube</label></div></li></ul></div><div class="pcb__buttons pcb__popup__buttons"><button type="button" class="pcb__btn pcb__btn--solid pcb__btn--accept">Accept all</button> <button type="button" class="pcb__btn pcb__btn--reject">Reject all</button> <button type="button" class="pcb__btn pcb__btn--save">Save settings</button></div></div></div></div><div class="pcb__overlay" aria-hidden="true"></div><button class="pcb__badge" aria-label="Cookie Policy" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" width="40" height="40" viewBox="0 0 23 23" fill="currentColor"><path d="M21.41 12.71c-.08-.01-.15 0-.22 0h-.03c-.03 0-.05 0-.08.01-.07 0-.13.01-.19.04-.52.21-1.44.19-2.02-.22-.44-.31-.65-.83-.62-1.53a.758.758 0 0 0-.27-.61.73.73 0 0 0-.65-.14c-1.98.51-3.49.23-4.26-.78-.82-1.08-.73-2.89.24-4.49.14-.23.14-.52 0-.75a.756.756 0 0 0-.67-.36c-.64.03-1.11-.1-1.31-.35-.19-.26-.13-.71-.01-1.29.04-.18.06-.38.03-.59-.05-.4-.4-.7-.81-.66C5.1 1.54 1 6.04 1 11.48 1 17.28 5.75 22 11.6 22c5.02 0 9.39-3.54 10.39-8.42.08-.4-.18-.78-.58-.87Zm-9.81 7.82c-5.03 0-9.12-4.06-9.12-9.06 0-4.34 3.05-8 7.25-8.86-.08.7.05 1.33.42 1.81.24.32.66.67 1.38.84-.76 1.86-.65 3.78.36 5.11.61.81 2.03 2 4.95 1.51.18.96.71 1.54 1.18 1.87.62.43 1.38.62 2.1.62.05 0 .09 0 .13-.01-1.23 3.64-4.7 6.18-8.64 6.18ZM13 17c0 .55-.45 1-1 1s-1-.45-1-1 .45-1 1-1 1 .45 1 1Zm5.29-12.3a.99.99 0 0 1-.29-.71c0-.55.45-.99 1-.99a1 1 0 0 1 .71.3c.19.19.29.44.29.71 0 .55-.45.99-1 .99a1 1 0 0 1-.71-.3ZM9 13.5c0 .83-.67 1.5-1.5 1.5S6 14.33 6 13.5 6.67 12 7.5 12s1.5.67 1.5 1.5Zm3.25.81a.744.744 0 0 1-.06-1.05c.28-.32.75-.34 1.05-.06.31.28.33.75.05 1.06-.15.16-.35.25-.56.25-.18 0-.36-.06-.5-.19ZM8.68 7.26c.41.37.44 1 .07 1.41-.2.22-.47.33-.75.33a.96.96 0 0 1-.67-.26c-.41-.37-.44-1-.07-1.41.37-.42 1-.45 1.41-.08Zm11.48 1.88c.18-.19.52-.19.7 0 .05.04.09.1.11.16.03.06.04.12.04.19 0 .13-.05.26-.15.35-.09.1-.22.15-.35.15s-.26-.05-.35-.15a.355.355 0 0 1-.11-.16.433.433 0 0 1-.04-.19c0-.13.05-.26.15-.35Zm-4.93-1.86a.75.75 0 1 1 1.059-1.06.75.75 0 0 1-1.059 1.06Z"/></svg></button></div><script>(function(win) {
if (!document.querySelector('.pcb')) {
return;
}
var cbConfig = {
behaviour: document.querySelector('.pcb').getAttribute('data-behaviour'),
behaviourLink: document.querySelector('.pcb').getAttribute('data-behaviour-link'),
revision: document.querySelector('.pcb').getAttribute('data-revision'),
configTTL: parseInt(document.querySelector('.pcb').getAttribute('data-config-ttl'), 10),
debugMode: document.querySelector('.pcb').getAttribute('data-debug-mode') === 'true',
initialState: null,
initialLsState: null,
previouslyAccepted: []
};
var cbUI = {
wrapper: document.querySelector('.pcb'),
banner: {
element: null,
btnAccept: null,
btnReject: null,
btnConfigure: null
},
popup: {
element: null,
btnClose: null,
btnSave: null,
btnAccept: null,
btnReject: null,
checkboxes: null,
},
overlay: null,
badge: null,
blockedScripts: document.querySelectorAll('script[type^="gdpr-blocker/"]'),
triggerLinks: cbConfig.behaviourLink ? document.querySelectorAll('a[href*="' + cbConfig.behaviourLink + '"]') : null
};
function initUI () {
// setup banner elements
cbUI.banner.element = cbUI.wrapper.querySelector('.pcb__banner');
cbUI.banner.btnAccept = cbUI.banner.element.querySelector('.pcb__btn--accept');
cbUI.banner.btnReject = cbUI.banner.element.querySelector('.pcb__btn--reject');
cbUI.banner.btnConfigure = cbUI.banner.element.querySelector('.pcb__btn--configure');
// setup popup elements
if (cbUI.wrapper.querySelector('.pcb__popup')) {
cbUI.popup.element = cbUI.wrapper.querySelector('.pcb__popup');
cbUI.popup.btnClose = cbUI.wrapper.querySelector('.pcb__popup__close');
cbUI.popup.btnSave = cbUI.popup.element.querySelector('.pcb__btn--save');
cbUI.popup.btnAccept = cbUI.popup.element.querySelector('.pcb__btn--accept');
cbUI.popup.btnReject = cbUI.popup.element.querySelector('.pcb__btn--reject');
cbUI.popup.checkboxes = cbUI.popup.element.querySelector('input[type="checkbox"]');
// setup overlay
cbUI.overlay = cbUI.wrapper.querySelector('.pcb__overlay');
}
cbUI.badge = cbUI.wrapper.querySelector('.pcb__badge');
if (cbConfig.behaviour.indexOf('link') > -1) {
for (var i = 0; i < cbUI.triggerLinks.length; i++) {
cbUI.triggerLinks[i].addEventListener('click', function(e) {
e.preventDefault();
showBannerOrPopup();
});
}
}
}
function initState () {
var lsKeyName = getConfigName();
var currentConfig = localStorage.getItem(lsKeyName);
var configIsFresh = checkIfConfigIsFresh();
if (!configIsFresh || currentConfig === null) {
if (cbConfig.debugMode) {
console.log('πͺ Config not found, or configuration expired');
}
if (window.publiiCBGCM) {
gtag('consent', 'default', {
'ad_storage': window.publiiCBGCM.defaultState.ad_storage ? 'granted' : 'denied',
'ad_personalization': window.publiiCBGCM.defaultState.ad_personalization ? 'granted' : 'denied',
'ad_user_data': window.publiiCBGCM.defaultState.ad_user_data ? 'granted' : 'denied',
'analytics_storage': window.publiiCBGCM.defaultState.analytics_storage ? 'granted' : 'denied',
'personalization_storage': window.publiiCBGCM.defaultState.personalization_storage ? 'granted' : 'denied',
'functionality_storage': window.publiiCBGCM.defaultState.functionality_storage ? 'granted' : 'denied',
'security_storage': window.publiiCBGCM.defaultState.security_storage ? 'granted' : 'denied'
});
if (cbConfig.debugMode) {
console.log('πͺ GCMv2 DEFAULT STATE: ' + JSON.stringify({
'ad_storage': window.publiiCBGCM.defaultState.ad_storage ? 'granted' : 'denied',
'ad_personalization': window.publiiCBGCM.defaultState.ad_personalization ? 'granted' : 'denied',
'ad_user_data': window.publiiCBGCM.defaultState.ad_user_data ? 'granted' : 'denied',
'analytics_storage': window.publiiCBGCM.defaultState.analytics_storage ? 'granted' : 'denied',
'personalization_storage': window.publiiCBGCM.defaultState.personalization_storage ? 'granted' : 'denied',
'functionality_storage': window.publiiCBGCM.defaultState.functionality_storage ? 'granted' : 'denied',
'security_storage': window.publiiCBGCM.defaultState.security_storage ? 'granted' : 'denied'
}));
}
}
showBanner();
} else if (typeof currentConfig === 'string') {
if (cbConfig.debugMode) {
console.log('πͺ Config founded');
}
cbConfig.initialLsState = currentConfig.split(',');
if (window.publiiCBGCM) {
gtag('consent', 'default', {
'ad_storage': getDefaultConsentState(currentConfig, 'ad_storage'),
'ad_personalization': getDefaultConsentState(currentConfig, 'ad_personalization'),
'ad_user_data': getDefaultConsentState(currentConfig, 'ad_user_data'),
'analytics_storage': getDefaultConsentState(currentConfig, 'analytics_storage'),
'personalization_storage': getDefaultConsentState(currentConfig, 'personalization_storage'),
'functionality_storage': getDefaultConsentState(currentConfig, 'functionality_storage'),
'security_storage': getDefaultConsentState(currentConfig, 'security_storage')
});
if (cbConfig.debugMode) {
console.log('πͺ GCMv2 DEFAULT STATE: ' + JSON.stringify({
'ad_storage': getDefaultConsentState(currentConfig, 'ad_storage'),
'ad_personalization': getDefaultConsentState(currentConfig, 'ad_personalization'),
'ad_user_data': getDefaultConsentState(currentConfig, 'ad_user_data'),
'analytics_storage': getDefaultConsentState(currentConfig, 'analytics_storage'),
'personalization_storage': getDefaultConsentState(currentConfig, 'personalization_storage'),
'functionality_storage': getDefaultConsentState(currentConfig, 'functionality_storage'),
'security_storage': getDefaultConsentState(currentConfig, 'security_storage')
}));
}
}
showBadge();
if (cbUI.popup.element) {
var allowedGroups = currentConfig.split(',');
var checkedCheckboxes = cbUI.popup.element.querySelectorAll('input[type="checkbox"]:checked');
for (var j = 0; j < checkedCheckboxes.length; j++) {
var name = checkedCheckboxes[j].getAttribute('data-group-name');
if (name && name !== '-' && allowedGroups.indexOf(name) === -1) {
checkedCheckboxes[j].checked = false;
}
}
for (var i = 0; i < allowedGroups.length; i++) {
var checkbox = cbUI.popup.element.querySelector('input[type="checkbox"][data-group-name="' + allowedGroups[i] + '"]');
if (checkbox) {
checkbox.checked = true;
}
allowCookieGroup(allowedGroups[i]);
}
}
}
setTimeout(function () {
cbConfig.initialState = getInitialStateOfConsents();
}, 0);
}
function checkIfConfigIsFresh () {
var lastConfigSave = localStorage.getItem('publii-gdpr-cookies-config-save-date');
if (lastConfigSave === null) {
return false;
}
lastConfigSave = parseInt(lastConfigSave, 10);
if (lastConfigSave === 0) {
return true;
}
if (+new Date() - lastConfigSave < cbConfig.configTTL * 24 * 60 * 60 * 1000) {
return true;
}
return false;
}
function getDefaultConsentState (currentConfig, consentGroup) {
let configGroups = currentConfig.split(',');
for (let i = 0; i < configGroups.length; i++) {
let groupName = configGroups[i];
let group = window.publiiCBGCM.groups.find(group => group.cookieGroup === groupName);
if (group && group[consentGroup]) {
return 'granted';
}
}
if (window.publiiCBGCM.defaultState[consentGroup]) {
return 'granted';
}
return 'denied';
}
function initBannerEvents () {
cbUI.banner.btnAccept.addEventListener('click', function (e) {
e.preventDefault();
acceptAllCookies('banner');
showBadge();
}, false);
if (cbUI.banner.btnReject) {
cbUI.banner.btnReject.addEventListener('click', function (e) {
e.preventDefault();
rejectAllCookies();
showBadge();
}, false);
}
if (cbUI.banner.btnConfigure) {
cbUI.banner.btnConfigure.addEventListener('click', function (e) {
e.preventDefault();
hideBanner();
showAdvancedPopup();
showBadge();
}, false);
}
}
function initPopupEvents () {
if (!cbUI.popup.element) {
return;
}
cbUI.overlay.addEventListener('click', function (e) {
hideAdvancedPopup();
}, false);
cbUI.popup.element.addEventListener('click', function (e) {
e.stopPropagation();
}, false);
cbUI.popup.btnAccept.addEventListener('click', function (e) {
e.preventDefault();
acceptAllCookies('popup');
}, false);
cbUI.popup.btnReject.addEventListener('click', function (e) {
e.preventDefault();
rejectAllCookies();
}, false);
cbUI.popup.btnSave.addEventListener('click', function (e) {
e.preventDefault();
saveConfiguration();
}, false);
cbUI.popup.btnClose.addEventListener('click', function (e) {
e.preventDefault();
hideAdvancedPopup();
}, false);
}
function initBadgeEvents () {
if (!cbUI.badge) {
return;
}
cbUI.badge.addEventListener('click', function (e) {
showBannerOrPopup();
}, false);
}
initUI();
initState();
initBannerEvents();
initPopupEvents();
initBadgeEvents();
/**
* API
*/
function addScript (src, inline) {
var newScript = document.createElement('script');
if (src) {
newScript.setAttribute('src', src);
}
if (inline) {
newScript.text = inline;
}
document.body.appendChild(newScript);
}
function allowCookieGroup (allowedGroup) {
var scripts = document.querySelectorAll('script[type="gdpr-blocker/' + allowedGroup + '"]');
cbConfig.previouslyAccepted.push(allowedGroup);
for (var j = 0; j < scripts.length; j++) {
addScript(scripts[j].src, scripts[j].text);
}
var groupEvent = new Event('publii-cookie-banner-unblock-' + allowedGroup);
document.body.dispatchEvent(groupEvent);
unlockEmbeds(allowedGroup);
if (cbConfig.debugMode) {
console.log('πͺ Allowed group: ' + allowedGroup);
}
if (window.publiiCBGCM && cbConfig.initialLsState.indexOf(allowedGroup) === -1) {
let consentResult = {};
let group = window.publiiCBGCM.groups.find(group => group.cookieGroup === allowedGroup);
if (group) {
let foundSomeConsents = false;
Object.keys(group).forEach(key => {
if (key !== 'cookieGroup' && group[key] === true) {
consentResult[key] = 'granted';
foundSomeConsents = true;
}
});
if (foundSomeConsents) {
gtag('consent', 'update', consentResult);
if (cbConfig.debugMode) {
console.log('πͺ GCMv2 UPDATE: ' + JSON.stringify(consentResult));
}
}
}
}
}
function showBannerOrPopup () {
if (cbUI.popup.element) {
showAdvancedPopup();
} else {
showBanner();
}
}
function showAdvancedPopup () {
cbUI.popup.element.classList.add('is-visible');
cbUI.overlay.classList.add('is-visible');
cbUI.popup.element.setAttribute('aria-hidden', 'false');
cbUI.overlay.setAttribute('aria-hidden', 'false');
}
function hideAdvancedPopup () {
cbUI.popup.element.classList.remove('is-visible');
cbUI.overlay.classList.remove('is-visible');
cbUI.popup.element.setAttribute('aria-hidden', 'true');
cbUI.overlay.setAttribute('aria-hidden', 'true');
}
function showBanner () {
cbUI.banner.element.classList.add('is-visible');
cbUI.banner.element.setAttribute('aria-hidden', 'false');
}
function hideBanner () {
cbUI.banner.element.classList.remove('is-visible');
cbUI.banner.element.setAttribute('aria-hidden', 'true');
}
function showBadge () {
if (!cbUI.badge) {
return;
}
cbUI.badge.classList.add('is-visible');
cbUI.badge.setAttribute('aria-hidden', 'false');
}
function getConfigName () {
var lsKeyName = 'publii-gdpr-allowed-cookies';
if (cbConfig.revision) {
lsKeyName = lsKeyName + '-v' + parseInt(cbConfig.revision, 10);
}
return lsKeyName;
}
function storeConfiguration (allowedGroups) {
var lsKeyName = getConfigName();
var dataToStore = allowedGroups.join(',');
localStorage.setItem(lsKeyName, dataToStore);
if (cbConfig.configTTL === 0) {
localStorage.setItem('publii-gdpr-cookies-config-save-date', 0);
if (cbConfig.debugMode) {
console.log('πͺ Store never expiring configuration');
}
} else {
localStorage.setItem('publii-gdpr-cookies-config-save-date', +new Date());
}
}
function getInitialStateOfConsents () {
if (!cbUI.popup.element) {
return [];
}
var checkedGroups = cbUI.popup.element.querySelectorAll('input[type="checkbox"]:checked');
var groups = [];
for (var i = 0; i < checkedGroups.length; i++) {
var allowedGroup = checkedGroups[i].getAttribute('data-group-name');
if (allowedGroup !== '') {
groups.push(allowedGroup);
}
}
if (cbConfig.debugMode) {
console.log('πͺ Initial state: ' + groups.join(', '));
}
return groups;
}
function getCurrentStateOfConsents () {
if (!cbUI.popup.element) {
return [];
}
var checkedGroups = cbUI.popup.element.querySelectorAll('input[type="checkbox"]:checked');
var groups = [];
for (var i = 0; i < checkedGroups.length; i++) {
var allowedGroup = checkedGroups[i].getAttribute('data-group-name');
if (allowedGroup !== '') {
groups.push(allowedGroup);
}
}
if (cbConfig.debugMode) {
console.log('πͺ State to save: ' + groups.join(', '));
}
return groups;
}
function getAllGroups () {
if (!cbUI.popup.element) {
return [];
}
var checkedGroups = cbUI.popup.element.querySelectorAll('input[type="checkbox"]');
var groups = [];
for (var i = 0; i < checkedGroups.length; i++) {
var allowedGroup = checkedGroups[i].getAttribute('data-group-name');
if (allowedGroup !== '') {
groups.push(allowedGroup);
}
}
return groups;
}
function acceptAllCookies (source) {
var groupsToAccept = getAllGroups();
storeConfiguration(groupsToAccept);
for (var i = 0; i < groupsToAccept.length; i++) {
var group = groupsToAccept[i];
if (cbConfig.initialState.indexOf(group) > -1 || cbConfig.previouslyAccepted.indexOf(group) > -1) {
if (cbConfig.debugMode) {
console.log('πͺ Skip previously activated group: ' + group);
}
continue;
}
allowCookieGroup(group);
}
if (cbUI.popup.element) {
var checkboxesToCheck = cbUI.popup.element.querySelectorAll('input[type="checkbox"]');
for (var j = 0; j < checkboxesToCheck.length; j++) {
checkboxesToCheck[j].checked = true;
}
}
if (cbConfig.debugMode) {
console.log('πͺ Accept all cookies: ', groupsToAccept.join(', '));
}
if (source === 'popup') {
hideAdvancedPopup();
} else if (source === 'banner') {
hideBanner();
}
}
function rejectAllCookies () {
if (cbConfig.debugMode) {
console.log('πͺ Reject all cookies');
}
storeConfiguration([]);
setTimeout(function () {
window.location.reload();
}, 100);
}
function saveConfiguration () {
var groupsToAccept = getCurrentStateOfConsents();
storeConfiguration(groupsToAccept);
if (cbConfig.debugMode) {
console.log('πͺ Save new config: ', groupsToAccept.join(', '));
}
if (reloadIsNeeded(groupsToAccept)) {
setTimeout(function () {
window.location.reload();
}, 100);
return;
}
for (var i = 0; i < groupsToAccept.length; i++) {
var group = groupsToAccept[i];
if (cbConfig.initialState.indexOf(group) > -1 || cbConfig.previouslyAccepted.indexOf(group) > -1) {
if (cbConfig.debugMode) {
console.log('πͺ Skip previously activated group: ' + group);
}
continue;
}
allowCookieGroup(group);
}
hideAdvancedPopup();
}
function reloadIsNeeded (groupsToAccept) {
// check if user rejected consent for initial groups
var initialGroups = cbConfig.initialState;
var previouslyAcceptedGroups = cbConfig.previouslyAccepted;
var groupsToCheck = initialGroups.concat(previouslyAcceptedGroups);
for (var i = 0; i < groupsToCheck.length; i++) {
var groupToCheck = groupsToCheck[i];
if (groupToCheck !== '' && groupsToAccept.indexOf(groupToCheck) === -1) {
if (cbConfig.debugMode) {
console.log('πͺ Reload is needed due lack of: ', groupToCheck);
}
return true;
}
}
return false;
}
function unlockEmbeds (cookieGroup) {
var iframesToUnlock = document.querySelectorAll('.pec-wrapper[data-consent-group-id="' + cookieGroup + '"]');
for (var i = 0; i < iframesToUnlock.length; i++) {
var iframeWrapper = iframesToUnlock[i];
iframeWrapper.querySelector('.pec-overlay').classList.remove('is-active');
iframeWrapper.querySelector('.pec-overlay').setAttribute('aria-hidden', 'true');
var iframe = iframeWrapper.querySelector('iframe');
iframe.setAttribute('src', iframe.getAttribute('data-consent-src'));
}
}
win.publiiEmbedConsentGiven = function (cookieGroup) {
// it will unlock embeds
allowCookieGroup(cookieGroup);
var checkbox = cbUI.popup.element.querySelector('input[type="checkbox"][data-group-name="' + cookieGroup + '"]');
if (checkbox) {
checkbox.checked = true;
}
var groupsToAccept = getCurrentStateOfConsents();
storeConfiguration(groupsToAccept);
if (cbConfig.debugMode) {
console.log('πͺ Save new config: ', groupsToAccept.join(', '));
}
}
})(window);</script></body></html>