@bebranded/bb-contents 1.0.128 → 1.0.130
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/bb-contents.js +17 -17
- package/package.json +1 -1
package/bb-contents.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* BeBranded Contents
|
|
3
3
|
* Contenus additionnels français pour Webflow
|
|
4
|
-
* @version 1.0.
|
|
4
|
+
* @version 1.0.130
|
|
5
5
|
* @author BeBranded
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @website https://www.bebranded.xyz
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
window._bbContentsInitialized = true;
|
|
33
33
|
|
|
34
34
|
// Log de démarrage simple (une seule fois)
|
|
35
|
-
console.log('bb-contents | v1.0.
|
|
35
|
+
console.log('bb-contents | v1.0.130');
|
|
36
36
|
|
|
37
37
|
// Configuration
|
|
38
38
|
const config = {
|
|
39
|
-
version: '1.0.
|
|
39
|
+
version: '1.0.130',
|
|
40
40
|
debug: false, // Debug désactivé pour rendu propre
|
|
41
41
|
prefix: 'bb-', // utilisé pour générer les sélecteurs (data-bb-*)
|
|
42
42
|
youtubeEndpoint: null, // URL du worker YouTube (à définir par l'utilisateur)
|
|
@@ -1317,26 +1317,26 @@
|
|
|
1317
1317
|
return c !== undefined;
|
|
1318
1318
|
});
|
|
1319
1319
|
|
|
1320
|
-
// Pays non-préférés triés par ordre alphabétique
|
|
1320
|
+
// Pays non-préférés triés par ordre alphabétique (avec gestion des accents)
|
|
1321
1321
|
const others = sortedCountries.filter(function(c) {
|
|
1322
1322
|
return preferredCountries.indexOf(c.alpha2) === -1;
|
|
1323
1323
|
}).sort(function(a, b) {
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1324
|
+
return a.name[language].localeCompare(b.name[language], language === 'fr' ? 'fr' : 'en', {
|
|
1325
|
+
sensitivity: 'base',
|
|
1326
|
+
ignorePunctuation: true,
|
|
1327
|
+
numeric: true
|
|
1328
|
+
});
|
|
1329
1329
|
});
|
|
1330
1330
|
|
|
1331
1331
|
sortedCountries = preferred.concat(others);
|
|
1332
1332
|
} else {
|
|
1333
|
-
// Tous les pays par ordre alphabétique si pas de préférés
|
|
1333
|
+
// Tous les pays par ordre alphabétique si pas de préférés (avec gestion des accents)
|
|
1334
1334
|
sortedCountries = sortedCountries.sort(function(a, b) {
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1335
|
+
return a.name[language].localeCompare(b.name[language], language === 'fr' ? 'fr' : 'en', {
|
|
1336
|
+
sensitivity: 'base',
|
|
1337
|
+
ignorePunctuation: true,
|
|
1338
|
+
numeric: true
|
|
1339
|
+
});
|
|
1340
1340
|
});
|
|
1341
1341
|
}
|
|
1342
1342
|
|
|
@@ -1427,7 +1427,7 @@
|
|
|
1427
1427
|
// Liste des pays
|
|
1428
1428
|
const list = document.createElement('div');
|
|
1429
1429
|
list.className = 'bb-country-list';
|
|
1430
|
-
list.style.cssText = 'overflow-y: auto; max-height: 250px;';
|
|
1430
|
+
list.style.cssText = 'overflow-y: auto; max-height: 250px; padding-bottom: 4px;';
|
|
1431
1431
|
popover.appendChild(list);
|
|
1432
1432
|
|
|
1433
1433
|
// Fonction pour rendre la liste
|
|
@@ -1441,7 +1441,7 @@
|
|
|
1441
1441
|
|
|
1442
1442
|
list.innerHTML = countries.map(function(country) {
|
|
1443
1443
|
const isSelected = currentSelectedCountry && currentSelectedCountry.alpha2 === country.alpha2;
|
|
1444
|
-
return '<div class="bb-country-item" data-country="' + country.alpha2 + '" role="option" aria-selected="' + (isSelected ? 'true' : 'false') + '" style="display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: inherit; font-family: inherit; transition: background-color 0.15s;' + (isSelected ? ' background-color: #f3f4f6;' : '') + '"><img src="https://hatscripts.github.io/circle-flags/flags/' + country.alpha2.toLowerCase() + '.svg" alt="' + bbContents.utils.sanitize(country.name[language]) + '" style="width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0;"><span>' + bbContents.utils.sanitize(country.name[language]) + '</span></div>';
|
|
1444
|
+
return '<div class="bb-country-item" data-country="' + country.alpha2 + '" role="option" aria-selected="' + (isSelected ? 'true' : 'false') + '" style="display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: inherit; font-family: inherit; transition: background-color 0.15s; min-height: 36px; box-sizing: border-box;' + (isSelected ? ' background-color: #f3f4f6;' : '') + '"><img src="https://hatscripts.github.io/circle-flags/flags/' + country.alpha2.toLowerCase() + '.svg" alt="' + bbContents.utils.sanitize(country.name[language]) + '" style="width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0;"><span style="line-height: 1.2;">' + bbContents.utils.sanitize(country.name[language]) + '</span></div>';
|
|
1445
1445
|
}).join('');
|
|
1446
1446
|
|
|
1447
1447
|
// Ajouter hover effect
|