| | |
| | |
| | |
| | |
| | |
| | <script> |
| | |
| | |
| | let docsConsent = __md_get("__consent") |
| | let d = new Date(); |
| | d.setTime(d.getTime() + 5 * 24 * 60 * 60 * 1000); |
| | let n8nCookie = {'consent': true}; |
| | |
| | |
| | if (docsConsent && docsConsent.analytics === true) { |
| | document.cookie = `n8n-consent=${JSON.stringify(n8nCookie)};expires=${d.toUTCString()};path=/;domain=.n8n.io`; |
| | } |
| | |
| | |
| | let getn8nCookie = getCookie("n8n-consent"); |
| | if(getn8nCookie) { |
| | var parsedn8nCookie = JSON.parse(getn8nCookie); |
| | } |
| | if(parsedn8nCookie && parsedn8nCookie.consent === true) { |
| | |
| | __md_set("__consent", {"analytics": true}); |
| | } |
| | |
| | |
| | function getCookie(cname) { |
| | let name = cname + "="; |
| | let decodedCookie = decodeURIComponent(document.cookie); |
| | let ca = decodedCookie.split(';'); |
| | for(let i = 0; i <ca.length; i++) { |
| | let c = ca[i]; |
| | while (c.charAt(0) == ' ') { |
| | c = c.substring(1); |
| | } |
| | if (c.indexOf(name) == 0) { |
| | return c.substring(name.length, c.length); |
| | } |
| | } |
| | return ""; |
| | } |
| | </script> |
| | |
| |
|
| | |
| | <script> |
| | var consent = __md_get("__consent") |
| | if (consent) { |
| | for (var input of document.forms.consent.elements) |
| | if (input.name) |
| | input.checked = consent[input.name] || false |
| | |
| | |
| | } else if (location.protocol !== "file:") { |
| | setTimeout(function() { |
| | var el = document.querySelector("[data-md-component=consent]") |
| | el.hidden = false |
| | }, 250) |
| | } |
| | |
| | |
| | var form = document.forms.consent |
| | for (var action of ["submit", "reset"]) |
| | form.addEventListener(action, function(ev) { |
| | ev.preventDefault() |
| | |
| | |
| | if (ev.type === "reset") |
| | for (var input of document.forms.consent.elements) |
| | if (input.name) |
| | input.checked = false |
| | |
| | |
| | console.log(new FormData(form)) |
| | __md_set("__consent", Object.fromEntries( |
| | Array.from(new FormData(form).keys()) |
| | .map(function(key) { return [key, true] }) |
| | )) |
| | |
| | |
| | location.hash = ''; |
| | location.reload() |
| | }) |
| | </script> |
| |
|