X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fform-validators%2Fvideo-channel-validators.ts;h=b12b3caafb9ac53b213db37e0b2be041fa3b6cc2;hb=cb0eda5602a21d1626a7face32de6153ed07b5f9;hp=48f5b1a2cc20bb028d62e977532630d019724d15;hpb=9df52d660feb722404be00a50f3c8a612bec1c15;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/form-validators/video-channel-validators.ts b/client/src/app/shared/form-validators/video-channel-validators.ts index 48f5b1a2c..b12b3caaf 100644 --- a/client/src/app/shared/form-validators/video-channel-validators.ts +++ b/client/src/app/shared/form-validators/video-channel-validators.ts @@ -45,6 +45,19 @@ export const VIDEO_CHANNEL_SUPPORT_VALIDATOR: BuildFormValidator = { ], MESSAGES: { minlength: $localize`Support text must be at least 3 characters long.`, - maxlength: $localize`Support text cannot be more than 1000 characters long` + maxlength: $localize`Support text cannot be more than 1000 characters long.` + } +} + +export const VIDEO_CHANNEL_EXTERNAL_URL_VALIDATOR: BuildFormValidator = { + VALIDATORS: [ + Validators.required, + Validators.pattern(/^https?:\/\//), + Validators.maxLength(1000) + ], + MESSAGES: { + required: $localize`Remote channel url is required.`, + pattern: $localize`External channel URL must begin with "https://" or "http://"`, + maxlength: $localize`External channel URL cannot be more than 1000 characters long` } }