1var CPrivacyPolicy = function () 2 { 3 4 // variables 5 this.expires = new Date(); 6 let today = this.expires; 7 this.plusDay = new Date(today.getTime() + 1000 * 60 * 60 * 24); 8 this.plusWeek = new Date(today.getTime() + 1000 * 60 * 60 * 24 * 7); 9 this.plusMonth = new Date(today.getTime() + 1000 * 60 * 60 * 24 * 31); 10 this.plusYear = new Date(today.getTime() + 1000 * 60 * 60 * 24 * 365); 11 this.checkIfConfirmed(); 12 this.navigation(); 13 this.actionWatcher(); 14 }; 15 16 17/** 18 * Ãberprüfe ob Cookie-Hinweis bereits bestätigt wurde 19 */ 20CPrivacyPolicy.prototype.checkIfConfirmed = function () 21 { 22 23 24 let c_pp_set = document.cookie.indexOf('bt_privacy_policy_set'); 25 let local_pp_set = localStorage.getItem('bt_privacy_policy_set'); 26 27 if (c_pp_set === -1 || local_pp_set === null) 28 { 29 // Cookie oder LocalStorage ist nicht gesetzt... 30 this.showBox(); 31 } 32 else 33 { 34 // Cookie oder LocalStorage ist gesetzt... 35 this.hideBox(); 36 this.startBlackTAnalytics(); 37 this.startGoogleAnalytics(); 38 } 39 }; 40 41 42/** 43 * Navigation - Click Events um Tabs sowie Accordion zu bedienen 44 */ 45CPrivacyPolicy.prototype.navigation = function () 46 { 47 // Tabs Navigation 48 $('#pp_box_cookies img').click(function () 49 { 50 51 let target = $(this).data('pair'); 52 53 $(this).toggleClass('open').siblings().addClass('closed').not('#pp_confirmation,#pp_confirmation_pop ').removeClass('open').not('#pp_confirmation,#pp_confirmation_pop'); 54 $('#pp_content .' + target).removeClass('closed').addClass('open').not('#pp_confirmation,#pp_confirmation_pop').siblings().removeClass('open').not('#pp_confirmation,#pp_confirmation_pop', $(this)).addClass('closed').not('#pp_confirmation'); 55 }); 56 57 // Accordion Navigation 58 $('#pp_content .cookie span, #datenschutz_analytics .cookie h4').click(function () 59 { 60 if ($(this).hasClass('da')) 61 { 62 $(this).toggleClass('open').next().next().slideToggle().addClass('open').parent().siblings().children('.cookie_description').slide
62Up().removeClass('open').prev().prev().removeClass('open'); 63 } 64 else 65 { 66 $(this).toggleClass('open').next().slideToggle().addClass('open').parent().siblings().children('.cookie_description').slideUp().removeClass('open').prev().removeClass('open'); 67 } 68 69 }); 70 71 }; 72 73 74/** 75 * Watcher - Cookie Hinweis akzeptieren, ablehnen oder abschalten 76 */ 77CPrivacyPolicy.prototype.actionWatcher = function () 78 { 79 // Cookies mit optionen akzeptiert 80 $('.pp_confirm').click(function () 81 { 82 PrivacyPolicy.setCookies(true); 83 PrivacyPolicy.hideBox(); 84 }); 85 86 // Grundsätzlich alle Cookies akzeptiert 87 $('.pp_confirm_pop').click(function () 88 { 89 90 PrivacyPolicy.setCookies(false); 91 PrivacyPolicy.hideBox(); 92 93 }); 94 95 // Cookies abgelehnt. Nur Funktions-Cookies 96 $('.pp_deny').click(function () 97 { 98 PrivacyPolicy.denyCookies(); 99 PrivacyPolicy.hideBox(); 100 }); 101 102 // Cookie Hinweis ausblenden 103 $('#pp_close_box').click(function () 104 { 105 PrivacyPolicy.hideBox(); 106 }); 107 108 $('#pp_google_analytcs').click(function () 109 { 110 111 if (PrivacyPolicy.endGoogleAnalytics()) 112 { 113 $(this).parent().fadeOut(); 114 115 } 116 }); 117 118 $('#pp_blackt_analytcs').click(function () 119 { 120 121 if (PrivacyPolicy.endBlackTAnalytics()) 122 { 123 $(this).parent().fadeOut(); 124 125 } 126 127 }); 128 129 $('#datenschutz_analytics #da_allow_blackt_analytics').click(function () 130 { 131 if ($(this).prop('checked') === true) 132 { 133 PrivacyPolicy.setCookies(true); 134 } 135 else 136 { 137 PrivacyPolicy.endBlackTAnalytics(); 138 } 139 140 }); 141 142 $('#datenschutz_analytics #da_allow_google_analytics').click(function () 143 { 144 145 if ($(this).prop('checked') === true) 146 { 147 PrivacyPolicy.setCookies(true); 148 } 149 else 150 { 151 PrivacyPolicy.endGoogleAnalytics(); 152 } 153 }); 154 }; 155 156 157/** 158 * Cookies angenommen - Vorgang durchführen 159 * @param checkup Wenn true, wird überprüft, welche Optionen erlaubt ist und je nachdem werden cookies angelegt 160 * Wenn false, wird alles angelegt. 161 */ 162CPrivacyPolicy.prototype.setCookies = function (checkup) 163 { 164 165 // Cookie setzen um cookie hinweis nicht erneut nachzufragen 166 document.cookie = "bt_privacy_policy_set=1; expires=" + this.plusWeek + "" + ";path=/"; 167 localStorage.setItem('bt_privacy_policy_set', '1'); 168 169 if (checkup === true) 170 { 171 // black.t Analytics erlauben 172 if ($('#allow_analytics').prop('checked') === true || $('#datenschutz_analytics #da_allow_blackt_analytics').prop('checked') === true) 173 { 174 175 document.cookie = "bt_allow_analytics=1; expires=" + this.plusWeek + "" + ";path=/"; 176 localStorage.setItem('bt_allow_analytics', '1'); 177 178 this.startBlackTAnalytics(); 179 } 180 181 // Google Analytics erlauben 182 if ($('#allow_google_analytics').prop('checked') === true || $('#datenschutz_analytics #da_allow_google_analytics').prop('checked') === true) 183 { 184 185 document.cookie = "bt_allow_google_analytics=1; expires=" + this.plusWeek + "" + ";path=/"; 186 localStorage.setItem('bt_allow_google_analytics', '1'); 187 188 this.startGoogleAnalytics(); 189 } 190 } 191 else 192 { 193 document.cookie = "bt_allow_analytics=1; expires=" + this.plusWeek + "" + ";path=/"; 194 document.cookie = "bt_allow_google_analytics=1; expires=" + this.plusWeek + "" + ";path=/"; 195 localStorage.setItem('bt_allow_analytics', '1'); 196 localStorage.setItem('bt_allow_google_analytics', '1'); 197 this.startGoogleAnalytics(); 198 this.startBlackTAnalytics(); 199 } 200 201 202 return true; 203 }; 204 205 206/** 207 * Cookies abgelehnt - Vorgang abbrechen 208 */ 209CPrivacyPolicy.prototype.denyCookies = function () 210 { 211 212 // Cookie setzen um cookie hinweis nicht erneut nachzufragen 213 document.cookie = "bt_privacy_policy_set=1; expires=" + this.plusWeek + "" + ";path=/"; 214 localStorage.setItem('bt_privacy_policy_set', '1'); 215 }; 216 217 218/** 219 * Um Box anzuzeigen 220 */ 221CPrivacyPolicy.prototype.showBox = function () 222 { 223 setTimeout(function () 224 { 225 $('#privacy_policy_wrapper,#privacy_policy_wrapper_pop').addClass('open') 226 }, 1500); 227 }; 228 229 230/** 231 * Hinweisbox verdecken 232 */ 233CPrivacyPolicy.prototype.hideBox = function () 234 { 235 236 $('#privacy_policy_wrapper,#privacy_policy_wrapper_pop').removeClass('open').addClass('closed'); 237 }; 238 239 240/** 241 * Google Analytics starten 242 */ 243CPrivacyPolicy.prototype.startGoogleAnalytics = function () 244 { 245 246 let c_cookiesAllowed = document.cookie.indexOf('bt_allow_google_analytics'); 247 let local_cookiesAllowed = localStorage.getItem('bt_allow_google_analytics'); 248 249 250 // Google Analytics UA-Code wurde angegeben... 251 let ga_ua = $('#privacy_policy_wrapper .pp_ga_state, #privacy_policy_wrapper_pop .pp_ga_state').val(); 252 if (ga_ua === '1' && c_cookiesAllowed !== -1 || ga_ua === '1' && local_cookiesAllowed !== null) 253 { 254 255 // trigger Google Analytics 256 gaOptIn(); 257 } 258 }; 259 260 261CPrivacyPolicy.prototype.startBlackTAnalytics = function () 262 { 263 264 // Lytics.getData(); 265 266 }; 267 268 269CPrivacyPolicy.prototype.endBlackTAnalytics = function () 270 { 271 272 document.cookie = "bt_allow_analytics=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; 273 document.cookie = "bt_stpEDC=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; 274 localStorage.removeItem('bt_allow_analytics'); 275 276 return true; 277 }; 278 279 280CPrivacyPolicy.prototype.endGoogleAnalytics = function () 281 { 282 let wildcard = $('.domain_data').data('domain_wildcard'); 283 284 document.cookie = "bt_allow_google_analytics=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; 285 document.cookie = "_ga=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;domain=" + wildcard + ""; 286 document.cookie = "_gat=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;domain=" + wildcard + ""; 287 document.cookie = "_gid=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;domain=" + wildcard + ""; 288 document.cookie = "id=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;domain=" + wildcard + ""; 289 localStorage.removeItem('bt_allow_google_analytics'); 290 291 return true; 292 }; 293 294 295// BEGIN Objektinstanz erzeugen 296let PrivacyPolicy; 297$(document).ready(function () 298{ 299 PrivacyPolicy = new CPrivacyPolicy(); 300});
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.