From 2c409a60c6a80333b03f98a6491677fcad73522e Mon Sep 17 00:00:00 2001 From: Junior Date: Fri, 18 Aug 2023 14:56:00 -0400 Subject: [PATCH] Change comic issue (showcomic) to use the new ajaxy way, or at least prep for it --- index.php | 4 ++-- js/comics.js | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index 592e0c8..da056d1 100644 --- a/index.php +++ b/index.php @@ -176,8 +176,8 @@ for ( $i=1; $i<=$total; $i++ ) { if ( in_array($items[$i-1], $issues) ) $classmod=" readborder"; $relcomic = trim(base64_encode($compath . "/" . $items[$i-1]), "="); $thumburl = htmlentities($thumb, ENT_QUOTES); - echo "

"; + echo "
"; + echo "
"; echo "{$comname}
\n"; } } diff --git a/js/comics.js b/js/comics.js index 1c74215..592192d 100644 --- a/js/comics.js +++ b/js/comics.js @@ -1,9 +1,7 @@ // This function is executed after the page load completes on the client $(document).ready(function() { - $(".folder").click(function() { - toastr.success("Opening comic \"" + $(this).data("name") + "\"
If this is the first time it may take a while to generate thumbnails."); - window.location.replace("index.php?newpath=" + $(this).data("path")); - }); + $(".folder").click(function() { changeFolder($(this).data("name"), $(this).data("path")); }); + $(".issue").click(function() { showComic($(this).data("relcomic"), $(this).data("comname")); }); }); var lightbox = null; @@ -20,6 +18,11 @@ function updateCurrentPage() { }); } +function changeFolder(name, path) { + toastr.success("Opening comic \"" + name + "\"
If this is the first time it may take a while to generate thumbnails."); + window.location.replace("index.php?newpath=" + path); +} + // // This JS function is called when a user clicks on a comic. // "showcomic.php" is called with the comic to view as a parameter.