carica i canto in maniera differenziata. visualizza il canto selezionato
relativo alla cantica selezionata
This commit is contained in:
parent
3f89ee28ca
commit
03fa724606
|
|
@ -4,14 +4,16 @@
|
|||
var resetResult;
|
||||
|
||||
$(document).ready(function() {
|
||||
const categoriegrammaticali={"v":"Verbo", "s":"Sostantivo", "a":"Aggettivo", "p":"Pronome", "r":"Articolo", "b":"Avverbio","e":"Preposizione",
|
||||
const categoriegrammaticali = {
|
||||
"v": "Verbo", "s": "Sostantivo", "a": "Aggettivo", "p": "Pronome", "r": "Articolo", "b": "Avverbio", "e": "Preposizione",
|
||||
"c": "Congiunzione", "i": "Interiezione", "n": "Onomastica", "f": "Citazione", "l": "Locuzione",
|
||||
"r-e": "Articolo, Preposizione", "b-v": "Avverbio, Verbo", "p-v": "Pronome, Verbo",
|
||||
"b-p-v": "Avverbio, Pronome, Verbo", "b-p": "Avverbio, Pronome",
|
||||
"e-p": "Preposizione, Pronome", "a-s": "Aggettivo, Sostantivo",
|
||||
"e-r": "Preposizione, Articolo", "v-b": "Verbo, Avverbio", "v-p": "Verbo, Pronome",
|
||||
"v-p-b": "Verbo, Pronome, Avverbio", "p-b": "Pronome, Avverbio",
|
||||
"p-e":"Pronome, Preposizione", "s-a":"Sostantivo, Aggettivo",}
|
||||
"p-e": "Pronome, Preposizione", "s-a": "Sostantivo, Aggettivo",
|
||||
}
|
||||
|
||||
const cantobadgeclass = 'badge badge-outline-info badge-pill'
|
||||
|
||||
|
|
@ -37,6 +39,11 @@ $(document).ready(function() {
|
|||
let realScale;
|
||||
let mappedElement = '';
|
||||
|
||||
var purgatorioSelected = "PurgatorioCanto_1";
|
||||
var paradisoSelected = "ParadisoCanto_1";
|
||||
var infernoSelected = "InfernoCanto_1";
|
||||
|
||||
|
||||
resetResult = function() {
|
||||
//console.log('clean result')
|
||||
cleanSearchResult()
|
||||
|
|
@ -46,16 +53,59 @@ $(document).ready(function() {
|
|||
hideMinimap();
|
||||
createAllDivCanti()
|
||||
const start = performance.now();
|
||||
|
||||
showCantica('Inferno')
|
||||
showCantica('Purgatorio')
|
||||
showCantica('Paradiso')
|
||||
var purgatorioLoaded = false;
|
||||
var paradisoLoaded = false;
|
||||
|
||||
$("#InfernoCanto_1").attr('style', 'display:block')
|
||||
drawMinimap("InfernoCanto_1")
|
||||
const end = performance.now();
|
||||
console.log(`Load cantiche time: ${end - start} ms`);
|
||||
|
||||
jQuery(document).delegate('#cantica2', 'click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (!purgatorioLoaded){
|
||||
showCantica('Purgatorio')
|
||||
purgatorioLoaded = true;
|
||||
}
|
||||
|
||||
$('.canto').each(function() {
|
||||
$(this).attr("style", 'display:none');
|
||||
});
|
||||
$("#"+purgatorioSelected).attr('style', 'display:block')
|
||||
manageMiniMap("#"+purgatorioSelected);
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
jQuery(document).delegate('#cantica3', 'click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
if (!paradisoLoaded){
|
||||
showCantica('Paradiso')
|
||||
paradisoLoaded = true;
|
||||
}
|
||||
|
||||
$('.canto').each(function() {
|
||||
$(this).attr("style", 'display:none');
|
||||
});
|
||||
$("#"+paradisoSelected).attr('style', 'display:block')
|
||||
manageMiniMap("#"+paradisoSelected);
|
||||
|
||||
return true;
|
||||
});
|
||||
jQuery(document).delegate('#cantica1', 'click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('.canto').each(function() {
|
||||
$(this).attr("style", 'display:none');
|
||||
});
|
||||
$("#"+infernoSelected).attr('style', 'display:block')
|
||||
manageMiniMap("#"+infernoSelected);
|
||||
return true;
|
||||
});
|
||||
$("[data-cg]").hover(function() {
|
||||
var details = getHoverContent($(this).data("cg"))
|
||||
var index = details.indexOf(",");
|
||||
|
|
@ -101,6 +151,15 @@ $(document).ready(function() {
|
|||
function manageMiniMap(divElem) {
|
||||
mmiw = $("#" + displayId).innerWidth();
|
||||
mmih = $("#" + displayId).innerHeight();
|
||||
var selectedCanto = ($(divElem).attr('name').replace(" ", "_"));
|
||||
if (selectedCanto.startsWith("Inferno")){
|
||||
infernoSelected = selectedCanto;
|
||||
}else
|
||||
if(selectedCanto.startsWith("Paradiso")){
|
||||
paradisoSelected = selectedCanto;
|
||||
}else{
|
||||
purgatorioSelected = selectedCanto;
|
||||
}
|
||||
drawMinimap($(divElem).attr('name').replace(" ", "_"))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue