estione risultati
This commit is contained in:
parent
16fefbe371
commit
1beb6aa613
|
@ -93,6 +93,7 @@ $(document).ready(function() {
|
|||
case "visPeriodi|false":
|
||||
$("#vistaFrasi").css("display", "none");
|
||||
resetFrasi()
|
||||
manageResults()
|
||||
vistaPeriodi = false
|
||||
break;
|
||||
case "visRiferimenti|true":
|
||||
|
@ -214,7 +215,7 @@ $(document).ready(function() {
|
|||
for (var forma of versiContestoExp) {
|
||||
if (!setVersicontestoExp.has(forma.verso)) {
|
||||
//divVersoExp = createDivVersoLI(forma.cantica + 1, forma.verso, forma.canto)
|
||||
divVersoExp=createDivVersoGenericLi(forma.cantica + 1, forma.verso, forma.canto)
|
||||
divVersoExp = createDivVersoGenericLi(forma.cantica + 1, forma.verso, forma.canto)
|
||||
$(reit).append(divVersoExp)
|
||||
setVersicontestoExp.add(forma.verso)
|
||||
}
|
||||
|
@ -309,12 +310,12 @@ $(document).ready(function() {
|
|||
|
||||
}
|
||||
|
||||
function countResultContexts() {
|
||||
function countResultContexts() {
|
||||
var numeroRisultati = 0;
|
||||
if (listarisultati.length) {
|
||||
var ultimaPosizione = -1;
|
||||
for (var risultato of listarisultati) {
|
||||
|
||||
|
||||
if (risultato <= ultimaPosizione) {
|
||||
continue;
|
||||
}
|
||||
|
@ -323,7 +324,7 @@ function countResultContexts() {
|
|||
ultimaPosizione = getContextLastPosition(risultato, contextLength);
|
||||
}
|
||||
numeroContesti = numeroRisultati
|
||||
console.log('num contesti '+numeroContesti)
|
||||
console.log('num contesti ' + numeroContesti)
|
||||
return (numeroRisultati)
|
||||
}
|
||||
|
||||
|
@ -337,7 +338,7 @@ function countResultContexts() {
|
|||
return (numeroRisultati)
|
||||
}
|
||||
|
||||
function getResInPage(startcont, endcont) {
|
||||
function getResInPage(startcont, endcont) {
|
||||
var res = [];
|
||||
var contaContesti = 0
|
||||
//console.log(listaClausoleRisultato)
|
||||
|
@ -386,7 +387,7 @@ function countResultContexts() {
|
|||
var t0 = performance.now();
|
||||
var resincontext = getResInPage(start, start + offset)
|
||||
var t1 = performance.now();
|
||||
|
||||
|
||||
for (let i = 0; i < resincontext.length; i++) {
|
||||
//risultato = listarisultati[i];
|
||||
var risultato = resincontext[i];
|
||||
|
@ -429,7 +430,7 @@ function countResultContexts() {
|
|||
}
|
||||
if (!setVersicontesto.has(forma.verso)) {
|
||||
//divVerso = createDivVersoLI(forma.cantica + 1, forma.verso, forma.canto)
|
||||
divVerso=createDivVersoGenericLi(forma.cantica + 1, forma.verso, forma.canto)
|
||||
divVerso = createDivVersoGenericLi(forma.cantica + 1, forma.verso, forma.canto)
|
||||
versiIniziali.append(divVerso)
|
||||
listaVersi.append(versiIniziali)
|
||||
elencoRisutati.append(listaVersi)
|
||||
|
@ -489,37 +490,42 @@ function countResultContexts() {
|
|||
comandi.appendTo(elencoRisutati);
|
||||
|
||||
}
|
||||
var t2=performance.now()
|
||||
console.log('res in context '+(t1-t0))
|
||||
console.log('list creation '+(t2-t1))
|
||||
var t2 = performance.now()
|
||||
console.log('res in context ' + (t1 - t0))
|
||||
console.log('list creation ' + (t2 - t1))
|
||||
//evidenzio resultati
|
||||
var clausesinrs=[]
|
||||
var clausesinrs = []
|
||||
for (var ris of listarisultati) {
|
||||
let idris = '#e' + ris
|
||||
if ($(idris).attr('class')!=null){
|
||||
console.log($(idris).attr('class').replace(' frm', ''))
|
||||
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 ")
|
||||
}
|
||||
var t3=performance.now()
|
||||
console.log('mar res '+(t2-t3))
|
||||
var t3 = performance.now()
|
||||
console.log('mar res ' + (t2 - t3))
|
||||
//evidenzio i periodi se unità di ricerca è impostato come periodo
|
||||
if (listaPeriodiRisultato.length) {
|
||||
for (var msid of listaPeriodiRisultato) {
|
||||
for (var msid of clausesinrs) {
|
||||
loadPeriodo(msid.split(' ')[0])
|
||||
|
||||
}
|
||||
|
||||
/*for (var msid of listaPeriodiRisultato) {
|
||||
loadPeriodo(msid)
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
var t4=performance.now()
|
||||
console.log('load per '+(t3-t4))
|
||||
var t4 = performance.now()
|
||||
console.log('load per ' + (t3 - t4))
|
||||
//evidenzio le frasi se unità di ricerca è frase
|
||||
if (listaClausoleRisultato.length) {
|
||||
for (var clsid of clausesinrs){
|
||||
for (var clsid of clausesinrs) {
|
||||
let tmpid = clsid.split(' ')
|
||||
loadClausola(tmpid[0], tmpid[1], 0,0)
|
||||
loadClausola(tmpid[0], tmpid[1], 0, 0)
|
||||
}
|
||||
/*for (var clsid of listaClausoleRisultato) {
|
||||
let tmpid = clsid.split('-')
|
||||
|
@ -528,8 +534,8 @@ function countResultContexts() {
|
|||
|
||||
}*/
|
||||
}
|
||||
var t5=performance.now()
|
||||
console.log('load cla '+(t4-t5))
|
||||
var t5 = performance.now()
|
||||
console.log('load cla ' + (t4 - t5))
|
||||
|
||||
|
||||
}
|
||||
|
@ -594,6 +600,7 @@ function countResultContexts() {
|
|||
});
|
||||
|
||||
}
|
||||
manageResults()
|
||||
|
||||
|
||||
});
|
||||
|
@ -696,7 +703,6 @@ function countResultContexts() {
|
|||
var mpstp = $(this).attr('class').split(" ")[1]
|
||||
if (mpstp == 'sentencetag')
|
||||
$(this).attr('style', 'display: d-flex;');
|
||||
//$(this).css('color', colorssp(mapsynttypestopalette[mpstp]));
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -719,19 +725,19 @@ function countResultContexts() {
|
|||
|
||||
if (!isPeriodoInCanto(idperiodo, cantoDisplayed) && !(cantoDisplayed.includes('#vistaFrasi')))
|
||||
return
|
||||
|
||||
$(cantoDisplayed).find(' .' + idperiodo+'.'+funzionefrase).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() {
|
||||
|
||||
minim.contents().find(' .' + idperiodo + '.' + funzionefrase).each(function() {
|
||||
var mtpstp = $(this).attr('class').split(" ")[1]
|
||||
$(this).css('color', colorssp(mapsynttypestopalette[mtpstp]));
|
||||
$(this).css('color', colorssp(mapsynttypestopalette[mtpstp]));
|
||||
})
|
||||
|
||||
|
||||
/*$(cantoDisplayed).find(' .' + idperiodo).each(function() {
|
||||
var vid = parseInt($(this).attr('id').replace('e', ''))
|
||||
if (vid >= parseInt(fromn)
|
||||
|
@ -859,7 +865,7 @@ function countResultContexts() {
|
|||
//cancello il grafo sintattico
|
||||
resetGraphStr()
|
||||
emptyStructCard()
|
||||
emphResults()
|
||||
//emphResults()
|
||||
}
|
||||
//visualizzazione risultati
|
||||
function emphResults() {
|
||||
|
@ -915,16 +921,16 @@ function countResultContexts() {
|
|||
/*
|
||||
*/
|
||||
var mresult = await getVersiConCitazioni(cantica, canto)
|
||||
|
||||
|
||||
|
||||
commentsSQL = Object.groupBy(mresult, ({ VersoCitazione }) => VersoCitazione);
|
||||
|
||||
var tmpkeys = []
|
||||
|
||||
for (const ke in commentsSQL) {
|
||||
|
||||
|
||||
var t = ke.split('-')[0]
|
||||
|
||||
|
||||
if (tmpkeys.indexOf(t) == -1)
|
||||
tmpkeys.push(t)
|
||||
else
|
||||
|
@ -932,18 +938,18 @@ function countResultContexts() {
|
|||
var pio = $("#" + idCommento + t)
|
||||
if (pio.length)
|
||||
break;
|
||||
|
||||
if(t=='Proemio'){
|
||||
console.log(idminimap+' '+t)
|
||||
var elcanto=$("#" + 'Titolo'+idminimap)
|
||||
|
||||
if (t == 'Proemio') {
|
||||
console.log(idminimap + ' ' + t)
|
||||
var elcanto = $("#" + 'Titolo' + idminimap)
|
||||
if (canto.startsWith('0'))
|
||||
canto=canto.replace('0','')
|
||||
createProemioSpan(idCommento + t, elcanto, commentsSQL[ke].length, cantica + '_Canto_' + canto+'_Proemio')
|
||||
canto = canto.replace('0', '')
|
||||
createProemioSpan(idCommento + t, elcanto, commentsSQL[ke].length, cantica + '_Canto_' + canto + '_Proemio')
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
var elverso = $("#" + idverso + t)
|
||||
|
||||
|
||||
createCommentSpan(idCommento + t, elverso, commentsSQL[ke].length)
|
||||
}
|
||||
|
||||
|
@ -1031,9 +1037,9 @@ function countResultContexts() {
|
|||
} else {
|
||||
var commentiSP = " commento su "
|
||||
}
|
||||
if (versi.includes('Proemio')){
|
||||
if (versi.includes('Proemio')) {
|
||||
rigaNota.append('<h6 class="card-title m-2 text-warning"><span class="badge badge-warning badge-pill mx-1">' + len + "</span>" + cantica + ", Canto " + canto + ", Proemio </h6>");
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
rigaNota.append('<h6 class="card-title m-2 text-warning"><span class="badge badge-warning badge-pill mx-1">' + len + "</span>" + commentiSP + cantica + ", Canto " + canto + versi + "</h6>");
|
||||
|
@ -1197,7 +1203,7 @@ function countResultContexts() {
|
|||
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>');
|
||||
} else {
|
||||
if (luogoFonte!=null && luogoFonte.trim()!='')
|
||||
if (luogoFonte != null && luogoFonte.trim() != '')
|
||||
rigaNota.append(' <b>Coordinate della fonte:</b><i> ' + luogoFonte + 'ttttt</i><br>');
|
||||
}
|
||||
rigaNota.appendTo(commentHeader);
|
||||
|
@ -1538,17 +1544,7 @@ function countResultContexts() {
|
|||
|
||||
}
|
||||
|
||||
/*function manageMM(name) {
|
||||
currentMinimap = name;
|
||||
let testhtml = $(currentMinimap)[0].outerHTML;
|
||||
//let minim=$(" .minimap__content")
|
||||
let bm = minim.contents().find(' .blog-main')
|
||||
bm.empty()
|
||||
bm.append(testhtml)
|
||||
getDimensionsDiv(true, true);
|
||||
|
||||
}
|
||||
*/
|
||||
var unitaRicerca = 'forma'
|
||||
|
||||
function manageQuery() {
|
||||
|
@ -1696,14 +1692,14 @@ function countResultContexts() {
|
|||
if (!setVersiCanto.has(cantica + "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])) {
|
||||
|
||||
//var verso = parseInt(formaItem[3]) - 1;
|
||||
|
||||
|
||||
|
||||
if (currSentenceId != null && currSentenceId != sentenceid) {
|
||||
|
||||
createSpanPeriodiTag(closeSTag, 'c', formaItem[2] - 1, currSentenceId, elverso, periodinum[currSentenceId])
|
||||
currSentenceId = null
|
||||
}
|
||||
|
||||
|
||||
//elverso=createDivVersoNew(cantica, formaItem[3], 'Canto_' + formaItem[1])
|
||||
elverso = createDivVersoLI(cantica, formaItem[3], 'Canto_' + formaItem[1])
|
||||
setVersiCanto.add(cantica + "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])
|
||||
|
@ -1732,7 +1728,7 @@ function countResultContexts() {
|
|||
|
||||
createSpanPeriodiTag(closeSTag, 'c', ultimaFormaCanto[2] - 1, currSentenceId, elverso, periodinum[currSentenceId])
|
||||
|
||||
//gestione risultati
|
||||
/*//gestione risultati
|
||||
|
||||
if (listaPeriodiRisultato.length) {
|
||||
for (var msid of listaPeriodiRisultato) {
|
||||
|
@ -1757,27 +1753,55 @@ function countResultContexts() {
|
|||
$(idris).addClass("font-weight-bold mark ")
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
function createProemioSpan(idVerso, elementoverso, numberOfComments, spanid) {
|
||||
var spanoccorrenza = $('<span />')
|
||||
spanoccorrenza.attr('id', spanid+'_sp')
|
||||
var proemiooccorrenza = $('<button />')
|
||||
proemiooccorrenza.attr('id', idVerso)
|
||||
|
||||
proemiooccorrenza.attr('class', 'btn btn-sm btn-outline-primary showcomments bg-light border-0 rounded text-primary px-1 pt-1 pb-0 ml-1');
|
||||
|
||||
var commentIcon = '<ion-icon name="document-attach"></ion-icon>';
|
||||
|
||||
proemiooccorrenza.append(commentIcon)
|
||||
|
||||
proemiooccorrenza.appendTo(spanoccorrenza)
|
||||
function manageResults() {
|
||||
if (listaPeriodiRisultato.length) {
|
||||
for (var msid of listaPeriodiRisultato) {
|
||||
loadPeriodo(msid)
|
||||
|
||||
spanoccorrenza.appendTo(elementoverso)
|
||||
}
|
||||
}
|
||||
|
||||
if (listaClausoleRisultato.length) {
|
||||
for (var clsid of listaClausoleRisultato) {
|
||||
let tmpid = clsid.split('-')
|
||||
//loadFrase(tmpid[0], tmpid[1])
|
||||
loadClausola(tmpid[0], tmpid[1], tmpid[2], tmpid[3])
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (listarisultati.length) {
|
||||
//evidenzia risultati
|
||||
for (var ris of listarisultati) {
|
||||
var idris = '#' + ris
|
||||
$(idris).addClass("font-weight-bold mark ")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function createProemioSpan(idVerso, elementoverso, numberOfComments, spanid) {
|
||||
var spanoccorrenza = $('<span />')
|
||||
spanoccorrenza.attr('id', spanid + '_sp')
|
||||
var proemiooccorrenza = $('<button />')
|
||||
proemiooccorrenza.attr('id', idVerso)
|
||||
|
||||
proemiooccorrenza.attr('class', 'btn btn-sm btn-outline-primary showcomments bg-light border-0 rounded text-primary px-1 pt-1 pb-0 ml-1');
|
||||
|
||||
var commentIcon = '<ion-icon name="document-attach"></ion-icon>';
|
||||
|
||||
proemiooccorrenza.append(commentIcon)
|
||||
|
||||
proemiooccorrenza.appendTo(spanoccorrenza)
|
||||
|
||||
spanoccorrenza.appendTo(elementoverso)
|
||||
}
|
||||
|
||||
function createCommentSpan(idVerso, elementoverso, numberOfComments) {
|
||||
var spanoccorrenza = $('<button />')
|
||||
spanoccorrenza.attr('id', idVerso)
|
||||
|
@ -1857,20 +1881,20 @@ function countResultContexts() {
|
|||
spanoccorrenza.appendTo(elementoverso)
|
||||
nbsp.appendTo(elementoverso)
|
||||
}
|
||||
|
||||
|
||||
|
||||
function createDivVersoLI(cantica, num, canto) {
|
||||
|
||||
var elementoverso = createDivVersoGenericLi(cantica, num, canto)
|
||||
let cantoContainer = $('#' + cantica + canto);
|
||||
elementoverso.appendTo(cantoContainer.find('ol'))
|
||||
var elementoversospan=$('<span />')
|
||||
elementoversospan.attr('id', cantica + "_" + canto + "_" + num+'_sp')
|
||||
elementoverso.append(elementoversospan)
|
||||
/*return elementoverso*/
|
||||
return elementoversospan
|
||||
var elementoverso = createDivVersoGenericLi(cantica, num, canto)
|
||||
let cantoContainer = $('#' + cantica + canto);
|
||||
elementoverso.appendTo(cantoContainer.find('ol'))
|
||||
var elementoversospan = $('<span />')
|
||||
elementoversospan.attr('id', cantica + "_" + canto + "_" + num + '_sp')
|
||||
elementoverso.append(elementoversospan)
|
||||
/*return elementoverso*/
|
||||
return elementoversospan
|
||||
|
||||
}
|
||||
}
|
||||
function createDivVersoGenericLi(cantica, num, canto) {
|
||||
/*let digits = num.length*/
|
||||
|
||||
|
@ -1905,7 +1929,7 @@ function countResultContexts() {
|
|||
var divDialoghi = $('<div />')
|
||||
var divMetafore = $('<div />')
|
||||
|
||||
|
||||
|
||||
var titoloDialoghi = $('<h4 class="titolo-canto pb-2" />')
|
||||
var titoloMetafore = $('<h4 class="titolo-canto pb-2" />')
|
||||
|
||||
|
@ -1944,11 +1968,11 @@ function countResultContexts() {
|
|||
var divcanto = $('<div />')
|
||||
var titolocanto = $('<h4 class="titolo-canto pb-2" />')
|
||||
//titolocanto.append(cantica + ", " + cantoRomano)
|
||||
var spantitolocanto=$('<span />')
|
||||
spantitolocanto.attr('id', 'Titolo'+(cantica + canto).replace(" ", "_"))
|
||||
var spantitolocanto = $('<span />')
|
||||
spantitolocanto.attr('id', 'Titolo' + (cantica + canto).replace(" ", "_"))
|
||||
spantitolocanto.append(cantica + ", " + cantoRomano)
|
||||
titolocanto.append(spantitolocanto)
|
||||
|
||||
|
||||
divcanto.attr('class', 'canto pt-3')
|
||||
divcanto.css("display", "none")
|
||||
|
||||
|
@ -2042,11 +2066,11 @@ function countResultContexts() {
|
|||
resultsInCantica.push(cantica);
|
||||
resultsInCanto.push(cantica + canto)
|
||||
}
|
||||
|
||||
|
||||
//cambiare!
|
||||
for (var ip=1; ip<30; ip++){
|
||||
if (binding.has('pos'+ip)){
|
||||
var tp=binding.get('pos'+ip).value;
|
||||
for (var ip = 1; ip < 30; ip++) {
|
||||
if (binding.has('pos' + ip)) {
|
||||
var tp = binding.get('pos' + ip).value;
|
||||
if (!result.has(tp))
|
||||
result.add(tp)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue