From 0f6abfa7b9ceea6fdd0d17366e77ea3929b9beb0 Mon Sep 17 00:00:00 2001 From: Yannick Francois Date: Mon, 8 Oct 2018 22:47:50 +0200 Subject: [PATCH] Bifurcation sur le sondate en fonction du choix --- public/dates.html | 12 +----------- public/index.html | 3 ++- public/notifications.html | 4 +++- public/parametres.html | 6 +++--- public/recapitulatif.html | 2 ++ public/reponses.html | 6 +----- public/script.js | 28 +++++++++++++++------------- public/validations.html | 5 +---- 8 files changed, 28 insertions(+), 38 deletions(-) diff --git a/public/dates.html b/public/dates.html index 66eebb42..c24eb5d7 100644 --- a/public/dates.html +++ b/public/dates.html @@ -33,17 +33,7 @@ Continuer - + diff --git a/public/index.html b/public/index.html index efdf5d8a..59b022b9 100644 --- a/public/index.html +++ b/public/index.html @@ -36,5 +36,6 @@ + - \ No newline at end of file + diff --git a/public/notifications.html b/public/notifications.html index 366a040c..114f1a67 100644 --- a/public/notifications.html +++ b/public/notifications.html @@ -73,6 +73,8 @@ Continuer Modifier + + - \ No newline at end of file + diff --git a/public/parametres.html b/public/parametres.html index 2a855f4e..e3893a62 100644 --- a/public/parametres.html +++ b/public/parametres.html @@ -20,14 +20,14 @@

Je m'appelle - + et le titre de ce sondage - est - . + .

Si je devais le décrire pour les autres personnes, je dirais diff --git a/public/recapitulatif.html b/public/recapitulatif.html index f236880c..c664531f 100644 --- a/public/recapitulatif.html +++ b/public/recapitulatif.html @@ -52,6 +52,8 @@ Continuer Modifier + + diff --git a/public/reponses.html b/public/reponses.html index 763d6f55..a83887d6 100644 --- a/public/reponses.html +++ b/public/reponses.html @@ -39,11 +39,7 @@ - + diff --git a/public/script.js b/public/script.js index a46978f4..b10240fe 100644 --- a/public/script.js +++ b/public/script.js @@ -1,19 +1,21 @@ window.onload = () => { - var monStockage = localStorage; - if(localStorage.getItem('type_sondage') == undefined) { + if(localStorage.getItem('type_sondage') == null) { localStorage.setItem('type_sondage', 'classique'); } - document.querySelector('#type_sondage').addEventListener('change', function() { - const selectedType = this.options[this.selectedIndex].text; - localStorage.setItem('type_sondage', type_sondage); - console.log(selectedType); - if(selectedType == "classique") { - document.querySelector('#next').href = "reponses.html"; - } else { - document.querySelector('#next').href = "dates.html"; - } - console.log(document.querySelector('#next')) - }) + console.debug(localStorage) + + let typeSondageElement = document.querySelectorAll("*[data-group='record']") + typeSondageElement.forEach((currentElement) => { + currentElement.addEventListener('change', function() { + const selectedType = this.options[this.selectedIndex].text; + localStorage.setItem('type_sondage', type_sondage); + if(selectedType == "classique") { + document.querySelector('#next').href = "reponses.html"; + } else { + document.querySelector('#next').href = "dates.html"; + } + }) + }); } diff --git a/public/validations.html b/public/validations.html index 49fd0d84..50aad23a 100644 --- a/public/validations.html +++ b/public/validations.html @@ -21,10 +21,7 @@

C'est tout bon !

+ - - - -