diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index eb1ca4f..407ee43 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -910,6 +910,9 @@ function resetFrasi(){ var commentoCommentatore = []; var urlCommento = ""; var esitoCommento = ""; + var position = 0; + var autoreCommento = ""; + for (var pos in commentsArray){ var comments = commentsArray[pos] if (comments.verso == id){ @@ -958,22 +961,31 @@ function resetFrasi(){ spanComment.append("Rapporto Soggetto/Oggetto: " + comments.RapportoSoggettoOggetto+"
"); } if (comments.RapportoCommentoCommentatoreText != null && comments.RapportoCommentoCommentatoreText != "nan"){ - commentoCommentatore = comments.RapportoCommentoCommentatoreText.split(' '); - urlCommento = commentoCommentatore[1]; - urlCommento = urlCommento.replaceAll('"',""); + commentoCommentatore = comments.RapportoCommentoCommentatoreText.split(','); + urlCommento = commentoCommentatore[0]; + position = urlCommento.indexOf("https"); + urlCommento = urlCommento.substring(position) + //urlCommento = urlCommento.replaceAll("'",""); urlCommento = urlCommento.replaceAll("'",""); - urlCommento = urlCommento.replaceAll(',',""); + //urlCommento = urlCommento.replaceAll(',',""); esitoCommento = commentoCommentatore[3]; - esitoCommento = esitoCommento.replaceAll('"',""); + esitoCommento = esitoCommento.replace("'Rapporto': ","") + //esitoCommento = esitoCommento.replaceAll('"',""); esitoCommento = esitoCommento.replaceAll("'",""); - esitoCommento = esitoCommento.replaceAll('}]',""); + esitoCommento = esitoCommento.replaceAll('}',""); + autoreCommento = commentoCommentatore[1]; + autoreCommento = autoreCommento.replace(" 'Autore':","") + autoreCommento = autoreCommento.replaceAll("'",""); + if (autoreCommento == ""){ + autoreCommento = "Commento" + } if (esitoCommento == ""){ esitoCommento = "Rapporto nullo" } if(urlCommento == ""){ spanComment.append('Rapporto Commento/Commentatore: [Commento nullo, '+esitoCommento+']
'); }else{ - spanComment.append('Rapporto Commento/Commentatore: ['+ "Commento"+', '+esitoCommento+']
'); + spanComment.append('Rapporto Commento/Commentatore: ['+ autoreCommento +', '+esitoCommento+']
'); } } if (comments.annotazione != null && comments.annotazione != "nan"){ @@ -984,7 +996,7 @@ function resetFrasi(){ spanForm.append(spanDiv); spanDiv.append(''); spanDiv.append(''); - } + if (comments.frammentoNota != null && comments.frammentoNota != "nan"){ var spanForm = $('
'); spanComment.append(spanForm); @@ -1013,9 +1025,11 @@ function resetFrasi(){ spanDiv.append(''); } } + spanComment.append('
'); + + } } spanComment.appendTo(commentArea); - commentArea.append('
'); $('#tab-list #vis0-tab').tab('show') }) @@ -1553,14 +1567,12 @@ function resetFrasi(){ //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]) + if (resClauses.filter(clocc => clocc==tmpocc[0]).length==0) { + resClauses.push(tmpocc[0]); + resSent.add(fraseItems[0] + '-' + fraseItems[3]); //resSent.add(fraseItems.slice(-1)) resultsInCantica.push(fraseItems[4]); - resultsInCanto.push(fraseItems[4] + fraseItems[5]) - + resultsInCanto.push(fraseItems[4] + fraseItems[5]); } } listaClausoleRisultato=Array.from(resSent)