@massimo-cassandro/minimo 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/package.json +27 -0
- package/src/TODO custom-properties.scss +230 -0
- package/src/components/auto-datatable/auto-datatable.css +355 -0
- package/src/components/auto-datatable/auto-datatable.js +154 -0
- package/src/components/init.js +7 -0
- package/src/components/modal-alert/flash-alerts.js +32 -0
- package/src/components/modal-alert/modal-alert.css +47 -0
- package/src/components/modal-alert/modal-alert.js +85 -0
- package/src/components/modal-alert/svg/check-circle-duotone.svg +1 -0
- package/src/components/modal-alert/svg/info-duotone.svg +1 -0
- package/src/components/modal-alert/svg/question-duotone.svg +1 -0
- package/src/components/modal-alert/svg/warning-duotone.svg +1 -0
- package/src/components/modal-alert/svg/x-circle-duotone.svg +1 -0
- package/src/components/modal-content/modal-content.js +152 -0
- package/src/components/modal-content/modal-content.module.css +142 -0
- package/src/components/recaptcha/recaptcha.css +74 -0
- package/src/components/sf-macro/sf-macro.css +104 -0
- package/src/components/sf-macro/sf-macro.js +44 -0
- package/src/components/vanilla-cookie-consent/cookie-consent.css +20 -0
- package/src/components/vanilla-cookie-consent/cookie-consent.js +76 -0
- package/src/components/vanilla-cookie-consent/render-cookie-list.js +32 -0
- package/src/components/vanilla-cookie-consent/src/cookie-list.js +85 -0
- package/src/components/vanilla-cookie-consent/src/it-translation.js +38 -0
- package/src/components/vanilla-cookie-consent/src/run-analytics.js +54 -0
- package/src/components/vanilla-cookie-consent/src/run-recaptcha.js +71 -0
- package/src/css/alerts.css +95 -0
- package/src/css/anchors.css +40 -0
- package/src/css/buttons/btn-close.css +41 -0
- package/src/css/buttons/buttons.css +187 -0
- package/src/css/buttons/status-buttons.css +107 -0
- package/src/css/container.css +15 -0
- package/src/css/data-formats.css +30 -0
- package/src/css/details.css +19 -0
- package/src/css/dialog-content.css +72 -0
- package/src/css/flex.css +30 -0
- package/src/css/forms/form-edit-info.css +17 -0
- package/src/css/forms/forms.css +315 -0
- package/src/css/forms/select-indicator.svg +3 -0
- package/src/css/grid.css +63 -0
- package/src/css/headings.css +34 -0
- package/src/css/icons.css +114 -0
- package/src/css/inner-nav.css +11 -0
- package/src/css/layout-base.css +11 -0
- package/src/css/overlay.css +11 -0
- package/src/css/reset.css +59 -0
- package/src/css/spinners/TODO spinner-circle.css +54 -0
- package/src/css/spinners/TODO spinner-three-dots.css +14 -0
- package/src/css/spinners/readme.md +1 -0
- package/src/css/spinners/spinner-circle-basic.css +15 -0
- package/src/css/spinners/spinner-trailing-dots.css +51 -0
- package/src/css/spinners/spinner-wrapper.css +20 -0
- package/src/css/svg.css +3 -0
- package/src/css/table.css +66 -0
- package/src/css/text.css +114 -0
- package/src/css/utilities.css +128 -0
- package/src/custom-media-default.css +16 -0
- package/src/custom-properties-default.css +273 -0
- package/src/index.css +49 -0
- package/src/index.js +0 -0
- package/src/js/alert-autoclose.js +9 -0
- package/src/js/create-blurhash-canvas.js +47 -0
- package/src/js/dialog-content.js +82 -0
- package/src/js/dismiss-alerts.js +6 -0
- package/src/js/forms.js +36 -0
- package/src/js/img-viewer-dom-builder.js +196 -0
- package/src/js/inner-nav.js +11 -0
- package/src/js/overlay.js +12 -0
- package/src/js/print-icon.js +51 -0
- package/src/js/spinner.js +30 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
|
|
3
|
+
{%- set chiave_recaptcha_client = '6Le75-AZAAAAAO1sEV1JChhNg3nYw1HBn9AjaVSN' -%}
|
|
4
|
+
<div class="recaptcha-form-wrapper disabled" data-key="{{ chiave_recaptcha_client }}">
|
|
5
|
+
|
|
6
|
+
<form id="form-xxx" action="" method="post">
|
|
7
|
+
..
|
|
8
|
+
</form>
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
<div class="recaptcha-alert">Per abilitare questo form è necessario attivare
|
|
12
|
+
i cookie per le funzionalità aggiuntive modificando le tue
|
|
13
|
+
<button class="btn btn-link" type="button" data-cc="show-preferencesModal" aria-haspopup="dialog">preferenze per i cookie</button></div>
|
|
14
|
+
|
|
15
|
+
<p class="text-xs">Questo modulo è protetto da Google reCAPTCHA.
|
|
16
|
+
Per info consulta la <a href="https://policies.google.com/privacy" target="_blank" rel="noopener noreferrer">Privacy Policy</a> di Google
|
|
17
|
+
e i <a href="https://policies.google.com/terms" target="_blank" rel="noopener noreferrer">termini di servizio</a>.</p>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
.recaptcha-form-wrapper {
|
|
23
|
+
|
|
24
|
+
.recaptcha-alert {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.disabled {
|
|
29
|
+
position: relative;
|
|
30
|
+
|
|
31
|
+
.recaptcha-form-inner-wrapper {
|
|
32
|
+
filter: blur(2px);
|
|
33
|
+
|
|
34
|
+
&::after {
|
|
35
|
+
position: absolute;
|
|
36
|
+
inset: 0;
|
|
37
|
+
display: block;
|
|
38
|
+
content: '';
|
|
39
|
+
background-color: var(--recaptcha-alert-overlay, color-mix(in srgb, #000 50%, transparent));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
input, select, textarea {
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
user-select: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.recaptcha-alert {
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 50%;
|
|
50
|
+
left: 50%;
|
|
51
|
+
display: block;
|
|
52
|
+
padding: var(--spacing-xs);
|
|
53
|
+
color: var(--recaptcha-alert-fg, #fff);
|
|
54
|
+
background-color: var(--recaptcha-alert-bg, #000);
|
|
55
|
+
border: .5px solid currentColor;
|
|
56
|
+
border-radius: var(--radius-xs);
|
|
57
|
+
box-shadow: var(--box-shadow-base);
|
|
58
|
+
transform-origin: center;
|
|
59
|
+
translate: -50% -50%;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.grecaptcha-badge {
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.grecaptcha-info {
|
|
69
|
+
margin: 1rem 0 0;
|
|
70
|
+
font-size: .6rem;
|
|
71
|
+
font-style: italic;
|
|
72
|
+
font-weight: 300;
|
|
73
|
+
opacity: 75%;
|
|
74
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
|
|
2
|
+
.sf-macro-wrapper {
|
|
3
|
+
--sf-macro-rows-padding: .5rem;
|
|
4
|
+
--sf-macro-rows-margin-bottom: 1rem;
|
|
5
|
+
--sf-macro-rows-border-radius: .4rem;
|
|
6
|
+
--sf-macro-rows-hover-bg-color: color-mix(in srgb, var(--body-bg-color) 95%, #000);
|
|
7
|
+
--sf-macro-even-rows-bg-color: var(--body-bg-color); /* rgb(0 0 0 / .05); */
|
|
8
|
+
--sf-macro-rows-border: 1px solid var(--stone-5);
|
|
9
|
+
--sf-macro-close-btn-size: 2rem;
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
/* etichette campi righe successive alla prima */
|
|
13
|
+
@media (--desktop-up) {
|
|
14
|
+
&:not(.always-show-labels) {
|
|
15
|
+
.sf-macro-riga {
|
|
16
|
+
&:not(:first-child) {
|
|
17
|
+
.form-label, label {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/*
|
|
26
|
+
// forza la visualizzazione delle etichette in tutte le righe
|
|
27
|
+
// a partire dal breakpont successivo a quello indicato
|
|
28
|
+
@each $brk in (xs, sm, md, lg, xl) {
|
|
29
|
+
&.sf-macro-show-label-down-#{$brk} {
|
|
30
|
+
@include media-breakpoint-down($brk) {
|
|
31
|
+
.form-label, label {
|
|
32
|
+
display: inline-block !important;
|
|
33
|
+
}
|
|
34
|
+
} // end @media
|
|
35
|
+
}
|
|
36
|
+
} // end @each
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.sf-macro-riga {
|
|
42
|
+
position: relative;
|
|
43
|
+
padding: var(--sf-macro-rows-padding);
|
|
44
|
+
margin-bottom: var(--sf-macro-rows-margin-bottom);
|
|
45
|
+
border: var(--sf-macro-rows-border);
|
|
46
|
+
border-radius: var(--sf-macro-rows-border-radius);
|
|
47
|
+
|
|
48
|
+
&:nth-child(even) {
|
|
49
|
+
background-color: var(--sf-macro-even-rows-bg-color);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
&:hover {
|
|
54
|
+
background-color: var(--sf-macro-rows-hover-bg-color);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.form-group {
|
|
58
|
+
margin-bottom: 0;
|
|
59
|
+
|
|
60
|
+
&:has([type='checkbox']) {
|
|
61
|
+
align-self: center;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.grid {
|
|
66
|
+
row-gap: .8rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
} /* end .sf-macro-riga */
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
.sf-macro-close-btn { /* button */
|
|
73
|
+
position: absolute;
|
|
74
|
+
top: -.5rem;
|
|
75
|
+
right: -.5rem;
|
|
76
|
+
z-index: 1;
|
|
77
|
+
display: block;
|
|
78
|
+
width: var(--sf-macro-close-btn-size);
|
|
79
|
+
height: var(--sf-macro-close-btn-size);
|
|
80
|
+
padding: 1px;
|
|
81
|
+
color: currentColor;
|
|
82
|
+
background-color: var(--body-content-bg);
|
|
83
|
+
border-radius: 50%;
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
&[disabled], [disabled] & {
|
|
87
|
+
cursor: not-allowed;
|
|
88
|
+
opacity: .4;
|
|
89
|
+
transform: skew(-15deg);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
svg {
|
|
93
|
+
width: 100%;
|
|
94
|
+
aspect-ratio: 1;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.sf-macro-riga:has(.sf-macro-close-btn:not(:disabled):hover) {
|
|
99
|
+
|
|
100
|
+
outline: 2px dashed var(--status-danger-color);
|
|
101
|
+
.sf-macro-close-btn {
|
|
102
|
+
color: var(--status-danger-color);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import './sf-macro.css';
|
|
2
|
+
|
|
3
|
+
export function sf_macro({
|
|
4
|
+
wrapper_selector = '.sf-macro-wrapper',
|
|
5
|
+
row_selector = '.sf-macro-riga',
|
|
6
|
+
add_callback = null,
|
|
7
|
+
del_callback = null
|
|
8
|
+
}={}) {
|
|
9
|
+
|
|
10
|
+
document.querySelectorAll(wrapper_selector).forEach(fset => {
|
|
11
|
+
const macro_container = fset.querySelector('.sf-macro-container')
|
|
12
|
+
,macro_template = macro_container.dataset.template
|
|
13
|
+
;
|
|
14
|
+
|
|
15
|
+
// listeners
|
|
16
|
+
fset.addEventListener('click', e => {
|
|
17
|
+
|
|
18
|
+
if(e.target.closest('.sf-macro-riga-add')) {
|
|
19
|
+
|
|
20
|
+
const righe_macro = macro_container.querySelectorAll(row_selector).length;
|
|
21
|
+
|
|
22
|
+
macro_container.insertAdjacentHTML('beforeend',
|
|
23
|
+
macro_template.replace(/__indice\d?__/g, righe_macro + 1)
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
if(add_callback && typeof add_callback === 'function') {
|
|
27
|
+
add_callback(
|
|
28
|
+
macro_container.querySelector('.sf-macro-riga:last-child'),
|
|
29
|
+
e.target.closest('.sf-macro-riga-add')
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
} else if(e.target.closest('.sf-macro-close-btn')) {
|
|
35
|
+
e.target.closest(row_selector).remove();
|
|
36
|
+
|
|
37
|
+
if(del_callback && typeof del_callback === 'function') {
|
|
38
|
+
del_callback();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}, false);
|
|
43
|
+
}); // end foreach wrapper_selector
|
|
44
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* stylelint-disable selector-max-id */
|
|
2
|
+
@import 'vanilla-cookieconsent/dist/cookieconsent.css';
|
|
3
|
+
|
|
4
|
+
/* stylelint-disable declaration-no-important */
|
|
5
|
+
#cc-main {
|
|
6
|
+
h2 {
|
|
7
|
+
line-height: 1.3 !important;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.btn-link {
|
|
11
|
+
font-weight: var(--font-weight-semibold);
|
|
12
|
+
|
|
13
|
+
@media (hover: hover) {
|
|
14
|
+
&:hover {
|
|
15
|
+
text-decoration: underline;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/* stylelint-enable declaration-no-important */
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import './cookie-consent.css';
|
|
2
|
+
import * as CookieConsent from 'vanilla-cookieconsent';
|
|
3
|
+
import { it_translation } from './src/it-translation.js';
|
|
4
|
+
// import { run_analytics } from './src/run-analytics.js';
|
|
5
|
+
import { run_recaptcha, disableRecaptcha } from './src/run-recaptcha.js';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// https://cookieconsent.orestbida.com/essential/getting-started.html
|
|
9
|
+
CookieConsent.run({
|
|
10
|
+
hideFromBots: !(new URLSearchParams(document.location.search).get('cc-list-parser') !== null), // abilita il parsing dei cookie da cookies-list
|
|
11
|
+
categories: {
|
|
12
|
+
necessary: {
|
|
13
|
+
enabled: true,
|
|
14
|
+
readOnly: true
|
|
15
|
+
},
|
|
16
|
+
functionality: {
|
|
17
|
+
enabled: true,
|
|
18
|
+
},
|
|
19
|
+
analytics: {
|
|
20
|
+
enabled: true,
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
guiOptions: {
|
|
24
|
+
consentModal: {
|
|
25
|
+
layout: 'box',
|
|
26
|
+
position: 'bottom right',
|
|
27
|
+
flipButtons: false,
|
|
28
|
+
equalWeightButtons: false
|
|
29
|
+
},
|
|
30
|
+
preferencesModal: {
|
|
31
|
+
layout: 'box',
|
|
32
|
+
// position: 'left right',
|
|
33
|
+
flipButtons: false,
|
|
34
|
+
equalWeightButtons: true
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
language: {
|
|
38
|
+
default: 'it',
|
|
39
|
+
translations: it_translation
|
|
40
|
+
},
|
|
41
|
+
onConsent: ({cookie}) => {
|
|
42
|
+
// if(cookie.categories.indexOf('analytics') !== -1) {
|
|
43
|
+
// run_analytics();
|
|
44
|
+
// }
|
|
45
|
+
if(cookie.categories.indexOf('functionality') !== -1) {
|
|
46
|
+
run_recaptcha();
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
// https://cookieconsent.orestbida.com/reference/configuration-reference.html#onchange
|
|
50
|
+
onChange: ({/* cookie, */changedCategories/* , changedServices */}) => {
|
|
51
|
+
if(changedCategories.includes('functionality')){
|
|
52
|
+
|
|
53
|
+
// caso in cui si cambia l'intera categoria
|
|
54
|
+
if(CookieConsent.acceptedCategory('functionality')){
|
|
55
|
+
run_recaptcha();
|
|
56
|
+
} else {
|
|
57
|
+
disableRecaptcha();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// TODO caso in cui si cambia il solo recaptcha (se ce ne fossero anche altri)
|
|
61
|
+
// console.log(cookie);
|
|
62
|
+
// console.log(changedServices);
|
|
63
|
+
// console.log(CookieConsent.acceptedService('_GRECAPTCHA', 'functionality'));
|
|
64
|
+
|
|
65
|
+
// if(changedServices['functionality'].includes('Google Analytics')){
|
|
66
|
+
// if(CookieConsent.acceptedService('Google Analytics', 'analytics')){
|
|
67
|
+
// // Google Analytics was just enabled
|
|
68
|
+
// }else{
|
|
69
|
+
// // Google Analytics was just disabled
|
|
70
|
+
// }
|
|
71
|
+
// }
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// lista dei cookie per visualizzazione nella pagina della privacy policy
|
|
2
|
+
// questo file è importato direttamente nella pagina privacy policy
|
|
3
|
+
|
|
4
|
+
import { cookie_list } from './src/cookie-list';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export function render_cookie_list(target) {
|
|
8
|
+
|
|
9
|
+
const list = document.createDocumentFragment()
|
|
10
|
+
.appendChild(document.createElement('ul'));
|
|
11
|
+
|
|
12
|
+
cookie_list
|
|
13
|
+
.filter(i => i.cookieTable !== undefined)
|
|
14
|
+
.forEach(tab => {
|
|
15
|
+
const section = list.appendChild(document.createElement('li'));
|
|
16
|
+
section.appendChild(document.createElement('span'));
|
|
17
|
+
section.querySelector(':scope > span').classList.add('cookie-list-section');
|
|
18
|
+
section.querySelector(':scope > span').appendChild(document.createTextNode(tab.title));
|
|
19
|
+
const sublist = section.appendChild(document.createElement('ul'));
|
|
20
|
+
|
|
21
|
+
tab.cookieTable.body.forEach(cookie => {
|
|
22
|
+
const li = sublist.appendChild(document.createElement('li'));
|
|
23
|
+
li.appendChild(document.createElement('strong'))
|
|
24
|
+
.appendChild(document.createTextNode(cookie.name + ': '));
|
|
25
|
+
li.appendChild(document.createTextNode(`${cookie.description} (dur. ${cookie.expiration})`));
|
|
26
|
+
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// console.log(list);
|
|
31
|
+
target.appendChild(list);
|
|
32
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// elenco da cookie nel formato utilizzato da cookie consent e da `render-cookie-list.js`
|
|
2
|
+
// per visualizzazione nella pagina privacy
|
|
3
|
+
|
|
4
|
+
// https://cookieconsent.orestbida.com/reference/configuration-reference.html
|
|
5
|
+
export const cookie_list = [
|
|
6
|
+
{
|
|
7
|
+
title: 'Cookie strettamente necessari',
|
|
8
|
+
description: 'I cookie necessari sono indispensabili per il corretto funzionamento del sito web. Questi cookie garantiscono le funzionalità di base e le caratteristiche di sicurezza del sito web, in modo anonimo.',
|
|
9
|
+
linkedCategory: 'necessary',
|
|
10
|
+
cookieTable: {
|
|
11
|
+
headers: {
|
|
12
|
+
name: 'Cookie',
|
|
13
|
+
domain: 'Impostato da',
|
|
14
|
+
description: 'Descrizione',
|
|
15
|
+
expiration: 'Durata',
|
|
16
|
+
},
|
|
17
|
+
body: [
|
|
18
|
+
{
|
|
19
|
+
name: 'cc_cookie',
|
|
20
|
+
domain: 'Questo sito',
|
|
21
|
+
description: 'Registra la tua scelta sui cookie',
|
|
22
|
+
expiration: '6 mesi'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'PHPSESSID',
|
|
26
|
+
domain: 'Questo sito',
|
|
27
|
+
description: 'Identifica la sessione corrente in modo anonimo in modo di poter eseguire alcune azioni.',
|
|
28
|
+
expiration: 'sessione'
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
title: 'Cookie per funzionalità aggiuntive',
|
|
36
|
+
description: 'Questi cookie sono necessari per l’abilitazione di alcune funzionalità aggiuntive. In mancanza della loro attivazione, alcune funzionalità non saranno disponibili',
|
|
37
|
+
linkedCategory: 'functionality',
|
|
38
|
+
cookieTable: {
|
|
39
|
+
headers: {
|
|
40
|
+
name: 'Cookie',
|
|
41
|
+
domain: 'Impostato da',
|
|
42
|
+
description: 'Descrizione',
|
|
43
|
+
expiration: 'Durata',
|
|
44
|
+
},
|
|
45
|
+
body: [
|
|
46
|
+
{
|
|
47
|
+
name: '_GRECAPTCHA',
|
|
48
|
+
domain: 'google.com',
|
|
49
|
+
description: 'Questo cookie è impostato dal servizio recaptcha di Google per identificare i bot e proteggere il sito da attacchi di spam dannosi.<br>'+
|
|
50
|
+
'Se questa opzione viene disattivata non sarà possibile utilizzare il form di contatto a fondo pagina',
|
|
51
|
+
expiration: 'Circa 6 mesi'
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
// {
|
|
58
|
+
// title: 'Cookie analitici',
|
|
59
|
+
// description: 'I cookie analitici vengono utilizzati per capire come i visitatori interagiscono con il sito web. Questi cookie aiutano a fornire informazioni sulle metriche del numero di visitatori, frequenza di rimbalzo, fonte di traffico, ecc.',
|
|
60
|
+
// linkedCategory: 'analytics',
|
|
61
|
+
// cookieTable: {
|
|
62
|
+
// headers: {
|
|
63
|
+
// name: 'Cookie',
|
|
64
|
+
// domain: 'Impostato da',
|
|
65
|
+
// description: 'Descrizione',
|
|
66
|
+
// expiration: 'Durata',
|
|
67
|
+
// },
|
|
68
|
+
// body: [
|
|
69
|
+
// {
|
|
70
|
+
// name: '_ga',
|
|
71
|
+
// domain: 'Questo sito',
|
|
72
|
+
// description: 'Cookie utilizzato da Google Analytics',
|
|
73
|
+
// expiration: '2 anni'
|
|
74
|
+
// },
|
|
75
|
+
// {
|
|
76
|
+
// name: '_ga_NBCMZ18740',
|
|
77
|
+
// domain: 'Questo sito',
|
|
78
|
+
// description: 'Cookie utilizzato da Google Analytics',
|
|
79
|
+
// expiration: '1 minuto'
|
|
80
|
+
// },
|
|
81
|
+
|
|
82
|
+
// ]
|
|
83
|
+
// }
|
|
84
|
+
// }
|
|
85
|
+
];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cookie_list } from './cookie-list.js';
|
|
2
|
+
|
|
3
|
+
export const it_translation = {
|
|
4
|
+
'it': {
|
|
5
|
+
consentModal: {
|
|
6
|
+
title: 'Utilizziamo i cookie per offrirti la migliore esperienza di navigazione ricordando le tue preferenze.',
|
|
7
|
+
description: 'Scegliendo l’opzione <strong>“Accetta tutti i cookie”</strong>, acconsenti all’uso di <strong>tutti</strong> i cookie.<br>' +
|
|
8
|
+
'Il pulsante <strong>“Gestisci le tue preferenze”</strong>, permette di selezionare singole categorie di cookies ed avere informazioni più dettagliate.<br>' +
|
|
9
|
+
'Tieni presente che alcune funzionalità potrebbero non essere disponibili se si accettano solo i cookie essenziali.<br>' +
|
|
10
|
+
'Per ulteriori informazioni vai alla pagina sulla <a href="/privacy-policy">Privacy e Cookie Policy</a>',
|
|
11
|
+
acceptAllBtn: 'Accetta tutti i cookie',
|
|
12
|
+
acceptNecessaryBtn: 'Accetta solo quelli essenziali',
|
|
13
|
+
showPreferencesBtn: 'Gestisci le tue preferenze'
|
|
14
|
+
},
|
|
15
|
+
preferencesModal: {
|
|
16
|
+
title: 'Gestici le tue preferenze sui cookie',
|
|
17
|
+
acceptAllBtn: 'Accetta tutti i cookie',
|
|
18
|
+
acceptNecessaryBtn: 'Accetta solo i cookie essenziali',
|
|
19
|
+
savePreferencesBtn: 'Salva le tue preferenze',
|
|
20
|
+
closeIconLabel: 'Chiudi',
|
|
21
|
+
sections: [
|
|
22
|
+
{
|
|
23
|
+
title: 'Utilizzo dei cookie',
|
|
24
|
+
description: 'Questo sito web utilizza i cookie per migliorare la tua esperienza di navigazione.<br>' +
|
|
25
|
+
'I cookie classificati come <em>strettamente necessari</em> vengono memorizzati nel browser in quanto sono essenziali per il funzionamento del sito.<br>' +
|
|
26
|
+
'Utilizziamo anche cookie di terze parti che ci aiutano ad analizzare e capire come utilizzi il portale. Questi cookie verranno memorizzati nel tuo browser solo con il tuo consenso. '+
|
|
27
|
+
'Hai la possibilità di disattivare questi cookie, tuttavia, la loro disattivazione potrebbe influire sulla tua esperienza di navigazione.'
|
|
28
|
+
},
|
|
29
|
+
...cookie_list,
|
|
30
|
+
{
|
|
31
|
+
title: 'Altre informazioni',
|
|
32
|
+
// description: 'Per ulteriori informazioni, consulta la pagina relativa a Privacy e Cookie Policy'
|
|
33
|
+
description: 'Per ulteriori informazioni, consulta la pagina relativa a <button class="btn-link" data-content="privacy" type="button" aria-haspopup="dialog">Privacy e Cookie Policy</button>'
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// imposta lo script analytics GA4 (se l'utente ha dato il consenso)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export function run_analytics() {
|
|
5
|
+
|
|
6
|
+
const analytics_id = 'G-NBCMZ18740';
|
|
7
|
+
|
|
8
|
+
// purchase_data_element = document.getElementById('ga-purchase-data'); // deinito in landing-acquisti
|
|
9
|
+
// let purchase_obj = null;
|
|
10
|
+
// if(purchase_data_element) {
|
|
11
|
+
// purchase_obj = JSON.parse(purchase_data_element.dataset.d);
|
|
12
|
+
// }
|
|
13
|
+
|
|
14
|
+
let script = document.createElement('script');
|
|
15
|
+
|
|
16
|
+
// <script async src="https://www.googletagmanager.com/gtag/js?id={{ GA_id }}"></script>
|
|
17
|
+
// <script>
|
|
18
|
+
// window.dataLayer = window.dataLayer || [];
|
|
19
|
+
// function gtag(){dataLayer.push(arguments);}
|
|
20
|
+
// gtag('js', new Date());
|
|
21
|
+
// gtag('config', '{{ GA_id }}');
|
|
22
|
+
// </script>
|
|
23
|
+
|
|
24
|
+
script.onload = function() {
|
|
25
|
+
window.dataLayer = window.dataLayer || [];
|
|
26
|
+
function gtag() {
|
|
27
|
+
window.dataLayer.push(arguments);
|
|
28
|
+
}
|
|
29
|
+
gtag('js', new Date());
|
|
30
|
+
gtag('config', analytics_id);
|
|
31
|
+
|
|
32
|
+
// if(purchase_obj) {
|
|
33
|
+
// gtag('event', 'purchase', purchase_obj);
|
|
34
|
+
// }
|
|
35
|
+
|
|
36
|
+
// console.log('GA4 onLoad');
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
script.classList.add('ga');
|
|
40
|
+
script.src = `https://www.googletagmanager.com/gtag/js?id=${analytics_id}`;
|
|
41
|
+
document.head.appendChild(script);
|
|
42
|
+
|
|
43
|
+
// console.log('Google Analytics ON');
|
|
44
|
+
// console.log(document.head.querySelector('script.ga'));
|
|
45
|
+
// console.groupCollapsed('Impostazioni analytics');
|
|
46
|
+
// console.log(`analytics_id: ${analytics_id}`);
|
|
47
|
+
// // if(purchase_obj) {
|
|
48
|
+
// // console.log('purchase:');
|
|
49
|
+
// // console.log(purchase_obj);
|
|
50
|
+
// // }
|
|
51
|
+
// console.log($wt.cookie.get('cck1'));
|
|
52
|
+
// console.groupEnd();
|
|
53
|
+
|
|
54
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// TODO rivedere, uso anche al di fuori di cookie consent?
|
|
2
|
+
// TODO spostare nella dir recaptcha
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
import { recaptcha_key } from '@src/pages/recaptcha-params.js';
|
|
6
|
+
|
|
7
|
+
const form_wrapper = document.querySelector('.recaptcha-form-wrapper');
|
|
8
|
+
|
|
9
|
+
export function addRecaptchaScript(callback) {
|
|
10
|
+
|
|
11
|
+
if (!document.head.querySelector('script.recaptcha')) {
|
|
12
|
+
const script = document.createElement('script');
|
|
13
|
+
|
|
14
|
+
if(callback != null && typeof callback === 'function') {
|
|
15
|
+
script.onload = callback;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
script.async = true;
|
|
19
|
+
script.defer = true;
|
|
20
|
+
script.className = 'recaptcha';
|
|
21
|
+
script.src = `https://www.google.com/recaptcha/api.js?render=${recaptcha_key}`;
|
|
22
|
+
document.head.appendChild(script);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// imposta lo script analytics GA4 (se l'utente ha dato il consenso)
|
|
28
|
+
export function run_recaptcha() {
|
|
29
|
+
|
|
30
|
+
if(recaptcha_key) {
|
|
31
|
+
addRecaptchaScript(() => form_wrapper.classList.remove('disabled'));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function disableRecaptcha() {
|
|
37
|
+
document.head.querySelector('script.recaptcha')?.remove();
|
|
38
|
+
form_wrapper?.classList.add('disabled');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// funzione da richiamare al submit del form con recaptcha
|
|
42
|
+
/*
|
|
43
|
+
|
|
44
|
+
loadRecaptchaAsync('TUO_SITE_KEY', () => {
|
|
45
|
+
|
|
46
|
+
grecaptcha.ready(function() {
|
|
47
|
+
grecaptcha.execute('TUO_SITE_KEY', {action: 'submit'}).then(function(token) {
|
|
48
|
+
// Usa il token
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
export function loadRecaptchaAsync(siteKey, callback) {
|
|
55
|
+
|
|
56
|
+
function waitForGrecaptcha(cb) {
|
|
57
|
+
|
|
58
|
+
if (window.grecaptcha && typeof window.grecaptcha.execute === 'function') {
|
|
59
|
+
window.grecaptcha.ready(cb);
|
|
60
|
+
} else {
|
|
61
|
+
setTimeout(() => waitForGrecaptcha(cb), 100);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (document.querySelector('script.recaptcha')) {
|
|
66
|
+
waitForGrecaptcha(callback);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
addRecaptchaScript(() => waitForGrecaptcha(callback));
|
|
71
|
+
}
|