Commit 5bdc6dd9 authored by Sylvain Coulange's avatar Sylvain Coulange
Browse files

ajout audio phon 9_nas et a_maj

parent 29bedbb7
......@@ -34,16 +34,7 @@ for (i in tps) {
var group = [] // liste des éléments sélectionnés
var lastSelect = "" // dernier élément modifié (pour la position du curseur)
// Au double-click sur la table: on pose le curseur
document.getElementById('multidraggable').addEventListener('dblclick', (e) => {
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"
anchor.style.top = e.layerY - 28 + "px" // remonter le curseur de la moitié de sa hauteur
anchor.style.display = "block"
lastSelect = anchor
})
// Paramétrage multidraggable (nécessite multidraggable.js, jquery et jquery-ui)
$('#multidraggable').multidraggable({
......@@ -78,6 +69,20 @@ $('#multidraggable').multidraggable({
stack: ".carte-v2",
})
// 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)
document.querySelectorAll('.selectedPhon').forEach( (el) => { el.classList.remove('selectedPhon') })
var anchor = document.getElementById('anchor')
anchor.style.left = e.layerX + "px"
anchor.style.top = e.layerY - 28 + "px" // remonter le curseur de la moitié de sa hauteur
anchor.style.display = "block"
lastSelect = anchor
}
function sortGroup(groupX){
return groupX.sort(function(a, b){ return a.offsetLeft - b.offsetLeft})
}
......
......@@ -28,23 +28,6 @@ async function playIpa() {
if (ipa != currentIpa) { synth = true }
} else if (group.length == 1) {
// lire phon kinéphones
var thisPhon = ""
for (c=0; c<group[0].classList.length; c++){
// si la classe match "phon_.*"" alors on récupère l'équivalent api
if (group[0].classList[c].match(/phon_.*/)){
thisPhon = group[0].classList[c]
}
}
console.log('Lecture Kinephones', thisPhon, phon2api[thisPhon])
var audio = new Audio("audio/" + lang+"_" + thisPhon+"-f.mp3")
audio.play()
}
if (synth) {
console.log("lecture de ", ipa);
currentIpa = ipa;
......@@ -76,6 +59,21 @@ async function playIpa() {
sv_audio.play();
}
} else if (group.length == 1) {
// lire phon kinéphones
var thisPhon = ""
for (c=0; c<group[0].classList.length; c++){
// si la classe match "phon_.*"" alors on récupère l'équivalent api
if (group[0].classList[c].match(/phon_.*/)){
thisPhon = group[0].classList[c]
}
}
console.log('Lecture Kinephones', thisPhon, phon2api[thisPhon])
var audio = new Audio("audio/" + lang+"_" + thisPhon+"-f.mp3")
audio.play()
}
}
function readResponse(response) {
......
Markdown is supported
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