From a32e09766522ae6036d8b4adcc204ed33e02aa51 Mon Sep 17 00:00:00 2001 From: nicola Date: Thu, 13 Mar 2025 22:24:14 +0100 Subject: [PATCH] Migliorato gestione bottone filtro --- js/browseMgr_5.1.js | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/js/browseMgr_5.1.js b/js/browseMgr_5.1.js index d6ad57d..74213fc 100644 --- a/js/browseMgr_5.1.js +++ b/js/browseMgr_5.1.js @@ -592,24 +592,35 @@ $(document).ready(function() { } } var parcid = cid.split('_') - + var numeroVerso; + var forma; + if (parcid[0].includes('Inferno')) { + forma = formeprima; + numeroVerso = 1; + } + if (parcid[0].includes('Purgatorio')) { + forma = formeseconda; + numeroVerso = 2; + } + if (parcid[0].includes('Paradiso')) { + forma = formeterza; + numeroVerso = 3; + } + if (!(loadedCanti.has(cid))) { - if (parcid[0].includes('Inferno')) - showCanto(formeprima, '1', parcid[1]) - if (parcid[0].includes('Purgatorio')) - showCanto(formeseconda, '2', parcid[1]) - if (parcid[0].includes('Paradiso')) - showCanto(formeterza, '3', parcid[1]) + showCanto(forma, '1', parcid[1]) loadedCanti.add(cid) } - //var versiCommentati = $(".risultato").removeClass("risultato"); for (var tel of telive) { var telId = tel.split("_"); + var commento = "#Commento_"+numeroVerso+"_" + telId[2] + "_" + telId[3]; + //commento = commento+telId[2] + "_" + telId[3]; telId = "#" + telId[0] + telId[1] + "_" + telId[2]; + $(commento).addClass("risultato ") //replace inserito per evitare errori per i dati non corretti - $(telId + " #" + tel.replace('|', '')).addClass("mark risultato") + $(telId + " #" + tel.replace('|', '')).addClass("mark ") } $("#" + $(this).attr('name').replace(" ", "_")).attr('style', 'display: d-flex;') @@ -1647,7 +1658,7 @@ $(document).ready(function() { var telive = getListaRis() for (var ve of telive) { //let idve = ve - $(ve.replace('|', '')).removeClass("mark risultato") + $(ve.replace('|', '')).removeClass("mark ") minim.contents().find(ve.replace('|', '')).removeClass("mark ") } const tmplistaidcomm = getListaIdCommenti()