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,6 +28,37 @@ async function playIpa() {
if (ipa != currentIpa) { synth = true }
if (synth) {
console.log("lecture de ", ipa);
currentIpa = ipa;
// ON EMBALLE TOUT ÇA
var colis = {
ipa,
lang,
'voix': 'f',
'appli': "phonodrop"
};
// Paramètres d'envoi
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(colis)
};
// ENVOI
const response = await fetch('http://phonographe.alem-app.fr/_playIpa/', options)
const data = await response.json();
readResponse(data["audio"]);
} else {
var sv_audio = document.getElementsByTagName("audio")[0];
sv_audio.playbackRate = document.getElementById('debitParole').value / 100;
sv_audio.play();
}
} else if (group.length == 1) {
// lire phon kinéphones
var thisPhon = ""
......@@ -43,39 +74,6 @@ async function playIpa() {
audio.play()
}
if (synth) {
console.log("lecture de ", ipa);
currentIpa = ipa;
// ON EMBALLE TOUT ÇA
var colis = {
ipa,
lang,
'voix': 'f',
'appli': "phonodrop"
};
// Paramètres d'envoi
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(colis)
};
// ENVOI
const response = await fetch('http://phonographe.alem-app.fr/_playIpa/', options)
const data = await response.json();
readResponse(data["audio"]);
} else {
var sv_audio = document.getElementsByTagName("audio")[0];
sv_audio.playbackRate = document.getElementById('debitParole').value / 100;
sv_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