]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/form-validators/video-channel-validators.ts
Add Podcast RSS feeds (#5487)
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / form-validators / video-channel-validators.ts
index 48f5b1a2cc20bb028d62e977532630d019724d15..b12b3caafb9ac53b213db37e0b2be041fa3b6cc2 100644 (file)
@@ -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`
   }
 }