/* --- Parameters --- */ var consent_manager_parameters = {initially_hidden: true, domain: "www.karim-immobilien.de", consentid: "6849129aa19373.70622504", cachelogid: "20", version: "3", fe_controller: "/", hidebodyscrollbar: false}; /* --- Consent-Manager Box Template lang=1 --- */ var consent_manager_box_template = ' '; /* --- /assets/addons/consent_manager/js.cookie-2.2.1.min.js --- */ /*! js-cookie v2.2.1 | MIT */ !function(a){var b;if("function"==typeof define&&define.amd&&(define(a),b=!0),"object"==typeof exports&&(module.exports=a(),b=!0),!b){var c=window.Cookies,d=window.Cookies=a();d.noConflict=function(){return window.Cookies=c,d}}}(function(){function a(){for(var a=0,b={};a0?parseInt(n.substring(i+5,n.indexOf(".",i))):-1} // element.classList polyfill http://purl.eligrey.com/github/classList.js/blob/master/classList.js "document"in self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||!function(t){"use strict";if("Element"in t){var e="classList",n="prototype",i=t.Element[n],s=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},o=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},c=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},a=function(t,e){if(""===e)throw new c("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(e))throw new c("INVALID_CHARACTER_ERR","The token must not contain space characters.");return o.call(t,e)},l=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],i=0,s=n.length;s>i;i++)this.push(n[i]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},u=l[n]=[],h=function(){return new l(this)};if(c[n]=Error[n],u.item=function(t){return this[t]||null},u.contains=function(t){return~a(this,t+"")},u.add=function(){var t,e=arguments,n=0,i=e.length,s=!1;do t=e[n]+"",~a(this,t)||(this.push(t),s=!0);while(++nn;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(t,e){var n=this.toString().split(" "),i=n.indexOf(t+"");~i&&(n=n.slice(i),this.remove.apply(this,n),this.add(e),this.add.apply(this,n.slice(1)))}),t=null}()); // DOMParser polyfill https://gist.github.com/1129031 !function(t){"use strict";var e=t.prototype,r=e.parseFromString;try{if((new t).parseFromString("","text/html"))return}catch(t){}e.parseFromString=function(t,e){if(/^\s*text\/html\s*(?:;|$)/i.test(e)){var n=document.implementation.createHTMLDocument("");return t.toLowerCase().indexOf("-1?n.documentElement.innerHTML=t:n.body.innerHTML=t,n}return r.apply(this,arguments)}}(DOMParser); // nodelist.forEach polyfill https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach if (window.NodeList && !NodeList.prototype.forEach){NodeList.prototype.forEach = Array.prototype.forEach;} // node.remove polyfill https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md [Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach(function(e){e.hasOwnProperty("remove")||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})}); // custom event polyfill https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill !function(){if("function"==typeof window.CustomEvent)return!1;window.CustomEvent=function(n,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var e=document.createEvent("CustomEvent");return e.initCustomEvent(n,t.bubbles,t.cancelable,t.detail),e}}(); /* --- /assets/addons/consent_manager/consent_manager_frontend.js --- */ /* globals Cookies, consent_managerIEVersion */ (function () { 'use strict'; var expires = new Date(), show = 0, cookieData = {}, consents = [], addonVersion = -1, cachelogid = -1, cookieVersion = -1, cookieCachelogid = -1, consent_managerBox; expires.setFullYear(expires.getFullYear() + 1); // es gibt keinen datenschutzcookie, banner zeigen if (typeof Cookies.get('consent_manager') === 'undefined') { show = 1; Cookies.set('test', 'test', { path: '/', sameSite: 'Lax', secure: false }); // cookie konnte nicht gesetzt werden, kein cookie banner anzeigen if (typeof Cookies.get('test') === 'undefined') { show = 0; } else { Cookies.remove('test'); } } else { cookieData = JSON.parse(Cookies.get('consent_manager')); // cookie version auslesen. cookie version = major addon version zum zeitpunkt des cookie speicherns if (cookieData.hasOwnProperty('version')) { consents = cookieData.consents; cookieVersion = parseInt(cookieData.version); cookieCachelogid = parseInt(cookieData.cachelogid); } } if (consent_manager_box_template === '') { console.warn('Addon consent_manager: Keine Cookie-Gruppen / Cookies ausgewählt bzw. keine Domain zugewiesen! (' + location.hostname + ')'); return; } consent_managerBox = new DOMParser().parseFromString(consent_manager_box_template, 'text/html'); consent_managerBox = consent_managerBox.getElementById('consent_manager-background'); document.querySelectorAll('body')[0].appendChild(consent_managerBox); // aktuelle major addon version auslesen addonVersion = parseInt(consent_manager_parameters.version); cachelogid = parseInt(consent_manager_parameters.cachelogid); // cookie wurde mit einer aelteren major version gesetzt, alle consents loeschen und box zeigen if (addonVersion !== cookieVersion || cachelogid !== cookieCachelogid) { show = 1; consents = []; deleteCookies(); } if (consent_managerIEVersion() === 9) { consent_managerBox.querySelectorAll('.consent_manager-cookiegroup-checkbox').forEach(function (el) { el.classList.remove('pretty'); el.querySelectorAll('.icon').forEach(function (icon) { icon.remove(); }); }); } consents.forEach(function (uid) { addScript(consent_managerBox.querySelector('[data-uid="script-' + uid + '"]')); }); if (consent_manager_parameters.initially_hidden) { show = 0; } if (show) { showBox(); } consent_managerBox.querySelectorAll('.consent_manager-close').forEach(function (el) { el.addEventListener('click', function () { if (el.classList.contains('consent_manager-save-selection')) { deleteCookies(); saveConsent('selection'); } else if (el.classList.contains('consent_manager-accept-all')) { deleteCookies(); saveConsent('all'); } if (consent_manager_parameters.hidebodyscrollbar) { document.querySelector('body').style.overflow = 'auto'; } document.getElementById('consent_manager-background').classList.add('consent_manager-hidden'); }); }); document.getElementById('consent_manager-toggle-details').addEventListener('click', function () { document.getElementById('consent_manager-detail').classList.toggle('consent_manager-hidden'); }); document.querySelectorAll('.consent_manager-show-box, .consent_manager-show-box-reload').forEach(function (el) { el.addEventListener('click', function () { showBox(); }); }); function saveConsent(toSave) { consents = []; cookieData = { consents: [], version: addonVersion, consentid: consent_manager_parameters.consentid, cachelogid: consent_manager_parameters.cachelogid }; // checkboxen consent_managerBox.querySelectorAll('[data-cookie-uids]').forEach(function (el) { // array mit cookie uids var cookieUids = JSON.parse(el.getAttribute('data-cookie-uids')); if (el.checked || toSave === 'all') { cookieUids.forEach(function (uid) { consents.push(uid); addScript(consent_managerBox.querySelector('[data-uid="script-' + uid + '"]')); }); } else { cookieUids.forEach(function (uid) { removeScript(consent_managerBox.querySelector('[data-uid="script-' + uid + '"]')); }); } }); cookieData.consents = consents; Cookies.set('consent_manager', JSON.stringify(cookieData), { expires: expires, path: '/', sameSite: 'Lax', secure: false }); var http = new XMLHttpRequest(), url = consent_manager_parameters.fe_controller + '?rex-api-call=consent_manager', params = 'domain=' + consent_manager_parameters.domain + '&consentid=' + consent_manager_parameters.consentid; http.open('POST', url, false); http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); http.send(params); if (document.querySelectorAll('.consent_manager-show-box-reload').length) { location.reload(); } else { document.dispatchEvent(new CustomEvent('consent_manager-saved', { detail: JSON.stringify(consents) })); } } function deleteCookies() { var domain = consent_manager_parameters.domain; for (var key in Cookies.get()) { Cookies.remove(encodeURIComponent(key)); Cookies.remove(encodeURIComponent(key), { 'domain': domain }); Cookies.remove(encodeURIComponent(key), { 'path': '/' }); Cookies.remove(encodeURIComponent(key), { 'domain': domain, 'path': '/' }); Cookies.remove(encodeURIComponent(key), { 'domain': ('.' + domain) }); Cookies.remove(encodeURIComponent(key), { 'domain': ('.' + domain), 'path': '/' }); } } function addScript(el) { var scriptDom; if (!el) { return; } if (!el.children.length) { scriptDom = new DOMParser().parseFromString(window.atob(el.getAttribute('data-script')), 'text/html'); for (var i = 0; i < scriptDom.scripts.length; i++) { var scriptNode = document.createElement('script'); if (scriptDom.scripts[i].src) { scriptNode.src = scriptDom.scripts[i].src; } else { scriptNode.innerHTML = scriptDom.scripts[i].innerHTML; } el.appendChild(scriptNode); } } } function removeScript(el) { if (!el) { return; } el.innerHTML = ''; } function showBox() { consent_managerBox.querySelectorAll('[data-cookie-uids]').forEach(function (el) { var check = true, cookieUids = JSON.parse(el.getAttribute('data-cookie-uids')); cookieUids.forEach(function (uid) { if (consents.indexOf(uid) === -1) { check = false; } }); if (check) { el.checked = true; } }); if (consent_manager_parameters.hidebodyscrollbar) { document.querySelector('body').style.overflow = 'hidden'; } document.getElementById('consent_manager-background').classList.remove('consent_manager-hidden'); } })();