From 20ef7062c0dfb6f4f89db0b24b0dc2724c198b66 Mon Sep 17 00:00:00 2001 From: Luca Trupiano Date: Mon, 20 Mar 2023 18:08:05 +0100 Subject: [PATCH] Risolto uno dei bug del resize window, spostata funzione minimap --- index_4.2.html | 5 ++++- js/cesareBrowse.js | 27 +++------------------------ js/script_4.2.js | 38 ++++++++++++++++++++++++++++++++++---- 3 files changed, 41 insertions(+), 29 deletions(-) diff --git a/index_4.2.html b/index_4.2.html index 8d2bf71..a113f8b 100644 --- a/index_4.2.html +++ b/index_4.2.html @@ -441,7 +441,10 @@
-
Visualizza info




+
Visualizza info
+
diff --git a/js/cesareBrowse.js b/js/cesareBrowse.js index fe5e4ac..642bceb 100644 --- a/js/cesareBrowse.js +++ b/js/cesareBrowse.js @@ -29,7 +29,6 @@ $(document).ready(function() { listaPeriodiRisultato = []; listaClausoleRisultato=[] var resultSentences = new Set() - var minimapScrolling = false; //var displayId = 'displaycanto' var cantiche=["Inferno", "Purgatorio","Paradiso"] var loadedCanti=new Set(); @@ -129,20 +128,6 @@ $(" ."+formaClass).hover(function(idx, element) { lsentid=$(this).attr('class').split(' ')[0] lisid=tmplisid }); - - - - - //$("#" + displayId).scroll(function() { - $(displayCantoWrapperId).scroll(function() { - if (minimapScrolling) { - minimapScrolling = false - } - else { - trackScrollCanto() - } - }); - /* @@ -764,7 +749,7 @@ function resetFrasi(){ } function cleanSearchResult() { - let updateMap=false + $("#headingZero").closest('.card').css("display", "none"); $("#collapseZero").collapse('hide'); $("#vistaFrasi").empty() @@ -797,18 +782,12 @@ function resetFrasi(){ listaPeriodiRisultato=[] listaClausoleRisultato=[] resultSentences=new Set() - - if(cantoDisplayed=='#vistaFrasi'){ + if(cantoDisplayed=='#vistaFrasi') cantoDisplayed=prevCantoDisplayed - updateMap=true - } - $(cantoDisplayed).attr('style', 'display: d-flex;'); //manageMM (cantoDisplayed) currPage = 0; - if (updateMap) - drawMinimap(cantoDisplayed) - + drawMinimap(cantoDisplayed, true) } function manageMM(name){ diff --git a/js/script_4.2.js b/js/script_4.2.js index 0bb332a..829b15a 100644 --- a/js/script_4.2.js +++ b/js/script_4.2.js @@ -17,9 +17,19 @@ $(document).ready(function() { function doneResizing(){ $("#displayminimap").empty();; - drawMinimap(currentMinimap); + $('#displayminimap').css('height', 'auto'); + drawMinimap(currentMinimap, false); } - + + $(displayCantoWrapperId).scroll(function() { + if (minimapScrolling) { + minimapScrolling = false + } + else { + trackScrollCanto() + } + }); + // Evento: click sul cambio stile $('.stileLink').on('click', function() { var newStyle = $(this)[0].id; @@ -56,6 +66,19 @@ $(document).ready(function() { }); + $("#incrFontSize").click(function() { + newFontSize = incSize($('#displaycanto').css("font-size"), 10, 18, 58) + newH4FontSize = incSize($('#displaycanto h4').css("font-size"), 12, 24, 72) + //newLiFontSize = incSize($('#displaycanto li::marker').css("font-size"), 6, 12, 32) + $('#displaycanto').css("font-size", newFontSize); + $('#displaycanto h4').css("font-size", newH4FontSize); + //$('#displaycanto li::marker').css("font-size", newLiFontSize); + drawMinimap(currentMinimap); + $('iframe').contents().find('.blog-main').css("font-size", newFontSize); + $('iframe').contents().find('.blog-main h4').css("font-size", newH4FontSize); + }); + + // Funzioni di gestione del comportamento dei bottoni collapse $('#collapseLogic').on('hidden.bs.collapse', function (e) { if (e.target.id == "collapseLogic") { @@ -573,7 +596,8 @@ $(document).ready(function() { const bgImgUrl1 = "./images/fefeff.png"; const bgImgUrl2 = "./images/f8f9fa.png"; - // Variabili e costanti funzionali + // Variabili e costanti funzionali + var minimapScrolling = false; var tabID = 0; var claListLen = 0; var condListLen = 0; @@ -1319,7 +1343,6 @@ $(document).ready(function() { function managePage() { if (currPage == 0){ - //numeroPagine = Math.ceil(listarisultati.length/nRisultatiPerPag); numeroPagine = Math.ceil(numeroContesti/nRisultatiPerPag); $("#paginaLista option").remove(); for (let i = 1; i <= numeroPagine; i++) { @@ -1359,5 +1382,12 @@ $(document).ready(function() { latestPhraseId = ""; } }; + + function incSize(currentSize, incr, min, max) { + //fSize = (parseFloat(currentSize) + incr) % max + min; + fSize = Math.max((parseFloat(currentSize) + incr) % max, min); + //console.log("fSize: "+fSize); + return (fSize) + 'px'; + }; });