PageSourceSearch

https://www.gimmler-reisen.de/wp-content/plugins/cookie_consent/js/cookie_.js.php

js gimmler-reisen.de collected 2026-10-05 19:27:13 UTC 13,190 bytes, 371 lines download raw bytes

1
2var expire  =   new Date();
3
4expire.setTime(expire.getTime() + (60*60*1000*24*365));
5
6console.log('expire');
7console.log(expire);
8
9(function (ttcc){
10        var reg_match = /\d+$/;
11        var dbdata;
12        if (ttcc.hasInitialised) return;
13
14        // Initialisieren
15        ttcc.initialise = function (data) {
16            data = atob(data);
17            dbdata = JSON.parse(data);
18
19            ttcc.fbload();
20            ttcc.ytload();
21
22            ttcc.read_cookie('truetravel_ttconsent');
23            ttcc.Popup()
24
25            // Event Listener - Alle Checkboxen
26            $('#cm-selectAllCheckboxes').on('click', function () {
27                ttcc.selectAllCheckboxes();
28            });
29
30            
31            /*$(document).on("click", "button, a, li", function () {
32                 if ($(this).attr('id') != 'pm-btn-handler' && $(this).attr('id') != 'cm-descToggle' && $(this).attr('id') != 'cm-selectSpecific') {
33                    console.log($(this).attr('id'));
34                    ttcc.selectAllCheckboxes();
35                 }
36            });*/
37
38            
39            // Event Listener - X-Button
40            $('.button-secondary.cl').on('click', function () {
41                ttcc.selectAllCheckboxes();
42            });
43
44            // Event Listener - Präferenzen anzeigen
45            $('#pm-btn-handler').on('click', function () {
46                ttcc.showPreferences();
47            });
48
49            // Event Listener - OK klick
50            $('#pm-accept-btn-handler').on('click', function () {
51                ttcc.selectAllCheckboxes();
52            });
53
54            // Event Listener - Personalisierung
55            $('#ck_4').change(function () {
56                ttcc.selectSpecific(4)
57            });
58
59            // Event Listener - Komfort
60            $('#ck_3').change(function () {
61                ttcc.selectSpecific(3)
62            });
63
64            // Event Listener - Statistik
65            $('#ck_2').change(function () {
66                ttcc.selectSpecific(2)
67            });
68
69            // Auswahl bestätigen - Cookie schreiben mit ausgewählten Checkboxes als json 64 Bit decoded
70            $('#cm-selectSpecific').on('click', function () {
71                var checkboxes = $('.cmCat-checkboxes');
72                checkedBoxes = {};
73                for (var i = 0; i < checkboxes.length; i++) {
74                    if (checkboxes[i].checked) {
75                        var j = i+1;
76                        checkedBoxes[i] = $('#ck_'+j).attr('name');
77                    }
78                }
79
80                var expire  =   new Date();
81                expire.setTime(expire.getTime() + (60*60*1000*24*365));
82
83
84                document.cookie =   'truetravel_ttconsent='+btoa(JSON.stringify(checkedBoxes))+';expires='+expire.toUTCString()+';path=/;samesite=none;secure';
85
86                ttcc.read_cookie('truetravel_ttconsent');
87            });
88        };
89
90        ttcc.Popup = function () {
91            ttcc.changeToggleText();
92        };
93
94        // Details anzeigen - Change Text
95        ttcc.changeToggleText = function () {
96            if($('#cm-descToggle').hasClass('collapsed')) {
97                $('#cm-descToggle').html('Details anzeigen');
98                $('#cm-descToggle').attr('aria-expanded', 'false');
99            }
100            else {
101                $('#cm-descToggle').html('Details ausblenden');
102                $('#cm-descToggle').attr('aria-expanded', 'true');
103            }
104            $('#cm-descToggle').click(function () {
105                ttcc.consentDescToggle()
106            });
107        }
108
109        // Details anzeigen - open / close Details
110        ttcc.consentDescToggle = function () {
111            if($('#cm-descToggle').hasClass('collapsed')) {
112                $('#cm-descToggle').html('Details ausblenden');
113                $('#cm-descToggle').attr('aria-expanded', 'false');
114            }
115            else {
116                $('#cm-descToggle').html('Details anzeigen');
117                $('#cm-descToggle').attr('aria-expanded', 'true');
118            }
119            $('#cm-consentDesc').toggleClass('collapsed');
120            $('#cm-descToggleIcon').toggleClass('collapsed');
121            $('#cm-descToggle').toggleClass('collapsed');
122        }
123
124        // Alle Checkboxen auswählen
125        ttcc.selectAllCheckboxes = function () {
126
127
128            var checkboxes = $('.cmCat-checkboxes');
129            var recallthis = false;
130
131
132
133            ttcc.closeConsentDialog(checkboxes, 'all');
134
135            for (var i = 0; i < checkboxes.length; i++) {
136
137
138                 if (!checkboxes[i].checked) {
139                    recallthis = true;
140                    ttcc.setCheckbox(i, checkboxes);
141                    ttcc.closeConsentDialog(checkboxes, 'all');
142                    break;
143                 }
144            }
145            if (recallthis) {
146                setTimeout(function () {
147                    ttcc.selectAllCheckboxes();
148                }, 100);
149            } else {
150                setTimeout(function () {
151                    try {
152                        ttcc.closeConsentDialog(checkboxes, 'all');
153                    } catch (error) {
154                        console.log(error);
155                    }
156                }, 200);
157            }
158        }
159
160        // Alles auswählen
161        ttcc.closeConsentDialog = function (checkboxArray, clickedButton) {
162            var cats = {};
163            for (var i = 0; i < checkboxArray.length; i++) {
164                var obj = checkboxArray[i];
165                cats[obj.id.match(reg_match)[0]] = obj.checked ? 1 : 0;
166            }
167            cats[1] = 1;
168
169            var checkboxes = $('.cmCat-checkboxes');
170            checkedBoxes = {};
171            for (var i = 0; i < checkboxes.length; i++) {
172                if (checkboxes[i].checked) {
173                    var j = i+1;
174                    checkedBoxes[i] = $('#ck_'+j).attr('name');
175                }
176            }
177
178
179            var expire  =   new Date();
180            expire.setTime(expire.getTime() + (60*60*1000*24*365));
181
182            document.cookie =   'truetravel_ttconsent='+btoa(JSON.stringify(checkedBoxes))+';expires='+expire.toUTCString()+';path=/;samesite=none;secure';
183            //document.cookie = 'Testcc' + '=' + 'test123' + '' + '; path=/;samesite=none;secure';
184
185            ttcc.setCookie('truetravel_ttconsent', btoa(JSON.stringify(checkedBoxes)), '356');
186            ttcc.read_cookie('truetravel_ttconsent');
187
188
189
190        }
191
192        // Hinweis für Personalisierung
193        ttcc.selectSpecific = function(categoryNum) {
194
195
196            $("#cm-notification").css("display", "none");
197            var checkboxes = $('.cmCat-checkboxes');
198
199
200            // console.log(categoryNum);
201            // console.log(checkboxes);
202
203
204            if (dbdata.config.cookieBoxAcceptStaticCookies === true && dbdata.config.cookieBoxAcceptKomfortCookies === true && dbdata.config.cookieBoxAcceptPersonalCookies === true) {
205
206                if (categoryNum == 4) {
207                    for (var i = 0; i < categoryNum - 1; i++) {
208                        $("#cm-notification").css("display", "block");
209                        ttcc.setCheckbox(i, checkboxes);
210                    }
211                    $(".checkmark_ck_4").focus();
212                }
213                if (categoryNum == 3 && checkboxes[3].checked === true) {
214                    ttcc.unsetCheckbox(3, checkboxes);
215                    $("#cm-notification").css("display", "none");
216                } else if (categoryNum == 2 && checkboxes[2].checked === true) {
217                    ttcc.unsetCheckbox(2, checkboxes);
218                    ttcc.unsetCheckbox(2, checkboxes);
219                    $("#cm-notification").css("display", "none");
220                }
221                if (checkboxes[categoryNum - 1].checked === false) {
222                    $("#cm-notification").css("display", "none");
223                }
224            }
225            else if (dbdata.config.cookieBoxAcceptStaticCookies === false && dbdata.config.cookieBoxAcceptKomfortCookies === true && dbdata.config.cookieBoxAcceptPersonalCookies === true) {
226                if (categoryNum == 4) {
227                    if (checkboxes[2].checked === true) {
228                        $("#cm-notification").html("Zur Aktivierung dieser Kategorie wird auch die Kategorie Komfort aktiviert.");
229                        $("#cm-notification").css("display", "block");
230                        ttcc.setCheckbox(1, checkboxes);
231                    }
232                    $(".checkmark_ck_4").focus();
233                }
234            }
235            else if (dbdata.config.cookieBoxAcceptStaticCookies === true && dbdata.config.cookieBoxAcceptKomfortCookies === false && dbdata.config.cookieBoxAcceptPersonalCookies === true) {
236                if (categoryNum == 4) {
237                    if (checkboxes[2].checked === true) {
238                        $("#cm-notification").html("Zur Aktivierung dieser Kategorie wird auch die Kategorie Statistik aktiviert.");
239                        $("#cm-notification").css("display", "block");
240                        ttcc.setCheckbox(1, checkboxes);
241                    }
242                    $(".checkmark_ck_4").focus();
243                }
244            }
245
246
247
248
249        }
250
251
252
253        ttcc.showPreferences = function () {
254            $('article.cookie-consent').show();
255        }
256
257
258
259        // Checkboxen setzen
260        ttcc.setCheckbox = function (i, checkboxArray) {
261            checkboxArray[i].checked = true;
262            var checkmark = $('#checkmark_' + checkboxArray[i].getAttribute('id'));
263            checkmark.attr('aria-checked', 'true');
264        }
265
266        // Checkboxen unsetten
267        ttcc.unsetCheckbox = function (i, checkboxArray) {
268            checkboxArray[i].checked = false;
269            var checkmark = $('#checkmark_' + checkboxArray[i].getAttribute('id'));
270            checkmark.attr('aria-checked', 'false');
271        }
272
273        // Cookies lesen und Modal anzeigen wenn Cookie nicht vorhanden ist
274        ttcc.read_cookie = function (cookie) {
275            var my_cookie_eq = cookie + "=";
276            var ca = document.cookie.split(';');
277            for(var i=0;i < ca.length; i++) {
278                var c = ca[i];
279                while (c.charAt(0) ==' ') {
280                    c = c.substring(1,c.length);
281                }
282                if (c.indexOf(my_cookie_eq) == 0) {
283
284                    cookie_content = JSON.parse(atob(c.replace(cookie + '=', '')));
285                    var statistic = false;
286                    if (cookie_content[1] == 'statistics') {
287                        statistic = true;
288                    }
289
290                    $('#cookie-consent').hide();
291                    $('.pressmind-cookie-consent-footer').hide();
292
293
294                    /*
295                                                    $('#cookie-consent').html('');
296                        */
297
298
299                    $('html').css('overflow', '');
300                    return c.substring(my_cookie_eq.length,c.length);
301                }
302                else {
303
304                    // Erstmal das Modal einblenden
305
306                    if (dbdata.config.cookieMode == 1) {
307                        $('.pressmind-cookie-consent-footer').show();
308                    }
309                    else {
310                        $('#cookie-consent').show();
311                    }
312
313                    //$('html').css('overflow', 'hidden');
314                }
315            }
316            return null
317        }
318
319        // Cookie setzen
320
321        ttcc.setCookie = function(cookie, value, days) {
322            if (days) {
323                var date = new Date();
324                date.setTime(date.getTime()+(days*24*60*60*1000*365));
325                var expires = "; expires="+date.toGMTString();
326            }
327            else expires = ""
328            document.cookie = cookie+"="+value+expires+"; path=/;samesite=none;secure";
329
330            // Wenn Statistische Cookies erlaubt werden Seite einmal neu laden
331            var csettings = JSON.parse(atob(value));
332            $.each(csettings, function (i, v) {
333                if (v == 'statistics') {
334                    location.reload(true);
335                }
336            });
337        }
338
339
340
341        // Lade Facebook / Instagram-Inhalt
342        ttcc.fbload = function () {
343            $(".CookieConsent").on('click', '.tt-btn', function (e) {
344                e.preventDefault();
345                var facebook = $(this).closest('.CookieConsent').find('.tt-hide script').html();
346                facebook = atob(facebook);
347                console.log(facebook);
348                $(this).closest('.CookieConsent').html(facebook);
349            });
350
351        }
352
353        // Lade Youtube / Vimeo-Inhalt
354        ttcc.ytload = function () {
355            $(".CookieConsent").on('click', '.video-wall button', function (e) {
356                console.log("YouTube");
357                e.preventDefault();
358                var facebook = $(this).closest('.CookieConsent').find('.tt-hide script').html();
359                facebook = atob(facebook);
360                console.log(facebook);
361                $(this).closest('.CookieConsent').html(facebook);
362            });
363
364        }
365
366
367        window.truetravelCookieConsent = ttcc;
368    }(window.truetravelCookieConsent || {})
369);
370
371

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.