Nombre de jours

Created by: PetitGens

Merge request reports

Loading
+6 −2
Changes for js/interface.js: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -3,7 +3,11 @@
// Interface
const barreRechercheCodePostal = document.getElementById("codePostalInput");
const boutonRechercheCodePostal = document.getElementById("recherche");

const conteneurChoixVille = document.getElementById("choixVille");
const listeDeroulanteVilles = document.getElementById("villeListe");
const inputNombreJours = document.getElementById("inputNbJours");
const boutonVoirInformations = document.getElementById("voirInformations");

boutonRechercheCodePostal.addEventListener("click", onRechercher);
listeDeroulanteVilles.addEventListener("change", onSelectionneVille);
@@ -39,7 +43,7 @@ function onRechercher(){

function onErreurSaisieCodePostal(message){
    alert(message);
    listeDeroulanteVilles.classList.add("cache");
    conteneurChoixVille.classList.add("cache");
    zoneResultats.classList.add("cache");
}

@@ -49,7 +53,7 @@ function listeVille(){
    villes_insee.forEach((ville, codeInsee) => {
        listeDeroulanteVilles.innerHTML += `\n<option value="${codeInsee}">${ville}</option>`
    });
    listeDeroulanteVilles.classList.remove("cache");
    conteneurChoixVille.classList.remove("cache");
}

const setVilles = async codepostal => {
+15 −1
Changes for index.html: 15 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -11,10 +11,24 @@
    <input type="search" id="codePostalInput" placeholder="Entrez votre code postal" aria-label="code postal"><button id="recherche" >Rechercher</button>
    <br>
    
    <select id="villeListe" class="cache" aria-label="ville">
    <label>Nombre de jours :</label>
    <input id="inputNbJours" type="number" value="1" min="1" max="7"></input>

    <div id="choixVille" class="cache">
        <select id="villeListe" aria-label="ville">
        <option>--Sélectionner une ville--</option>
        </select>

        

        <button id="voirInformations">Voir les informations</button>
    </div>
    
    

    <label>Nombre de jours :</label>
    <input id="inputNbJours" type="number" value="1" min="1" max="7"></input>

    <div class="resultat cache" id="resultat">
        <div class="weatherCard" id="weatherCard">
            <p>Ville : <span id="WCVille"></span></p>
Loading