gestione risultati rif
This commit is contained in:
parent
ac219522cd
commit
cd0ed513dd
|
@ -583,6 +583,7 @@ $(document).ready(function() {
|
||||||
cantoDisplayed = "#" + cid;
|
cantoDisplayed = "#" + cid;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (telive.length > 0) {
|
if (telive.length > 0) {
|
||||||
initCitazioni()
|
initCitazioni()
|
||||||
} else {
|
} else {
|
||||||
|
@ -605,9 +606,9 @@ $(document).ready(function() {
|
||||||
//var telive = getListaRis()
|
//var telive = getListaRis()
|
||||||
for (var tel of telive) {
|
for (var tel of telive) {
|
||||||
var telId = tel.split("_");
|
var telId = tel.split("_");
|
||||||
telId = "#"+telId[0]+telId[1]+"_"+telId[2];
|
telId = "#" + telId[0] + telId[1] + "_" + telId[2];
|
||||||
//replace inserito per evitare errori per i dati non corretti
|
//replace inserito per evitare errori per i dati non corretti
|
||||||
$(telId+" #"+tel.replace('|', '')).addClass("mark ")
|
$(telId + " #" + tel.replace('|', '')).addClass("mark ")
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#" + $(this).attr('name').replace(" ", "_")).attr('style', 'display: d-flex;')
|
$("#" + $(this).attr('name').replace(" ", "_")).attr('style', 'display: d-flex;')
|
||||||
|
@ -933,7 +934,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
/*INIZIO GESTIONE CITAZIONI*/
|
/*INIZIO GESTIONE CITAZIONI*/
|
||||||
|
|
||||||
async function initCitazioni( cantoCitazione = cantoDisplayed) {
|
async function initCitazioni(cantoCitazione = cantoDisplayed) {
|
||||||
//"#InfernoCanto_1"
|
//"#InfernoCanto_1"
|
||||||
var idcantica = '1'
|
var idcantica = '1'
|
||||||
var mcanto = cantoCitazione.replace("#", '')
|
var mcanto = cantoCitazione.replace("#", '')
|
||||||
|
@ -1016,9 +1017,6 @@ $(document).ready(function() {
|
||||||
var queryComment = false;
|
var queryComment = false;
|
||||||
var idClass = $(this).attr('class');
|
var idClass = $(this).attr('class');
|
||||||
var parentClass = $(this).parent().attr('class');
|
var parentClass = $(this).parent().attr('class');
|
||||||
if(cid.includes("Proemio")){
|
|
||||||
parentClass = "mark";
|
|
||||||
}
|
|
||||||
filterOn = true;
|
filterOn = true;
|
||||||
|
|
||||||
if (idClass.includes("filterRiferimentiOn")) {
|
if (idClass.includes("filterRiferimentiOn")) {
|
||||||
|
@ -1031,12 +1029,12 @@ $(document).ready(function() {
|
||||||
if (!hasCommentsJson(cid)) {
|
if (!hasCommentsJson(cid)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (getListaIdCommenti().length>0) {
|
if (getListaIdCommenti().length > 0) {
|
||||||
if (filterOn) {
|
if (filterOn) {
|
||||||
if (parentClass.includes("mark")){
|
if (parentClass.includes("mark")) {
|
||||||
$(".filterRiferimentiOn").css('display', 'inline-block');
|
$(".filterRiferimentiOn").css('display', 'inline-block');
|
||||||
$(".filterRiferimentiOff").css('display', 'none');
|
$(".filterRiferimentiOff").css('display', 'none');
|
||||||
}else{
|
} else {
|
||||||
$(".filterRiferimentiOn").css('display', 'none');
|
$(".filterRiferimentiOn").css('display', 'none');
|
||||||
$(".filterRiferimentiOff").css('display', 'none');
|
$(".filterRiferimentiOff").css('display', 'none');
|
||||||
}
|
}
|
||||||
|
@ -1060,9 +1058,9 @@ $(document).ready(function() {
|
||||||
case "3": cantica = "Paradiso";
|
case "3": cantica = "Paradiso";
|
||||||
}
|
}
|
||||||
var commentArea = $('#displaynote');
|
var commentArea = $('#displaynote');
|
||||||
var idCommento = "CommentoQuery_"+parcid[1]+"_"+parcid[2]+"_"+parcid[3];
|
var idCommento = "CommentoQuery_" + parcid[1] + "_" + parcid[2] + "_" + parcid[3];
|
||||||
$(".filterRiferimentiOn").attr("id",idCommento)
|
$(".filterRiferimentiOn").attr("id", idCommento)
|
||||||
$(".filterRiferimentiOff").attr("id",idCommento)
|
$(".filterRiferimentiOff").attr("id", idCommento)
|
||||||
|
|
||||||
if (parcid[0] == "CommentoQuery") { // verificare
|
if (parcid[0] == "CommentoQuery") { // verificare
|
||||||
queryComment = true;
|
queryComment = true;
|
||||||
|
@ -1107,7 +1105,7 @@ $(document).ready(function() {
|
||||||
$(".filterRiferimentiOn").css('display', 'inline-block');
|
$(".filterRiferimentiOn").css('display', 'inline-block');
|
||||||
$(".filterRiferimentiOff").css('display', 'none');
|
$(".filterRiferimentiOff").css('display', 'none');
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
if (k.includes("-") && !filterOn) {
|
if (k.includes("-") && !filterOn) {
|
||||||
commentArea.append(currentGroup);
|
commentArea.append(currentGroup);
|
||||||
}
|
}
|
||||||
|
@ -1149,7 +1147,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
var toTitleCase = str => str.replace(/(^\w|\s\w)(\S*)/g, (_, m1, m2) => m1.toUpperCase() + m2.toLowerCase())
|
var toTitleCase = str => str.replace(/(^\w|\s\w)(\S*)/g, (_, m1, m2) => m1.toUpperCase() + m2.toLowerCase())
|
||||||
|
|
||||||
function isCommentInResult(idComment){
|
function isCommentInResult(idComment) {
|
||||||
const tmplistaidcomm = getListaIdCommenti()
|
const tmplistaidcomm = getListaIdCommenti()
|
||||||
if (tmplistaidcomm.length && tmplistaidcomm.includes(idComment)) {
|
if (tmplistaidcomm.length && tmplistaidcomm.includes(idComment)) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -1167,9 +1165,9 @@ $(document).ready(function() {
|
||||||
else {
|
else {
|
||||||
var noteCard = $('<div class="card card-body well well-sm mx-1 mb-1 mt-0 p-0 border-lida08" id="noteCard' + id + '_' + pos + '"' + ' name= "' + idref + '">');
|
var noteCard = $('<div class="card card-body well well-sm mx-1 mb-1 mt-0 p-0 border-lida08" id="noteCard' + id + '_' + pos + '"' + ' name= "' + idref + '">');
|
||||||
if (queryComment) {
|
if (queryComment) {
|
||||||
if(filterOn){
|
if (filterOn) {
|
||||||
noteCard.css("display", "none");
|
noteCard.css("display", "none");
|
||||||
}else{
|
} else {
|
||||||
noteCard.css("display", "inline-block");
|
noteCard.css("display", "inline-block");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1517,9 +1515,9 @@ $(document).ready(function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var ile=-1
|
var ile = -1
|
||||||
for (var detail of details) {
|
for (var detail of details) {
|
||||||
ile+=1
|
ile += 1
|
||||||
myitems = detail.split(',');
|
myitems = detail.split(',');
|
||||||
|
|
||||||
catgramm = '<div class="ttContent">';
|
catgramm = '<div class="ttContent">';
|
||||||
|
@ -1649,7 +1647,7 @@ $(document).ready(function() {
|
||||||
for (var ve of telive) {
|
for (var ve of telive) {
|
||||||
//let idve = ve
|
//let idve = ve
|
||||||
$(ve.replace('|', '')).removeClass("mark ")
|
$(ve.replace('|', '')).removeClass("mark ")
|
||||||
minim.contents().find(ve).removeClass("mark ")
|
minim.contents().find(ve.replace('|', '')).removeClass("mark ")
|
||||||
}
|
}
|
||||||
const tmplistaidcomm = getListaIdCommenti()
|
const tmplistaidcomm = getListaIdCommenti()
|
||||||
for (var idco of tmplistaidcomm) {
|
for (var idco of tmplistaidcomm) {
|
||||||
|
@ -1786,7 +1784,7 @@ $(document).ready(function() {
|
||||||
managePage();
|
managePage();
|
||||||
$("#loader").fadeOut(300);
|
$("#loader").fadeOut(300);
|
||||||
//$("#cantica0").trigger("click");
|
//$("#cantica0").trigger("click");
|
||||||
}else{
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!filterBottonAdded) {
|
if (!filterBottonAdded) {
|
||||||
|
@ -1827,9 +1825,8 @@ $(document).ready(function() {
|
||||||
var idFrase = 0;
|
var idFrase = 0;
|
||||||
var cid;
|
var cid;
|
||||||
var numCantica;
|
var numCantica;
|
||||||
var ultimoCanto;
|
var ultimoVersoPrecedente;
|
||||||
var ultimoVerso;
|
var numeroRisultato = 0;
|
||||||
|
|
||||||
elencoRiferimenti = $("#vistaFrasi");
|
elencoRiferimenti = $("#vistaFrasi");
|
||||||
elencoRiferimenti.empty();
|
elencoRiferimenti.empty();
|
||||||
$("#displaynote").empty();
|
$("#displaynote").empty();
|
||||||
|
@ -1844,10 +1841,105 @@ $(document).ready(function() {
|
||||||
$("#vistaFrasi").attr('style', 'display: d-flex;');
|
$("#vistaFrasi").attr('style', 'display: d-flex;');
|
||||||
cantoDisplayed = "#vistaFrasi";
|
cantoDisplayed = "#vistaFrasi";
|
||||||
}
|
}
|
||||||
var risLen = listaRisultatiCommenti.length;
|
|
||||||
for (var j = start; j < start+offset && j< risLen; j++) {
|
var uniq_res = [...new Set(listaRisultatiCommenti)];
|
||||||
commentoRisultato = listaRisultatiCommenti[j].split("_")
|
var risLen = uniq_res.length;
|
||||||
|
var risultato=''
|
||||||
|
var setVersicontesto = new Set()
|
||||||
|
for (var j = start; j < start + offset && j < risLen; j++) {
|
||||||
|
numeroRisultato++
|
||||||
|
commentoRisultato = uniq_res[j].replace('#','').split("_")
|
||||||
|
risultato=uniq_res[j]
|
||||||
|
|
||||||
|
|
||||||
|
var cre = getVersoContext(commentoRisultato, 3)
|
||||||
|
console.log(cre)
|
||||||
|
|
||||||
|
var divVerso = ''
|
||||||
|
var elementoversospan=''
|
||||||
|
var numeroCantica = 0
|
||||||
|
var canto = 0
|
||||||
|
var versiIniziali = $('<div class="versiFrase mt-3" />')
|
||||||
var listaVersi = $('<ol class="pt-3" />')
|
var listaVersi = $('<ol class="pt-3" />')
|
||||||
|
|
||||||
|
listaVersi.attr('id', "Frase" + numeroRisultato);
|
||||||
|
versiIniziali.attr('id', "versiFrase" + numeroRisultato);
|
||||||
|
if(commentoRisultato[3]!='Proemio'){
|
||||||
|
var numeroVersi = 0;
|
||||||
|
|
||||||
|
for (var forma of cre) {
|
||||||
|
if (setVersicontesto.size == 0) {
|
||||||
|
numeroCantica = forma.cantica
|
||||||
|
canto = forma.canto
|
||||||
|
}
|
||||||
|
if (!setVersicontesto.has(forma.cantica+'_'+forma.canto+'_'+forma.verso)) {
|
||||||
|
divVerso = createDivVersoGenericLi(forma.cantica, forma.verso+'_res', 'Canto_'+forma.canto)
|
||||||
|
elementoversospan = $('<span />')
|
||||||
|
elementoversospan.attr('id', forma.cantica + "_" + 'Canto_'+forma.canto + "_" + forma.verso + '_sp_res')
|
||||||
|
divVerso.append(elementoversospan)
|
||||||
|
versiIniziali.append(divVerso)
|
||||||
|
listaVersi.append(versiIniziali)
|
||||||
|
elencoRiferimenti.append(listaVersi)
|
||||||
|
setVersicontesto.add(forma.cantica+'_'+forma.canto+'_'+forma.verso)
|
||||||
|
numeroVersi++;
|
||||||
|
}
|
||||||
|
|
||||||
|
createSpanFormeNew(forma.testo, forma.catg, 'e' + forma.posizione, forma.periodo, forma.funzperiodo, elementoversospan)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
divVerso = createDivVersoGenericLi(commentoRisultato[0], '0_res', 'Canto_'+commentoRisultato[2])
|
||||||
|
elementoversospan = $('<span />')
|
||||||
|
elementoversospan.attr('id', commentoRisultato[0] + "_" + 'Canto_'+commentoRisultato[2] + '_0_sp_res')
|
||||||
|
divVerso.append(elementoversospan)
|
||||||
|
versiIniziali.append(divVerso)
|
||||||
|
listaVersi.append(versiIniziali)
|
||||||
|
elencoRiferimenti.append(listaVersi)
|
||||||
|
setVersicontesto.add(commentoRisultato[0]+'P')
|
||||||
|
numeroVersi++;
|
||||||
|
createSpanFormeNew('Proemio', '* ', 'e0', '*', '*', elementoversospan)
|
||||||
|
}
|
||||||
|
var comandi = $('<div class=" comandi col flex-nowrap d-inline justify-content-between pl-1 pb-2 ml-2 mb-2 border-bottom"/>')
|
||||||
|
comandi.attr('id', "comandiFrase" + numeroRisultato)
|
||||||
|
var comandiGrp = $('<div />')
|
||||||
|
comandiGrp.attr('class', 'btn-group flex-nowrap d-inline pr-3 mt-1 mr-3 align-text-bottom');
|
||||||
|
comandiGrp.attr('role', "group")
|
||||||
|
|
||||||
|
|
||||||
|
//BOTTONE ESPANSIONE MODIFICARE
|
||||||
|
var spanBadgeExpand = $('<button class="btn btn-sm btn-outline-primary espandiFrase px-1 pt-1 pb-0"/>');
|
||||||
|
var expandIcon = '<ion-icon name="expand-outline"></ion-icon>';
|
||||||
|
var spanBadgeReduce = $('<button class="btn btn-sm btn-outline-secondary riduciFrase px-1 pt-1 pb-0 ml-1 disabled"/>');
|
||||||
|
var reduceIcon = '<ion-icon name="contract-outline"></ion-icon>';
|
||||||
|
var ctxpivot=1
|
||||||
|
|
||||||
|
spanBadgeExpand.attr('id', commentoRisultato[0] + "Canto_ex_" + commentoRisultato[2] + "_" + ctxpivot + "_" + numeroRisultato);
|
||||||
|
spanBadgeExpand.append(expandIcon);
|
||||||
|
|
||||||
|
spanBadgeReduce.attr('id', commentoRisultato[0] + "Canto_er_" + commentoRisultato[2] + "_" + ctxpivot + "_" + numeroRisultato);
|
||||||
|
spanBadgeReduce.append(reduceIcon)
|
||||||
|
|
||||||
|
spanBadgeExpand.appendTo(comandiGrp);
|
||||||
|
spanBadgeReduce.appendTo(comandiGrp);
|
||||||
|
|
||||||
|
comandiGrp.appendTo(comandi);
|
||||||
|
|
||||||
|
var citazioneDiv = $('<div class=" text-right flex-nowrap d-inline ml-3 px-3 py-0"/>')
|
||||||
|
|
||||||
|
var citazione = $('<span class= " pl-3 citazioneFrase align-text-top"/>')
|
||||||
|
citazione.append("[" + commentoRisultato[0] + ", Canto " + commentoRisultato[2] + "]")
|
||||||
|
citazione.attr('name', commentoRisultato[0] + "Canto " + commentoRisultato[2]);
|
||||||
|
citazione.attr('id', idCitazione + '_' + numeroRisultato + '_' + risultato);
|
||||||
|
citazione.appendTo(citazioneDiv);
|
||||||
|
|
||||||
|
citazioneDiv.appendTo(comandi);
|
||||||
|
|
||||||
|
comandi.appendTo(elencoRiferimenti);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*var listaVersi = $('<ol class="pt-3" />')
|
||||||
idFrase++;
|
idFrase++;
|
||||||
listaVersi.attr('id', "Frase" + idFrase);
|
listaVersi.attr('id', "Frase" + idFrase);
|
||||||
var versiFrase = $('<div class="versiFrase mt-3" />')
|
var versiFrase = $('<div class="versiFrase mt-3" />')
|
||||||
|
@ -1874,19 +1966,19 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(loadedCanti.has(cid))) {
|
if (!(loadedCanti.has(cid))) {
|
||||||
loadCommentsBottons(cid,formeCanto, numCantica, canto)
|
//loadCommentsBottons(cid,formeCanto, numCantica, canto)
|
||||||
|
showCanto(formeCanto, numCantica, canto)
|
||||||
loadedCanti.add(cid)
|
loadedCanti.add(cid)
|
||||||
}
|
}
|
||||||
|
|
||||||
verso = commentoRisultato[3];
|
verso = commentoRisultato[3];
|
||||||
if (verso == "Proemio"){
|
if (verso == "Proemio"){
|
||||||
var proemio = $("#Titolo"+cantica + "Canto_" + canto ).clone()
|
var proemio = $("#Titolo"+cantica + "Canto_" + canto ).clone()
|
||||||
proemio.attr("id","#Titolo" + cantica + '_Canto_' + canto +"_VF")
|
|
||||||
versiFrase.append("Proemio ")
|
versiFrase.append("Proemio ")
|
||||||
versiFrase.append(proemio)
|
versiFrase.append(proemio)
|
||||||
} else {
|
} else {
|
||||||
verso = Number(verso);
|
verso = Number(verso);
|
||||||
if (canto <= ultimoCanto && verso <= ultimoVerso) {
|
if (verso <= ultimoVersoPrecedente) {
|
||||||
$("#" + cantica + '_Canto_' + canto + '_' + verso).addClass("mark ")
|
$("#" + cantica + '_Canto_' + canto + '_' + verso).addClass("mark ")
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1896,12 +1988,11 @@ $(document).ready(function() {
|
||||||
|
|
||||||
for (var num = 0; num<versiPerGruppo; num++){
|
for (var num = 0; num<versiPerGruppo; num++){
|
||||||
var liVerso = $("#" + cantica + '_Canto_' + canto + '_' + verso).clone()
|
var liVerso = $("#" + cantica + '_Canto_' + canto + '_' + verso).clone()
|
||||||
liVerso.attr("id","#" + cantica + '_Canto_' + canto + '_' + verso+"_VF")
|
|
||||||
versiFrase.append(liVerso)
|
versiFrase.append(liVerso)
|
||||||
verso++
|
verso++
|
||||||
}
|
}
|
||||||
ultimoVerso = verso-1;
|
|
||||||
ultimoCanto = canto;
|
ultimoVersoPrecedente = verso;
|
||||||
|
|
||||||
listaVersi.append(versiFrase)
|
listaVersi.append(versiFrase)
|
||||||
elencoRiferimenti.append(listaVersi)
|
elencoRiferimenti.append(listaVersi)
|
||||||
|
@ -1912,19 +2003,43 @@ $(document).ready(function() {
|
||||||
citazione.attr('name', cantica + "Canto " + canto);
|
citazione.attr('name', cantica + "Canto " + canto);
|
||||||
citazione.attr('id', idCitazione + '_' + numCantica + '_' + (verso-versiPerGruppo));
|
citazione.attr('id', idCitazione + '_' + numCantica + '_' + (verso-versiPerGruppo));
|
||||||
citazione.appendTo(citazioneDiv);
|
citazione.appendTo(citazioneDiv);
|
||||||
citazioneDiv.appendTo(elencoRiferimenti)
|
citazioneDiv.appendTo(elencoRiferimenti)*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ottimizzare
|
||||||
|
for (var tres of uniq_res){
|
||||||
|
if (tres.includes('Proemio'))
|
||||||
|
tres=tres.replace('Proemio','0')
|
||||||
|
$('#' + tres+'_res').addClass("mark ")
|
||||||
|
var tresa=tres.split('_')
|
||||||
|
var tcantica='1'
|
||||||
|
if (tresa[0]=='Purgatorio')
|
||||||
|
tcantica='2'
|
||||||
|
if (tresa[0]=='Paradiso')
|
||||||
|
tcantica='3'
|
||||||
|
var tverso= tresa[3]
|
||||||
|
if (tverso=='0')
|
||||||
|
tverso='Proemio'
|
||||||
|
var idCommento = "CommentoRes_" + tcantica + "_" + tresa[2] + '_'+tverso;
|
||||||
|
var pio = $("#" + idCommento )
|
||||||
|
if (pio.length)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var elverso = $("#" + tresa[0]+'_Canto_'+tresa[2] + '_'+tresa[3]+'_res')
|
||||||
|
createCommentSpan(idCommento, elverso, 1)
|
||||||
|
}
|
||||||
|
drawMinimap('#vistaFrasi', false)
|
||||||
showingComments = true;
|
showingComments = true;
|
||||||
|
|
||||||
return verso;
|
return verso;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadCommentsBottons(cid, formeCanto, numCantica, canto) {
|
async function loadCommentsBottons(cid, formeCanto, numCantica, canto) {
|
||||||
showCanto(formeCanto, numCantica, canto)
|
|
||||||
await initCitazioni(cid)
|
await initCitazioni(cid)
|
||||||
//drawMinimap(cid, false)
|
showCanto(formeCanto, numCantica, canto)
|
||||||
addFormaListenersInCanto(cid);
|
drawMinimap(cid, false)
|
||||||
|
addFormaListenersInCanto();
|
||||||
}
|
}
|
||||||
function executeLocalSearch(testo, forme, limit, cantica, cont, resultsInCantica, resultsInCanto) {
|
function executeLocalSearch(testo, forme, limit, cantica, cont, resultsInCantica, resultsInCanto) {
|
||||||
|
|
||||||
|
@ -2203,6 +2318,7 @@ $(document).ready(function() {
|
||||||
var elementoverso = $('<li />')
|
var elementoverso = $('<li />')
|
||||||
/*var elementoversospan=$('<span />')*/
|
/*var elementoversospan=$('<span />')*/
|
||||||
//elementoverso.append(spannum)
|
//elementoverso.append(spannum)
|
||||||
|
|
||||||
elementoverso.attr("value", num)
|
elementoverso.attr("value", num)
|
||||||
|
|
||||||
//elementoverso.attr("style", "line-height: 1.0em")
|
//elementoverso.attr("style", "line-height: 1.0em")
|
||||||
|
|
|
@ -42,7 +42,7 @@ const conn = await db.connect();
|
||||||
// SELECT * FROM "https://lida.dantenetwork.it/js/data/com.parquet";
|
// SELECT * FROM "https://lida.dantenetwork.it/js/data/com.parquet";
|
||||||
await conn.query(`
|
await conn.query(`
|
||||||
CREATE TABLE riferimenti AS
|
CREATE TABLE riferimenti AS
|
||||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/riferimenti_6.parquet";
|
SELECT * FROM "https://lida.dantenetwork.it/js/data/riferimenti_7.parquet";
|
||||||
|
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
@ -134,9 +134,9 @@ export async function getVersiConCitazioni(canticapar = '', cantopar = '') {
|
||||||
RCC as RapportoCommentoCommentatoreText, RSO as RapportoSoggettoOggetto,
|
RCC as RapportoCommentoCommentatoreText, RSO as RapportoSoggettoOggetto,
|
||||||
Aut as NomeAutoreCitazione, TiFo as TitoloFonteCitazione, Verso as VersoCitazione, CA as AreaTematica,
|
Aut as NomeAutoreCitazione, TiFo as TitoloFonteCitazione, Verso as VersoCitazione, CA as AreaTematica,
|
||||||
TiCi as TipoCitazione, CEP as CitEpisodi, CIM as CitImmagini, CTE as CitTeorie,
|
TiCi as TipoCitazione, CEP as CitEpisodi, CIM as CitImmagini, CTE as CitTeorie,
|
||||||
CMO as CitMotivi, CST as CitStilemi, CTO as CitTopografie, CPER as CitPersonaggi, IdRiferimento as Id
|
CMO as CitMotivi, CST as CitStilemi, CTO as CitTopografie, CPER as CitPersonaggi, IdRiferimento as Id, n1, n2, n3
|
||||||
from riferimenti
|
from riferimenti
|
||||||
where Cantica='${canticapar}' and Canto='${cantopar}' order by verso;
|
where Cantica='${canticapar}' and Canto='${cantopar}' order by n1, n2, n3;
|
||||||
`);
|
`);
|
||||||
|
|
||||||
var result4 = table.toArray().map((row) => row.toJSON());
|
var result4 = table.toArray().map((row) => row.toJSON());
|
||||||
|
@ -146,6 +146,34 @@ export async function getVersiConCitazioni(canticapar = '', cantopar = '') {
|
||||||
return result4
|
return result4
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getCitazioniVerso(canticapar = '', cantopar = '', versopar='') {
|
||||||
|
|
||||||
|
//let citcantiche = ['Inferno', 'Purgatorio', 'Paradiso']
|
||||||
|
if (canticapar == '') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const tconn = await db.connect();
|
||||||
|
var table = await tconn.query(`
|
||||||
|
select Ann as Annotazione, Com as Commentario, FrN as frammentoNota, AC as AutoreCitazione,
|
||||||
|
F as FonteCitazione, LF as LuogoFonteCitazione, NF as NotaFonteCitazione,
|
||||||
|
TF as TestoFonteCitazione, UF as URLFonteCitazione, NaRi as NaturaRiferimento,
|
||||||
|
RCC as RapportoCommentoCommentatoreText, RSO as RapportoSoggettoOggetto,
|
||||||
|
Aut as NomeAutoreCitazione, TiFo as TitoloFonteCitazione, Verso as VersoCitazione, CA as AreaTematica,
|
||||||
|
TiCi as TipoCitazione, CEP as CitEpisodi, CIM as CitImmagini, CTE as CitTeorie,
|
||||||
|
CMO as CitMotivi, CST as CitStilemi, CTO as CitTopografie, CPER as CitPersonaggi, IdRiferimento as Id, n1, n2, n3
|
||||||
|
from riferimenti
|
||||||
|
where Cantica='${canticapar}' and Canto='${cantopar}' and Verso={versopar} order by n1, n2, n3;
|
||||||
|
`);
|
||||||
|
|
||||||
|
var result4 = table.toArray().map((row) => row.toJSON());
|
||||||
|
|
||||||
|
|
||||||
|
await tconn.close();
|
||||||
|
return result4
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function getWhere(filtro) {
|
function getWhere(filtro) {
|
||||||
if (filtro == null) {
|
if (filtro == null) {
|
||||||
return
|
return
|
||||||
|
@ -275,7 +303,7 @@ export async function queryRiferimentimul(query, cid) {
|
||||||
console.log(wherecl)
|
console.log(wherecl)
|
||||||
const tconn = await db.connect();
|
const tconn = await db.connect();
|
||||||
|
|
||||||
var querytl = 'select IdRiferimento, Cantica, Canto, Verso from riferimenti'
|
var querytl = 'select IdRiferimento, Cantica, Canto, Verso from riferimenti order by n1, n2, n3'
|
||||||
var rs = await tconn.query(querytl + wherecl)
|
var rs = await tconn.query(querytl + wherecl)
|
||||||
var result4 = rs.toArray().map((row) => row.toJSON());
|
var result4 = rs.toArray().map((row) => row.toJSON());
|
||||||
|
|
||||||
|
@ -286,12 +314,12 @@ export async function queryRiferimentimul(query, cid) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showResult(resxcantica, cid) {
|
function showResult(resxcantica, cid) {
|
||||||
var resKeys = Object.keys(resxcantica);
|
/*var resKeys = Object.keys(resxcantica);
|
||||||
var tuttiVersiPurgatorio = []
|
var tuttiVersiPurgatorio = []
|
||||||
var tuttiVersiParadiso = []
|
var tuttiVersiParadiso = []*/
|
||||||
listaidversi = []
|
listaidversi = []
|
||||||
|
var numcid = cid.split('_')[1]
|
||||||
if (resKeys.includes("Inferno")) {
|
/*if (resKeys.includes("Inferno")) {
|
||||||
sortRiferimenti(resxcantica.Inferno, listaidversi)
|
sortRiferimenti(resxcantica.Inferno, listaidversi)
|
||||||
}
|
}
|
||||||
if (resKeys.includes("Purgatorio")) {
|
if (resKeys.includes("Purgatorio")) {
|
||||||
|
@ -302,7 +330,7 @@ function showResult(resxcantica, cid) {
|
||||||
sortRiferimenti(resxcantica.Paradiso, tuttiVersiParadiso)
|
sortRiferimenti(resxcantica.Paradiso, tuttiVersiParadiso)
|
||||||
listaidversi = listaidversi.concat(tuttiVersiParadiso)
|
listaidversi = listaidversi.concat(tuttiVersiParadiso)
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
for (var cantica in resxcantica) {
|
for (var cantica in resxcantica) {
|
||||||
var $nctags = $(' .navig-canto')
|
var $nctags = $(' .navig-canto')
|
||||||
|
|
||||||
|
@ -318,6 +346,16 @@ function showResult(resxcantica, cid) {
|
||||||
spanbadgecantica.appendTo($('#cantica' + i + '-badge'))
|
spanbadgecantica.appendTo($('#cantica' + i + '-badge'))
|
||||||
|
|
||||||
var tmp = resxcantica[cantica]
|
var tmp = resxcantica[cantica]
|
||||||
|
for (var el of tmp){
|
||||||
|
var tmpc=el.Canto
|
||||||
|
if (tmpc.startsWith('0')) {
|
||||||
|
tmpc = tmpc.replace('0', '')
|
||||||
|
}
|
||||||
|
|
||||||
|
let ordveid = el.Cantica + '_Canto_' + tmpc + '_' + el.Verso.split('-')[0]+'_sp'
|
||||||
|
listaidversi.push(ordveid)
|
||||||
|
}
|
||||||
|
|
||||||
var resxcanto = Object.groupBy(tmp, ({ Canto }) => Canto);
|
var resxcanto = Object.groupBy(tmp, ({ Canto }) => Canto);
|
||||||
for (var canto in resxcanto) {
|
for (var canto in resxcanto) {
|
||||||
var tmpv = resxcanto[canto]
|
var tmpv = resxcanto[canto]
|
||||||
|
@ -329,8 +367,11 @@ function showResult(resxcantica, cid) {
|
||||||
}
|
}
|
||||||
spanbadge.appendTo($nctags.filter('[name="' + cantica + 'Canto ' + canto + '"]'))
|
spanbadge.appendTo($nctags.filter('[name="' + cantica + 'Canto ' + canto + '"]'))
|
||||||
for (const tmpvi of tmpv) {
|
for (const tmpvi of tmpv) {
|
||||||
console.log('id rif '+tmpvi.idRiferimento)
|
let myveid = cantica + '_Canto_' + canto + '_' + tmpvi.Verso.split('-')[0].replace('|','')+'_sp'
|
||||||
listaidcommenti.push(tmpvi.IdRiferimento)
|
//listaidversi.push(myveid)
|
||||||
|
listaidcommenti.push(tmpvi.IdRiferimento) //Nico
|
||||||
|
if (cid.includes(cantica) && numcid == canto)
|
||||||
|
$('#' + myveid).addClass("mark ")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drawMinimap(cid, true)
|
drawMinimap(cid, true)
|
||||||
|
@ -419,7 +460,7 @@ export async function queryRiferimenti(filtro, cid) {
|
||||||
queryfi += ")"
|
queryfi += ")"
|
||||||
}
|
}
|
||||||
|
|
||||||
var rs = await tconn.query(querytl + queryfi)
|
var rs = await tconn.query(querytl + queryfi+ ' order by n1, n2, n3;')
|
||||||
var result4 = rs.toArray().map((row) => row.toJSON());
|
var result4 = rs.toArray().map((row) => row.toJSON());
|
||||||
|
|
||||||
await tconn.close();
|
await tconn.close();
|
||||||
|
|
|
@ -161,17 +161,16 @@ function getVersoContext(versoid, numversi = 3) {
|
||||||
if (cantica == 'Purgatorio') {
|
if (cantica == 'Purgatorio') {
|
||||||
offset = 33374
|
offset = 33374
|
||||||
listaforme = formeseconda;
|
listaforme = formeseconda;
|
||||||
console.log(listaforme.length)
|
|
||||||
}
|
}
|
||||||
if (cantica == 'Paradiso3') {
|
if (cantica == 'Paradiso') {
|
||||||
offset = 66588
|
offset = 66588
|
||||||
listaforme = formeterza;
|
listaforme = formeterza;
|
||||||
}
|
}
|
||||||
var maxpos = listaforme.length - 1
|
var maxpos = listaforme.length - 1
|
||||||
var pos = 0
|
var pos = 0
|
||||||
var startindex = Math.max(0, (offset - 30))
|
var startindex = 0//Math.max(0, (offset - 30))
|
||||||
//cerco la posizione iniziale del verso precedente
|
//cerco la posizione iniziale del verso precedente
|
||||||
var startver= Math.max(0, num-1)
|
var startver= Math.max(1, (num-1))
|
||||||
|
|
||||||
for (i = startindex; i < listaforme.length; i++) {
|
for (i = startindex; i < listaforme.length; i++) {
|
||||||
var tmpos = listaforme[i].split('_')[1]
|
var tmpos = listaforme[i].split('_')[1]
|
||||||
|
@ -200,7 +199,7 @@ function getVersoContext(versoid, numversi = 3) {
|
||||||
contextitem['testo'] = tmpform[0];
|
contextitem['testo'] = tmpform[0];
|
||||||
contextitem['verso'] = tmpform[3];
|
contextitem['verso'] = tmpform[3];
|
||||||
contextitem['canto'] = tmpform[1];
|
contextitem['canto'] = tmpform[1];
|
||||||
contextitem['cantica'] = cantica - 1;
|
contextitem['cantica'] = cantica;
|
||||||
contextitem['posizione'] = tmpform[2];
|
contextitem['posizione'] = tmpform[2];
|
||||||
contextitem['catg'] = tmpform[4];
|
contextitem['catg'] = tmpform[4];
|
||||||
contextitem['periodo'] = cantica + '_' + tmpform[1] + '_s_' + tmpform[5];
|
contextitem['periodo'] = cantica + '_' + tmpform[1] + '_s_' + tmpform[5];
|
||||||
|
|
Loading…
Reference in New Issue