diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index 32a1864..3887086 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -28,6 +28,8 @@ $(document).ready(function() { listarisultati = []; listaPeriodiRisultato = []; listaClausoleRisultato=[] + var commentsArray = [] + var resultSentences = new Set() //var displayId = 'displaycanto' var cantiche=["Inferno", "Purgatorio","Paradiso"] @@ -42,6 +44,8 @@ $(document).ready(function() { var showOffset = 30; var idCitazione = "citazioneFrase"; + initComments(); + resetResult=function(){ //console.log('clean result') cleanSearchResult() @@ -899,6 +903,13 @@ function resetFrasi(){ var sentenceid=idcantica+"_"+formaItem[1]+"_s_"+formaItem[5] if (formaItem[1]==canto){ if (! setVersiCanto.has(cantica + "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])){ + + var verso = parseInt(formaItem[3]) - 1; + var idCommento = "Commento_"+idcantica+"_"+canto+"_"+verso; + if (getComments(idCommento) != null){ + createCommentSpan(idCommento, elverso) + } + if(currSentenceId!=null && currSentenceId != sentenceid){ createSpanPeriodiTag(closeSTag, 'c', formaItem[2]-1, currSentenceId, elverso) currSentenceId=null @@ -947,7 +958,97 @@ function resetFrasi(){ } } + + function createCommentSpan(idVerso, elementoverso) { + var spanoccorrenza = $('