From a5262822a59e3469ecf36d3c7b32d1a757a4d9b6 Mon Sep 17 00:00:00 2001 From: Christophe-Marie Duquesne Date: Sun, 6 Dec 2015 17:28:34 +0100 Subject: [PATCH 1/4] =?UTF-8?q?Adoption=20du=20m=C3=AAme=20style=20de=20co?= =?UTF-8?q?de=20pour=20tout=20le=20fichier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- creuille.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/creuille.js b/creuille.js index 0767907..942388e 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,7 +6,7 @@ function changeDeSens(traductions) construitListe(traductions); } -function metAJourLienChange(langue){ +function metAJourLienChange(langue) { var de = ' Anglais '; var vers = 'Français'; var fleche = ' → '; @@ -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); From e5769a9cee6bdddafc8ecc1465f50b4b8edcbd57 Mon Sep 17 00:00:00 2001 From: Christophe-Marie Duquesne Date: Sun, 6 Dec 2015 17:53:52 +0100 Subject: [PATCH 2/4] removing unnecessary spaces --- creuille.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/creuille.js b/creuille.js index 942388e..e894461 100644 --- a/creuille.js +++ b/creuille.js @@ -7,7 +7,7 @@ function changeDeSens(traductions) { } function metAJourLienChange(langue) { - var de = ' Anglais '; + var de = 'Anglais'; var vers = 'Français'; var fleche = ' → '; if (langue == 'francais') { @@ -73,7 +73,7 @@ function construitListe(traductions) { ); } - var cle = ' ' + mot.anglais + ' '; + var cle = '' + mot.anglais + ''; var val = '' + mot.francais + ''; if (langue == "francais") { var tmp = cle; From 000d35bfb4efb68f6e134acfe47253877e1893c4 Mon Sep 17 00:00:00 2001 From: Christophe-Marie Duquesne Date: Sun, 6 Dec 2015 18:00:18 +0100 Subject: [PATCH 3/4] =?UTF-8?q?Am=C3=A9lioration=20du=20CSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feuille_de_style.css | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) 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; } From 0504c8cbff8a21c0f9ac6c49055b9932aaf6776c Mon Sep 17 00:00:00 2001 From: Christophe-Marie Duquesne Date: Sun, 6 Dec 2015 18:50:04 +0100 Subject: [PATCH 4/4] =?UTF-8?q?am=C3=A9lioration=20de=20la=20lisibilit?= =?UTF-8?q?=C3=A9=20du=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- creuille.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/creuille.js b/creuille.js index e894461..6a42c03 100644 --- a/creuille.js +++ b/creuille.js @@ -53,23 +53,23 @@ 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)) ); }