From 8805deed40002b72377a6ede7f530384ea3bb34b Mon Sep 17 00:00:00 2001 From: Zach Lagden Date: Thu, 5 Dec 2024 13:03:38 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Add=20global=20variable=20declar?= =?UTF-8?q?ations=20for=20lucide,=20toastr,=20and=20grecaptcha=20in=20mult?= =?UTF-8?q?iple=20JS=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/static/js/app_api_keys.js | 2 ++ src/static/js/app_dashboard.js | 2 ++ src/static/js/login.js | 2 ++ src/static/js/shared.js | 4 ++++ src/static/js/signup.js | 4 +++- 5 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/static/js/app_api_keys.js b/src/static/js/app_api_keys.js index 09c2200..7ab8d9d 100644 --- a/src/static/js/app_api_keys.js +++ b/src/static/js/app_api_keys.js @@ -1,3 +1,5 @@ +/* global lucide, toastr */ + // Modal elements const createKeyModal = document.getElementById('createKeyModal'); const createKeyBtn = document.getElementById('createKeyBtn'); diff --git a/src/static/js/app_dashboard.js b/src/static/js/app_dashboard.js index f1940ce..c1d8b79 100644 --- a/src/static/js/app_dashboard.js +++ b/src/static/js/app_dashboard.js @@ -1,3 +1,5 @@ +/* global lucide, toastr, $ */ + const dashboardData = { user: { name: 'Failed to fetch user data', diff --git a/src/static/js/login.js b/src/static/js/login.js index ff2f576..6b50797 100644 --- a/src/static/js/login.js +++ b/src/static/js/login.js @@ -1,3 +1,5 @@ +/* global lucide, grecaptcha */ + // Helper functions for UI manipulation function setButtonLoading(button, isLoading) { const text = button.querySelector('span'); diff --git a/src/static/js/shared.js b/src/static/js/shared.js index e440053..a7b8254 100644 --- a/src/static/js/shared.js +++ b/src/static/js/shared.js @@ -1,3 +1,5 @@ +/* global lucide, toastr */ + // static/js/shared.js // Initialize toastr options @@ -11,6 +13,7 @@ toastr.options = { lucide.createIcons(); // Utility function for handling error messages +/* exported showError */ function showError(formId, message) { const errorDiv = document.querySelector(`${formId} #errorMessage`); const errorText = errorDiv.querySelector('p'); @@ -26,6 +29,7 @@ function showError(formId, message) { } // Utility function for showing loading state on submit buttons +/* exported setButtonLoading */ function setButtonLoading(button, isLoading) { const span = button.querySelector('span'); const originalText = span.textContent; diff --git a/src/static/js/signup.js b/src/static/js/signup.js index 09455e2..47a5814 100644 --- a/src/static/js/signup.js +++ b/src/static/js/signup.js @@ -1,3 +1,5 @@ +/* global lucide, grecaptcha */ + // Constants const RECAPTCHA_SITE_KEY = '6LdKgI8qAAAAAFCPWoutXxb3bRw2CdEAzRHnYP5P'; @@ -236,7 +238,7 @@ document.addEventListener('DOMContentLoaded', function () { const data = await response.json(); if (data.status === 'success') { - window.location.href = '/login'; + window.location.href = escape("/login") } else { throw new Error(data.message || 'Signup failed'); }