Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pédagogies Multimodales
PhonoDrop
Commits
2e4732c2
Commit
2e4732c2
authored
Jan 30, 2022
by
Sylvain Coulange
Browse files
consoleLog en commentaires
parent
83735065
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/scripts/phonodrop_v2.js
View file @
2e4732c2
...
...
@@ -102,7 +102,7 @@ $('#multidraggable').multidraggable({
onCreate
:(
event
,
ui
)
=>
{},
onSelecting
:(
event
,
ui
)
=>
{
// if (ui.selecting.id != 'tooldiv') console.log("Sélection ",ui.selecting.id)
// if (ui.selecting.id != 'tooldiv')
//
console.log("Sélection ",ui.selecting.id)
},
onSelected
:(
event
,
ui
)
=>
{
if
(
ui
.
selected
.
id
!=
'
tooldiv
'
)
group
.
push
(
ui
.
selected
)
...
...
@@ -110,7 +110,7 @@ $('#multidraggable').multidraggable({
onStopSelecting
:(
event
,
ui
)
=>
{
if
(
group
.
length
>
0
)
getTools
(
group
)
console
.
log
(
"
Sélection groupe :
"
+
group
.
map
((
rect
)
=>
{
return
rect
.
id
}).
join
(
'
,
'
))
//
console.log("Sélection groupe : "+ group.map((rect)=>{ return rect.id }).join(', '))
},
onStartSelecting
:(
event
,
ui
)
=>
{
group
=
[]
...
...
@@ -133,8 +133,8 @@ $('#multidraggable').multidraggable({
// Au double-click sur la table: on pose le curseur
document
.
getElementById
(
'
multidraggable
'
).
ondblclick
=
(
e
)
=>
{
console
.
log
(
"
Coucou
"
)
console
.
log
(
"
Position curseur (x,y)
"
,
e
.
layerX
,
e
.
layerY
)
//
console.log("Coucou")
//
console.log("Position curseur (x,y)", e.layerX, e.layerY)
document
.
querySelectorAll
(
'
.selectedPhon
'
).
forEach
(
(
el
)
=>
{
el
.
classList
.
remove
(
'
selectedPhon
'
)
})
var
anchor
=
document
.
getElementById
(
'
anchor
'
)
anchor
.
style
.
left
=
e
.
layerX
+
"
px
"
...
...
@@ -158,7 +158,7 @@ function sortGroup(groupX){
// - pronsci
function
recupPhon
(
identifiant
){
console
.
log
(
identifiant
)
//
console.log(identifiant)
var
newDiv
=
document
.
createElement
(
'
div
'
)
newDiv
.
id
=
identifiant
+
'
-
'
+
Math
.
random
().
toString
(
36
).
substring
(
2
,
9
);
...
...
@@ -212,7 +212,7 @@ function recupPhon(identifiant){
// SINOSYLLABE
}
else
if
(
identifiant
.
match
(
/syll_.*/
))
{
console
.
log
(
"
Création de :
"
,
identifiant
)
//
console.log("Création de :", identifiant)
let
newSyll
=
makeNewSyll
(
currentSyll
)
newDiv
.
appendChild
(
newSyll
)
rmPart
(
document
.
getElementById
(
'
syll1
'
),
'
initiale
'
)
...
...
@@ -229,7 +229,7 @@ function recupPhon(identifiant){
// PINYIN
}
else
if
(
identifiant
.
match
(
/pinyin.*/
))
{
console
.
log
(
"
Création de :
"
,
identifiant
)
//
console.log("Création de :", identifiant)
newDiv
.
innerHTML
=
document
.
getElementById
(
'
pinyinLab
'
).
innerHTML
;
newDiv
.
classList
.
add
(
"
contours
"
);
newDiv
.
style
.
fontSize
=
"
5em
"
;
...
...
@@ -324,7 +324,7 @@ function selectPhon(rect) {
document
.
getElementById
(
'
anchor
'
).
style
.
display
=
"
none
"
document
.
querySelectorAll
(
'
.selectedPhon
'
).
forEach
(
(
el
)
=>
{
el
.
classList
.
remove
(
'
selectedPhon
'
)}
)
rect
.
classList
.
add
(
'
selectedPhon
'
)
console
.
log
(
"
Focus :
"
,
rect
.
id
)
//
console.log("Focus :",rect.id)
lastSelect
=
rect
}
...
...
@@ -435,7 +435,7 @@ function initGraph() {
}
function
space
()
{
console
.
log
(
"
Espace
"
)
//
console.log("Espace")
document
.
querySelectorAll
(
'
.selectedPhon
'
).
forEach
(
(
el
)
=>
{
el
.
classList
.
remove
(
'
selectedPhon
'
)
})
var
anchor
=
document
.
getElementById
(
'
anchor
'
)
...
...
public/scripts/sinosyllabe.js
View file @
2e4732c2
...
...
@@ -27,7 +27,7 @@ function makeSyll(code) {
if
(
code
==
100
)
[
initiale
,
glide
,
tonale
,
finale
]
=
[
0
,
2
,
0
,
0
]
if
(
code
==
101
)
[
initiale
,
glide
,
tonale
,
finale
]
=
[
0
,
3
,
0
,
3
]
console
.
log
(
code
,
initiale
,
glide
,
tonale
,
finale
)
//
console.log(code, initiale,glide,tonale,finale)
document
.
getElementById
(
'
initiale
'
).
classList
.
remove
(
"
_1
"
,
"
_2
"
,
"
_3
"
,
"
_4
"
)
document
.
getElementById
(
'
glide
'
).
classList
.
remove
(
"
_1
"
,
"
_2
"
,
"
_3
"
,
"
_4
"
)
document
.
getElementById
(
'
tonale
'
).
classList
.
remove
(
"
_1
"
,
"
_2
"
,
"
_3
"
,
"
_4
"
)
...
...
@@ -70,7 +70,7 @@ function togglePart(part) {
currentTone
=
0
function
toggleTone
(
nb
)
{
if
(
nb
==
currentTone
||
nb
==
5
)
{
console
.
log
(
"
Réinitialisation du ton
"
)
//
console.log("Réinitialisation du ton")
// réinitialisation si clique sur ton déjà actif
currentTone
=
0
document
.
getElementById
(
'
ton1
'
).
style
.
display
=
"
none
"
...
...
@@ -129,7 +129,7 @@ function toggleTone(nb) {
document
.
getElementById
(
'
ton8
'
).
style
.
display
=
"
none
"
}
}
console
.
log
(
"
Ton:
"
,
currentTone
)
//
console.log("Ton:", currentTone)
}
let
listinitiales
=
[
...
...
@@ -215,7 +215,7 @@ var possibleOutputs = {} // pour le pinyin : pour chaque pinyin potentiel → <s
function
zhPhon
(
identifiant
)
{
let
phon
=
identifiant
.
replace
(
'
rect_
'
,
'
phon_
'
).
replace
(
'
-t
'
,
''
).
replace
(
'
-f
'
,
''
)
if
(
gradientToRight
.
includes
(
phon
))
{
phon
=
phon
+
'
-h
'
}
// gradients à l'horizontal pour affriquées
console
.
log
(
"
zhPhon
"
,
identifiant
,
phon
)
//
console.log("zhPhon",identifiant, phon)
if
(
listinitiales
.
includes
(
identifiant
))
{
if
(
document
.
getElementById
(
'
initiale
'
).
classList
.
contains
(
phon
))
{
...
...
@@ -290,11 +290,11 @@ function zhPhon(identifiant) {
// ÉCRITURE PINYIN
var
currentSyllonAPI
=
document
.
getElementById
(
'
pinyinLabAPI
'
).
innerText
;
console
.
log
(
'
Current syll:
'
,
currentSyllonAPI
,
possibleCurrentSyll
);
//
console.log('Current syll:',currentSyllonAPI,possibleCurrentSyll);
phon
=
phon
.
replace
(
'
-h
'
,
''
)
var
phonApi
=
phon2api
[
phon
];
console
.
log
(
'
PINYIN:
'
,
phon
,
phonApi
);
//
console.log('PINYIN:',phon,phonApi);
// syllabe API attestée ?
...
...
@@ -305,7 +305,7 @@ function zhPhon(identifiant) {
possibleSyllonApi2pinyin
[
x
]
=
syllonAPI2pinyin
[
x
];
}
}
console
.
log
(
"
Syllons API possibles:
"
,
possibleSyllonApi2pinyin
);
//
console.log("Syllons API possibles:",possibleSyllonApi2pinyin);
document
.
getElementById
(
'
pinyinLabAPI
'
).
innerHTML
+=
phonApi
;
var
pinyinLab
=
document
.
getElementById
(
'
pinyinLabAPI
'
).
innerHTML
;
...
...
@@ -350,7 +350,7 @@ function zhPhon(identifiant) {
xph
++
;
}
console
.
log
(
"
pp=
"
,
ph
);
//
console.log("pp=",ph);
for
(
xpi
in
api2pinyin
[
ph
])
{
// pour chaque graphie pi possible pour cet api
...
...
@@ -370,7 +370,7 @@ function zhPhon(identifiant) {
continue
;
}
else
{
var
tonale
=
""
;
console
.
log
(
ph
);
//
console.log(ph);
if
(
tonalesApi
.
includes
(
ph
))
tonale
=
"
tonale
"
;
pinyinEnCoursHtml
+=
"
<span class='
"
+
api2class
[
ph
]
+
tonale
+
"
'>
"
+
pi
+
"
</span>
"
;
pinyinEnCours
+=
pi
;
...
...
@@ -426,26 +426,26 @@ function recupTone(identifiant) {
var
inPin
=
document
.
getElementById
(
'
pinyinLab
'
).
innerText
;
var
inSyll
=
inPin
+
myton
;
if
(
Object
.
keys
(
syllons
).
includes
(
inSyll
))
{
console
.
log
(
"
Syllon attesté !
"
)
//
console.log("Syllon attesté !")
var
nods
=
document
.
getElementById
(
'
pinyinLab
'
).
childNodes
nods
.
forEach
((
nod
)
=>
{
if
([
"
a
"
,
"
e
"
,
"
i
"
,
"
o
"
,
"
u
"
,
"
ü
"
,
"
er
"
,
"
yu
"
,
"
wu
"
,
"
yi
"
].
includes
(
nod
.
innerText
)
&&
nod
.
classList
.
contains
(
'
tonale
'
))
{
var
thisVoy
=
nod
.
innerText
;
console
.
log
(
"
TONALE!
"
,
thisVoy
)
//
console.log("TONALE!",thisVoy)
nod
.
innerText
=
nod
.
innerText
.
replace
(
thisVoy
,
tons
[
myton
][
thisVoy
])
}
})
document
.
getElementById
(
'
pinyinLabAPI
'
).
innerHTML
+=
myton
;
document
.
getElementById
(
'
pinyinLab
'
).
classList
.
add
(
"
pinyinAtteste
"
);
}
else
{
console
.
log
(
"
Syllon non attesté.
"
);
//
console.log("Syllon non attesté.");
document
.
getElementById
(
'
pinyinLab
'
).
classList
.
remove
(
"
pinyinAtteste
"
);
}
}
function
rmPart
(
thisEl
,
syllid
)
{
if
(
thisEl
.
classList
.
contains
(
"
actif
"
))
{
console
.
log
(
"
rm
"
,
syllid
,
currentSyll
[
syllid
].
rect
)
//
console.log("rm", syllid, currentSyll[syllid].rect)
zhPhon
(
currentSyll
[
syllid
].
rect
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment