From 7a2493277d79322d529b2b56fa942a22bcf0dd83 Mon Sep 17 00:00:00 2001 From: nicola Date: Thu, 16 Nov 2023 19:35:55 +0100 Subject: [PATCH] nuova versione con gli accordi dell'ultimo skype --- js/cesareBrowse.js | 77 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 12 deletions(-) diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index 11810a3..dd5e21e 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -756,6 +756,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«",""); text = text.replace("»",""); + text = text.replaceAll("\n"," "); value["annotazione"] = text; } @@ -764,6 +765,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«",""); text = text.replace("»",""); + text = text.replaceAll("\n"," "); value["verso"] = text; } @@ -772,6 +774,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«",""); text = text.replace("»",""); + text = text.replaceAll("\n"," "); value["commentario"] = text; } @@ -780,6 +783,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«",""); text = text.replace("»",""); + text = text.replaceAll("\n"," "); value["frammentoNota"] = text; } @@ -788,6 +792,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«",""); text = text.replace("»",""); + text = text.replaceAll("\n"," "); value["AutoreCitazione"] = text; } @@ -796,6 +801,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«",""); text = text.replace("»",""); + text = text.replaceAll("\n"," "); value["FonteCitazione"] = text; } @@ -804,6 +810,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«", ""); text = text.replace("»", ""); + text = text.replaceAll("\n"," "); value["NotaFonteCitazione"] = text; } @@ -812,6 +819,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«", ""); text = text.replace("»", ""); + text = text.replaceAll("\n"," "); value["LuogoFonteCitazione"] = text; } @@ -820,6 +828,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«", ""); text = text.replace("»", ""); + text = text.replaceAll("\n"," "); value["TestoFonteCitazione"] = text; } @@ -828,6 +837,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«", ""); text = text.replace("»", ""); + text = text.replaceAll("\n"," "); value["URLFonteCitazione"] = text; } @@ -836,6 +846,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«", ""); text = text.replace("»", ""); + text = text.replaceAll("\n"," "); value["NaturaRiferimento"] = text; } @@ -844,6 +855,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«", ""); text = text.replace("»", ""); + text = text.replaceAll("\n"," "); value["RapportoCommentoCommentatoreText"] = text; } @@ -852,6 +864,7 @@ function resetFrasi(){ text = text.replace(/<(.|\n)*?>/g, ''); text = text.replace("«", ""); text = text.replace("»", ""); + text = text.replaceAll("\n"," "); value["RapportoSoggettoOggetto"] = text; } } @@ -876,25 +889,49 @@ function resetFrasi(){ commentArea.empty() var spanComment = $(''); var id = cid.substr(9); + var nomeAutore = ""; + var titoloFonte = ""; + var luogoFonte = ""; + var commentoCommentatore = []; + var urlCommento = ""; + var esitoCommento = ""; for (var pos in commentsArray){ var comments = commentsArray[pos] if (comments.verso == id){ - console.log(comments) spanComment.append(''+cantica+''+", Canto " + getRoman(parcid[2])+" Verso "+ parcid[3]+"
"); + if (comments.NomeAutoreCitazione == null){ + nomeAutore = 'riferimento'; + } + else{ + nomeAutore = comments.NomeAutoreCitazione; + } if (comments.AutoreCitazione != null){ - spanComment.append('Autore: '+comments.NomeAutoreCitazione+ ', '); - //spanComment.append("Autore: " + comments.AutoreCitazione+"
"); + spanComment.append('Autore: '+nomeAutore+ ', '); + }else{ + spanComment.append('Autore: '+nomeAutore+''); + + } + if(comments.TitoloFonteCitazione == null){ + titoloFonte = "riferimento"; + }else{ + titoloFonte = comments.TitoloFonteCitazione; } if (comments.FonteCitazione != null){ - spanComment.append('Fonte: '+comments.TitoloFonteCitazione +', '); - //spanComment.append("Fonte: " + comments.FonteCitazione+"
"); + spanComment.append('Fonte: '+titoloFonte +', '); + }else{ + spanComment.append('Fonte: '+titoloFonte +''); + + } + if(comments.LuogoFonteCitazione == null){ + luogoFonte = "riferimento"; + }else{ + luogoFonte = comments.LuogoFonteCitazione; } if (comments.URLFonteCitazione != null){ - spanComment.append('URL Fonte, '); - //spanComment.append("URL Fonte: " + comments.URLFonteCitazione+"
"); - } - if (comments.LuogoFonteCitazione != null){ - spanComment.append("Luogo Fonte: " + comments.LuogoFonteCitazione+"
"); + spanComment.append('Luogo Fonte: ' + luogoFonte+',
'); + }else{ + spanComment.append('Luogo Fonte: ' + luogoFonte+'
'); + } if (comments.NaturaRiferimento != null){ spanComment.append("Natura Riferimento: " + comments.NaturaRiferimento+"
"); @@ -906,7 +943,23 @@ function resetFrasi(){ spanComment.append("Rapporto Soggetto/Oggetto: " + comments.RapportoSoggettoOggetto+"
"); } if (comments.RapportoCommentoCommentatoreText != null && comments.RapportoCommentoCommentatoreText != "nan"){ - spanComment.append("Rapporto Commento/Commentatore: " + comments.RapportoCommentoCommentatoreText+"
"); + commentoCommentatore = comments.RapportoCommentoCommentatoreText.split(' '); + urlCommento = commentoCommentatore[1]; + urlCommento = urlCommento.replaceAll('"',""); + urlCommento = urlCommento.replaceAll("'",""); + urlCommento = urlCommento.replaceAll(',',""); + esitoCommento = commentoCommentatore[3]; + esitoCommento = esitoCommento.replaceAll('"',""); + esitoCommento = esitoCommento.replaceAll("'",""); + esitoCommento = esitoCommento.replaceAll('}]',""); + if (esitoCommento == ""){ + esitoCommento = "Rapporto nullo" + } + if(urlCommento == ""){ + spanComment.append('Rapporto Commento/Commentatore: [Commento nullo, '+esitoCommento+']
'); + }else{ + spanComment.append('Rapporto Commento/Commentatore: ['+ "Commento"+', '+esitoCommento+']
'); + } } if (comments.annotazione != null && comments.annotazione != "nan"){ var spanForm = $('
'); @@ -944,10 +997,10 @@ function resetFrasi(){ spanDiv.append(''); spanDiv.append(''); } + spanComment.append('
'); } } spanComment.appendTo(commentArea); - commentArea.append('
'); }) function hasComments(cid){