diff --git a/js/browseMgr_5.1.js b/js/browseMgr_5.1.js index b59a18a..baf8c38 100644 --- a/js/browseMgr_5.1.js +++ b/js/browseMgr_5.1.js @@ -61,6 +61,7 @@ $(document).ready(function() { /*var commentsArray = [] var commentsJson = {}*/ var commentsSQL = {} + var resultcommentsSQL = {} /*var resultSentences = new Set()*/ const cantiche = ["Inferno", "Purgatorio", "Paradiso"] var loadedCanti = new Set(); @@ -581,7 +582,7 @@ $(document).ready(function() { const cid = $(this).attr('name').replace(" ", "_"); var telive = getListaRis() cantoDisplayed = "#" + cid; - + if (telive.length > 0) { @@ -606,16 +607,16 @@ $(document).ready(function() { forma = formeterza; numeroCantica = 3; } - + if (!(loadedCanti.has(cid))) { showCanto(forma, '1', parcid[1]) loadedCanti.add(cid) } - + for (var tel of telive) { var telId = tel.split("_"); - var commento = "#Commento_"+numeroCantica+"_" + telId[2] + "_" + telId[3]; + var commento = "#Commento_" + numeroCantica + "_" + telId[2] + "_" + telId[3]; telId = "#" + telId[0] + telId[1] + "_" + telId[2]; $(commento).addClass("risultato ") $(telId + " #" + tel.replace('|', '')).addClass("mark ") @@ -1022,7 +1023,12 @@ $(document).ready(function() { } } var noteAdded; + jQuery(document).delegate(' .showcomments', 'click', function() { + if (cantoDisplayed.includes('#vistaFrasi')) { + showCommentsInResult($(this).attr('id'), $(this).attr('class')) + return + } var cid = $(this).attr('id'); var queryComment = false; var idClass = $(this).attr('class'); @@ -1129,6 +1135,35 @@ $(document).ready(function() { }) + function showCommentsInResult(tmpcid, tmpclass) { + var queryComment = false; + var myid=tmpcid.split('_') + //var parentClass = $(this).parent().attr('class'); + filterOn = true; + + if (tmpclass.includes("filterRiferimentiOn")) { + filterOn = true; + } else { + if (tmpclass.includes("filterRiferimentiOff")) { + filterOn = false; + } + } + var tmpresu = getRisultatiRiferimenti() + + var resultComments = Object.groupBy(tmpresu, ({ Cantica }) => Cantica); + + var tcantica='Inferno' + if (myid=='2') + tcantica='Purgatorio' + if (myid=='3') + tcantica='Paradiso' + if (! tcantica in resultComments) + return + var tmpCanti=resultComments[tcantica] + var cantiComments=Object.groupBy(tmpresu, ({ Canto }) => Canto); + + } + function createNoteGroup(cantica, canto, versi, id, len, queryComment) { var noteGroupCard = $('