From a9de96f30f0ab6ca8a131e72cbfc1ad6c190b62a Mon Sep 17 00:00:00 2001 From: veganedge Date: Tue, 11 Feb 2025 05:39:35 -0800 Subject: [PATCH] moving url input validation to proper file --- .../manage/PanelCreationForm.svelte | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/frontend/src/components/manage/PanelCreationForm.svelte b/frontend/src/components/manage/PanelCreationForm.svelte index 5b20d95..81785a7 100644 --- a/frontend/src/components/manage/PanelCreationForm.svelte +++ b/frontend/src/components/manage/PanelCreationForm.svelte @@ -147,8 +147,8 @@
- - + +
@@ -269,21 +269,6 @@ }; } - // Function to validate image URL - function validateImageUrl(url) { - const validExtensions = ['.gif', '.jpg', '.jpeg', '.png', '.webp']; - return validExtensions.some(ext => url.endsWith(ext)); - } - - // Function to handle input validation - function handleImageUrlInput(event) { - const url = event.target.value; - if (url && !validateImageUrl(url)) { - alert('Invalid image URL. Please use a URL ending with .gif, .jpg, .jpeg, .png, or .webp'); - event.target.value = ''; - } - } - function updateColour() { data.colour = colourToInt(tempColour); }