Skip to content

Commit

Permalink
Merge pull request #199 from ffiesta/master
Browse files Browse the repository at this point in the history
Update template.inc.php
  • Loading branch information
leomoon authored Oct 3, 2024
2 parents 7963f77 + 4827a0f commit 27d60be
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.59
1.0.60
21 changes: 21 additions & 0 deletions template.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ function gtag(){dataLayer.push(arguments);}
</main>
<script>var APP=<?= json_encode($APP->export()) ?>;</script>
<script>var DOC=<?= json_encode($DOC->export()) ?>;</script>
<button onclick="topFunction()" id="myBtn" title="Go to top" style="display: none; position: fixed;bottom: 15px;right: 30px;z-index: 99;font-size: 12px;border: none;outline: none;background-color: #4caf50;color: white;cursor: pointer;padding: 15px;border-radius: 4px;">Top</button>
<script src="<?= $APP->PATH ?>helpers/jquery-3.7.0/js/jquery.min.js"></script>
<script src="<?= $APP->PATH ?>helpers/materialize-1.0.0/js/materialize.min.js"></script>
<script src="<?= $APP->PATH ?>helpers/highlightjs-11.9.0/js/highlight.min.js"></script>
Expand Down Expand Up @@ -375,6 +376,26 @@ function gtag(){dataLayer.push(arguments);}
});
</script>
<?php endif; ?>
<script>
// Get the button Top
let mybutton = document.getElementById("myBtn");

// When the user scrolls down 30px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};

function scrollFunction() {
if (document.body.scrollTop > 40 || document.documentElement.scrollTop > 40) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
<script>
function new_document(){
var new_path=prompt("<?= str_replace(["'",'"'],"\'",$TXT->PromptNewDocument) ?>",DOC.ID+"/");
Expand Down

0 comments on commit 27d60be

Please sign in to comment.