A few small consistency cleanups

This commit is contained in:
Junior 2026-11-08 15:47:57 -05:00
parent 0988f1df2a
commit 7b186c1898

View File

@ -1,5 +1,5 @@
const NOREFRESH = false; let folderRequest = false;
var folderRequest = false; let lightbox = null;
toastr.options.escapeHtml = true; toastr.options.escapeHtml = true;
// This function is executed after the page load completes on the client // This function is executed after the page load completes on the client
@ -16,8 +16,6 @@ $(document).ready(function() {
getSortOrder(); getSortOrder();
}); });
var lightbox = null;
/** /**
* Redirects the user to the login page by replacing the current location with "index.php". * Redirects the user to the login page by replacing the current location with "index.php".
* Logs a message to the console before redirecting. * Logs a message to the console before redirecting.
@ -39,10 +37,9 @@ function getSortOrder(refresh = true) {
if ( !data.validated ) { if ( !data.validated ) {
redirectToLogin(); redirectToLogin();
return; return;
} else { }
$("#sortorder").html(data.order); $("#sortorder").html(data.order);
if ( refresh ) getFolderContents(); if ( refresh ) getFolderContents();
}
}, },
error : function(xhr, stat, err) { error : function(xhr, stat, err) {
toastr.error("There was an error retrieving the current sort order.", "API Error...", {timeOut: 15000}); toastr.error("There was an error retrieving the current sort order.", "API Error...", {timeOut: 15000});
@ -161,7 +158,7 @@ function changeFolder(path) {
* @returns {void} * @returns {void}
*/ */
function updateCurrentPage() { function updateCurrentPage() {
var currentPage = lightbox.currentPosition; let currentPage = lightbox.currentPosition;
$.ajax({ $.ajax({
url : 'ajax/setpage.php', url : 'ajax/setpage.php',
type : 'POST', type : 'POST',
@ -222,7 +219,7 @@ function showComic(comic, name) {
return; return;
} }
toastr.remove(); toastr.remove();
if ( data.images.length == 0 ) { if ( data.images.length === 0 ) {
toastr.error("There doesn't seem to be any images in this comic. Please contact the admin!", "Comics is empty", {timeOut: 8000}); toastr.error("There doesn't seem to be any images in this comic. Please contact the admin!", "Comics is empty", {timeOut: 8000});
return; return;
} }