From 95b158cf57d2f17621952a1ccb02290db4602411 Mon Sep 17 00:00:00 2001 From: cesare Date: Thu, 18 Apr 2024 10:59:20 +0200 Subject: [PATCH] gestione 'Visualizza' in progress --- js/cesareBrowse.js | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index 132e91a..4203705 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -8,6 +8,8 @@ var lsid; var lsentid; const formaClass='frm' var selectedVista; +var vistaPeriodi=false +var vistaDialoghi=false var listaPeriodiRisultato; var listaClausoleRisultato; var numeroContesti; @@ -77,20 +79,19 @@ $('#opzioniVista :checkbox').change(function() { //resetFrasi() selectedVista = 'frasi' $(cantoDisplayed).attr('style', 'display: d-flex;') - + vistaPeriodi=true //cancello il grafo sintattico //resetGraphStruct() //emptyStructCard() loadFrasi(); - break; case "visPeriodi|false": $("#vistaFrasi").css("display", "none"); resetFrasi() + vistaPeriodi=false + if(vistaDialoghi) + loadDialoghi(); $(cantoDisplayed).attr('style', 'display: d-flex;') - //cancello il grafo sintattico - resetGraphStruct() - emptyStructCard() break; case "visRiferimenti|true": $(".showcomments").css("display", "inline-block"); @@ -109,12 +110,14 @@ $('#opzioniVista :checkbox').change(function() { break; case "visDialoghi|true": selectedVista = 'dialoghi' - resetFrasi() + //resetFrasi() loadDialoghi(); + vistaDialoghi=true break; case "visDialoghi|false": $("#vistaDialoghi").css("display", "none"); - resetFrasi() + //resetFrasi() + vistaDialoghi=false break; case "visMetafore|true": //loadMetafore(); @@ -124,7 +127,7 @@ $('#opzioniVista :checkbox').change(function() { } }); -$("#valoreVista").on('change', function() { +/*$("#valoreVista").on('change', function() { selectedVista = $(this).val(); switch (selectedVista){ case "forme": @@ -155,7 +158,7 @@ $("#valoreVista").on('change', function() { resetGraphStruct() emptyStructCard() } -}); +});*/ @@ -831,6 +834,7 @@ function resetFrasi(){ //cancello il grafo sintattico resetGraphStruct() emptyStructCard() + vistaPeriodi=false } /*INIZIO GESTIONE CITAZIONI*/ @@ -1293,9 +1297,9 @@ function resetFrasi(){ //Calcola lemma e categoria grammaticale oppure categoria sintattica per tooltip function formatTTContent(categ, syntType, sentId){ - if (selectedVista=='frasi'){ + /*if (selectedVista=='frasi'){ return '
'+maptypes[syntType]+'
'; - } + }*/ var details=[]; var lemma=categ.split('#')[1].replace("^", " ") //il lemma var categoria=categ.split('#')[0] // la categoria @@ -1306,6 +1310,7 @@ function resetFrasi(){ var subcatgramm = ''; var popoverText = ''; var discorsost=''; + var funcFrase=''; var TipiDiscorso={ "ThoughtDiscourse": "Pensato", "DirectDiscourse": "Diretto", @@ -1323,7 +1328,7 @@ function resetFrasi(){ popoverText = popoverText + catgramm + subcatgramm; } - if(selectedVista=='dialoghi'){ + if(vistaDialoghi){ for (const india in dialoghi){ if (dialoghi[india]['Cnt'].replace('_so','')==sentId){ discorsost="
Personaggio: "+dialoghi[india]['Spna'].replace('http://dantenetwork.it/data/commedia/', '')+'' @@ -1332,7 +1337,10 @@ function resetFrasi(){ } } } - popoverText=popoverText+discorsost + if(vistaPeriodi){ + funcFrase='
'+maptypes[syntType]+'
' + } + popoverText=popoverText+discorsost+funcFrase return (popoverText); }