diff --git a/creuille.js b/creuille.js index 0767907..6a42c03 100644 --- a/creuille.js +++ b/creuille.js @@ -1,5 +1,4 @@ -function changeDeSens(traductions) -{ +function changeDeSens(traductions) { var langue = $( "#mots" ).attr("data-langue"); var autre = {'anglais': 'francais', 'francais': 'anglais'}; @@ -7,8 +6,8 @@ function changeDeSens(traductions) construitListe(traductions); } -function metAJourLienChange(langue){ - var de = ' Anglais '; +function metAJourLienChange(langue) { + var de = 'Anglais'; var vers = 'Français'; var fleche = ' → '; if (langue == 'francais') { @@ -19,7 +18,7 @@ function metAJourLienChange(langue){ $( "#lienChange" ).html(de + fleche + vers); } -function sansAccents(mot){ +function sansAccents(mot) { // Faute d'une bibliotheque unidecode, nous nous limitons aux lettres // accentuées du français. // https://fr.wikipedia.org/wiki/Diacritiques_utilisés_en_français @@ -39,8 +38,7 @@ function sansAccents(mot){ .replace("ü", "u"); } -function construitListe(traductions) -{ +function construitListe(traductions) { var langue = $( "#mots" ).attr("data-langue"); metAJourLienChange(langue); @@ -55,27 +53,27 @@ function construitListe(traductions) $( "#mots" ).html(""); $( "#index" ).html(""); - var lettreAlphabet = ''; + var lettre = ''; for (var i=0; i < traductions.length; i++) { var mot = traductions[i]; var l = sansAccents(mot[langue]).charAt(0).toUpperCase(); - if (l != lettreAlphabet) { - lettreAlphabet = l; + if (l != lettre) { + lettre = l; $( "#index" ).append( $("") - .attr("href", "#" + lettreAlphabet) - .html(lettreAlphabet) + .attr("href", "#" + lettre) + .html(lettre) ); $( "#mots" ).append( $("
") .attr("class", "groupe-lettre") - .append($("").attr("name", lettreAlphabet)) - .append($("").html(lettreAlphabet)) + .append($("").attr("name", lettre)) + .append($("").html(lettre)) ); } - var cle = ' ' + mot.anglais + ' '; + var cle = '' + mot.anglais + ''; var val = '' + mot.francais + ''; if (langue == "francais") { var tmp = cle; diff --git a/feuille_de_style.css b/feuille_de_style.css index 059d833..e3f8866 100644 --- a/feuille_de_style.css +++ b/feuille_de_style.css @@ -20,12 +20,12 @@ h3 #tout { font-family: Georgia, “Nimbus Roman No9 L”, serif; - margin-left: auto; - margin-right: auto; - max-width: 800px; - background-color: #fff5f5; - padding: 50px; - box-shadow: 0px 0px 10px 0px #d8d8d8; + margin-left: auto; + margin-right: auto; + max-width: 800px; + background-color: #fff5f5; + padding: 50px; + box-shadow: 0px 0px 10px 0px #d8d8d8; } @@ -43,10 +43,6 @@ h3 .definition { padding: 1px 2px 1px 2px; -} - -.definition -{ margin-left: 10px; }