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=163faf270950a30b0de2ec1bdd69895557d12692;hpb=94beea1f5867a1a5a87519d1f7b6d69bfb55428d;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 163faf270..b12b3caaf 100644 --- a/client/src/app/shared/form-validators/video-channel-validators.ts +++ b/client/src/app/shared/form-validators/video-channel-validators.ts @@ -48,3 +48,16 @@ export const VIDEO_CHANNEL_SUPPORT_VALIDATOR: BuildFormValidator = { 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` + } +}