fissato bug sulla vista frasi, rimosso codice non usato

This commit is contained in:
cesare 2023-02-23 10:27:17 +01:00
parent e351dfa004
commit 08cc9a17c7
2 changed files with 21 additions and 29 deletions

View File

@ -6,7 +6,6 @@
var resetResult; var resetResult;
var lsid; var lsid;
var lsentid; var lsentid;
//var getDimDiv;
const formaClass='frm' const formaClass='frm'
var selectedVista; var selectedVista;
@ -45,16 +44,14 @@ $(document).ready(function() {
hideMinimap(); hideMinimap();
createAllDivCanti() createAllDivCanti()
const start = performance.now(); //const start = performance.now();
showCanto(formeprima, '1','1') showCanto(formeprima, '1','1')
$("#InfernoCanto_1").attr('style', 'display: d-flex;') $("#InfernoCanto_1").attr('style', 'display: d-flex;')
loadedCanti.add("InfernoCanto_1") loadedCanti.add("InfernoCanto_1")
//$("#InfernoCanto_1").removeClass('hidecanto')
//$("#InfernoCanto_1").css("display", "block");
drawMinimap("#InfernoCanto_1") drawMinimap("#InfernoCanto_1")
const end = performance.now(); const minim=$(" .minimap__content")
console.log(`Load cantiche time: ${end - start} ms`); //const end = performance.now();
//console.log(`Load cantiche time: ${end - start} ms`);
$("#valoreVista").on('change', function() { $("#valoreVista").on('change', function() {
selectedVista = $(this).val(); selectedVista = $(this).val();
@ -93,13 +90,6 @@ $("#valoreVista").on('change', function() {
}); });
function loadFrasi() { function loadFrasi() {
//var spanFrase = $('<span />')
/*for (pos=0;pos<20;pos++){
spanFrase.attr('id', pos)
spanFrase.append("La mia più bella frase numero "+" "+pos+"<br>");
$("#vistaFrasi").append(spanFrase);
}*/
$(cantoDisplayed).find(' .sentencetag').each(function() { $(cantoDisplayed).find(' .sentencetag').each(function() {
$(this).attr('style', 'display: d-flex;'); $(this).attr('style', 'display: d-flex;');
@ -109,7 +99,7 @@ function loadFrasi() {
$(this).css('color', colorssp(mapsynttypestopalette[stp])); $(this).css('color', colorssp(mapsynttypestopalette[stp]));
}) })
let minim=$(" .minimap__content") //let minim=$(" .minimap__content")
minim.contents().find(" .sentencetag").each(function(){ minim.contents().find(" .sentencetag").each(function(){
$(this).attr('style', 'display: d-flex;'); $(this).attr('style', 'display: d-flex;');
}) })
@ -118,7 +108,6 @@ function loadFrasi() {
$(this).css('color', colorssp(mapsynttypestopalette[stp])); $(this).css('color', colorssp(mapsynttypestopalette[stp]));
}) })
//drawMinimap(cantoDisplayed)
} }
function resetFrasi(){ function resetFrasi(){
@ -129,18 +118,16 @@ function resetFrasi(){
//console.log(colorssp(mapsynttypestopalette[stp])) //console.log(colorssp(mapsynttypestopalette[stp]))
$(this).css('color', ''); $(this).css('color', '');
}) })
let minim=$(" .minimap__content") //let minim=$(" .minimap__content")
minim.contents().find(" .sentencetag").each(function(){ minim.contents().find(" .sentencetag").each(function(){
$(this).css('display', 'none'); $(this).css('display', 'none');
}) })
minim.contents().find(' .'+formaClass).each(function() { minim.contents().find(' .'+formaClass).each(function() {
$(this).css('color', ''); $(this).css('color', '');
}) })
//drawMinimap(cantoDisplayed)
} }
//$(" .Ma, .Co, .Su, .Pa").each(function(idx, element) {
$(" ."+formaClass).each(function(idx, element) { $(" ."+formaClass).each(function(idx, element) {
// We cycle through the elements using each() so that we can choose the element specifically that we wish to clean up afterward // We cycle through the elements using each() so that we can choose the element specifically that we wish to clean up afterward
var ele = $(element); var ele = $(element);
@ -150,7 +137,7 @@ $(" ."+formaClass).each(function(idx, element) {
close: function (event, ui) {$(".ui-helper-hidden-accessible").remove();}, close: function (event, ui) {$(".ui-helper-hidden-accessible").remove();},
create: function(ev, ui) {$(this).data("ui-tooltip").liveRegion.remove();}, create: function(ev, ui) {$(this).data("ui-tooltip").liveRegion.remove();},
hide: false, hide: false,
show: false show: {delay: 800,duration: 0}
}); });
}); });
@ -185,7 +172,7 @@ $(" ."+formaClass).hover(function(idx, element) {
/*
jQuery(document).delegate('#sentence', 'click', function(e) { jQuery(document).delegate('#sentence', 'click', function(e) {
e.preventDefault(); e.preventDefault();
@ -202,7 +189,7 @@ $(" ."+formaClass).hover(function(idx, element) {
} }
}); });
*/
$("#" + displayId).scroll(function() { $("#" + displayId).scroll(function() {
@ -445,7 +432,6 @@ $(" ."+formaClass).hover(function(idx, element) {
$("#vistaFrasi").attr('style', 'display: d-flex;'); $("#vistaFrasi").attr('style', 'display: d-flex;');
manageMM("#vistaFrasi") manageMM("#vistaFrasi")
//drawMinimap("#vistaFrasi")
}); });
@ -494,10 +480,15 @@ $(" ."+formaClass).hover(function(idx, element) {
$("#" + $(this).attr('name').replace(" ", "_")).attr('style', 'display: d-flex;') $("#" + $(this).attr('name').replace(" ", "_")).attr('style', 'display: d-flex;')
//drawMinimap("#" + $(this).attr('name').replace(" ", "_")) //drawMinimap("#" + $(this).attr('name').replace(" ", "_"))
manageMM("#" + $(this).attr('name').replace(" ", "_")) manageMM("#" + $(this).attr('name').replace(" ", "_"))
if (selectedVista=='frasi'){ if (selectedVista=='frasi'){
loadFrasi(); loadFrasi();
} }
addFormaListeners(); addFormaListeners();
}); });
@ -533,7 +524,7 @@ $(" ."+formaClass).hover(function(idx, element) {
close: function(event, ui) { $(".ui-helper-hidden-accessible").remove(); }, close: function(event, ui) { $(".ui-helper-hidden-accessible").remove(); },
create: function(ev, ui) { $(this).data("ui-tooltip").liveRegion.remove(); }, create: function(ev, ui) { $(this).data("ui-tooltip").liveRegion.remove(); },
hide: false, hide: false,
show: false show: {delay: 800,duration: 0}
}); });
ele.hover(function(idx, element) { ele.hover(function(idx, element) {
@ -643,7 +634,7 @@ $(" ."+formaClass).hover(function(idx, element) {
}); });
} }
let minim=$(" .minimap__content") //let minim=$(" .minimap__content")
for (forma of listarisultati) { for (forma of listarisultati) {
idforma = '#' + forma idforma = '#' + forma
$(idforma).removeClass("font-weight-bold mark ") $(idforma).removeClass("font-weight-bold mark ")
@ -665,7 +656,7 @@ $(" ."+formaClass).hover(function(idx, element) {
function manageMM(name){ function manageMM(name){
currentMinimap = name; currentMinimap = name;
let testhtml = $(currentMinimap)[0].outerHTML; let testhtml = $(currentMinimap)[0].outerHTML;
let minim=$(" .minimap__content") //let minim=$(" .minimap__content")
let bm=minim.contents().find(' .blog-main') let bm=minim.contents().find(' .blog-main')
bm.empty() bm.empty()
bm.append(testhtml) bm.append(testhtml)
@ -952,7 +943,7 @@ $(" ."+formaClass).hover(function(idx, element) {
}); });
seachbBindingsStream.on('end', () => { seachbBindingsStream.on('end', () => {
var resSent=new Set() var resSent=new Set()
let minim=$(" .minimap__content") //let minim=$(" .minimap__content")
console.log('start rendering...') console.log('start rendering...')
listarisultati = Array.from(result) listarisultati = Array.from(result)
var listaclausole=Array.from(resultClauses) var listaclausole=Array.from(resultClauses)
@ -1011,6 +1002,7 @@ $(" ."+formaClass).hover(function(idx, element) {
for (ris of listarisultati) { for (ris of listarisultati) {
idris = '#' + ris idris = '#' + ris
$(idris).addClass("font-weight-bold mark ") $(idris).addClass("font-weight-bold mark ")
minim.contents().find(idris).addClass("font-weight-bold mark ")
} }
} }

View File

@ -60,9 +60,9 @@ document.addEventListener("dblclick", function(e){
if (lisid!=''){ if (lisid!=''){
var mywidth=document.getElementById('displaycanto').offsetWidth var mywidth=document.getElementById('displaycanto').offsetWidth
let svgwidth=Math.min((mywidth-65), 800)
console.log('here graph '+lisid+' '+lsentid) console.log('here graph '+lisid+' '+lsentid)
main.redefine('width', 605); main.redefine('width', 645);
main.redefine("lisid", lisid); main.redefine("lisid", lisid);
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++) {