updated the whole structure

This commit is contained in:
2023-10-01 03:19:25 +02:00
parent 9887a6f445
commit e994c5a865
252 changed files with 7442 additions and 1913 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -0,0 +1,94 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
width="933.000000pt" height="178.000000pt" viewBox="0 0 933.000000 178.000000"
preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,178.000000) scale(0.100000,-0.100000)"
fill="#000000" stroke="none">
<path d="M7523 1475 c-40 -17 -53 -42 -53 -103 0 -71 21 -93 96 -102 141 -17
214 18 214 101 0 59 -23 96 -68 108 -52 15 -151 13 -189 -4z"/>
<path d="M380 1420 c0 -5 1 -11 2 -12 1 -2 -4 -13 -10 -25 -9 -16 -9 -24 -1
-29 8 -5 6 -10 -5 -16 -23 -13 -21 -48 3 -48 10 0 21 -7 25 -15 6 -18 36 -9
36 11 0 9 11 14 29 14 25 0 28 3 23 25 -2 15 0 25 7 25 6 0 11 7 11 15 0 19
-14 19 -30 0 -7 -9 -21 -13 -31 -10 -11 4 -22 -1 -28 -12 -9 -16 -12 -16 -21
-3 -10 14 -8 38 6 74 3 9 1 16 -5 16 -6 0 -11 -4 -11 -10z"/>
<path d="M1095 1420 c-3 -5 -7 -26 -9 -45 -2 -20 -8 -41 -15 -48 -17 -17 -14
-48 4 -40 9 3 22 -2 31 -13 14 -18 15 -18 30 4 10 12 27 22 41 22 20 0 23 4
18 21 -5 14 -1 25 11 33 13 10 14 15 4 21 -8 5 -18 1 -26 -9 -8 -12 -20 -16
-32 -12 -13 4 -22 1 -26 -9 -3 -8 -9 -15 -15 -15 -16 0 -19 36 -5 69 12 28 4
45 -11 21z"/>
<path d="M2010 981 l0 -441 140 0 140 0 0 131 0 130 32 -3 c31 -3 34 -8 88
-128 l56 -125 152 -3 c84 -1 152 0 152 4 0 4 -33 69 -72 145 l-73 138 38 34
c64 59 82 113 82 247 0 96 -3 122 -21 160 -27 57 -67 97 -124 124 -42 19 -65
21 -317 24 l-273 3 0 -440z m428 197 c14 -14 16 -116 2 -138 -6 -10 -32 -16
-79 -18 l-71 -4 0 86 0 86 68 0 c40 0 73 -5 80 -12z"/>
<path d="M620 1400 c0 -5 5 -10 11 -10 5 0 7 5 4 10 -3 6 -8 10 -11 10 -2 0
-4 -4 -4 -10z"/>
<path d="M1340 1400 c0 -5 5 -10 11 -10 5 0 7 5 4 10 -3 6 -8 10 -11 10 -2 0
-4 -4 -4 -10z"/>
<path d="M3085 1260 c-87 -8 -193 -29 -200 -40 -3 -6 24 -190 29 -197 0 -1 26
5 56 13 30 8 108 17 173 21 l117 6 0 -25 c0 -25 -2 -25 -93 -32 -217 -16 -308
-71 -338 -204 -9 -38 -9 -64 -1 -108 24 -117 97 -168 242 -168 72 -1 94 4 145
27 33 16 70 38 83 49 l22 22 43 -42 c42 -41 45 -42 110 -42 l67 0 0 273 c0
307 -4 326 -75 384 -66 55 -214 79 -380 63z m175 -459 c0 -56 -19 -71 -91 -71
l-59 0 0 45 c0 54 14 64 93 65 l57 0 0 -39z"/>
<path d="M4012 1259 c-59 -10 -103 -30 -134 -61 l-21 -21 -24 32 c-23 29 -28
31 -94 31 l-69 0 0 -466 0 -466 43 5 c23 4 86 9 140 13 l97 6 0 104 0 104 90
0 c168 0 248 36 303 137 79 146 51 407 -54 512 -62 63 -166 89 -277 70z m78
-342 c0 -176 -5 -187 -86 -187 l-54 0 0 149 c0 176 2 181 86 181 l54 0 0 -143z"/>
<path d="M4849 1260 c-56 -10 -111 -34 -135 -61 -23 -25 -27 -24 -47 11 -18
29 -20 30 -93 30 l-74 0 0 -466 0 -466 43 5 c23 4 86 9 140 13 l97 6 0 103 0
102 123 5 c97 4 130 9 162 25 99 51 145 137 153 281 11 209 -49 343 -179 395
-46 19 -133 27 -190 17z m71 -355 c0 -177 1 -175 -89 -175 l-51 0 0 149 c0
144 1 151 22 165 13 9 43 16 70 16 l48 0 0 -155z"/>
<path d="M5550 1260 c-71 -7 -188 -28 -201 -36 -5 -3 16 -159 26 -191 3 -9 17
-8 57 3 29 8 106 17 171 21 l117 6 0 -24 c0 -24 -3 -25 -113 -36 -230 -23
-317 -93 -317 -255 1 -145 60 -209 208 -224 75 -8 171 16 238 61 l51 33 39
-39 c37 -38 40 -39 106 -39 l68 0 0 277 c0 262 -1 279 -21 321 -48 99 -210
145 -429 122z m170 -465 c0 -54 -16 -65 -94 -65 l-56 0 0 45 c0 54 14 64 93
65 l57 0 0 -45z"/>
<path d="M8160 1260 c-130 -21 -195 -62 -240 -154 -77 -156 -50 -415 53 -502
77 -66 221 -96 356 -76 187 27 272 124 287 325 11 153 -34 287 -119 348 -71
51 -218 77 -337 59z m160 -343 c0 -176 -5 -187 -86 -187 l-54 0 0 155 c0 177
-1 174 88 175 l52 0 0 -143z"/>
<path d="M7296 1240 c-27 -10 -66 -31 -87 -45 l-38 -27 -31 36 c-31 35 -34 36
-106 36 l-74 0 0 -350 0 -351 138 3 137 3 3 199 c1 120 7 204 13 212 6 7 41
21 79 30 l69 18 -5 86 c-8 144 -13 170 -32 170 -9 -1 -39 -10 -66 -20z"/>
<path d="M6120 952 c0 -281 1 -290 23 -333 34 -66 96 -94 207 -94 98 0 143 13
204 60 l44 33 38 -39 c39 -40 39 -40 109 -37 l70 3 3 348 2 347 -140 0 -140 0
0 -233 c0 -277 0 -277 -86 -277 l-54 0 0 255 0 255 -140 0 -140 0 0 -288z"/>
<path d="M7605 1225 c-49 -7 -98 -14 -107 -14 -17 -1 -18 -24 -18 -336 l0
-335 140 0 140 0 0 350 0 350 -32 -1 c-18 -1 -73 -7 -123 -14z"/>
<path d="M611 1194 c0 -11 3 -14 6 -6 3 7 2 16 -1 19 -3 4 -6 -2 -5 -13z"/>
<path d="M581 1184 c0 -11 3 -14 6 -6 3 7 2 16 -1 19 -3 4 -6 -2 -5 -13z"/>
<path d="M1155 1131 c-3 -5 -1 -12 5 -16 5 -3 10 1 10 9 0 18 -6 21 -15 7z"/>
<path d="M792 1118 c-18 -18 -15 -113 3 -128 12 -10 15 -37 15 -121 l0 -109
-110 0 -110 0 0 35 0 35 50 0 c41 0 56 5 75 25 32 31 35 89 6 105 -21 11 -348
14 -375 4 -11 -4 -16 -19 -16 -48 0 -63 16 -79 89 -84 l61 -4 0 -34 0 -34 -58
0 c-66 0 -92 -18 -92 -62 0 -54 16 -58 258 -58 l222 0 0 -45 c0 -43 -1 -45
-30 -45 -38 0 -70 -32 -70 -70 l0 -30 -75 0 c-41 0 -85 -5 -99 -11 -31 -15
-48 -55 -44 -105 l3 -39 173 -3 c149 -2 172 0 172 13 0 13 -23 15 -160 15
l-160 0 0 34 c0 65 6 66 352 66 341 0 338 1 338 -66 l0 -34 -160 0 c-137 0
-160 -2 -160 -15 0 -13 23 -15 173 -13 l172 3 3 52 c3 45 -1 56 -22 78 -23 23
-33 25 -106 25 -77 0 -80 1 -80 24 0 39 -36 76 -76 76 -34 0 -34 0 -34 45 l0
45 125 0 c104 0 125 2 125 15 0 13 -21 15 -125 15 l-125 0 0 30 0 30 218 0
c229 0 251 -4 231 -42 -8 -15 -22 -18 -79 -18 -56 0 -70 -3 -70 -15 0 -12 15
-15 74 -15 84 0 106 13 106 60 0 44 -23 60 -86 60 l-54 0 0 35 0 35 48 0 c69
0 92 19 92 79 0 35 -4 51 -16 55 -20 8 -348 8 -368 0 -11 -4 -16 -19 -16 -48
0 -62 17 -78 84 -84 l56 -4 0 -34 0 -34 -110 0 -110 0 0 106 c0 85 3 109 16
118 24 18 30 90 10 121 -15 22 -23 25 -79 25 -36 0 -68 -5 -75 -12z m133 -63
l0 -40 -57 -3 -58 -3 0 46 0 46 58 -3 57 -3 0 -40z m-35 -295 l0 -210 -25 0
-25 0 0 210 0 210 25 0 25 0 0 -210z m-180 153 c-1 -42 -10 -44 -181 -41
l-164 3 -3 28 -3 27 175 0 c161 0 176 -1 176 -17z m670 0 c-1 -42 -10 -44
-181 -41 l-164 3 -3 28 -3 27 175 0 c161 0 176 -1 176 -17z m-820 -118 c0 -31
-3 -35 -25 -35 -22 0 -25 4 -25 35 0 31 3 35 25 35 22 0 25 -4 25 -35z m670
-1 c0 -33 -2 -35 -27 -32 -23 2 -29 8 -31 36 -3 30 -1 32 27 32 29 0 31 -3 31
-36z m-420 -94 l0 -30 -220 0 c-187 0 -222 2 -226 15 -4 8 -4 22 0 30 4 13 39
15 226 15 l220 0 0 -30z m180 -199 c25 -48 19 -51 -120 -51 l-130 0 0 29 c0
16 6 32 13 34 6 3 60 6 119 6 96 1 108 -1 118 -18z"/>
<path d="M605 1100 c3 -5 8 -10 11 -10 2 0 4 5 4 10 0 6 -5 10 -11 10 -5 0 -7
-4 -4 -10z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.0 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 265 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 265 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,368 @@
// === SCROLL MENU ===
const pageLink = document.querySelectorAll('.menu-scroll');
pageLink.forEach((elem) => {
elem.addEventListener('click', (e) => {
e.preventDefault();
document.querySelector(elem.getAttribute('href')).scrollIntoView({
behavior: 'smooth',
offsetTop: 1 - 60,
});
});
});
// section menu active
function onScroll(event) {
const sections = document.querySelectorAll('.menu-scroll');
const scrollPos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
for (let i = 0; i < sections.length; i++) {
const currLink = sections[i];
const val = currLink.getAttribute('href');
const refElement = document.querySelector(val);
const scrollTopMinus = scrollPos + 73;
if (refElement.offsetTop <= scrollTopMinus && refElement.offsetTop + refElement.offsetHeight > scrollTopMinus) {
document.querySelector('.menu-scroll').classList.remove('active');
currLink.classList.add('active');
} else {
currLink.classList.remove('active');
}
}
}
window.document.addEventListener('scroll', onScroll);
// === FOOTER DYNAMIC ===
// Sélectionnez le footer par son ID
const footer = document.getElementById('leFooter');
// Fonction pour positionner le footer en bas de la page
function positionFooter() {
const windowHeight = window.innerHeight;
const bodyHeight = document.body.clientHeight;
const footerHeight = footer.clientHeight;
if (bodyHeight < windowHeight) {
footer.style.position = 'absolute';
footer.style.bottom = '0';
} else {
footer.style.position = 'static';
}
}
// Appelez la fonction lors du chargement de la page et lorsque la fenêtre est redimensionnée
window.addEventListener('load', positionFooter);
window.addEventListener('resize', positionFooter);
// === MODE SOMBRE +> LOCAL STORAGE ===
// Fonction pour lire la valeur du thème depuis localStorage
function getThemeLocalStorage() {
return localStorage.getItem('theme');
}
// Fonction pour définir le thème dans localStorage
function setThemeLocalStorage(theme) {
localStorage.setItem('theme', theme);
}
// Fonction pour mettre à jour la classe sur le <html> en fonction du thème
function updateThemeClass() {
const darkTogglerCheckbox = document.querySelector('#darkToggler');
const html = document.querySelector('html');
const theme = getThemeLocalStorage();
// Appliquer la classe en fonction de la valeur de localStorage
if (theme === 'dark') {
darkTogglerCheckbox.checked = true;
html.classList.add('dark');
} else {
darkTogglerCheckbox.checked = false;
html.classList.remove('dark');
}
}
// Appeler la fonction d'initialisation de la gestion du thème
updateThemeClass();
// Gérer le changement de thème lorsque l'utilisateur clique sur la case à cocher
const darkTogglerCheckbox = document.querySelector('#darkToggler');
darkTogglerCheckbox.addEventListener('click', function () {
if (darkTogglerCheckbox.checked) {
setThemeLocalStorage('dark');
} else {
setThemeLocalStorage('light');
}
});
// === ENVOIE FORMULAIRE AVEC AJAX ===
// Attendre que le document soit prêt
$(document).ready(function () {
// Sélectionnez le formulaire de COMPARAISON par son ID
$('#formulaire-comp').submit(function (e) {
// Fait scroll une fois le formulaire envoyé
$(document).ready(function () {
// Sélectionnez le lien par son ID
$('html, body').animate({
scrollTop: $('#resultat').offset().top
}, 1000); // 1000 millisecondes (1 seconde) pour l'animation
});
// Empêchez la soumission normale du formulaire
e.preventDefault();
// Affiche le chargement
$('#loading').removeClass('hidden');
$('#articleIntrouvable').addClass('hidden');
$('#articleContainer1').addClass('hidden');
$('#articleContainer2').addClass('hidden');
// Reste du code pour gérer la soumission du formulaire
//console.log('Formulaire soumis !');
// Récupérez les valeurs des champs du formulaire
const articleTitle1 = $('#articleTitle1').val();
const articleTitle2 = $('#articleTitle2').val();
// Créez un objet JavaScript avec les données à envoyer au serveur
const formData = {
articleTitle1: articleTitle1,
articleTitle2: articleTitle2
};
// Utilisez AJAX pour envoyer les données au serveur
$.ajax({
type: 'POST',
url: '/search',
data: formData,
dataType: 'json',
success: function (response) {
console.log(response);
$('#loading').addClass('hidden');
$('#articleIntrouvable').removeClass('hidden');
// Mettez à jour la section HTML avec les données reçues ici
// Vérifiez si response.articleInfo1 existe et contient les informations nécessaires
if (response.articleInfo1) {
$('#articleInfo1Title').html(response.articleInfo1.title);
// Article 1
$('#articleInfo1Title').html(response.articleInfo1.title);
$('#articleInfo1url').attr('href', response.articleInfo1.url);
$('#articleInfo1extract').html(response.articleInfo1.extract);
$('#articleInfo1lastEdit').html(response.articleInfo1.lastEdit);
$('#articleInfo1numRevisions').html(response.articleInfo1.numRevisions);
$('#articleInfo1pageSize').html(response.articleInfo1.pageSize);
$('#articleInfo1firstRevisionUser').html(response.articleInfo1.firstRevisionUser);
$('#articleInfo1latestRevisionId').html(response.articleInfo1.latestRevisionId);
$('#articleInfo1pageId').html(response.articleInfo1.pageId);
$('#articleInfo1latestVersion').html(response.articleInfo1.latestVersion);
$('#articleInfo1wordCount').html(response.articleInfo1.wordCount);
$('#articleInfo1charCount').html(response.articleInfo1.charCount);
$('#articleInfo1lastContributor').html(response.articleInfo1.lastContributor);
$('#articleInfo1image').attr('href', response.articleInfo1.image);
$('#articleInfo1image img').attr('src', response.articleInfo1.image);
// Récupérez la valeur de l'image
const articleInfo1ImageValue = response.articleInfo1.image;
// Récupérez l'élément image par son ID
const articleInfo1Image = document.getElementById("articleInfo1image");
if (articleInfo1ImageValue === "Non disponible") {
// Si la valeur est "Non disponible", masquez l'élément
articleInfo1Image.style.display = "none";
} else {
// Sinon, affichez l'élément
articleInfo1Image.style.display = "block"; // Vous pouvez utiliser "inline" si nécessaire
// Assurez-vous de définir la source de l'image ici en fonction de votre logique
articleInfo1Image.src = articleInfo1ImageValue;
}
const infoboxContainer1 = document.getElementById("infoboxcontainer1");
// Supprimer le contenu précédent de l'infobox
while (infoboxContainer1.firstChild) {
infoboxContainer1.removeChild(infoboxContainer1.firstChild);
}
// Ajouter les nouvelles informations pour articleInfo1
const infoboxData1 = response.articleInfo1.infobox;
Object.entries(infoboxData1).forEach(([key, value]) => {
const ligne = document.createElement("tr");
ligne.innerHTML = `<th>${key}</th> <td>${value}</td>`;
infoboxContainer1.appendChild(ligne);
});
} else {
// Traitez le cas où response.articleInfo1 n'existe pas
}
// Vérifiez si response.articleInfo2 existe et contient les informations nécessaires
if (response.articleInfo2) {
$('#articleInfo2Title').html(response.articleInfo2.title);
// Article 2
$('#articleInfo2Title').html(response.articleInfo2.title);
$('#articleInfo2url').attr('href', response.articleInfo2.url);
$('#articleInfo2extract').html(response.articleInfo2.extract);
$('#articleInfo2lastEdit').html(response.articleInfo2.lastEdit);
$('#articleInfo2numRevisions').html(response.articleInfo2.numRevisions);
$('#articleInfo2pageSize').html(response.articleInfo2.pageSize);
$('#articleInfo2firstRevisionUser').html(response.articleInfo2.firstRevisionUser);
$('#articleInfo2latestRevisionId').html(response.articleInfo2.latestRevisionId);
$('#articleInfo2pageId').html(response.articleInfo2.pageId);
$('#articleInfo2latestVersion').html(response.articleInfo2.latestVersion);
$('#articleInfo2wordCount').html(response.articleInfo2.wordCount);
$('#articleInfo2charCount').html(response.articleInfo2.charCount);
$('#articleInfo2lastContributor').html(response.articleInfo2.lastContributor);
$('#articleInfo2image').attr('href', response.articleInfo2.image);
$('#articleInfo2image img').attr('src', response.articleInfo2.image);
// Récupérez la valeur de l'image
const articleInfo2ImageValue = response.articleInfo2.image;
// Récupérez l'élément image par son ID
const articleInfo2Image = document.getElementById("articleInfo2image");
if (articleInfo2ImageValue === "Non disponible") {
// Si la valeur est "Non disponible", masquez l'élément
articleInfo2Image.style.display = "none";
} else {
// Sinon, affichez l'élément
articleInfo2Image.style.display = "block"; // Vous pouvez utiliser "inline" si nécessaire
// Assurez-vous de définir la source de l'image ici en fonction de votre logique
articleInfo2Image.src = articleInfo2ImageValue;
}
const infoboxContainer2 = document.getElementById("infoboxcontainer2");
// Supprimer le contenu précédent de l'infobox
while (infoboxContainer2.firstChild) {
infoboxContainer2.removeChild(infoboxContainer2.firstChild);
}
// Ajouter les nouvelles informations pour articleInfo2
const infoboxData2 = response.articleInfo2.infobox;
Object.entries(infoboxData2).forEach(([key, value]) => {
const ligne = document.createElement("tr");
ligne.innerHTML = `<th>${key}</th> <td>${value}</td>`;
infoboxContainer2.appendChild(ligne);
});
} else {
// Traitez le cas où response.articleInfo2 n'existe pas
}
// Vérifiez si toutes les informations nécessaires sont disponibles
const allInfoAvailable = checkIfAllInfoAvailable(response);
if (allInfoAvailable) {
$('#articleContainer1').removeClass('hidden');
$('#articleContainer2').removeClass('hidden');
$('#articleIntrouvable').addClass('hidden');
$(document).ready(function () {
// Sélectionnez le lien par son ID
$('html, body').animate({
scrollTop: $('#resultat').offset().top
}, 1000); // 1000 millisecondes (1 seconde) pour l'animation
});
} else {
// Traitez le cas où certaines informations ne sont pas disponibles
const articleIntrouvable = document.getElementById("articleIntrouvable");
let errorMessage = "";
if (!response.articleInfo1 && !response.articleInfo2) {
errorMessage += "Les articles " +
'<span class="underline">' + articleTitle1 + "</span> et " +
'<span class="underline">' + articleTitle2 + "</span> sont introuvables.";
}
else {
if (!response.articleInfo1) {
errorMessage += "L'article " + '<span class="underline">' + articleTitle1 + "</span> est introuvable.";
}
if (!response.articleInfo2) {
errorMessage += "L'article " + '<span class="underline">' + articleTitle2 + "</span> est introuvable.";
}
}
articleIntrouvable.innerHTML = errorMessage;
}
},
error: function (error) {
console.error('Erreur lors de la recherche d\'informations sur les articles :', error);
// Ajoutez une console.log pour vérifier si cette partie du code est exécutée
console.log('Erreur AJAX');
// Sélectionnez le div d'erreur par son ID
const articleIntrouvable = document.getElementById("articleIntrouvable");
// Mettez à jour le contenu du div avec un message d'erreur
articleIntrouvable.textContent = "Aucun article n'a été trouvé.";
// Assurez-vous de masquer les conteneurs d'articles
$('#articleContainer1').addClass('hidden');
$('#articleContainer2').addClass('hidden');
}
});
});
});
function checkIfAllInfoAvailable(response) {
// Vérifiez si response.articleInfo1 contient toutes les informations nécessaires
const articleInfo1 = response.articleInfo1;
if (!articleInfo1) {
return false; // Si articleInfo1 est absent, retournez false
}
// Ajoutez ici des vérifications spécifiques pour les propriétés nécessaires dans articleInfo1
if (!articleInfo1.title || !articleInfo1.url || !articleInfo1.extract || !articleInfo1.lastEdit) {
return false; // Si l'une des propriétés nécessaires est absente, retournez false
}
// Vérifiez si response.articleInfo2 contient toutes les informations nécessaires
const articleInfo2 = response.articleInfo2;
if (!articleInfo2) {
return false; // Si articleInfo2 est absent, retournez false
}
// Ajoutez ici des vérifications spécifiques pour les propriétés nécessaires dans articleInfo2
if (!articleInfo2.title || !articleInfo2.url || !articleInfo2.extract || !articleInfo2.lastEdit) {
return false; // Si l'une des propriétés nécessaires est absente, retournez false
}
// Si toutes les vérifications sont passées, cela signifie que toutes les informations nécessaires sont disponibles
return true;
}
// === SMOOTH SCROLL ~(^^)~
// Fait scroll jusqu'au formulaire de comparaison
$(document).ready(function () {
// Sélectionnez le lien par son ID
$('#letzgooo').click(function (e) {
e.preventDefault(); // Empêchez le comportement de clic par défaut
$('html, body').animate({
scrollTop: $('#comparaison').offset().top
}, 1000); // 1000 millisecondes (1 seconde) pour l'animation
});
});

File diff suppressed because it is too large Load Diff