diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-29 15:19:22 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-29 15:19:22 +0200 |
commit | af7fd04a6706fb781e4622167b08dc6c9376f06a (patch) | |
tree | 4d6a84cd67143e07d762ba967f9d29e947e7436c /client/src/app/shared/form-validators/host-validators.ts | |
parent | 9c9a236b541a286e165d67341e4ddd6ea2fabdf1 (diff) | |
download | PeerTube-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/host-validators.ts')
-rw-r--r-- | client/src/app/shared/form-validators/host-validators.ts | 4 |
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 @@ | |||
1 | import { AbstractControl, ValidatorFn, Validators } from '@angular/forms' | 1 | import { AbstractControl, ValidatorFn, Validators } from '@angular/forms' |
2 | import { BuildFormValidator } from './form-validator.model' | 2 | import { BuildFormValidator } from './form-validator.model' |
3 | 3 | ||
4 | function validateHost (value: string) { | 4 | export 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 | ||
13 | function validateHandle (value: string) { | 13 | export function validateHandle (value: string) { |
14 | if (!value) return false | 14 | if (!value) return false |
15 | 15 | ||
16 | return value.includes('@') | 16 | return value.includes('@') |