From 55bcec90c14db6f2956ed51cf4df1503c0767f81 Mon Sep 17 00:00:00 2001 From: Ken D'Ambrosio Date: Mon, 25 May 2026 00:46:10 +0000 Subject: =?UTF-8?q?Initial=20commit=20=E2=80=94=20menu.jots.org=20Flask/SQ?= =?UTF-8?q?Lite=20meal=20planner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Full-featured weekly menu planner with: - Recipe library with ratings, comments, cuisine/nationality, added-by attribution - AI recipe assistant (Claude) with URL fetching and file upload - Weekly meal plan grid with shopping list generation - Sort by name, prep/cook time, or rating - Print and copy-link support - Deployed on LXC container (192.168.10.51) behind Apache reverse proxy Co-Authored-By: Claude Sonnet 4.6 --- app/static/js/main.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/static/js/main.js (limited to 'app/static/js') diff --git a/app/static/js/main.js b/app/static/js/main.js new file mode 100644 index 0000000..ed1147b --- /dev/null +++ b/app/static/js/main.js @@ -0,0 +1,18 @@ +// Global JSON fetch helper — redirects to /login on 401 +async function api(url, options = {}) { + const res = await fetch(url, { + headers: {'Content-Type': 'application/json'}, + ...options, + }); + if (res.status === 401) { + window.location.href = '/login?next=' + encodeURIComponent(window.location.pathname); + return null; + } + return res; +} + +document.addEventListener('DOMContentLoaded', () => { + document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el => + new bootstrap.Tooltip(el) + ); +}); -- cgit v1.2.3