impl gestione chiusura tab dei grafi sintattici
This commit is contained in:
parent
fb1e732cca
commit
dbb6e6525a
|
@ -73,17 +73,8 @@ $("#valoreVista").on('change', function() {
|
||||||
break;
|
break;
|
||||||
case "frasi":
|
case "frasi":
|
||||||
//cancello il grafo sintattico
|
//cancello il grafo sintattico
|
||||||
var periodograph=document.getElementById("periodograph");
|
resetGraphStruct()
|
||||||
if (periodograph!=null){
|
emptyStructCard()
|
||||||
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);
|
|
||||||
|
|
||||||
}
|
|
||||||
loadFrasi();
|
loadFrasi();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -93,20 +84,15 @@ $("#valoreVista").on('change', function() {
|
||||||
break;
|
break;
|
||||||
case "dialoghi":
|
case "dialoghi":
|
||||||
resetFrasi()
|
resetFrasi()
|
||||||
|
resetGraphStruct()
|
||||||
|
emptyStructCard()
|
||||||
loadDialoghi();
|
loadDialoghi();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case "citazioni":
|
case "citazioni":
|
||||||
//cancello il grafo sintattico
|
//cancello il grafo sintattico
|
||||||
var periodograph=document.getElementById("periodograph");
|
resetGraphStruct()
|
||||||
if (periodograph!=null){
|
emptyStructCard()
|
||||||
let showngr=periodograph.getAttribute('name').split("_")
|
|
||||||
var tmpsent=showngr[0]+"_"+showngr[1]+"_s_"+showngr[2];
|
|
||||||
resetSentenceStructure(tmpsent)
|
|
||||||
shownSentenceList.delete(tmpsent)
|
|
||||||
|
|
||||||
periodograph.parentNode.removeChild(periodograph);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -461,18 +447,8 @@ $(" ."+formaClass).hover(function(idx, element) {
|
||||||
$("#vistaFrasi").css("display", "none");
|
$("#vistaFrasi").css("display", "none");
|
||||||
|
|
||||||
//rimuove il grafo sintattico se c'è'
|
//rimuove il grafo sintattico se c'è'
|
||||||
var periodograph=document.getElementById("periodograph");
|
resetGraphStruct()
|
||||||
|
emptyStructCard()
|
||||||
if (periodograph!=null){
|
|
||||||
let showngr=periodograph.getAttribute('name').split("_")
|
|
||||||
var tmpsent=showngr[0]+"_"+showngr[1]+"_s_"+showngr[2];
|
|
||||||
if (shownSentenceList.has(tmpsent)){
|
|
||||||
lisid=''
|
|
||||||
resetSentenceStructure(tmpsent)
|
|
||||||
shownSentenceList.delete(tmpsent)
|
|
||||||
}
|
|
||||||
$("#periodograph").empty()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$(cantoDisplayed).css("display", "none");
|
$(cantoDisplayed).css("display", "none");
|
||||||
|
@ -795,18 +771,8 @@ function resetFrasi(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//cancello il grafo sintattico
|
//cancello il grafo sintattico
|
||||||
var periodograph=document.getElementById("periodograph");
|
resetGraphStruct()
|
||||||
if (periodograph!=null){
|
emptyStructCard()
|
||||||
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);
|
|
||||||
//$('#tab-list #vis0-tab').tab('show')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*INIZIO GESTIONE CITAZIONI*/
|
/*INIZIO GESTIONE CITAZIONI*/
|
||||||
|
|
||||||
|
|
|
@ -449,6 +449,7 @@ $(document).ready(function() {
|
||||||
//$('#displayinfo').append($(emptyInfo))
|
//$('#displayinfo').append($(emptyInfo))
|
||||||
$('#infoCard0').attr('style', "display: flex;");
|
$('#infoCard0').attr('style', "display: flex;");
|
||||||
$('#structGroupCard0').attr('style', "display: none;");
|
$('#structGroupCard0').attr('style', "display: none;");
|
||||||
|
resetGraphStruct()
|
||||||
});
|
});
|
||||||
|
|
||||||
// Variabili JSON per i filtri
|
// Variabili JSON per i filtri
|
||||||
|
|
|
@ -12,49 +12,16 @@ const runtime1 = new Runtime(new Library(name => {
|
||||||
case "d3@^6.0": return d3;
|
case "d3@^6.0": return d3;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener("dblclick", function(e){
|
document.addEventListener("dblclick", function(e){
|
||||||
const target = e.target.closest("."+formaClass);
|
const target = e.target.closest("."+formaClass);
|
||||||
|
|
||||||
if(target){
|
if(target){
|
||||||
|
|
||||||
|
if (locResetGraphStruct())
|
||||||
|
return
|
||||||
|
|
||||||
var periodograph=document.getElementById("periodograph");
|
|
||||||
|
|
||||||
if (periodograph!=null){
|
|
||||||
//console.log('val '+document.getElementById("periodograph").getAttribute('name'))
|
|
||||||
let showngr=document.getElementById("periodograph").getAttribute('name').split("_")
|
|
||||||
var tmpsent=showngr[0]+"_"+showngr[1]+"_s_"+showngr[2]
|
|
||||||
periodograph.parentNode.removeChild(periodograph);
|
|
||||||
|
|
||||||
//var sentence = document.getElementsByClassName(lsentid);
|
|
||||||
var sentence = document.getElementsByClassName(tmpsent);
|
|
||||||
|
|
||||||
for (let i = 0; i < sentence.length; i++) {
|
|
||||||
//var matches = listaClausoleRisultato.filter(s => s.includes(sentence[i].classList[0]));
|
|
||||||
sentence[i].classList.remove('font-italic');
|
|
||||||
if (selectedVista!='frasi' && !listaPeriodiRisultato.includes(tmpsent))
|
|
||||||
sentence[i].style.removeProperty('color');
|
|
||||||
|
|
||||||
sentence[i].classList.remove('font-weight-normal');
|
|
||||||
|
|
||||||
}
|
|
||||||
//console.log('matches for clausole '+matches)
|
|
||||||
|
|
||||||
|
|
||||||
//$('#tab-list #vis0-tab').tab('show')
|
|
||||||
resetMinimap(tmpsent)
|
|
||||||
|
|
||||||
emptyStructCard()
|
|
||||||
|
|
||||||
if (tmpsent==lsentid){
|
|
||||||
|
|
||||||
//showMinimap()
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
var hcontainer="#structCard0"
|
var hcontainer="#structCard0"
|
||||||
|
|
||||||
var main=runtime1.module(commarc, name => {
|
var main=runtime1.module(commarc, name => {
|
||||||
|
@ -71,14 +38,10 @@ document.addEventListener("dblclick", function(e){
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//main.redefine("links", d3.csv("https://hdnlab1.isti.cnr.it/d3search/node_modules/commarcdiag/files/parsint_mod_completo_pre_new_4.csv", d3.autoType));
|
|
||||||
|
|
||||||
if (lisid!=''){
|
if (lisid!=''){
|
||||||
var mywidth=document.getElementById('displaycanto').offsetWidth
|
//var mywidth=document.getElementById('displaycanto').offsetWidth
|
||||||
|
|
||||||
console.log('here graph '+lisid+' '+lsentid)
|
console.log('here graph '+lisid+' '+lsentid)
|
||||||
var structContainer=document.getElementById("structCard0");
|
|
||||||
|
|
||||||
|
|
||||||
main.redefine('width', 645);
|
main.redefine('width', 645);
|
||||||
|
@ -89,16 +52,11 @@ document.addEventListener("dblclick", function(e){
|
||||||
var structid=stid[0]+'_'+stid[1]+'_'+structel[0].parentNode.getAttribute('value')
|
var structid=stid[0]+'_'+stid[1]+'_'+structel[0].parentNode.getAttribute('value')
|
||||||
|
|
||||||
fillStructCard(structid)
|
fillStructCard(structid)
|
||||||
|
|
||||||
var collection = document.getElementsByClassName(lsentid);
|
var collection = document.getElementsByClassName(lsentid);
|
||||||
for (let i = 0; i < collection.length; i++) {
|
for (let i = 0; i < collection.length; i++) {
|
||||||
//collection[i].classList.add('font-weight-normal');
|
//collection[i].classList.add('font-weight-normal');
|
||||||
collection[i].classList.add('font-italic');
|
collection[i].classList.add('font-italic');
|
||||||
//collection[i].classList.add('text-info');
|
|
||||||
//console.log(collection[i].className)
|
|
||||||
|
|
||||||
|
|
||||||
//console.log(maptypes[synttp]+' '+maptypestopalette[synttp]+', '+colorssp(maptypestopalette[synttp]))
|
|
||||||
//collection[i].style.background = colorssp(maptypestopalette[synttp]);
|
|
||||||
if (selectedVista!='frasi'){
|
if (selectedVista!='frasi'){
|
||||||
var synttp=collection[i].className.split(" ")[1]
|
var synttp=collection[i].className.split(" ")[1]
|
||||||
collection[i].style.color = colorssp(mapsynttypestopalette[synttp]);
|
collection[i].style.color = colorssp(mapsynttypestopalette[synttp]);
|
||||||
|
@ -117,10 +75,9 @@ document.addEventListener("dblclick", function(e){
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//showMinimap()
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//manage clauses
|
|
||||||
|
|
||||||
function resetMinimap(sentid){
|
function resetMinimap(sentid){
|
||||||
//var iframe = document.getElementsByClassName("minimap__content");
|
//var iframe = document.getElementsByClassName("minimap__content");
|
||||||
|
@ -158,4 +115,39 @@ function updateMinimap(sentid){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function locResetGraphStruct(){
|
||||||
|
|
||||||
|
var periodograph=document.getElementById("periodograph");
|
||||||
|
if (periodograph!=null){
|
||||||
|
let showngr=document.getElementById("periodograph").getAttribute('name').split("_")
|
||||||
|
var tmpsent=showngr[0]+"_"+showngr[1]+"_s_"+showngr[2]
|
||||||
|
periodograph.parentNode.removeChild(periodograph);
|
||||||
|
|
||||||
|
//var sentence = document.getElementsByClassName(lsentid);
|
||||||
|
var sentence = document.getElementsByClassName(tmpsent);
|
||||||
|
|
||||||
|
for (let i = 0; i < sentence.length; i++) {
|
||||||
|
//var matches = listaClausoleRisultato.filter(s => s.includes(sentence[i].classList[0]));
|
||||||
|
sentence[i].classList.remove('font-italic');
|
||||||
|
if (selectedVista!='frasi' && !listaPeriodiRisultato.includes(tmpsent))
|
||||||
|
sentence[i].style.removeProperty('color');
|
||||||
|
|
||||||
|
sentence[i].classList.remove('font-weight-normal');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
resetMinimap(tmpsent)
|
||||||
|
|
||||||
|
emptyStructCard()
|
||||||
|
|
||||||
|
if (tmpsent==lsentid){
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
50
js/utils.js
50
js/utils.js
|
@ -1253,6 +1253,56 @@ function getVersiConCitazioni(canticapar='', cantopar=''){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//TEMPORANEAMENTE: gestione del grafo quando viene chiusa la finestra dal bottone, dovebbe essere spostato
|
||||||
|
function resetGraphStruct(){
|
||||||
|
|
||||||
|
var periodograph=document.getElementById("periodograph");
|
||||||
|
if (periodograph!=null){
|
||||||
|
let showngr=document.getElementById("periodograph").getAttribute('name').split("_")
|
||||||
|
var tmpsent=showngr[0]+"_"+showngr[1]+"_s_"+showngr[2]
|
||||||
|
periodograph.parentNode.removeChild(periodograph);
|
||||||
|
|
||||||
|
//var sentence = document.getElementsByClassName(lsentid);
|
||||||
|
var sentence = document.getElementsByClassName(tmpsent);
|
||||||
|
|
||||||
|
for (let i = 0; i < sentence.length; i++) {
|
||||||
|
//var matches = listaClausoleRisultato.filter(s => s.includes(sentence[i].classList[0]));
|
||||||
|
sentence[i].classList.remove('font-italic');
|
||||||
|
if (selectedVista!='frasi' && !listaPeriodiRisultato.includes(tmpsent))
|
||||||
|
sentence[i].style.removeProperty('color');
|
||||||
|
|
||||||
|
sentence[i].classList.remove('font-weight-normal');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//reset Minimap
|
||||||
|
const iframe = document.getElementsByClassName("minimap__content");
|
||||||
|
var iframeDocument = iframe[0].contentDocument || iframe[0].contentWindow.document;
|
||||||
|
if (!iframeDocument) {
|
||||||
|
throw "iframe couldn't be found in DOM.";
|
||||||
|
}
|
||||||
|
var iframeSentence = iframeDocument.getElementsByClassName(tmpsent);
|
||||||
|
for (let i = 0; i < iframeSentence.length; i++) {
|
||||||
|
iframeSentence[i].classList.remove('font-italic');
|
||||||
|
if (selectedVista!='frasi')
|
||||||
|
iframeSentence[i].style.removeProperty('color');
|
||||||
|
|
||||||
|
iframeSentence[i].classList.remove('font-weight-normal');
|
||||||
|
}
|
||||||
|
|
||||||
|
emptyStructCard()
|
||||||
|
|
||||||
|
if (tmpsent==lsentid){
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//end
|
||||||
|
|
||||||
var sottoCategorie = {
|
var sottoCategorie = {
|
||||||
"verbovolgare": {
|
"verbovolgare": {
|
||||||
"Diatesi": { "Attivo": "TipoDiatesiVerboVolgare:VerboVolgareAttivo", "Passivo": "TipoDiatesiVerboVolgare:VerboVolgarePassivo" },
|
"Diatesi": { "Attivo": "TipoDiatesiVerboVolgare:VerboVolgareAttivo", "Passivo": "TipoDiatesiVerboVolgare:VerboVolgarePassivo" },
|
||||||
|
|
Loading…
Reference in New Issue