From 08bef1bd009be7ec9065d91bc15fbc147b0b4caf Mon Sep 17 00:00:00 2001 From: William Mantly Date: Fri, 10 Jul 2026 12:24:01 -0400 Subject: [PATCH] Fix jQuery 4 removed-API usage in app-base.js jQuery 4 removed $.isFunction and $.holdReady. Replace the isFunction checks with typeof and drop the holdReady calls (the redirect already guards the page). Mirrors the master hotfix (#108) so this branch is testable on jQuery 4. Co-Authored-By: Claude Opus 4.8 --- nodejs/public/lib/js/app-base.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/nodejs/public/lib/js/app-base.js b/nodejs/public/lib/js/app-base.js index 3e1b0b6..1ba6b28 100644 --- a/nodejs/public/lib/js/app-base.js +++ b/nodejs/public/lib/js/app-base.js @@ -76,7 +76,7 @@ app.api = (function(app){ var baseURL = '/api/' function post(url, data, callback){ - if(!$.isFunction(callback)) callback = callback2; + if(typeof callback !== 'function') callback = callback2; return $.ajax({ type: 'POST', url: baseURL+url, @@ -97,7 +97,7 @@ app.api = (function(app){ } function put(url, data, callback){ - if(!$.isFunction(callback)) callback = callback2; + if(typeof callback !== 'function') callback = callback2; return $.ajax({ type: 'PUT', url: baseURL+url, @@ -118,7 +118,7 @@ app.api = (function(app){ } function remove(url, callback, callback2){ - if(!$.isFunction(callback)) callback = callback2; + if(typeof callback !== 'function') callback = callback2; return $.ajax({ type: 'delete', url: baseURL+url, @@ -237,13 +237,12 @@ app.auth = (function(app){ } function forceLogin(){ - $.holdReady(true); + // jQuery 4 removed $.holdReady; rely on the redirect below to keep an + // unauthenticated user off the page instead of pausing document ready. app.auth.isLoggedIn(function(error, isLoggedIn){ if(error || !isLoggedIn){ app.auth.logOut(function(){}) location.replace(`/login${location.href.replace(location.origin, '')}`); - }else{ - $.holdReady(false); } }); }