publication with a mistake

This commit is contained in:
Clément Brossaud
2023-05-25 18:46:01 +02:00
parent 34952a1a1b
commit c6c5ae38ce
3 changed files with 19 additions and 28 deletions

View File

@@ -11,7 +11,7 @@
<link rel="stylesheet" href="src/css/style_publications.css">
<link rel="stylesheet" href="src/css/navbar.css">
<link rel="stylesheet" href="src/css/footer.css">
<script type="module" src="src/js/publication/publicaton.js"></script>
<script type='module' src="src/js/publication/publication.js" defer></script>
</head>
<body>
<div id="loaderContainer">
@@ -44,7 +44,8 @@
<div id="chrono"></div>
<div id="hour"></div>
</nav>
<input type="text" id="entry_text">
<input type="text" id="entry_text">
<button id="search_button" onclick='search()'>Rechercher</button>
<div class="publi">
<p><img src="src/img/publications/pink square.png" alt="pink square" class="squares">
Sébastien Puma Emmanuel Sander Matthieu Saumard Isabelle Barbet Aurélien Latouche.<strong> Reconsidering conceptual knowledge: Heterogeneity of its components.</strong> Journal of Experimental Child Psychology, 2023, 227, pp.105587.
@@ -59,7 +60,7 @@
Ayoub Karine , Maher Jridi , Rémi Adde , Sébastien Demousselle. <strong>CONCEPTION ET DEVELOPPEMENT DUNE VOITURE AUTONOME.</strong> La Revue 3 E. I, 2022 </p>
<p><img src="src/img/publications/pink square.png" alt="pink square" class="squares">
Sylvain Lefebvre , Maher Jridi. <strong>Mutualisation des Ressources IOT par Conteneurisation de Passerelle.</strong> La Revue 3 E. I, 2022, Intelligence Artificielle et Génie Électrique 2ème partie, 109, pp.69 </p>
</div>
</div>
<footer>
<div class="foot">
<p>

View File

@@ -16,10 +16,6 @@ img{
text-align: center;
}
.highlight {
background-color: yellow;
}
.publi{
display: flex;
flex-direction: column;

View File

@@ -1,22 +1,16 @@
function searchAndHighlight() {
const searchInput = document.getElementById('text_entry');
const searchTerm = searchInput.value.trim();
const content = document.getElementById('content');
const result = document.getElementById('result');
// Effacer le contenu précédent
result.innerHTML = '';
// Rechercher et mettre en évidence le terme de recherche
const regex = new RegExp(`\\b${searchTerm}\\b`, 'gi');
const matches = content.innerHTML.match(regex);
if (matches) {
matches.forEach(match => {
const matchElement = document.createElement('span');
matchElement.innerText = match;
matchElement.classList.add('highlight');
result.appendChild(matchElement);
});
function search() {
const searchInput = document.getElementById('entry_text');
const searchTerm = searchInput.value.trim().toLowerCase(); // on récupère le terme recherché en minuscule
const paragraphs = document.querySelectorAll('.publi p'); // on prend tous les paragraphes
for (let i = 0; i < paragraphs.length; i++) { // boucle qui parcourt tous les paragraphes
const paragraph = paragraphs[i];
const paragraphText = paragraph.textContent.toLowerCase(); // on récupère le texte du paragraphe en minuscule
if (paragraphText.includes(searchTerm)) { //on cherche si le texte du paragraphe contient le terme recherché
paragraph.style.display = 'block'; // si oui, on affiche le paragraphe
} else {
paragraph.style.display = 'none'; // sinon, on le cache
}
}
}