aggiunta possibilità di filtering
This commit is contained in:
parent
e6e52c4243
commit
d079a84ea6
|
|
@ -1,9 +1,9 @@
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { getVersiConCitazioni, queryRiferimenti, getListaRis, cleanListaRis, getFormaCntxt, getListaIdCommenti} from './dataMgr_5.0.js';
|
import { getVersiConCitazioni, queryRiferimenti, getListaRis, cleanListaRis, getFormaCntxt, getListaIdCommenti } from './dataMgr_5.0.js';
|
||||||
import { getJsonQuery, emptyStructCard } from './script_5.0.js';
|
import { getJsonQuery, emptyStructCard } from './script_5.0.js';
|
||||||
import {resetGraphStr} from './syntgraph_5.0.js'
|
import { resetGraphStr } from './syntgraph_5.0.js'
|
||||||
|
|
||||||
|
|
||||||
export var resetResult;
|
export var resetResult;
|
||||||
|
|
@ -35,12 +35,12 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
const dialogaltri = 'diaAltri'
|
const dialogaltri = 'diaAltri'
|
||||||
var listaClausoleRisultatoContesti = []
|
var listaClausoleRisultatoContesti = []
|
||||||
|
|
||||||
var listaRisultatiCommenti=[]
|
var listaRisultatiCommenti = []
|
||||||
|
|
||||||
const sparqlGenerator = sparqljs.Generator;
|
const sparqlGenerator = sparqljs.Generator;
|
||||||
const myEngine = new Comunica.QueryEngine();
|
const myEngine = new Comunica.QueryEngine();
|
||||||
|
|
||||||
//const sparqlEndpoint = "https://hdnlab1.isti.cnr.it/fuseki/commedia/query";
|
//const sparqlEndpoint = "https://hdnlab1.isti.cnr.it/fuseki/commedia/query";
|
||||||
const sparqlEndpoint = "https://lida.dantenetwork.it/fuseki/commedia/query";
|
const sparqlEndpoint = "https://lida.dantenetwork.it/fuseki/commedia/query";
|
||||||
|
|
||||||
|
|
@ -57,12 +57,12 @@ $(document).ready(function() {
|
||||||
var loadedCanti = new Set();
|
var loadedCanti = new Set();
|
||||||
const openSTag = "{"
|
const openSTag = "{"
|
||||||
const closeSTag = "}"
|
const closeSTag = "}"
|
||||||
|
|
||||||
cantoDisplayed = "#InfernoCanto_1";
|
cantoDisplayed = "#InfernoCanto_1";
|
||||||
|
|
||||||
var prevCantoDisplayed = "#InfernoCanto_1";
|
var prevCantoDisplayed = "#InfernoCanto_1";
|
||||||
var contextLength = 3;
|
var contextLength = 3;
|
||||||
|
|
||||||
var idCitazione = "citazioneFrase";
|
var idCitazione = "citazioneFrase";
|
||||||
|
|
||||||
initCitazioni();
|
initCitazioni();
|
||||||
|
|
@ -213,7 +213,7 @@ $(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)
|
||||||
$(reit).append(divVersoExp)
|
$(reit).append(divVersoExp)
|
||||||
setVersicontestoExp.add(forma.verso)
|
setVersicontestoExp.add(forma.verso)
|
||||||
}
|
}
|
||||||
|
|
@ -272,12 +272,12 @@ $(document).ready(function() {
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Costruzione e visualizzazione del risultato in frasi.
|
* Costruzione e visualizzazione del risultato in frasi.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
var prevstart = -1
|
var prevstart = -1
|
||||||
var prevoffset = -1
|
var prevoffset = -1
|
||||||
jQuery.manageResultList = function manageResultList(start, offset = showOffset) {
|
jQuery.manageResultList = function manageResultList(start, offset = showOffset) {
|
||||||
|
|
@ -297,7 +297,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
//listarisultati.sort(function(a, b){return a - b});
|
//listarisultati.sort(function(a, b){return a - b});
|
||||||
showFrasi(start, offset)
|
showFrasi(start, offset)
|
||||||
|
|
||||||
if (vistaPeriodi) {
|
if (vistaPeriodi) {
|
||||||
loadFrasi();
|
loadFrasi();
|
||||||
}
|
}
|
||||||
|
|
@ -318,7 +318,7 @@ $(document).ready(function() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
numeroRisultati = numeroRisultati + 1;
|
numeroRisultati = numeroRisultati + 1;
|
||||||
|
|
||||||
ultimaPosizione = getContextLastPosition(risultato, contextLength);
|
ultimaPosizione = getContextLastPosition(risultato, contextLength);
|
||||||
//console.log(ultimaPosizione)
|
//console.log(ultimaPosizione)
|
||||||
}
|
}
|
||||||
|
|
@ -330,7 +330,7 @@ $(document).ready(function() {
|
||||||
if (listaClausoleRisultato.length) {
|
if (listaClausoleRisultato.length) {
|
||||||
numeroContesti = listaClausoleRisultatoContesti.length
|
numeroContesti = listaClausoleRisultatoContesti.length
|
||||||
return (listaClausoleRisultatoContesti.length)
|
return (listaClausoleRisultatoContesti.length)
|
||||||
|
|
||||||
}
|
}
|
||||||
numeroContesti = numeroRisultati
|
numeroContesti = numeroRisultati
|
||||||
return (numeroRisultati)
|
return (numeroRisultati)
|
||||||
|
|
@ -358,11 +358,11 @@ $(document).ready(function() {
|
||||||
res.sort(function(a, b) { return a - b });
|
res.sort(function(a, b) { return a - b });
|
||||||
return (res)
|
return (res)
|
||||||
}
|
}
|
||||||
if (listaClausoleRisultatoContesti.length && !listarisultati.length ) {
|
if (listaClausoleRisultatoContesti.length && !listarisultati.length) {
|
||||||
var lim=endcont
|
var lim = endcont
|
||||||
if (listaClausoleRisultatoContesti.length<=endcont)
|
if (listaClausoleRisultatoContesti.length <= endcont)
|
||||||
lim=listaClausoleRisultatoContesti.length-1
|
lim = listaClausoleRisultatoContesti.length - 1
|
||||||
for (let i=startcont; i<=lim; i++){
|
for (let i = startcont; i <= lim; i++) {
|
||||||
res.push(listaClausoleRisultatoContesti[i])
|
res.push(listaClausoleRisultatoContesti[i])
|
||||||
}
|
}
|
||||||
//res.sort(function(a, b) { puno = a[0].split('-')[3]; pdue = b[0].split('-')[3]; return parseInt(puno) - parseInt(pdue) });
|
//res.sort(function(a, b) { puno = a[0].split('-')[3]; pdue = b[0].split('-')[3]; return parseInt(puno) - parseInt(pdue) });
|
||||||
|
|
@ -392,21 +392,21 @@ $(document).ready(function() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
var versiContesto = ''
|
var versiContesto = ''
|
||||||
var ctxpivot=0
|
var ctxpivot = 0
|
||||||
if (!Array.isArray(risultato)) {
|
if (!Array.isArray(risultato)) {
|
||||||
risultato = parseInt(risultato)
|
risultato = parseInt(risultato)
|
||||||
//getFormaCntxt(risultato, contextLength)
|
//getFormaCntxt(risultato, contextLength)
|
||||||
versiContesto = getFormaContext(risultato, contextLength);
|
versiContesto = getFormaContext(risultato, contextLength);
|
||||||
ctxpivot=risultato
|
ctxpivot = risultato
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
versiContesto = getFraseContext(risultato, contextLength);
|
versiContesto = getFraseContext(risultato, contextLength);
|
||||||
if(versiContesto.length){
|
if (versiContesto.length) {
|
||||||
var tmind=Math.floor(versiContesto.length/2);
|
var tmind = Math.floor(versiContesto.length / 2);
|
||||||
ctxpivot=versiContesto[tmind]['posizione']
|
ctxpivot = versiContesto[tmind]['posizione']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var setVersicontesto = new Set()
|
var setVersicontesto = new Set()
|
||||||
divVerso = ''
|
divVerso = ''
|
||||||
|
|
@ -523,7 +523,7 @@ $(document).ready(function() {
|
||||||
//rimuove il grafo sintattico se c'è'
|
//rimuove il grafo sintattico se c'è'
|
||||||
resetGraphStr()
|
resetGraphStr()
|
||||||
emptyStructCard()
|
emptyStructCard()
|
||||||
|
|
||||||
|
|
||||||
$(cantoDisplayed).css("display", "none");
|
$(cantoDisplayed).css("display", "none");
|
||||||
|
|
||||||
|
|
@ -546,8 +546,8 @@ $(document).ready(function() {
|
||||||
//$("#" + $(this).attr('name').replace(" ", "_")).css("display", "block");
|
//$("#" + $(this).attr('name').replace(" ", "_")).css("display", "block");
|
||||||
$("#" + $(this).attr('name').replace(" ", "_")).attr('style', 'display: d-flex;')
|
$("#" + $(this).attr('name').replace(" ", "_")).attr('style', 'display: d-flex;')
|
||||||
|
|
||||||
var telive=getListaRis()
|
var telive = getListaRis()
|
||||||
for (var tel of telive){
|
for (var tel of telive) {
|
||||||
$(tel).addClass("mark ")
|
$(tel).addClass("mark ")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -654,8 +654,8 @@ $(document).ready(function() {
|
||||||
|
|
||||||
return (cantica + '_' + mcanto.split('_')[1])
|
return (cantica + '_' + mcanto.split('_')[1])
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function loadPeriodo(idperiodo) {
|
function loadPeriodo(idperiodo) {
|
||||||
|
|
||||||
|
|
@ -857,52 +857,52 @@ $(document).ready(function() {
|
||||||
|
|
||||||
async function initCitazioni() {
|
async function initCitazioni() {
|
||||||
//"#InfernoCanto_1"
|
//"#InfernoCanto_1"
|
||||||
var idcantica='1'
|
var idcantica = '1'
|
||||||
var mcanto = cantoDisplayed.replace("#", '')
|
var mcanto = cantoDisplayed.replace("#", '')
|
||||||
var cantica = ''
|
var cantica = ''
|
||||||
if (mcanto.startsWith('Inf'))
|
if (mcanto.startsWith('Inf'))
|
||||||
cantica = 'Inferno'
|
cantica = 'Inferno'
|
||||||
if (mcanto.startsWith('Pur')){
|
if (mcanto.startsWith('Pur')) {
|
||||||
cantica = 'Purgatorio'
|
cantica = 'Purgatorio'
|
||||||
idcantica='2'
|
idcantica = '2'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcanto.startsWith('Par')) {
|
if (mcanto.startsWith('Par')) {
|
||||||
cantica = 'Paradiso'
|
cantica = 'Paradiso'
|
||||||
idcantica='3'
|
idcantica = '3'
|
||||||
}
|
}
|
||||||
var canto = mcanto.split('_')[1]
|
var canto = mcanto.split('_')[1]
|
||||||
var idCommento = "Commento_" + idcantica + "_" + canto + "_";
|
var idCommento = "Commento_" + idcantica + "_" + canto + "_";
|
||||||
var idverso=cantica+'_Canto_'+canto+'_'
|
var idverso = cantica + '_Canto_' + canto + '_'
|
||||||
var idminimap=cantica+'Canto_'+canto
|
var idminimap = cantica + 'Canto_' + canto
|
||||||
/*console.log(myid)*/
|
/*console.log(myid)*/
|
||||||
if (canto.length == 1)
|
if (canto.length == 1)
|
||||||
canto = '0' + canto
|
canto = '0' + canto
|
||||||
//commentsJson = getVersiConCitazioniJson(cantica, canto)
|
//commentsJson = getVersiConCitazioniJson(cantica, canto)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*/
|
*/
|
||||||
var mresult =await getVersiConCitazioni(cantica, canto)
|
var mresult = await getVersiConCitazioni(cantica, canto)
|
||||||
|
|
||||||
commentsSQL= Object.groupBy(mresult, ({ VersoCitazione }) => VersoCitazione);
|
commentsSQL = Object.groupBy(mresult, ({ VersoCitazione }) => VersoCitazione);
|
||||||
|
|
||||||
var tmpkeys=[]
|
var tmpkeys = []
|
||||||
|
|
||||||
for (const ke in commentsSQL){
|
for (const ke in commentsSQL) {
|
||||||
//console.log(ke.split('-')[0])
|
//console.log(ke.split('-')[0])
|
||||||
var t=ke.split('-')[0]
|
var t = ke.split('-')[0]
|
||||||
if (tmpkeys.indexOf(t) == -1)
|
if (tmpkeys.indexOf(t) == -1)
|
||||||
tmpkeys.push(t)
|
tmpkeys.push(t)
|
||||||
else
|
else
|
||||||
continue
|
continue
|
||||||
var pio=$( "#"+idCommento+t)
|
var pio = $("#" + idCommento + t)
|
||||||
if(pio.length)
|
if (pio.length)
|
||||||
break;
|
break;
|
||||||
var elverso=$( "#"+idverso+t)//$("li[value='"+t+"']")
|
var elverso = $("#" + idverso + t)//$("li[value='"+t+"']")
|
||||||
//console.log(elverso)
|
//console.log(elverso)
|
||||||
createCommentSpan(idCommento+t, elverso, commentsSQL[ke].length)
|
createCommentSpan(idCommento + t, elverso, commentsSQL[ke].length)
|
||||||
}
|
}
|
||||||
|
|
||||||
drawMinimap("#" + idminimap, false)
|
drawMinimap("#" + idminimap, false)
|
||||||
//console.log (commentsSQL)
|
//console.log (commentsSQL)
|
||||||
}
|
}
|
||||||
|
|
@ -920,7 +920,7 @@ $(document).ready(function() {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var noteAdded;
|
||||||
jQuery(document).delegate(' .showcomments', 'click', function() {
|
jQuery(document).delegate(' .showcomments', 'click', function() {
|
||||||
var cid = $(this).attr('id');
|
var cid = $(this).attr('id');
|
||||||
if (!hasCommentsJson(cid)) {
|
if (!hasCommentsJson(cid)) {
|
||||||
|
|
@ -941,7 +941,7 @@ $(document).ready(function() {
|
||||||
$("#noteCard0")[0].remove();
|
$("#noteCard0")[0].remove();
|
||||||
}
|
}
|
||||||
var id = cid.substr(9);
|
var id = cid.substr(9);
|
||||||
id=parcid.at(-1)
|
id = parcid.at(-1)
|
||||||
var collapseNote;
|
var collapseNote;
|
||||||
var gruppoVersi;
|
var gruppoVersi;
|
||||||
var versText = "";
|
var versText = "";
|
||||||
|
|
@ -951,29 +951,39 @@ $(document).ready(function() {
|
||||||
var currentGroup;
|
var currentGroup;
|
||||||
|
|
||||||
allGrouplKeys.sort().some(function(k) {
|
allGrouplKeys.sort().some(function(k) {
|
||||||
if (k == id || k.startsWith(id+'-')){ //~k.indexOf(id + '-')) {
|
if (k == id || k.startsWith(id + '-')) { //~k.indexOf(id + '-')) {
|
||||||
//console.log('gruppo commenti '+k)
|
//console.log('gruppo commenti '+k)
|
||||||
console.log(commentsSQL[k].length)
|
console.log(commentsSQL[k].length)
|
||||||
//gruppoVersi = k.split("_").slice(-1)[0]
|
//gruppoVersi = k.split("_").slice(-1)[0]
|
||||||
gruppoVersi=k
|
gruppoVersi = k
|
||||||
if (gruppoVersi.includes("-")) {
|
if (gruppoVersi.includes("-")) {
|
||||||
versText = ", Versi " + gruppoVersi;
|
versText = ", Versi " + gruppoVersi;
|
||||||
} else {
|
} else {
|
||||||
versText = ", Verso " + gruppoVersi;
|
versText = ", Verso " + gruppoVersi;
|
||||||
}
|
}
|
||||||
|
var queryComment = false;
|
||||||
currentGroup = createNoteGroup(cantica, getRoman(parcid[2]), versText, k, commentsSQL[k].length)
|
if (parcid[0] == "CommentoQuery") {
|
||||||
commentsSQL[k].forEach(function(value, i) {
|
queryComment = true;
|
||||||
currentGroup.append(createNoteEntry(value, k, i))
|
}
|
||||||
});
|
currentGroup = createNoteGroup(cantica, getRoman(parcid[2]), versText, k, commentsSQL[k].length, queryComment)
|
||||||
commentArea.append(currentGroup);
|
noteAdded = false;
|
||||||
|
commentsSQL[k].forEach(function(value, i) {
|
||||||
|
currentGroup.append(createNoteEntry(value, k, i, queryComment))
|
||||||
|
});
|
||||||
|
if (queryComment){ //Nik changes
|
||||||
|
if (noteAdded){
|
||||||
|
commentArea.append(currentGroup);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
commentArea.append(currentGroup);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$('#tab-list #vis0-tab').tab('show')
|
$('#tab-list #vis0-tab').tab('show')
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
function createNoteGroup(cantica, canto, versi, id, len) {
|
function createNoteGroup(cantica, canto, versi, id, len, queryComment) {
|
||||||
var noteGroupCard = $('<div class="card card-body noteCardGroup well well-sm mx-1 my-2 p-0" id="noteGroupCard' + id + '">');
|
var noteGroupCard = $('<div class="card card-body noteCardGroup well well-sm mx-1 my-2 p-0" id="noteGroupCard' + id + '">');
|
||||||
var commentHeader = $('<div class="d-flex align-content-start flex-nowrap text-muted" id="commentoGruppoVersi' + id + '">')
|
var commentHeader = $('<div class="d-flex align-content-start flex-nowrap text-muted" id="commentoGruppoVersi' + id + '">')
|
||||||
var rigaNota = $('<div class="p-0 m-0">');
|
var rigaNota = $('<div class="p-0 m-0">');
|
||||||
|
|
@ -985,26 +995,51 @@ $(document).ready(function() {
|
||||||
if (len > 1) {
|
if (len > 1) {
|
||||||
var commentiSP = " commenti su "
|
var commentiSP = " commenti su "
|
||||||
} else {
|
} else {
|
||||||
var commentiSP = " commento su "
|
var commentiSP = " commento su " // Nik riferimenti modificare con funzione successiva
|
||||||
}
|
}
|
||||||
//noteGroupCard.append('<h6 class="card-title m-2 text-warning">' + cantica + ", Canto " + canto + versi + "</h6>");
|
//noteGroupCard.append('<h6 class="card-title m-2 text-warning">' + cantica + ", Canto " + canto + versi + "</h6>");
|
||||||
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>");
|
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>");
|
||||||
rigaNota.appendTo(commentHeader);
|
rigaNota.appendTo(commentHeader);
|
||||||
|
if (queryComment) {
|
||||||
|
var filterButton = $('<button />'); // Nik da migliorare
|
||||||
|
filterButton.attr('id', 'filterRiferimentiOn_' + id + '_' + canto)
|
||||||
|
filterButton.attr('class', 'btn btn-sm btn-outline-primary showQueryComments border-0 rounded text-primary px-1 pt-1 pb-0 ml-1');
|
||||||
|
var filterIcon = '<ion-icon name="funnel"></ion-icon>';
|
||||||
|
var filterIcon1 = '<ion-icon name="funnel-outline"></ion-icon>';
|
||||||
|
var filterButton1 = $('<button />'); // Nik da migliorare
|
||||||
|
filterButton1.attr('id', 'filterRiferimentiOff_' + id + '_' + canto)
|
||||||
|
filterButton1.attr('class', 'btn btn-sm btn-outline-primary showQueryComments border-0 rounded text-primary px-1 pt-1 pb-0 ml-1');
|
||||||
|
filterButton1.append(filterIcon1)
|
||||||
|
filterButton1.css('display', 'none');
|
||||||
|
filterButton.append(filterIcon)
|
||||||
|
filterButton.appendTo(commentHeader)
|
||||||
|
filterButton1.appendTo(commentHeader)
|
||||||
|
} else {
|
||||||
|
$('#'+'filterRiferimentiOn_' + id + '_' + canto).remove()
|
||||||
|
$('#'+'filterRiferimentiOff_' + id + '_' + canto).remove()
|
||||||
|
}
|
||||||
|
|
||||||
buttons.appendTo(commentHeader);
|
buttons.appendTo(commentHeader);
|
||||||
commentHeader.appendTo(noteGroupCard);
|
commentHeader.appendTo(noteGroupCard);
|
||||||
|
|
||||||
return noteGroupCard;
|
return noteGroupCard;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createNoteEntry(comments, id, pos) {
|
function createNoteEntry(comments, id, pos, queryComment) {
|
||||||
const tmplistaidcomm=getListaIdCommenti()
|
const tmplistaidcomm = getListaIdCommenti()
|
||||||
var idref=comments.Id
|
var idref = comments.Id
|
||||||
if(tmplistaidcomm.length && tmplistaidcomm.includes(idref)){
|
|
||||||
var noteCard = $('<div class="card card-body border-success well well-sm mx-1 mb-1 mt-0 p-0" id="noteCard' + id + '_' + pos +'"'+ ' name= "'+idref+'">');
|
|
||||||
}
|
|
||||||
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+'">');
|
|
||||||
|
|
||||||
|
if (tmplistaidcomm.length && tmplistaidcomm.includes(idref)) { // Nik riferimenti
|
||||||
|
var noteCard = $('<div class="card card-body bg-light border-success well well-sm mx-1 mb-1 mt-0 p-0" id="noteCard' + id + '_' + pos + '"' + ' name= "' + idref + '">');
|
||||||
|
noteAdded = true;
|
||||||
|
}
|
||||||
|
else { //Nik changes
|
||||||
|
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){
|
||||||
|
noteCard.css("display", "none");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
var collapseCardBody = $('<div class="card-body px-0 py-1 mx-3 my-0 border-top rounded" >');
|
var collapseCardBody = $('<div class="card-body px-0 py-1 mx-3 my-0 border-top rounded" >');
|
||||||
var divCampiSingoli = $('<div class="d-flex align-content-start flex-wrap text-muted">');
|
var divCampiSingoli = $('<div class="d-flex align-content-start flex-wrap text-muted">');
|
||||||
//createNoteHeader(noteCard, comments, id, pos, cantica, parcid, saveVersoCitazione);
|
//createNoteHeader(noteCard, comments, id, pos, cantica, parcid, saveVersoCitazione);
|
||||||
|
|
@ -1194,7 +1229,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
function createModuleCommentatore(collapse, commento, num, id, pos) {
|
function createModuleCommentatore(collapse, commento, num, id, pos) {
|
||||||
|
|
||||||
let tmpcomm = commento
|
let tmpcomm = commento
|
||||||
let jsonCommento = JSON.parse(tmpcomm.replaceAll("'", '"').replaceAll("+", '"'));
|
let jsonCommento = JSON.parse(tmpcomm.replaceAll("'", '"').replaceAll("+", '"'));
|
||||||
/*var minLength = (($('#displaynote').width() / ($('#Test').width() / 32)) * 2 * 1.63);*/
|
/*var minLength = (($('#displaynote').width() / ($('#Test').width() / 32)) * 2 * 1.63);*/
|
||||||
var divContent = $('<div class="d-flex align-content-start flex-wrap text-muted">');
|
var divContent = $('<div class="d-flex align-content-start flex-wrap text-muted">');
|
||||||
|
|
@ -1202,9 +1237,9 @@ $(document).ready(function() {
|
||||||
var nota = '';
|
var nota = '';
|
||||||
var lenmod = 0
|
var lenmod = 0
|
||||||
for (var el in jsonCommento) {
|
for (var el in jsonCommento) {
|
||||||
|
|
||||||
var tmpcc=JSON.parse(jsonCommento[el])
|
var tmpcc = JSON.parse(jsonCommento[el])
|
||||||
console.log(' el '+tmpcc)
|
console.log(' el ' + tmpcc)
|
||||||
var urlCommento = tmpcc["Commento"];
|
var urlCommento = tmpcc["Commento"];
|
||||||
|
|
||||||
var esitoCommento = tmpcc.Rapporto;
|
var esitoCommento = tmpcc.Rapporto;
|
||||||
|
|
@ -1282,14 +1317,14 @@ $(document).ready(function() {
|
||||||
divFrammAnnot.appendTo(collapse);
|
divFrammAnnot.appendTo(collapse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function hasCommentsJson(cid) {
|
function hasCommentsJson(cid) {
|
||||||
|
|
||||||
|
|
||||||
var id = cid.split('_').at(-1)
|
var id = cid.split('_').at(-1)
|
||||||
for (const [keyt, value] of Object.entries(commentsSQL)) {
|
for (const [keyt, value] of Object.entries(commentsSQL)) {
|
||||||
if (keyt == id || keyt.startsWith(id+'-')) {
|
if (keyt == id || keyt.startsWith(id + '-')) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1304,10 +1339,10 @@ $(document).ready(function() {
|
||||||
*/
|
*/
|
||||||
function numberOfCommentsJson(cid) {
|
function numberOfCommentsJson(cid) {
|
||||||
var cntc = 0
|
var cntc = 0
|
||||||
|
|
||||||
var id=cid.split('_').at(-1)
|
var id = cid.split('_').at(-1)
|
||||||
for (const keyt in commentsSQL){
|
for (const keyt in commentsSQL) {
|
||||||
if (keyt==id) {
|
if (keyt == id) {
|
||||||
cntc = commentsSQL[keyt].length
|
cntc = commentsSQL[keyt].length
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
@ -1428,7 +1463,7 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanSearchResult() {
|
function cleanSearchResult() {
|
||||||
|
|
||||||
$("#headingZero").closest('.card').css("display", "none");
|
$("#headingZero").closest('.card').css("display", "none");
|
||||||
$("#collapseZero").collapse('hide');
|
$("#collapseZero").collapse('hide');
|
||||||
$("#vistaFrasi").empty()
|
$("#vistaFrasi").empty()
|
||||||
|
|
@ -1473,20 +1508,20 @@ $(document).ready(function() {
|
||||||
//manageMM (cantoDisplayed)
|
//manageMM (cantoDisplayed)
|
||||||
//var currPage = 0;
|
//var currPage = 0;
|
||||||
//var latestPhraseId = "";
|
//var latestPhraseId = "";
|
||||||
var telive=getListaRis()
|
var telive = getListaRis()
|
||||||
for (var ve of telive) {
|
for (var ve of telive) {
|
||||||
//let idve = ve
|
//let idve = ve
|
||||||
$(ve).removeClass("mark ")
|
$(ve).removeClass("mark ")
|
||||||
minim.contents().find(ve).removeClass("mark ")
|
minim.contents().find(ve).removeClass("mark ")
|
||||||
}
|
}
|
||||||
const tmplistaidcomm=getListaIdCommenti()
|
const tmplistaidcomm = getListaIdCommenti()
|
||||||
for (var idco of tmplistaidcomm){
|
for (var idco of tmplistaidcomm) {
|
||||||
//$('[name="' + cantica + 'Canto ' + k + '"]')
|
//$('[name="' + cantica + 'Canto ' + k + '"]')
|
||||||
$('[name="' + idco + '"]').removeClass('border-success ')
|
$('[name="' + idco + '"]').removeClass('border-success ') // Nik riferimenti
|
||||||
}
|
}
|
||||||
cleanListaRis()
|
cleanListaRis()
|
||||||
drawMinimap(cantoDisplayed, true)
|
drawMinimap(cantoDisplayed, true)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*function manageMM(name) {
|
/*function manageMM(name) {
|
||||||
|
|
@ -1511,8 +1546,8 @@ $(document).ready(function() {
|
||||||
unitaRicerca = 'forma'
|
unitaRicerca = 'forma'
|
||||||
else
|
else
|
||||||
unitaRicerca = jsonQuery['unitaRicerca']
|
unitaRicerca = jsonQuery['unitaRicerca']
|
||||||
if (unitaRicerca=='riferimenti'){
|
if (unitaRicerca == 'riferimenti') {
|
||||||
listaRisultatiCommenti=queryRiferimenti(jsonQuery.Riferimento100, cantoDisplayed)
|
listaRisultatiCommenti = queryRiferimenti(jsonQuery.Riferimento100, cantoDisplayed)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log("got json query, unita ricerca: " + unitaRicerca)
|
console.log("got json query, unita ricerca: " + unitaRicerca)
|
||||||
|
|
@ -1710,7 +1745,7 @@ $(document).ready(function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createCommentSpan(idVerso, elementoverso, numberOfComments) {
|
function createCommentSpan(idVerso, elementoverso, numberOfComments) {
|
||||||
|
|
@ -1924,7 +1959,7 @@ $(document).ready(function() {
|
||||||
var cantica = 'Nessuna'
|
var cantica = 'Nessuna'
|
||||||
var canto = 'Canto 0'
|
var canto = 'Canto 0'
|
||||||
//var numverso=0
|
//var numverso=0
|
||||||
var pos=0
|
var pos = 0
|
||||||
seachbBindingsStream.on('data', (binding) => {
|
seachbBindingsStream.on('data', (binding) => {
|
||||||
|
|
||||||
//cantica
|
//cantica
|
||||||
|
|
@ -2024,7 +2059,7 @@ $(document).ready(function() {
|
||||||
//if (!resSent.has(fraseItems[0] + '-' + fraseItems[3])) {
|
//if (!resSent.has(fraseItems[0] + '-' + fraseItems[3])) {
|
||||||
let tmpocc = fraseItems.slice(-1)
|
let tmpocc = fraseItems.slice(-1)
|
||||||
|
|
||||||
if (resClauses.filter(clocc => clocc == tmpocc[0]).length == 0 || tmpocc[0]=='') {
|
if (resClauses.filter(clocc => clocc == tmpocc[0]).length == 0 || tmpocc[0] == '') {
|
||||||
resClauses.push(tmpocc[0]);
|
resClauses.push(tmpocc[0]);
|
||||||
//resSent.add(fraseItems[0] + '-' + fraseItems[3]+'-'+fraseItems[1] + '-' + fraseItems[2]);
|
//resSent.add(fraseItems[0] + '-' + fraseItems[3]+'-'+fraseItems[1] + '-' + fraseItems[2]);
|
||||||
resSentence.add(fraseItems[1] + '-' + fraseItems[2]);
|
resSentence.add(fraseItems[1] + '-' + fraseItems[2]);
|
||||||
|
|
@ -2132,8 +2167,8 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
tempr.forEach(y => listaClausoleRisultatoContesti.push(listaClausoleRisultato.filter(x => (x.split('-')[0] == y) && x.split('-').length > 1)))
|
tempr.forEach(y => listaClausoleRisultatoContesti.push(listaClausoleRisultato.filter(x => (x.split('-')[0] == y) && x.split('-').length > 1)))
|
||||||
}
|
}
|
||||||
|
|
||||||
//aggiunge badge con totale risultati accanto alle cantiche
|
//aggiunge badge con totale risultati accanto alle cantiche
|
||||||
|
|
||||||
var totResultN = showBadgeInCantica(resultsInCantica)
|
var totResultN = showBadgeInCantica(resultsInCantica)
|
||||||
|
|
@ -2152,8 +2187,8 @@ $(document).ready(function() {
|
||||||
showBadgeInCanto(resultsInCanto)
|
showBadgeInCanto(resultsInCanto)
|
||||||
|
|
||||||
console.log('badge end...')
|
console.log('badge end...')
|
||||||
//calcolo numero dei contesti
|
//calcolo numero dei contesti
|
||||||
countResultContexts()
|
countResultContexts()
|
||||||
$("#loader").fadeOut(300);
|
$("#loader").fadeOut(300);
|
||||||
// mostra lista risultati
|
// mostra lista risultati
|
||||||
//$.manageResultList(0, showOffset);
|
//$.manageResultList(0, showOffset);
|
||||||
|
|
@ -2163,8 +2198,8 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
//var queryExecuted = true;
|
//var queryExecuted = true;
|
||||||
//$(cantoDisplayed).attr('style', 'display: d-flex;');
|
//$(cantoDisplayed).attr('style', 'display: d-flex;');
|
||||||
/* $("#cantica0").trigger("click");
|
/* $("#cantica0").trigger("click");
|
||||||
$("#vistaFrasi").css("display", "none");*/
|
$("#vistaFrasi").css("display", "none");*/
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ export function getListaRis() {
|
||||||
return listaidversi;
|
return listaidversi;
|
||||||
}
|
}
|
||||||
export function getListaIdCommenti() {
|
export function getListaIdCommenti() {
|
||||||
return listaidcommenti;
|
return listaidcommenti; // Nik riferimenti
|
||||||
}
|
}
|
||||||
export function cleanListaRis() {
|
export function cleanListaRis() {
|
||||||
listaidversi = [];
|
listaidversi = [];
|
||||||
|
|
@ -266,8 +266,20 @@ export async function queryRiferimenti(filtro, cid) {
|
||||||
//console.log(myveid)
|
//console.log(myveid)
|
||||||
listaidversi.push(myveid)
|
listaidversi.push(myveid)
|
||||||
listaidcommenti.push(tmpvi.IdRiferimento)
|
listaidcommenti.push(tmpvi.IdRiferimento)
|
||||||
if (cid.includes(cantica) && numcid == canto)
|
if (cid.includes(cantica) && numcid == canto){
|
||||||
$(myveid).addClass("mark ")
|
var multiButton = $('<button />');
|
||||||
|
multiButton.attr('id','CommentoQuery_'+ i + '_' + canto + '_' + tmpvi.Verso.split('-')[0])
|
||||||
|
multiButton.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>';
|
||||||
|
multiButton.append (commentIcon)
|
||||||
|
var idButton = null;
|
||||||
|
idButton = $('#'+ 'CommentoQuery_'+ i + '_' + canto + '_' + tmpvi.Verso.split('-')[0]);
|
||||||
|
if (idButton [0] == null){
|
||||||
|
$(myveid).append(multiButton);
|
||||||
|
}
|
||||||
|
$(myveid).addClass("mark ") // Nik Riferimenti
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ $(document).ready(function() {
|
||||||
setStyle(newStyle);
|
setStyle(newStyle);
|
||||||
});
|
});
|
||||||
$('#btnParentesi').on('click', function() {
|
$('#btnParentesi').on('click', function() {
|
||||||
var fava = $("#parentesiAperta1");
|
|
||||||
$("#parentesiAperta1").attr('style', "display: d-flex;");
|
$("#parentesiAperta1").attr('style', "display: d-flex;");
|
||||||
$("#parentesiChiusa2").attr('style', "display: d-flex;");
|
$("#parentesiChiusa2").attr('style', "display: d-flex;");
|
||||||
});
|
});
|
||||||
|
|
@ -166,6 +165,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
if (tabID == 0) {
|
if (tabID == 0) {
|
||||||
tabID++;
|
tabID++;
|
||||||
|
// Fake Nik Parentesi
|
||||||
$('#sortable0').append('<h3 class="text-primary " id="parentesiAperta1" style="display: none;">(<br></h3>');
|
$('#sortable0').append('<h3 class="text-primary " id="parentesiAperta1" style="display: none;">(<br></h3>');
|
||||||
|
|
||||||
addGramCla("#sortable0", 1, tabID, 1);
|
addGramCla("#sortable0", 1, tabID, 1);
|
||||||
|
|
@ -1159,6 +1159,8 @@ $(document).ready(function() {
|
||||||
$(sortableId).append(boolCond)
|
$(sortableId).append(boolCond)
|
||||||
$(sortableId).append($(cloneLI)[0]);
|
$(sortableId).append($(cloneLI)[0]);
|
||||||
if (tabID == 2){
|
if (tabID == 2){
|
||||||
|
// Fake Nik Parentesi
|
||||||
|
|
||||||
$(sortableId).append('<h3 class="text-primary " id="parentesiChiusa2" style="display: none;">)<br></h3>');
|
$(sortableId).append('<h3 class="text-primary " id="parentesiChiusa2" style="display: none;">)<br></h3>');
|
||||||
}
|
}
|
||||||
if (toExpand == 1) {
|
if (toExpand == 1) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue