gestione risultati, in progress
This commit is contained in:
parent
86534b5b82
commit
16fefbe371
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { getVersiConCitazioni, queryRiferimenti, getListaRis, cleanListaRis, getFormaCntxt, getListaIdCommenti, queryRiferimentimul } from './dataMgr_5.1.js';
|
import { getVersiConCitazioni, queryRiferimenti, getListaRis, cleanListaRis, getFormaCntxtLastPosition, getListaIdCommenti, queryRiferimentimul } from './dataMgr_5.1.js';
|
||||||
import { getJsonQuery, emptyStructCard } from './script_5.1.js';
|
import { getJsonQuery, emptyStructCard } from './script_5.1.js';
|
||||||
import { resetGraphStr } from './syntgraph_5.1.js'
|
import { resetGraphStr } from './syntgraph_5.1.js'
|
||||||
|
|
||||||
|
@ -190,7 +190,7 @@ $(document).ready(function() {
|
||||||
if ($(this).hasClass("disabled")) {
|
if ($(this).hasClass("disabled")) {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
var posizioniEspansione = []
|
//var posizioniEspansione = []
|
||||||
var cid = $(this).attr('id');
|
var cid = $(this).attr('id');
|
||||||
var parcid = cid.split('_');
|
var parcid = cid.split('_');
|
||||||
var posVerso
|
var posVerso
|
||||||
|
@ -213,12 +213,13 @@ $(document).ready(function() {
|
||||||
var setVersicontestoExp = new Set()
|
var setVersicontestoExp = new Set()
|
||||||
for (var forma of versiContestoExp) {
|
for (var forma of versiContestoExp) {
|
||||||
if (!setVersicontestoExp.has(forma.verso)) {
|
if (!setVersicontestoExp.has(forma.verso)) {
|
||||||
divVersoExp = createDivVersoLI(forma.cantica + 1, forma.verso, forma.canto)
|
//divVersoExp = createDivVersoLI(forma.cantica + 1, forma.verso, forma.canto)
|
||||||
|
divVersoExp=createDivVersoGenericLi(forma.cantica + 1, forma.verso, forma.canto)
|
||||||
$(reit).append(divVersoExp)
|
$(reit).append(divVersoExp)
|
||||||
setVersicontestoExp.add(forma.verso)
|
setVersicontestoExp.add(forma.verso)
|
||||||
}
|
}
|
||||||
createSpanFormeNew(forma.testo, forma.catg, 'e' + forma.posizione, forma.periodo, forma.funzperiodo, divVersoExp)
|
createSpanFormeNew(forma.testo, forma.catg, 'e' + forma.posizione, forma.periodo, forma.funzperiodo, divVersoExp)
|
||||||
posizioniEspansione.push('e' + forma.posizione)
|
//posizioniEspansione.push('e' + forma.posizione)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cid.includes('_er_')) {
|
if (cid.includes('_er_')) {
|
||||||
|
@ -308,18 +309,21 @@ $(document).ready(function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function countResultContexts() {
|
function countResultContexts() {
|
||||||
var numeroRisultati = 0;
|
var numeroRisultati = 0;
|
||||||
if (listarisultati.length) {
|
if (listarisultati.length) {
|
||||||
var ultimaPosizione = -1;
|
var ultimaPosizione = -1;
|
||||||
for (var risultato of listarisultati) {
|
for (var risultato of listarisultati) {
|
||||||
|
|
||||||
if (risultato <= ultimaPosizione) {
|
if (risultato <= ultimaPosizione) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
numeroRisultati = numeroRisultati + 1;
|
numeroRisultati = numeroRisultati + 1;
|
||||||
|
//ultimaPosizione=await getFormaCntxtLastPosition(risultato, contextLength)
|
||||||
ultimaPosizione = getContextLastPosition(risultato, contextLength);
|
ultimaPosizione = getContextLastPosition(risultato, contextLength);
|
||||||
}
|
}
|
||||||
numeroContesti = numeroRisultati
|
numeroContesti = numeroRisultati
|
||||||
|
console.log('num contesti '+numeroContesti)
|
||||||
return (numeroRisultati)
|
return (numeroRisultati)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,7 +337,7 @@ $(document).ready(function() {
|
||||||
return (numeroRisultati)
|
return (numeroRisultati)
|
||||||
}
|
}
|
||||||
|
|
||||||
function getResInPage(startcont, endcont) {
|
function getResInPage(startcont, endcont) {
|
||||||
var res = [];
|
var res = [];
|
||||||
var contaContesti = 0
|
var contaContesti = 0
|
||||||
//console.log(listaClausoleRisultato)
|
//console.log(listaClausoleRisultato)
|
||||||
|
@ -349,6 +353,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
if (contaContesti > endcont)
|
if (contaContesti > endcont)
|
||||||
break;
|
break;
|
||||||
|
//ultimaPosizione=await getFormaCntxtLastPosition(risultato, contextLength)
|
||||||
ultimaPosizione = getContextLastPosition(risultato, contextLength);
|
ultimaPosizione = getContextLastPosition(risultato, contextLength);
|
||||||
}
|
}
|
||||||
//ordino la lista dei risultati
|
//ordino la lista dei risultati
|
||||||
|
@ -378,7 +383,9 @@ $(document).ready(function() {
|
||||||
var ultimaPosizione = 0;
|
var ultimaPosizione = 0;
|
||||||
var numeroVersi;
|
var numeroVersi;
|
||||||
//const intsup = Math.min(start + offset, listarisultati.length)
|
//const intsup = Math.min(start + offset, listarisultati.length)
|
||||||
|
var t0 = performance.now();
|
||||||
var resincontext = getResInPage(start, start + offset)
|
var resincontext = getResInPage(start, start + offset)
|
||||||
|
var t1 = performance.now();
|
||||||
|
|
||||||
for (let i = 0; i < resincontext.length; i++) {
|
for (let i = 0; i < resincontext.length; i++) {
|
||||||
//risultato = listarisultati[i];
|
//risultato = listarisultati[i];
|
||||||
|
@ -421,7 +428,8 @@ $(document).ready(function() {
|
||||||
canto = forma.canto
|
canto = forma.canto
|
||||||
}
|
}
|
||||||
if (!setVersicontesto.has(forma.verso)) {
|
if (!setVersicontesto.has(forma.verso)) {
|
||||||
divVerso = createDivVersoLI(forma.cantica + 1, forma.verso, forma.canto)
|
//divVerso = createDivVersoLI(forma.cantica + 1, forma.verso, forma.canto)
|
||||||
|
divVerso=createDivVersoGenericLi(forma.cantica + 1, forma.verso, forma.canto)
|
||||||
versiIniziali.append(divVerso)
|
versiIniziali.append(divVerso)
|
||||||
listaVersi.append(versiIniziali)
|
listaVersi.append(versiIniziali)
|
||||||
elencoRisutati.append(listaVersi)
|
elencoRisutati.append(listaVersi)
|
||||||
|
@ -481,14 +489,22 @@ $(document).ready(function() {
|
||||||
comandi.appendTo(elencoRisutati);
|
comandi.appendTo(elencoRisutati);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
var t2=performance.now()
|
||||||
|
console.log('res in context '+(t1-t0))
|
||||||
|
console.log('list creation '+(t2-t1))
|
||||||
//evidenzio resultati
|
//evidenzio resultati
|
||||||
|
var clausesinrs=[]
|
||||||
for (var ris of listarisultati) {
|
for (var ris of listarisultati) {
|
||||||
let idris = '#e' + ris
|
let idris = '#e' + ris
|
||||||
|
if ($(idris).attr('class')!=null){
|
||||||
|
console.log($(idris).attr('class').replace(' frm', ''))
|
||||||
|
clausesinrs.push($(idris).attr('class').replace(' frm', ''))
|
||||||
|
}
|
||||||
|
|
||||||
$(idris).addClass("font-weight-bold mark ")
|
$(idris).addClass("font-weight-bold mark ")
|
||||||
}
|
}
|
||||||
|
var t3=performance.now()
|
||||||
|
console.log('mar res '+(t2-t3))
|
||||||
//evidenzio i periodi se unità di ricerca è impostato come periodo
|
//evidenzio i periodi se unità di ricerca è impostato come periodo
|
||||||
if (listaPeriodiRisultato.length) {
|
if (listaPeriodiRisultato.length) {
|
||||||
for (var msid of listaPeriodiRisultato) {
|
for (var msid of listaPeriodiRisultato) {
|
||||||
|
@ -497,15 +513,23 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
var t4=performance.now()
|
||||||
|
console.log('load per '+(t3-t4))
|
||||||
//evidenzio le frasi se unità di ricerca è frase
|
//evidenzio le frasi se unità di ricerca è frase
|
||||||
if (listaClausoleRisultato.length) {
|
if (listaClausoleRisultato.length) {
|
||||||
for (var clsid of listaClausoleRisultato) {
|
for (var clsid of clausesinrs){
|
||||||
|
let tmpid = clsid.split(' ')
|
||||||
|
loadClausola(tmpid[0], tmpid[1], 0,0)
|
||||||
|
}
|
||||||
|
/*for (var clsid of listaClausoleRisultato) {
|
||||||
let tmpid = clsid.split('-')
|
let tmpid = clsid.split('-')
|
||||||
//loadFrase(tmpid[0], tmpid[1])
|
//loadFrase(tmpid[0], tmpid[1])
|
||||||
loadClausola(tmpid[0], tmpid[1], tmpid[2], tmpid[3])
|
loadClausola(tmpid[0], tmpid[1], tmpid[2], tmpid[3])
|
||||||
|
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
var t5=performance.now()
|
||||||
|
console.log('load cla '+(t4-t5))
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -696,7 +720,19 @@ $(document).ready(function() {
|
||||||
if (!isPeriodoInCanto(idperiodo, cantoDisplayed) && !(cantoDisplayed.includes('#vistaFrasi')))
|
if (!isPeriodoInCanto(idperiodo, cantoDisplayed) && !(cantoDisplayed.includes('#vistaFrasi')))
|
||||||
return
|
return
|
||||||
|
|
||||||
$(cantoDisplayed).find(' .' + idperiodo).each(function() {
|
$(cantoDisplayed).find(' .' + idperiodo+'.'+funzionefrase).each(function() {
|
||||||
|
var tpstp = $(this).attr('class').split(" ")[1]
|
||||||
|
$(this).css('color', colorssp(mapsynttypestopalette[tpstp]));
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
minim.contents().find(' .' + idperiodo+'.'+funzionefrase).each(function() {
|
||||||
|
var mtpstp = $(this).attr('class').split(" ")[1]
|
||||||
|
$(this).css('color', colorssp(mapsynttypestopalette[mtpstp]));
|
||||||
|
})
|
||||||
|
|
||||||
|
/*$(cantoDisplayed).find(' .' + idperiodo).each(function() {
|
||||||
var vid = parseInt($(this).attr('id').replace('e', ''))
|
var vid = parseInt($(this).attr('id').replace('e', ''))
|
||||||
if (vid >= parseInt(fromn)
|
if (vid >= parseInt(fromn)
|
||||||
&& vid <= parseInt(ton)) {
|
&& vid <= parseInt(ton)) {
|
||||||
|
@ -706,9 +742,9 @@ $(document).ready(function() {
|
||||||
$(this).css('color', colorssp(mapsynttypestopalette[pstp]));
|
$(this).css('color', colorssp(mapsynttypestopalette[pstp]));
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})*/
|
||||||
|
|
||||||
minim.contents().find(' .' + idperiodo).each(function() {
|
/*minim.contents().find(' .' + idperiodo).each(function() {
|
||||||
var vid = parseInt($(this).attr('id').replace('e', ''))
|
var vid = parseInt($(this).attr('id').replace('e', ''))
|
||||||
if (vid >= parseInt(fromn)
|
if (vid >= parseInt(fromn)
|
||||||
&& vid <= parseInt(ton)) {
|
&& vid <= parseInt(ton)) {
|
||||||
|
@ -717,7 +753,7 @@ $(document).ready(function() {
|
||||||
$(this).css('color', colorssp(mapsynttypestopalette[mpstp]));
|
$(this).css('color', colorssp(mapsynttypestopalette[mpstp]));
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -896,6 +932,7 @@ $(document).ready(function() {
|
||||||
var pio = $("#" + idCommento + t)
|
var pio = $("#" + idCommento + t)
|
||||||
if (pio.length)
|
if (pio.length)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if(t=='Proemio'){
|
if(t=='Proemio'){
|
||||||
console.log(idminimap+' '+t)
|
console.log(idminimap+' '+t)
|
||||||
var elcanto=$("#" + 'Titolo'+idminimap)
|
var elcanto=$("#" + 'Titolo'+idminimap)
|
||||||
|
@ -1024,7 +1061,7 @@ $(document).ready(function() {
|
||||||
var collapseNote = $('<div class="collapse show">');
|
var collapseNote = $('<div class="collapse show">');
|
||||||
collapseNote.attr('id', "collapseNote" + id + '_' + pos)
|
collapseNote.attr('id', "collapseNote" + id + '_' + pos)
|
||||||
|
|
||||||
if (comments.TestoFonteCitazione != null && comments.TestoFonteCitazione != "nan") {
|
if (comments.TestoFonteCitazione != null && comments.TestoFonteCitazione != "nan" && comments.TestoFonteCitazione.trim() != "") {
|
||||||
createModule(collapseCardBody, "Testo della fonte: ", removeHtmlTags(comments.TestoFonteCitazione), "1", id, pos)
|
createModule(collapseCardBody, "Testo della fonte: ", removeHtmlTags(comments.TestoFonteCitazione), "1", id, pos)
|
||||||
}
|
}
|
||||||
if (comments.NaturaRiferimento != null) {
|
if (comments.NaturaRiferimento != null) {
|
||||||
|
@ -1157,10 +1194,11 @@ $(document).ready(function() {
|
||||||
} else {
|
} else {
|
||||||
luogoFonte = comments.LuogoFonteCitazione;
|
luogoFonte = comments.LuogoFonteCitazione;
|
||||||
}
|
}
|
||||||
if (comments.URLFonteCitazione != null) {
|
if (comments.URLFonteCitazione != null && comments.URLFonteCitazione.trim() != '') {
|
||||||
rigaNota.append(' <b>Coordinate della fonte:</b><a href="' + comments.URLFonteCitazione + '"target="_blank"><i> ' + luogoFonte + '</i></a><br>');
|
rigaNota.append(' <b>Coordinate della fonte:</b><a href="' + comments.URLFonteCitazione + '"target="_blank"><i> ' + luogoFonte + '</i></a><br>');
|
||||||
} else {
|
} else {
|
||||||
rigaNota.append(' <b>Coordinate della fonte:</b><i> ' + luogoFonte + '</i><br>');
|
if (luogoFonte!=null && luogoFonte.trim()!='')
|
||||||
|
rigaNota.append(' <b>Coordinate della fonte:</b><i> ' + luogoFonte + 'ttttt</i><br>');
|
||||||
}
|
}
|
||||||
rigaNota.appendTo(commentHeader);
|
rigaNota.appendTo(commentHeader);
|
||||||
buttons.appendTo(commentHeader);
|
buttons.appendTo(commentHeader);
|
||||||
|
@ -1657,12 +1695,7 @@ $(document).ready(function() {
|
||||||
if (formaItem[1] == canto) {
|
if (formaItem[1] == canto) {
|
||||||
if (!setVersiCanto.has(cantica + "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])) {
|
if (!setVersiCanto.has(cantica + "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])) {
|
||||||
|
|
||||||
var verso = parseInt(formaItem[3]) - 1;
|
//var verso = parseInt(formaItem[3]) - 1;
|
||||||
//var idCommento = "Commento_" + idcantica + "_" + canto + "_" + verso;
|
|
||||||
//var commNumber = numberOfComments(idCommento);
|
|
||||||
//var commNumber = numberOfCommentsJson(idCommento)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (currSentenceId != null && currSentenceId != sentenceid) {
|
if (currSentenceId != null && currSentenceId != sentenceid) {
|
||||||
|
@ -1670,10 +1703,7 @@ $(document).ready(function() {
|
||||||
createSpanPeriodiTag(closeSTag, 'c', formaItem[2] - 1, currSentenceId, elverso, periodinum[currSentenceId])
|
createSpanPeriodiTag(closeSTag, 'c', formaItem[2] - 1, currSentenceId, elverso, periodinum[currSentenceId])
|
||||||
currSentenceId = null
|
currSentenceId = null
|
||||||
}
|
}
|
||||||
/*if (commNumber > 0) {
|
|
||||||
createCommentSpan(idCommento, elverso, commNumber)
|
|
||||||
//console.log("Numero commenti: "+commNumber)
|
|
||||||
}*/
|
|
||||||
//elverso=createDivVersoNew(cantica, formaItem[3], 'Canto_' + formaItem[1])
|
//elverso=createDivVersoNew(cantica, formaItem[3], 'Canto_' + formaItem[1])
|
||||||
elverso = createDivVersoLI(cantica, formaItem[3], 'Canto_' + formaItem[1])
|
elverso = createDivVersoLI(cantica, formaItem[3], 'Canto_' + formaItem[1])
|
||||||
setVersiCanto.add(cantica + "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])
|
setVersiCanto.add(cantica + "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])
|
||||||
|
@ -1733,7 +1763,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
function createProemioSpan(idVerso, elementoverso, numberOfComments, spanid) {
|
function createProemioSpan(idVerso, elementoverso, numberOfComments, spanid) {
|
||||||
var spanoccorrenza = $('<span />')
|
var spanoccorrenza = $('<span />')
|
||||||
spanoccorrenza.attr('id', spanid)
|
spanoccorrenza.attr('id', spanid+'_sp')
|
||||||
var proemiooccorrenza = $('<button />')
|
var proemiooccorrenza = $('<button />')
|
||||||
proemiooccorrenza.attr('id', idVerso)
|
proemiooccorrenza.attr('id', idVerso)
|
||||||
|
|
||||||
|
@ -1820,43 +1850,39 @@ $(document).ready(function() {
|
||||||
var spanoccorrenza = $('<span />')
|
var spanoccorrenza = $('<span />')
|
||||||
var nbsp = $('<span> </span>')
|
var nbsp = $('<span> </span>')
|
||||||
spanoccorrenza.attr('id', pos)
|
spanoccorrenza.attr('id', pos)
|
||||||
//spanoccorrenza.attr('data-cg', catgramm)
|
|
||||||
spanoccorrenza.attr('title', catgramm)
|
spanoccorrenza.attr('title', catgramm)
|
||||||
spanoccorrenza.attr('class', sentenceid + " " + clausefunct + ' ' + formaClass)
|
spanoccorrenza.attr('class', sentenceid + " " + clausefunct + ' ' + formaClass)
|
||||||
spanoccorrenza.append(forma)
|
spanoccorrenza.append(forma)
|
||||||
spanoccorrenza.appendTo(elementoverso)
|
spanoccorrenza.appendTo(elementoverso)
|
||||||
nbsp.appendTo(elementoverso)
|
nbsp.appendTo(elementoverso)
|
||||||
}
|
}
|
||||||
/* function createDivVersoNew(cantica, num, canto) {
|
|
||||||
|
|
||||||
var elementoverso = createDivVersoGeneric(cantica, num, canto)
|
|
||||||
|
|
||||||
elementoverso.appendTo('#' + cantica + canto)
|
|
||||||
return elementoverso
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
function createDivVersoLI(cantica, num, canto) {
|
function createDivVersoLI(cantica, num, canto) {
|
||||||
|
|
||||||
var elementoverso = createDivVersoGenericLi(cantica, num, canto)
|
var elementoverso = createDivVersoGenericLi(cantica, num, canto)
|
||||||
let cantoContainer = $('#' + cantica + canto);
|
let cantoContainer = $('#' + cantica + canto);
|
||||||
elementoverso.appendTo(cantoContainer.find('ol'))
|
elementoverso.appendTo(cantoContainer.find('ol'))
|
||||||
return elementoverso
|
var elementoversospan=$('<span />')
|
||||||
|
elementoversospan.attr('id', cantica + "_" + canto + "_" + num+'_sp')
|
||||||
}
|
elementoverso.append(elementoversospan)
|
||||||
|
/*return elementoverso*/
|
||||||
|
return elementoversospan
|
||||||
|
|
||||||
|
}
|
||||||
function createDivVersoGenericLi(cantica, num, canto) {
|
function createDivVersoGenericLi(cantica, num, canto) {
|
||||||
let digits = num.length
|
/*let digits = num.length*/
|
||||||
|
|
||||||
var spannum = $('<span />')
|
/*var spannum = $('<span />')
|
||||||
|
|
||||||
if (digits == 1)
|
if (digits == 1)
|
||||||
spannum.append('\xa0\xa0')
|
spannum.append('\xa0\xa0')
|
||||||
if (digits == 2)
|
if (digits == 2)
|
||||||
spannum.append('\xa0')
|
spannum.append('\xa0')
|
||||||
spannum.append(num + '. ')
|
spannum.append(num + '. ')*/
|
||||||
var elementoverso = $('<li />')
|
var elementoverso = $('<li />')
|
||||||
//var elementoverso=$('<p />')
|
/*var elementoversospan=$('<span />')*/
|
||||||
//elementoverso.append(spannum)
|
//elementoverso.append(spannum)
|
||||||
elementoverso.attr("value", num)
|
elementoverso.attr("value", num)
|
||||||
|
|
||||||
|
@ -1866,6 +1892,7 @@ $(document).ready(function() {
|
||||||
//elementoverso.attr('class', 'text-nowrap ')//+cantica+' '+canto)
|
//elementoverso.attr('class', 'text-nowrap ')//+cantica+' '+canto)
|
||||||
|
|
||||||
elementoverso.attr('id', cantica + "_" + canto + "_" + num)
|
elementoverso.attr('id', cantica + "_" + canto + "_" + num)
|
||||||
|
/*elementoverso.append(elementoversospan)*/
|
||||||
elementoverso.append('\xa0')
|
elementoverso.append('\xa0')
|
||||||
return elementoverso
|
return elementoverso
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ const conn = await db.connect();
|
||||||
|
|
||||||
await conn.query(`
|
await conn.query(`
|
||||||
CREATE TABLE riferimenti AS
|
CREATE TABLE riferimenti AS
|
||||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/riferimenti_4.parquet";
|
SELECT * FROM "https://lida.dantenetwork.it/js/data/riferimenti_5.parquet";
|
||||||
CREATE TABLE commedia AS
|
CREATE TABLE commedia AS
|
||||||
SELECT * FROM "https://lida.dantenetwork.it/js/data/com.parquet";
|
SELECT * FROM "https://lida.dantenetwork.it/js/data/com.parquet";
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ 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) {
|
||||||
let myveid = '#' + cantica + '_Canto_' + canto + '_' + tmpvi.Verso.split('-')[0]
|
let myveid = '#' + cantica + '_Canto_' + canto + '_' + tmpvi.Verso.split('-')[0]+'_sp'
|
||||||
//console.log(myveid)
|
//console.log(myveid)
|
||||||
listaidversi.push(myveid)
|
listaidversi.push(myveid)
|
||||||
listaidcommenti.push(tmpvi.IdRiferimento)
|
listaidcommenti.push(tmpvi.IdRiferimento)
|
||||||
|
@ -417,8 +417,9 @@ export async function queryRiferimenti(filtro, cid) {
|
||||||
|
|
||||||
await tconn.close();
|
await tconn.close();
|
||||||
var resxcantica = Object.groupBy(result4, ({ Cantica }) => Cantica);
|
var resxcantica = Object.groupBy(result4, ({ Cantica }) => Cantica);
|
||||||
|
return (showResult(resxcantica, cid))
|
||||||
|
|
||||||
listaidversi = []
|
/*listaidversi = []
|
||||||
var numcid = cid.split('_')[1]
|
var numcid = cid.split('_')[1]
|
||||||
for (var cantica in resxcantica) {
|
for (var cantica in resxcantica) {
|
||||||
var $nctags = $(' .navig-canto')
|
var $nctags = $(' .navig-canto')
|
||||||
|
@ -447,7 +448,7 @@ export async function queryRiferimenti(filtro, 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) {
|
||||||
let myveid = '#' + cantica + '_Canto_' + canto + '_' + tmpvi.Verso.split('-')[0]
|
let myveid = '#' + cantica + '_Canto_' + canto + '_' + tmpvi.Verso.split('-')[0]+'_sp'
|
||||||
|
|
||||||
listaidversi.push(myveid)
|
listaidversi.push(myveid)
|
||||||
listaidcommenti.push(tmpvi.IdRiferimento)
|
listaidcommenti.push(tmpvi.IdRiferimento)
|
||||||
|
@ -461,8 +462,8 @@ export async function queryRiferimenti(filtro, cid) {
|
||||||
drawMinimap(cid, true)
|
drawMinimap(cid, true)
|
||||||
|
|
||||||
}
|
}
|
||||||
/*console.log(resxcantica)*/
|
console.log(resxcantica)
|
||||||
return listaidversi
|
return listaidversi*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -518,20 +519,21 @@ function filtroContesto(marray, cantica, op) {
|
||||||
return filtrost
|
return filtrost
|
||||||
}
|
}
|
||||||
|
|
||||||
//Contesto
|
//Contesto per lista risultati
|
||||||
|
|
||||||
export async function getFormaCntxt(formaid, numversi = 3) {
|
export async function getFormaCntxtLastPosition(formaid, numversi = 3) {
|
||||||
const tconn = await db.connect();
|
const tconn = await db.connect();
|
||||||
var querycnt = "select * from commedia where index>=((select index from commedia where Position='" + formaid + "')-25) order by index limit 50"
|
var querycnt = "select * from commedia where index>=((select index from commedia where Position='" + formaid + "')-25) order by index limit 50"
|
||||||
console.log(" " + formaid)
|
/*console.log(" " + formaid)*/
|
||||||
var rs = await tconn.query(querycnt)
|
var rs = await tconn.query(querycnt)
|
||||||
var result4 = rs.toArray().map((row) => row.toJSON());
|
var result4 = rs.toArray().map((row) => row.toJSON());
|
||||||
|
|
||||||
|
|
||||||
console.log(result4)
|
/*console.log(result4.at(-1)['Position'])
|
||||||
console.log('-----------------------------------------')
|
console.log('-----------------------------------------')*/
|
||||||
|
|
||||||
|
|
||||||
await tconn.close();
|
await tconn.close();
|
||||||
|
return (result4.at(-1)['Position'])
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,22 +210,22 @@ function getContextLastPosition(formaid, numversi = 3) {
|
||||||
var listaforme = formeprima;
|
var listaforme = formeprima;
|
||||||
|
|
||||||
var limitv = Math.max((numversi), 3)
|
var limitv = Math.max((numversi), 3)
|
||||||
var maxpos = 0;
|
|
||||||
var offset = parseInt(formaid);
|
var offset = parseInt(formaid);
|
||||||
|
|
||||||
if (parseInt(formaid) > 33373 && parseInt(formaid) < 66588) {
|
if (parseInt(formaid) > 33373 && parseInt(formaid) < 66588) {
|
||||||
listaforme = formeseconda;
|
listaforme = formeseconda;
|
||||||
cantica = 1;
|
cantica = 1;
|
||||||
offset = parseInt(formaid) - 33374
|
offset = offset - 33374
|
||||||
|
|
||||||
}
|
}
|
||||||
if (parseInt(formaid) > 66587 && parseInt(formaid) < 99314) {
|
if (parseInt(formaid) > 66587 && parseInt(formaid) < 99314) {
|
||||||
listaforme = formeterza;
|
listaforme = formeterza;
|
||||||
cantica = 2;
|
cantica = 2;
|
||||||
offset = parseInt(formaid) - 66588
|
offset = offset - 66588
|
||||||
|
|
||||||
}
|
}
|
||||||
maxpos = listaforme.length - 1
|
var maxpos = listaforme.length - 1
|
||||||
var pos = 0
|
var pos = 0
|
||||||
var startindex = Math.max(0, (offset - 25))
|
var startindex = Math.max(0, (offset - 25))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue