Merge pull request #49 from chmduquesne/gh-pages

Améliorations générales de lisibilité du code
This commit is contained in:
Christophe-Marie Duquesne
2015-12-06 18:52:57 +01:00
2 changed files with 19 additions and 25 deletions

View File

@@ -1,5 +1,4 @@
function changeDeSens(traductions)
{
function changeDeSens(traductions) {
var langue = $( "#mots" ).attr("data-langue");
var autre = {'anglais': 'francais',
'francais': 'anglais'};
@@ -39,8 +38,7 @@ function sansAccents(mot){
.replace("ü", "u");
}
function construitListe(traductions)
{
function construitListe(traductions) {
var langue = $( "#mots" ).attr("data-langue");
metAJourLienChange(langue);
@@ -55,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(
$("<a></a>")
.attr("href", "#" + lettreAlphabet)
.html(lettreAlphabet)
.attr("href", "#" + lettre)
.html(lettre)
);
$( "#mots" ).append(
$("<div></div>")
.attr("class", "groupe-lettre")
.append($("<a></a>").attr("name", lettreAlphabet))
.append($("<h3></h3>").html(lettreAlphabet))
.append($("<a></a>").attr("name", lettre))
.append($("<h3></h3>").html(lettre))
);
}

View File

@@ -43,10 +43,6 @@ h3
.definition
{
padding: 1px 2px 1px 2px;
}
.definition
{
margin-left: 10px;
}