gestione citazioni, in progress
This commit is contained in:
parent
c25c00e06d
commit
98ae98c3d4
|
@ -45,7 +45,8 @@ $(document).ready(function() {
|
|||
var showOffset = 30;
|
||||
var idCitazione = "citazioneFrase";
|
||||
|
||||
initComments();
|
||||
//initComments();
|
||||
loadCitazioni();
|
||||
|
||||
resetResult=function(){
|
||||
//console.log('clean result')
|
||||
|
@ -98,6 +99,19 @@ $("#valoreVista").on('change', function() {
|
|||
//loadDialoghi();
|
||||
|
||||
break;
|
||||
case "citazioni":
|
||||
//cancello il grafo sintattico
|
||||
var periodograph=document.getElementById("periodograph");
|
||||
if (periodograph!=null){
|
||||
let showngr=periodograph.getAttribute('name').split("_")
|
||||
var tmpsent=showngr[0]+"_"+showngr[1]+"_s_"+showngr[2];
|
||||
resetSentenceStructure(tmpsent)
|
||||
shownSentenceList.delete(tmpsent)
|
||||
|
||||
//$("#periodograph").empty()
|
||||
periodograph.parentNode.removeChild(periodograph);
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -711,7 +725,29 @@ function resetFrasi(){
|
|||
//$('#tab-list #vis0-tab').tab('show')
|
||||
}
|
||||
}
|
||||
/*INIZIO GESTIONE CITAZIONI*/
|
||||
|
||||
function loadCitazioni(){
|
||||
//"#InfernoCanto_1"
|
||||
console.log('VISTA CITAZIONI!')
|
||||
var mcanto=cantoDisplayed.replace("#",'')
|
||||
cantica=''
|
||||
if (mcanto.startsWith('Inf'))
|
||||
cantica='Inferno'
|
||||
if (mcanto.startsWith('Pur'))
|
||||
cantica='Purgatorio'
|
||||
if (mcanto.startsWith('Par'))
|
||||
cantica='Paradiso'
|
||||
canto=mcanto.split('_')[1]
|
||||
if (canto.length=1)
|
||||
canto='0'+canto
|
||||
console.log(cantica+', '+canto)
|
||||
commentsArray=getVersiConCitazioni(cantica, "01")
|
||||
console.log(commentsArray)
|
||||
}
|
||||
|
||||
|
||||
/*FINE GESTIONE CITAZIONI*/
|
||||
function getCantica(numeroCantica){
|
||||
|
||||
switch (numeroCantica){
|
||||
|
@ -1008,6 +1044,7 @@ function resetFrasi(){
|
|||
spanComment.appendTo(commentArea);
|
||||
|
||||
})
|
||||
/*
|
||||
|
||||
function initComments(){
|
||||
var commentsItem = {}
|
||||
|
@ -1069,11 +1106,11 @@ function resetFrasi(){
|
|||
commentsItem['testoVerso'] = "testo verso";
|
||||
commentsArray.push(commentsItem);
|
||||
}
|
||||
*/
|
||||
|
||||
function getComments(cid){
|
||||
|
||||
var id = cid.substr(9);
|
||||
|
||||
for (var pos in commentsArray){
|
||||
var comments = commentsArray[pos]
|
||||
if (comments.verso == id){
|
||||
|
|
43
js/utils.js
43
js/utils.js
|
@ -936,6 +936,49 @@ function buildsubcategoryClause(sttmnt) {
|
|||
return (subcatstatement)
|
||||
|
||||
}
|
||||
//GESTIONE CITAZIONI
|
||||
function getVersiConCitazioni(canticapar='', cantopar=''){
|
||||
let citcantiche=['Inferno','Purgatorio','Paradiso']
|
||||
if (canticapar==''){
|
||||
citazioni.map(function(item) {
|
||||
console.log(item['Cantica']+', '+item['Canto']+', '+item['Verso']);
|
||||
})
|
||||
return
|
||||
}
|
||||
var citazionitemp=[]
|
||||
citazioni.map(function(item) {
|
||||
if (item['Cantica']==canticapar && item['Canto']==cantopar){
|
||||
//versi.push(item['Verso'])
|
||||
//console.log(item['Cantica']+', '+item['Canto']+', '+item['Verso']);
|
||||
|
||||
//console.log(citcantiche.indexOf(item['Cantica'])+1);
|
||||
//console.log(item['Canto']);
|
||||
tca=item['Canto']
|
||||
if (tca.startsWith('0'))
|
||||
tca=tca.replace('0','')
|
||||
citid=(citcantiche.indexOf(item['Cantica'])+1).toString()+'_'+tca+'_'+item['Verso']
|
||||
console.log(citid)
|
||||
var commentsItem = {}
|
||||
commentsItem['verso'] = citid;
|
||||
commentsItem['annotazione'] = item['Annotazione'];
|
||||
commentsItem['commentario'] = item['Commentario'];
|
||||
commentsItem['frammentoNota'] = item['FrammentoNota'];
|
||||
commentsItem['AutoreCitazione'] = item['InfoCitazione.Autore'];
|
||||
commentsItem['FonteCitazione'] = item['InfoCitazione.Fonte'];
|
||||
commentsItem['LuogoFonteCitazione'] = item['InfoCitazione.LuogoFonte'];
|
||||
commentsItem['NotaFonteCitazione'] = item['InfoCitazione.NotaFonte'];
|
||||
commentsItem['TestoFonteCitazione'] = item['InfoCitazione.TestoFonte'];
|
||||
commentsItem['URLFonteCitazione'] = item['InfoCitazione.UrlFonte'];
|
||||
commentsItem['NaturaRiferimento'] = item['NaturaRiferimento'];
|
||||
commentsItem['RapportoCommentoCommentatoreText'] = item['RapportoCommentoCommentatoreText'];
|
||||
commentsItem['RapportoSoggettoOggetto'] = item['RapportoSoggettoOggetto'];
|
||||
|
||||
citazionitemp.push(commentsItem)
|
||||
}
|
||||
|
||||
})
|
||||
return citazionitemp;
|
||||
}
|
||||
|
||||
|
||||
var sottoCategorie = {
|
||||
|
|
Loading…
Reference in New Issue