mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
chore(control): more user friendly open website pop up
This commit is contained in:
@@ -140,7 +140,7 @@
|
|||||||
|
|
||||||
function validate_website_url(url: string): [boolean, string] {
|
function validate_website_url(url: string): [boolean, string] {
|
||||||
if (url === '') return [true, ''];
|
if (url === '') return [true, ''];
|
||||||
const regex = /^https?:\/\/[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/;
|
const regex = /^https?:\/\/[\w\-]+(\.[\w\-]+)+([\w\-\._~:/?#\[\]@!$&'\(\)\*\+,;=.])*/;
|
||||||
if (regex.test(url)) {
|
if (regex.test(url)) {
|
||||||
return [true, ''];
|
return [true, ''];
|
||||||
}
|
}
|
||||||
@@ -159,7 +159,7 @@
|
|||||||
{#snippet website_popup()}
|
{#snippet website_popup()}
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<TextInput
|
<TextInput
|
||||||
title="URL"
|
title="URL (mit http:// oder https://)"
|
||||||
placeholder="https://example.com"
|
placeholder="https://example.com"
|
||||||
bind:current_value={website_url}
|
bind:current_value={website_url}
|
||||||
bind:current_valid={website_url_valid}
|
bind:current_valid={website_url_valid}
|
||||||
|
|||||||
Reference in New Issue
Block a user