gestione risultati come periodo

This commit is contained in:
cesare 2023-03-07 10:10:22 +01:00
parent bc4502b4bf
commit 67eb044ef1
2 changed files with 44 additions and 16 deletions

View File

@ -90,6 +90,22 @@ function getRoman(numero) {
}
function loadPeriodo(idperiodo) {
$(cantoDisplayed).find(' .'+idperiodo).each(function() {
var pstp=$(this).attr('class').split(" ")[1]
$(this).css('color', colorssp(mapsynttypestopalette[pstp]));
})
minim.contents().find(' .'+idperiodo).each(function() {
var mpstp=$(this).attr('class').split(" ")[1]
$(this).css('color', colorssp(mapsynttypestopalette[mpstp]));
})
}
function loadFrasi() {
$(cantoDisplayed).find(' .sentencetag').each(function() {
@ -641,8 +657,9 @@ $(" ."+formaClass).hover(function(idx, element) {
$("#vistaFrasi").empty()
$("#vistaFrasi").css("display", "none");
for (msid of listaPeriodiRisultato){
$(msid).each(function(){
$(this).removeClass("font-weight-bold mark ")
$('.'+msid).each(function(){
//$(this).removeClass("font-weight-bold mark ")
$(this).css('color', '');
});
}
@ -753,9 +770,12 @@ $(" ."+formaClass).hover(function(idx, element) {
if (listaPeriodiRisultato.length){
for (msid of listaPeriodiRisultato){
loadPeriodo(msid)
/*
$(msid).each(function(){
$(this).addClass("font-weight-bold mark ")
});
*/
}
}
@ -980,22 +1000,25 @@ $(" ."+formaClass).hover(function(idx, element) {
cantiche = ["Inferno", "Purgatorio", "Paradiso"]
if (!listarisultati.length || unitaRicerca=='frase'){
resultsInCantica=[]
resultsInCanto=[]
listaPeriodiRisultato=[]
if (listaclausole.length){
for (var frase of listaclausole){
var fraseItems=frase.split('-');
for (var p=parseInt(fraseItems[1]); p<parseInt(fraseItems[2])+1;p++){
listarisultati.push(p)
if (!listarisultati.length || unitaRicerca == 'frase') {
resultsInCantica = []
resultsInCanto = []
listaPeriodiRisultato = []
if (listaclausole.length) {
for (var frase of listaclausole) {
var fraseItems = frase.split('-');
for (var p = parseInt(fraseItems[1]); p < parseInt(fraseItems[2]) + 1; p++) {
listarisultati.push(p)
}
if (!resSent.has(fraseItems[0]+'-'+fraseItems[3])){
resSent.add(fraseItems[0]+'-'+fraseItems[3])
if (!resSent.has(fraseItems[0] + '-' + fraseItems[3])) {
resSent.add(fraseItems[0] + '-' + fraseItems[3])
resultsInCantica.push(fraseItems[4]);
resultsInCanto.push(fraseItems[4] + fraseItems[5])
}
}
@ -1011,11 +1034,15 @@ $(" ."+formaClass).hover(function(idx, element) {
console.log(mysid)
//$(mysid).addClass('font-italic')
//$(mysid).addClass("font-weight-bold mark ")
listaPeriodiRisultato.push(mysid)
listaPeriodiRisultato.push(fraseItems[0].toString())
loadPeriodo(fraseItems[0].toString())
/*
$(mysid).each(function(){
//console.log('add id '+$(this).attr('id'));
listarisultati.push($(this).attr('id'))
});
*/
if (!resSent.has(fraseItems[0])){
resSent.add(fraseItems[0])
resultsInCantica.push(fraseItems[4]);

View File

@ -237,6 +237,7 @@ WHERE {
//colori
var colorssp = d3.scaleQuantize()
.domain([0, 17])
.range(["#1f78b4", "#a6cee3", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00",