diff --git a/index_4.4_test.html b/index_4.4_test.html index 6cb733b..b909920 100644 --- a/index_4.4_test.html +++ b/index_4.4_test.html @@ -482,36 +482,35 @@
-
+
-
- -
-
+
+
+
Inferno, Canto I Verso 1 - Dante Alighieri, Convivio IV, xxiii, 9-11
- - - - - + + + +
-
-
+
+
+
@@ -561,14 +560,9 @@
- - -
- - -
- -
+
+
+
Visualizza struttura periodo diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index 407ee43..08a9f5e 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -900,138 +900,166 @@ function resetFrasi(){ case "3": cantica = "Paradiso"; } - var commentArea = $('#displaynote'); + var commentArea = $('#CardCommenti'); commentArea.empty() - var spanComment = $(''); - var id = cid.substr(9); - var nomeAutore = ""; - var titoloFonte = ""; - var luogoFonte = ""; - var commentoCommentatore = []; - var urlCommento = ""; - var esitoCommento = ""; - var position = 0; - var autoreCommento = ""; - + var id = cid.substr(9); + var collapseNote; + var claBody = $('
'); + for (var pos in commentsArray){ var comments = commentsArray[pos] if (comments.verso == id){ - 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: '+nomeAutore+ ', '); - }else{ - spanComment.append('Autore: '+nomeAutore+''); - - } - if(comments.TitoloFonteCitazione == null){ - titoloFonte = "riferimento"; - }else{ - titoloFonte = comments.TitoloFonteCitazione; - } - if (comments.FonteCitazione != null){ - 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('Luogo Fonte: ' + luogoFonte+',
'); - }else{ - spanComment.append('Luogo Fonte: ' + luogoFonte+'
'); - + createNoteHeader(commentArea, comments, id, cantica, parcid); + collapseNote = $('
'); + collapseNote.append(claBody); + + if (comments.TestoFonteCitazione != null && comments.TestoFonteCitazione != "nan"){ + createModule(commentArea,"Testo della fonte: ", comments.TestoFonteCitazione, "1", id) } if (comments.NaturaRiferimento != null){ - spanComment.append("Natura Riferimento: " + comments.NaturaRiferimento+"
"); + createModule(commentArea,"Tipo Riferimento: ", comments.NaturaRiferimento, "2", id) } if (comments.commentario != null){ - spanComment.append("Commentario: " + comments.commentario+"
"); + createModule(commentArea,"Commentatore: ", comments.commentario, "3", id) } if (comments.RapportoSoggettoOggetto != null){ - spanComment.append("Rapporto Soggetto/Oggetto: " + comments.RapportoSoggettoOggetto+"
"); + createModule(commentArea,"Rapporto Testo/Fonte: ", comments.RapportoSoggettoOggetto, "4", id) } if (comments.RapportoCommentoCommentatoreText != null && comments.RapportoCommentoCommentatoreText != "nan"){ - commentoCommentatore = comments.RapportoCommentoCommentatoreText.split(','); - urlCommento = commentoCommentatore[0]; - position = urlCommento.indexOf("https"); - urlCommento = urlCommento.substring(position) - //urlCommento = urlCommento.replaceAll("'",""); - urlCommento = urlCommento.replaceAll("'",""); - //urlCommento = urlCommento.replaceAll(',',""); - esitoCommento = commentoCommentatore[3]; - esitoCommento = esitoCommento.replace("'Rapporto': ","") - //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: ['+ autoreCommento +', '+esitoCommento+']
'); - } + createModuleCommentatore (commentArea, comments.RapportoCommentoCommentatoreText, "5", id) } + if (comments.annotazione != null && comments.annotazione != "nan"){ - var spanForm = $('
'); - spanComment.append(spanForm); - var spanDiv = $('
'); - spanDiv.attr('class', ' form-group pt-2'); - spanForm.append(spanDiv); - spanDiv.append(''); - spanDiv.append(''); - + createModule(commentArea,"Annotazione: ", comments.annotazione, "6", id) + } if (comments.frammentoNota != null && comments.frammentoNota != "nan"){ - var spanForm = $(''); - spanComment.append(spanForm); - var spanDiv = $('
'); - spanDiv.attr('class', ' form-group'); - spanForm.append(spanDiv); - spanDiv.append(''); - spanDiv.append(''); - } - if (comments.TestoFonteCitazione != null && comments.TestoFonteCitazione != "nan"){ - var spanForm = $(''); - spanComment.append(spanForm); - var spanDiv = $('
'); - spanDiv.attr('class', ' form-group'); - spanForm.append(spanDiv); - spanDiv.append(''); - spanDiv.append(''); + createModule(commentArea,"Nota: ", comments.frammentoNota, "7", id) } + if (comments.NotaFonteCitazione != null && comments.NotaFonteCitazione != "nan" && comments.NotaFonteCitazione != ""){ - var spanForm = $(''); - spanComment.append(spanForm); - var spanDiv = $('
'); - spanDiv.attr('class', ' form-group'); - spanForm.append(spanDiv); - spanDiv.append(''); - spanDiv.append(''); + createModule(commentArea,"Nota dell'annotatore: ", comments.NotaFonteCitazione, "8", id) } - } - spanComment.append('
'); - + commentArea.append('
'); } } - spanComment.appendTo(commentArea); $('#tab-list #vis0-tab').tab('show') }) + + function createNoteHeader(headerDiv, comments, id, cantica, parcid){ + var nomeAutore = ""; + var titoloFonte = ""; + var luogoFonte = ""; + var commentHeader = $('
') + var rigaNota = $('
'); + var spanButtons = $(''); + var buttons = $('
') + var collapseButton = $('