From 39afb87499101f9ebde6eac12e5298516f2c0d91 Mon Sep 17 00:00:00 2001 From: cesare Date: Fri, 5 Jan 2024 13:20:10 +0100 Subject: [PATCH] colori per dialoghi --- js/cesareBrowse.js | 35 ++++++++++++++++++++++++++++++----- js/syntgraph.js | 2 +- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index 68bf60e..5394b1f 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -702,14 +702,21 @@ function loadDialoghi() { continue; if(diaclass.split('_')[1]!=cantoDisplayed.split('_')[1]) continue; + var csscl='diaDiretto ' + var diaty=dialoghi[india]['Dty'] + if (diaty=='SpeakableDiscourse') + csscl='diaSpeakable ' + if (diaty=='ThoughtDiscourse') + csscl='diaPensato ' $(cantoDisplayed).find(' .'+diaclass).each(function() { - //#1f78b4 - $(this).css('color', '#1f78b4'); - $(this).addClass("font-weight-bold ") + $(this).addClass(csscl) + //$(this).css('color', '#1f78b4'); + //$(this).addClass("font-weight-bold ") }) minim.contents().find(' .'+diaclass).each(function() { - $(this).css('color', '#1f78b4'); - $(this).addClass("font-weight-bold ") + $(this).addClass(csscl) + //$(this).css('color', '#1f78b4'); + //$(this).addClass("font-weight-bold ") }) } @@ -736,6 +743,15 @@ function loadFrasi() { } function resetFrasi(){ + $(cantoDisplayed).find(' .diaDiretto').each(function() { + $(this).removeClass('diaDiretto'); + }) + $(cantoDisplayed).find(' .diaPensato').each(function() { + $(this).removeClass('diaPensato'); + }) + $(cantoDisplayed).find(' .diaSpeakable').each(function() { + $(this).removeClass('diaSpeakable'); + }) $(cantoDisplayed).find(' .sentencetag').each(function() { $(this).css('display', 'none'); }) @@ -745,6 +761,15 @@ function resetFrasi(){ $(this).removeClass('font-weight-bold') }) //let minim=$(" .minimap__content") + minim.contents().find(" .diaDiretto").each(function(){ + $(this).removeClass('diaDiretto'); + }) + minim.contents().find(" .diaPensato").each(function(){ + $(this).removeClass('diaPensato'); + }) + minim.contents().find(" .diaSpeakable").each(function(){ + $(this).removeClass('diaSpeakable'); + }) minim.contents().find(" .sentencetag").each(function(){ $(this).css('display', 'none'); }) diff --git a/js/syntgraph.js b/js/syntgraph.js index f6dc018..185284d 100644 --- a/js/syntgraph.js +++ b/js/syntgraph.js @@ -33,7 +33,7 @@ document.addEventListener("dblclick", function(e){ for (let i = 0; i < sentence.length; i++) { var matches = listaClausoleRisultato.filter(s => s.includes(sentence[i].classList[0])); sentence[i].classList.remove('font-italic'); - if (selectedVista!='frasi' && !listaPeriodiRisultato.includes(tmpsent) && !matches.length) + if (selectedVista!='frasi' && !listaPeriodiRisultato.includes(tmpsent)) sentence[i].style.removeProperty('color'); sentence[i].classList.remove('font-weight-normal');