From 781ba981263ee6524fea1a95836108d252a124f4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 21 Aug 2020 14:45:57 +0200 Subject: [PATCH] Add ability to set a description to dynamic fields --- .../src/app/+videos/+video-watch/video-watch.component.ts | 2 +- .../shared/shared-forms/dynamic-form-field.component.html | 2 ++ .../shared/shared-forms/dynamic-form-field.component.scss | 6 ++++++ client/src/standalone/videos/embed.ts | 2 +- shared/models/plugins/register-client-form-field.model.ts | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts index 0a61227a8..1b2820810 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts @@ -548,7 +548,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { this.zone.run(() => this.theaterEnabled = enabled) }) - this.hooks.runAction('action:video-watch.player.loaded', 'video-watch', { player: this.player, videojs }) + this.hooks.runAction('action:video-watch.player.loaded', 'video-watch', { player: this.player, videojs, video: this.video }) }) this.setVideoDescriptionHTML() diff --git a/client/src/app/shared/shared-forms/dynamic-form-field.component.html b/client/src/app/shared/shared-forms/dynamic-form-field.component.html index c111ea7df..17b4a134f 100644 --- a/client/src/app/shared/shared-forms/dynamic-form-field.component.html +++ b/client/src/app/shared/shared-forms/dynamic-form-field.component.html @@ -1,6 +1,8 @@
+
+ diff --git a/client/src/app/shared/shared-forms/dynamic-form-field.component.scss b/client/src/app/shared/shared-forms/dynamic-form-field.component.scss index 70b3cf6c3..89193ed85 100644 --- a/client/src/app/shared/shared-forms/dynamic-form-field.component.scss +++ b/client/src/app/shared/shared-forms/dynamic-form-field.component.scss @@ -16,3 +16,9 @@ textarea { .peertube-select-container { @include peertube-select-container(340px); } + +.label-small-info { + font-style: italic; + margin-bottom: 10px; + font-size: 13px; +} diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index af98a1561..995e8c277 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -588,7 +588,7 @@ export class PeerTubeEmbed { }) } - this.runHook('action:embed.player.loaded', undefined, { player: this.player, videojs }) + this.runHook('action:embed.player.loaded', undefined, { player: this.player, videojs, video: videoInfo }) } private async initCore () { diff --git a/shared/models/plugins/register-client-form-field.model.ts b/shared/models/plugins/register-client-form-field.model.ts index df24339c6..ec333e8d6 100644 --- a/shared/models/plugins/register-client-form-field.model.ts +++ b/shared/models/plugins/register-client-form-field.model.ts @@ -3,6 +3,8 @@ export interface RegisterClientFormFieldOptions { label: string type: 'input' | 'input-checkbox' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' + descriptionHTML?: string + // Default setting value default?: string | boolean } -- 2.41.0