nuovo modo di visualizzare numero verso

This commit is contained in:
cesare 2023-02-24 18:06:26 +01:00
parent 7ce99ba0cd
commit 82ae18f5ad
3 changed files with 45 additions and 7 deletions

View File

@ -623,7 +623,7 @@ $(" ."+formaClass).hover(function(idx, element) {
function cleanSearchResult() { function cleanSearchResult() {
$("#headingZero").css("display", "none"); $("#headingZero").closest('.card') .css("display", "none");
$("#vistaFrasi").empty() $("#vistaFrasi").empty()
$("#vistaFrasi").css("display", "none"); $("#vistaFrasi").css("display", "none");
for (msid of listaPeriodiRisultato){ for (msid of listaPeriodiRisultato){
@ -745,7 +745,8 @@ $(" ."+formaClass).hover(function(idx, element) {
createSpanPeriodiTag(closeSTag, 'c', formaItem[2]-1, currSentenceId, elverso) createSpanPeriodiTag(closeSTag, 'c', formaItem[2]-1, currSentenceId, elverso)
currSentenceId=null currSentenceId=null
} }
elverso=createDivVersoNew(cantica, formaItem[3], 'Canto_' + formaItem[1]) //elverso=createDivVersoNew(cantica, formaItem[3], 'Canto_' + formaItem[1])
elverso=createDivVersoLI(cantica, formaItem[3], 'Canto_' + formaItem[1])
setVersiCanto.add(cantica+ "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1]) setVersiCanto.add(cantica+ "_" + formaItem[3] + "_" + 'Canto_' + formaItem[1])
} }
if(currSentenceId==null || currSentenceId != sentenceid){ if(currSentenceId==null || currSentenceId != sentenceid){
@ -816,11 +817,38 @@ $(" ."+formaClass).hover(function(idx, element) {
} }
function createDivVersoGeneric(cantica, num, canto) { function createDivVersoLI(cantica, num, canto) {
var elementoverso = createDivVersoGenericLi(cantica, num, canto)
let cantoContainer=$('#' + cantica + canto);
elementoverso.appendTo(cantoContainer.find('ol'))
return elementoverso
}
function createDivVersoGenericLi(cantica, num, canto) {
//let digits=num.length
var elementoverso = $('<li />')
elementoverso.attr("value", num)
elementoverso.attr("style", "line-height: 1.0em")
elementoverso.attr('class', 'f6 mb-2 text-muted text-nowrap font-weight-lighter '+cantica+' '+canto)
elementoverso.attr('id', cantica + "_" + canto + "_" + num)
elementoverso.append('\xa0')
return elementoverso
}
function createDivVersoGeneric(cantica, num, canto) {
var elementoverso = $('<p />') var elementoverso = $('<p />')
var spannum=$('<span />') var spannum=$('<span />')
spannum.append(num + ". ") spannum.append(num + ". ")
spannum.attr('class', 'numverso text-muted') spannum.attr('class', 'numverso text-muted')
elementoverso.append(spannum) elementoverso.append(spannum)
//elementoverso.append(num + ". ") //elementoverso.append(num + ". ")
@ -879,6 +907,10 @@ $(" ."+formaClass).hover(function(idx, element) {
divcanto.attr('id', (cantica + canto).replace(" ", "_")) divcanto.attr('id', (cantica + canto).replace(" ", "_"))
titolocanto.appendTo(divcanto) titolocanto.appendTo(divcanto)
//nuovo
var olversi=$('<ol />')
olversi.appendTo(divcanto)
//fine nuovo
divcanto.appendTo('#displaycanto') divcanto.appendTo('#displaycanto')
} }
} }
@ -1025,7 +1057,7 @@ $(" ."+formaClass).hover(function(idx, element) {
} }
//aggiunge badge con totale risultati nel bottone lista risultati //aggiunge badge con totale risultati nel bottone lista risultati
if (totResultN>0){ if (totResultN>0){
$("#headingZero").attr('style', 'display: d-flex;') $("#headingZero").closest('.card') .attr('style', 'display: d-flex;')
var spanbadgelista = $('<span />'); var spanbadgelista = $('<span />');
spanbadgelista.attr('class', 'badge badge-primary badge-pill mx-2 lista-risultati'); spanbadgelista.attr('class', 'badge badge-primary badge-pill mx-2 lista-risultati');
spanbadgelista.append(totResultN+listIcon) spanbadgelista.append(totResultN+listIcon)
@ -1057,9 +1089,11 @@ $(" ."+formaClass).hover(function(idx, element) {
console.log('badge end...') console.log('badge end...')
//aggiorna minimap //aggiorna minimap
/*
if (currentMinimap != '') { if (currentMinimap != '') {
showMinimap() showMinimap()
} }
*/
}); });
queryExecuted = true; queryExecuted = true;

View File

@ -4,7 +4,7 @@
import {Runtime, Library, Inspector} from "https://hdnlab1.isti.cnr.it/d3search/node_modules/commarcdiag/runtime.js"; import {Runtime, Library, Inspector} from "https://hdnlab1.isti.cnr.it/d3search/node_modules/commarcdiag/runtime.js";
import commarc from "https://hdnlab1.isti.cnr.it/d3search/node_modules/commarcdiag/index.js"; import commarc from "https://hdnlab1.isti.cnr.it/d3search/node_modules/commarcdiag/index.js";
const iframe = document.getElementsByClassName("minimap__content");
const runtime1 = new Runtime(new Library(name => { const runtime1 = new Runtime(new Library(name => {
console.log('name' +name) console.log('name' +name)
switch (name) { switch (name) {
@ -96,7 +96,7 @@ document.addEventListener("dblclick", function(e){
function resetMinimap(sentid){ function resetMinimap(sentid){
var iframe = document.getElementsByClassName("minimap__content"); //var iframe = document.getElementsByClassName("minimap__content");
var iframeDocument = iframe[0].contentDocument || iframe[0].contentWindow.document; var iframeDocument = iframe[0].contentDocument || iframe[0].contentWindow.document;
if (!iframeDocument) { if (!iframeDocument) {
@ -115,7 +115,7 @@ function resetMinimap(sentid){
function updateMinimap(sentid){ function updateMinimap(sentid){
var iframe = document.getElementsByClassName("minimap__content"); //var iframe = document.getElementsByClassName("minimap__content");
var iframeDocument = iframe[0].contentDocument || iframe[0].contentWindow.document; var iframeDocument = iframe[0].contentDocument || iframe[0].contentWindow.document;
if (!iframeDocument) { if (!iframeDocument) {

View File

@ -236,8 +236,12 @@ WHERE {
//colori //colori
var colorssp = d3.scaleQuantize() var colorssp = d3.scaleQuantize()
.domain([0, 17]) .domain([0, 17])
/*.range(["#1f78b4", "#a6cee3", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00",
"#cab2d6", "#6a3d9a", "#ffff99", "#b15928", "#F46D43",
"#D53E4F", "#9E0142", "#e377c2", "#7f7f7f", "#bcbd22"]);*/
.range(["#3288bd", "#66c2a5", "#e41a1c", "#4daf4a", "#984ea3", "#d53e4f", "#f46d43", "#ABDDA4", .range(["#3288bd", "#66c2a5", "#e41a1c", "#4daf4a", "#984ea3", "#d53e4f", "#f46d43", "#ABDDA4",
"#E6F598", "#FFFFBF", "#FEE08B", "#FDAE61", "#F46D43", "#E6F598", "#FFFFBF", "#FEE08B", "#FDAE61", "#F46D43",
"#D53E4F", "#9E0142", "#e377c2", "#7f7f7f", "#bcbd22"]); "#D53E4F", "#9E0142", "#e377c2", "#7f7f7f", "#bcbd22"]);