cookiecraft 1.0.9 → 1.0.10
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/dist/cookiecraft.css +1 -1
- package/dist/cookiecraft.esm.js +25 -31
- package/dist/cookiecraft.esm.js.map +1 -1
- package/dist/cookiecraft.js +25 -31
- package/dist/cookiecraft.js.map +1 -1
- package/dist/cookiecraft.min.js +1 -1
- package/dist/cookiecraft.min.js.map +1 -1
- package/dist/stats.html +1 -1
- package/package.json +1 -1
package/dist/cookiecraft.js
CHANGED
|
@@ -689,6 +689,13 @@
|
|
|
689
689
|
const isModal = this.config.disablePageInteraction;
|
|
690
690
|
const safeColor = this.config.primaryColor ? sanitizeColor(this.config.primaryColor) : '';
|
|
691
691
|
const colorStyle = buildColorStyle(safeColor);
|
|
692
|
+
const titleHtml = translations.title
|
|
693
|
+
? `<h2 class="cc-banner__title">${escapeHtml(translations.title)}</h2>`
|
|
694
|
+
: '';
|
|
695
|
+
const descriptionHtml = this.getDescriptionHTML();
|
|
696
|
+
const descBlock = descriptionHtml
|
|
697
|
+
? `<p class="cc-banner__description">${descriptionHtml}</p>`
|
|
698
|
+
: '';
|
|
692
699
|
const template = `
|
|
693
700
|
<div
|
|
694
701
|
class="cc-banner cc-banner--${escapeHtml(position)} cc-banner--${escapeHtml(layout)} ${backdropBlur ? 'cc-backdrop-blur' : ''}"
|
|
@@ -701,28 +708,10 @@
|
|
|
701
708
|
>
|
|
702
709
|
<div class="cc-banner__container">
|
|
703
710
|
<div class="cc-banner__content">
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
</h2>
|
|
707
|
-
<p class="cc-banner__description">
|
|
708
|
-
${this.getDescriptionHTML()}
|
|
709
|
-
</p>
|
|
711
|
+
${titleHtml}
|
|
712
|
+
${descBlock}
|
|
710
713
|
</div>
|
|
711
714
|
<div class="cc-banner__actions">
|
|
712
|
-
<button
|
|
713
|
-
class="cc-btn cc-btn--ghost"
|
|
714
|
-
data-action="reject"
|
|
715
|
-
aria-label="${escapeHtml(translations.rejectAll || 'Essentials only')}"
|
|
716
|
-
>
|
|
717
|
-
${escapeHtml(translations.rejectAll || 'Essentials only')}
|
|
718
|
-
</button>
|
|
719
|
-
<button
|
|
720
|
-
class="cc-btn cc-btn--tertiary"
|
|
721
|
-
data-action="customize"
|
|
722
|
-
aria-label="${escapeHtml(translations.customize || 'Customize')}"
|
|
723
|
-
>
|
|
724
|
-
${escapeHtml(translations.customize || 'Customize')}
|
|
725
|
-
</button>
|
|
726
715
|
<button
|
|
727
716
|
class="cc-btn cc-btn--accept"
|
|
728
717
|
data-action="accept"
|
|
@@ -826,16 +815,21 @@
|
|
|
826
815
|
*/
|
|
827
816
|
getDescriptionHTML() {
|
|
828
817
|
const translations = this.config.translations || {};
|
|
829
|
-
|
|
830
|
-
|
|
818
|
+
if (!translations.description)
|
|
819
|
+
return '';
|
|
820
|
+
const description = escapeHtml(translations.description);
|
|
821
|
+
const customizeLabel = escapeHtml(translations.customize || 'Customize');
|
|
822
|
+
let html = description;
|
|
831
823
|
if (translations.privacyPolicyUrl) {
|
|
832
824
|
const safeUrl = sanitizeUrl(translations.privacyPolicyUrl);
|
|
833
825
|
if (safeUrl) {
|
|
834
826
|
const linkLabel = escapeHtml(translations.privacyPolicyLabel || 'Privacy Policy');
|
|
835
|
-
|
|
827
|
+
html += ` <a href="${safeUrl}" target="_blank" rel="noopener noreferrer">${linkLabel}</a>`;
|
|
836
828
|
}
|
|
837
829
|
}
|
|
838
|
-
|
|
830
|
+
// Inline customize link at end of description
|
|
831
|
+
html += ` <span class="cc-banner__customize" data-action="customize">${customizeLabel}</span>`;
|
|
832
|
+
return html;
|
|
839
833
|
}
|
|
840
834
|
}
|
|
841
835
|
|
|
@@ -1406,7 +1400,7 @@
|
|
|
1406
1400
|
description: 'We use cookies to improve your experience on our site. You can choose which cookies you accept.',
|
|
1407
1401
|
acceptAll: 'Accept all',
|
|
1408
1402
|
rejectAll: 'Essentials only',
|
|
1409
|
-
customize: '
|
|
1403
|
+
customize: 'Manage preferences',
|
|
1410
1404
|
savePreferences: 'Save preferences',
|
|
1411
1405
|
essentialsOnly: 'Essentials only',
|
|
1412
1406
|
preferencesTitle: 'Cookie Preferences',
|
|
@@ -1419,7 +1413,7 @@
|
|
|
1419
1413
|
description: 'Ce site utilise des cookies pour améliorer votre expérience de navigation. Vous pouvez choisir les cookies que vous acceptez.',
|
|
1420
1414
|
acceptAll: 'Tout accepter',
|
|
1421
1415
|
rejectAll: 'Essentiels uniquement',
|
|
1422
|
-
customize: '
|
|
1416
|
+
customize: 'Gérer mes préférences',
|
|
1423
1417
|
savePreferences: 'Enregistrer',
|
|
1424
1418
|
essentialsOnly: 'Essentiels uniquement',
|
|
1425
1419
|
preferencesTitle: 'Préférences des cookies',
|
|
@@ -1432,7 +1426,7 @@
|
|
|
1432
1426
|
description: 'Diese Website verwendet Cookies, um Ihr Erlebnis zu verbessern. Sie können wählen, welche Cookies Sie akzeptieren.',
|
|
1433
1427
|
acceptAll: 'Alle akzeptieren',
|
|
1434
1428
|
rejectAll: 'Nur essenzielle',
|
|
1435
|
-
customize: '
|
|
1429
|
+
customize: 'Einstellungen verwalten',
|
|
1436
1430
|
savePreferences: 'Speichern',
|
|
1437
1431
|
essentialsOnly: 'Nur essenzielle',
|
|
1438
1432
|
preferencesTitle: 'Cookie-Einstellungen',
|
|
@@ -1445,7 +1439,7 @@
|
|
|
1445
1439
|
description: 'Este sitio utiliza cookies para mejorar su experiencia. Puede elegir qué cookies acepta.',
|
|
1446
1440
|
acceptAll: 'Aceptar todo',
|
|
1447
1441
|
rejectAll: 'Solo esenciales',
|
|
1448
|
-
customize: '
|
|
1442
|
+
customize: 'Gestionar preferencias',
|
|
1449
1443
|
savePreferences: 'Guardar',
|
|
1450
1444
|
essentialsOnly: 'Solo esenciales',
|
|
1451
1445
|
preferencesTitle: 'Preferencias de cookies',
|
|
@@ -1458,7 +1452,7 @@
|
|
|
1458
1452
|
description: 'Questo sito utilizza i cookie per migliorare la tua esperienza. Puoi scegliere quali cookie accettare.',
|
|
1459
1453
|
acceptAll: 'Accetta tutti',
|
|
1460
1454
|
rejectAll: 'Solo essenziali',
|
|
1461
|
-
customize: '
|
|
1455
|
+
customize: 'Gestisci preferenze',
|
|
1462
1456
|
savePreferences: 'Salva',
|
|
1463
1457
|
essentialsOnly: 'Solo essenziali',
|
|
1464
1458
|
preferencesTitle: 'Preferenze cookie',
|
|
@@ -1471,7 +1465,7 @@
|
|
|
1471
1465
|
description: 'Deze site maakt gebruik van cookies om uw ervaring te verbeteren. U kunt kiezen welke cookies u accepteert.',
|
|
1472
1466
|
acceptAll: 'Alles accepteren',
|
|
1473
1467
|
rejectAll: 'Alleen essentieel',
|
|
1474
|
-
customize: '
|
|
1468
|
+
customize: 'Voorkeuren beheren',
|
|
1475
1469
|
savePreferences: 'Opslaan',
|
|
1476
1470
|
essentialsOnly: 'Alleen essentieel',
|
|
1477
1471
|
preferencesTitle: 'Cookie-voorkeuren',
|
|
@@ -1484,7 +1478,7 @@
|
|
|
1484
1478
|
description: 'Este site utiliza cookies para melhorar a sua experiência. Pode escolher quais cookies aceita.',
|
|
1485
1479
|
acceptAll: 'Aceitar todos',
|
|
1486
1480
|
rejectAll: 'Apenas essenciais',
|
|
1487
|
-
customize: '
|
|
1481
|
+
customize: 'Gerir preferências',
|
|
1488
1482
|
savePreferences: 'Guardar',
|
|
1489
1483
|
essentialsOnly: 'Apenas essenciais',
|
|
1490
1484
|
preferencesTitle: 'Preferências de cookies',
|