From 6fcbfb4a08d914964b126adb9c0ef7314e916c81 Mon Sep 17 00:00:00 2001 From: horville Date: Fri, 31 Mar 2023 17:07:25 +0200 Subject: [PATCH] Bouton Vider le cache + Carte --- components/fili-info.riot | 26 +- components/main-controller.riot | 42 +- components/school-info.riot | 2 +- components/school.riot | 48 +- index.html | 15 +- javascript/fili-info.js | 71 +- javascript/main-controller.js | 64 +- javascript/school-info.js | 176 +- javascript/school.js | 88 +- javascript/search.js | 28 +- javascript/title-progress.js | 14 +- style/parcoursup.css | 6 + test.json | 4800 +++++++++---------------------- 13 files changed, 1694 insertions(+), 3686 deletions(-) diff --git a/components/fili-info.riot b/components/fili-info.riot index 0d74496..d918c23 100644 --- a/components/fili-info.riot +++ b/components/fili-info.riot @@ -23,6 +23,7 @@ diff --git a/components/main-controller.riot b/components/main-controller.riot index b629701..d4be1dc 100644 --- a/components/main-controller.riot +++ b/components/main-controller.riot @@ -5,9 +5,10 @@ + -
+
@@ -25,7 +26,7 @@ this.update({ course: course, - shouldShowInfos: course != null, + shouldShowInfos: course != null }) }, @@ -59,34 +60,18 @@ onMounted(props, state) { this.update({ course: null, -<<<<<<< HEAD - sortBy: null, - schoolList: null, - sortFields: SORT_TABLE, - filteredSchoolList: null, - shouldShowInfos: false, - school: null, - popupEnabled: false + schoolList: [], + shouldShowInfos: false }) }, - filterSearch() { - let input = this.$("input") - if (!input) return - let finalArray = [] + clearCache(e) { + localStorage.clear() + e.target.textContent = "Cache vidé !" - //On évite de trier avant d'avoir plus de 1 lettres. - if (input.value.length > 1) { - finalArray = this.state.schoolList.filter((item) => { - return item.name.toLowerCase().includes(input.value.toLowerCase()) - }) - } else { - finalArray = this.state.schoolList - } - - this.update({ - filteredSchoolList: finalArray - }) + setTimeout(() => { + e.target.textContent = "Vider le cache" + }, 3000) }, popup(school){ this.update({ @@ -100,11 +85,6 @@ popupEnabled: false }) console.log("closed!") -======= - schoolList: [], - shouldShowInfos: false - }) ->>>>>>> 6ed22586179f7de1d23fd1ebd68d111298170226 } } diff --git a/components/school-info.riot b/components/school-info.riot index cc1e9d8..bfbdc52 100644 --- a/components/school-info.riot +++ b/components/school-info.riot @@ -1,5 +1,5 @@ -