Add ability to set a description to dynamic fields

pull/3105/head
Chocobozzz 2020-08-21 14:45:57 +02:00 committed by Chocobozzz
parent 365783532e
commit 781ba98126
5 changed files with 12 additions and 2 deletions

View 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()

View 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>

View 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;
}

View 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 () {

View 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
}