]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Add ability to set a description to dynamic fields
authorChocobozzz <me@florianbigard.com>
Fri, 21 Aug 2020 12:45:57 +0000 (14:45 +0200)
committerChocobozzz <chocobozzz@cpy.re>
Fri, 21 Aug 2020 13:39:51 +0000 (15:39 +0200)
client/src/app/+videos/+video-watch/video-watch.component.ts
client/src/app/shared/shared-forms/dynamic-form-field.component.html
client/src/app/shared/shared-forms/dynamic-form-field.component.scss
client/src/standalone/videos/embed.ts
shared/models/plugins/register-client-form-field.model.ts

index 0a61227a8928724e6457cd757a43361322ccca53..1b282081057945bf239e07f854bb6c5707ab481d 100644 (file)
@@ -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()
index c111ea7df354c3fc0956af46558696e6a4adc9c8..17b4a134fe400e183ffebff25e7763896028799f 100644 (file)
@@ -1,6 +1,8 @@
 <div [formGroup]="form">
   <label *ngIf="setting.type !== 'input-checkbox'" [attr.for]="setting.name" [innerHTML]="setting.label"></label>
 
+  <div *ngIf="setting.descriptionHTML" class="label-small-info" [innerHTML]="setting.descriptionHTML"></div>
+
   <input *ngIf="setting.type === 'input'" type="text" [id]="setting.name" [formControlName]="setting.name" />
 
   <textarea *ngIf="setting.type === 'input-textarea'" type="text" [id]="setting.name" [formControlName]="setting.name"></textarea>
index 70b3cf6c3356410c81217fe273578583af1475a3..89193ed8587655daeb04fbf625b843c234b710f9 100644 (file)
@@ -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;
+}
index af98a1561d1bce848888a993008418975d7eeb82..995e8c27781b4df05080751555d72ed6967dae18 100644 (file)
@@ -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 () {
index df24339c6de695950c3f624b0f6e36893944d8b0..ec333e8d69d6ac133ef01977efb53b023e804499 100644 (file)
@@ -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
 }