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

ajout Chaouigit add .

parent ef6c31df
......@@ -50,6 +50,7 @@ urlpatterns = [
path('en/', clavier_views.newPage),
path('zh/', clavier_views.newPage),
path('dz/', clavier_views.newPage),
path('shy/', clavier_views.newPage),
path('id-<str:pageId>/', clavier_views.loadPage),
path('id-<str:pageId>/page', clavier_views.getPageContent),
path('<str:pageLang>/id-<str:pageId>/', clavier_views.loadPage),
......
......@@ -113,26 +113,42 @@ function switchMode(){
if (!modeGraphies) {
// Mode PHONO
console.log('Passage en mode PHONO')
document.getElementById('graphies').style.display = 'none'
document.getElementById('clavier').classList.remove('clavier')
document.getElementById('clavier').classList.add('clavierSeul')
document.getElementById('modePhono').checked = false;
modeGraphies = 0
document.documentElement.style.setProperty('--clavSize', '60%');
document.documentElement.style.setProperty('--graphSize', '40%');
if (thisPageLang != "shy") {
document.getElementById('graphies').style.display = 'none'
document.getElementById('clavier').classList.remove('clavier')
document.getElementById('clavier').classList.add('clavierSeul')
hideGraphies();
document.documentElement.style.setProperty('--clavSize', '60%');
document.documentElement.style.setProperty('--graphSize', '40%');
hideGraphies();
} else {
// SI CHAOUI
selectPanneau('phonoShypSb4');
}
} else {
// Mode PHONOGRAPHIE
console.log('Passage en mode PHONOGRAPHIE')
document.getElementById('graphies').style.display = 'block'
document.getElementById('clavier').classList.remove('clavierSeul')
document.getElementById('clavier').classList.add('clavier')
document.getElementById('modePhono').checked = true;
modeGraphies = 1
document.documentElement.style.setProperty('--clavSize', '50%');
document.documentElement.style.setProperty('--graphSize', '50%');
if (thisPageLang != "shy") {
document.getElementById('graphies').style.display = 'block'
document.getElementById('clavier').classList.remove('clavierSeul')
document.getElementById('clavier').classList.add('clavier')
hideGraphies();
document.documentElement.style.setProperty('--clavSize', '50%');
document.documentElement.style.setProperty('--graphSize', '50%');
showGraphies();
} else {
// SI CHAOUI
selectPanneau('phonoShyfSb4');
}
}
}
......@@ -196,7 +212,7 @@ function recupPhon(identifiant){
//// IF modeGraphies
//// → lister les graphies
if (thisPageLang != "dz") {
if (thisPageLang != "dz" && thisPageLang != "shy") {
currentPhon = identifiant
var graphZone = document.getElementById("graphiesZone")
......@@ -226,7 +242,7 @@ function recupPhon(identifiant){
graphZone.innerHTML = gz
} else {
} else if (thisPageLang == "dz") {
// ARABE ALGÉRIEN - traitement plus simple
var graphZone = document.getElementById("graphiesZone")
graphlist = api2ar[phon2api[identifiant.replace('rect_', 'phon_')]]
......@@ -330,6 +346,11 @@ function writeGraph(graph,phon){
// if (hamzah.includes(graph)) graph = "&zwj;"+graph;
}
// SI CHAOUI
if (thisPageLang == "shy") {
stress = " chaoui";
}
var graphSpan = document.createElement("span")
graphSpan.setAttribute("id", phon+"-g"+Math.random().toString(36).substring(2,9))
graphSpan.setAttribute("class", 'text '+phon+stress+textClip)
......@@ -618,7 +639,7 @@ function getPopUp() {
newOutputSpan = "<span style='" + expFonte + expBold + expSizeBase; // PAR DEFAUT
if (classs.includes("punct")) newOutputSpan = "<span style='" + expFonte + expSizeBase;
if (classs.includes("unstressed") || classs.includes("arabe")) newOutputSpan = "<span style='" + expFonte + expNoBold + expSizeBase;
if (classs.includes("unstressed") || classs.includes("arabe") || classs.includes("chaoui")) newOutputSpan = "<span style='" + expFonte + expNoBold + expSizeBase;
if (classs.includes("schwa")) newOutputSpan = "<span style='" + expFonte + expNoBold + expSizeSchwa;
if (classs.includes("stress1")) newOutputSpan = "<span style='" + expFonte + expSizeStress1;
if (classs.includes("stress2")) newOutputSpan = "<span style='" + expFonte + expSizeStress2;
......@@ -1209,7 +1230,7 @@ function checkWord() {
var wordPhonoSpansList = []
if (thisPageLang != "dz") {
if (['fr','en','zh'].includes(thisPageLang)) {
let cptw = 0;
for (w of ww) {
cptw++;
......
......@@ -6,7 +6,7 @@ var thisPageLang = "";
// set page target language
function setLangFromUrl() {
var pageLang = thisURL.match(/.*\/(fr|en|zh|dz)/);
var pageLang = thisURL.match(/.*\/(fr|en|zh|dz|shy)/);
if (pageLang) {
console.log("Langue indiquée par l'url:",pageLang[1]);
thisPageLang = pageLang[1];
......@@ -14,6 +14,7 @@ function setLangFromUrl() {
if (pageLang[1]=="en") selectLang("en");
if (pageLang[1]=="zh") selectLang("zh");
if (pageLang[1]=="dz") selectLang("dz");
if (pageLang[1]=="shy") selectLang("shy");
} else {
console.log("Chargement langue par défaut (fr)");
thisPageLang = "fr"
......@@ -115,6 +116,21 @@ function selectLang(lang, p="default", f="default"){
if (pageId == '0') window.history.pushState("", "", "/dz");
interface("dz");
} else if (lang == "shy") {
// var phonoShypSb4 = document.createElement('option');
// phonoShypSb4.value = "phonoShypSb4";
// phonoShypSb4.innerHTML = "Chaoui S. Benbouaziz v4";
// phonolist.appendChild(phonoShypSb4);
var phonoShyfSb4 = document.createElement('option');
phonoShyfSb4.value = "phonoShyfSb4";
phonoShyfSb4.selected = "True";
phonoShyfSb4.innerHTML = "Chaoui Fidel S. Benbouaziz v4";
phonolist.appendChild(phonoShyfSb4);
if (pageId == '0') window.history.pushState("", "", "/shy");
interface("shy");
}
selectPanneau(p);
selectFidel(f);
......@@ -131,6 +147,9 @@ function selectPanneau(p){
p = "phonoZhJi"
} else if (p=="default" && thisPageLang=="dz") {
p = "phonoDzSb3"
} else if (p=="default" && thisPageLang=="shy") {
if (modeGraphies==0) p = "phonoShypSb4";
else p = "phonoShyfSb4";
}
var svgFrKinephones = document.getElementById('svgFrKinephones'); // Panneau FR Kinephones
......@@ -155,7 +174,10 @@ function selectPanneau(p){
var svgDzSb2 = document.getElementById('svgDzSb2'); // Panneau Arabe Algérien Sarra Benbouaziz v2
var svgDzSb3 = document.getElementById('svgDzSb3'); // Panneau Arabe Algérien Sarra Benbouaziz v3
var svgShypSb4 = document.getElementById('svgShypSb4'); // Panneau Chaoui Sarra Benbouaziz v4
var svgShyfSb4 = document.getElementById('svgShyfSb4'); // Panneau Fidel Chaoui Sarra Benbouaziz v4
function resetPanneaux() {
// FR DO
doCalques.style.display = 'none';
......@@ -191,6 +213,23 @@ function selectPanneau(p){
svgDzSb2.style.display = 'none';
// DZ SB v3
svgDzSb3.style.display = 'none';
// SHY SB v4
svgShypSb4.style.display = 'none';
// SHY Fidel SB v4
svgShyfSb4.style.display = 'none';
if (modeGraphies==1) {
document.getElementById('graphies').style.display = 'block'
document.getElementById('clavier').classList.remove('clavierSeul')
document.getElementById('clavier').classList.add('clavier')
document.documentElement.style.setProperty('--clavSize', '50%');
document.documentElement.style.setProperty('--graphSize', '50%');
showGraphies();
}
document.getElementById('selectFidel').style.display = 'block';
}
......@@ -264,6 +303,41 @@ function selectPanneau(p){
// DZ SB v2
svgDzSb3.style.display = 'block';
} else if (p == 'phonoShypSb4') {
resetPanneaux();
document.getElementById('modePhono').checked = false;
document.getElementById('graphies').style.display = 'none'
document.getElementById('clavier').classList.remove('clavier')
document.getElementById('clavier').classList.add('clavierSeul')
document.documentElement.style.setProperty('--clavSize', '60%');
document.documentElement.style.setProperty('--graphSize', '40%');
hideGraphies();
// SHY SB v4
svgShypSb4.style.display = 'block';
document.getElementById('selectFidel').style.display = 'none';
} else if (p == 'phonoShyfSb4') {
resetPanneaux();
document.getElementById('modePhono').checked = true;
document.getElementById('graphies').style.display = 'none'
document.getElementById('clavier').classList.remove('clavier')
document.getElementById('clavier').classList.add('clavierSeul')
document.documentElement.style.setProperty('--clavSize', '60%');
document.documentElement.style.setProperty('--graphSize', '40%');
hideGraphies();
// SHY Fidel SB v4
svgShyfSb4.style.display = 'block';
document.getElementById('selectFidel').style.display = 'none';
}
}
......@@ -277,10 +351,12 @@ function selectFidel(f){
f = "cedict";
} else if (f=="default" && thisPageLang=="dz") {
f = "fidelSb";
} else if (f=="default" && thisPageLang=="shy") {
f = "";
}
fidel = dicoFidels[f];
document.getElementById('selectFidel').value = f;
if (currentPhon) recupPhon(currentPhon);
if (currentPhon && modeGraphies==1) recupPhon(currentPhon);
}
function interface(lang) {
......@@ -369,11 +445,18 @@ function interface(lang) {
var punctAr0s = document.querySelectorAll('.punctAr0');
for (el of punctAr0s) el.style.display = "none";
} else if (lang == "shy") {
initInterface();
document.getElementById('ti_maj').style.display = "none";
// Indiquer le lien de Page Vierge
document.getElementById('hrefNewPage').href = thisRawURL+'shy/';
} else { // "fr" par défaut
initInterface();
// Indiquer le lien de Page Vierge
document.getElementById('hrefNewPage').href = thisRawURL+'fr/';
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -342,6 +342,10 @@
font-size: 6vw;
}
.chaoui {
font-weight: normal;
}
.noTextClipGraphZone {
-webkit-text-fill-color: unset;
}
......
......@@ -164,6 +164,30 @@
font-style: italic;
}
@font-face {
font-family: 'DejaVu Serif';
src: url('../fonts/DejaVuSerif.eot');
src: local('DejaVu Serif'), local('DejaVuSerif'),
url('../fonts/DejaVuSerif.eot?#iefix') format('embedded-opentype'),
url('../fonts/DejaVuSerif.woff2') format('woff2'),
url('../fonts/DejaVuSerif.woff') format('woff'),
url('../fonts/DejaVuSerif.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'DejaVu Serif';
src: url('../fonts/DejaVuSerif-Bold.eot');
src: local('DejaVu Serif Bold'), local('DejaVuSerif-Bold'),
url('../fonts/DejaVuSerif-Bold.eot?#iefix') format('embedded-opentype'),
url('../fonts/DejaVuSerif-Bold.woff2') format('woff2'),
url('../fonts/DejaVuSerif-Bold.woff') format('woff'),
url('../fonts/DejaVuSerif-Bold.ttf') format('truetype');
font-weight: bold;
font-style: normal;
}
body {
background-image: url(../im/arriereplan.gif);
background-color: rgba(255, 255, 255, 0.5);
......
This diff is collapsed.
This diff is collapsed.
......@@ -32,6 +32,7 @@
<option value="en">English</option>
<option value="zh">中文</option>
<option value="dz">جزايري</option>
<option value="shy">ⵜⴰⵛⴰⵡⵉⵜ</option>
</select>
</div>
......@@ -176,6 +177,12 @@
<!-- DZ Clavier Sarra Benbouaziz v3-->
<embed id="svgDzSb3" style="display: none;" src="../static/svg/arabe_alg_Benbouaziz_v3.svg" class="superposeBack">
<!-- SHY Chaoui phono Clavier Sarra Benbouaziz v4-->
<embed id="svgShypSb4" style="display: none;" src="../static/svg/chaoui_v4.svg" class="superposeBack">
<!-- SHY Chaoui fidel Clavier Sarra Benbouaziz v4-->
<embed id="svgShyfSb4" style="display: none;" src="../static/svg/chaouiFidel_v4.svg" class="superposeBack">
<!-- BOUTONS + - -->
<div class="control-clavier">
......
......@@ -611,7 +611,7 @@ def addStat(request):
newStat.app = app
newStat.module = module
newStat.ip = get_client_ip(request)
newStat.agent = "" #parse(request.META['HTTP_USER_AGENT'])
newStat.agent = parse(request.META['HTTP_USER_AGENT'])
newStat.country = getCountry(get_client_ip(request))
newStat.lang = lang
......@@ -628,5 +628,4 @@ def getCountry(ip):
exit()
data = response.json()
print(data)
return data['country']
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment