mirror of
https://github.com/soulaklabs/bitoduc.fr.git
synced 2025-12-09 01:23:24 +00:00
Merge pull request #59 from chmduquesne/gh-pages
Ajout de genre et classe dans le html
This commit is contained in:
33
creuille.js
33
creuille.js
@@ -42,6 +42,29 @@ function sansAccents(mot) {
|
|||||||
.replace("ü", "u");
|
.replace("ü", "u");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function htmlifier(mot, langue){
|
||||||
|
var res = '<span class="mot-' + langue + '">' + mot[langue] + '</span>';
|
||||||
|
if (langue == "francais") {
|
||||||
|
if ("genre" in mot){
|
||||||
|
var genre = 'N' + mot["genre"].toUpperCase();
|
||||||
|
res += ' <span class="genre">' + genre + '</span>';
|
||||||
|
}
|
||||||
|
if ("classe" in mot){
|
||||||
|
var classe = "";
|
||||||
|
if (mot["classe"] == "groupe nominal") {
|
||||||
|
classe = "GN";
|
||||||
|
}
|
||||||
|
if (mot["classe"] == "proposition") {
|
||||||
|
classe = "Prop";
|
||||||
|
}
|
||||||
|
if (classe != ""){
|
||||||
|
res += ' <span class="classe">' + classe + '</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
function construitListe(traductions) {
|
function construitListe(traductions) {
|
||||||
var langue = $( "#mots" ).attr("data-langue");
|
var langue = $( "#mots" ).attr("data-langue");
|
||||||
|
|
||||||
@@ -84,8 +107,6 @@ function construitListe(traductions) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
var langueSource = langue;
|
|
||||||
var langueDestination = reciproque[langue];
|
|
||||||
$( "#mots" )
|
$( "#mots" )
|
||||||
.children()
|
.children()
|
||||||
.last()
|
.last()
|
||||||
@@ -94,13 +115,9 @@ function construitListe(traductions) {
|
|||||||
.attr("class", "definition")
|
.attr("class", "definition")
|
||||||
.html(
|
.html(
|
||||||
'· '
|
'· '
|
||||||
+ '<span class="mot-' + langueSource + '">'
|
+ htmlifier(mot, langue)
|
||||||
+ mot[langueSource]
|
|
||||||
+ '</span>'
|
|
||||||
+ ' : '
|
+ ' : '
|
||||||
+ '<span class="mot-' + langueDestination + '">'
|
+ htmlifier(mot, reciproque[langue])
|
||||||
+ mot[langueDestination]
|
|
||||||
+ '</span>'
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,6 +56,16 @@ h3
|
|||||||
color: #905050;
|
color: #905050;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.genre
|
||||||
|
{
|
||||||
|
display: None;
|
||||||
|
}
|
||||||
|
|
||||||
|
.classe
|
||||||
|
{
|
||||||
|
display: None;
|
||||||
|
}
|
||||||
|
|
||||||
#intro
|
#intro
|
||||||
{
|
{
|
||||||
font-size: larger;
|
font-size: larger;
|
||||||
|
|||||||
Reference in New Issue
Block a user