tolti commenti, eliminate funzioni non usate
This commit is contained in:
parent
653d25e8ae
commit
53c99fb012
|
|
@ -12,57 +12,38 @@ $(document).ready(function() {
|
||||||
var primaCanticaLoaded = false;
|
var primaCanticaLoaded = false;
|
||||||
var secondaCanticaLoaded = false;
|
var secondaCanticaLoaded = false;
|
||||||
var terzaCanticaLoaded = false;
|
var terzaCanticaLoaded = false;
|
||||||
var listaVersi = new Set()
|
|
||||||
const ddmenus={"Inferno":"#dmc1",
|
|
||||||
"Purgatorio": "#dmc2",
|
|
||||||
"Paradiso": "#dmc3"}
|
|
||||||
|
|
||||||
var currentMinimap = ''
|
var currentMinimap = ''
|
||||||
|
|
||||||
|
|
||||||
//caricamento prima cantica
|
//caricamento prima cantica
|
||||||
$('#cantica1').on('click', function() {
|
$('#cantica1').on('click', function() {
|
||||||
hideMinimap();
|
hideMinimap();
|
||||||
activateMenuItem('#cantica1')
|
|
||||||
if (!(primaCanticaLoaded)) {
|
if (!(primaCanticaLoaded)) {
|
||||||
|
|
||||||
//jsonQuery = versiCantica("Inferno");
|
|
||||||
//execQuery = new sparqlGenerator().stringify(jsonQuery);
|
|
||||||
//executeQueryVersi(execQuery);
|
|
||||||
showCantica('Inferno')
|
showCantica('Inferno')
|
||||||
primaCanticaLoaded = true;
|
primaCanticaLoaded = true;
|
||||||
$(".labelCantica").attr('style', "display: block;");
|
$(".labelCantica").attr('style', "display: block;");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//$("#InfernoCanto_1").attr('style', 'display:block')
|
|
||||||
$("#CantiInferno").attr('style', 'display:block')
|
$("#CantiInferno").attr('style', 'display:block')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//caricamento seconda cantica
|
//caricamento seconda cantica
|
||||||
$('#cantica2').on('click', function() {
|
$('#cantica2').on('click', function() {
|
||||||
hideMinimap();
|
hideMinimap();
|
||||||
activateMenuItem('#cantica2')
|
|
||||||
if (!(secondaCanticaLoaded)) {
|
if (!(secondaCanticaLoaded)) {
|
||||||
|
|
||||||
//jsonQuery = versiCantica("Purgatorio");
|
|
||||||
//execQuery = new sparqlGenerator().stringify(jsonQuery);
|
|
||||||
//executeQueryVersi(execQuery);
|
|
||||||
showCantica('Purgatorio')
|
showCantica('Purgatorio')
|
||||||
secondaCanticaLoaded = true;
|
secondaCanticaLoaded = true;
|
||||||
$(".labelCantica").attr('style', "display: block;");
|
$(".labelCantica").attr('style', "display: block;");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//$("#PurgatorioCanto_1").attr('style', 'display:block')
|
|
||||||
$("#CantiPurgatorio").attr('style', 'display:block')
|
$("#CantiPurgatorio").attr('style', 'display:block')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//caricamento terza cantica
|
//caricamento terza cantica
|
||||||
|
|
@ -75,9 +56,7 @@ $(document).ready(function() {
|
||||||
$(".labelCantica").attr('style', "display: block;");
|
$(".labelCantica").attr('style', "display: block;");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//$("#ParadisoCanto_1").attr('style', 'display:block')
|
|
||||||
$("#CantiParadiso").attr('style', 'display:block')
|
$("#CantiParadiso").attr('style', 'display:block')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -101,6 +80,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
jQuery(document).delegate('.navig-canto', 'click', function(e) {
|
jQuery(document).delegate('.navig-canto', 'click', function(e) {
|
||||||
$('.canto').each(function() {
|
$('.canto').each(function() {
|
||||||
$(this).attr("style", 'display:none');
|
$(this).attr("style", 'display:none');
|
||||||
|
|
@ -133,14 +113,11 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//$('#minimapviewer').on('drag', trackScrollViewer)
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//Query
|
//Query
|
||||||
|
|
||||||
|
|
||||||
//$('#searchcomm').on('click', function() {
|
|
||||||
jQuery(document).delegate('#searchcomm', 'click', function(e) {
|
jQuery(document).delegate('#searchcomm', 'click', function(e) {
|
||||||
|
|
||||||
cleanSearchResult()
|
cleanSearchResult()
|
||||||
|
|
@ -160,8 +137,6 @@ $(document).ready(function() {
|
||||||
|
|
||||||
executeQuerySearch(myquery)
|
executeQuerySearch(myquery)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//Reset
|
//Reset
|
||||||
|
|
@ -178,33 +153,11 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
||||||
|
|
||||||
//activate navigation menu items
|
//activate navigation menu items
|
||||||
|
|
||||||
function activateMenuItem(menuItem) {
|
|
||||||
//$('.blog-nav-item').each(function() {
|
|
||||||
// $(this).attr("class", $(this).attr("class").replace(' active', ''));
|
|
||||||
//});
|
|
||||||
//$(menuItem).attr("class", $(menuItem).attr("class") + ' active');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function managePunctuation(stringa) {
|
|
||||||
var tempstringa=stringa.replaceAll(" ,", ",")
|
|
||||||
tempstringa=tempstringa.replaceAll(" .", ".")
|
|
||||||
tempstringa=tempstringa.replaceAll(" :", ":")
|
|
||||||
tempstringa=tempstringa.replaceAll(" !", "!")
|
|
||||||
tempstringa=tempstringa.replaceAll(" ?", "?")
|
|
||||||
tempstringa=tempstringa.replaceAll(" ;", ";")
|
|
||||||
tempstringa=tempstringa.replaceAll("%20", " ")
|
|
||||||
return tempstringa
|
|
||||||
}
|
|
||||||
|
|
||||||
function cleanSearchResult() {
|
function cleanSearchResult() {
|
||||||
|
|
||||||
for (verso of listarisultati) {
|
for (verso of listarisultati) {
|
||||||
idverso = '#' + verso
|
idverso = '#' + verso
|
||||||
//console.log(idverso)
|
//console.log(idverso)
|
||||||
//$(idverso).attr('class', 'f6 font-weight-lighter')
|
|
||||||
$(idverso).attr('class', 'f6text-secondary text-nowrap font-weight-lighter')
|
$(idverso).attr('class', 'f6text-secondary text-nowrap font-weight-lighter')
|
||||||
}
|
}
|
||||||
$(".badge").remove();
|
$(".badge").remove();
|
||||||
|
|
@ -213,8 +166,8 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
||||||
showMinimap(currentMinimap)
|
showMinimap(currentMinimap)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//START minimap management
|
||||||
|
|
||||||
//minimap management
|
|
||||||
let minimap = document.createElement('div');
|
let minimap = document.createElement('div');
|
||||||
let minimapSize = document.createElement('div');
|
let minimapSize = document.createElement('div');
|
||||||
let viewer = document.createElement('div');
|
let viewer = document.createElement('div');
|
||||||
|
|
@ -225,25 +178,24 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
||||||
|
|
||||||
function showMinimap(element) {
|
function showMinimap(element) {
|
||||||
|
|
||||||
|
|
||||||
mmplace = document.getElementById('displayminimap')
|
mmplace = document.getElementById('displayminimap')
|
||||||
//mmplace=document.getElementById('displaycanto')
|
|
||||||
|
|
||||||
minimap.className = 'minimap__container'
|
minimap.className = 'minimap__container'
|
||||||
|
minimap.id = 'minimapcontainer'
|
||||||
minimapSize.className = 'minimap__size'
|
minimapSize.className = 'minimap__size'
|
||||||
|
minimapSize.id = 'minimapsize'
|
||||||
viewer.className = 'minimap__viewer'
|
viewer.className = 'minimap__viewer'
|
||||||
viewer.id = 'minimapviewer'
|
viewer.id = 'minimapviewer'
|
||||||
minimapContent.className = 'minimap__content'
|
minimapContent.className = 'minimap__content'
|
||||||
//class="col-3 px-0"
|
//class="col-3 px-0"
|
||||||
minimap.append(minimapSize, viewer, minimapContent);
|
minimap.append(minimapSize, viewer, minimapContent);
|
||||||
|
|
||||||
//document.body.appendChild(minimap)
|
|
||||||
mmplace.appendChild(minimap)
|
mmplace.appendChild(minimap)
|
||||||
|
|
||||||
|
|
||||||
let html = document.getElementById(element).outerHTML//innerHTML
|
let html = document.getElementById(element).outerHTML//innerHTML
|
||||||
//console.log(html)
|
//console.log(html)
|
||||||
if (html==null | html=='')
|
if (html == null || html == '')
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let iFrameDoc = minimapContent.contentWindow.document;
|
let iFrameDoc = minimapContent.contentWindow.document;
|
||||||
|
|
@ -279,67 +231,40 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function getDimensions(){
|
|
||||||
cantoplace=document.getElementById(displayId)
|
|
||||||
let bodyWidth= cantoplace.clientWidth;
|
|
||||||
let bodyRatio= bodyWidth/cantoplace.clientHeight
|
|
||||||
//let winRatio=cantoplace.clientWidth / getInnerHeight(cantoplace)
|
|
||||||
let winRatio= window.innerHeight / window.innerWidth;
|
|
||||||
|
|
||||||
|
|
||||||
minimap.style.width='55%';
|
|
||||||
viewer.style.width='55%'
|
|
||||||
|
|
||||||
realScale=minimap.clientWidth / bodyWidth;
|
|
||||||
|
|
||||||
minimapSize.style.paddingTop=`${bodyRatio * 100}%`
|
|
||||||
viewer.style.paddingTop=`${winRatio * 100}%`;
|
|
||||||
minimapContent.style.transform=`scale(${realScale})`;
|
|
||||||
minimapContent.style.width=`${(100/realScale)}%`;
|
|
||||||
minimapContent.style.height=`${(100 / realScale)}%`;
|
|
||||||
|
|
||||||
}
|
|
||||||
function getInnerHeight(elm) {
|
function getInnerHeight(elm) {
|
||||||
var computed = getComputedStyle(elm),
|
var computed = getComputedStyle(elm),
|
||||||
padding = parseInt(computed.paddingTop) + parseInt(computed.paddingBottom);
|
padding = parseInt(computed.paddingTop) + parseInt(computed.paddingBottom);
|
||||||
|
|
||||||
return elm.clientHeight - padding
|
return elm.clientHeight - padding
|
||||||
}
|
}
|
||||||
function getDimensionsDiv(){
|
|
||||||
|
|
||||||
|
function getDimensionsDiv() {
|
||||||
|
|
||||||
cantoplace = document.getElementById(displayId)
|
cantoplace = document.getElementById(displayId)
|
||||||
|
|
||||||
elementplace = document.getElementById(mappedElement)
|
elementplace = document.getElementById(mappedElement)
|
||||||
|
|
||||||
bodyWidth = elementplace.clientWidth;
|
bodyWidth = elementplace.clientWidth;
|
||||||
bodyRatio= elementplace.clientHeight / bodyWidth;
|
let bodyRatio = elementplace.clientHeight / bodyWidth;
|
||||||
//let bodyWidth= cantoplace.clientWidth;
|
|
||||||
//let bodyRatio= cantoplace.clientHeight / bodyWidth;
|
|
||||||
//let winRatio= window.innerHeight / (window.innerWidth);
|
|
||||||
let winRatio = getInnerHeight(cantoplace) / (cantoplace.clientWidth);
|
let winRatio = getInnerHeight(cantoplace) / (cantoplace.clientWidth);
|
||||||
|
|
||||||
|
|
||||||
//minimap.style.width='15%';
|
|
||||||
minimap.style.width = '100%';
|
minimap.style.width = '100%';
|
||||||
|
|
||||||
|
|
||||||
realScale = minimap.clientWidth / bodyWidth;
|
realScale = minimap.clientWidth / bodyWidth;
|
||||||
|
|
||||||
minimapSize.style.paddingTop = `${bodyRatio * 100}%`
|
minimapSize.style.paddingTop = `${bodyRatio * 100}%`
|
||||||
|
|
||||||
viewer.style.paddingTop = `${winRatio * 100}%`;
|
viewer.style.paddingTop = `${winRatio * 100}%`;
|
||||||
minimapContent.style.transform = `scale(${realScale})`;
|
minimapContent.style.transform = `scale(${realScale})`;
|
||||||
minimapContent.style.width = `${(100 / realScale)}%`;
|
minimapContent.style.width = `${(100 / realScale)}%`;
|
||||||
minimapContent.style.height = `${(100 / realScale)}%`;
|
minimapContent.style.height = `${(100 / realScale)}%`;
|
||||||
//minimapContent.style.height=`100%`;
|
|
||||||
minimapContent.style.float='right';
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function trackScroll() {
|
function trackScroll() {
|
||||||
//console.log(window.scrollY)
|
|
||||||
viewer.style.transform = `translateY(${window.scrollY * realScale}px)`
|
viewer.style.transform = `translateY(${window.scrollY * realScale}px)`
|
||||||
}
|
}
|
||||||
function trackScrollCanto() {
|
function trackScrollCanto() {
|
||||||
|
|
@ -353,7 +278,6 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
||||||
|
|
||||||
did.scrollTop = (toppos * (1 / realScale))
|
did.scrollTop = (toppos * (1 / realScale))
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideMinimap() {
|
function hideMinimap() {
|
||||||
|
|
@ -364,17 +288,13 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
||||||
currentMinimap = ''
|
currentMinimap = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
// fa diventare draggable il minimapviewer
|
//END minimap management
|
||||||
|
|
||||||
|
|
||||||
//end minimap management
|
|
||||||
//Cantica management functions
|
//Cantica management functions
|
||||||
|
|
||||||
function showCantica(cantica) {
|
function showCantica(cantica) {
|
||||||
var listaCanti = new Set()
|
var listaCanti = new Set()
|
||||||
var setVersi = new Set()
|
var setVersi = new Set()
|
||||||
var listaVersi = []
|
|
||||||
var listaForme =[]
|
|
||||||
containerForme = formeterza
|
containerForme = formeterza
|
||||||
if (cantica == 'Inferno')
|
if (cantica == 'Inferno')
|
||||||
containerForme = formeprima
|
containerForme = formeprima
|
||||||
|
|
@ -387,13 +307,6 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
||||||
var obj = new Object();
|
var obj = new Object();
|
||||||
var forma = new Object()
|
var forma = new Object()
|
||||||
setVersi = createDivVersi(setVersi, cantica, formaItem[3], 'Canto ' + formaItem[1])
|
setVersi = createDivVersi(setVersi, cantica, formaItem[3], 'Canto ' + formaItem[1])
|
||||||
/*
|
|
||||||
obj.numverso = formaItem[3];
|
|
||||||
|
|
||||||
obj.canto = 'Canto '+formaItem[1];
|
|
||||||
obj.cantica = cantica;
|
|
||||||
listaVersi.push(obj)
|
|
||||||
*/
|
|
||||||
|
|
||||||
forma.numverso = formaItem[3];
|
forma.numverso = formaItem[3];
|
||||||
forma.canto = 'Canto ' + formaItem[1];
|
forma.canto = 'Canto ' + formaItem[1];
|
||||||
|
|
@ -403,9 +316,9 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
||||||
createSpanForme(forma)
|
createSpanForme(forma)
|
||||||
//listaForme.push(forma)
|
//listaForme.push(forma)
|
||||||
}
|
}
|
||||||
//renderData(cantica, listaCanti, listaVersi, listaForme);
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
function createSpanForme(element) {
|
function createSpanForme(element) {
|
||||||
var spanoccorrenza = $('<span />')
|
var spanoccorrenza = $('<span />')
|
||||||
var pos = parseInt(element.pos)
|
var pos = parseInt(element.pos)
|
||||||
|
|
@ -418,15 +331,14 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
||||||
elementoverso.append(' ')
|
elementoverso.append(' ')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDivVersi(setVersi, cantica, num, canto) {
|
function createDivVersi(setVersi, cantica, num, canto) {
|
||||||
if (setVersi.has(cantica + "_" + num + "_" + canto))
|
if (setVersi.has(cantica + "_" + num + "_" + canto))
|
||||||
return setVersi
|
return setVersi
|
||||||
else {
|
else {
|
||||||
var elementoverso = $('<p />')
|
var elementoverso = $('<p />')
|
||||||
|
|
||||||
elementoverso.append(num + ". ")
|
elementoverso.append(num + ". ")
|
||||||
elementoverso.attr("style", "line-height: 0.5em")
|
elementoverso.attr("style", "line-height: 0.5em")
|
||||||
|
|
||||||
elementoverso.attr('class', 'f6 text-secondary text-nowrap font-weight-lighter')
|
elementoverso.attr('class', 'f6 text-secondary text-nowrap font-weight-lighter')
|
||||||
|
|
||||||
elementoverso.attr('id', cantica + "_" + canto.replace(" ", "_") + "_" + num)
|
elementoverso.attr('id', cantica + "_" + canto.replace(" ", "_") + "_" + num)
|
||||||
|
|
@ -453,214 +365,10 @@ jQuery(document).delegate('#cleanresult', 'click', function(e) {
|
||||||
return orderedListaCanti
|
return orderedListaCanti
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderData(cantica, listaCanti, listaVersi, listaForme){
|
// SEARCH
|
||||||
//var orderedListaCanti = Array.from(listaCanti)
|
|
||||||
//orderedListaCanti = orderedListaCanti.sort((a, b) => {
|
|
||||||
// return parseInt(a.split(" ")[1], 10)-parseInt(b.split(" ")[1], 10)
|
|
||||||
//});
|
|
||||||
//var orderedListaVersi = Array.from(listaVersi)
|
|
||||||
//orderedListaVersi = orderedListaVersi.sort((a, b) => {
|
|
||||||
// return parseInt(a.numverso, 10)-parseInt(b.numverso, 10)
|
|
||||||
|
|
||||||
//});
|
|
||||||
|
|
||||||
/*
|
|
||||||
listaVersi = listaVersi.filter((value, index, self) =>
|
|
||||||
index === self.findIndex((t) => (
|
|
||||||
t.numverso === value.numverso && t.canto === value.canto && t.cantica===value.cantica
|
|
||||||
))
|
|
||||||
)*/
|
|
||||||
|
|
||||||
//var orderedListaForme = Array.from(listaForme)
|
|
||||||
//orderedListaForme = orderedListaForme.sort((a, b) => {
|
|
||||||
// return parseInt(a.pos, 10)-parseInt(b.pos, 10)
|
|
||||||
|
|
||||||
//});
|
|
||||||
|
|
||||||
//var divListaCanti = $('<DIV id="Canti' + cantica + '" />')
|
|
||||||
/*
|
|
||||||
for (canto of orderedListaCanti) {
|
|
||||||
|
|
||||||
|
|
||||||
var divcanto = $('<div />')
|
|
||||||
var titolocanto = $('<h4 class="titolo-canto pb-2" />')
|
|
||||||
titolocanto.append(cantica+", "+canto)
|
|
||||||
divcanto.attr('class', 'canto')
|
|
||||||
divcanto.attr('style', 'display:none')
|
|
||||||
divcanto.attr('id', (cantica + canto).replace(" ", "_"))
|
|
||||||
titolocanto.appendTo(divcanto)
|
|
||||||
divcanto.appendTo(' .blog-main')
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
//divListaCanti.appendTo('#listacanti')
|
|
||||||
//divListaCanti.appendTo(ddmenus[cantica])
|
|
||||||
/*
|
|
||||||
for (verso of listaVersi) {
|
|
||||||
|
|
||||||
|
|
||||||
var elementoverso = $('<p />')
|
|
||||||
//vartestoverso=verso.numverso;
|
|
||||||
elementoverso.append(verso.numverso + ". ")
|
|
||||||
elementoverso.attr("style", "line-height: 0.5em")
|
|
||||||
|
|
||||||
elementoverso.attr('class', 'f6 text-secondary text-nowrap font-weight-lighter')
|
|
||||||
//elementoverso.attr('class', 'f6 font-weight-lighter nowrap')
|
|
||||||
elementoverso.attr('id', verso.cantica+"_"+ verso.canto.replace(" ", "_")+"_"+verso.numverso)
|
|
||||||
elementoverso.appendTo('#' + cantica + verso.canto.replace(" ", "_"))
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
listaForme.forEach((element) => {
|
|
||||||
var spanoccorrenza=$('<span />')
|
|
||||||
var pos=parseInt(element.pos)
|
|
||||||
spanoccorrenza.attr('id', element.cantica+"_"+ element.canto.replace(" ", "_")+"_"+element.numverso+"_"+pos)
|
|
||||||
if (listarisultati.length>0 && listarisultati.includes(spanoccorrenza.attr('id')))
|
|
||||||
spanoccorrenza.attr('class', "f6 mark ")
|
|
||||||
spanoccorrenza.append(element.form)
|
|
||||||
elementoverso=$('#'+element.cantica+"_"+ element.canto.replace(" ", "_")+"_"+element.numverso)
|
|
||||||
spanoccorrenza.appendTo(elementoverso)
|
|
||||||
elementoverso.append(' ')
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
// Search functions
|
|
||||||
|
|
||||||
async function executeQueryVersi(query) {
|
|
||||||
bindingsStream = await myEngine.queryBindings(query, { sources: [{ type: 'sparql', value: sparqlEndpoint },], });
|
|
||||||
alert(query)
|
|
||||||
try {
|
|
||||||
|
|
||||||
var listaCanti = new Set()
|
|
||||||
|
|
||||||
listaVersi = new Set()
|
|
||||||
listaForme = new Set()
|
|
||||||
let cantica = 0;
|
|
||||||
bindingsStream.on('data', (binding) => {
|
|
||||||
//cantica
|
|
||||||
cantica = binding.get('Cantica').value;
|
|
||||||
//la lista dei canti
|
|
||||||
listaCanti.add(binding.get('Canto').value)
|
|
||||||
//la lista dei versi
|
|
||||||
var obj = new Object();
|
|
||||||
var forma=new Object()
|
|
||||||
obj.numverso = binding.get('NumeroVerso').value;
|
|
||||||
obj.verso = binding.get('Verso').value;
|
|
||||||
obj.canto = binding.get('Canto').value;
|
|
||||||
//obj.pos = binding.get('pos').value;
|
|
||||||
//obj.form = binding.get('textform').value;
|
|
||||||
obj.cantica = cantica;
|
|
||||||
listaVersi.add(obj)
|
|
||||||
forma.numverso = binding.get('NumeroVerso').value;
|
|
||||||
forma.canto = binding.get('Canto').value;
|
|
||||||
forma.pos = binding.get('pos').value;
|
|
||||||
forma.form = binding.get('textform').value;
|
|
||||||
forma.cantica = cantica;
|
|
||||||
|
|
||||||
listaForme.add(forma)
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
bindingsStream.on('end', () => {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var orderedListaCanti = Array.from(listaCanti)
|
|
||||||
orderedListaCanti = orderedListaCanti.sort((a, b) => {
|
|
||||||
return parseInt(a.split(" ")[1], 10)-parseInt(b.split(" ")[1], 10)
|
|
||||||
//if (parseInt(a.split(" ")[1], 10) < parseInt(b.split(" ")[1]), 10) {
|
|
||||||
// return -1;
|
|
||||||
//}
|
|
||||||
});
|
|
||||||
|
|
||||||
var orderedListaVersi = Array.from(listaVersi)
|
|
||||||
|
|
||||||
orderedListaVersi = orderedListaVersi.sort((a, b) => {
|
|
||||||
return parseInt(a.numverso, 10)-parseInt(b.numverso, 10)
|
|
||||||
//if (parseInt(a.numverso, 10) < parseInt(b.numverso, 10)) {
|
|
||||||
// console.log(parseInt(a.numverso, 10)+' '+parseInt(b.numverso, 10))
|
|
||||||
// return -1;
|
|
||||||
//}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
orderedListaVersi = orderedListaVersi.filter((value, index, self) =>
|
|
||||||
index === self.findIndex((t) => (
|
|
||||||
t.numverso === value.numverso && t.canto === value.canto && t.cantica===value.cantica
|
|
||||||
))
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var orderedListaForme = Array.from(listaForme)
|
|
||||||
orderedListaForme = orderedListaForme.sort((a, b) => {
|
|
||||||
return parseInt(a.pos, 10)-parseInt(b.pos, 10)
|
|
||||||
//if (parseInt(a.pos) < parseInt(b.pos)) {
|
|
||||||
// return -1;
|
|
||||||
//}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
var divListaCanti = $('<DIV id="Canti' + cantica + '" />')
|
|
||||||
for (canto of orderedListaCanti) {
|
|
||||||
var licanto = $('<li class="navig-canto"/>')
|
|
||||||
licanto.attr('name', cantica + canto)
|
|
||||||
licanto.attr('href', "#")
|
|
||||||
licanto.attr("style", "line-height: 1.2em")
|
|
||||||
numcanto=canto.split(" ")[1]
|
|
||||||
licanto.append(numcanto)
|
|
||||||
|
|
||||||
//licanto.appendTo('#listacanti')
|
|
||||||
licanto.appendTo(divListaCanti)
|
|
||||||
var divcanto = $('<div />')
|
|
||||||
var titolocanto = $('<h1 class="f3 titolo-canto" />')
|
|
||||||
titolocanto.append(cantica+", "+canto)
|
|
||||||
divcanto.attr('class', 'canto')
|
|
||||||
divcanto.attr('style', 'display:none')
|
|
||||||
divcanto.attr('id', (cantica + canto).replace(" ", "_"))
|
|
||||||
titolocanto.appendTo(divcanto)
|
|
||||||
divcanto.appendTo(' .blog-main')
|
|
||||||
}
|
|
||||||
//divListaCanti.appendTo('#listacanti')
|
|
||||||
divListaCanti.appendTo(ddmenus[cantica])
|
|
||||||
for (verso of orderedListaVersi) {
|
|
||||||
|
|
||||||
|
|
||||||
var elementoverso = $('<p />')
|
|
||||||
vartestoverso=verso.numverso;
|
|
||||||
elementoverso.append(verso.numverso + ". ")
|
|
||||||
//elementoverso.append(verso.numverso + ". " + managePunctuation(verso.verso))
|
|
||||||
elementoverso.attr("style", "line-height: 0.5em")
|
|
||||||
elementoverso.attr('class', 'f6 font-weight-lighter nowrap')
|
|
||||||
elementoverso.attr('id', verso.cantica+"_"+ verso.canto.replace(" ", "_")+"_"+verso.numverso)
|
|
||||||
elementoverso.appendTo('#' + cantica + verso.canto.replace(" ", "_"))
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
orderedListaForme.forEach((element) => {
|
|
||||||
var spanoccorrenza=$('<span />')
|
|
||||||
var pos=parseInt(element.pos)
|
|
||||||
spanoccorrenza.attr('id', element.cantica+"_"+ element.canto.replace(" ", "_")+"_"+element.numverso+"_"+pos)
|
|
||||||
if (listarisultati.length>0 && listarisultati.includes(spanoccorrenza.attr('id')))
|
|
||||||
spanoccorrenza.attr('class', "f6 b dark-blue ")
|
|
||||||
spanoccorrenza.append(managePunctuation(element.form))
|
|
||||||
elementoverso=$('#'+element.cantica+"_"+ element.canto.replace(" ", "_")+"_"+element.numverso)
|
|
||||||
spanoccorrenza.appendTo(elementoverso)
|
|
||||||
elementoverso.append(' ')
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
console.log(err.message);
|
|
||||||
$("#loader").hide();
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
//execute query
|
//execute query
|
||||||
|
|
||||||
var listarisultati = [];
|
var listarisultati = [];
|
||||||
async function executeQuerySearch(query) {
|
async function executeQuerySearch(query) {
|
||||||
seachbBindingsStream = await myEngine.queryBindings(query, { sources: [{ type: 'sparql', value: sparqlEndpoint },], });
|
seachbBindingsStream = await myEngine.queryBindings(query, { sources: [{ type: 'sparql', value: sparqlEndpoint },], });
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue