mirror of
https://github.com/soulaklabs/bitoduc.fr.git
synced 2025-12-09 01:23:24 +00:00
Mise à profit du support unicode de javascript pour les noms de variables
This commit is contained in:
@@ -1,17 +1,17 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var reciproque = {'anglais': 'francais', 'francais': 'anglais'};
|
var réciproque = {'anglais': 'francais', 'francais': 'anglais'};
|
||||||
var embelli = {'francais': 'Français', 'anglais': 'Anglais'};
|
var embelli = {'francais': 'Français', 'anglais': 'Anglais'};
|
||||||
|
|
||||||
function inverser(traductions) {
|
function inverser(traductions) {
|
||||||
var langue = $( "#mots" ).attr("data-langue");
|
var langue = $( "#mots" ).attr("data-langue");
|
||||||
$( "#mots" ).attr("data-langue", reciproque[langue]);
|
$( "#mots" ).attr("data-langue", réciproque[langue]);
|
||||||
construitListe(traductions);
|
construitListe(traductions);
|
||||||
}
|
}
|
||||||
|
|
||||||
function mettreAJourLienInversion(langue) {
|
function mettreÀJourLienInversion(langue) {
|
||||||
var langueSource = langue;
|
var langueSource = langue;
|
||||||
var langueDestination = reciproque[langue];
|
var langueDestination = réciproque[langue];
|
||||||
$( "#lienInversion" )
|
$( "#lienInversion" )
|
||||||
.html(
|
.html(
|
||||||
'<span class="mot-' + langueSource + '">'
|
'<span class="mot-' + langueSource + '">'
|
||||||
@@ -50,7 +50,7 @@ function htmlifier(mot, langue){
|
|||||||
function construitListe(traductions) {
|
function construitListe(traductions) {
|
||||||
var langue = $( "#mots" ).attr("data-langue");
|
var langue = $( "#mots" ).attr("data-langue");
|
||||||
|
|
||||||
mettreAJourLienInversion(langue);
|
mettreÀJourLienInversion(langue);
|
||||||
|
|
||||||
traductions = traductions["vrais mots"].concat(traductions["faux mots"]);
|
traductions = traductions["vrais mots"].concat(traductions["faux mots"]);
|
||||||
// trier par ordre alphabétique de la langue de départ
|
// trier par ordre alphabétique de la langue de départ
|
||||||
@@ -100,7 +100,7 @@ function construitListe(traductions) {
|
|||||||
'· '
|
'· '
|
||||||
+ htmlifier(mot, langue)
|
+ htmlifier(mot, langue)
|
||||||
+ ' : '
|
+ ' : '
|
||||||
+ htmlifier(mot, reciproque[langue])
|
+ htmlifier(mot, réciproque[langue])
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user