forked from markus/AMPERION_Webpage
Update020920251404
This commit is contained in:
parent
8119796efa
commit
6c64da0884
2 changed files with 181 additions and 97 deletions
|
|
@ -1,73 +1,141 @@
|
|||
|
||||
|
||||
<!-- JS Plugins + Main script -->
|
||||
{{ $scripts := slice }}
|
||||
{{ range site.Params.plugins.js}}
|
||||
{{ if findRE "^http" .link }}
|
||||
<script src="{{ .link | relURL }}" type="application/javascript" {{.attributes | safeHTMLAttr}}></script>
|
||||
{{ else }}
|
||||
{{ $scripts = $scripts | append (resources.Get .link) }}
|
||||
{{ end }}
|
||||
{{ if findRE "^http" .link }}
|
||||
<script src="{{ .link | relURL }}" type="application/javascript" {{.attributes | safeHTMLAttr}}></script>
|
||||
{{ else }}
|
||||
{{ $scripts = $scripts | append (resources.Get .link) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $scripts := $scripts | append (resources.Get "js/script.js" | minify) }}
|
||||
{{ $scripts := $scripts | resources.Concat "js/script.js" | minify | fingerprint "sha512" }}
|
||||
<script crossorigin="anonymous" defer="defer" integrity="{{ $scripts.Data.Integrity }}" type="application/javascript">{{$scripts.Content | safeJS}}</script>
|
||||
|
||||
|
||||
|
||||
<!-- Cookie-Manager -->
|
||||
<script src="/tarteaucitron/tarteaucitron.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
tarteaucitron.init({
|
||||
"privacyUrl": "/datenschutz",
|
||||
"bodyPosition": "top",
|
||||
"hashtag": "#tarteaucitron",
|
||||
"cookieName": "tarteaucitron",
|
||||
"orientation": "middle",
|
||||
|
||||
"groupServices": true,
|
||||
"showDetailsOnClick": false,
|
||||
"serviceDefaultState": "wait", // ← wichtig: wartet auf Nutzeraktion
|
||||
"showAlertSmall": false,
|
||||
"cookieslist": false,
|
||||
|
||||
"closePopup": false,
|
||||
"showIcon": true,
|
||||
"iconPosition": "BottomRight",
|
||||
|
||||
"adblocker": false,
|
||||
"DenyAllCta": false,
|
||||
"AcceptAllCta": true,
|
||||
"highPrivacy": true, // ← wichtig: kein Auto-Consent
|
||||
"alwaysNeedConsent": false,
|
||||
|
||||
"handleBrowserDNTRequest": false,
|
||||
"removeCredit": false,
|
||||
"moreInfoLink": true,
|
||||
"useExternalCss": false,
|
||||
"useExternalJs": false,
|
||||
|
||||
"mandatory": false, // ← notwendig, wenn man keine Pflicht-Cookies nutzt
|
||||
"mandatoryCta": false,
|
||||
|
||||
"googleConsentMode": true,
|
||||
"bingConsentMode": true,
|
||||
"softConsentMode": false,
|
||||
|
||||
"dataLayer": false,
|
||||
"serverSide": false,
|
||||
"partnersList": true
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- hCaptcha Custom-Service (MUSS VOR init DEFINIERT SEIN) -->
|
||||
<script>
|
||||
tarteaucitron.user.matomoId = 2;
|
||||
(tarteaucitron.job = tarteaucitron.job || []).push('matomocloud');
|
||||
(function() {
|
||||
function renderAllHC() {
|
||||
try {
|
||||
var nodes = document.querySelectorAll('.h-captcha');
|
||||
if (!nodes.length) return;
|
||||
|
||||
if (!window.hcaptcha || !window.hcaptcha.render) {
|
||||
setTimeout(renderAllHC, 200);
|
||||
return;
|
||||
}
|
||||
|
||||
nodes.forEach(function(el) {
|
||||
if (el.getAttribute('data-hc-rendered') === '1') return;
|
||||
|
||||
var sitekey = el.getAttribute('data-sitekey');
|
||||
if (!sitekey) {
|
||||
el.innerHTML = '<div style="color:#b00020;font-size:13px;padding:8px 0;">hCaptcha: data-sitekey fehlt.</div>';
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
window.hcaptcha.render(el, {
|
||||
sitekey: sitekey,
|
||||
theme: el.getAttribute('data-theme') || 'light',
|
||||
size: el.getAttribute('data-size') || 'normal'
|
||||
});
|
||||
el.setAttribute('data-hc-rendered', '1');
|
||||
} catch (e) {
|
||||
el.innerHTML = '<div style="color:#b00020;font-size:13px;padding:8px 0;">hCaptcha Render-Fehler: ' + (e && e.message ? e.message : e) + '</div>';
|
||||
}
|
||||
});
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
// globaler Callback für die API
|
||||
window.__hcRenderAll = renderAllHC;
|
||||
|
||||
// hCaptcha als Tarteaucitron-Service
|
||||
tarteaucitron.services.hcaptcha = {
|
||||
key: 'hcaptcha',
|
||||
type: 'other',
|
||||
name: 'hCaptcha',
|
||||
needConsent: true,
|
||||
cookies: [],
|
||||
uri: 'https://www.hcaptcha.com/privacy',
|
||||
js: function () {
|
||||
if (!document.getElementById('hcaptcha-api')) {
|
||||
var s = document.createElement('script');
|
||||
s.id = 'hcaptcha-api';
|
||||
s.src = 'https://hcaptcha.com/1/api.js?render=explicit&onload=__hcRenderAll';
|
||||
s.async = true;
|
||||
s.defer = true;
|
||||
s.onerror = function() {
|
||||
document.querySelectorAll('.h-captcha').forEach(function(el){
|
||||
el.innerHTML = '<div style="color:#b00020;font-size:13px;padding:8px 0;">hCaptcha API geblockt (CSP/Blocker?).</div>';
|
||||
});
|
||||
};
|
||||
document.head.appendChild(s);
|
||||
} else {
|
||||
__hcRenderAll();
|
||||
}
|
||||
},
|
||||
fallback: function () {
|
||||
tarteaucitron.fallback(['h-captcha'], tarteaucitron.engage('hcaptcha'));
|
||||
}
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
|
||||
<script>tarteaucitron.user.matomoHost = 'https://matomo.amperion.at/';
|
||||
tarteaucitron.user.matomoDontTrackPageView = dontTrackPageView (false | true);
|
||||
tarteaucitron.user.matomoFullTracking = fullTracking (true | false);
|
||||
<!-- Tarteaucitron initialisieren -->
|
||||
<script type="text/javascript">
|
||||
tarteaucitron.init({
|
||||
"privacyUrl": "/datenschutz",
|
||||
"bodyPosition": "top",
|
||||
"hashtag": "#tarteaucitron",
|
||||
"cookieName": "tarteaucitron",
|
||||
"orientation": "middle",
|
||||
|
||||
"groupServices": true,
|
||||
"showDetailsOnClick": false,
|
||||
"serviceDefaultState": "wait",
|
||||
"showAlertSmall": false,
|
||||
"cookieslist": false,
|
||||
|
||||
"closePopup": false,
|
||||
"showIcon": true,
|
||||
"iconPosition": "BottomRight",
|
||||
|
||||
"adblocker": false,
|
||||
"DenyAllCta": false,
|
||||
"AcceptAllCta": true,
|
||||
"highPrivacy": true,
|
||||
"alwaysNeedConsent": false,
|
||||
|
||||
"handleBrowserDNTRequest": false,
|
||||
"removeCredit": false,
|
||||
"moreInfoLink": true,
|
||||
"useExternalCss": false,
|
||||
"useExternalJs": false,
|
||||
|
||||
"mandatory": false,
|
||||
"mandatoryCta": false,
|
||||
|
||||
"googleConsentMode": true,
|
||||
"bingConsentMode": true,
|
||||
"softConsentMode": false,
|
||||
|
||||
"dataLayer": false,
|
||||
"serverSide": false,
|
||||
"partnersList": true
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="/js/tarteaucitron.js"></script>
|
||||
<!-- Matomo + hCaptcha in die Queue (NACH init) -->
|
||||
<script>
|
||||
tarteaucitron.user.matomoId = 2;
|
||||
tarteaucitron.user.matomoHost = 'https://matomo.amperion.at/';
|
||||
tarteaucitron.user.matomoDontTrackPageView = false; // bei Bedarf true
|
||||
tarteaucitron.user.matomoFullTracking = true; // bei Bedarf false
|
||||
|
||||
(tarteaucitron.job = tarteaucitron.job || []).push('matomocloud');
|
||||
(tarteaucitron.job = tarteaucitron.job || []).push('hcaptcha');
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue