aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/form-validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-29 15:19:22 +0200
committerChocobozzz <me@florianbigard.com>2021-07-29 15:19:22 +0200
commitaf7fd04a6706fb781e4622167b08dc6c9376f06a (patch)
tree4d6a84cd67143e07d762ba967f9d29e947e7436c /client/src/app/shared/form-validators
parent9c9a236b541a286e165d67341e4ddd6ea2fabdf1 (diff)
downloadPeerTube-af7fd04a6706fb781e4622167b08dc6c9376f06a.tar.gz
PeerTube-af7fd04a6706fb781e4622167b08dc6c9376f06a.tar.zst
PeerTube-af7fd04a6706fb781e4622167b08dc6c9376f06a.zip
Add ability to filter by host in search page
Diffstat (limited to 'client/src/app/shared/form-validators')
-rw-r--r--client/src/app/shared/form-validators/host-validators.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/client/src/app/shared/form-validators/host-validators.ts b/client/src/app/shared/form-validators/host-validators.ts
index d750113ef..6f410a50a 100644
--- a/client/src/app/shared/form-validators/host-validators.ts
+++ b/client/src/app/shared/form-validators/host-validators.ts
@@ -1,7 +1,7 @@
1import { AbstractControl, ValidatorFn, Validators } from '@angular/forms' 1import { AbstractControl, ValidatorFn, Validators } from '@angular/forms'
2import { BuildFormValidator } from './form-validator.model' 2import { BuildFormValidator } from './form-validator.model'
3 3
4function validateHost (value: string) { 4export function validateHost (value: string) {
5 // Thanks to http://stackoverflow.com/a/106223 5 // Thanks to http://stackoverflow.com/a/106223
6 const HOST_REGEXP = new RegExp( 6 const HOST_REGEXP = new RegExp(
7 '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$' 7 '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$'
@@ -10,7 +10,7 @@ function validateHost (value: string) {
10 return HOST_REGEXP.test(value) 10 return HOST_REGEXP.test(value)
11} 11}
12 12
13function validateHandle (value: string) { 13export function validateHandle (value: string) {
14 if (!value) return false 14 if (!value) return false
15 15
16 return value.includes('@') 16 return value.includes('@')