]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/videos/+video-watch/modal/video-support.component.ts
Slightly more personal support modal
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / +video-watch / modal / video-support.component.ts
1 import { Component, Input, ViewChild } from '@angular/core'
2 import { VideoDetails } from '../../../shared/video/video-details.model'
3 import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
4 import { MarkdownService } from '@app/shared/renderer'
5 import { User } from '@app/shared'
6
7 @Component({
8 selector: 'my-video-support',
9 templateUrl: './video-support.component.html',
10 styleUrls: [ './video-support.component.scss' ]
11 })
12 export class VideoSupportComponent {
13 @Input() video: VideoDetails = null
14 @Input() user: User = null
15
16 @ViewChild('modal', { static: true }) modal: NgbModal
17
18 videoHTMLSupport = ''
19
20 constructor (
21 private markdownService: MarkdownService,
22 private modalService: NgbModal
23 ) { }
24
25 show () {
26 this.modalService.open(this.modal)
27
28 this.markdownService.enhancedMarkdownToHTML(this.video.support)
29 .then(r => this.videoHTMLSupport = r)
30 }
31 }