|
@@ -1,4 +1,4 @@
|
|
|
-// Button to return to the top of page
|
|
|
+// Botao de voltar para o topo da pagina
|
|
|
let btnVoltar = document.getElementById("ifr__btn__backToTop");
|
|
|
window.onscroll = function () {
|
|
|
scrollFunction();
|
|
@@ -20,18 +20,28 @@ function backToTop() {
|
|
|
// footer.innerHTML =
|
|
|
// "<p>Atualizado pela ultima vez em: 3 de Outubro de 2023 -- por <a href='http://www.ime.usp.br/~laira'>Laira</a>.</p>";
|
|
|
|
|
|
-// Remover ultima parte da URL atual
|
|
|
-function pegarURL () {
|
|
|
+// Remove last part of the current URL
|
|
|
+function getURL () {
|
|
|
strUrl = window.location.href;
|
|
|
ind = strUrl.lastIndexOf("/");
|
|
|
subStrigURL = strUrl.substring(0, ind);
|
|
|
- // alert("carregar_pagina.js: " + subStrigURL);
|
|
|
+ ind2 = subStrigURL.lastIndexOf("/");
|
|
|
+ subStrigURL2 = strUrl.substring(ind2+1, ind);
|
|
|
+ if (subStrigURL2=='paginas') // it is under "/about/paginas", erase "paginas"
|
|
|
+ subStrigURL = strUrl.substring(0, ind2);
|
|
|
+ else
|
|
|
+ if (subStrigURL2=='area_professor') // it is under "/about/paginas/area_professor", erase "paginas/area_professor"
|
|
|
+ subStrigURL = strUrl.substring(0, ind2-7);
|
|
|
+ else
|
|
|
+ if (subStrigURL2=='sobre') // it is under "/about/paginas/sobre/", erase "paginas/area_professor"
|
|
|
+ subStrigURL = strUrl.substring(0, ind2-7);
|
|
|
+ //DEBUG alert("script/index.js!getURL(): ind=" + ind + ": ind2=" + ind2 + ": subStrigURL2=" + subStrigURL2 + ": " + subStrigURL);
|
|
|
return subStrigURL;
|
|
|
}
|
|
|
|
|
|
// Insert in all pages the footer
|
|
|
//leo const baseUrl = "/about";
|
|
|
-const baseUrl = pegarURL();
|
|
|
+const baseUrl = getURL(); //leo
|
|
|
const lastUpdate =
|
|
|
"Atualizado pela ultima vez em: 25 de março de 2025 -- por <a href='http://www.ime.usp.br/~laira'>Laira</a>.";
|
|
|
let footer = document.getElementById("footer");
|