Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit bf90ea39 authored by Sylvain Coulange's avatar Sylvain Coulange
Browse files

mise à jour en cours searchDico anglais

parent 5d283a8d
......@@ -50,6 +50,10 @@ def getLenDic(dic):
# pour requêtage depuis views.py (dicoView())
def getLenDicFr():
return getLenDic(word2transFr)
def getLenDicEn():
return getLenDic(word2transEn)
def getLenDicZh():
return getLenDic(word2transZh)
## FR
word2transFr = {} # un mot → liste de trans possibles
......@@ -305,16 +309,15 @@ def getEntryByWord(m,mc,t,tc,lang):
# mc = motCond (condition de recherche : contient, est égal à, commence par, finit par),
# t = trans (contenu de la barre de recherche "transcription phonétique"),
# tc = transCond (condition de recherche : contient, est égal à, commence par, finit par),
# lang = langue cible ('fr' ou 'en')
# lang = langue cible ('fr', 'en', 'zh'...)
if lang == "fr":
word2trans = word2transFr
phon2graph = phon2graphFr
m = m.replace("'",'’')
elif lang == "en":
word2trans = word2transEn
phon2graph = phon2graphEn
m = m.replace('’',"'")
m = m.replace("'",'’')
m = m.lower()
t = t.replace('.','')
......@@ -338,8 +341,6 @@ def getEntryByWord(m,mc,t,tc,lang):
tc2 = r'$'
for entree,transList in word2trans.items():
# if len(result) >= 1000: # seulement si besoin de stopper la recherche quand plus de 1000 résultats
# break
if re.match(mc1+m+mc2,entree):
transOK = False
for i,trans in enumerate(transList):
......
......@@ -222,21 +222,38 @@ def main0(request):
def dicoView(request):
data = Entree()
data.update = updateTime()
data.nbMotsFr = txtphono.getLenDicFr()
data.nbMotsEn = txtphono.getLenDicEn()
data.nbMotsZh = txtphono.getLenDicZh()
return render(request, 'editDicoHome.html', {'data': data})
def dicoViewFr(request):
data = Entree()
data.update = updateTime()
data.lenDic = txtphono.getLenDicFr()
data.logStat = txtphono.getLogStat()
data.dicoLang = "fr"
return render(request, 'editDico.html', {'data': data})
def dicoViewEn(request):
data = Entree()
data.update = updateTime()
data.lenDic = txtphono.getLenDicEn()
data.logStat = txtphono.getLogStatEn()
data.dicoLang = "en"
return render(request, 'editDico.html', {'data': data})
def dicoReq(request):
listeEntrees = []
dicoLang = request.GET.get('dicoLang', None)
mot = request.GET.get('mot', None)
trans = request.GET.get('trans', None)
motCond = request.GET.get('motCond', None)
transCond = request.GET.get('transCond', None)
rep = {
"listeEntrees" : txtphono.getEntryByWord(m=mot,mc=motCond,t=trans,tc=transCond,lang='fr')
"listeEntrees" : txtphono.getEntryByWord(m=mot,mc=motCond,t=trans,tc=transCond,lang=dicoLang)
}
return JsonResponse(rep)
......
......@@ -51,6 +51,7 @@ INSTALLED_APPS = [
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'corsheaders',
'hello',
'colorapp',
......@@ -121,9 +122,9 @@ AUTH_PASSWORD_VALIDATORS = [
# Internationalization
# https://docs.djangoproject.com/en/2.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
LANGUAGE_CODE = 'fr'
TIME_ZONE = 'UTC'
TIME_ZONE = 'Europe/Paris'
USE_I18N = True
......
......@@ -29,6 +29,8 @@ urlpatterns = [
path('getPhonoOf/', csrf_exempt(colorapp_views.getPhonoOf)),
#path('getAllPhonographiesOf/', csrf_exempt(colorapp_views.getAllPhonographiesOf)),
path('app/dico/', colorapp_views.dicoView),
path('app/dico/fr', colorapp_views.dicoViewFr),
path('app/dico/en', colorapp_views.dicoViewEn),
path('dicoSearch/', colorapp_views.dicoReq),
path('modifEntry/', colorapp_views.editEntry),
path('addEntry/', colorapp_views.newEntry),
......
......@@ -90,10 +90,15 @@ var langJson = {
"fr": "changer de prononciation",
"en": "switch pronunciation"
},
"ti_add2dico": {
"fr": "Ajouter ce mot au dictionnaire",
"en": "Add this word to the dictionary",
"zh": ""
},
"sp_infoWiki": {
"fr": "WikiColor est un coloriseur automatique de texte basé sur les transcriptions phonétiques du Wiktionnaire et de la collaboration de nombreux utilisateurs. Vous pouvez consulter et participer à l'amélioration du dictionnaire en cliquant sur le bouton ci-dessous. L'alignement phono-graphémique reste encore expérimental, toute suggestion de votre part est bienvenue ! N'hésitez pas à visiter <a href='https://alem.hypotheses.org/outils-alem-app/wikicolor'>notre site</a>, et participez aux discussions sur <a href='https://groups.google.com/forum/#!forum/alem-app'>le forum</a>.",
"en": "WikiColor is an automatic text coloriser based on Wiktionary's phonetic transcriptions, CMU Pronunciation Dictionary and collaboration of our users community. English dictionary isn't editable yet, but it will be soon! Phono-graphemic alignment still is experimental, especially for English, every suggestion from you will be welcome! We are still working on the phonologic representation of English, which is a big challenge. Please let us know your suggestions in <a href='https://groups.google.com/forum/#!forum/alem-app'>our Forum</a>. We also have <a href='https://alem.hypotheses.org/outils-alem-app/wikicolor'>a website</a> (English content will come soon!).",
"zh": "WikiColor is an automatic text coloriser based on Wiktionary's phonetic transcriptions, CMU Pronunciation Dictionary and collaboration of our users community. English dictionary isn't editable yet, but it will be soon! Phono-graphemic alignment still is experimental, especially for English, every suggestion from you will be welcome! We are still working on the phonologic representation of English, which is a big challenge. Please let us know your suggestions in <a href='https://groups.google.com/forum/#!forum/alem-app'>our Forum</a>. We also have <a href='https://alem.hypotheses.org/outils-alem-app/wikicolor'>a website</a> (English content will come soon!)."
"en": "WikiColor is an automatic text coloriser based on Wiktionary's phonetic transcriptions, CMU Pronunciation Dictionary and collaboration of our users community. English dictionary isn't editable yet, but it will be soon! Phono-graphemic alignment still is experimental, especially for English, any suggestion from you will be welcome! We are still working on the phonological representation of English, which is a big challenge. Please let us know your suggestions in <a href='https://groups.google.com/forum/#!forum/alem-app'>our Forum</a>. We also have <a href='https://alem.hypotheses.org/outils-alem-app/wikicolor'>a website</a> (English content will come soon!).",
"zh": "WikiColor is an automatic text coloriser based on Wiktionary's phonetic transcriptions, CMU Pronunciation Dictionary and collaboration of our users community. English dictionary isn't editable yet, but it will be soon! Phono-graphemic alignment still is experimental, especially for English, any suggestion from you will be welcome! We are still working on the phonological representation of English, which is a big challenge. Please let us know your suggestions in <a href='https://groups.google.com/forum/#!forum/alem-app'>our Forum</a>. We also have <a href='https://alem.hypotheses.org/outils-alem-app/wikicolor'>a website</a> (English content will come soon!)."
},
"sp_btnEditDico": {
"fr": "Consulter/éditer le dictionnaire",
......
// SET DEFAULT FRENCH TEMPORARY
interface("fr"); // default, temporary
function interface(lang) {
console.log("Langue d'interface:",lang);
thisPageLang = lang;
var langspanList = document.getElementsByClassName("langspan");
if (lang == "en") {
for (i=0; i<langspanList.length; i++) {
span = langspanList[i];
span.innerHTML = langJson[span.id]["en"];
}
} else { // "fr" par défaut
for (i=0; i<langspanList.length; i++) {
span = langspanList[i];
span.innerHTML = langJson[span.id]["fr"];
}
}
}
// Récupération de la liste des modifications du dictionnaire
var logDic = {};
getLogFile();
......@@ -43,6 +22,7 @@ $(document).ready(function(){
$("#rechercher").click(function(){
var dicoLang = thisPageLang; //document.getElementById('dicoLang').value;
var mot = document.getElementById('inMot').value;
var trans = document.getElementById('inTrans').value;
var motCond = document.getElementById('condition-mot').value;
......@@ -55,7 +35,7 @@ $(document).ready(function(){
document.getElementById('loader').style.display = '';
document.body.style.cursor = "wait";
console.log(motCond,mot,transCond,trans);
console.log(dicoLang, motCond,mot,transCond,trans);
//variable qui contiendra le dictionnaire de listes de graphies
var reponseDico = new Object();
......@@ -64,6 +44,7 @@ $(document).ready(function(){
$.ajax({
url: '/dicoSearch/',
data: {
dicoLang: dicoLang,
mot: mot,
trans: trans,
motCond: motCond,
......@@ -84,6 +65,7 @@ $(document).ready(function(){
document.getElementById('loader').style.display = 'none';
document.body.style.cursor = "default";
console.log(data)
document.getElementById('resultTable').innerHTML = '<colgroup><col width="40%"><col width="40%"><col width="20%"></colgroup><tr><th>Mot</th><th>Transcription (API)</th><th>Actions</th></tr>';
document.getElementById('nbres').innerHTML = '('+Object.keys(data.listeEntrees).length+')';
......@@ -115,17 +97,30 @@ $(document).ready(function(){
var lienWiki = '<a href="https://fr.wiktionary.org/wiki/'+entr.replace(' ','_')+'" target="_blank"><button role="button" class="btn btn-sm" title="Consulter le Wiktionnaire">W</button></a>';
var transList = '';
for (j in dico[i][1]) {
transList += dico[i][1][j];
if (j < dico[i][1].length-1) transList += ', '
if (dicoLang == 'en'){
for (j in dico[i][1]) {
console.log(j, dico[i][1][j]);
transList += j + ' (' + dico[i][1][j].join(',') + ')\n'
}
} else {
for (j in dico[i][1]) {
transList += dico[i][1][j];
if (j < dico[i][1].length-1) transList += ', '
}
}
var btnModifier = '<button id="btnModifier'+cptEntr+'" class="btn btn-primary btn-perso" onclick="modifEntry('+cptEntr+',\''+entr+'\')"><span class="glyphicon glyphicon-edit" area-hidden="true" title="Modifier"></span></button>';
var btnValider = '<button id="btnValider'+cptEntr+'" class="btn btn-success btn-perso" style="display: none;" onclick="validEntry(\''+entr+'\','+cptEntr+')"><span class="glyphicon glyphicon-ok" area-hidden="true" title="Valider"></span></button>';
var btnAnnuler = '<button id="btnAnnuler'+cptEntr+'" class="btn btn-secondary btn-perso" style="display: none;" onclick="annuler('+cptEntr+')"><span class="glyphicon glyphicon-remove" area-hidden="true" title="Annuler"></span></button>';
var btnSupprimer = '<button id="btnSupprimer'+cptEntr+'" class="btn btn-danger btn-perso" style="display: none;" onclick="supprimer(\''+entr+'\','+cptEntr+')"><span class="glyphicon glyphicon-trash" area-hidden="true" title="Supprimer cette entrée"></span></button>';
var btnModifier = '<button id="btnModifier'+cptEntr+'" class="btn btn-primary btn-perso" onclick="modifEntry('+cptEntr+',\''+entr+'\')"><svg title="Modifier" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16"> <path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/> <path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"/></svg></button>';
var btnValider = '<button id="btnValider'+cptEntr+'" class="btn btn-success btn-perso" style="display: none;" onclick="validEntry(\''+entr+'\','+cptEntr+')"><svg title="Valider" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-circle" viewBox="0 0 16 16"> <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/> <path d="M10.97 4.97a.235.235 0 0 0-.02.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-1.071-1.05z"/></svg></button>';
var btnAnnuler = '<button id="btnAnnuler'+cptEntr+'" class="btn btn-secondary btn-perso" style="display: none;" onclick="annuler('+cptEntr+')"><svg title="Annuler" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16"> <path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"/> <path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"/></svg></button>';
var btnSupprimer = '<button id="btnSupprimer'+cptEntr+'" class="btn btn-danger btn-perso" style="display: none;" onclick="supprimer(\''+entr+'\','+cptEntr+')"><svg title="Supprimer" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash" viewBox="0 0 16 16"> <path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z"/> <path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4 4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z"/></svg></button>';
document.getElementById('resultTable').innerHTML += '<tr id="tr'+cptEntr+'" class="tr"><td><span class="numEntr">'+cptEntr+'</span>'+lienWiki+' '+entr+'</td><td><input class="api-kb inputTrans" disabled="true" type="text" id="td'+cptEntr+'" value="'+transList+'">'+logEntr+'</td><td style="text-align:center">'+btnModifier+btnValider+btnAnnuler+btnSupprimer+'</td></tr>';
if (dicoLang == 'en'){
var transInput = '<textarea class="api-kb inputTrans" disabled="true" type="text" id="td'+cptEntr+'">'+transList+'</textarea>';
} else {
var transInput = '<input class="api-kb inputTrans" disabled="true" type="text" id="td'+cptEntr+'" value="'+transList+'"></input>';
}
document.getElementById('resultTable').innerHTML += '<tr id="tr'+cptEntr+'" class="tr"><td><span class="numEntr">'+cptEntr+'</span>'+lienWiki+' '+entr+'</td><td>'+transInput+logEntr+'</td><td style="text-align:center">'+btnModifier+btnValider+btnAnnuler+btnSupprimer+'</td></tr>';
getAPIkeyboard();
}
}
......
const thisURL = window.location.href;
console.log("url:",thisURL);
var thisPageLang = "";
var boolBold = true;
function toggleBold() {
if (document.getElementById('output')) {document.getElementById('output').classList.toggle('outputBold');}
boolBold = !boolBold;
console.log("boolBold to",boolBold);
}
// set page target language
setLangFromUrl()
function setLangFromUrl() {
var pageLang = thisURL.match(/.*\/(fr|en|zh)/);
if (pageLang) {
console.log("Langue indiquée par l'url:",pageLang[1]);
thisPageLang = pageLang[1];
if (pageLang[1]=="fr") selectLang("fr");
if (pageLang[1]=="en") selectLang("en");
if (pageLang[1]=="zh") selectLang("zh");
} else {
console.log("Chargement langue par défaut (fr)");
thisPageLang = "fr"
selectLang("fr");
}
}
function selectLang(lang){
if (lang=="en"){
interface("en");
document.getElementById('choixLang').value = 'en';
if (boolBold) toggleBold();
document.getElementById('zhsubtitle').style.display="none";
document.getElementById('subtitle').style.marginTop = "-20px";
if(document.getElementById('silentWayLabel')){ // if this page is Wikicolor's main page
document.getElementById('monochromeLabel').style.display="";
document.getElementById('monochrome').style.display="";
document.getElementById('silentWayLabel').style.margin = "-20px 0px";
document.getElementById('bicolor').style.display="";
document.getElementById('bicolorLabel').style.display="";
document.getElementById('bicolorLabel').style.margin = "-10px 0px";
// Paramètres output
document.getElementById('ti_btnCopierColler').style.display = "";
document.getElementById('ti_btnBold').style.display = "";
document.getElementById('ti_btnzi').style.display = "none";
document.getElementById('ti_btnwordspace').style.display = "none";
document.getElementById('btnLiaison').style.display = "none";
window.history.pushState("", "", "/en");
}
} else if (lang=="fr"){
interface("fr");
document.getElementById('choixLang').value = 'fr';
if (boolBold == false) toggleBold();
document.getElementById('zhsubtitle').style.display="none";
document.getElementById('subtitle').style.marginTop = "0px";
if(document.getElementById('silentWayLabel')){ // if this page is Wikicolor's main page
document.getElementById('monochromeLabel').style.display="none";
document.getElementById('monochrome').style.display="none";
document.getElementById('silentWayLabel').style.margin = "0px 0px";
document.getElementById('bicolor').style.display="";
document.getElementById('bicolorLabel').style.display="";
document.getElementById('bicolorLabel').style.margin = "0px 0px";
// Paramètres output
document.getElementById('ti_btnCopierColler').style.display = "";
document.getElementById('ti_btnBold').style.display = "";
document.getElementById('ti_btnzi').style.display = "none";
document.getElementById('ti_btnwordspace').style.display = "none";
document.getElementById('btnLiaison').style.display = "";
window.history.pushState("", "", "/fr");
}
} else if (lang == "zh"){
interface("zh");
document.getElementById('choixLang').value = 'zh';
if (boolBold == false) toggleBold();
document.getElementById('zhsubtitle').style.display="";
document.getElementById('subtitle').style.marginTop = "0px";
if(document.getElementById('silentWayLabel')){ // if this page is Wikicolor's main page
document.getElementById('monochromeLabel').style.display="none";
document.getElementById('monochrome').style.display="none";
document.getElementById('silentWayLabel').style.margin = "0px 0px";
document.getElementById('bicolor').style.display="none";
document.getElementById('bicolorLabel').style.display="none";
// Paramètres output
document.getElementById('ti_btnCopierColler').style.display = "none";
document.getElementById('ti_btnBold').style.display = "none";
document.getElementById('ti_btnzi').style.display = "";
document.getElementById('ti_btnwordspace').style.display = "";
document.getElementById('btnLiaison').style.display = "none";
window.history.pushState("", "", "/zh");
}
}
}
function interface(lang) {
console.log("Langue d'interface:",lang);
thisPageLang = lang;
var langspanList = document.getElementsByClassName("langspan");
var langtitleList = document.getElementsByClassName("langtitle");
if (lang == "en") {
for (i=0; i<langspanList.length; i++) {
span = langspanList[i];
span.innerHTML = langJson[span.id]["en"];
}
for (i=0; i<langtitleList.length; i++) {
title = langtitleList[i];
title.title = langJson[title.id]["en"];
}
} else if (lang == "zh") {
for (i=0; i<langspanList.length; i++) {
span = langspanList[i];
span.innerHTML = langJson[span.id]["zh"];
}
for (i=0; i<langtitleList.length; i++) {
title = langtitleList[i];
title.title = langJson[title.id]["zh"];
}
} else { // "fr" par défaut
for (i=0; i<langspanList.length; i++) {
span = langspanList[i];
span.innerHTML = langJson[span.id]["fr"];
}
for (i=0; i<langtitleList.length; i++) {
title = langtitleList[i];
title.title = langJson[title.id]["fr"];
}
}
}
\ No newline at end of file
var boolBold = true;
function toggleBold() {
document.getElementById('output').classList.toggle('outputBold');
boolBold = !boolBold;
console.log("boolBold to",boolBold);
}
const thisURL = window.location.href;
console.log("url:",thisURL);
var thisPageLang = "";
// set page target language
setLangFromUrl()
function setLangFromUrl() {
var pageLang = thisURL.match(/.*\/(fr|en|zh)/);
if (pageLang) {
console.log("Langue indiquée par l'url:",pageLang[1]);
thisPageLang = pageLang[1];
if (pageLang[1]=="fr") selectLang("fr");
if (pageLang[1]=="en") selectLang("en");
if (pageLang[1]=="zh") selectLang("zh");
} else {
console.log("Chargement langue par défaut (fr)");
thisPageLang = "fr"
selectLang("fr");
}
}
function selectLang(lang){
if (lang=="en"){
interface("en");
document.getElementById('choixLang').value = 'en';
if (boolBold) toggleBold();
document.getElementById('zhsubtitle').style.display="none";
document.getElementById('monochromeLabel').style.display="";
document.getElementById('monochrome').style.display="";
document.getElementById('silentWayLabel').style.margin = "-20px 0px";
document.getElementById('bicolor').style.display="";
document.getElementById('bicolorLabel').style.display="";
document.getElementById('bicolorLabel').style.margin = "-10px 0px";
document.getElementById('subtitle').style.marginTop = "-20px";
// Paramètres output
document.getElementById('ti_btnCopierColler').style.display = "";
document.getElementById('ti_btnBold').style.display = "";
document.getElementById('ti_btnzi').style.display = "none";
document.getElementById('ti_btnwordspace').style.display = "none";
document.getElementById('btnLiaison').style.display = "none";
window.history.pushState("", "", "/en");
} else if (lang=="fr"){
interface("fr");
document.getElementById('choixLang').value = 'fr';
if (boolBold == false) toggleBold();
document.getElementById('zhsubtitle').style.display="none";
document.getElementById('monochromeLabel').style.display="none";
document.getElementById('monochrome').style.display="none";
document.getElementById('silentWayLabel').style.margin = "0px 0px";
document.getElementById('bicolor').style.display="";
document.getElementById('bicolorLabel').style.display="";
document.getElementById('bicolorLabel').style.margin = "0px 0px";
document.getElementById('subtitle').style.marginTop = "0px";
// Paramètres output
document.getElementById('ti_btnCopierColler').style.display = "";
document.getElementById('ti_btnBold').style.display = "";
document.getElementById('ti_btnzi').style.display = "none";
document.getElementById('ti_btnwordspace').style.display = "none";
document.getElementById('btnLiaison').style.display = "";
window.history.pushState("", "", "/fr");
} else if (lang == "zh"){
interface("zh");
document.getElementById('choixLang').value = 'zh';
if (boolBold == false) toggleBold();
document.getElementById('zhsubtitle').style.display="";
document.getElementById('monochromeLabel').style.display="none";
document.getElementById('monochrome').style.display="none";
document.getElementById('silentWayLabel').style.margin = "0px 0px";
document.getElementById('bicolor').style.display="none";
document.getElementById('bicolorLabel').style.display="none";
document.getElementById('subtitle').style.marginTop = "0px";
// Paramètres output
document.getElementById('ti_btnCopierColler').style.display = "none";
document.getElementById('ti_btnBold').style.display = "none";
document.getElementById('ti_btnzi').style.display = "";
document.getElementById('ti_btnwordspace').style.display = "";
document.getElementById('btnLiaison').style.display = "none";
window.history.pushState("", "", "/zh");
}
}
function interface(lang) {
console.log("Langue d'interface:",lang);
thisPageLang = lang;
var langspanList = document.getElementsByClassName("langspan");
var langtitleList = document.getElementsByClassName("langtitle");
if (lang == "en") {
for (i=0; i<langspanList.length; i++) {
span = langspanList[i];
span.innerHTML = langJson[span.id]["en"];
}
for (i=0; i<langtitleList.length; i++) {
title = langtitleList[i];
title.title = langJson[title.id]["en"];
}
} else if (lang == "zh") {
for (i=0; i<langspanList.length; i++) {
span = langspanList[i];
span.innerHTML = langJson[span.id]["zh"];
}
for (i=0; i<langtitleList.length; i++) {
title = langtitleList[i];
title.title = langJson[title.id]["zh"];
}
} else { // "fr" par défaut
for (i=0; i<langspanList.length; i++) {
span = langspanList[i];
span.innerHTML = langJson[span.id]["fr"];
}
for (i=0; i<langtitleList.length; i++) {
title = langtitleList[i];
title.title = langJson[title.id]["fr"];
}
}
}
var dicoTok = {};
var dicoId = {};
......@@ -263,10 +128,11 @@ async function getColorisation() {
for (i = 0; i < tokens.length; i++) {
if (dicoTok[tokens[i].id].length > 1) {
tokens[i].innerHTML = dicoTok[tokens[i].id][0][0];
$('#'+tokens[i].id).addClass('transMult');
if (lang=="en") {
$('#'+tokens[i].id).prop('title', langJson['ti_multitrans']['en']);
$('#'+tokens[i].id).addClass('transMultEn');
$('#'+tokens[i].id).prop('title', langJson['ti_multitrans']['en']);
} else {
$('#'+tokens[i].id).addClass('transMult');
$('#'+tokens[i].id).prop('title', langJson['ti_multitrans']['fr']);
}
} else {
......@@ -355,7 +221,7 @@ function unknownMark() {
for (i = 0; i < unknowns.length; i++) {
var newMark = document.createElement('span');
newMark.classList = 'glyphicon glyphicon-edit unknownMark';
newMark.title = "Ajouter ce mot au dictionnaire";
newMark.title = langJson["ti_add2dico"][thisPageLang];
newMark.value = unknowns[i].innerHTML;
newMark.innerHTML = "?";
newMark.onclick = function(){
......
/* CSS ALeM-APP v3 */
/* https://alem.hypotheses.org/ */
/* Last update: 2021/04/26 */
/* Last update: 2021/06/19 */
:root {
--bicolor1: #ff0000;
......@@ -106,7 +106,7 @@
.unstressed { font-weight: normal;} /* unstressed spellings (default) */
.stress1 { font-size: 1.7em; font-weight: bolder;} /* Primary stress */
.stress2 { font-size: 1.3em; font-weight: bold;} /* Secondary stress */
.schwa { font-size: .7em; font-weight: lighter;} /* Schwa */
.schwa { font-size: .6em; font-weight: lighter;} /* Schwa */
.phon_cbrack { fill: var(--phon_cbrack); color:var(--phon_cbrack); stop-color:var(--phon_cbrack); background:-webkit-linear-gradient(var(--phon_cbrack), var(--phon_cbrack));-webkit-background-clip: text;background-clip: text;-webkit-text-fill-color: transparent; } /*æ {*/
.phon_cbrack2 { fill: var(--phon_cbrack2); color:var(--phon_cbrack2); stop-color:var(--phon_cbrack2); background:-webkit-linear-gradient(var(--phon_cbrack2), var(--phon_cbrack2));-webkit-background-clip: text;background-clip: text;-webkit-text-fill-color: transparent; } /*ʉ }*/
......
......@@ -165,6 +165,10 @@ svg { /* vient écraser le background black de phonochromie-alem.css*/
.transMult {
border-bottom: .5px solid rgba(211, 211, 211, 0.5);
cursor: pointer;
}
.transMultEn {
cursor: pointer;
}
.monochrome {
......@@ -425,6 +429,7 @@ tr:hover {
.inputTrans {
width: 90%;
font-family: Arial, Helvetica, sans-serif;
}
.dicEntryHead {
......@@ -493,4 +498,12 @@ footer {
.btnAddNew {
transform: translateY(-3px);
}