corretto bug in visualizzazione frasi

This commit is contained in:
cesare 2024-01-03 15:09:53 +01:00
parent c217fe5928
commit 21003092f1
1 changed files with 40 additions and 6 deletions

View File

@ -229,7 +229,8 @@ $(" ."+formaClass).hover(function(idx, element) {
if (listaClausoleRisultato.length){
for (clsid of listaClausoleRisultato){
let tmpid=clsid.split('-')
loadFrase(tmpid[0], tmpid[1])
//loadFrase(tmpid[0], tmpid[1])
loadClausola(tmpid[0], tmpid[1], tmpid[2], tmpid[3])
}
}
@ -440,7 +441,8 @@ $(" ."+formaClass).hover(function(idx, element) {
if (listaClausoleRisultato.length){
for (clsid of listaClausoleRisultato){
let tmpid=clsid.split('-')
loadFrase(tmpid[0], tmpid[1])
//loadFrase(tmpid[0], tmpid[1])
loadClausola(tmpid[0], tmpid[1], tmpid[2], tmpid[3])
}
}
@ -654,6 +656,33 @@ function loadFrase(idperiodo, funzionefrase) {
})
}
function loadClausola(idperiodo, funzionefrase, fromn, ton) {
if (!isPeriodoInCanto(idperiodo, cantoDisplayed))
return
$(cantoDisplayed).find(' .'+idperiodo).each(function() {
if (parseInt($(this).attr('id'))>=parseInt(fromn)
&& parseInt($(this).attr('id'))<=parseInt(ton)){
var pstp=$(this).attr('class').split(" ")[1]
if(pstp.trim()==funzionefrase)
$(this).css('color', colorssp(mapsynttypestopalette[pstp]));
}
})
minim.contents().find(' .'+idperiodo).each(function() {
if (parseInt($(this).attr('id'))>=parseInt(fromn)
&& parseInt($(this).attr('id'))<=parseInt(ton)){
var mpstp=$(this).attr('class').split(" ")[1]
if(mpstp.trim()==funzionefrase)
$(this).css('color', colorssp(mapsynttypestopalette[mpstp]));
}
})
}
function loadFrasi() {
$(cantoDisplayed).find(' .sentencetag').each(function() {
@ -702,7 +731,8 @@ function resetFrasi(){
if (listaClausoleRisultato.length) {
for (clsid of listaClausoleRisultato) {
let tmpid = clsid.split('-')
loadFrase(tmpid[0], tmpid[1])
//loadFrase(tmpid[0], tmpid[1])
loadClausola(tmpid[0], tmpid[1], tmpid[2], tmpid[3])
}
}
@ -1432,7 +1462,8 @@ function resetFrasi(){
if (listaClausoleRisultato.length){
for (clsid of listaClausoleRisultato){
let tmpid=clsid.split('-')
loadFrase(tmpid[0], tmpid[1])
//loadFrase(tmpid[0], tmpid[1])
loadClausola(tmpid[0], tmpid[1], tmpid[2], tmpid[3])
}
}
@ -1659,6 +1690,7 @@ function resetFrasi(){
});
seachbBindingsStream.on('end', () => {
var resSent=new Set()
var resSentence=new Set()
var resClauses=[]
//let minim=$(" .minimap__content")
console.log('start rendering...')
@ -1679,14 +1711,16 @@ function resetFrasi(){
for (var frase of listaclausole) {
var fraseItems = frase.split('-');
loadFrase(fraseItems[0].toString(), fraseItems[3].toString())
//loadFrase(fraseItems[0].toString(), fraseItems[3].toString())
loadClausola(fraseItems[0].toString(), fraseItems[3].toString(), fraseItems[1], fraseItems[2])
//if (!resSent.has(fraseItems[0] + '-' + fraseItems[3])) {
let tmpocc=fraseItems.slice(-1)
if (resClauses.filter(clocc => clocc==tmpocc[0]).length==0) {
resClauses.push(tmpocc[0]);
resSent.add(fraseItems[0] + '-' + fraseItems[3]);
resSent.add(fraseItems[0] + '-' + fraseItems[3]+'-'+fraseItems[1] + '-' + fraseItems[2]);
resSentence.add(fraseItems[1] + '-' + fraseItems[2]);
//resSent.add(fraseItems.slice(-1))
resultsInCantica.push(fraseItems[4]);
resultsInCanto.push(fraseItems[4] + fraseItems[5]);